diff options
author | djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-07-27 15:58:23 +0000 |
---|---|---|
committer | djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-07-27 15:58:23 +0000 |
commit | 7dade42e6f2e35dd27b4090fd7894322d755d4db (patch) | |
tree | 0581859868d08ff07cbf44fb0a6477b445073373 /src/utils | |
parent | 1c6d64b78b24083ee9fd7411dac8a4a7e2d03a3c (diff) |
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
Review URL: https://codereview.appspot.com/6439043
git-svn-id: http://skia.googlecode.com/svn/trunk@4809 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/SkDeferredCanvas.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/utils/SkDeferredCanvas.cpp b/src/utils/SkDeferredCanvas.cpp index c5a21831d4..47e551ef5d 100644 --- a/src/utils/SkDeferredCanvas.cpp +++ b/src/utils/SkDeferredCanvas.cpp @@ -576,8 +576,7 @@ void SkDeferredCanvas::DeferredDevice::beginRecording() { fRecordingCanvas = fPipeWriter.startRecording(&fPipeController, 0); #else fRecordingCanvas = fPicture.beginRecording(fImmediateDevice->width(), - fImmediateDevice->height(), - SkPicture::kFlattenMutableNonTexturePixelRefs_RecordingFlag); + fImmediateDevice->height()); #endif } |