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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp

Issue 2716203002: blink: Fix cc/paint skia type mismatches (Closed)
Patch Set: Fix canvas 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 1232 matching lines...) Expand 10 before | Expand all | Expand 10 after
1243 return; 1243 return;
1244 1244
1245 IntRect rect = intersection(tracking->lastInterestRect, interestRect()); 1245 IntRect rect = intersection(tracking->lastInterestRect, interestRect());
1246 if (rect.isEmpty()) 1246 if (rect.isEmpty())
1247 return; 1247 return;
1248 1248
1249 SkBitmap oldBitmap; 1249 SkBitmap oldBitmap;
1250 oldBitmap.allocPixels( 1250 oldBitmap.allocPixels(
1251 SkImageInfo::MakeN32Premul(rect.width(), rect.height())); 1251 SkImageInfo::MakeN32Premul(rect.width(), rect.height()));
1252 { 1252 {
1253 SkCanvas bitmapCanvas(oldBitmap); 1253 PaintCanvas canvas(oldBitmap);
1254 PaintCanvasPassThrough canvas(&bitmapCanvas);
1255 canvas.clear(SK_ColorTRANSPARENT); 1254 canvas.clear(SK_ColorTRANSPARENT);
1256 canvas.translate(-rect.x(), -rect.y()); 1255 canvas.translate(-rect.x(), -rect.y());
1257 canvas.drawPicture(tracking->lastPaintedRecord.get()); 1256 canvas.drawPicture(tracking->lastPaintedRecord.get());
1258 } 1257 }
1259 1258
1260 SkBitmap newBitmap; 1259 SkBitmap newBitmap;
1261 newBitmap.allocPixels( 1260 newBitmap.allocPixels(
1262 SkImageInfo::MakeN32Premul(rect.width(), rect.height())); 1261 SkImageInfo::MakeN32Premul(rect.width(), rect.height()));
1263 { 1262 {
1264 SkCanvas bitmapCanvas(newBitmap); 1263 PaintCanvas canvas(newBitmap);
1265 PaintCanvasPassThrough canvas(&bitmapCanvas);
1266 canvas.clear(SK_ColorTRANSPARENT); 1264 canvas.clear(SK_ColorTRANSPARENT);
1267 canvas.translate(-rect.x(), -rect.y()); 1265 canvas.translate(-rect.x(), -rect.y());
1268 canvas.drawPicture(&newRecord); 1266 canvas.drawPicture(&newRecord);
1269 } 1267 }
1270 1268
1271 oldBitmap.lockPixels(); 1269 oldBitmap.lockPixels();
1272 newBitmap.lockPixels(); 1270 newBitmap.lockPixels();
1273 int mismatchingPixels = 0; 1271 int mismatchingPixels = 0;
1274 static const int maxMismatchesToReport = 50; 1272 static const int maxMismatchesToReport = 50;
1275 for (int bitmapY = 0; bitmapY < rect.height(); ++bitmapY) { 1273 for (int bitmapY = 0; bitmapY < rect.height(); ++bitmapY) {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
1320 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) { 1318 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) {
1321 if (!layer) { 1319 if (!layer) {
1322 LOG(INFO) << "Cannot showGraphicsLayerTree for (nil)."; 1320 LOG(INFO) << "Cannot showGraphicsLayerTree for (nil).";
1323 return; 1321 return;
1324 } 1322 }
1325 1323
1326 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); 1324 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo);
1327 LOG(INFO) << output.utf8().data(); 1325 LOG(INFO) << output.utf8().data();
1328 } 1326 }
1329 #endif 1327 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698