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

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

Issue 388833003: Remove Skia's use of the default SkPicture constructor and multi-clone (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix test Created 6 years, 5 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 | « gyp/skia_for_android_framework_defines.gypi ('k') | 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 /* 2 /*
3 * Copyright 2007 The Android Open Source Project 3 * Copyright 2007 The Android Open Source Project
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 8
9 9
10 #ifndef SkPicture_DEFINED 10 #ifndef SkPicture_DEFINED
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 // This entry point allows user's to get a unique domain prefix 57 // This entry point allows user's to get a unique domain prefix
58 // for their keys 58 // for their keys
59 static Domain GenerateDomain(); 59 static Domain GenerateDomain();
60 private: 60 private:
61 Key fKey; 61 Key fKey;
62 62
63 typedef SkRefCnt INHERITED; 63 typedef SkRefCnt INHERITED;
64 }; 64 };
65 65
66 #ifdef SK_SUPPORT_LEGACY_DEFAULT_PICTURE_CTOR
66 SkPicture(); 67 SkPicture();
68 #endif
67 69
68 /** PRIVATE / EXPERIMENTAL -- do not call */ 70 /** PRIVATE / EXPERIMENTAL -- do not call */
69 void EXPERIMENTAL_addAccelData(const AccelData*) const; 71 void EXPERIMENTAL_addAccelData(const AccelData*) const;
70 72
71 /** PRIVATE / EXPERIMENTAL -- do not call */ 73 /** PRIVATE / EXPERIMENTAL -- do not call */
72 const AccelData* EXPERIMENTAL_getAccelData(AccelData::Key) const; 74 const AccelData* EXPERIMENTAL_getAccelData(AccelData::Key) const;
73 75
74 /** 76 /**
75 * Function signature defining a function that sets up an SkBitmap from enc oded data. On 77 * Function signature defining a function that sets up an SkBitmap from enc oded data. On
76 * success, the SkBitmap should have its Config, width, height, rowBytes an d pixelref set. 78 * success, the SkBitmap should have its Config, width, height, rowBytes an d pixelref set.
(...skipping 28 matching lines...) Expand all
105 */ 107 */
106 static SkPicture* CreateFromBuffer(SkReadBuffer&); 108 static SkPicture* CreateFromBuffer(SkReadBuffer&);
107 109
108 virtual ~SkPicture(); 110 virtual ~SkPicture();
109 111
110 #ifdef SK_SUPPORT_LEGACY_PICTURE_CLONE 112 #ifdef SK_SUPPORT_LEGACY_PICTURE_CLONE
111 /** 113 /**
112 * Creates a thread-safe clone of the picture that is ready for playback. 114 * Creates a thread-safe clone of the picture that is ready for playback.
113 */ 115 */
114 SkPicture* clone() const; 116 SkPicture* clone() const;
115
116 /**
117 * Creates multiple thread-safe clones of this picture that are ready for
118 * playback. The resulting clones are stored in the provided array of
119 * SkPictures.
120 */
121 void clone(SkPicture* pictures, int count) const;
122 #endif 117 #endif
123 118
124 /** Replays the drawing commands on the specified canvas. 119 /** Replays the drawing commands on the specified canvas.
125 @param canvas the canvas receiving the drawing commands. 120 @param canvas the canvas receiving the drawing commands.
126 */ 121 */
127 void draw(SkCanvas* canvas, SkDrawPictureCallback* = NULL) const; 122 void draw(SkCanvas* canvas, SkDrawPictureCallback* = NULL) const;
128 123
129 /** Return the width of the picture's recording canvas. This 124 /** Return the width of the picture's recording canvas. This
130 value reflects what was passed to setSize(), and does not necessarily 125 value reflects what was passed to setSize(), and does not necessarily
131 reflect the bounds of what has been recorded into the picture. 126 reflect the bounds of what has been recorded into the picture.
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 232
238 mutable uint32_t fUniqueID; 233 mutable uint32_t fUniqueID;
239 234
240 // TODO: make SkPictureData const when clone method goes away 235 // TODO: make SkPictureData const when clone method goes away
241 SkAutoTDelete<SkPictureData> fData; 236 SkAutoTDelete<SkPictureData> fData;
242 int fWidth, fHeight; 237 int fWidth, fHeight;
243 mutable SkAutoTUnref<const AccelData> fAccelData; 238 mutable SkAutoTUnref<const AccelData> fAccelData;
244 239
245 void needsNewGenID() { fUniqueID = SK_InvalidGenID; } 240 void needsNewGenID() { fUniqueID = SK_InvalidGenID; }
246 241
247 // Create a new SkPicture from an existing SkPictureData. Ref count of 242 // Create a new SkPicture from an existing SkPictureData. The new picture
248 // data is unchanged. 243 // takes ownership of 'data'.
249 SkPicture(SkPictureData* data, int width, int height); 244 SkPicture(SkPictureData* data, int width, int height);
250 245
251 SkPicture(int width, int height, const SkPictureRecord& record, bool deepCop yOps); 246 SkPicture(int width, int height, const SkPictureRecord& record, bool deepCop yOps);
252 247
253 // An OperationList encapsulates a set of operation offsets into the picture byte 248 // An OperationList encapsulates a set of operation offsets into the picture byte
254 // stream along with the CTMs needed for those operation. 249 // stream along with the CTMs needed for those operation.
255 class OperationList : ::SkNoncopyable { 250 class OperationList : ::SkNoncopyable {
256 public: 251 public:
257 // The following three entry points should only be accessed if 252 // The following three entry points should only be accessed if
258 // 'valid' returns true. 253 // 'valid' returns true.
(...skipping 22 matching lines...) Expand all
281 friend class SkPictureReplacementPlayback; // to access OperationList 276 friend class SkPictureReplacementPlayback; // to access OperationList
282 277
283 typedef SkRefCnt INHERITED; 278 typedef SkRefCnt INHERITED;
284 279
285 SkPicture(int width, int height, SkRecord*); // Takes ownership. 280 SkPicture(int width, int height, SkRecord*); // Takes ownership.
286 SkAutoTDelete<SkRecord> fRecord; 281 SkAutoTDelete<SkRecord> fRecord;
287 bool fRecordWillPlayBackBitmaps; // TODO: const 282 bool fRecordWillPlayBackBitmaps; // TODO: const
288 }; 283 };
289 284
290 #endif 285 #endif
OLDNEW
« no previous file with comments | « gyp/skia_for_android_framework_defines.gypi ('k') | src/core/SkPicture.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698