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

Issue 6439043: Always store pixels of mutable bitmaps when recording a SkPicture. (Closed)

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

Description

Always store pixels of mutable bitmaps when recording a SkPicture. Prior to this CL mutable bitmaps only saved a copy of their pixels if a flag was set at recording time. That flag has been removed and the default behavior when recording a mutable bitmap is to make a copy of it's pixels. This is the only way to ensure that the pixels are not manipulated before we playback their contents. However, enabling this behavior breaks the recording of extracted bitmaps in SkPicture. This is because we currently cache bitmaps within a picture based only on their pixelRef. This results in false positive cache hit when drawing an extracted bitmap as it shares a pixelRef with its orginating bitmap. Therefore we must update the index of the bitmap cache to be both the pixelRef AND the size and offset of the bitmap using those pixels. BUG= TEST=extractbitmap.cpp Committed: https://code.google.com/p/skia/source/detail?r=4809

Patch Set 1 #

Total comments: 6

Patch Set 2 : remove getter from SkPicture #

Patch Set 3 : remove DeferredCanvas code #

Unified diffs Side-by-side diffs Delta from patch set Stats (+34 lines, -48 lines) Patch
M include/core/SkPicture.h View 1 2 chunks +1 line, -15 lines 0 comments Download
M src/core/SkPicture.cpp View 1 1 chunk +0 lines, -4 lines 0 comments Download
M src/core/SkPictureRecord.h View 1 2 chunks +21 lines, -9 lines 0 comments Download
M src/core/SkPictureRecord.cpp View 1 3 chunks +11 lines, -15 lines 0 comments Download
M src/utils/SkDeferredCanvas.cpp View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M tests/CanvasTest.cpp View 1 chunk +0 lines, -3 lines 0 comments Download

Messages

Total messages: 11
DerekS
12 years, 4 months ago (2012-07-24 20:58:35 UTC) #1
reed1
pipe does this correctly I think. Can we be sharing more code?
12 years, 4 months ago (2012-07-25 12:43:26 UTC) #2
DerekS
On 2012/07/25 12:43:26, reed1 wrote: > pipe does this correctly I think. Can we be ...
12 years, 4 months ago (2012-07-25 12:57:05 UTC) #3
junov1
Actually, the pipe flattens bitmaps if it is cross process, and copies mutable bitmaps when ...
12 years, 4 months ago (2012-07-25 13:04:06 UTC) #4
DerekS
On 2012/07/25 13:04:06, junov1 wrote: > Actually, the pipe flattens bitmaps if it is cross ...
12 years, 4 months ago (2012-07-25 13:25:44 UTC) #5
junov1
http://codereview.appspot.com/6439043/diff/1/src/core/SkPictureRecord.cpp File src/core/SkPictureRecord.cpp (right): http://codereview.appspot.com/6439043/diff/1/src/core/SkPictureRecord.cpp#newcode644 src/core/SkPictureRecord.cpp:644: return !bitmap.isImmutable() && NULL == bitmap.getTexture(); Why check bitmap.getTexture()? ...
12 years, 4 months ago (2012-07-25 13:35:03 UTC) #6
DerekS
http://codereview.appspot.com/6439043/diff/1/src/core/SkPictureRecord.cpp File src/core/SkPictureRecord.cpp (right): http://codereview.appspot.com/6439043/diff/1/src/core/SkPictureRecord.cpp#newcode644 src/core/SkPictureRecord.cpp:644: return !bitmap.isImmutable() && NULL == bitmap.getTexture(); On 2012/07/25 13:35:03, ...
12 years, 4 months ago (2012-07-25 14:01:36 UTC) #7
junov
On Wed, Jul 25, 2012 at 10:01 AM, <djsollen@google.com> wrote: > >> > I talked ...
12 years, 4 months ago (2012-07-25 15:20:45 UTC) #8
DerekS
now that junov has removed the need for the deferred canvas to ask the picture ...
12 years, 4 months ago (2012-07-27 15:08:04 UTC) #9
reed1
if juno agrees, I'm all for removing APIs
12 years, 4 months ago (2012-07-27 15:15:05 UTC) #10
junov1
12 years, 4 months ago (2012-07-27 15:18:18 UTC) #11
On 2012/07/27 15:15:05, reed1 wrote:
> if juno agrees, I'm all for removing APIs

Yep, we're good.
Sign in to reply to this message.

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