| Index: src/record/SkRecorder.h
|
| diff --git a/src/record/SkRecorder.h b/src/record/SkRecorder.h
|
| index bf317f3bef1550a1a1e793763d6488f65f7c9b9b..0f2162f9177db67bcfd9c062081bd4d7c0755a15 100644
|
| --- a/src/record/SkRecorder.h
|
| +++ b/src/record/SkRecorder.h
|
| @@ -9,8 +9,17 @@
|
|
|
| class SkRecorder : public SkCanvas {
|
| public:
|
| + // SkRecorder can work in two modes:
|
| + // write-only: only a core subset of SkCanvas operations (save/restore, clip, transform, draw)
|
| + // are supported, and all of the readback methods on SkCanvas will probably fail or lie.
|
| + //
|
| + // read-write: all methods should behave with similar semantics to SkCanvas.
|
| + //
|
| + // Write-only averages 10-20% faster, but you can't sensibly inspect the canvas while recording.
|
| + enum Mode { kWriteOnly_Mode, kReadWrite_Mode };
|
| +
|
| // Does not take ownership of the SkRecord.
|
| - SkRecorder(SkRecord*, int width, int height);
|
| + SkRecorder(Mode mode, SkRecord*, int width, int height);
|
|
|
| void clear(SkColor) SK_OVERRIDE;
|
| void drawPaint(const SkPaint& paint) SK_OVERRIDE;
|
| @@ -95,6 +104,7 @@ private:
|
| template <typename T>
|
| T* copy(const T[], unsigned count);
|
|
|
| + const Mode fMode;
|
| SkRecord* fRecord;
|
| };
|
|
|
|
|