Chromium Code Reviews| Index: third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp |
| diff --git a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp |
| index da3c47056d82795de41e10be38b9c866c35d6033..3ee105f4a0461c58828ff4f269a3d2e41a1a969d 100644 |
| --- a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp |
| +++ b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp |
| @@ -83,33 +83,41 @@ PaintArtifactCompositor::~PaintArtifactCompositor() |
| namespace { |
| +static gfx::Rect largeRect(-20000, -20000, 40000, 40000); |
|
chrishtr
2016/08/01 20:22:19
Recommend expanding by 10-100x in each direction,
wkorman
2016/08/01 20:32:59
Done.
|
| + |
| static void appendDisplayItemToCcDisplayItemList(const DisplayItem& displayItem, cc::DisplayItemList* list) |
| { |
| if (DisplayItem::isDrawingType(displayItem.getType())) { |
| const SkPicture* picture = static_cast<const DrawingDisplayItem&>(displayItem).picture(); |
| if (!picture) |
| return; |
| - gfx::Rect bounds = gfx::SkIRectToRect(picture->cullRect().roundOut()); |
| - list->CreateAndAppendItem<cc::DrawingDisplayItem>(bounds, sk_ref_sp(picture)); |
| + // In theory we would pass the bounds of the picture, previously done as: |
| + // gfx::Rect bounds = gfx::SkIRectToRect(picture->cullRect().roundOut()); |
| + // or use the visual rect directly. However, clip content layers attempt |
| + // to raster in a different space than that of the visual rects. We'll be |
| + // reworking visual rects further for SPv2, so for now we just pass a |
| + // visual rect large enough to make sure items raster. |
| + list->CreateAndAppendItem<cc::DrawingDisplayItem>(largeRect, sk_ref_sp(picture)); |
| } |
| } |
| static scoped_refptr<cc::DisplayItemList> recordPaintChunk(const PaintArtifact& artifact, const PaintChunk& chunk, const gfx::Rect& combinedBounds) |
| { |
| cc::DisplayItemListSettings settings; |
| - scoped_refptr<cc::DisplayItemList> list = cc::DisplayItemList::Create( |
| - gfx::Rect(combinedBounds.size()), settings); |
| + scoped_refptr<cc::DisplayItemList> list = cc::DisplayItemList::Create(settings); |
| gfx::Transform translation; |
| translation.Translate(-combinedBounds.x(), -combinedBounds.y()); |
| - // TODO(jbroman, wkorman): What visual rectangle is wanted here? |
| - list->CreateAndAppendItem<cc::TransformDisplayItem>(gfx::Rect(), translation); |
| + // Passing combinedBounds as the visual rect for the begin/end transform item |
| + // would normally be the sensible thing to do, but see comment above re: |
| + // visual rects for drawing items and further rework in flight. |
| + list->CreateAndAppendItem<cc::TransformDisplayItem>(largeRect, translation); |
| const DisplayItemList& displayItems = artifact.getDisplayItemList(); |
| for (const auto& displayItem : displayItems.itemsInPaintChunk(chunk)) |
| appendDisplayItemToCcDisplayItemList(displayItem, list.get()); |
| - list->CreateAndAppendItem<cc::EndTransformDisplayItem>(gfx::Rect()); |
| + list->CreateAndAppendItem<cc::EndTransformDisplayItem>(largeRect); |
| list->Finalize(); |
| return list; |