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

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

Issue 722043005: Revert of allow pictures to have a full bounds (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month 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 | « include/core/SkDevice.h ('k') | include/core/SkPictureRecorder.h » ('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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 SkRect cullRect() const { return fCullRect; } 133 const SkRect cullRect() const { return SkRect::MakeWH(fCullWidth, fCullHeigh t); }
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
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(const SkRect& cullRect, SkRecord*, SkData* drawablePicts, 263 SkPicture(SkScalar width, SkScalar height, 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 SkRect fCullRect; 270 const SkScalar fCullWidth;
271 const SkScalar fCullHeight;
271 mutable SkAutoTUnref<const AccelData> fAccelData; 272 mutable SkAutoTUnref<const AccelData> fAccelData;
272 mutable SkTDArray<DeletionListener*> fDeletionListeners; // pointers are re fed 273 mutable SkTDArray<DeletionListener*> fDeletionListeners; // pointers are re fed
273 SkAutoTDelete<SkRecord> fRecord; 274 SkAutoTDelete<SkRecord> fRecord;
274 SkAutoTUnref<SkBBoxHierarchy> fBBH; 275 SkAutoTUnref<SkBBoxHierarchy> fBBH;
275 SkAutoTUnref<SkData> fDrawablePicts; 276 SkAutoTUnref<SkData> fDrawablePicts;
276 277
277 // helpers for fDrawablePicts 278 // helpers for fDrawablePicts
278 int drawableCount() const; 279 int drawableCount() const;
279 // will return NULL if drawableCount() returns 0 280 // will return NULL if drawableCount() returns 0
280 SkPicture const* const* drawablePicts() const; 281 SkPicture const* const* drawablePicts() const;
(...skipping 17 matching lines...) Expand all
298 mutable uint32_t fUniqueID; 299 mutable uint32_t fUniqueID;
299 300
300 friend class SkPictureRecorder; // SkRecord-based constructor. 301 friend class SkPictureRecorder; // SkRecord-based constructor.
301 friend class GrLayerHoister; // access to fRecord 302 friend class GrLayerHoister; // access to fRecord
302 friend class ReplaceDraw; 303 friend class ReplaceDraw;
303 304
304 typedef SkRefCnt INHERITED; 305 typedef SkRefCnt INHERITED;
305 }; 306 };
306 307
307 #endif 308 #endif
OLDNEW
« no previous file with comments | « include/core/SkDevice.h ('k') | include/core/SkPictureRecorder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698