draw: generate code for op == Over.

This change just does the mechanical codegen for the op == Over cases.
The actual compositing operator is still effectively Src. Fixing that,
which is less mechanical, will be a follow-up change.

Change-Id: I87805114d49e7ce7087066187a2f4c722a883c01
Reviewed-on: https://go-review.googlesource.com/8524
Reviewed-by: Rob Pike <r@golang.org>
This commit is contained in:
Nigel Tao 2015-04-07 16:22:05 +10:00
parent b293696c81
commit 65a798f031
2 changed files with 4004 additions and 9 deletions

View File

@ -71,7 +71,7 @@ var (
"420",
"440",
}
ops = []string{"Src"} // TODO: add "Over".
ops = []string{"Over", "Src"}
)
func init() {
@ -273,6 +273,7 @@ func expnDollar(prefix, dollar, suffix string, d *data) string {
}
case "outputu":
// TODO: handle op==Over, not just op==Src.
args, _ := splitArgs(suffix)
if len(args) != 3 {
return ""
@ -345,6 +346,7 @@ func expnDollar(prefix, dollar, suffix string, d *data) string {
}
case "outputf":
// TODO: handle op==Over, not just op==Src.
args, _ := splitArgs(suffix)
if len(args) != 5 {
return ""
@ -749,7 +751,7 @@ const (
if !sr.In(src.Bounds()) {
switch opts.op() {
case Over:
// TODO: z.scale_Image_Image_Over(dst, dr, adr, src, sr)
z.scale_Image_Image_Over(dst, dr, adr, src, sr)
case Src:
z.scale_Image_Image_Src(dst, dr, adr, src, sr)
}
@ -788,7 +790,7 @@ const (
if !sr.In(src.Bounds()) {
switch opts.op() {
case Over:
// TODO: z.transform_Image_Image_Over(dst, dr, adr, &d2s, src, sr, bias)
z.transform_Image_Image_Over(dst, dr, adr, &d2s, src, sr, bias)
case Src:
z.transform_Image_Image_Src(dst, dr, adr, &d2s, src, sr, bias)
}
@ -1032,7 +1034,7 @@ const (
if !sr.In(src.Bounds()) {
switch opts.op() {
case Over:
// TODO: q.transform_Image_Image_Over(dst, dr, adr, &d2s, src, sr, bias, xscale, yscale)
q.transform_Image_Image_Over(dst, dr, adr, &d2s, src, sr, bias, xscale, yscale)
case Src:
q.transform_Image_Image_Src(dst, dr, adr, &d2s, src, sr, bias, xscale, yscale)
}

File diff suppressed because it is too large Load Diff