aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPictureData.h
diff options
context:
space:
mode:
authorGravatar msarett <msarett@google.com>2016-04-27 13:51:20 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-04-27 13:51:20 -0700
commit95416f477d2ca264f2fb065455e95778a2289a1d (patch)
tree41aa18dccbe6e45d771abb4256b850c1ffb09bdd /src/core/SkPictureData.h
parent80f5ea02cf69096e00b8fe01fe54375a9387c9d9 (diff)
Enable flattening of SkRecordedDrawable
Diffstat (limited to 'src/core/SkPictureData.h')
-rw-r--r--src/core/SkPictureData.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/SkPictureData.h b/src/core/SkPictureData.h
index dbb117ef14..4870305de4 100644
--- a/src/core/SkPictureData.h
+++ b/src/core/SkPictureData.h
@@ -9,6 +9,7 @@
#define SkPictureData_DEFINED
#include "SkBitmap.h"
+#include "SkDrawable.h"
#include "SkPicture.h"
#include "SkPictureContentInfo.h"
#include "SkPictureFlat.h"
@@ -43,6 +44,7 @@ struct SkPictInfo {
#define SK_PICT_FACTORY_TAG SkSetFourByteTag('f', 'a', 'c', 't')
#define SK_PICT_TYPEFACE_TAG SkSetFourByteTag('t', 'p', 'f', 'c')
#define SK_PICT_PICTURE_TAG SkSetFourByteTag('p', 'c', 't', 'r')
+#define SK_PICT_DRAWABLE_TAG SkSetFourByteTag('d', 'r', 'a', 'w')
// This tag specifies the size of the ReadBuffer, needed for the following tags
#define SK_PICT_BUFFER_SIZE_TAG SkSetFourByteTag('a', 'r', 'a', 'y')
@@ -107,6 +109,12 @@ public:
return reader->validateIndex(index, fPictureCount) ? fPictureRefs[index] : nullptr;
}
+ SkDrawable* getDrawable(SkReadBuffer* reader) const {
+ int index = reader->readInt();
+ SkASSERT(index > 0 && index <= fDrawableCount);
+ return fDrawableRefs[index - 1];
+ }
+
const SkPaint* getPaint(SkReadBuffer* reader) const {
const int index = reader->readInt() - 1;
return reader->validateIndex(index, fPaints.count()) ? &fPaints[index] : nullptr;
@@ -160,6 +168,8 @@ private:
const SkPicture** fPictureRefs;
int fPictureCount;
+ SkDrawable** fDrawableRefs;
+ int fDrawableCount;
const SkTextBlob** fTextBlobRefs;
int fTextBlobCount;
const SkImage** fImageRefs;