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

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

Issue 2752593002: cc: Make PaintCanvas abstract (Closed)
Patch Set: Separate files 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 1222 matching lines...) Expand 10 before | Expand all | Expand 10 after
1233 return; 1233 return;
1234 1234
1235 IntRect rect = intersection(tracking->lastInterestRect, interestRect()); 1235 IntRect rect = intersection(tracking->lastInterestRect, interestRect());
1236 if (rect.isEmpty()) 1236 if (rect.isEmpty())
1237 return; 1237 return;
1238 1238
1239 SkBitmap oldBitmap; 1239 SkBitmap oldBitmap;
1240 oldBitmap.allocPixels( 1240 oldBitmap.allocPixels(
1241 SkImageInfo::MakeN32Premul(rect.width(), rect.height())); 1241 SkImageInfo::MakeN32Premul(rect.width(), rect.height()));
1242 { 1242 {
1243 PaintCanvas canvas(oldBitmap); 1243 SkiaPaintCanvas canvas(oldBitmap);
1244 canvas.clear(SK_ColorTRANSPARENT); 1244 canvas.clear(SK_ColorTRANSPARENT);
1245 canvas.translate(-rect.x(), -rect.y()); 1245 canvas.translate(-rect.x(), -rect.y());
1246 canvas.drawPicture(tracking->lastPaintedRecord.get()); 1246 canvas.drawPicture(tracking->lastPaintedRecord.get());
1247 } 1247 }
1248 1248
1249 SkBitmap newBitmap; 1249 SkBitmap newBitmap;
1250 newBitmap.allocPixels( 1250 newBitmap.allocPixels(
1251 SkImageInfo::MakeN32Premul(rect.width(), rect.height())); 1251 SkImageInfo::MakeN32Premul(rect.width(), rect.height()));
1252 { 1252 {
1253 PaintCanvas canvas(newBitmap); 1253 SkiaPaintCanvas canvas(newBitmap);
1254 canvas.clear(SK_ColorTRANSPARENT); 1254 canvas.clear(SK_ColorTRANSPARENT);
1255 canvas.translate(-rect.x(), -rect.y()); 1255 canvas.translate(-rect.x(), -rect.y());
1256 canvas.drawPicture(&newRecord); 1256 canvas.drawPicture(&newRecord);
1257 } 1257 }
1258 1258
1259 oldBitmap.lockPixels(); 1259 oldBitmap.lockPixels();
1260 newBitmap.lockPixels(); 1260 newBitmap.lockPixels();
1261 int mismatchingPixels = 0; 1261 int mismatchingPixels = 0;
1262 static const int maxMismatchesToReport = 50; 1262 static const int maxMismatchesToReport = 50;
1263 for (int bitmapY = 0; bitmapY < rect.height(); ++bitmapY) { 1263 for (int bitmapY = 0; bitmapY < rect.height(); ++bitmapY) {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
1308 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) { 1308 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) {
1309 if (!layer) { 1309 if (!layer) {
1310 LOG(INFO) << "Cannot showGraphicsLayerTree for (nil)."; 1310 LOG(INFO) << "Cannot showGraphicsLayerTree for (nil).";
1311 return; 1311 return;
1312 } 1312 }
1313 1313
1314 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); 1314 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo);
1315 LOG(INFO) << output.utf8().data(); 1315 LOG(INFO) << output.utf8().data();
1316 } 1316 }
1317 #endif 1317 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698