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