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

Unified Diff: third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp

Issue 2866733002: Remove owning_id from EffectNode and replace it by an opaque stable_id (Closed)
Patch Set: none Created 3 years, 7 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/core/page/scrolling/ScrollingCoordinator.cpp
diff --git a/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp b/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp
index be89186618379733becce7107e6ef7f3e41ab966..81b4822e46548d49d9598dea3fe1ed31d2a7341e 100644
--- a/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp
+++ b/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp
@@ -50,6 +50,7 @@
#include "platform/exported/WebScrollbarThemeGeometryNative.h"
#include "platform/geometry/Region.h"
#include "platform/geometry/TransformState.h"
+#include "platform/graphics/CompositorElementId.h"
#include "platform/graphics/GraphicsLayer.h"
#include "platform/instrumentation/tracing/TraceEvent.h"
#if OS(MACOSX)
@@ -337,6 +338,11 @@ void ScrollingCoordinator::RemoveWebScrollbarLayer(
GraphicsLayer::UnregisterContentsLayer(scrollbar_layer->Layer());
}
+static int NextScrollbarId() {
+ static int next_scrollbar_id = 0;
+ return ++next_scrollbar_id;
+}
+
static std::unique_ptr<WebScrollbarLayer> CreateScrollbarLayer(
Scrollbar& scrollbar,
float device_scale_factor) {
@@ -350,10 +356,15 @@ static std::unique_ptr<WebScrollbarLayer> CreateScrollbarLayer(
scrollbar_layer =
Platform::Current()->CompositorSupport()->CreateOverlayScrollbarLayer(
WebScrollbarImpl::Create(&scrollbar), painter, std::move(geometry));
+ scrollbar_layer->SetElementId(CreateCompositorElementId(
+ NextScrollbarId(), CompositorSubElementId::kScrollbar));
+
} else {
scrollbar_layer =
Platform::Current()->CompositorSupport()->CreateScrollbarLayer(
WebScrollbarImpl::Create(&scrollbar), painter, std::move(geometry));
+ scrollbar_layer->SetElementId(CreateCompositorElementId(
+ NextScrollbarId(), CompositorSubElementId::kScrollbar));
}
GraphicsLayer::RegisterContentsLayer(scrollbar_layer->Layer());
return scrollbar_layer;
@@ -372,6 +383,9 @@ ScrollingCoordinator::CreateSolidColorScrollbarLayer(
Platform::Current()->CompositorSupport()->CreateSolidColorScrollbarLayer(
web_orientation, thumb_thickness, track_start,
is_left_side_vertical_scrollbar);
+ scrollbar_layer->SetElementId(CreateCompositorElementId(
+ NextScrollbarId(), CompositorSubElementId::kScrollbar));
+
GraphicsLayer::RegisterContentsLayer(scrollbar_layer->Layer());
return scrollbar_layer;
}
« no previous file with comments | « cc/trees/property_tree_builder.cc ('k') | third_party/WebKit/Source/platform/graphics/CompositorElementId.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698