OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright 2014 Google Inc. |
| 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. |
| 6 */ |
| 7 |
| 8 #ifndef SkPictureRangePlayback_DEFINED |
| 9 #define SkPictureRangePlayback_DEFINED |
| 10 |
| 11 #include "SkPicturePlayback.h" |
| 12 |
| 13 // This version of picture playback plays all the operations between |
| 14 // a pair of start and stop values. |
| 15 // The opcode at 'start' should be a saveLayer while the opcode at |
| 16 // 'stop' should be a restore. Neither of those commands will be issued. |
| 17 // Since this class never uses the bounding box hierarchy, the base class' |
| 18 // useBBH setting is ignored. |
| 19 class SkPictureRangePlayback : public SkPicturePlayback { |
| 20 public: |
| 21 // Set both start & stop to 0 to disable draw limiting. Note that disabling |
| 22 // draw limiting isn't the same as using the base SkPicturePlayback object |
| 23 // since this class never uses the bounding box hierarchy information. |
| 24 SkPictureRangePlayback(const SkPicture* picture, size_t start, size_t stop) |
| 25 : INHERITED(picture) |
| 26 , fStart(start) |
| 27 , fStop(stop) { |
| 28 } |
| 29 |
| 30 virtual void draw(SkCanvas* canvas, SkDrawPictureCallback*) SK_OVERRIDE; |
| 31 |
| 32 private: |
| 33 size_t fStart; |
| 34 size_t fStop; |
| 35 |
| 36 typedef SkPicturePlayback INHERITED; |
| 37 }; |
| 38 |
| 39 |
| 40 #endif |
OLD | NEW |