Chromium Code Reviews| 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 SkPictureRangePlayback(const SkPicture* picture) | |
| 22 : INHERITED(picture) | |
| 23 , fStart(0) | |
| 24 , fStop(0) { | |
| 25 } | |
| 26 | |
| 27 virtual void draw(SkCanvas* canvas, SkDrawPictureCallback*) SK_OVERRIDE; | |
| 28 | |
| 29 // Limit the opcode playback to be between the offsets 'start' and 'stop'. | |
| 30 // Set both start & stop to 0 to disable draw limiting. Note that disabling | |
| 31 // draw limiting isn't the same as using the base SkPicturePlayback object | |
| 32 // since this class never uses the bounding box hierarchy information. | |
| 33 void setDrawLimits(size_t start, size_t stop) { | |
|
mtklein
2014/07/08 14:31:57
As used, looks like you can eliminate this and set
robertphillips
2014/07/08 14:38:33
Done.
| |
| 34 fStart = start; | |
| 35 fStop = stop; | |
| 36 } | |
| 37 | |
| 38 private: | |
| 39 size_t fStart; | |
| 40 size_t fStop; | |
| 41 | |
| 42 typedef SkPicturePlayback INHERITED; | |
| 43 }; | |
| 44 | |
| 45 | |
| 46 #endif | |
| OLD | NEW |