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

Unified Diff: include/core/SkPicture.h

Issue 738083002: Allow pictures to have a full bounds (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update dox 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkDevice.h ('k') | include/core/SkPictureRecorder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkPicture.h
diff --git a/include/core/SkPicture.h b/include/core/SkPicture.h
index 99bca367d987c4d3ca237580b4c9e5b51c73c0b8..1042ccd61bdb3969268231ddca994f09314bd667 100644
--- a/include/core/SkPicture.h
+++ b/include/core/SkPicture.h
@@ -122,15 +122,15 @@ public:
#endif
#ifdef SK_LEGACY_PICTURE_SIZE_API
- int width() const { return SkScalarCeilToInt(fCullWidth); }
- int height() const { return SkScalarCeilToInt(fCullHeight); }
+ int width() const { return fCullRect.roundOut().width(); }
+ int height() const { return fCullRect.roundOut().height(); }
#endif
/** Return the cull rect used when creating this picture: { 0, 0, cullWidth, cullHeight }.
It does not necessarily reflect the bounds of what has been recorded into the picture.
@return the cull rect used to create this picture
*/
- const SkRect cullRect() const { return SkRect::MakeWH(fCullWidth, fCullHeight); }
+ SkRect cullRect() const { return fCullRect; }
/** Return a non-zero, unique value representing the picture. This call is
only valid when not recording. Between a beginRecording/endRecording
@@ -260,15 +260,14 @@ private:
static bool IsValidPictInfo(const SkPictInfo& info);
// Takes ownership of the SkRecord, refs the (optional) drawablePicts and BBH.
- SkPicture(SkScalar width, SkScalar height, SkRecord*, SkData* drawablePicts,
+ SkPicture(const SkRect& cullRect, SkRecord*, SkData* drawablePicts,
SkBBoxHierarchy*);
static SkPicture* Forwardport(const SkPictInfo&, const SkPictureData*);
static SkPictureData* Backport(const SkRecord&, const SkPictInfo&,
SkPicture const* const drawablePics[], int drawableCount);
- const SkScalar fCullWidth;
- const SkScalar fCullHeight;
+ const SkRect fCullRect;
mutable SkAutoTUnref<const AccelData> fAccelData;
mutable SkTDArray<DeletionListener*> fDeletionListeners; // pointers are refed
SkAutoTDelete<SkRecord> fRecord;
« 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