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

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

Issue 195793010: Add a means of extracting active operations from SkPicture (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Add EXPERIMENTAL prefix to the new entry point Created 6 years, 9 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 | Annotate | Revision Log
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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 public: 78 public:
79 SkPicturePlayback(); 79 SkPicturePlayback();
80 SkPicturePlayback(const SkPicturePlayback& src, SkPictCopyInfo* deepCopyInfo = NULL); 80 SkPicturePlayback(const SkPicturePlayback& src, SkPictCopyInfo* deepCopyInfo = NULL);
81 explicit SkPicturePlayback(const SkPictureRecord& record, bool deepCopy = fa lse); 81 explicit SkPicturePlayback(const SkPictureRecord& record, bool deepCopy = fa lse);
82 static SkPicturePlayback* CreateFromStream(SkStream*, const SkPictInfo&, 82 static SkPicturePlayback* CreateFromStream(SkStream*, const SkPictInfo&,
83 SkPicture::InstallPixelRefProc); 83 SkPicture::InstallPixelRefProc);
84 static SkPicturePlayback* CreateFromBuffer(SkReadBuffer&); 84 static SkPicturePlayback* CreateFromBuffer(SkReadBuffer&);
85 85
86 virtual ~SkPicturePlayback(); 86 virtual ~SkPicturePlayback();
87 87
88 const SkTDArray<void*>* getActiveOps(const SkIRect& queryRect);
bsalomon 2014/03/13 17:59:34 The signature seems a little dangerous to me.
robertphillips 2014/03/14 17:59:34 Done. I think I have addressed your concerns here.
89
88 void draw(SkCanvas& canvas, SkDrawPictureCallback*); 90 void draw(SkCanvas& canvas, SkDrawPictureCallback*);
89 91
90 void serialize(SkWStream*, SkPicture::EncodeBitmap) const; 92 void serialize(SkWStream*, SkPicture::EncodeBitmap) const;
91 void flatten(SkWriteBuffer&) const; 93 void flatten(SkWriteBuffer&) const;
92 94
93 void dumpSize() const; 95 void dumpSize() const;
94 96
95 bool containsBitmaps() const; 97 bool containsBitmaps() const;
96 98
97 #ifdef SK_BUILD_FOR_ANDROID 99 #ifdef SK_BUILD_FOR_ANDROID
98 // Can be called in the middle of playback (the draw() call). WIll abort the 100 // Can be called in the middle of playback (the draw() call). WIll abort the
99 // drawing and return from draw() after the "current" op code is done 101 // drawing and return from draw() after the "current" op code is done
100 void abort() { fAbortCurrentPlayback = true; } 102 void abort() { fAbortCurrentPlayback = true; }
101 #endif 103 #endif
102 104
103 protected: 105 protected:
104 bool parseStream(SkStream*, const SkPictInfo&, 106 bool parseStream(SkStream*, const SkPictInfo&,
105 SkPicture::InstallPixelRefProc); 107 SkPicture::InstallPixelRefProc);
106 bool parseBuffer(SkReadBuffer& buffer); 108 bool parseBuffer(SkReadBuffer& buffer);
107 #ifdef SK_DEVELOPER 109 #ifdef SK_DEVELOPER
108 virtual bool preDraw(int opIndex, int type); 110 virtual bool preDraw(int opIndex, int type);
109 virtual void postDraw(int opIndex); 111 virtual void postDraw(int opIndex);
110 #endif 112 #endif
111 113
112 void preLoadBitmaps(const SkTDArray<void*>& results); 114 void preLoadBitmaps(const SkTDArray<void*>* results);
113 115
114 private: 116 private:
115 class TextContainer { 117 class TextContainer {
116 public: 118 public:
117 size_t length() { return fByteLength; } 119 size_t length() { return fByteLength; }
118 const void* text() { return (const void*) fText; } 120 const void* text() { return (const void*) fText; }
119 size_t fByteLength; 121 size_t fByteLength;
120 const char* fText; 122 const char* fText;
121 }; 123 };
122 124
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 232
231 SkData* fOpData; // opcodes and parameters 233 SkData* fOpData; // opcodes and parameters
232 SkAutoTUnref<SkOffsetTable> fBitmapUseOffsets; 234 SkAutoTUnref<SkOffsetTable> fBitmapUseOffsets;
233 235
234 SkPicture** fPictureRefs; 236 SkPicture** fPictureRefs;
235 int fPictureCount; 237 int fPictureCount;
236 238
237 SkBBoxHierarchy* fBoundingHierarchy; 239 SkBBoxHierarchy* fBoundingHierarchy;
238 SkPictureStateTree* fStateTree; 240 SkPictureStateTree* fStateTree;
239 241
242 // The query rect for which the cached active ops are valid
243 SkIRect fCacheQueryRect;
244 // The operations which are active within 'fCachedQueryRect'
245 SkTDArray<void*>* fCachedActiveOps;
246
240 SkTypefacePlayback fTFPlayback; 247 SkTypefacePlayback fTFPlayback;
241 SkFactoryPlayback* fFactoryPlayback; 248 SkFactoryPlayback* fFactoryPlayback;
242 #ifdef SK_BUILD_FOR_ANDROID 249 #ifdef SK_BUILD_FOR_ANDROID
243 SkMutex fDrawMutex; 250 SkMutex fDrawMutex;
244 bool fAbortCurrentPlayback; 251 bool fAbortCurrentPlayback;
245 #endif 252 #endif
246 }; 253 };
247 254
248 #endif 255 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698