| OLD | NEW |
| 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 1204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1215 return; | 1215 return; |
| 1216 | 1216 |
| 1217 IntRect rect = intersection(tracking->lastInterestRect, interestRect()); | 1217 IntRect rect = intersection(tracking->lastInterestRect, interestRect()); |
| 1218 if (rect.isEmpty()) | 1218 if (rect.isEmpty()) |
| 1219 return; | 1219 return; |
| 1220 | 1220 |
| 1221 SkBitmap oldBitmap; | 1221 SkBitmap oldBitmap; |
| 1222 oldBitmap.allocPixels( | 1222 oldBitmap.allocPixels( |
| 1223 SkImageInfo::MakeN32Premul(rect.width(), rect.height())); | 1223 SkImageInfo::MakeN32Premul(rect.width(), rect.height())); |
| 1224 { | 1224 { |
| 1225 PaintCanvas canvas(oldBitmap); | 1225 SkiaPaintCanvas canvas(oldBitmap); |
| 1226 canvas.clear(SK_ColorTRANSPARENT); | 1226 canvas.clear(SK_ColorTRANSPARENT); |
| 1227 canvas.translate(-rect.x(), -rect.y()); | 1227 canvas.translate(-rect.x(), -rect.y()); |
| 1228 canvas.drawPicture(tracking->lastPaintedRecord.get()); | 1228 canvas.drawPicture(tracking->lastPaintedRecord.get()); |
| 1229 } | 1229 } |
| 1230 | 1230 |
| 1231 SkBitmap newBitmap; | 1231 SkBitmap newBitmap; |
| 1232 newBitmap.allocPixels( | 1232 newBitmap.allocPixels( |
| 1233 SkImageInfo::MakeN32Premul(rect.width(), rect.height())); | 1233 SkImageInfo::MakeN32Premul(rect.width(), rect.height())); |
| 1234 { | 1234 { |
| 1235 PaintCanvas canvas(newBitmap); | 1235 SkiaPaintCanvas canvas(newBitmap); |
| 1236 canvas.clear(SK_ColorTRANSPARENT); | 1236 canvas.clear(SK_ColorTRANSPARENT); |
| 1237 canvas.translate(-rect.x(), -rect.y()); | 1237 canvas.translate(-rect.x(), -rect.y()); |
| 1238 canvas.drawPicture(&newRecord); | 1238 canvas.drawPicture(&newRecord); |
| 1239 } | 1239 } |
| 1240 | 1240 |
| 1241 oldBitmap.lockPixels(); | 1241 oldBitmap.lockPixels(); |
| 1242 newBitmap.lockPixels(); | 1242 newBitmap.lockPixels(); |
| 1243 int mismatchingPixels = 0; | 1243 int mismatchingPixels = 0; |
| 1244 static const int maxMismatchesToReport = 50; | 1244 static const int maxMismatchesToReport = 50; |
| 1245 for (int bitmapY = 0; bitmapY < rect.height(); ++bitmapY) { | 1245 for (int bitmapY = 0; bitmapY < rect.height(); ++bitmapY) { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1290 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) { | 1290 void showGraphicsLayerTree(const blink::GraphicsLayer* layer) { |
| 1291 if (!layer) { | 1291 if (!layer) { |
| 1292 LOG(INFO) << "Cannot showGraphicsLayerTree for (nil)."; | 1292 LOG(INFO) << "Cannot showGraphicsLayerTree for (nil)."; |
| 1293 return; | 1293 return; |
| 1294 } | 1294 } |
| 1295 | 1295 |
| 1296 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); | 1296 String output = layer->layerTreeAsText(blink::LayerTreeIncludesDebugInfo); |
| 1297 LOG(INFO) << output.utf8().data(); | 1297 LOG(INFO) << output.utf8().data(); |
| 1298 } | 1298 } |
| 1299 #endif | 1299 #endif |
| OLD | NEW |