OLD | NEW |
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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 #endif | 190 #endif |
191 | 191 |
192 class DeletionListener : public SkRefCnt { | 192 class DeletionListener : public SkRefCnt { |
193 public: | 193 public: |
194 virtual void onDeletion(uint32_t pictureID) = 0; | 194 virtual void onDeletion(uint32_t pictureID) = 0; |
195 }; | 195 }; |
196 | 196 |
197 // Takes ref on listener. | 197 // Takes ref on listener. |
198 void addDeletionListener(DeletionListener* listener) const; | 198 void addDeletionListener(DeletionListener* listener) const; |
199 | 199 |
| 200 /** |
| 201 * Return the approximate number of "operations" in the picture. This numbe
r is hard to nail |
| 202 * down precisely, since there is not always a 1-to-1 correspondence betwee
n "operations" in |
| 203 * the internal format, and public API calls on SkCanvas. It is also possib
le that the value |
| 204 * returned may chage, as deferred optimizations may vary the count. |
| 205 */ |
| 206 int countOps() const; |
| 207 |
200 private: | 208 private: |
201 // V2 : adds SkPixelRef's generation ID. | 209 // V2 : adds SkPixelRef's generation ID. |
202 // V3 : PictInfo tag at beginning, and EOF tag at the end | 210 // V3 : PictInfo tag at beginning, and EOF tag at the end |
203 // V4 : move SkPictInfo to be the header | 211 // V4 : move SkPictInfo to be the header |
204 // V5 : don't read/write FunctionPtr on cross-process (we can detect that) | 212 // V5 : don't read/write FunctionPtr on cross-process (we can detect that) |
205 // V6 : added serialization of SkPath's bounds (and packed its flags tighter
) | 213 // V6 : added serialization of SkPath's bounds (and packed its flags tighter
) |
206 // V7 : changed drawBitmapRect(IRect) to drawBitmapRectToRect(Rect) | 214 // V7 : changed drawBitmapRect(IRect) to drawBitmapRectToRect(Rect) |
207 // V8 : Add an option for encoding bitmaps | 215 // V8 : Add an option for encoding bitmaps |
208 // V9 : Allow the reader and writer of an SKP disagree on whether to support | 216 // V9 : Allow the reader and writer of an SKP disagree on whether to support |
209 // SK_SUPPORT_HINTING_SCALE_FACTOR | 217 // SK_SUPPORT_HINTING_SCALE_FACTOR |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 | 299 |
292 // Takes ownership of the SkRecord, refs the (optional) BBH. | 300 // Takes ownership of the SkRecord, refs the (optional) BBH. |
293 SkPicture(int width, int height, SkRecord*, SkBBoxHierarchy*); | 301 SkPicture(int width, int height, SkRecord*, SkBBoxHierarchy*); |
294 | 302 |
295 SkAutoTDelete<SkRecord> fRecord; | 303 SkAutoTDelete<SkRecord> fRecord; |
296 SkAutoTUnref<SkBBoxHierarchy> fBBH; | 304 SkAutoTUnref<SkBBoxHierarchy> fBBH; |
297 bool fRecordWillPlayBackBitmaps; // TODO: const | 305 bool fRecordWillPlayBackBitmaps; // TODO: const |
298 }; | 306 }; |
299 | 307 |
300 #endif | 308 #endif |
OLD | NEW |