Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1306)

Unified Diff: src/record/SkRecorder.h

Issue 231653002: SkRecordDraw: skip draw ops when the clip is empty (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: pop cull unconditionally Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/record/SkRecordDraw.cpp ('k') | src/record/SkRecorder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
};
« no previous file with comments | « src/record/SkRecordDraw.cpp ('k') | src/record/SkRecorder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698