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

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

Issue 2676923002: End-to-end prototype of compositor scrolling with slimming paint v2 (Closed)
Patch Set: Add SPV2 test of didScroll callback Created 3 years, 10 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
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 85faa47843757739f06908f6240e1c56126d6cf3..6b72cac58ab5b98f4c1bf032ca6011f1161e6467 100644
--- a/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp
+++ b/third_party/WebKit/Source/platform/graphics/compositing/PaintArtifactCompositor.cpp
@@ -4,6 +4,9 @@
#include "platform/graphics/compositing/PaintArtifactCompositor.h"
+#include <algorithm>
+#include <memory>
+#include <utility>
#include "cc/layers/content_layer_client.h"
#include "cc/layers/layer.h"
#include "cc/layers/picture_layer.h"
@@ -40,9 +43,6 @@
#include "wtf/Allocator.h"
#include "wtf/Noncopyable.h"
#include "wtf/PtrUtil.h"
-#include <algorithm>
-#include <memory>
-#include <utility>
namespace blink {
@@ -671,7 +671,8 @@ void PaintArtifactCompositor::update(
const PaintArtifact& paintArtifact,
RasterInvalidationTrackingMap<const PaintChunk>* rasterChunkInvalidations,
bool storeDebugInfo,
- GeometryMapper& geometryMapper) {
+ GeometryMapper& geometryMapper,
+ ScrollClientMap& scrollClients) {
#ifndef NDEBUG
storeDebugInfo = true;
#endif
@@ -723,8 +724,16 @@ void PaintArtifactCompositor::update(
layer->SetTransformTreeIndex(transformId);
layer->SetClipTreeIndex(clipId);
layer->SetEffectTreeIndex(effectId);
- layer->SetScrollTreeIndex(propertyTreeManager.ensureCompositorScrollNode(
- transform->findEnclosingScrollNode()));
+ propertyTreeManager.updateLayerScrollMapping(layer.get(), transform);
+
+ if (transform->isScrollTranslation()) {
+ auto scrollClientIt = scrollClients.find(transform->scrollNode());
+ if (scrollClientIt != scrollClients.end()) {
+ layer->set_did_scroll_callback(
+ base::Bind(&blink::WebLayerScrollClient::didScroll,
+ base::Unretained(scrollClientIt->value)));
+ }
+ }
layer->SetShouldCheckBackfaceVisibility(pendingLayer.backfaceHidden);

Powered by Google App Engine
This is Rietveld 408576698