Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(522)

Issue 6501140: Change drawBitmapRect to take a float-src-rect instead of integer-src-rect. This (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 2 months ago by reed1
Modified:
12 years, 2 months ago
Reviewers:
DerekS, Leon, bsalomon
CC:
skia-review_googlegroups.com
Base URL:
http://skia.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Change drawBitmapRect to take a float-src-rect instead of integer-src-rect. This allows the client more control over the scaling. Because of virtual overrides and wanting to keep the old call-sites up and running, this CL renames the virtual entry-point to drawBitmapRectToRect, and downgrades drawBitmapRect to a non-virtual helper function. The implementation is to use the float-rect for computing the matrix, but still cons-up an integer rect for the purposes of subsetting the original bitmap. We do this by calling float_src->roundOut(&int_src) so that we include all (partially) covered src pixels. No change needed on SkDevice, since that signature is explicitly passed the computed matrix. Committed: https://code.google.com/p/skia/source/detail?r=5578

Patch Set 1 #

Total comments: 3

Patch Set 2 : #

Patch Set 3 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+202 lines, -81 lines) Patch
M debugger/SkDebugCanvas.h View 1 1 chunk +2 lines, -2 lines 0 comments Download
M debugger/SkDebugCanvas.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M debugger/SkDrawCommand.h View 1 chunk +2 lines, -2 lines 0 comments Download
M debugger/SkDrawCommand.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
A gm/bitmaprect.cpp View 1 2 1 chunk +100 lines, -0 lines 0 comments Download
M gyp/gmslides.gypi View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M include/core/SkCanvas.h View 1 2 chunks +20 lines, -3 lines 0 comments Download
M include/utils/SkDeferredCanvas.h View 1 chunk +1 line, -1 line 0 comments Download
M include/utils/SkDumpCanvas.h View 1 chunk +1 line, -1 line 0 comments Download
M include/utils/SkNWayCanvas.h View 1 chunk +1 line, -1 line 0 comments Download
M include/utils/SkProxyCanvas.h View 1 chunk +1 line, -1 line 0 comments Download
M src/core/SkBBoxRecord.h View 1 chunk +1 line, -1 line 0 comments Download
M src/core/SkBBoxRecord.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M src/core/SkCanvas.cpp View 4 chunks +36 lines, -31 lines 0 comments Download
M src/core/SkPicture.cpp View 1 chunk +2 lines, -1 line 0 comments Download
M src/core/SkPictureFlat.h View 1 chunk +1 line, -1 line 0 comments Download
M src/core/SkPicturePlayback.cpp View 1 chunk +3 lines, -3 lines 0 comments Download
M src/core/SkPictureRecord.h View 1 chunk +2 lines, -2 lines 0 comments Download
M src/core/SkPictureRecord.cpp View 1 chunk +3 lines, -3 lines 0 comments Download
M src/pipe/SkGPipePriv.h View 1 chunk +1 line, -1 line 0 comments Download
M src/pipe/SkGPipeWrite.cpp View 3 chunks +4 lines, -7 lines 0 comments Download
M src/utils/SkDeferredCanvas.cpp View 2 chunks +5 lines, -5 lines 0 comments Download
M src/utils/SkDumpCanvas.cpp View 1 chunk +5 lines, -5 lines 0 comments Download
M src/utils/SkNWayCanvas.cpp View 1 chunk +2 lines, -2 lines 0 comments Download
M src/utils/SkProxyCanvas.cpp View 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 9
reed1
12 years, 2 months ago (2012-09-17 14:44:55 UTC) #1
reed1
key changes are SkCanvas.[h,cpp] the bulk of the rest are just renamings
12 years, 2 months ago (2012-09-17 14:45:43 UTC) #2
Leon
https://codereview.appspot.com/6501140/diff/1/debugger/SkDebugCanvas.h File debugger/SkDebugCanvas.h (right): https://codereview.appspot.com/6501140/diff/1/debugger/SkDebugCanvas.h#newcode196 debugger/SkDebugCanvas.h:196: virtual void onDrawBitmapRect(const SkBitmap&, const SkRect* src, Do you ...
12 years, 2 months ago (2012-09-17 15:20:34 UTC) #3
reed1
right on both counts. uploaded fixes.
12 years, 2 months ago (2012-09-17 16:18:32 UTC) #4
Leon
On 2012/09/17 16:18:32, reed1 wrote: > right on both counts. uploaded fixes. lgtm
12 years, 2 months ago (2012-09-17 16:42:28 UTC) #5
bsalomon
https://codereview.appspot.com/6501140/diff/1/debugger/SkDrawCommand.cpp File debugger/SkDrawCommand.cpp (right): https://codereview.appspot.com/6501140/diff/1/debugger/SkDrawCommand.cpp#newcode183 debugger/SkDrawCommand.cpp:183: DrawBitmapRect::DrawBitmapRect(const SkBitmap& bitmap, const SkRect* src, Should this class ...
12 years, 2 months ago (2012-09-17 17:08:25 UTC) #6
bsalomon
New GM?
12 years, 2 months ago (2012-09-17 17:08:45 UTC) #7
reed1
add new gm (for both versions)
12 years, 2 months ago (2012-09-17 17:30:24 UTC) #8
bsalomon
12 years, 2 months ago (2012-09-17 17:45:54 UTC) #9
On 2012/09/17 17:30:24, reed1 wrote:
> add new gm (for both versions)

lgtm
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b