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

Side by Side Diff: include/core/SkPicture.h

Issue 1061283002: Send SkPicture deletion message lazily. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/core/SkPicture.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 * Copyright 2007 The Android Open Source Project 2 * Copyright 2007 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 8
9 #ifndef SkPicture_DEFINED 9 #ifndef SkPicture_DEFINED
10 #define SkPicture_DEFINED 10 #define SkPicture_DEFINED
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 void playback(SkCanvas* canvas, AbortCallback* = NULL) const; 129 void playback(SkCanvas* canvas, AbortCallback* = NULL) const;
130 130
131 /** Return the cull rect used when creating this picture: { 0, 0, cullWidth, cullHeight }. 131 /** Return the cull rect used when creating this picture: { 0, 0, cullWidth, cullHeight }.
132 It does not necessarily reflect the bounds of what has been recorded int o the picture. 132 It does not necessarily reflect the bounds of what has been recorded int o the picture.
133 @return the cull rect used to create this picture 133 @return the cull rect used to create this picture
134 */ 134 */
135 SkRect cullRect() const { return fCullRect; } 135 SkRect cullRect() const { return fCullRect; }
136 136
137 /** Return a non-zero, unique value representing the picture. 137 /** Return a non-zero, unique value representing the picture.
138 */ 138 */
139 uint32_t uniqueID() const { return fUniqueID; } 139 uint32_t uniqueID() const;
140 140
141 /** 141 /**
142 * Serialize to a stream. If non NULL, serializer will be used to serialize 142 * Serialize to a stream. If non NULL, serializer will be used to serialize
143 * any bitmaps in the picture. 143 * any bitmaps in the picture.
144 * 144 *
145 * TODO: Use serializer to serialize SkImages as well. 145 * TODO: Use serializer to serialize SkImages as well.
146 */ 146 */
147 void serialize(SkWStream*, SkPixelSerializer* serializer = NULL) const; 147 void serialize(SkWStream*, SkPixelSerializer* serializer = NULL) const;
148 148
149 /** 149 /**
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 static bool IsValidPictInfo(const SkPictInfo& info); 256 static bool IsValidPictInfo(const SkPictInfo& info);
257 257
258 // Takes ownership of the SkRecord and (optional) SnapshotArray, refs the (o ptional) BBH. 258 // Takes ownership of the SkRecord and (optional) SnapshotArray, refs the (o ptional) BBH.
259 SkPicture(const SkRect& cullRect, SkRecord*, SnapshotArray*, SkBBoxHierarchy *); 259 SkPicture(const SkRect& cullRect, SkRecord*, SnapshotArray*, SkBBoxHierarchy *);
260 260
261 static SkPicture* Forwardport(const SkPictInfo&, const SkPictureData*); 261 static SkPicture* Forwardport(const SkPictInfo&, const SkPictureData*);
262 static SkPictureData* Backport(const SkRecord&, const SkPictInfo&, 262 static SkPictureData* Backport(const SkRecord&, const SkPictInfo&,
263 SkPicture const* const drawablePics[], int dr awableCount); 263 SkPicture const* const drawablePics[], int dr awableCount);
264 264
265 // uint32_t fRefCnt; from SkNVRefCnt<SkPicture> 265 // uint32_t fRefCnt; from SkNVRefCnt<SkPicture>
266 const uint32_t fUniqueID; 266 mutable uint32_t fUniqueID;
267 const SkRect fCullRect; 267 const SkRect fCullRect;
268 mutable SkAutoTUnref<const AccelData> fAccelData; 268 mutable SkAutoTUnref<const AccelData> fAccelData;
269 SkAutoTUnref<const SkRecord> fRecord; 269 SkAutoTUnref<const SkRecord> fRecord;
270 SkAutoTUnref<const SkBBoxHierarchy> fBBH; 270 SkAutoTUnref<const SkBBoxHierarchy> fBBH;
271 SkAutoTDelete<const SnapshotArray> fDrawablePicts; 271 SkAutoTDelete<const SnapshotArray> fDrawablePicts;
272 272
273 // helpers for fDrawablePicts 273 // helpers for fDrawablePicts
274 int drawableCount() const; 274 int drawableCount() const;
275 // will return NULL if drawableCount() returns 0 275 // will return NULL if drawableCount() returns 0
276 SkPicture const* const* drawablePicts() const; 276 SkPicture const* const* drawablePicts() const;
(...skipping 17 matching lines...) Expand all
294 294
295 friend class SkPictureRecorder; // SkRecord-based constructor. 295 friend class SkPictureRecorder; // SkRecord-based constructor.
296 friend class GrLayerHoister; // access to fRecord 296 friend class GrLayerHoister; // access to fRecord
297 friend class ReplaceDraw; 297 friend class ReplaceDraw;
298 friend class SkPictureUtils; 298 friend class SkPictureUtils;
299 friend class SkRecordedDrawable; 299 friend class SkRecordedDrawable;
300 }; 300 };
301 SK_COMPILE_ASSERT(sizeof(SkPicture) <= 96, SkPictureSize); 301 SK_COMPILE_ASSERT(sizeof(SkPicture) <= 96, SkPictureSize);
302 302
303 #endif 303 #endif
OLDNEW
« no previous file with comments | « no previous file | src/core/SkPicture.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698