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

Unified Diff: include/core/SkPictureRecorder.h

Issue 331573004: Add EXPERIMENTAL_beginRecording() for SkRecord-based recording. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: put back Created 6 years, 6 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 | « gyp/tools.gyp ('k') | src/core/SkPictureRecorder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkPictureRecorder.h
diff --git a/include/core/SkPictureRecorder.h b/include/core/SkPictureRecorder.h
index 8d29ff36daa310bcfbb3d3b0f3d9980a702d0dac..b13b8a809b21695e3c9ce86e73712120c572465b 100644
--- a/include/core/SkPictureRecorder.h
+++ b/include/core/SkPictureRecorder.h
@@ -14,10 +14,12 @@
class SkCanvas;
class SkPictureRecord;
+class SkRecord;
+class SkRecorder;
class SK_API SkPictureRecorder : SkNoncopyable {
public:
- SkPictureRecorder() : fCanvas(NULL) { }
+ SkPictureRecorder() : fPictureRecord(NULL), fRecorder(NULL), fRecord(NULL) { }
~SkPictureRecorder();
/** Returns the canvas that records the drawing commands.
@@ -33,6 +35,10 @@ public:
SkBBHFactory* bbhFactory = NULL,
uint32_t recordFlags = 0);
+ /** Same as beginRecording(), using a new faster backend. */
+ SkCanvas* EXPERIMENTAL_beginRecording(int width, int height,
+ SkBBHFactory* bbhFactory = NULL);
+
/** Returns the recording canvas if one is active, or NULL if recording is
not active. This does not alter the refcnt on the canvas (if present).
*/
@@ -54,6 +60,8 @@ public:
void internalOnly_EnableOpts(bool enableOpts);
private:
+ void reset();
+
/** Replay the current (partially recorded) operation stream into
canvas. This call doesn't close the current recording.
*/
@@ -63,7 +71,13 @@ private:
int fWidth;
int fHeight;
- SkPictureRecord* fCanvas; // ref counted
+
+ // Both ref counted. One of these two will be non-null:
+ SkPictureRecord* fPictureRecord; // beginRecording()
+ SkRecorder* fRecorder; // EXPERIMENTAL_beginRecording()
+
+ // Not refcounted. Used by EXPERIMENTAL_beginRecording().
+ SkRecord* fRecord;
typedef SkNoncopyable INHERITED;
};
« no previous file with comments | « gyp/tools.gyp ('k') | src/core/SkPictureRecorder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698