aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar junov@chromium.org <junov@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-09-20 19:35:43 +0000
committerGravatar junov@chromium.org <junov@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-09-20 19:35:43 +0000
commitfb10389403cf1cc771e103016207fde84c5f4825 (patch)
tree8cd372eadb4eaa6f7b82cf5360ba03e1b58fb08d /include
parent84d320e258bb99ab7b5435f9954d3fbdd45e90f9 (diff)
Adding a silent playback option to SkGPipeRead
Testing state consistency after silent playback in CanvasTest indirectly through SkDeferredCanvas. BUG=http://code.google.com/p/chromium/issues/detail?id=146178 TEST=CanvasTest unit test, and bench with --mode deferredSilent Review URL: https://codereview.appspot.com/6542047 git-svn-id: http://skia.googlecode.com/svn/trunk@5619 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r--include/pipe/SkGPipe.h9
-rw-r--r--include/utils/SkDeferredCanvas.h5
2 files changed, 12 insertions, 2 deletions
diff --git a/include/pipe/SkGPipe.h b/include/pipe/SkGPipe.h
index f1fc4b0ede..27af16db8c 100644
--- a/include/pipe/SkGPipe.h
+++ b/include/pipe/SkGPipe.h
@@ -34,11 +34,16 @@ public:
kReadAtom_Status//!< finished reading an atom
};
+ enum PlaybackFlags {
+ kReadAtom_PlaybackFlag = 0x1, //!< playback a single command from the stream
+ kSilent_PlaybackFlag = 0x2, //!< playback without drawing
+ };
+
void setCanvas(SkCanvas*);
// data must be 4-byte aligned
// length must be a multiple of 4
- Status playback(const void* data, size_t length, size_t* bytesRead = NULL,
- bool readAtom = false);
+ Status playback(const void* data, size_t length, uint32_t playbackFlags = 0,
+ size_t* bytesRead = NULL);
private:
SkCanvas* fCanvas;
class SkGPipeState* fState;
diff --git a/include/utils/SkDeferredCanvas.h b/include/utils/SkDeferredCanvas.h
index 5e8920024a..f3005b322b 100644
--- a/include/utils/SkDeferredCanvas.h
+++ b/include/utils/SkDeferredCanvas.h
@@ -109,6 +109,11 @@ public:
*/
size_t freeMemoryIfPossible(size_t bytesToFree);
+ /**
+ * Executes all pending commands without drawing
+ */
+ void silentFlush();
+
// Overrides of the SkCanvas interface
virtual int save(SaveFlags flags) SK_OVERRIDE;
virtual int saveLayer(const SkRect* bounds, const SkPaint* paint,