| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/graphics/compositing/PaintArtifactCompositor.h" | 5 #include "platform/graphics/compositing/PaintArtifactCompositor.h" |
| 6 | 6 |
| 7 #include "cc/layers/content_layer_client.h" | 7 #include "cc/layers/content_layer_client.h" |
| 8 #include "cc/layers/layer.h" | 8 #include "cc/layers/layer.h" |
| 9 #include "cc/layers/picture_layer.h" | 9 #include "cc/layers/picture_layer.h" |
| 10 #include "cc/playback/compositing_display_item.h" | 10 #include "cc/playback/compositing_display_item.h" |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 return json; | 214 return json; |
| 215 } | 215 } |
| 216 | 216 |
| 217 namespace { | 217 namespace { |
| 218 | 218 |
| 219 static gfx::Rect largeRect(-200000, -200000, 400000, 400000); | 219 static gfx::Rect largeRect(-200000, -200000, 400000, 400000); |
| 220 | 220 |
| 221 static void appendDisplayItemToCcDisplayItemList(const DisplayItem& displayItem, | 221 static void appendDisplayItemToCcDisplayItemList(const DisplayItem& displayItem, |
| 222 cc::DisplayItemList* list) { | 222 cc::DisplayItemList* list) { |
| 223 if (DisplayItem::isDrawingType(displayItem.getType())) { | 223 if (DisplayItem::isDrawingType(displayItem.getType())) { |
| 224 const SkPicture* picture = | 224 const PaintRecord* picture = |
| 225 static_cast<const DrawingDisplayItem&>(displayItem).picture(); | 225 static_cast<const DrawingDisplayItem&>(displayItem).picture(); |
| 226 if (!picture) | 226 if (!picture) |
| 227 return; | 227 return; |
| 228 // In theory we would pass the bounds of the picture, previously done as: | 228 // In theory we would pass the bounds of the picture, previously done as: |
| 229 // gfx::Rect bounds = gfx::SkIRectToRect(picture->cullRect().roundOut()); | 229 // gfx::Rect bounds = gfx::SkIRectToRect(picture->cullRect().roundOut()); |
| 230 // or use the visual rect directly. However, clip content layers attempt | 230 // or use the visual rect directly. However, clip content layers attempt |
| 231 // to raster in a different space than that of the visual rects. We'll be | 231 // to raster in a different space than that of the visual rects. We'll be |
| 232 // reworking visual rects further for SPv2, so for now we just pass a | 232 // reworking visual rects further for SPv2, so for now we just pass a |
| 233 // visual rect large enough to make sure items raster. | 233 // visual rect large enough to make sure items raster. |
| 234 list->CreateAndAppendDrawingItem<cc::DrawingDisplayItem>( | 234 list->CreateAndAppendDrawingItem<cc::DrawingDisplayItem>( |
| (...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 749 #ifndef NDEBUG | 749 #ifndef NDEBUG |
| 750 void PaintArtifactCompositor::showDebugData() { | 750 void PaintArtifactCompositor::showDebugData() { |
| 751 LOG(ERROR) << layersAsJSON(LayerTreeIncludesDebugInfo) | 751 LOG(ERROR) << layersAsJSON(LayerTreeIncludesDebugInfo) |
| 752 ->toPrettyJSONString() | 752 ->toPrettyJSONString() |
| 753 .utf8() | 753 .utf8() |
| 754 .data(); | 754 .data(); |
| 755 } | 755 } |
| 756 #endif | 756 #endif |
| 757 | 757 |
| 758 } // namespace blink | 758 } // namespace blink |
| OLD | NEW |