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

Unified Diff: src/core/SkPicturePlayback.h

Issue 249453002: First step in pulling SkPicturePlayback & SkPictureRecord out of SkPicture (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: cleanup Created 6 years, 8 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 | « src/core/SkPicture.cpp ('k') | src/core/SkPicturePlayback.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPicturePlayback.h
===================================================================
--- src/core/SkPicturePlayback.h (revision 14323)
+++ src/core/SkPicturePlayback.h (working copy)
@@ -75,12 +75,17 @@
class SkPicturePlayback {
public:
- SkPicturePlayback(const SkPicturePlayback& src, SkPictCopyInfo* deepCopyInfo = NULL);
- SkPicturePlayback(const SkPictureRecord& record, const SkPictInfo&, bool deepCopy = false);
- static SkPicturePlayback* CreateFromStream(SkStream*,
+ SkPicturePlayback(const SkPicture* picture, const SkPicturePlayback& src,
+ SkPictCopyInfo* deepCopyInfo = NULL);
+ SkPicturePlayback(const SkPicture* picture, const SkPictureRecord& record, const SkPictInfo&,
+ bool deepCopy = false);
+ static SkPicturePlayback* CreateFromStream(SkPicture* picture,
+ SkStream*,
const SkPictInfo&,
SkPicture::InstallPixelRefProc);
- static SkPicturePlayback* CreateFromBuffer(SkReadBuffer&, const SkPictInfo&);
+ static SkPicturePlayback* CreateFromBuffer(SkPicture* picture,
+ SkReadBuffer&,
+ const SkPictInfo&);
virtual ~SkPicturePlayback();
@@ -105,10 +110,10 @@
void resetOpID() { fCurOffset = 0; }
protected:
- explicit SkPicturePlayback(const SkPictInfo& info);
+ explicit SkPicturePlayback(const SkPicture* picture, const SkPictInfo& info);
- bool parseStream(SkStream*, SkPicture::InstallPixelRefProc);
- bool parseBuffer(SkReadBuffer& buffer);
+ bool parseStream(SkPicture* picture, SkStream*, SkPicture::InstallPixelRefProc);
+ bool parseBuffer(SkPicture* picture, SkReadBuffer& buffer);
#ifdef SK_DEVELOPER
virtual bool preDraw(int opIndex, int type);
virtual void postDraw(int opIndex);
@@ -139,7 +144,7 @@
}
const SkPath& getPath(SkReader32& reader) {
- return (*fPathHeap)[reader.readInt() - 1];
+ return fPicture->getPath(reader.readInt() - 1);
}
SkPicture& getPicture(SkReader32& reader) {
@@ -215,17 +220,20 @@
#endif
private: // 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);
+ bool parseStreamTag(SkPicture* picture, SkStream*, uint32_t tag, uint32_t size,
+ SkPicture::InstallPixelRefProc);
+ bool parseBufferTag(SkPicture* picture, SkReadBuffer&, uint32_t tag, uint32_t size);
void flattenToBuffer(SkWriteBuffer&) const;
private:
+ // The picture that owns this SkPicturePlayback object
+ const SkPicture* fPicture;
+
// 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;
SkAutoTUnref<SkBitmapHeap> fBitmapHeap;
- SkAutoTUnref<SkPathHeap> fPathHeap;
SkTRefArray<SkBitmap>* fBitmaps;
SkTRefArray<SkPaint>* fPaints;
@@ -269,6 +277,9 @@
const SkPictInfo fInfo;
+ static void WriteFactories(SkWStream* stream, const SkFactorySet& rec);
+ static void WriteTypefaces(SkWStream* stream, const SkRefCntSet& rec);
+
#ifdef SK_BUILD_FOR_ANDROID
SkMutex fDrawMutex;
bool fAbortCurrentPlayback;
« no previous file with comments | « src/core/SkPicture.cpp ('k') | src/core/SkPicturePlayback.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698