| 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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 | 123 |
| 124 #ifdef SK_LEGACY_PICTURE_SIZE_API | 124 #ifdef SK_LEGACY_PICTURE_SIZE_API |
| 125 int width() const { return SkScalarCeilToInt(fCullWidth); } | 125 int width() const { return SkScalarCeilToInt(fCullWidth); } |
| 126 int height() const { return SkScalarCeilToInt(fCullHeight); } | 126 int height() const { return SkScalarCeilToInt(fCullHeight); } |
| 127 #endif | 127 #endif |
| 128 | 128 |
| 129 /** Return the cull rect used when creating this picture: { 0, 0, cullWidth,
cullHeight }. | 129 /** Return the cull rect used when creating this picture: { 0, 0, cullWidth,
cullHeight }. |
| 130 It does not necessarily reflect the bounds of what has been recorded int
o the picture. | 130 It does not necessarily reflect the bounds of what has been recorded int
o the picture. |
| 131 @return the cull rect used to create this picture | 131 @return the cull rect used to create this picture |
| 132 */ | 132 */ |
| 133 const SkRect cullRect() const { return SkRect::MakeWH(fCullWidth, fCullHeigh
t); } | 133 SkRect cullRect() const { return fCullRect; } |
| 134 | 134 |
| 135 /** Return a non-zero, unique value representing the picture. This call is | 135 /** Return a non-zero, unique value representing the picture. This call is |
| 136 only valid when not recording. Between a beginRecording/endRecording | 136 only valid when not recording. Between a beginRecording/endRecording |
| 137 pair it will just return 0 (the invalid ID). Each beginRecording/ | 137 pair it will just return 0 (the invalid ID). Each beginRecording/ |
| 138 endRecording pair will cause a different generation ID to be returned. | 138 endRecording pair will cause a different generation ID to be returned. |
| 139 */ | 139 */ |
| 140 uint32_t uniqueID() const; | 140 uint32_t uniqueID() const; |
| 141 | 141 |
| 142 /** | 142 /** |
| 143 * Function to encode an SkBitmap to an SkData. A function with this | 143 * Function to encode an SkBitmap to an SkData. A function with this |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 static const uint32_t MIN_PICTURE_VERSION = 19; | 253 static const uint32_t MIN_PICTURE_VERSION = 19; |
| 254 static const uint32_t CURRENT_PICTURE_VERSION = 37; | 254 static const uint32_t CURRENT_PICTURE_VERSION = 37; |
| 255 | 255 |
| 256 void needsNewGenID() { fUniqueID = SK_InvalidGenID; } | 256 void needsNewGenID() { fUniqueID = SK_InvalidGenID; } |
| 257 void callDeletionListeners(); | 257 void callDeletionListeners(); |
| 258 | 258 |
| 259 void createHeader(SkPictInfo* info) const; | 259 void createHeader(SkPictInfo* info) const; |
| 260 static bool IsValidPictInfo(const SkPictInfo& info); | 260 static bool IsValidPictInfo(const SkPictInfo& info); |
| 261 | 261 |
| 262 // Takes ownership of the SkRecord, refs the (optional) drawablePicts and BB
H. | 262 // Takes ownership of the SkRecord, refs the (optional) drawablePicts and BB
H. |
| 263 SkPicture(SkScalar width, SkScalar height, SkRecord*, SkData* drawablePicts, | 263 SkPicture(const SkRect& cullRect, SkRecord*, SkData* drawablePicts, |
| 264 SkBBoxHierarchy*); | 264 SkBBoxHierarchy*); |
| 265 | 265 |
| 266 static SkPicture* Forwardport(const SkPictInfo&, const SkPictureData*); | 266 static SkPicture* Forwardport(const SkPictInfo&, const SkPictureData*); |
| 267 static SkPictureData* Backport(const SkRecord&, const SkPictInfo&, | 267 static SkPictureData* Backport(const SkRecord&, const SkPictInfo&, |
| 268 SkPicture const* const drawablePics[], int dr
awableCount); | 268 SkPicture const* const drawablePics[], int dr
awableCount); |
| 269 | 269 |
| 270 const SkScalar fCullWidth; | 270 const SkRect fCullRect; |
| 271 const SkScalar fCullHeight; | |
| 272 mutable SkAutoTUnref<const AccelData> fAccelData; | 271 mutable SkAutoTUnref<const AccelData> fAccelData; |
| 273 mutable SkTDArray<DeletionListener*> fDeletionListeners; // pointers are re
fed | 272 mutable SkTDArray<DeletionListener*> fDeletionListeners; // pointers are re
fed |
| 274 SkAutoTDelete<SkRecord> fRecord; | 273 SkAutoTDelete<SkRecord> fRecord; |
| 275 SkAutoTUnref<SkBBoxHierarchy> fBBH; | 274 SkAutoTUnref<SkBBoxHierarchy> fBBH; |
| 276 SkAutoTUnref<SkData> fDrawablePicts; | 275 SkAutoTUnref<SkData> fDrawablePicts; |
| 277 | 276 |
| 278 // helpers for fDrawablePicts | 277 // helpers for fDrawablePicts |
| 279 int drawableCount() const; | 278 int drawableCount() const; |
| 280 // will return NULL if drawableCount() returns 0 | 279 // will return NULL if drawableCount() returns 0 |
| 281 SkPicture const* const* drawablePicts() const; | 280 SkPicture const* const* drawablePicts() const; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 299 mutable uint32_t fUniqueID; | 298 mutable uint32_t fUniqueID; |
| 300 | 299 |
| 301 friend class SkPictureRecorder; // SkRecord-based constructor. | 300 friend class SkPictureRecorder; // SkRecord-based constructor. |
| 302 friend class GrLayerHoister; // access to fRecord | 301 friend class GrLayerHoister; // access to fRecord |
| 303 friend class ReplaceDraw; | 302 friend class ReplaceDraw; |
| 304 | 303 |
| 305 typedef SkRefCnt INHERITED; | 304 typedef SkRefCnt INHERITED; |
| 306 }; | 305 }; |
| 307 | 306 |
| 308 #endif | 307 #endif |
| OLD | NEW |