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

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

Issue 2565073002: Implement the algorithm to test merging and overlap in PaintArtifactCompositor. (Closed)
Patch Set: none Created 4 years 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
Index: third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.h
diff --git a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.h b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.h
index 6f7c2bc57854c878a0f1199276af4290759d7f50..f1cb5b3de66d4a0a64aab1f63d6411977a5a2567 100644
--- a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.h
+++ b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.h
@@ -26,10 +26,27 @@ class Vector2dF;
namespace blink {
class JSONObject;
+class LayoutView;
class PaintArtifact;
class WebLayer;
struct PaintChunk;
+struct PendingLayer {
+ PendingLayer(const PaintChunk& firstPaintChunk) : knownToBeOpaque(false) {
+ add(firstPaintChunk);
+ }
+
+ void add(const PaintChunk& paintChunk) {
+ paintChunks.append(paintChunk);
+ bounds.unite(paintChunk.bounds);
+ knownToBeOpaque = knownToBeOpaque && paintChunk.knownToBeOpaque;
+ }
+
+ FloatRect bounds;
+ Vector<PaintChunk> paintChunks;
+ bool knownToBeOpaque;
+};
+
// Responsible for managing compositing in terms of a PaintArtifact.
//
// Owns a subtree of the compositor layer tree, and updates it in response to
@@ -82,18 +99,21 @@ class PLATFORM_EXPORT PaintArtifactCompositor {
class ContentLayerClientImpl;
+ void collectPendingLayers(const Vector<PaintChunk>& paintChunks,
+ Vector<PendingLayer>& pendingLayers);
+
// Builds a leaf layer that represents a single paint chunk.
// Note: cc::Layer API assumes the layer bounds start at (0, 0), but the
// bounding box of a paint chunk does not necessarily start at (0, 0) (and
// could even be negative). Internally the generated layer translates the
// paint chunk to align the bounding box to (0, 0) and return the actual
// origin of the paint chunk in the |layerOffset| outparam.
- scoped_refptr<cc::Layer> layerForPaintChunk(
+ scoped_refptr<cc::Layer> compositedLayerForPendingLayer(
const PaintArtifact&,
- const PaintChunk&,
+ const PendingLayer&,
gfx::Vector2dF& layerOffset,
Vector<std::unique_ptr<ContentLayerClientImpl>>& newContentLayerClients,
- RasterInvalidationTracking*);
+ RasterInvalidationTrackingMap<const PaintChunk>*);
// Finds a client among the current vector of clients that matches the paint
// chunk's id, or otherwise allocates a new one.

Powered by Google App Engine
This is Rietveld 408576698