aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
authorGravatar djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-07-27 15:58:23 +0000
committerGravatar djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-07-27 15:58:23 +0000
commit7dade42e6f2e35dd27b4090fd7894322d755d4db (patch)
tree0581859868d08ff07cbf44fb0a6477b445073373 /include/core
parent1c6d64b78b24083ee9fd7411dac8a4a7e2d03a3c (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 'include/core')
-rw-r--r--include/core/SkPicture.h16
1 files changed, 1 insertions, 15 deletions
diff --git a/include/core/SkPicture.h b/include/core/SkPicture.h
index 976c594cad..dae7ed7829 100644
--- a/include/core/SkPicture.h
+++ b/include/core/SkPicture.h
@@ -58,16 +58,7 @@ public:
clip-query calls will reflect the path's bounds, not the actual
path.
*/
- kUsePathBoundsForClip_RecordingFlag = 0x01,
-
- /* When a draw operation is recorded that has a bitmap parameter, it
- may be unsafe to defer rendering if source bitmap may be written to
- between the time of recording and the time of executing the draw
- operation. This flag specifies that SkPicture should serialize a
- snapshot of any source bitmaps that reside in RAM and are not
- marked as immutable, making the draw operation safe for deferral.
- */
- kFlattenMutableNonTexturePixelRefs_RecordingFlag = 0x02
+ kUsePathBoundsForClip_RecordingFlag = 0x01
};
/** Returns the canvas that records the drawing commands.
@@ -96,11 +87,6 @@ public:
*/
bool hasRecorded() const;
- /** Returns true if a snapshot of the specified bitmap will be flattened
- whaen a draw operation using the bitmap is recorded.
- */
- bool willFlattenPixelsOnRecord(const SkBitmap&) const;
-
/** Replays the drawing commands on the specified canvas. This internally
calls endRecording() if that has not already been called.
@param surface the canvas receiving the drawing commands.