aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPictureData.h
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2014-07-10 09:35:12 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-07-10 09:35:12 -0700
commit6142609b22814283210f79d698182b651a93136c (patch)
treed49bde0884bf278b41be4c85b1c985fa290f386e /src/core/SkPictureData.h
parentfd429991e99d18cbb956f91b7c347440b39684c1 (diff)
Cleanup SkPicture* classes a bit
This is an attempt to reduce the number of friends the various SkPicture* classes have. Probably the only controversial part is making getBitmap, getPath, getPicture and getPaint public on SkPictureData (and adding a new initIterator entry point). R=mtklein@google.com, reed@google.com Author: robertphillips@google.com Review URL: https://codereview.chromium.org/384753004
Diffstat (limited to 'src/core/SkPictureData.h')
-rw-r--r--src/core/SkPictureData.h23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/core/SkPictureData.h b/src/core/SkPictureData.h
index efae974840..e4ee86ab8f 100644
--- a/src/core/SkPictureData.h
+++ b/src/core/SkPictureData.h
@@ -12,6 +12,7 @@
#include "SkPathHeap.h"
#include "SkPicture.h"
#include "SkPictureFlat.h"
+#include "SkPictureStateTree.h"
class SkData;
class SkPictureRecord;
@@ -24,7 +25,6 @@ class SkPaint;
class SkPath;
class SkPictureStateTree;
class SkReadBuffer;
-class SkRegion;
struct SkPictInfo {
enum Flags {
@@ -160,8 +160,7 @@ protected:
bool parseStream(SkStream*, SkPicture::InstallPixelRefProc);
bool parseBuffer(SkReadBuffer& buffer);
-private:
-
+public:
const SkBitmap& getBitmap(SkReader32* reader) const {
const int index = reader->readInt();
if (SkBitmapHeap::INVALID_SLOT == index) {
@@ -192,10 +191,15 @@ private:
return &(*fPaints)[index - 1];
}
- void init();
+ void initIterator(SkPictureStateTree::Iterator* iter,
+ const SkTDArray<void*>& draws,
+ SkCanvas* canvas) const {
+ if (NULL != fStateTree) {
+ fStateTree->initIterator(iter, draws, canvas);
+ }
+ }
#ifdef SK_DEBUG_SIZE
-public:
int size(size_t* sizePtr);
int bitmaps(size_t* size);
int paints(size_t* size);
@@ -241,15 +245,14 @@ public:
GrPixelConfig config, SkScalar dpi) const;
#endif
-private: // these help us with reading/writing
+private:
+ void init();
+
+ // these help us with reading/writing
bool parseStreamTag(SkStream*, uint32_t tag, uint32_t size, SkPicture::InstallPixelRefProc);
bool parseBufferTag(SkReadBuffer&, uint32_t tag, uint32_t size);
void flattenToBuffer(SkWriteBuffer&) const;
-private:
- friend class SkPicture;
- friend class SkPicturePlayback;
-
// Only used by getBitmap() if the passed in index is SkBitmapHeap::INVALID_SLOT. This empty
// bitmap allows playback to draw nothing and move on.
SkBitmap fBadBitmap;