Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1409)

Unified Diff: third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp

Issue 2225563002: Reland "Raster display item lists via a visual rect RTree." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync to head. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | ui/compositor/canvas_painter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 66b643199f7b05353be93b8a6c4dcd97e053f931..a5224687dc758d16366c9649663255015a998e74 100644
--- a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp
+++ b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp
@@ -83,26 +83,34 @@ 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;
- gfx::Rect bounds = gfx::SkIRectToRect(picture->cullRect().roundOut());
- list->CreateAndAppendDrawingItem<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->CreateAndAppendDrawingItem<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?
+ // 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->CreateAndAppendPairedBeginItem<cc::TransformDisplayItem>(translation);
const DisplayItemList& displayItems = artifact.getDisplayItemList();
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | ui/compositor/canvas_painter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698