]> Cypherpunks repositories - gostls13.git/commitdiff
image/draw: add an Op argument to Draw.
authorNigel Tao <nigeltao@golang.org>
Thu, 16 Jun 2011 01:45:16 +0000 (11:45 +1000)
committerNigel Tao <nigeltao@golang.org>
Thu, 16 Jun 2011 01:45:16 +0000 (11:45 +1000)
R=r
CC=golang-dev
https://golang.org/cl/4622041

src/pkg/image/draw/draw.go
src/pkg/image/draw/draw_test.go

index 618fb4aa6bb89ef1f7a4d81233c26169964c0834..0ab7b59ab754b6438e443ae6a2d251e621e0c586 100644 (file)
@@ -34,9 +34,9 @@ type Image interface {
        Set(x, y int, c image.Color)
 }
 
-// Draw calls DrawMask with a nil mask and an Over op.
-func Draw(dst Image, r image.Rectangle, src image.Image, sp image.Point) {
-       DrawMask(dst, r, src, sp, nil, image.ZP, Over)
+// Draw calls DrawMask with a nil mask.
+func Draw(dst Image, r image.Rectangle, src image.Image, sp image.Point, op Op) {
+       DrawMask(dst, r, src, sp, nil, image.ZP, op)
 }
 
 // clip clips r against each image's bounds (after translating into the
index 37d63035333ca1a450ede07239926c9d7e80ffdf..6db567231e4f6a1e27bafe8ce64cfdef2cc70c26 100644 (file)
@@ -271,7 +271,7 @@ func TestNonZeroSrcPt(t *testing.T) {
        b.Set(1, 0, image.RGBAColor{0, 0, 5, 5})
        b.Set(0, 1, image.RGBAColor{0, 5, 0, 5})
        b.Set(1, 1, image.RGBAColor{5, 0, 0, 5})
-       Draw(a, image.Rect(0, 0, 1, 1), b, image.Pt(1, 1))
+       Draw(a, image.Rect(0, 0, 1, 1), b, image.Pt(1, 1), Over)
        if !eq(image.RGBAColor{5, 0, 0, 5}, a.At(0, 0)) {
                t.Errorf("non-zero src pt: want %v got %v", image.RGBAColor{5, 0, 0, 5}, a.At(0, 0))
        }