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

Unified Diff: src/core/SkRecordDraw.h

Issue 732653004: option to return drawable from recording (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month 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/core/SkRecord.h ('k') | src/core/SkRecordDraw.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkRecordDraw.h
diff --git a/src/core/SkRecordDraw.h b/src/core/SkRecordDraw.h
index 8ea1bbd72fdc79e9fc63b488f31ba917512a4729..e95123bbe6ebcd0d2994cfc7468329062d1d3d76 100644
--- a/src/core/SkRecordDraw.h
+++ b/src/core/SkRecordDraw.h
@@ -14,16 +14,19 @@
#include "SkMatrix.h"
#include "SkRecord.h"
+class SkCanvasDrawable;
class SkLayerInfo;
// Fill a BBH to be used by SkRecordDraw to accelerate playback.
void SkRecordFillBounds(const SkRect& cullRect, const SkRecord&, SkBBoxHierarchy*);
void SkRecordComputeLayers(const SkRect& cullRect, const SkRecord& record,
+ const SkPicture::SnapshotArray*,
SkBBoxHierarchy* bbh, SkLayerInfo* data);
// Draw an SkRecord into an SkCanvas. A convenience wrapper around SkRecords::Draw.
-void SkRecordDraw(const SkRecord&, SkCanvas*, SkPicture const* const drawablePicts[], int drawableCount,
+void SkRecordDraw(const SkRecord&, SkCanvas*, SkPicture const* const drawablePicts[],
+ SkCanvasDrawable* const drawables[], int drawableCount,
const SkBBoxHierarchy*, SkDrawPictureCallback*);
// Draw a portion of an SkRecord into an SkCanvas while replacing clears with drawRects.
@@ -41,11 +44,13 @@ namespace SkRecords {
// This is an SkRecord visitor that will draw that SkRecord to an SkCanvas.
class Draw : SkNoncopyable {
public:
- explicit Draw(SkCanvas* canvas, SkPicture const* const drawablePicts[], int drawableCount,
+ explicit Draw(SkCanvas* canvas, SkPicture const* const drawablePicts[],
+ SkCanvasDrawable* const drawables[], int drawableCount,
const SkMatrix* initialCTM = NULL)
: fInitialCTM(initialCTM ? *initialCTM : canvas->getTotalMatrix())
, fCanvas(canvas)
, fDrawablePicts(drawablePicts)
+ , fDrawables(drawables)
, fDrawableCount(drawableCount)
{}
@@ -67,6 +72,7 @@ private:
const SkMatrix fInitialCTM;
SkCanvas* fCanvas;
SkPicture const* const* fDrawablePicts;
+ SkCanvasDrawable* const* fDrawables;
int fDrawableCount;
};
@@ -75,7 +81,8 @@ class PartialDraw : public Draw {
public:
PartialDraw(SkCanvas* canvas, SkPicture const* const drawablePicts[], int drawableCount,
const SkRect& clearRect, const SkMatrix& initialCTM)
- : INHERITED(canvas, drawablePicts, drawableCount, &initialCTM), fClearRect(clearRect) {}
+ : INHERITED(canvas, drawablePicts, NULL, drawableCount, &initialCTM), fClearRect(clearRect)
+ {}
// Same as Draw for all ops except Clear.
template <typename T> void operator()(const T& r) {
« no previous file with comments | « src/core/SkRecord.h ('k') | src/core/SkRecordDraw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698