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

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

Issue 2716203002: blink: Fix cc/paint skia type mismatches (Closed)
Patch Set: Fix canvas Created 3 years, 10 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 28ec16bf05df69cd3ff5879101a89e79992a9455..493e6c3754a565b577ac04997672a4e8886482a8 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/DrawingDisplayItem.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/DrawingDisplayItem.cpp
@@ -32,7 +32,12 @@ bool DrawingDisplayItem::drawsContent() const {
void DrawingDisplayItem::analyzeForGpuRasterization(
SkPictureGpuAnalyzer& analyzer) const {
- analyzer.analyzePicture(m_record.get());
+ // TODO(enne): Need an SkPictureGpuAnalyzer on PictureRecord.
+ // This is a bit overkill to ToSkPicture a record just to get
+ // numSlowPaths.
+ if (!m_record)
+ return;
+ analyzer.analyzePicture(ToSkPicture(m_record.get()));
}
#ifndef NDEBUG
@@ -63,11 +68,10 @@ static SkBitmap recordToBitmap(const PaintRecord* record) {
SkBitmap bitmap;
SkRect rect = record->cullRect();
bitmap.allocPixels(SkImageInfo::MakeN32Premul(rect.width(), rect.height()));
- SkCanvas bitmapCanvas(bitmap);
- PaintCanvasPassThrough canvas(&bitmapCanvas);
+ PaintCanvas canvas(bitmap);
canvas.clear(SK_ColorTRANSPARENT);
canvas.translate(-rect.x(), -rect.y());
- canvas.drawPicture(ToSkPicture(record));
+ canvas.drawPicture(record);
return bitmap;
}

Powered by Google App Engine
This is Rietveld 408576698