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

Unified Diff: include/private/SkRecords.h

Issue 2185563003: turn bitmaps into images during recording (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: exlucde serialize bleed, remove ImmutableBitmap for records Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/core/SkRecordDraw.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/private/SkRecords.h
diff --git a/include/private/SkRecords.h b/include/private/SkRecords.h
index d9f2b3b6d7eb7d70402e4bfb8239e17ef207bff2..1c313f15d1a8dbc036c82c45c91f536707f8af31 100644
--- a/include/private/SkRecords.h
+++ b/include/private/SkRecords.h
@@ -53,11 +53,6 @@ namespace SkRecords {
M(ClipRRect) \
M(ClipRect) \
M(ClipRegion) \
- M(DrawBitmap) \
- M(DrawBitmapNine) \
- M(DrawBitmapRect) \
- M(DrawBitmapRectFast) \
- M(DrawBitmapRectFixedSize) \
M(DrawDrawable) \
M(DrawImage) \
M(DrawImageRect) \
@@ -155,25 +150,6 @@ private:
#undef ACT_AS_PTR
-// Like SkBitmap, but deep copies pixels if they're not immutable.
-// Using this, we guarantee the immutability of all bitmaps we record.
-class ImmutableBitmap : SkNoncopyable {
-public:
- ImmutableBitmap() {}
- ImmutableBitmap(const SkBitmap& bitmap);
- ImmutableBitmap(ImmutableBitmap&& o) {
- fBitmap.swap(o.fBitmap);
- }
-
- int width() const { return fBitmap.width(); }
- int height() const { return fBitmap.height(); }
-
- // While the pixels are immutable, SkBitmap itself is not thread-safe, so return a copy.
- SkBitmap shallowCopy() const { return fBitmap; }
-private:
- SkBitmap fBitmap;
-};
-
// SkPath::getBounds() isn't thread safe unless we precache the bounds in a singlethreaded context.
// SkPath::cheapComputeDirection() is similar.
// Recording is a convenient time to cache these, or we can delay it to between record and playback.
@@ -248,32 +224,6 @@ RECORD(ClipRegion, 0,
SkRegion::Op op);
// While not strictly required, if you have an SkPaint, it's fastest to put it first.
-RECORD(DrawBitmap, kDraw_Tag|kHasImage_Tag,
- Optional<SkPaint> paint;
- ImmutableBitmap bitmap;
- SkScalar left;
- SkScalar top);
-RECORD(DrawBitmapNine, kDraw_Tag|kHasImage_Tag,
- Optional<SkPaint> paint;
- ImmutableBitmap bitmap;
- SkIRect center;
- SkRect dst);
-RECORD(DrawBitmapRect, kDraw_Tag|kHasImage_Tag,
- Optional<SkPaint> paint;
- ImmutableBitmap bitmap;
- Optional<SkRect> src;
- SkRect dst);
-RECORD(DrawBitmapRectFast, kDraw_Tag|kHasImage_Tag,
- Optional<SkPaint> paint;
- ImmutableBitmap bitmap;
- Optional<SkRect> src;
- SkRect dst);
-RECORD(DrawBitmapRectFixedSize, kDraw_Tag|kHasImage_Tag,
- SkPaint paint;
- ImmutableBitmap bitmap;
- SkRect src;
- SkRect dst;
- SkCanvas::SrcRectConstraint constraint);
RECORD(DrawDRRect, kDraw_Tag,
SkPaint paint;
SkRRect outer;
« no previous file with comments | « no previous file | src/core/SkRecordDraw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698