| 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 93212686c0355bd624d57c5d25bd8e48de6d8b4e..da3c47056d82795de41e10be38b9c866c35d6033 100644
|
| --- a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp
|
| +++ b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp
|
| @@ -83,41 +83,33 @@ PaintArtifactCompositor::~PaintArtifactCompositor()
|
|
|
| namespace {
|
|
|
| -static gfx::Rect largeRect(-200000, -200000, 400000, 400000);
|
| -
|
| 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;
|
| - // 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));
|
| + gfx::Rect bounds = gfx::SkIRectToRect(picture->cullRect().roundOut());
|
| + list->CreateAndAppendItem<cc::DrawingDisplayItem>(bounds, 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(settings);
|
| + scoped_refptr<cc::DisplayItemList> list = cc::DisplayItemList::Create(
|
| + gfx::Rect(combinedBounds.size()), settings);
|
|
|
| gfx::Transform translation;
|
| translation.Translate(-combinedBounds.x(), -combinedBounds.y());
|
| - // 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);
|
| + // TODO(jbroman, wkorman): What visual rectangle is wanted here?
|
| + list->CreateAndAppendItem<cc::TransformDisplayItem>(gfx::Rect(), translation);
|
|
|
| const DisplayItemList& displayItems = artifact.getDisplayItemList();
|
| for (const auto& displayItem : displayItems.itemsInPaintChunk(chunk))
|
| appendDisplayItemToCcDisplayItemList(displayItem, list.get());
|
|
|
| - list->CreateAndAppendItem<cc::EndTransformDisplayItem>(largeRect);
|
| + list->CreateAndAppendItem<cc::EndTransformDisplayItem>(gfx::Rect());
|
|
|
| list->Finalize();
|
| return list;
|
|
|