| 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 1161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1172 | 1172 |
| 1173 void GraphicsLayer::setCompositorMutableProperties(uint32_t properties) { | 1173 void GraphicsLayer::setCompositorMutableProperties(uint32_t properties) { |
| 1174 if (WebLayer* layer = platformLayer()) | 1174 if (WebLayer* layer = platformLayer()) |
| 1175 layer->setCompositorMutableProperties(properties); | 1175 layer->setCompositorMutableProperties(properties); |
| 1176 } | 1176 } |
| 1177 | 1177 |
| 1178 sk_sp<PaintRecord> GraphicsLayer::captureRecord() { | 1178 sk_sp<PaintRecord> GraphicsLayer::captureRecord() { |
| 1179 if (!drawsContent()) | 1179 if (!drawsContent()) |
| 1180 return nullptr; | 1180 return nullptr; |
| 1181 | 1181 |
| 1182 IntSize intSize = expandedIntSize(size()); | 1182 FloatRect bounds(IntRect(IntPoint(0, 0), expandedIntSize(size()))); |
| 1183 GraphicsContext graphicsContext(getPaintController(), | 1183 GraphicsContext graphicsContext(getPaintController(), |
| 1184 GraphicsContext::NothingDisabled, nullptr); | 1184 GraphicsContext::NothingDisabled, nullptr); |
| 1185 graphicsContext.beginRecording(IntRect(IntPoint(0, 0), intSize)); | 1185 graphicsContext.beginRecording(bounds); |
| 1186 getPaintController().paintArtifact().replay(graphicsContext); | 1186 getPaintController().paintArtifact().replay(bounds, graphicsContext); |
| 1187 return graphicsContext.endRecording(); | 1187 return graphicsContext.endRecording(); |
| 1188 } | 1188 } |
| 1189 | 1189 |
| 1190 static bool pixelComponentsDiffer(int c1, int c2) { | 1190 static bool pixelComponentsDiffer(int c1, int c2) { |
| 1191 // Compare strictly for saturated values. | 1191 // Compare strictly for saturated values. |
| 1192 if (c1 == 0 || c1 == 255 || c2 == 0 || c2 == 255) | 1192 if (c1 == 0 || c1 == 255 || c2 == 0 || c2 == 255) |
| 1193 return c1 != c2; | 1193 return c1 != c2; |
| 1194 // Tolerate invisible differences that may occur in gradients etc. | 1194 // Tolerate invisible differences that may occur in gradients etc. |
| 1195 return abs(c1 - c2) > 2; | 1195 return abs(c1 - c2) > 2; |
| 1196 } | 1196 } |
| (...skipping 93 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 |