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:
parent
b293696c81
commit
65a798f031
10
draw/gen.go
10
draw/gen.go
|
@ -71,7 +71,7 @@ var (
|
||||||
"420",
|
"420",
|
||||||
"440",
|
"440",
|
||||||
}
|
}
|
||||||
ops = []string{"Src"} // TODO: add "Over".
|
ops = []string{"Over", "Src"}
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
@ -273,6 +273,7 @@ func expnDollar(prefix, dollar, suffix string, d *data) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
case "outputu":
|
case "outputu":
|
||||||
|
// TODO: handle op==Over, not just op==Src.
|
||||||
args, _ := splitArgs(suffix)
|
args, _ := splitArgs(suffix)
|
||||||
if len(args) != 3 {
|
if len(args) != 3 {
|
||||||
return ""
|
return ""
|
||||||
|
@ -345,6 +346,7 @@ func expnDollar(prefix, dollar, suffix string, d *data) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
case "outputf":
|
case "outputf":
|
||||||
|
// TODO: handle op==Over, not just op==Src.
|
||||||
args, _ := splitArgs(suffix)
|
args, _ := splitArgs(suffix)
|
||||||
if len(args) != 5 {
|
if len(args) != 5 {
|
||||||
return ""
|
return ""
|
||||||
|
@ -749,7 +751,7 @@ const (
|
||||||
if !sr.In(src.Bounds()) {
|
if !sr.In(src.Bounds()) {
|
||||||
switch opts.op() {
|
switch opts.op() {
|
||||||
case Over:
|
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:
|
case Src:
|
||||||
z.scale_Image_Image_Src(dst, dr, adr, src, sr)
|
z.scale_Image_Image_Src(dst, dr, adr, src, sr)
|
||||||
}
|
}
|
||||||
|
@ -788,7 +790,7 @@ const (
|
||||||
if !sr.In(src.Bounds()) {
|
if !sr.In(src.Bounds()) {
|
||||||
switch opts.op() {
|
switch opts.op() {
|
||||||
case Over:
|
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:
|
case Src:
|
||||||
z.transform_Image_Image_Src(dst, dr, adr, &d2s, src, sr, bias)
|
z.transform_Image_Image_Src(dst, dr, adr, &d2s, src, sr, bias)
|
||||||
}
|
}
|
||||||
|
@ -1032,7 +1034,7 @@ const (
|
||||||
if !sr.In(src.Bounds()) {
|
if !sr.In(src.Bounds()) {
|
||||||
switch opts.op() {
|
switch opts.op() {
|
||||||
case Over:
|
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:
|
case Src:
|
||||||
q.transform_Image_Image_Src(dst, dr, adr, &d2s, src, sr, bias, xscale, yscale)
|
q.transform_Image_Image_Src(dst, dr, adr, &d2s, src, sr, bias, xscale, yscale)
|
||||||
}
|
}
|
||||||
|
|
4003
draw/impl.go
4003
draw/impl.go
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user