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

Side by Side Diff: src/core/SkPicturePlayback.h

Issue 138063005: Serialization of SkPictureImageFilter (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Updated past revert point, will re-land tonight Created 6 years, 10 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 unified diff | Download patch
« no previous file with comments | « src/core/SkPicture.cpp ('k') | src/core/SkPicturePlayback.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2011 Google Inc. 3 * Copyright 2011 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #ifndef SkPicturePlayback_DEFINED 8 #ifndef SkPicturePlayback_DEFINED
9 #define SkPicturePlayback_DEFINED 9 #define SkPicturePlayback_DEFINED
10 10
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 SkTDArray<SkFlatData*> paintData; 57 SkTDArray<SkFlatData*> paintData;
58 }; 58 };
59 59
60 class SkPicturePlayback { 60 class SkPicturePlayback {
61 public: 61 public:
62 SkPicturePlayback(); 62 SkPicturePlayback();
63 SkPicturePlayback(const SkPicturePlayback& src, SkPictCopyInfo* deepCopyInfo = NULL); 63 SkPicturePlayback(const SkPicturePlayback& src, SkPictCopyInfo* deepCopyInfo = NULL);
64 explicit SkPicturePlayback(const SkPictureRecord& record, bool deepCopy = fa lse); 64 explicit SkPicturePlayback(const SkPictureRecord& record, bool deepCopy = fa lse);
65 static SkPicturePlayback* CreateFromStream(SkStream*, const SkPictInfo&, 65 static SkPicturePlayback* CreateFromStream(SkStream*, const SkPictInfo&,
66 SkPicture::InstallPixelRefProc); 66 SkPicture::InstallPixelRefProc);
67 static SkPicturePlayback* CreateFromBuffer(SkReadBuffer&);
67 68
68 virtual ~SkPicturePlayback(); 69 virtual ~SkPicturePlayback();
69 70
70 void draw(SkCanvas& canvas, SkDrawPictureCallback*); 71 void draw(SkCanvas& canvas, SkDrawPictureCallback*);
71 72
72 void serialize(SkWStream*, SkPicture::EncodeBitmap) const; 73 void serialize(SkWStream*, SkPicture::EncodeBitmap) const;
74 void flatten(SkWriteBuffer&) const;
73 75
74 void dumpSize() const; 76 void dumpSize() const;
75 77
76 bool containsBitmaps() const; 78 bool containsBitmaps() const;
77 79
78 #ifdef SK_BUILD_FOR_ANDROID 80 #ifdef SK_BUILD_FOR_ANDROID
79 // Can be called in the middle of playback (the draw() call). WIll abort the 81 // Can be called in the middle of playback (the draw() call). WIll abort the
80 // drawing and return from draw() after the "current" op code is done 82 // drawing and return from draw() after the "current" op code is done
81 void abort() { fAbortCurrentPlayback = true; } 83 void abort() { fAbortCurrentPlayback = true; }
82 #endif 84 #endif
83 85
84 protected: 86 protected:
85 bool parseStream(SkStream*, const SkPictInfo&, 87 bool parseStream(SkStream*, const SkPictInfo&,
86 SkPicture::InstallPixelRefProc); 88 SkPicture::InstallPixelRefProc);
89 bool parseBuffer(SkReadBuffer& buffer);
87 #ifdef SK_DEVELOPER 90 #ifdef SK_DEVELOPER
88 virtual bool preDraw(int opIndex, int type); 91 virtual bool preDraw(int opIndex, int type);
89 virtual void postDraw(int opIndex); 92 virtual void postDraw(int opIndex);
90 #endif 93 #endif
91 94
92 private: 95 private:
93 class TextContainer { 96 class TextContainer {
94 public: 97 public:
95 size_t length() { return fByteLength; } 98 size_t length() { return fByteLength; }
96 const void* text() { return (const void*) fText; } 99 const void* text() { return (const void*) fText; }
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 219
217 SkTypefacePlayback fTFPlayback; 220 SkTypefacePlayback fTFPlayback;
218 SkFactoryPlayback* fFactoryPlayback; 221 SkFactoryPlayback* fFactoryPlayback;
219 #ifdef SK_BUILD_FOR_ANDROID 222 #ifdef SK_BUILD_FOR_ANDROID
220 SkMutex fDrawMutex; 223 SkMutex fDrawMutex;
221 bool fAbortCurrentPlayback; 224 bool fAbortCurrentPlayback;
222 #endif 225 #endif
223 }; 226 };
224 227
225 #endif 228 #endif
OLDNEW
« 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