diff options
author | 2012-08-15 19:49:22 +0000 | |
---|---|---|
committer | 2012-08-15 19:49:22 +0000 | |
commit | a8db8fe39a640bda4b85b9342c3b6b2525142afa (patch) | |
tree | c4f2e091b61c7887e9db5354aa8dbbc812849667 /include/pipe/SkGPipe.h | |
parent | 837d31a0c9351c4d65f5d703ff12db2c7cc5f6cd (diff) |
Fixing a deferred canvas optimization that purges pending draws when the canvas is cleared
It appears that the recording canvas returns a save count of 1 when the save stack is empty.
In order to pass Canvas unit tests when a clear occurs, changes to SkGPipe were necessary
to allow SkDeferredCanvas to set the device bounds on the SkGPipeCanvas. A positive
side effect of this change is that graphics primitives that fall outside of the device
bounds will now always be culled at the recording stage (as opposed playback).
BUG=http://code.google.com/p/skia/issues/detail?id=782
TEST=deferred_canvas_record bench test
Review URL: https://codereview.appspot.com/6454157
git-svn-id: http://skia.googlecode.com/svn/trunk@5117 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/pipe/SkGPipe.h')
-rw-r--r-- | include/pipe/SkGPipe.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/pipe/SkGPipe.h b/include/pipe/SkGPipe.h index 40ab30af7c..bbe504aee6 100644 --- a/include/pipe/SkGPipe.h +++ b/include/pipe/SkGPipe.h @@ -103,7 +103,9 @@ public: kSharedAddressSpace_Flag = 1 << 1 }; - SkCanvas* startRecording(SkGPipeController*, uint32_t flags = 0); + SkCanvas* startRecording(SkGPipeController*, uint32_t flags = 0, + uint32_t width = kDefaultRecordingCanvasSize, + uint32_t height = kDefaultRecordingCanvasSize); // called in destructor, but can be called sooner once you know there // should be no more drawing calls made into the recording canvas. @@ -136,6 +138,10 @@ public: size_t freeMemoryIfPossible(size_t bytesToFree); private: + enum { + kDefaultRecordingCanvasSize = 32767, + }; + SkGPipeCanvas* fCanvas; SkWriter32 fWriter; }; |