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

Unified Diff: src/core/SkPictureRecord.h

Issue 324293004: Remove picture pre-allocation from SkPictureRecorder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: cleanup 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
Index: src/core/SkPictureRecord.h
diff --git a/src/core/SkPictureRecord.h b/src/core/SkPictureRecord.h
index d6cdf05f28ce9bbc314750d890b2d2e7ae6a818d..b4920e37bb3e1a47801493e53ae5b7111392da0a 100644
--- a/src/core/SkPictureRecord.h
+++ b/src/core/SkPictureRecord.h
@@ -15,6 +15,7 @@
#endif
#include "SkPathHeap.h"
#include "SkPicture.h"
+#include "SkPicturePlayback.h"
#include "SkPictureFlat.h"
#include "SkTemplates.h"
#include "SkWriter32.h"
@@ -33,7 +34,7 @@ class SkPictureStateTree;
class SkPictureRecord : public SkCanvas {
public:
- SkPictureRecord(SkPicture* picture, const SkISize& dimensions, uint32_t recordFlags);
+ SkPictureRecord(const SkISize& dimensions, uint32_t recordFlags);
virtual ~SkPictureRecord();
virtual void clear(SkColor) SK_OVERRIDE;
@@ -73,6 +74,28 @@ public:
return fPictureRefs;
}
+ SkData* opData(bool deepCopy) const {
+ this->validate(fWriter.bytesWritten(), 0);
mtklein 2014/06/11 15:30:21 Isn't this a tautology? It expands to SkASSERT(fW
robertphillips 2014/06/11 17:06:50 It expands to more if one defines SK_DEBUG_VALIDAT
+
+ if (fWriter.bytesWritten() == 0) {
+ return SkData::NewEmpty();
+ }
+
+ if (deepCopy) {
+ return SkData::NewWithCopy(fWriter.contiguousArray(), fWriter.bytesWritten());
+ }
+
+ return fWriter.snapshotAsData();
+ }
+
+ SkPathHeap* pathHeap() {
+ return fPathHeap;
+ }
+
+ const SkPictureContentInfo& contentInfo() const {
+ return fContentInfo;
+ }
+
void setFlags(uint32_t recordFlags) {
fRecordFlags = recordFlags;
}
@@ -283,12 +306,12 @@ protected:
SkBitmapHeap* fBitmapHeap;
private:
- // The owning SkPicture
- SkPicture* fPicture;
-
friend class MatrixClipState; // for access to *Impl methods
friend class SkMatrixClipStateMgr; // for access to *Impl methods
+ SkPictureContentInfo fContentInfo;
+ SkAutoTUnref<SkPathHeap> fPathHeap;
+
SkChunkFlatController fFlattenableHeap;
SkPaintDictionary fPaints;

Powered by Google App Engine
This is Rietveld 408576698