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

Unified Diff: third_party/WebKit/Source/platform/graphics/paint/DrawingDisplayItem.cpp

Issue 2743363006: Clean up cc/paint interfaces (Closed)
Patch Set: Rebase Created 3 years, 9 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
Index: third_party/WebKit/Source/platform/graphics/paint/DrawingDisplayItem.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/paint/DrawingDisplayItem.cpp b/third_party/WebKit/Source/platform/graphics/paint/DrawingDisplayItem.cpp
index c319de5e2da6716fb75b8ca5a9bf571e36b09629..a3279f3c8e0fa7a21a35efab264d4cd3d73c51ce 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/DrawingDisplayItem.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/DrawingDisplayItem.cpp
@@ -16,7 +16,7 @@ namespace blink {
void DrawingDisplayItem::replay(GraphicsContext& context) const {
if (m_record)
- context.drawRecord(m_record.get());
+ context.drawRecord(m_record);
}
void DrawingDisplayItem::appendToWebDisplayItemList(
@@ -53,8 +53,8 @@ void DrawingDisplayItem::dumpPropertiesAsDebugString(
}
#endif
-static bool recordsEqual(const PaintRecord* record1,
- const PaintRecord* record2) {
+static bool recordsEqual(sk_sp<const PaintRecord> record1,
danakj 2017/03/16 20:06:16 This seems like it should be T* still? ToSkPicture
enne (OOO) 2017/03/16 20:57:26 Agreed here.
+ sk_sp<const PaintRecord> record2) {
if (record1->approximateOpCount() != record2->approximateOpCount())
return false;
@@ -64,7 +64,7 @@ static bool recordsEqual(const PaintRecord* record1,
return data1->equals(data2.get());
}
-static SkBitmap recordToBitmap(const PaintRecord* record) {
+static SkBitmap recordToBitmap(sk_sp<const PaintRecord> record) {
SkBitmap bitmap;
SkRect rect = record->cullRect();
bitmap.allocPixels(SkImageInfo::MakeN32Premul(rect.width(), rect.height()));
@@ -75,8 +75,8 @@ static SkBitmap recordToBitmap(const PaintRecord* record) {
return bitmap;
}
-static bool bitmapsEqual(const PaintRecord* record1,
- const PaintRecord* record2) {
+static bool bitmapsEqual(sk_sp<const PaintRecord> record1,
danakj 2017/03/16 20:06:17 This seems like it should be T* also, it's not pas
enne (OOO) 2017/03/16 20:57:26 Not agreed here. This is rasterizing via drawPict
danakj 2017/03/16 21:02:01 Oh ok I missed what recordToBitmap does.
+ sk_sp<const PaintRecord> record2) {
SkRect rect = record1->cullRect();
if (rect != record2->cullRect())
return false;
@@ -107,8 +107,8 @@ bool DrawingDisplayItem::equals(const DisplayItem& other) const {
if (!DisplayItem::equals(other))
return false;
- const PaintRecord* record = this->GetPaintRecord();
- const PaintRecord* otherRecord =
+ sk_sp<const PaintRecord> record = this->GetPaintRecord();
danakj 2017/03/16 20:06:16 const& probably?
+ sk_sp<const PaintRecord> otherRecord =
static_cast<const DrawingDisplayItem&>(other).GetPaintRecord();
if (!record && !otherRecord)

Powered by Google App Engine
This is Rietveld 408576698