From 7dade42e6f2e35dd27b4090fd7894322d755d4db Mon Sep 17 00:00:00 2001 From: "djsollen@google.com" Date: Fri, 27 Jul 2012 15:58:23 +0000 Subject: 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 --- src/utils/SkDeferredCanvas.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/utils') 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 } -- cgit v1.2.3