mirror of
https://github.com/golang/go
synced 2024-11-21 14:44:40 -07:00
image/draw: add an Op argument to Draw.
R=r CC=golang-dev https://golang.org/cl/4622041
This commit is contained in:
parent
7fd51f2fb4
commit
9555ea7a5b
@ -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
|
||||
|
@ -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))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user