Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
9555ea7a
Commit
9555ea7a
authored
Jun 16, 2011
by
Nigel Tao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
image/draw: add an Op argument to Draw.
R=r CC=golang-dev
https://golang.org/cl/4622041
parent
7fd51f2f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
draw.go
src/pkg/image/draw/draw.go
+3
-3
draw_test.go
src/pkg/image/draw/draw_test.go
+1
-1
No files found.
src/pkg/image/draw/draw.go
View file @
9555ea7a
...
@@ -34,9 +34,9 @@ type Image interface {
...
@@ -34,9 +34,9 @@ type Image interface {
Set
(
x
,
y
int
,
c
image
.
Color
)
Set
(
x
,
y
int
,
c
image
.
Color
)
}
}
// Draw calls DrawMask with a nil mask
and an Over op
.
// Draw calls DrawMask with a nil mask.
func
Draw
(
dst
Image
,
r
image
.
Rectangle
,
src
image
.
Image
,
sp
image
.
Point
)
{
func
Draw
(
dst
Image
,
r
image
.
Rectangle
,
src
image
.
Image
,
sp
image
.
Point
,
op
Op
)
{
DrawMask
(
dst
,
r
,
src
,
sp
,
nil
,
image
.
ZP
,
Over
)
DrawMask
(
dst
,
r
,
src
,
sp
,
nil
,
image
.
ZP
,
op
)
}
}
// clip clips r against each image's bounds (after translating into the
// clip clips r against each image's bounds (after translating into the
...
...
src/pkg/image/draw/draw_test.go
View file @
9555ea7a
...
@@ -271,7 +271,7 @@ func TestNonZeroSrcPt(t *testing.T) {
...
@@ -271,7 +271,7 @@ func TestNonZeroSrcPt(t *testing.T) {
b
.
Set
(
1
,
0
,
image
.
RGBAColor
{
0
,
0
,
5
,
5
})
b
.
Set
(
1
,
0
,
image
.
RGBAColor
{
0
,
0
,
5
,
5
})
b
.
Set
(
0
,
1
,
image
.
RGBAColor
{
0
,
5
,
0
,
5
})
b
.
Set
(
0
,
1
,
image
.
RGBAColor
{
0
,
5
,
0
,
5
})
b
.
Set
(
1
,
1
,
image
.
RGBAColor
{
5
,
0
,
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
))
{
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
))
t
.
Errorf
(
"non-zero src pt: want %v got %v"
,
image
.
RGBAColor
{
5
,
0
,
0
,
5
},
a
.
At
(
0
,
0
))
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment