aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPictureRangePlayback.h
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2014-07-08 08:28:08 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-07-08 08:28:08 -0700
commit1ad00e4b245d464c16ba78bdaa377281f29972cd (patch)
tree06a227ada11ef57eb124a79c9484d36c09aa1775 /src/core/SkPictureRangePlayback.h
parent55fad7af61c21d502acb9891d631e8aa29e3628c (diff)
Split SkPictureRangePlayback out of SkPicturePlayback
This CL starts cleaning up SkPicturePlayback. Future CLs will: split out the SkPictureReplacementPlayback remove the preDraw/postDraw entry points & fix up SkPictureTimedPlayback R=mtklein@google.com, reed@google.com Author: robertphillips@google.com Review URL: https://codereview.chromium.org/374833006
Diffstat (limited to 'src/core/SkPictureRangePlayback.h')
-rw-r--r--src/core/SkPictureRangePlayback.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/core/SkPictureRangePlayback.h b/src/core/SkPictureRangePlayback.h
new file mode 100644
index 0000000000..61d10f5d92
--- /dev/null
+++ b/src/core/SkPictureRangePlayback.h
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2014 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef SkPictureRangePlayback_DEFINED
+#define SkPictureRangePlayback_DEFINED
+
+#include "SkPicturePlayback.h"
+
+// This version of picture playback plays all the operations between
+// a pair of start and stop values.
+// The opcode at 'start' should be a saveLayer while the opcode at
+// 'stop' should be a restore. Neither of those commands will be issued.
+// Since this class never uses the bounding box hierarchy, the base class'
+// useBBH setting is ignored.
+class SkPictureRangePlayback : public SkPicturePlayback {
+public:
+ // Set both start & stop to 0 to disable draw limiting. Note that disabling
+ // draw limiting isn't the same as using the base SkPicturePlayback object
+ // since this class never uses the bounding box hierarchy information.
+ SkPictureRangePlayback(const SkPicture* picture, size_t start, size_t stop)
+ : INHERITED(picture)
+ , fStart(start)
+ , fStop(stop) {
+ }
+
+ virtual void draw(SkCanvas* canvas, SkDrawPictureCallback*) SK_OVERRIDE;
+
+private:
+ size_t fStart;
+ size_t fStop;
+
+ typedef SkPicturePlayback INHERITED;
+};
+
+
+#endif