Remove WebLayer alias, use cc::Layer type directly.
Replace includes of web_layer.h in header files to forward declarations
of cc::Layer. Rename variables from web_*layer to cc_*layer or just
layer.
This does not rename the SetWebLayer() GetWebLayer() or PlatformLayer()
methods yet.
[email protected], [email protected], [email protected]
Bug: 838693
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel;master.tryserver.blink:linux_trusty_blink_rel;master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I606d7af50633e1fb57cd86a648b4f7433cb13da7
Reviewed-on: https://chromium-review.googlesource.com/1062016
Commit-Queue: danakj <[email protected]>
Reviewed-by: danakj <[email protected]>
Reviewed-by: Jeremy Roman <[email protected]>
Reviewed-by: Kentaro Hara <[email protected]>
Reviewed-by: Antoine Labour <[email protected]>
Reviewed-by: Avi Drissman <[email protected]>
Reviewed-by: Philip Rogers <[email protected]>
Reviewed-by: Dale Curtis <[email protected]>
Cr-Commit-Position: refs/heads/master@{#559561}
diff --git a/cc/layers/layer.h b/cc/layers/layer.h
index ab9aec3..41080d8 100644
--- a/cc/layers/layer.h
+++ b/cc/layers/layer.h
@@ -172,8 +172,7 @@
const FilterOperations& filters() const { return inputs_.filters; }
// Background filters are filters applied to what is behind this layer, when
- // they are viewed through non-opaque regions in this layer. They are used
- // through the WebLayer interface, and are not exposed to HTML.
+ // they are viewed through non-opaque regions in this layer.
void SetBackgroundFilters(const FilterOperations& filters);
const FilterOperations& background_filters() const {
return inputs_.background_filters;
diff --git a/content/public/browser/android/content_view_layer_renderer.h b/content/public/browser/android/content_view_layer_renderer.h
index 0bccb40..09bf2f6 100644
--- a/content/public/browser/android/content_view_layer_renderer.h
+++ b/content/public/browser/android/content_view_layer_renderer.h
@@ -5,7 +5,9 @@
#ifndef CONTENT_PUBLIC_BROWSER_ANDROID_CONTENT_VIEW_LAYER_RENDERER_H_
#define CONTENT_PUBLIC_BROWSER_ANDROID_CONTENT_VIEW_LAYER_RENDERER_H_
-#include "third_party/blink/public/platform/web_layer.h"
+namespace cc {
+class Layer;
+}
namespace content {
@@ -13,8 +15,8 @@
// attach/detach layers.
class ContentViewLayerRenderer {
public:
- virtual void AttachLayer(blink::WebLayer* layer) = 0;
- virtual void DetachLayer(blink::WebLayer* layer) = 0;
+ virtual void AttachLayer(cc::Layer* layer) = 0;
+ virtual void DetachLayer(cc::Layer* layer) = 0;
protected:
virtual ~ContentViewLayerRenderer() {}
diff --git a/content/renderer/browser_plugin/browser_plugin.cc b/content/renderer/browser_plugin/browser_plugin.cc
index 3f9d74d..e6eb03a 100644
--- a/content/renderer/browser_plugin/browser_plugin.cc
+++ b/content/renderer/browser_plugin/browser_plugin.cc
@@ -38,7 +38,6 @@
#include "third_party/blink/public/platform/web_coalesced_input_event.h"
#include "third_party/blink/public/platform/web_gesture_event.h"
#include "third_party/blink/public/platform/web_input_event.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/platform/web_mouse_wheel_event.h"
#include "third_party/blink/public/platform/web_rect.h"
#include "third_party/blink/public/web/web_ax_object.h"
@@ -857,7 +856,7 @@
}
#endif
-blink::WebLayer* BrowserPlugin::GetLayer() {
+cc::Layer* BrowserPlugin::GetLayer() {
return embedded_layer_.get();
}
diff --git a/content/renderer/browser_plugin/browser_plugin.h b/content/renderer/browser_plugin/browser_plugin.h
index e0486ec4..8ab2c1b 100644
--- a/content/renderer/browser_plugin/browser_plugin.h
+++ b/content/renderer/browser_plugin/browser_plugin.h
@@ -35,6 +35,7 @@
}
namespace cc {
+class Layer;
class RenderFrameMetadata;
}
@@ -220,7 +221,7 @@
#endif
// ChildFrameCompositor:
- blink::WebLayer* GetLayer() override;
+ cc::Layer* GetLayer() override;
void SetLayer(scoped_refptr<cc::Layer> layer,
bool prevent_contents_opaque_changes) override;
SkBitmap* GetSadPageBitmap() override;
diff --git a/content/renderer/child_frame_compositing_helper.cc b/content/renderer/child_frame_compositing_helper.cc
index 8bf2912..8ef6f5b 100644
--- a/content/renderer/child_frame_compositing_helper.cc
+++ b/content/renderer/child_frame_compositing_helper.cc
@@ -14,7 +14,6 @@
#include "cc/paint/paint_image_builder.h"
#include "content/renderer/child_frame_compositor.h"
#include "skia/ext/image_operations.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkImage.h"
#include "ui/gfx/geometry/point_f.h"
@@ -117,9 +116,9 @@
}
void ChildFrameCompositingHelper::UpdateVisibility(bool visible) {
- blink::WebLayer* web_layer = child_frame_compositor_->GetLayer();
- if (web_layer)
- web_layer->SetIsDrawable(visible);
+ cc::Layer* layer = child_frame_compositor_->GetLayer();
+ if (layer)
+ layer->SetIsDrawable(visible);
}
} // namespace content
diff --git a/content/renderer/child_frame_compositing_helper_unittest.cc b/content/renderer/child_frame_compositing_helper_unittest.cc
index f7a4f02f3..d2c3e49 100644
--- a/content/renderer/child_frame_compositing_helper_unittest.cc
+++ b/content/renderer/child_frame_compositing_helper_unittest.cc
@@ -4,9 +4,9 @@
#include "content/renderer/child_frame_compositing_helper.h"
+#include "cc/layers/layer.h"
#include "content/renderer/child_frame_compositor.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "third_party/blink/public/platform/web_layer.h"
namespace content {
@@ -20,7 +20,7 @@
sad_page_bitmap_.allocN32Pixels(width, height);
}
- blink::WebLayer* GetLayer() override { return layer_.get(); }
+ cc::Layer* GetLayer() override { return layer_.get(); }
void SetLayer(scoped_refptr<cc::Layer> layer,
bool prevent_contents_opaque_changes) override {
diff --git a/content/renderer/child_frame_compositor.h b/content/renderer/child_frame_compositor.h
index 74c81f9f..f93b026 100644
--- a/content/renderer/child_frame_compositor.h
+++ b/content/renderer/child_frame_compositor.h
@@ -5,20 +5,18 @@
#ifndef CONTENT_RENDERER_CHILD_FRAME_COMPOSITOR_H_
#define CONTENT_RENDERER_CHILD_FRAME_COMPOSITOR_H_
-#include "third_party/blink/public/platform/web_layer.h"
-
namespace cc {
class Layer;
}
namespace content {
-// A ChildFrameCompositor is an owner of a blink::WebLayer that embeds a child
+// A ChildFrameCompositor is an owner of a cc::Layer that embeds a child
// frame.
class ChildFrameCompositor {
public:
- // Get the child frame's cc::Layer wrapped as a blink::WebLayer.
- virtual blink::WebLayer* GetLayer() = 0;
+ // Get the child frame's cc::Layer.
+ virtual cc::Layer* GetLayer() = 0;
// Passes ownership of a cc::Layer to the ChildFrameCompositor.
virtual void SetLayer(scoped_refptr<cc::Layer> layer,
diff --git a/content/renderer/gpu/render_widget_compositor.cc b/content/renderer/gpu/render_widget_compositor.cc
index 51bb19a..9912bda 100644
--- a/content/renderer/gpu/render_widget_compositor.cc
+++ b/content/renderer/gpu/render_widget_compositor.cc
@@ -66,7 +66,6 @@
#include "media/base/media_switches.h"
#include "services/ui/public/cpp/gpu/context_provider_command_buffer.h"
#include "third_party/blink/public/platform/scheduler/web_main_thread_scheduler.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/platform/web_runtime_features.h"
#include "third_party/blink/public/platform/web_size.h"
#include "third_party/blink/public/web/blink.h"
@@ -785,12 +784,12 @@
return frame_sink_id_;
}
-void RenderWidgetCompositor::SetRootLayer(blink::WebLayer* layer) {
- layer_tree_host_->SetRootLayer(layer);
+void RenderWidgetCompositor::SetRootLayer(scoped_refptr<cc::Layer> layer) {
+ layer_tree_host_->SetRootLayer(std::move(layer));
}
void RenderWidgetCompositor::ClearRootLayer() {
- layer_tree_host_->SetRootLayer(scoped_refptr<cc::Layer>());
+ layer_tree_host_->SetRootLayer(nullptr);
}
cc::AnimationHost* RenderWidgetCompositor::CompositorAnimationHost() {
diff --git a/content/renderer/gpu/render_widget_compositor.h b/content/renderer/gpu/render_widget_compositor.h
index 2f3a147..933ed48 100644
--- a/content/renderer/gpu/render_widget_compositor.h
+++ b/content/renderer/gpu/render_widget_compositor.h
@@ -128,7 +128,7 @@
// WebLayerTreeView implementation.
viz::FrameSinkId GetFrameSinkId() override;
- void SetRootLayer(blink::WebLayer* layer) override;
+ void SetRootLayer(scoped_refptr<cc::Layer> layer) override;
void ClearRootLayer() override;
cc::AnimationHost* CompositorAnimationHost() override;
blink::WebSize GetViewportSize() const override;
diff --git a/content/renderer/media/stream/webmediaplayer_ms.cc b/content/renderer/media/stream/webmediaplayer_ms.cc
index faec8e1..cac09cf5 100644
--- a/content/renderer/media/stream/webmediaplayer_ms.cc
+++ b/content/renderer/media/stream/webmediaplayer_ms.cc
@@ -34,7 +34,6 @@
#include "media/blink/webmediaplayer_util.h"
#include "media/video/gpu_memory_buffer_video_frame_pool.h"
#include "services/ui/public/cpp/gpu/context_provider_command_buffer.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/platform/web_media_player_client.h"
#include "third_party/blink/public/platform/web_media_player_source.h"
#include "third_party/blink/public/platform/web_rect.h"
@@ -1005,8 +1004,8 @@
DCHECK(thread_checker_.CalledOnValidThread());
video_rotation_ = video_rotation;
- // Keep the old |video_layer_| and |video_weblayer_| alive until SetWebLayer
- // is called with a new pointer, as it may use the pointer from the last call.
+ // Keep the old |video_layer_| alive until SetWebLayer() is called with a new
+ // pointer, as it may use the pointer from the last call.
auto new_video_layer =
cc::VideoLayer::Create(compositor_.get(), video_rotation);
new_video_layer->SetContentsOpaque(is_opaque);
diff --git a/content/renderer/media/stream/webmediaplayer_ms.h b/content/renderer/media/stream/webmediaplayer_ms.h
index 896ed27..5d059bd 100644
--- a/content/renderer/media/stream/webmediaplayer_ms.h
+++ b/content/renderer/media/stream/webmediaplayer_ms.h
@@ -19,7 +19,6 @@
#include "media/blink/webmediaplayer_util.h"
#include "media/renderers/paint_canvas_video_renderer.h"
#include "media/video/gpu_video_accelerator_factories.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/platform/web_media_player.h"
#include "third_party/blink/public/platform/web_media_stream.h"
diff --git a/content/renderer/media/stream/webmediaplayer_ms_unittest.cc b/content/renderer/media/stream/webmediaplayer_ms_unittest.cc
index b801dde..bb44b51 100644
--- a/content/renderer/media/stream/webmediaplayer_ms_unittest.cc
+++ b/content/renderer/media/stream/webmediaplayer_ms_unittest.cc
@@ -12,6 +12,7 @@
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
#include "build/build_config.h"
+#include "cc/layers/layer.h"
#include "content/public/renderer/media_stream_renderer_factory.h"
#include "content/renderer/media/stream/webmediaplayer_ms.h"
#include "content/renderer/media/stream/webmediaplayer_ms_compositor.h"
@@ -21,7 +22,6 @@
#include "media/video/mock_gpu_memory_buffer_video_frame_pool.h"
#include "media/video/mock_gpu_video_accelerator_factories.h"
#include "third_party/blink/public/platform/web_fullscreen_video_status.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/platform/web_media_player.h"
#include "third_party/blink/public/platform/web_media_player_client.h"
#include "third_party/blink/public/platform/web_media_player_source.h"
@@ -444,8 +444,9 @@
// content::MediaStreamVideoRenderer.
// 2. content::MediaStreamVideoRenderer will start pushing frames into
// WebMediaPlayerMS repeatedly.
-// 3. On WebMediaPlayerMS receiving the first frame, a WebLayer will be created.
-// 4. The WebLayer will call
+// 3. On WebMediaPlayerMS receiving the first frame, a cc::Layer will be
+// created.
+// 4. The cc::Layer will call
// WebMediaPlayerMSCompositor::SetVideoFrameProviderClient, which in turn
// will trigger cc::VideoFrameProviderClient::StartRendering.
// 5. Then cc::VideoFrameProviderClient will start calling
@@ -480,7 +481,7 @@
message_loop_.task_runner(),
gpu_factories_.get(),
blink::WebString())),
- web_layer_set_(false),
+ layer_set_(false),
rendering_(false),
background_rendering_(false) {}
~WebMediaPlayerMSTest() override {
@@ -498,7 +499,7 @@
void DurationChanged() override {}
void SizeChanged() override;
void PlaybackStateChanged() override {}
- void SetWebLayer(blink::WebLayer* layer) override;
+ void SetWebLayer(cc::Layer* layer) override;
blink::WebMediaPlayer::TrackId AddAudioTrack(const blink::WebString& id,
AudioTrackKind,
const blink::WebString& label,
@@ -587,7 +588,7 @@
std::unique_ptr<WebMediaPlayerMS> player_;
WebMediaPlayerMSCompositor* compositor_;
ReusableMessageLoopEvent message_loop_controller_;
- blink::WebLayer* web_layer_;
+ cc::Layer* layer_;
bool is_audio_element_ = false;
std::vector<base::OnceClosure> frame_ready_cbs_;
@@ -596,7 +597,7 @@
// rendering.
void RenderFrame();
- bool web_layer_set_;
+ bool layer_set_;
bool rendering_;
bool background_rendering_;
};
@@ -646,13 +647,13 @@
player_->Play();
}
-void WebMediaPlayerMSTest::SetWebLayer(blink::WebLayer* layer) {
+void WebMediaPlayerMSTest::SetWebLayer(cc::Layer* layer) {
// Make sure that the old layer is still alive, see http://crbug.com/705448.
- if (web_layer_set_)
- EXPECT_TRUE(web_layer_ != nullptr);
- web_layer_set_ = layer ? true : false;
+ if (layer_set_)
+ EXPECT_TRUE(layer_ != nullptr);
+ layer_set_ = layer ? true : false;
- web_layer_ = layer;
+ layer_ = layer;
if (layer)
compositor_->SetVideoFrameProviderClient(this);
DoSetWebLayer(!!layer);
@@ -988,20 +989,20 @@
CheckSizeChanged(gfx::Size(kStandardWidth, kStandardHeight)));
message_loop_controller_.RunAndWaitForStatus(
media::PipelineStatus::PIPELINE_OK);
- ASSERT_TRUE(web_layer_ != nullptr);
- EXPECT_TRUE(web_layer_->contents_opaque());
+ ASSERT_TRUE(layer_ != nullptr);
+ EXPECT_TRUE(layer_->contents_opaque());
// Push one transparent frame.
provider->QueueFrames(timestamps, false);
message_loop_controller_.RunAndWaitForStatus(
media::PipelineStatus::PIPELINE_OK);
- EXPECT_FALSE(web_layer_->contents_opaque());
+ EXPECT_FALSE(layer_->contents_opaque());
// Push another opaque frame.
provider->QueueFrames(timestamps, true);
message_loop_controller_.RunAndWaitForStatus(
media::PipelineStatus::PIPELINE_OK);
- EXPECT_TRUE(web_layer_->contents_opaque());
+ EXPECT_TRUE(layer_->contents_opaque());
testing::Mock::VerifyAndClearExpectations(this);
EXPECT_CALL(*this, DoSetWebLayer(false));
diff --git a/content/renderer/pepper/fullscreen_container.h b/content/renderer/pepper/fullscreen_container.h
index 74be5d2..2855b9e 100644
--- a/content/renderer/pepper/fullscreen_container.h
+++ b/content/renderer/pepper/fullscreen_container.h
@@ -5,13 +5,15 @@
#ifndef CONTENT_RENDERER_PEPPER_FULLSCREEN_CONTAINER_H_
#define CONTENT_RENDERER_PEPPER_FULLSCREEN_CONTAINER_H_
-#include "third_party/blink/public/platform/web_layer.h"
-
namespace blink {
struct WebCursorInfo;
struct WebRect;
} // namespace blink
+namespace cc {
+class Layer;
+}
+
namespace content {
// This class is like a lightweight WebPluginContainer for fullscreen PPAPI
@@ -34,7 +36,7 @@
// Notifies the container that the mouse cursor has changed.
virtual void PepperDidChangeCursor(const blink::WebCursorInfo& cursor) = 0;
- virtual void SetLayer(blink::WebLayer* layer) = 0;
+ virtual void SetLayer(cc::Layer* layer) = 0;
protected:
virtual ~FullscreenContainer() {}
diff --git a/content/renderer/pepper/pepper_plugin_instance_impl.cc b/content/renderer/pepper/pepper_plugin_instance_impl.cc
index 766c19f..303291e 100644
--- a/content/renderer/pepper/pepper_plugin_instance_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_instance_impl.cc
@@ -100,7 +100,6 @@
#include "third_party/blink/public/platform/web_float_rect.h"
#include "third_party/blink/public/platform/web_input_event.h"
#include "third_party/blink/public/platform/web_keyboard_event.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/platform/web_mouse_event.h"
#include "third_party/blink/public/platform/web_pointer_event.h"
#include "third_party/blink/public/platform/web_rect.h"
diff --git a/content/renderer/pepper/pepper_plugin_instance_impl.h b/content/renderer/pepper/pepper_plugin_instance_impl.h
index 9e46053..6d55411 100644
--- a/content/renderer/pepper/pepper_plugin_instance_impl.h
+++ b/content/renderer/pepper/pepper_plugin_instance_impl.h
@@ -57,7 +57,6 @@
#include "ppapi/thunk/ppb_gamepad_api.h"
#include "ppapi/thunk/resource_creation_api.h"
#include "third_party/blink/public/platform/web_canvas.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/platform/web_string.h"
#include "third_party/blink/public/platform/web_url_response.h"
#include "third_party/blink/public/web/web_associated_url_loader_client.h"
diff --git a/content/renderer/render_frame_proxy.cc b/content/renderer/render_frame_proxy.cc
index 25b4494..fd11302 100644
--- a/content/renderer/render_frame_proxy.cc
+++ b/content/renderer/render_frame_proxy.cc
@@ -37,7 +37,6 @@
#include "third_party/blink/public/common/feature_policy/feature_policy.h"
#include "third_party/blink/public/common/frame/frame_policy.h"
#include "third_party/blink/public/platform/url_conversion.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/platform/web_rect.h"
#include "third_party/blink/public/platform/web_resource_timing_info.h"
#include "third_party/blink/public/platform/web_string.h"
@@ -864,7 +863,7 @@
}
#endif
-blink::WebLayer* RenderFrameProxy::GetLayer() {
+cc::Layer* RenderFrameProxy::GetLayer() {
return embedded_layer_.get();
}
diff --git a/content/renderer/render_frame_proxy.h b/content/renderer/render_frame_proxy.h
index 07992f5..649f4ee 100644
--- a/content/renderer/render_frame_proxy.h
+++ b/content/renderer/render_frame_proxy.h
@@ -264,7 +264,7 @@
#endif
// ChildFrameCompositor:
- blink::WebLayer* GetLayer() override;
+ cc::Layer* GetLayer() override;
void SetLayer(scoped_refptr<cc::Layer> layer,
bool prevent_contents_opaque_changes) override;
SkBitmap* GetSadPageBitmap() override;
diff --git a/content/renderer/render_widget_fullscreen_pepper.cc b/content/renderer/render_widget_fullscreen_pepper.cc
index b5eee66..1e908be 100644
--- a/content/renderer/render_widget_fullscreen_pepper.cc
+++ b/content/renderer/render_widget_fullscreen_pepper.cc
@@ -21,7 +21,6 @@
#include "third_party/blink/public/platform/web_canvas.h"
#include "third_party/blink/public/platform/web_cursor_info.h"
#include "third_party/blink/public/platform/web_gesture_event.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/platform/web_mouse_wheel_event.h"
#include "third_party/blink/public/platform/web_size.h"
#include "third_party/blink/public/web/web_widget.h"
@@ -333,7 +332,7 @@
}
// TODO(danakj): These should be a scoped_refptr<cc::Layer>.
-void RenderWidgetFullscreenPepper::SetLayer(blink::WebLayer* layer) {
+void RenderWidgetFullscreenPepper::SetLayer(cc::Layer* layer) {
layer_ = layer;
if (!layer_) {
if (compositor_)
diff --git a/content/renderer/render_widget_fullscreen_pepper.h b/content/renderer/render_widget_fullscreen_pepper.h
index 7aefd8e..0faccb2 100644
--- a/content/renderer/render_widget_fullscreen_pepper.h
+++ b/content/renderer/render_widget_fullscreen_pepper.h
@@ -13,10 +13,13 @@
#include "content/renderer/mouse_lock_dispatcher.h"
#include "content/renderer/pepper/fullscreen_container.h"
#include "content/renderer/render_widget.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/web/web_widget.h"
#include "url/gurl.h"
+namespace cc {
+class Layer;
+}
+
namespace content {
class CompositorDependencies;
class PepperPluginInstanceImpl;
@@ -42,7 +45,7 @@
void ScrollRect(int dx, int dy, const blink::WebRect& rect) override;
void Destroy() override;
void PepperDidChangeCursor(const blink::WebCursorInfo& cursor) override;
- void SetLayer(blink::WebLayer* layer) override;
+ void SetLayer(cc::Layer* layer) override;
// RenderWidget overrides.
bool OnMessageReceived(const IPC::Message& msg) override;
@@ -81,7 +84,7 @@
// The plugin instance this widget wraps.
PepperPluginInstanceImpl* plugin_;
- blink::WebLayer* layer_;
+ cc::Layer* layer_;
std::unique_ptr<MouseLockDispatcher> mouse_lock_dispatcher_;
diff --git a/content/shell/android/shell_manager.h b/content/shell/android/shell_manager.h
index 2c4aca9..910a117 100644
--- a/content/shell/android/shell_manager.h
+++ b/content/shell/android/shell_manager.h
@@ -9,10 +9,13 @@
#include "base/android/jni_android.h"
#include "base/android/scoped_java_ref.h"
-#include "third_party/blink/public/platform/web_layer.h"
class Shell;
+namespace cc {
+class Layer;
+}
+
namespace content {
// Creates an Android specific shell view, which is our version of a shell
@@ -24,8 +27,8 @@
// Removes a previously created shell view.
void RemoveShellView(const base::android::JavaRef<jobject>& shell_view);
-void ShellAttachLayer(blink::WebLayer* layer);
-void ShellRemoveLayer(blink::WebLayer* layer);
+void ShellAttachLayer(cc::Layer* layer);
+void ShellRemoveLayer(cc::Layer* layer);
} // namespace content
#endif // CONTENT_SHELL_ANDROID_SHELL_MANAGER_H_
diff --git a/content/shell/test_runner/test_plugin.cc b/content/shell/test_runner/test_plugin.cc
index 7cccbb3f..7ab9b90 100644
--- a/content/shell/test_runner/test_plugin.cc
+++ b/content/shell/test_runner/test_plugin.cc
@@ -24,7 +24,6 @@
#include "third_party/blink/public/platform/web_gesture_event.h"
#include "third_party/blink/public/platform/web_graphics_context_3d_provider.h"
#include "third_party/blink/public/platform/web_input_event.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/platform/web_mouse_event.h"
#include "third_party/blink/public/platform/web_thread.h"
#include "third_party/blink/public/platform/web_touch_event.h"
diff --git a/content/shell/test_runner/test_plugin.h b/content/shell/test_runner/test_plugin.h
index 2f9f597..ef8d9ce 100644
--- a/content/shell/test_runner/test_plugin.h
+++ b/content/shell/test_runner/test_plugin.h
@@ -14,7 +14,6 @@
#include "cc/resources/shared_bitmap_id_registrar.h"
#include "gpu/command_buffer/common/mailbox.h"
#include "gpu/command_buffer/common/sync_token.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/web/web_document.h"
#include "third_party/blink/public/web/web_element.h"
#include "third_party/blink/public/web/web_local_frame.h"
diff --git a/media/blink/DEPS b/media/blink/DEPS
index 1075bb50..ac48eba 100644
--- a/media/blink/DEPS
+++ b/media/blink/DEPS
@@ -1,4 +1,5 @@
include_rules = [
+ "+cc/layers/layer.h",
"+cc/layers/video_frame_provider.h",
"+cc/layers/video_layer.h",
"+components/scheduler", # Only allowed in tests.
diff --git a/media/blink/webmediaplayer_impl.cc b/media/blink/webmediaplayer_impl.cc
index d5825e8..f9c59ec 100644
--- a/media/blink/webmediaplayer_impl.cc
+++ b/media/blink/webmediaplayer_impl.cc
@@ -55,7 +55,6 @@
#include "media/filters/ffmpeg_demuxer.h"
#include "media/media_buildflags.h"
#include "third_party/blink/public/platform/web_encrypted_media_types.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/platform/web_localized_string.h"
#include "third_party/blink/public/platform/web_media_player_client.h"
#include "third_party/blink/public/platform/web_media_player_encrypted_media_client.h"
@@ -399,14 +398,14 @@
void WebMediaPlayerImpl::OnWebLayerUpdated() {}
-void WebMediaPlayerImpl::RegisterContentsLayer(blink::WebLayer* web_layer) {
+void WebMediaPlayerImpl::RegisterContentsLayer(cc::Layer* layer) {
DCHECK(bridge_);
bridge_->GetWebLayer()->SetContentsOpaque(opaque_);
- client_->SetWebLayer(web_layer);
+ client_->SetWebLayer(layer);
}
-void WebMediaPlayerImpl::UnregisterContentsLayer(blink::WebLayer* web_layer) {
- // |client_| will unregister its WebLayer if given a nullptr.
+void WebMediaPlayerImpl::UnregisterContentsLayer(cc::Layer* layer) {
+ // |client_| will unregister its cc::Layer if given a nullptr.
client_->SetWebLayer(nullptr);
}
diff --git a/media/blink/webmediaplayer_impl.h b/media/blink/webmediaplayer_impl.h
index 3080ed4..10f98cf 100644
--- a/media/blink/webmediaplayer_impl.h
+++ b/media/blink/webmediaplayer_impl.h
@@ -43,7 +43,6 @@
#include "media/renderers/paint_canvas_video_renderer.h"
#include "third_party/blink/public/platform/web_audio_source_provider.h"
#include "third_party/blink/public/platform/web_content_decryption_module_result.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/platform/web_media_player.h"
#include "third_party/blink/public/platform/web_surface_layer_bridge.h"
#include "url/gurl.h"
@@ -121,8 +120,8 @@
// WebSurfaceLayerBridgeObserver implementation.
void OnWebLayerUpdated() override;
- void RegisterContentsLayer(blink::WebLayer* web_layer) override;
- void UnregisterContentsLayer(blink::WebLayer* web_layer) override;
+ void RegisterContentsLayer(cc::Layer* layer) override;
+ void UnregisterContentsLayer(cc::Layer* layer) override;
void OnSurfaceIdUpdated(viz::SurfaceId surface_id) override;
void Load(LoadType load_type,
diff --git a/media/blink/webmediaplayer_impl_unittest.cc b/media/blink/webmediaplayer_impl_unittest.cc
index 40dd692..6494c7dc 100644
--- a/media/blink/webmediaplayer_impl_unittest.cc
+++ b/media/blink/webmediaplayer_impl_unittest.cc
@@ -22,6 +22,7 @@
#include "base/threading/thread.h"
#include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h"
+#include "cc/layers/layer.h"
#include "components/viz/test/test_context_provider.h"
#include "media/base/decoder_buffer.h"
#include "media/base/gmock_callback_support.h"
@@ -44,7 +45,6 @@
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/platform/web_fullscreen_video_status.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/platform/web_media_player.h"
#include "third_party/blink/public/platform/web_media_player_client.h"
#include "third_party/blink/public/platform/web_media_player_source.h"
@@ -131,7 +131,7 @@
MOCK_METHOD0(DurationChanged, void());
MOCK_METHOD0(SizeChanged, void());
MOCK_METHOD0(PlaybackStateChanged, void());
- MOCK_METHOD1(SetWebLayer, void(blink::WebLayer*));
+ MOCK_METHOD1(SetWebLayer, void(cc::Layer*));
MOCK_METHOD5(AddAudioTrack,
blink::WebMediaPlayer::TrackId(
const blink::WebString&,
@@ -281,7 +281,7 @@
class MockSurfaceLayerBridge : public blink::WebSurfaceLayerBridge {
public:
- MOCK_CONST_METHOD0(GetWebLayer, blink::WebLayer*());
+ MOCK_CONST_METHOD0(GetWebLayer, cc::Layer*());
MOCK_CONST_METHOD0(GetFrameSinkId, const viz::FrameSinkId&());
MOCK_METHOD0(ClearSurfaceId, void());
};
diff --git a/third_party/blink/public/BUILD.gn b/third_party/blink/public/BUILD.gn
index 0cc9bff9..d16a3ef 100644
--- a/third_party/blink/public/BUILD.gn
+++ b/third_party/blink/public/BUILD.gn
@@ -251,7 +251,6 @@
"platform/web_encrypted_media_request.h",
"platform/web_encrypted_media_types.h",
"platform/web_event_listener_properties.h",
- "platform/web_external_texture_layer.h",
"platform/web_fallback_theme_engine.h",
"platform/web_file_error.h",
"platform/web_file_info.h",
@@ -284,7 +283,6 @@
"platform/web_image.h",
"platform/web_image_capture_frame_grabber.h",
"platform/web_image_generator.h",
- "platform/web_image_layer.h",
"platform/web_inband_text_track.h",
"platform/web_inband_text_track_client.h",
"platform/web_input_event.h",
@@ -293,7 +291,6 @@
"platform/web_intrinsic_sizing_info.h",
"platform/web_isolated_world_ids.h",
"platform/web_keyboard_event.h",
- "platform/web_layer.h",
"platform/web_layer_scroll_client.h",
"platform/web_layer_tree_view.h",
"platform/web_loading_behavior_flag.h",
diff --git a/third_party/blink/public/platform/web_external_texture_layer.h b/third_party/blink/public/platform/web_external_texture_layer.h
deleted file mode 100644
index 72ad5a28..0000000
--- a/third_party/blink/public/platform/web_external_texture_layer.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_EXTERNAL_TEXTURE_LAYER_H_
-#define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_EXTERNAL_TEXTURE_LAYER_H_
-
-#include "third_party/blink/public/platform/web_common.h"
-#include "third_party/blink/public/platform/web_layer.h"
-
-namespace gfx {
-class PointF;
-}
-
-namespace blink {
-
-// This class represents a layer that renders a texture that is generated
-// externally (not managed by the WebLayerTreeView).
-// The texture will be used by the WebLayerTreeView during compositing passes.
-// When in single-thread mode, this means during WebLayerTreeView::composite().
-// When using the threaded compositor, this can mean at an arbitrary time until
-// the WebLayerTreeView is destroyed.
-class WebExternalTextureLayer {
- public:
- virtual ~WebExternalTextureLayer() = default;
-
- virtual WebLayer* Layer() = 0;
-
- // Clears texture from the layer.
- virtual void ClearTexture() = 0;
-
- // Sets whether every pixel in this layer is opaque. Defaults to false.
- virtual void SetOpaque(bool) = 0;
-
- // Sets whether this texture should be Y-flipped at draw time. Defaults to
- // true.
- virtual void SetFlipped(bool flipped) = 0;
-
- // Sets whether this layer's texture has premultiplied alpha or not. Defaults
- // to true.
- virtual void SetPremultipliedAlpha(bool) = 0;
-
- // Sets whether the texture should be blended with the background color
- // at draw time. Defaults to false.
- virtual void SetBlendBackgroundColor(bool) = 0;
-
- // Sets whether this texture should use nearest neighbor interpolation as
- // opposed to bilinear. Defaults to false.
- virtual void SetNearestNeighbor(bool) = 0;
-
- // Sets a UV transform to be used at draw time. Defaults to (0, 0) and (1, 1).
- virtual void SetUV(const gfx::PointF& left_top,
- const gfx::PointF& right_bottom) = 0;
-};
-
-} // namespace blink
-
-#endif // THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_EXTERNAL_TEXTURE_LAYER_H_
diff --git a/third_party/blink/public/platform/web_image_layer.h b/third_party/blink/public/platform/web_image_layer.h
deleted file mode 100644
index f7c11591..0000000
--- a/third_party/blink/public/platform/web_image_layer.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_IMAGE_LAYER_H_
-#define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_IMAGE_LAYER_H_
-
-#include "third_party/blink/public/platform/web_common.h"
-#include "third_party/blink/public/platform/web_layer.h"
-
-#if INSIDE_BLINK
-#include "third_party/blink/renderer/platform/graphics/paint/paint_image.h"
-#else
-#include "cc/paint/paint_image.h"
-using PaintImage = cc::PaintImage;
-#endif
-
-namespace blink {
-
-class WebImageLayer {
- public:
- virtual ~WebImageLayer() = default;
-
- virtual WebLayer* Layer() = 0;
- virtual void SetImage(PaintImage,
- const SkMatrix&,
- bool uses_width_as_height) = 0;
- virtual void SetNearestNeighbor(bool) = 0;
-};
-
-} // namespace blink
-
-#endif // THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_IMAGE_LAYER_H_
diff --git a/third_party/blink/public/platform/web_layer.h b/third_party/blink/public/platform/web_layer.h
deleted file mode 100644
index 6f4b0b7..0000000
--- a/third_party/blink/public/platform/web_layer.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_LAYER_H_
-#define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_LAYER_H_
-
-#include "cc/layers/layer.h"
-#include "third_party/blink/public/platform/web_common.h"
-
-namespace blink {
-
-using WebLayer = cc::Layer;
-
-} // namespace blink
-
-#endif // THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_LAYER_H_
diff --git a/third_party/blink/public/platform/web_layer_tree_view.h b/third_party/blink/public/platform/web_layer_tree_view.h
index e94b83f..2622020 100644
--- a/third_party/blink/public/platform/web_layer_tree_view.h
+++ b/third_party/blink/public/platform/web_layer_tree_view.h
@@ -28,13 +28,13 @@
#include "base/callback.h"
#include "cc/input/overscroll_behavior.h"
+#include "cc/layers/layer.h"
#include "cc/trees/layer_tree_mutator.h"
#include "components/viz/common/surfaces/frame_sink_id.h"
#include "third_party/blink/public/platform/web_browser_controls_state.h"
#include "third_party/blink/public/platform/web_common.h"
#include "third_party/blink/public/platform/web_event_listener_properties.h"
#include "third_party/blink/public/platform/web_float_point.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/platform/web_size.h"
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/skia/include/core/SkImage.h"
@@ -75,8 +75,7 @@
// Initialization and lifecycle --------------------------------------
// Sets the root of the tree. The root is set by way of the constructor.
- // TODO(danakj): This should be a scoped_refptr<cc::Layer>.
- virtual void SetRootLayer(WebLayer*) {}
+ virtual void SetRootLayer(scoped_refptr<cc::Layer>) {}
virtual void ClearRootLayer() {}
// TODO(loyso): This should use CompositorAnimationHost. crbug.com/584551
@@ -165,13 +164,12 @@
virtual void SetDeferCommits(bool defer_commits) {}
struct ViewportLayers {
- // TODO(danakj): These should be a scoped_refptr<cc::Layer>.
- WebLayer* overscroll_elasticity = nullptr;
- WebLayer* page_scale = nullptr;
- WebLayer* inner_viewport_container = nullptr;
- WebLayer* outer_viewport_container = nullptr;
- WebLayer* inner_viewport_scroll = nullptr;
- WebLayer* outer_viewport_scroll = nullptr;
+ scoped_refptr<cc::Layer> overscroll_elasticity;
+ scoped_refptr<cc::Layer> page_scale;
+ scoped_refptr<cc::Layer> inner_viewport_container;
+ scoped_refptr<cc::Layer> outer_viewport_container;
+ scoped_refptr<cc::Layer> inner_viewport_scroll;
+ scoped_refptr<cc::Layer> outer_viewport_scroll;
};
// Identify key viewport layers to the compositor.
diff --git a/third_party/blink/public/platform/web_media_player_client.h b/third_party/blink/public/platform/web_media_player_client.h
index ff9dc33..a16ba4a 100644
--- a/third_party/blink/public/platform/web_media_player_client.h
+++ b/third_party/blink/public/platform/web_media_player_client.h
@@ -32,11 +32,14 @@
#define THIRD_PARTY_BLINK_PUBLIC_PLATFORM_WEB_MEDIA_PLAYER_CLIENT_H_
#include "third_party/blink/public/platform/web_common.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/platform/web_localized_string.h"
#include "third_party/blink/public/platform/web_media_player.h"
#include "ui/gfx/color_space.h"
+namespace cc {
+class Layer;
+}
+
namespace blink {
class WebInbandTextTrack;
@@ -74,7 +77,7 @@
virtual void DurationChanged() = 0;
virtual void SizeChanged() = 0;
virtual void PlaybackStateChanged() = 0;
- virtual void SetWebLayer(WebLayer*) = 0;
+ virtual void SetWebLayer(cc::Layer*) = 0;
virtual WebMediaPlayer::TrackId AddAudioTrack(const WebString& id,
AudioTrackKind,
const WebString& label,
diff --git a/third_party/blink/public/platform/web_surface_layer_bridge.h b/third_party/blink/public/platform/web_surface_layer_bridge.h
index 73939d1..379fc73 100644
--- a/third_party/blink/public/platform/web_surface_layer_bridge.h
+++ b/third_party/blink/public/platform/web_surface_layer_bridge.h
@@ -7,20 +7,19 @@
#include "components/viz/common/surfaces/surface_id.h"
#include "third_party/blink/public/platform/web_common.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/platform/web_layer_tree_view.h"
namespace blink {
-// Listens for updates made on the WebLayer by the WebSurfaceLayerBridge.
+// Listens for updates made on the cc::Layer by the WebSurfaceLayerBridge.
class BLINK_PLATFORM_EXPORT WebSurfaceLayerBridgeObserver {
public:
// Triggered by resizing or surface layer creation.
virtual void OnWebLayerUpdated() = 0;
// Called when new a SurfaceLayer is created.
- virtual void RegisterContentsLayer(WebLayer*) = 0;
- virtual void UnregisterContentsLayer(WebLayer*) = 0;
+ virtual void RegisterContentsLayer(cc::Layer*) = 0;
+ virtual void UnregisterContentsLayer(cc::Layer*) = 0;
// Called when a SurfaceLayer is activated.
virtual void OnSurfaceIdUpdated(viz::SurfaceId surface_id){};
@@ -33,7 +32,7 @@
WebLayerTreeView*,
WebSurfaceLayerBridgeObserver*);
virtual ~WebSurfaceLayerBridge();
- virtual WebLayer* GetWebLayer() const = 0;
+ virtual cc::Layer* GetWebLayer() const = 0;
virtual const viz::FrameSinkId& GetFrameSinkId() const = 0;
virtual void ClearSurfaceId() = 0;
};
diff --git a/third_party/blink/public/web/web_plugin_container.h b/third_party/blink/public/web/web_plugin_container.h
index 21691d7..ee49fc6d 100644
--- a/third_party/blink/public/web/web_plugin_container.h
+++ b/third_party/blink/public/web/web_plugin_container.h
@@ -33,9 +33,12 @@
#define THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_PLUGIN_CONTAINER_H_
#include "third_party/blink/public/platform/web_common.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "v8/include/v8.h"
+namespace cc {
+class Layer;
+}
+
namespace blink {
class WebDocument;
@@ -138,7 +141,8 @@
// Sets the layer representing the plugin for compositing. The
// WebPluginContainer does *not* take ownership.
- virtual void SetWebLayer(WebLayer*, bool prevent_contents_opaque_changes) = 0;
+ virtual void SetWebLayer(cc::Layer*,
+ bool prevent_contents_opaque_changes) = 0;
virtual void RequestFullscreen() = 0;
virtual bool IsFullscreenElement() const = 0;
diff --git a/third_party/blink/public/web/web_remote_frame.h b/third_party/blink/public/web/web_remote_frame.h
index d4c2a53..800f067 100644
--- a/third_party/blink/public/web/web_remote_frame.h
+++ b/third_party/blink/public/web/web_remote_frame.h
@@ -9,10 +9,13 @@
#include "third_party/blink/public/common/frame/sandbox_flags.h"
#include "third_party/blink/public/platform/web_content_security_policy.h"
#include "third_party/blink/public/platform/web_insecure_request_policy.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/web/web_frame.h"
#include "v8/include/v8.h"
+namespace cc {
+class Layer;
+}
+
namespace blink {
enum class WebTreeScopeType;
@@ -61,7 +64,8 @@
WebFrame* opener) = 0;
// Layer for the in-process compositor.
- virtual void SetWebLayer(WebLayer*, bool prevent_contents_opaque_changes) = 0;
+ virtual void SetWebLayer(cc::Layer*,
+ bool prevent_contents_opaque_changes) = 0;
// Set security origin replicated from another process.
virtual void SetReplicatedOrigin(
diff --git a/third_party/blink/renderer/core/exported/web_frame_test.cc b/third_party/blink/renderer/core/exported/web_frame_test.cc
index 8f2328f..52f79f94 100644
--- a/third_party/blink/renderer/core/exported/web_frame_test.cc
+++ b/third_party/blink/renderer/core/exported/web_frame_test.cc
@@ -8144,11 +8144,11 @@
PaintLayerCompositor* compositor = web_view_helper.GetWebView()->Compositor();
GraphicsLayer* scroll_layer = compositor->ScrollLayer();
ASSERT_TRUE(scroll_layer);
- WebLayer* web_scroll_layer = scroll_layer->PlatformLayer();
+ cc::Layer* cc_scroll_layer = scroll_layer->PlatformLayer();
- // Verify that the WebLayer is not scrollable initially.
- ASSERT_FALSE(web_scroll_layer->user_scrollable_horizontal());
- ASSERT_FALSE(web_scroll_layer->user_scrollable_vertical());
+ // Verify that the cc::Layer is not scrollable initially.
+ ASSERT_FALSE(cc_scroll_layer->user_scrollable_horizontal());
+ ASSERT_FALSE(cc_scroll_layer->user_scrollable_vertical());
// Call javascript to make the layer scrollable, and verify it.
WebLocalFrameImpl* frame = web_view_helper.LocalMainFrame();
@@ -8156,9 +8156,9 @@
web_view_helper.GetWebView()->UpdateAllLifecyclePhases();
scroll_layer = compositor->ScrollLayer();
- web_scroll_layer = scroll_layer->PlatformLayer();
- ASSERT_TRUE(web_scroll_layer->user_scrollable_horizontal());
- ASSERT_TRUE(web_scroll_layer->user_scrollable_vertical());
+ cc_scroll_layer = scroll_layer->PlatformLayer();
+ ASSERT_TRUE(cc_scroll_layer->user_scrollable_horizontal());
+ ASSERT_TRUE(cc_scroll_layer->user_scrollable_vertical());
}
// Test that currentHistoryItem reflects the current page, not the provisional
@@ -8480,15 +8480,15 @@
web_view_helper.Resize(WebSize(viewport_width, viewport_height));
web_view_impl->UpdateAllLifecyclePhases();
- WebLayer* web_scroll_layer = web_view_impl->MainFrameImpl()
+ cc::Layer* cc_scroll_layer = web_view_impl->MainFrameImpl()
->GetFrame()
->View()
->LayoutViewportScrollableArea()
->LayerForScrolling()
->PlatformLayer();
- ASSERT_TRUE(web_scroll_layer->scrollable());
- ASSERT_TRUE(web_scroll_layer->user_scrollable_horizontal());
- ASSERT_TRUE(web_scroll_layer->user_scrollable_vertical());
+ ASSERT_TRUE(cc_scroll_layer->scrollable());
+ ASSERT_TRUE(cc_scroll_layer->user_scrollable_horizontal());
+ ASSERT_TRUE(cc_scroll_layer->user_scrollable_vertical());
LocalFrame* frame = web_view_impl->MainFrameImpl()->GetFrame();
Document* document = frame->GetDocument();
@@ -8505,21 +8505,21 @@
Fullscreen::FullscreenElementFrom(*document));
// Verify that the main frame is still scrollable.
- web_scroll_layer = web_view_impl->MainFrameImpl()
- ->GetFrame()
- ->View()
- ->LayoutViewportScrollableArea()
- ->LayerForScrolling()
- ->PlatformLayer();
- ASSERT_TRUE(web_scroll_layer->scrollable());
- ASSERT_TRUE(web_scroll_layer->user_scrollable_horizontal());
- ASSERT_TRUE(web_scroll_layer->user_scrollable_vertical());
+ cc_scroll_layer = web_view_impl->MainFrameImpl()
+ ->GetFrame()
+ ->View()
+ ->LayoutViewportScrollableArea()
+ ->LayerForScrolling()
+ ->PlatformLayer();
+ ASSERT_TRUE(cc_scroll_layer->scrollable());
+ ASSERT_TRUE(cc_scroll_layer->user_scrollable_horizontal());
+ ASSERT_TRUE(cc_scroll_layer->user_scrollable_vertical());
// Verify the main frame still behaves correctly after a resize.
web_view_helper.Resize(WebSize(viewport_height, viewport_width));
- ASSERT_TRUE(web_scroll_layer->scrollable());
- ASSERT_TRUE(web_scroll_layer->user_scrollable_horizontal());
- ASSERT_TRUE(web_scroll_layer->user_scrollable_vertical());
+ ASSERT_TRUE(cc_scroll_layer->scrollable());
+ ASSERT_TRUE(cc_scroll_layer->user_scrollable_horizontal());
+ ASSERT_TRUE(cc_scroll_layer->user_scrollable_vertical());
}
TEST_F(WebFrameTest, FullscreenSubframe) {
@@ -12777,14 +12777,14 @@
EXPECT_NE(nullptr, scrollable_area);
// We should have a composited layer for scrolling due to will-change.
- WebLayer* web_scroll_layer =
+ cc::Layer* cc_scroll_layer =
scrollable_area->LayerForScrolling()->PlatformLayer();
- EXPECT_NE(nullptr, web_scroll_layer);
+ EXPECT_NE(nullptr, cc_scroll_layer);
// Ensure a synthetic impl-side scroll offset propagates to the scrollable
// area using the DidScroll callback.
EXPECT_EQ(ScrollOffset(), scrollable_area->GetScrollOffset());
- web_scroll_layer->SetScrollOffsetFromImplSide(gfx::ScrollOffset(0, 1));
+ cc_scroll_layer->SetScrollOffsetFromImplSide(gfx::ScrollOffset(0, 1));
web_view->UpdateAllLifecyclePhases();
EXPECT_EQ(ScrollOffset(0, 1), scrollable_area->GetScrollOffset());
@@ -12802,7 +12802,7 @@
// The web scroll layer has not been deleted yet and we should be able to
// apply impl-side offsets without crashing.
- web_scroll_layer->SetScrollOffsetFromImplSide(gfx::ScrollOffset(0, 3));
+ cc_scroll_layer->SetScrollOffsetFromImplSide(gfx::ScrollOffset(0, 3));
}
class SlimmingPaintWebFrameTest : public PaintTestConfigurations,
diff --git a/third_party/blink/renderer/core/exported/web_page_popup_impl.cc b/third_party/blink/renderer/core/exported/web_page_popup_impl.cc
index 5869f41..ce0e370a 100644
--- a/third_party/blink/renderer/core/exported/web_page_popup_impl.cc
+++ b/third_party/blink/renderer/core/exported/web_page_popup_impl.cc
@@ -248,12 +248,7 @@
// WebPagePopupImpl ----------------------------------------------------------
WebPagePopupImpl::WebPagePopupImpl(WebWidgetClient* client)
- : widget_client_(client),
- closing_(false),
- layer_tree_view_(nullptr),
- root_layer_(nullptr),
- root_graphics_layer_(nullptr),
- is_accelerated_compositing_active_(false) {
+ : widget_client_(client) {
DCHECK(client);
}
diff --git a/third_party/blink/renderer/core/exported/web_page_popup_impl.h b/third_party/blink/renderer/core/exported/web_page_popup_impl.h
index 5684a01..6b30992 100644
--- a/third_party/blink/renderer/core/exported/web_page_popup_impl.h
+++ b/third_party/blink/renderer/core/exported/web_page_popup_impl.h
@@ -32,13 +32,16 @@
#define THIRD_PARTY_BLINK_RENDERER_CORE_EXPORTED_WEB_PAGE_POPUP_IMPL_H_
#include "base/macros.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/web/web_page_popup.h"
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/page/page_popup.h"
#include "third_party/blink/renderer/core/page/page_widget_delegate.h"
#include "third_party/blink/renderer/platform/wtf/ref_counted.h"
+namespace cc {
+class Layer;
+}
+
namespace blink {
class CompositorAnimationHost;
@@ -121,14 +124,13 @@
Persistent<Page> page_;
Persistent<PagePopupChromeClient> chrome_client_;
PagePopupClient* popup_client_;
- bool closing_;
+ bool closing_ = false;
- WebLayerTreeView* layer_tree_view_;
- // TODO(danakj): This should be a scoped_refptr<cc::Layer>.
- WebLayer* root_layer_;
- GraphicsLayer* root_graphics_layer_;
+ WebLayerTreeView* layer_tree_view_ = nullptr;
+ scoped_refptr<cc::Layer> root_layer_;
+ GraphicsLayer* root_graphics_layer_ = nullptr;
std::unique_ptr<CompositorAnimationHost> animation_host_;
- bool is_accelerated_compositing_active_;
+ bool is_accelerated_compositing_active_ = false;
friend class WebPagePopup;
friend class PagePopupChromeClient;
diff --git a/third_party/blink/renderer/core/exported/web_plugin_container_impl.cc b/third_party/blink/renderer/core/exported/web_plugin_container_impl.cc
index 1578eb1..c93db78 100644
--- a/third_party/blink/renderer/core/exported/web_plugin_container_impl.cc
+++ b/third_party/blink/renderer/core/exported/web_plugin_container_impl.cc
@@ -36,7 +36,6 @@
#include "third_party/blink/public/platform/web_coalesced_input_event.h"
#include "third_party/blink/public/platform/web_cursor_info.h"
#include "third_party/blink/public/platform/web_drag_data.h"
-#include "third_party/blink/public/platform/web_external_texture_layer.h"
#include "third_party/blink/public/platform/web_input_event.h"
#include "third_party/blink/public/platform/web_rect.h"
#include "third_party/blink/public/platform/web_string.h"
@@ -168,13 +167,13 @@
if (!cull_rect.IntersectsCullRect(FrameRect()))
return;
- if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled() && web_layer_) {
- web_layer_->SetBounds(static_cast<gfx::Size>(frame_rect_.Size()));
- web_layer_->SetIsDrawable(true);
+ if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled() && layer_) {
+ layer_->SetBounds(static_cast<gfx::Size>(frame_rect_.Size()));
+ layer_->SetIsDrawable(true);
// With Slimming Paint v2, composited plugins should have their layers
// inserted rather than invoking WebPlugin::paint.
RecordForeignLayer(context, *element_->GetLayoutObject(),
- DisplayItem::kForeignLayerPlugin, web_layer_,
+ DisplayItem::kForeignLayerPlugin, layer_,
FrameRect().Location(), frame_rect_.Size());
return;
}
@@ -326,18 +325,18 @@
return frame->PageZoomFactor();
}
-void WebPluginContainerImpl::SetWebLayer(WebLayer* layer,
+void WebPluginContainerImpl::SetWebLayer(cc::Layer* new_layer,
bool prevent_contents_opaque_changes) {
- if (web_layer_ == layer &&
+ if (layer_ == new_layer &&
prevent_contents_opaque_changes == prevent_contents_opaque_changes_)
return;
- if (web_layer_)
- GraphicsLayer::UnregisterContentsLayer(web_layer_);
- if (layer)
- GraphicsLayer::RegisterContentsLayer(layer);
+ if (layer_)
+ GraphicsLayer::UnregisterContentsLayer(layer_);
+ if (new_layer)
+ GraphicsLayer::RegisterContentsLayer(new_layer);
- web_layer_ = layer;
+ layer_ = new_layer;
prevent_contents_opaque_changes_ = prevent_contents_opaque_changes;
if (element_)
@@ -692,8 +691,8 @@
web_plugin_->DidFailLoading(error);
}
-WebLayer* WebPluginContainerImpl::PlatformLayer() const {
- return web_layer_;
+cc::Layer* WebPluginContainerImpl::PlatformLayer() const {
+ return layer_;
}
bool WebPluginContainerImpl::PreventContentsOpaqueChangesToPlatformLayer()
@@ -743,7 +742,7 @@
: ContextClient(element.GetDocument().GetFrame()),
element_(element),
web_plugin_(web_plugin),
- web_layer_(nullptr),
+ layer_(nullptr),
touch_event_request_type_(kTouchEventRequestTypeNone),
prevent_contents_opaque_changes_(false),
wants_wheel_events_(false),
@@ -773,9 +772,9 @@
web_plugin_ = nullptr;
}
- if (web_layer_) {
- GraphicsLayer::UnregisterContentsLayer(web_layer_);
- web_layer_ = nullptr;
+ if (layer_) {
+ GraphicsLayer::UnregisterContentsLayer(layer_);
+ layer_ = nullptr;
}
}
diff --git a/third_party/blink/renderer/core/exported/web_plugin_container_impl.h b/third_party/blink/renderer/core/exported/web_plugin_container_impl.h
index 5290f85..c205c02 100644
--- a/third_party/blink/renderer/core/exported/web_plugin_container_impl.h
+++ b/third_party/blink/renderer/core/exported/web_plugin_container_impl.h
@@ -44,6 +44,10 @@
#include "third_party/blink/renderer/platform/wtf/compiler.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
+namespace cc {
+class Layer;
+}
+
namespace blink {
class Event;
@@ -101,7 +105,7 @@
void Show() override;
void Hide() override;
- WebLayer* PlatformLayer() const;
+ cc::Layer* PlatformLayer() const;
bool PreventContentsOpaqueChangesToPlatformLayer() const;
v8::Local<v8::Object> ScriptableObject(v8::Isolate*);
bool SupportsKeyboardFocus() const;
@@ -148,7 +152,7 @@
float PageScaleFactor() override;
float PageZoomFactor() override;
- void SetWebLayer(WebLayer*, bool prevent_contents_opaque_changes) override;
+ void SetWebLayer(cc::Layer*, bool prevent_contents_opaque_changes) override;
void RequestFullscreen() override;
bool IsFullscreenElement() const override;
@@ -232,7 +236,7 @@
Member<HTMLPlugInElement> element_;
WebPlugin* web_plugin_;
- WebLayer* web_layer_;
+ cc::Layer* layer_;
IntRect frame_rect_;
TouchEventRequestType touch_event_request_type_;
bool prevent_contents_opaque_changes_;
diff --git a/third_party/blink/renderer/core/exported/web_plugin_container_test.cc b/third_party/blink/renderer/core/exported/web_plugin_container_test.cc
index ae156d7..7b6cfc0 100644
--- a/third_party/blink/renderer/core/exported/web_plugin_container_test.cc
+++ b/third_party/blink/renderer/core/exported/web_plugin_container_test.cc
@@ -38,7 +38,6 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/public/platform/web_coalesced_input_event.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/platform/web_mouse_wheel_event.h"
#include "third_party/blink/public/platform/web_pointer_event.h"
#include "third_party/blink/public/platform/web_thread.h"
@@ -1367,7 +1366,7 @@
explicit CompositedPlugin(const WebPluginParams& params)
: FakeWebPlugin(params), layer_(cc::Layer::Create()) {}
- WebLayer* GetWebLayer() const { return layer_.get(); }
+ cc::Layer* GetWebLayer() const { return layer_.get(); }
// WebPlugin
diff --git a/third_party/blink/renderer/core/exported/web_remote_frame_impl.cc b/third_party/blink/renderer/core/exported/web_remote_frame_impl.cc
index dcf6140..0a810c5 100644
--- a/third_party/blink/renderer/core/exported/web_remote_frame_impl.cc
+++ b/third_party/blink/renderer/core/exported/web_remote_frame_impl.cc
@@ -183,7 +183,7 @@
return child;
}
-void WebRemoteFrameImpl::SetWebLayer(WebLayer* layer,
+void WebRemoteFrameImpl::SetWebLayer(cc::Layer* layer,
bool prevent_contents_opaque_changes) {
if (!GetFrame())
return;
diff --git a/third_party/blink/renderer/core/exported/web_remote_frame_impl.h b/third_party/blink/renderer/core/exported/web_remote_frame_impl.h
index a7fd042..a636c2f 100644
--- a/third_party/blink/renderer/core/exported/web_remote_frame_impl.h
+++ b/third_party/blink/renderer/core/exported/web_remote_frame_impl.h
@@ -13,6 +13,10 @@
#include "third_party/blink/renderer/platform/heap/self_keep_alive.h"
#include "third_party/blink/renderer/platform/wtf/compiler.h"
+namespace cc {
+class Layer;
+}
+
namespace blink {
class FrameOwner;
@@ -56,7 +60,7 @@
const ParsedFeaturePolicy&,
WebRemoteFrameClient*,
WebFrame* opener) override;
- void SetWebLayer(WebLayer*, bool prevent_contents_opaque_changes) override;
+ void SetWebLayer(cc::Layer*, bool prevent_contents_opaque_changes) override;
void SetReplicatedOrigin(
const WebSecurityOrigin&,
bool is_potentially_trustworthy_unique_origin) override;
diff --git a/third_party/blink/renderer/core/exported/web_selection.cc b/third_party/blink/renderer/core/exported/web_selection.cc
index ecb0cc1e..8b89a74 100644
--- a/third_party/blink/renderer/core/exported/web_selection.cc
+++ b/third_party/blink/renderer/core/exported/web_selection.cc
@@ -4,7 +4,6 @@
#include "third_party/blink/public/web/web_selection.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/renderer/core/editing/selection_type.h"
#include "third_party/blink/renderer/core/paint/compositing/composited_selection.h"
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc
index 8064140..8d04cbd 100644
--- a/third_party/blink/renderer/core/exported/web_view_impl.cc
+++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
@@ -36,6 +36,7 @@
#include "base/memory/scoped_refptr.h"
#include "base/time/time.h"
#include "build/build_config.h"
+#include "cc/layers/layer.h"
#include "third_party/blink/public/mojom/page/page_visibility_state.mojom-blink.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/public/platform/web_float_point.h"
@@ -2240,7 +2241,7 @@
}
bool WebViewImpl::IsAcceleratedCompositingActive() const {
- return root_layer_;
+ return !!root_layer_;
}
void WebViewImpl::WillCloseLayerTreeView() {
@@ -3525,14 +3526,14 @@
// Get the outer viewport scroll layers.
GraphicsLayer* layout_viewport_container_layer =
GetPage()->GlobalRootScrollerController().RootContainerLayer();
- WebLayer* layout_viewport_container_web_layer =
+ cc::Layer* layout_viewport_container_cc_layer =
layout_viewport_container_layer
? layout_viewport_container_layer->PlatformLayer()
: nullptr;
GraphicsLayer* layout_viewport_scroll_layer =
GetPage()->GlobalRootScrollerController().RootScrollerLayer();
- WebLayer* layout_viewport_scroll_web_layer =
+ cc::Layer* layout_viewport_scroll_cc_layer =
layout_viewport_scroll_layer
? layout_viewport_scroll_layer->PlatformLayer()
: nullptr;
@@ -3546,11 +3547,10 @@
visual_viewport.PageScaleLayer()->PlatformLayer();
viewport_layers.inner_viewport_container =
visual_viewport.ContainerLayer()->PlatformLayer();
- viewport_layers.outer_viewport_container =
- layout_viewport_container_web_layer;
+ viewport_layers.outer_viewport_container = layout_viewport_container_cc_layer;
viewport_layers.inner_viewport_scroll =
visual_viewport.ScrollLayer()->PlatformLayer();
- viewport_layers.outer_viewport_scroll = layout_viewport_scroll_web_layer;
+ viewport_layers.outer_viewport_scroll = layout_viewport_scroll_cc_layer;
layer_tree_view_->RegisterViewportLayers(viewport_layers);
}
@@ -3592,8 +3592,7 @@
}
}
-// TODO(danakj): This should be a scoped_refptr<cc::Layer>.
-void WebViewImpl::SetRootLayer(WebLayer* layer) {
+void WebViewImpl::SetRootLayer(scoped_refptr<cc::Layer> layer) {
if (!layer_tree_view_)
return;
diff --git a/third_party/blink/renderer/core/exported/web_view_impl.h b/third_party/blink/renderer/core/exported/web_view_impl.h
index 8a8c012..fec6c61 100644
--- a/third_party/blink/renderer/core/exported/web_view_impl.h
+++ b/third_party/blink/renderer/core/exported/web_view_impl.h
@@ -41,7 +41,6 @@
#include "third_party/blink/public/platform/web_gesture_event.h"
#include "third_party/blink/public/platform/web_input_event.h"
#include "third_party/blink/public/platform/web_input_event_result.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/platform/web_point.h"
#include "third_party/blink/public/platform/web_rect.h"
#include "third_party/blink/public/platform/web_size.h"
@@ -69,6 +68,10 @@
#include "third_party/blink/renderer/platform/wtf/std_lib_extras.h"
#include "third_party/blink/renderer/platform/wtf/vector.h"
+namespace cc {
+class Layer;
+}
+
namespace blink {
class BrowserControls;
@@ -546,7 +549,7 @@
float DeviceScaleFactor() const;
void SetRootGraphicsLayer(GraphicsLayer*);
- void SetRootLayer(WebLayer*);
+ void SetRootLayer(scoped_refptr<cc::Layer>);
void AttachCompositorAnimationTimeline(CompositorAnimationTimeline*);
void DetachCompositorAnimationTimeline(CompositorAnimationTimeline*);
@@ -654,8 +657,7 @@
WebLayerTreeView* layer_tree_view_;
std::unique_ptr<CompositorAnimationHost> animation_host_;
- // TODO(danakj): This should be a scoped_refptr<cc::Layer>.
- WebLayer* root_layer_;
+ scoped_refptr<cc::Layer> root_layer_;
GraphicsLayer* root_graphics_layer_;
GraphicsLayer* visual_viewport_container_layer_;
bool matches_heuristics_for_gpu_rasterization_;
diff --git a/third_party/blink/renderer/core/frame/local_frame_view.cc b/third_party/blink/renderer/core/frame/local_frame_view.cc
index 0a27cade..25d4c5e8 100644
--- a/third_party/blink/renderer/core/frame/local_frame_view.cc
+++ b/third_party/blink/renderer/core/frame/local_frame_view.cc
@@ -33,7 +33,6 @@
#include "base/memory/ptr_util.h"
#include "third_party/blink/public/mojom/page/page_visibility_state.mojom-blink.h"
#include "third_party/blink/public/platform/task_type.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/platform/web_rect.h"
#include "third_party/blink/public/platform/web_scroll_into_view_params.h"
#include "third_party/blink/renderer/core/animation/document_animations.h"
@@ -3403,7 +3402,7 @@
if (!layer || layer->Client().ShouldThrottleRendering())
return;
- WebLayer* contents_layer = layer->ContentsLayer();
+ scoped_refptr<cc::Layer> contents_layer = layer->ContentsLayer();
if (layer->DrawsContent() || contents_layer) {
ScopedPaintChunkProperties scope(context.GetPaintController(),
layer->GetPropertyTreeState(), *layer,
@@ -3425,7 +3424,7 @@
auto size = contents_layer->bounds();
RecordForeignLayer(context, *layer,
DisplayItem::kForeignLayerContentsWrapper,
- contents_layer,
+ std::move(contents_layer),
layer->GetOffsetFromTransformNode() +
FloatSize(position.x(), position.y()),
IntSize(size.width(), size.height()));
@@ -5775,7 +5774,7 @@
.View()
->LayoutViewportScrollableArea()
->LayerForScrolling()) {
- if (WebLayer* platform_layer_for_scrolling =
+ if (cc::Layer* platform_layer_for_scrolling =
layer_for_scrolling->PlatformLayer()) {
if (reasons) {
platform_layer_for_scrolling->AddMainThreadScrollingReasons(reasons);
@@ -5880,7 +5879,7 @@
DCHECK(Lifecycle().GetState() >= DocumentLifecycle::kCompositingClean);
if (GraphicsLayer* layer_for_scrolling =
LayoutViewportScrollableArea()->LayerForScrolling()) {
- if (WebLayer* platform_layer = layer_for_scrolling->PlatformLayer()) {
+ if (cc::Layer* platform_layer = layer_for_scrolling->PlatformLayer()) {
String result(MainThreadScrollingReason::mainThreadScrollingReasonsAsText(
platform_layer->main_thread_scrolling_reasons())
.c_str());
diff --git a/third_party/blink/renderer/core/frame/remote_frame.cc b/third_party/blink/renderer/core/frame/remote_frame.cc
index 867d7a1..c87099e2 100644
--- a/third_party/blink/renderer/core/frame/remote_frame.cc
+++ b/third_party/blink/renderer/core/frame/remote_frame.cc
@@ -4,7 +4,6 @@
#include "third_party/blink/renderer/core/frame/remote_frame.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/renderer/bindings/core/v8/window_proxy.h"
#include "third_party/blink/renderer/bindings/core/v8/window_proxy_manager.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
@@ -107,7 +106,7 @@
// persistent strong references to RemoteDOMWindow will prevent the GCing
// of all these objects. Break the cycle by notifying of detachment.
ToRemoteDOMWindow(dom_window_)->FrameDetached();
- if (web_layer_)
+ if (cc_layer_)
SetWebLayer(nullptr, false);
Frame::Detach(type);
}
@@ -172,14 +171,14 @@
return static_cast<RemoteFrameClient*>(Frame::Client());
}
-void RemoteFrame::SetWebLayer(WebLayer* web_layer,
+void RemoteFrame::SetWebLayer(cc::Layer* cc_layer,
bool prevent_contents_opaque_changes) {
- if (web_layer_)
- GraphicsLayer::UnregisterContentsLayer(web_layer_);
- web_layer_ = web_layer;
+ if (cc_layer_)
+ GraphicsLayer::UnregisterContentsLayer(cc_layer_);
+ cc_layer_ = cc_layer;
prevent_contents_opaque_changes_ = prevent_contents_opaque_changes;
- if (web_layer_)
- GraphicsLayer::RegisterContentsLayer(web_layer_);
+ if (cc_layer_)
+ GraphicsLayer::RegisterContentsLayer(cc_layer_);
DCHECK(Owner());
ToHTMLFrameOwnerElement(Owner())->SetNeedsCompositingUpdate();
diff --git a/third_party/blink/renderer/core/frame/remote_frame.h b/third_party/blink/renderer/core/frame/remote_frame.h
index 81304a8..3e5cddb3b 100644
--- a/third_party/blink/renderer/core/frame/remote_frame.h
+++ b/third_party/blink/renderer/core/frame/remote_frame.h
@@ -6,12 +6,15 @@
#define THIRD_PARTY_BLINK_RENDERER_CORE_FRAME_REMOTE_FRAME_H_
#include "third_party/blink/public/platform/web_focus_type.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/execution_context/remote_security_context.h"
#include "third_party/blink/renderer/core/frame/frame.h"
#include "third_party/blink/renderer/core/frame/remote_frame_view.h"
+namespace cc {
+class Layer;
+}
+
namespace blink {
class LocalFrame;
@@ -41,8 +44,8 @@
void DidResume() override;
void SetIsInert(bool) override;
- void SetWebLayer(WebLayer*, bool prevent_contents_opaque_changes);
- WebLayer* GetWebLayer() const { return web_layer_; }
+ void SetWebLayer(cc::Layer*, bool prevent_contents_opaque_changes);
+ cc::Layer* GetWebLayer() const { return cc_layer_; }
bool WebLayerHasFixedContentsOpaque() const {
return prevent_contents_opaque_changes_;
}
@@ -68,7 +71,7 @@
Member<RemoteFrameView> view_;
Member<RemoteSecurityContext> security_context_;
- WebLayer* web_layer_ = nullptr;
+ cc::Layer* cc_layer_ = nullptr;
bool prevent_contents_opaque_changes_ = false;
};
diff --git a/third_party/blink/renderer/core/frame/visual_viewport.cc b/third_party/blink/renderer/core/frame/visual_viewport.cc
index fc7abac6..eed0c150 100644
--- a/third_party/blink/renderer/core/frame/visual_viewport.cc
+++ b/third_party/blink/renderer/core/frame/visual_viewport.cc
@@ -35,7 +35,6 @@
#include "cc/layers/layer.h"
#include "cc/layers/scrollbar_layer_interface.h"
#include "third_party/blink/public/platform/task_type.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/local_frame_client.h"
#include "third_party/blink/renderer/core/frame/local_frame_view.h"
diff --git a/third_party/blink/renderer/core/frame/visual_viewport_test.cc b/third_party/blink/renderer/core/frame/visual_viewport_test.cc
index 4944c0a..ec9e098f9 100644
--- a/third_party/blink/renderer/core/frame/visual_viewport_test.cc
+++ b/third_party/blink/renderer/core/frame/visual_viewport_test.cc
@@ -1537,11 +1537,11 @@
"content.style.width = \"1500px\";"
"content.style.height = \"2400px\";"));
frame_view.UpdateAllLifecyclePhases();
- WebLayer* scrollLayer = frame_view.LayoutViewportScrollableArea()
- ->LayerForScrolling()
- ->PlatformLayer();
+ cc::Layer* scroll_layer = frame_view.LayoutViewportScrollableArea()
+ ->LayerForScrolling()
+ ->PlatformLayer();
- EXPECT_EQ(gfx::Size(1500, 2400), scrollLayer->bounds());
+ EXPECT_EQ(gfx::Size(1500, 2400), scroll_layer->bounds());
}
// Tests that resizing the visual viepwort keeps its bounds within the outer
diff --git a/third_party/blink/renderer/core/frame/web_frame_widget_base.h b/third_party/blink/renderer/core/frame/web_frame_widget_base.h
index e626200..c1dee023 100644
--- a/third_party/blink/renderer/core/frame/web_frame_widget_base.h
+++ b/third_party/blink/renderer/core/frame/web_frame_widget_base.h
@@ -10,7 +10,6 @@
#include "third_party/blink/public/platform/web_drag_data.h"
#include "third_party/blink/public/platform/web_gesture_curve_target.h"
#include "third_party/blink/public/platform/web_gesture_device.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/web/web_frame_widget.h"
#include "third_party/blink/renderer/core/clipboard/data_object.h"
#include "third_party/blink/renderer/core/core_export.h"
@@ -18,6 +17,10 @@
#include "third_party/blink/renderer/platform/graphics/paint/paint_image.h"
#include "third_party/blink/renderer/platform/heap/member.h"
+namespace cc {
+class Layer;
+}
+
namespace blink {
class CompositorAnimationHost;
@@ -59,8 +62,8 @@
virtual void SetRootGraphicsLayer(GraphicsLayer*) = 0;
virtual GraphicsLayer* RootGraphicsLayer() const = 0;
- // Sets the root layer. |WebLayer| can be null when detaching the root layer.
- virtual void SetRootLayer(WebLayer*) = 0;
+ // Sets the root layer. The |layer| can be null when detaching the root layer.
+ virtual void SetRootLayer(scoped_refptr<cc::Layer> layer) = 0;
virtual WebLayerTreeView* GetLayerTreeView() const = 0;
virtual CompositorAnimationHost* AnimationHost() const = 0;
diff --git a/third_party/blink/renderer/core/frame/web_frame_widget_impl.cc b/third_party/blink/renderer/core/frame/web_frame_widget_impl.cc
index 5cf0faa..7673805 100644
--- a/third_party/blink/renderer/core/frame/web_frame_widget_impl.cc
+++ b/third_party/blink/renderer/core/frame/web_frame_widget_impl.cc
@@ -1085,10 +1085,10 @@
layer_tree_view_->ClearRootLayer();
}
-void WebFrameWidgetImpl::SetRootLayer(WebLayer* layer) {
+void WebFrameWidgetImpl::SetRootLayer(scoped_refptr<cc::Layer> layer) {
root_layer_ = layer;
- SetIsAcceleratedCompositingActive(layer);
+ SetIsAcceleratedCompositingActive(!!layer);
if (!layer_tree_view_)
return;
diff --git a/third_party/blink/renderer/core/frame/web_frame_widget_impl.h b/third_party/blink/renderer/core/frame/web_frame_widget_impl.h
index 88470c5..83008461 100644
--- a/third_party/blink/renderer/core/frame/web_frame_widget_impl.h
+++ b/third_party/blink/renderer/core/frame/web_frame_widget_impl.h
@@ -37,7 +37,6 @@
#include "base/optional.h"
#include "base/single_thread_task_runner.h"
#include "third_party/blink/public/platform/web_coalesced_input_event.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/platform/web_point.h"
#include "third_party/blink/public/platform/web_size.h"
#include "third_party/blink/public/web/web_input_method_controller.h"
@@ -51,6 +50,10 @@
#include "third_party/blink/renderer/platform/scroll/scroll_types.h"
#include "third_party/blink/renderer/platform/wtf/hash_set.h"
+namespace cc {
+class Layer;
+}
+
namespace blink {
class CompositorAnimationHost;
@@ -142,7 +145,7 @@
void DidCreateLocalRootView() override;
void SetRootGraphicsLayer(GraphicsLayer*) override;
- void SetRootLayer(WebLayer*) override;
+ void SetRootLayer(scoped_refptr<cc::Layer>) override;
WebLayerTreeView* GetLayerTreeView() const override;
CompositorAnimationHost* AnimationHost() const override;
HitTestResult CoreHitTestResultAt(const WebPoint&) override;
@@ -215,8 +218,7 @@
scoped_refptr<base::SingleThreadTaskRunner> mutator_task_runner_;
WebLayerTreeView* layer_tree_view_;
- // TODO(danakj): This should be a scoped_refptr<cc::Layer>.
- WebLayer* root_layer_;
+ scoped_refptr<cc::Layer> root_layer_;
GraphicsLayer* root_graphics_layer_;
std::unique_ptr<CompositorAnimationHost> animation_host_;
bool is_accelerated_compositing_active_;
diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
index bb0d28b..a6d73b1 100644
--- a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
+++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
@@ -99,7 +99,6 @@
#include "third_party/blink/public/platform/web_double_size.h"
#include "third_party/blink/public/platform/web_float_point.h"
#include "third_party/blink/public/platform/web_float_rect.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/platform/web_point.h"
#include "third_party/blink/public/platform/web_rect.h"
#include "third_party/blink/public/platform/web_security_origin.h"
diff --git a/third_party/blink/renderer/core/frame/web_view_frame_widget.cc b/third_party/blink/renderer/core/frame/web_view_frame_widget.cc
index e340ee75..a0a8817a 100644
--- a/third_party/blink/renderer/core/frame/web_view_frame_widget.cc
+++ b/third_party/blink/renderer/core/frame/web_view_frame_widget.cc
@@ -211,7 +211,7 @@
return web_view_->RootGraphicsLayer();
}
-void WebViewFrameWidget::SetRootLayer(WebLayer* layer) {
+void WebViewFrameWidget::SetRootLayer(scoped_refptr<cc::Layer> layer) {
web_view_->SetRootLayer(layer);
}
diff --git a/third_party/blink/renderer/core/frame/web_view_frame_widget.h b/third_party/blink/renderer/core/frame/web_view_frame_widget.h
index ad0146a..66251eae 100644
--- a/third_party/blink/renderer/core/frame/web_view_frame_widget.h
+++ b/third_party/blink/renderer/core/frame/web_view_frame_widget.h
@@ -94,7 +94,7 @@
scoped_refptr<base::SingleThreadTaskRunner>*) override;
void SetRootGraphicsLayer(GraphicsLayer*) override;
GraphicsLayer* RootGraphicsLayer() const override;
- void SetRootLayer(WebLayer*) override;
+ void SetRootLayer(scoped_refptr<cc::Layer>) override;
WebLayerTreeView* GetLayerTreeView() const override;
CompositorAnimationHost* AnimationHost() const override;
WebHitTestResult HitTestResultAt(const WebPoint&) override;
diff --git a/third_party/blink/renderer/core/html/canvas/canvas_rendering_context.h b/third_party/blink/renderer/core/html/canvas/canvas_rendering_context.h
index a4fb904..2be9199 100644
--- a/third_party/blink/renderer/core/html/canvas/canvas_rendering_context.h
+++ b/third_party/blink/renderer/core/html/canvas/canvas_rendering_context.h
@@ -27,7 +27,6 @@
#define THIRD_PARTY_BLINK_RENDERER_CORE_HTML_CANVAS_CANVAS_RENDERING_CONTEXT_H_
#include "base/macros.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/platform/web_thread.h"
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/html/canvas/canvas_context_creation_attributes_core.h"
@@ -108,7 +107,7 @@
return false;
}
- virtual WebLayer* PlatformLayer() const { return nullptr; }
+ virtual cc::Layer* PlatformLayer() const { return nullptr; }
enum LostContextMode {
kNotLostContext,
diff --git a/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc b/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc
index 0bc9935..2d66836c 100644
--- a/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc
+++ b/third_party/blink/renderer/core/html/canvas/html_canvas_element.cc
@@ -1480,12 +1480,12 @@
SetNeedsCompositingUpdate();
}
-void HTMLCanvasElement::RegisterContentsLayer(WebLayer* web_layer) {
- GraphicsLayer::RegisterContentsLayer(web_layer);
+void HTMLCanvasElement::RegisterContentsLayer(cc::Layer* layer) {
+ GraphicsLayer::RegisterContentsLayer(layer);
}
-void HTMLCanvasElement::UnregisterContentsLayer(WebLayer* web_layer) {
- GraphicsLayer::UnregisterContentsLayer(web_layer);
+void HTMLCanvasElement::UnregisterContentsLayer(cc::Layer* layer) {
+ GraphicsLayer::UnregisterContentsLayer(layer);
}
FontSelector* HTMLCanvasElement::GetFontSelector() {
diff --git a/third_party/blink/renderer/core/html/canvas/html_canvas_element.h b/third_party/blink/renderer/core/html/canvas/html_canvas_element.h
index dd42690..718e92c 100644
--- a/third_party/blink/renderer/core/html/canvas/html_canvas_element.h
+++ b/third_party/blink/renderer/core/html/canvas/html_canvas_element.h
@@ -56,6 +56,10 @@
#define CanvasDefaultInterpolationQuality kInterpolationLow
+namespace cc {
+class Layer;
+}
+
namespace blink {
class Canvas2DLayerBridge;
@@ -198,8 +202,8 @@
// SurfaceLayerBridgeObserver implementation
void OnWebLayerUpdated() override;
- void RegisterContentsLayer(WebLayer*) override;
- void UnregisterContentsLayer(WebLayer*) override;
+ void RegisterContentsLayer(cc::Layer*) override;
+ void UnregisterContentsLayer(cc::Layer*) override;
// CanvasResourceHost implementation
void NotifySurfaceInvalid() override;
diff --git a/third_party/blink/renderer/core/html/html_plugin_element.cc b/third_party/blink/renderer/core/html/html_plugin_element.cc
index 46de111..13b0c73 100644
--- a/third_party/blink/renderer/core/html/html_plugin_element.cc
+++ b/third_party/blink/renderer/core/html/html_plugin_element.cc
@@ -631,7 +631,7 @@
}
GetDocument().SetContainsPlugins();
- // TODO(esprehn): WebPluginContainerImpl::setWebLayer also schedules a
+ // TODO(esprehn): WebPluginContainerImpl::SetWebLayer() also schedules a
// compositing update, do we need both?
SetNeedsCompositingUpdate();
// Make sure any input event handlers introduced by the plugin are taken into
diff --git a/third_party/blink/renderer/core/html/media/html_media_element.cc b/third_party/blink/renderer/core/html/media/html_media_element.cc
index 1a4da15e..120588f3 100644
--- a/third_party/blink/renderer/core/html/media/html_media_element.cc
+++ b/third_party/blink/renderer/core/html/media/html_media_element.cc
@@ -38,7 +38,6 @@
#include "third_party/blink/public/platform/web_audio_source_provider.h"
#include "third_party/blink/public/platform/web_content_decryption_module.h"
#include "third_party/blink/public/platform/web_inband_text_track.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/platform/web_media_player.h"
#include "third_party/blink/public/platform/web_media_player_source.h"
#include "third_party/blink/public/platform/web_media_stream.h"
@@ -482,7 +481,7 @@
deferred_load_timer_(document.GetTaskRunner(TaskType::kInternalMedia),
this,
&HTMLMediaElement::DeferredLoadTimerFired),
- web_layer_(nullptr),
+ cc_layer_(nullptr),
display_mode_(kUnknown),
official_playback_position_(0),
official_playback_position_needs_update_(true),
@@ -3362,8 +3361,8 @@
// MediaPlayerPresentation methods
void HTMLMediaElement::Repaint() {
- if (web_layer_)
- web_layer_->SetNeedsDisplay();
+ if (cc_layer_)
+ cc_layer_->SetNeedsDisplay();
UpdateDisplayState();
if (GetLayoutObject())
@@ -3651,8 +3650,8 @@
in_overlay_fullscreen_video_ = false;
}
-WebLayer* HTMLMediaElement::PlatformLayer() const {
- return web_layer_;
+cc::Layer* HTMLMediaElement::PlatformLayer() const {
+ return cc_layer_;
}
bool HTMLMediaElement::HasClosedCaptions() const {
@@ -3942,20 +3941,20 @@
return WebMediaPlayer::kCORSModeAnonymous;
}
-void HTMLMediaElement::SetWebLayer(WebLayer* web_layer) {
- if (web_layer == web_layer_)
+void HTMLMediaElement::SetWebLayer(cc::Layer* cc_layer) {
+ if (cc_layer == cc_layer_)
return;
// If either of the layers is null we need to enable or disable compositing.
// This is done by triggering a style recalc.
- if (!web_layer_ || !web_layer)
+ if (!cc_layer_ || !cc_layer)
SetNeedsCompositingUpdate();
- if (web_layer_)
- GraphicsLayer::UnregisterContentsLayer(web_layer_);
- web_layer_ = web_layer;
- if (web_layer_)
- GraphicsLayer::RegisterContentsLayer(web_layer_);
+ if (cc_layer_)
+ GraphicsLayer::UnregisterContentsLayer(cc_layer_);
+ cc_layer_ = cc_layer;
+ if (cc_layer_)
+ GraphicsLayer::RegisterContentsLayer(cc_layer_);
}
void HTMLMediaElement::MediaSourceOpened(WebMediaSource* web_media_source) {
diff --git a/third_party/blink/renderer/core/html/media/html_media_element.h b/third_party/blink/renderer/core/html/media/html_media_element.h
index f3284e9..88e14c7 100644
--- a/third_party/blink/renderer/core/html/media/html_media_element.h
+++ b/third_party/blink/renderer/core/html/media/html_media_element.h
@@ -28,9 +28,9 @@
#define THIRD_PARTY_BLINK_RENDERER_CORE_HTML_MEDIA_HTML_MEDIA_ELEMENT_H_
#include <memory>
+
#include "base/optional.h"
#include "third_party/blink/public/platform/web_audio_source_provider_client.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/platform/web_media_player_client.h"
#include "third_party/blink/renderer/bindings/core/v8/active_script_wrappable.h"
#include "third_party/blink/renderer/bindings/core/v8/exception_state.h"
@@ -47,6 +47,10 @@
#include "third_party/blink/renderer/platform/supplementable.h"
#include "third_party/blink/renderer/platform/web_task_runner.h"
+namespace cc {
+class Layer;
+}
+
namespace blink {
class AudioSourceProviderClient;
@@ -120,7 +124,7 @@
bool SupportsSave() const;
- WebLayer* PlatformLayer() const;
+ cc::Layer* PlatformLayer() const;
enum DelayedActionType {
kLoadMediaResource = 1 << 0,
@@ -399,7 +403,7 @@
void SizeChanged() final;
void PlaybackStateChanged() final;
- void SetWebLayer(WebLayer*) final;
+ void SetWebLayer(cc::Layer*) final;
WebMediaPlayer::TrackId AddAudioTrack(const WebString&,
WebMediaPlayerClient::AudioTrackKind,
const WebString&,
@@ -617,7 +621,7 @@
TaskRunnerTimer<HTMLMediaElement> deferred_load_timer_;
std::unique_ptr<WebMediaPlayer> web_media_player_;
- WebLayer* web_layer_;
+ cc::Layer* cc_layer_;
DisplayMode display_mode_;
diff --git a/third_party/blink/renderer/core/html/media/picture_in_picture_interstitial.cc b/third_party/blink/renderer/core/html/media/picture_in_picture_interstitial.cc
index 61f35e5..05cdbf3 100644
--- a/third_party/blink/renderer/core/html/media/picture_in_picture_interstitial.cc
+++ b/third_party/blink/renderer/core/html/media/picture_in_picture_interstitial.cc
@@ -4,7 +4,7 @@
#include "third_party/blink/renderer/core/html/media/picture_in_picture_interstitial.h"
-#include "third_party/blink/public/platform/web_layer.h"
+#include "cc/layers/layer.h"
#include "third_party/blink/public/platform/web_localized_string.h"
#include "third_party/blink/renderer/bindings/core/v8/exception_state.h"
#include "third_party/blink/renderer/core/dom/document.h"
diff --git a/third_party/blink/renderer/core/inspector/inspector_layer_tree_agent.cc b/third_party/blink/renderer/core/inspector/inspector_layer_tree_agent.cc
index 90e08f95..dab5d859 100644
--- a/third_party/blink/renderer/core/inspector/inspector_layer_tree_agent.cc
+++ b/third_party/blink/renderer/core/inspector/inspector_layer_tree_agent.cc
@@ -35,7 +35,6 @@
#include "cc/base/region.h"
#include "third_party/blink/public/platform/web_float_point.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/dom_node_ids.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
@@ -98,16 +97,16 @@
bool report_wheel_scrollers) {
std::unique_ptr<Array<protocol::LayerTree::ScrollRect>> scroll_rects =
Array<protocol::LayerTree::ScrollRect>::create();
- WebLayer* web_layer = graphics_layer->PlatformLayer();
+ cc::Layer* cc_layer = graphics_layer->PlatformLayer();
const cc::Region& non_fast_scrollable_rects =
- web_layer->non_fast_scrollable_region();
+ cc_layer->non_fast_scrollable_region();
for (const gfx::Rect& rect : non_fast_scrollable_rects) {
scroll_rects->addItem(BuildScrollRect(
IntRect(rect),
protocol::LayerTree::ScrollRect::TypeEnum::RepaintsOnScroll));
}
const cc::Region& touch_event_handler_region =
- web_layer->touch_action_region().region();
+ cc_layer->touch_action_region().region();
for (const gfx::Rect& rect : touch_event_handler_region) {
scroll_rects->addItem(BuildScrollRect(
@@ -117,8 +116,8 @@
if (report_wheel_scrollers) {
scroll_rects->addItem(BuildScrollRect(
// TODO(yutak): This truncates the floating point position to integers.
- gfx::Rect(web_layer->position().x(), web_layer->position().y(),
- web_layer->bounds().width(), web_layer->bounds().height()),
+ gfx::Rect(cc_layer->position().x(), cc_layer->position().y(),
+ cc_layer->bounds().width(), cc_layer->bounds().height()),
protocol::LayerTree::ScrollRect::TypeEnum::WheelEventHandler));
}
return scroll_rects->length() ? std::move(scroll_rects) : nullptr;
@@ -139,7 +138,7 @@
}
static std::unique_ptr<protocol::LayerTree::StickyPositionConstraint>
-BuildStickyInfoForLayer(GraphicsLayer* root, WebLayer* layer) {
+BuildStickyInfoForLayer(GraphicsLayer* root, cc::Layer* layer) {
cc::LayerStickyPositionConstraint constraints =
layer->sticky_position_constraint();
if (!constraints.is_sticky)
@@ -181,16 +180,16 @@
GraphicsLayer* graphics_layer,
int node_id,
bool report_wheel_event_listeners) {
- WebLayer* web_layer = graphics_layer->PlatformLayer();
+ cc::Layer* cc_layer = graphics_layer->PlatformLayer();
std::unique_ptr<protocol::LayerTree::Layer> layer_object =
protocol::LayerTree::Layer::create()
.setLayerId(IdForLayer(graphics_layer))
- .setOffsetX(web_layer->position().x())
- .setOffsetY(web_layer->position().y())
- .setWidth(web_layer->bounds().width())
- .setHeight(web_layer->bounds().height())
+ .setOffsetX(cc_layer->position().x())
+ .setOffsetY(cc_layer->position().y())
+ .setWidth(cc_layer->bounds().width())
+ .setHeight(cc_layer->bounds().height())
.setPaintCount(graphics_layer->PaintCount())
- .setDrawsContent(web_layer->DrawsContent())
+ .setDrawsContent(cc_layer->DrawsContent())
.build();
if (node_id)
@@ -211,15 +210,15 @@
layer_object->setTransform(std::move(transform_array));
const FloatPoint3D& transform_origin = graphics_layer->TransformOrigin();
// FIXME: rename these to setTransformOrigin*
- if (web_layer->bounds().width() > 0) {
+ if (cc_layer->bounds().width() > 0) {
layer_object->setAnchorX(transform_origin.X() /
- web_layer->bounds().width());
+ cc_layer->bounds().width());
} else {
layer_object->setAnchorX(0.f);
}
- if (web_layer->bounds().height() > 0) {
+ if (cc_layer->bounds().height() > 0) {
layer_object->setAnchorY(transform_origin.Y() /
- web_layer->bounds().height());
+ cc_layer->bounds().height());
} else {
layer_object->setAnchorY(0.f);
}
@@ -230,7 +229,7 @@
if (scroll_rects)
layer_object->setScrollRects(std::move(scroll_rects));
std::unique_ptr<protocol::LayerTree::StickyPositionConstraint> sticky_info =
- BuildStickyInfoForLayer(root, web_layer);
+ BuildStickyInfoForLayer(root, cc_layer);
if (sticky_info)
layer_object->setStickyPositionConstraint(std::move(sticky_info));
return layer_object;
diff --git a/third_party/blink/renderer/core/layout/layout_object.cc b/third_party/blink/renderer/core/layout/layout_object.cc
index 0c6fcad..b0e7025 100644
--- a/third_party/blink/renderer/core/layout/layout_object.cc
+++ b/third_party/blink/renderer/core/layout/layout_object.cc
@@ -2800,7 +2800,7 @@
// tracking those rects outweighs the benefit of doing compositor thread hit
// testing.
// FIXME: This limit needs to be low due to the O(n^2) algorithm in
- // WebLayer::setTouchEventHandlerRegion - crbug.com/300282.
+ // ScrollingCoordinator::SetTouchEventTargetRects() - crbug.com/300282.
const size_t kMaxRectsPerLayer = 100;
LayerHitTestRects::iterator iter = layer_rects.find(current_layer);
diff --git a/third_party/blink/renderer/core/layout/layout_video.cc b/third_party/blink/renderer/core/layout/layout_video.cc
index db9b951b..877bd5f 100644
--- a/third_party/blink/renderer/core/layout/layout_video.cc
+++ b/third_party/blink/renderer/core/layout/layout_video.cc
@@ -25,7 +25,6 @@
#include "third_party/blink/renderer/core/layout/layout_video.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/html/media/html_video_element.h"
#include "third_party/blink/renderer/core/html_names.h"
diff --git a/third_party/blink/renderer/core/loader/empty_clients.h b/third_party/blink/renderer/core/loader/empty_clients.h
index 7c95a2d..afdc8a8 100644
--- a/third_party/blink/renderer/core/loader/empty_clients.h
+++ b/third_party/blink/renderer/core/loader/empty_clients.h
@@ -194,7 +194,8 @@
Cursor LastSetCursorForTesting() const override { return PointerCursor(); }
void AttachRootGraphicsLayer(GraphicsLayer*, LocalFrame* local_root) override;
- void AttachRootLayer(WebLayer*, LocalFrame* local_root) override {}
+ void AttachRootLayer(scoped_refptr<cc::Layer>,
+ LocalFrame* local_root) override {}
void SetEventListenerProperties(LocalFrame*,
WebEventListenerClass,
diff --git a/third_party/blink/renderer/core/page/chrome_client.h b/third_party/blink/renderer/core/page/chrome_client.h
index 579413f..af1f352 100644
--- a/third_party/blink/renderer/core/page/chrome_client.h
+++ b/third_party/blink/renderer/core/page/chrome_client.h
@@ -30,7 +30,6 @@
#include "third_party/blink/public/platform/web_drag_operation.h"
#include "third_party/blink/public/platform/web_event_listener_properties.h"
#include "third_party/blink/public/platform/web_focus_type.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/dom/animation_worklet_proxy_client.h"
#include "third_party/blink/renderer/core/dom/ax_object_cache.h"
@@ -52,6 +51,7 @@
#undef CreateWindow
namespace cc {
+class Layer;
struct OverscrollBehavior;
}
@@ -244,10 +244,11 @@
virtual void AttachRootGraphicsLayer(GraphicsLayer*,
LocalFrame* local_root) = 0;
- // Pass nullptr as the WebLayer to detach the root layer.
- // This sets the WebLayer for the LocalFrame's WebWidget, if it has
+ // Pass nullptr as the cc::Layer to detach the root layer.
+ // This sets the cc::Layer for the LocalFrame's WebWidget, if it has
// one. Otherwise it sets it for the WebViewImpl.
- virtual void AttachRootLayer(WebLayer*, LocalFrame* local_root) = 0;
+ virtual void AttachRootLayer(scoped_refptr<cc::Layer>,
+ LocalFrame* local_root) = 0;
virtual void AttachCompositorAnimationTimeline(CompositorAnimationTimeline*,
LocalFrame* local_root) {}
diff --git a/third_party/blink/renderer/core/page/chrome_client_impl.cc b/third_party/blink/renderer/core/page/chrome_client_impl.cc
index 6b9ce0b..af7cc35 100644
--- a/third_party/blink/renderer/core/page/chrome_client_impl.cc
+++ b/third_party/blink/renderer/core/page/chrome_client_impl.cc
@@ -694,7 +694,7 @@
web_frame->FrameWidgetImpl()->SetRootGraphicsLayer(root_layer);
}
-void ChromeClientImpl::AttachRootLayer(WebLayer* root_layer,
+void ChromeClientImpl::AttachRootLayer(scoped_refptr<cc::Layer> root_layer,
LocalFrame* local_frame) {
// TODO(dcheng): This seems wrong. Non-local roots shouldn't be calling this
// function.
@@ -707,7 +707,7 @@
// TODO(dcheng): This should be called before the widget is gone...
DCHECK(web_frame->FrameWidget() || !root_layer);
if (web_frame->FrameWidgetImpl())
- web_frame->FrameWidgetImpl()->SetRootLayer(root_layer);
+ web_frame->FrameWidgetImpl()->SetRootLayer(std::move(root_layer));
}
void ChromeClientImpl::AttachCompositorAnimationTimeline(
diff --git a/third_party/blink/renderer/core/page/chrome_client_impl.h b/third_party/blink/renderer/core/page/chrome_client_impl.h
index 84c159a..fb79804 100644
--- a/third_party/blink/renderer/core/page/chrome_client_impl.h
+++ b/third_party/blink/renderer/core/page/chrome_client_impl.h
@@ -151,7 +151,8 @@
void AttachRootGraphicsLayer(GraphicsLayer*, LocalFrame* local_root) override;
- void AttachRootLayer(WebLayer*, LocalFrame* local_root) override;
+ void AttachRootLayer(scoped_refptr<cc::Layer>,
+ LocalFrame* local_root) override;
void AttachCompositorAnimationTimeline(CompositorAnimationTimeline*,
LocalFrame*) override;
diff --git a/third_party/blink/renderer/core/page/page.cc b/third_party/blink/renderer/core/page/page.cc
index 1c299e2..995df2f 100644
--- a/third_party/blink/renderer/core/page/page.cc
+++ b/third_party/blink/renderer/core/page/page.cc
@@ -22,7 +22,6 @@
#include "third_party/blink/renderer/core/page/page.h"
#include "third_party/blink/public/platform/platform.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/web/blink.h"
#include "third_party/blink/renderer/bindings/core/v8/script_controller.h"
#include "third_party/blink/renderer/bindings/core/v8/source_location.h"
diff --git a/third_party/blink/renderer/core/page/page_overlay.cc b/third_party/blink/renderer/core/page/page_overlay.cc
index cc7aebc..b76cb2d7 100644
--- a/third_party/blink/renderer/core/page/page_overlay.cc
+++ b/third_party/blink/renderer/core/page/page_overlay.cc
@@ -32,7 +32,7 @@
#include <utility>
#include "base/memory/ptr_util.h"
-#include "third_party/blink/public/platform/web_layer.h"
+#include "cc/layers/layer.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/visual_viewport.h"
#include "third_party/blink/renderer/core/frame/web_frame_widget_base.h"
@@ -77,8 +77,8 @@
// This is required for contents of overlay to stay in sync with the page
// while scrolling.
- WebLayer* platform_layer = layer_->PlatformLayer();
- platform_layer->AddMainThreadScrollingReasons(
+ cc::Layer* cc_layer = layer_->PlatformLayer();
+ cc_layer->AddMainThreadScrollingReasons(
MainThreadScrollingReason::kPageOverlay);
if (frame->IsMainFrame()) {
frame->GetPage()->GetVisualViewport().ContainerLayer()->AddChild(
diff --git a/third_party/blink/renderer/core/page/scrolling/scrolling_coordinator.cc b/third_party/blink/renderer/core/page/scrolling/scrolling_coordinator.cc
index f915d2936..b7436c8 100644
--- a/third_party/blink/renderer/core/page/scrolling/scrolling_coordinator.cc
+++ b/third_party/blink/renderer/core/page/scrolling/scrolling_coordinator.cc
@@ -64,7 +64,6 @@
#include "third_party/blink/renderer/platform/mac/scroll_animator_mac.h"
#endif
#include "third_party/blink/public/platform/platform.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/platform/web_layer_tree_view.h"
#include "third_party/blink/renderer/platform/scroll/main_thread_scrolling_reason.h"
#include "third_party/blink/renderer/platform/scroll/scroll_animator_base.h"
@@ -72,13 +71,12 @@
#include "third_party/blink/renderer/platform/scroll/scrollbar_theme.h"
#include "third_party/blink/renderer/platform/wtf/text/string_builder.h"
-using blink::WebLayer;
using blink::WebRect;
using blink::WebVector;
namespace {
-WebLayer* GraphicsLayerToWebLayer(blink::GraphicsLayer* layer) {
+cc::Layer* GraphicsLayerToCcLayer(blink::GraphicsLayer* layer) {
return layer ? layer->PlatformLayer() : nullptr;
}
@@ -105,7 +103,7 @@
void ScrollingCoordinator::SetShouldHandleScrollGestureOnMainThreadRegion(
const Region& region,
LocalFrameView* frame_view) {
- if (WebLayer* scroll_layer = GraphicsLayerToWebLayer(
+ if (cc::Layer* scroll_layer = GraphicsLayerToCcLayer(
frame_view->LayoutViewportScrollableArea()->LayerForScrolling())) {
scroll_layer->SetNonFastScrollableRegion(RegionToCCRegion(region));
}
@@ -226,8 +224,8 @@
frame_view->ClearFrameIsScrollableDidChange();
if (frame_view && !RuntimeEnabledFeatures::RootLayerScrollingEnabled()) {
- if (WebLayer* scroll_layer =
- GraphicsLayerToWebLayer(frame_view->LayerForScrolling())) {
+ if (cc::Layer* scroll_layer =
+ GraphicsLayerToCcLayer(frame_view->LayerForScrolling())) {
UpdateUserInputScrollable(frame_view);
scroll_layer->SetBounds(
static_cast<gfx::Size>(frame_view->ContentsSize()));
@@ -245,8 +243,8 @@
LocalFrameView* frame_view = ToLocalFrame(child)->View();
if (!frame_view || frame_view->ShouldThrottleRendering())
continue;
- if (WebLayer* scroll_layer =
- GraphicsLayerToWebLayer(frame_view->LayerForScrolling())) {
+ if (cc::Layer* scroll_layer =
+ GraphicsLayerToCcLayer(frame_view->LayerForScrolling())) {
scroll_layer->SetBounds(
static_cast<gfx::Size>(frame_view->ContentsSize()));
}
@@ -256,8 +254,8 @@
static void ClearPositionConstraintExceptForLayer(GraphicsLayer* layer,
GraphicsLayer* except) {
- if (layer && layer != except && GraphicsLayerToWebLayer(layer)) {
- GraphicsLayerToWebLayer(layer)->SetPositionConstraint(
+ if (layer && layer != except && GraphicsLayerToCcLayer(layer)) {
+ GraphicsLayerToCcLayer(layer)->SetPositionConstraint(
cc::LayerPositionConstraint());
}
}
@@ -301,7 +299,7 @@
ClearPositionConstraintExceptForLayer(
composited_layer_mapping->MainGraphicsLayer(), main_layer);
- if (WebLayer* scrollable_layer = GraphicsLayerToWebLayer(main_layer))
+ if (cc::Layer* scrollable_layer = GraphicsLayerToCcLayer(main_layer))
scrollable_layer->SetPositionConstraint(ComputePositionConstraint(layer));
}
@@ -384,7 +382,7 @@
static void SetupScrollbarLayer(
GraphicsLayer* scrollbar_graphics_layer,
const ScrollingCoordinator::ScrollbarLayerGroup* scrollbar_layer_group,
- WebLayer* scrolling_layer) {
+ cc::Layer* scrolling_layer) {
DCHECK(scrollbar_graphics_layer);
if (!scrolling_layer) {
@@ -465,8 +463,8 @@
AddScrollbarLayerGroup(scrollable_area, orientation, std::move(group));
}
- WebLayer* scroll_layer =
- GraphicsLayerToWebLayer(scrollable_area->LayerForScrolling());
+ cc::Layer* scroll_layer =
+ GraphicsLayerToCcLayer(scrollable_area->LayerForScrolling());
SetupScrollbarLayer(scrollbar_graphics_layer, scrollbar_layer_group,
scroll_layer);
@@ -486,12 +484,12 @@
if (!scroll_layer || scroll_layer->GetScrollableArea() != scrollable_area)
return false;
- WebLayer* web_layer =
- GraphicsLayerToWebLayer(scrollable_area->LayerForScrolling());
- if (!web_layer)
+ cc::Layer* cc_layer =
+ GraphicsLayerToCcLayer(scrollable_area->LayerForScrolling());
+ if (!cc_layer)
return false;
- web_layer->SetScrollOffset(
+ cc_layer->SetScrollOffset(
static_cast<gfx::ScrollOffset>(scrollable_area->ScrollPosition()));
return true;
}
@@ -507,15 +505,15 @@
UpdateUserInputScrollable(scrollable_area);
- WebLayer* web_layer =
- GraphicsLayerToWebLayer(scrollable_area->LayerForScrolling());
- WebLayer* container_layer =
- GraphicsLayerToWebLayer(scrollable_area->LayerForContainer());
- if (web_layer) {
- web_layer->SetScrollable(container_layer->bounds());
+ cc::Layer* cc_layer =
+ GraphicsLayerToCcLayer(scrollable_area->LayerForScrolling());
+ cc::Layer* container_layer =
+ GraphicsLayerToCcLayer(scrollable_area->LayerForContainer());
+ if (cc_layer) {
+ cc_layer->SetScrollable(container_layer->bounds());
FloatPoint scroll_position(scrollable_area->ScrollOrigin() +
scrollable_area->GetScrollOffset());
- web_layer->SetScrollOffset(static_cast<gfx::ScrollOffset>(scroll_position));
+ cc_layer->SetScrollOffset(static_cast<gfx::ScrollOffset>(scroll_position));
// TODO(bokan): This method shouldn't be resizing the layer geometry. That
// happens in CompositedLayerMapping::UpdateScrollingLayerGeometry.
LayoutSize subpixel_accumulation =
@@ -534,12 +532,12 @@
// The scrolling contents layer must be at least as large as the clip.
scroll_contents_size = scroll_contents_size.ExpandedTo(IntSize(
container_layer->bounds().width(), container_layer->bounds().height()));
- web_layer->SetBounds(static_cast<gfx::Size>(scroll_contents_size));
+ cc_layer->SetBounds(static_cast<gfx::Size>(scroll_contents_size));
// VisualViewport scrolling may involve pinch zoom and gets routed through
// WebViewImpl explicitly rather than via ScrollingCoordinator::DidScroll
// since it needs to be set in tandem with the page scale delta.
if (scrollable_area != &page_->GetVisualViewport()) {
- web_layer->set_did_scroll_callback(WTF::BindRepeating(
+ cc_layer->set_did_scroll_callback(WTF::BindRepeating(
&ScrollingCoordinator::DidScroll, WrapWeakPersistent(this)));
}
}
@@ -549,7 +547,7 @@
scrollable_area->LayerForHorizontalScrollbar();
if (horizontal_scrollbar_layer) {
SetupScrollbarLayer(horizontal_scrollbar_layer, scrollbar_layer_group,
- web_layer);
+ cc_layer);
}
}
if (ScrollbarLayerGroup* scrollbar_layer_group =
@@ -559,7 +557,7 @@
if (vertical_scrollbar_layer) {
SetupScrollbarLayer(vertical_scrollbar_layer, scrollbar_layer_group,
- web_layer);
+ cc_layer);
}
}
@@ -584,7 +582,7 @@
}
scrollable_area->LayerForScrollingDidChange(timeline);
- return !!web_layer;
+ return !!cc_layer;
}
using GraphicsLayerHitTestRects =
@@ -775,14 +773,14 @@
void ScrollingCoordinator::UpdateUserInputScrollable(
ScrollableArea* scrollable_area) {
- WebLayer* web_layer =
- GraphicsLayerToWebLayer(scrollable_area->LayerForScrolling());
- if (web_layer) {
+ cc::Layer* cc_layer =
+ GraphicsLayerToCcLayer(scrollable_area->LayerForScrolling());
+ if (cc_layer) {
bool can_scroll_x =
scrollable_area->UserInputScrollable(kHorizontalScrollbar);
bool can_scroll_y =
scrollable_area->UserInputScrollable(kVerticalScrollbar);
- web_layer->SetUserScrollable(can_scroll_x, can_scroll_y);
+ cc_layer->SetUserScrollable(can_scroll_x, can_scroll_y);
}
}
@@ -887,24 +885,24 @@
void ScrollingCoordinator::UpdateScrollParentForGraphicsLayer(
GraphicsLayer* child,
const PaintLayer* parent) {
- WebLayer* scroll_parent_web_layer = nullptr;
+ cc::Layer* scroll_parent_cc_layer = nullptr;
if (parent && parent->HasCompositedLayerMapping())
- scroll_parent_web_layer = GraphicsLayerToWebLayer(
+ scroll_parent_cc_layer = GraphicsLayerToCcLayer(
parent->GetCompositedLayerMapping()->ScrollingContentsLayer());
- child->SetScrollParent(scroll_parent_web_layer);
+ child->SetScrollParent(scroll_parent_cc_layer);
}
void ScrollingCoordinator::UpdateClipParentForGraphicsLayer(
GraphicsLayer* child,
const PaintLayer* parent) {
- WebLayer* clip_parent_web_layer = nullptr;
+ cc::Layer* clip_parent_cc_layer = nullptr;
if (parent && parent->HasCompositedLayerMapping()) {
- clip_parent_web_layer = GraphicsLayerToWebLayer(
+ clip_parent_cc_layer = GraphicsLayerToCcLayer(
parent->GetCompositedLayerMapping()->ParentForSublayers());
}
- child->SetClipParent(clip_parent_web_layer);
+ child->SetClipParent(clip_parent_cc_layer);
}
void ScrollingCoordinator::WillDestroyLayer(PaintLayer* layer) {
@@ -921,11 +919,11 @@
MainThreadScrollingReasons main_thread_scrolling_reasons) {
GraphicsLayer* visual_viewport_layer =
frame->GetPage()->GetVisualViewport().ScrollLayer();
- WebLayer* visual_viewport_scroll_layer =
- GraphicsLayerToWebLayer(visual_viewport_layer);
+ cc::Layer* visual_viewport_scroll_layer =
+ GraphicsLayerToCcLayer(visual_viewport_layer);
GraphicsLayer* layer =
frame->View()->LayoutViewportScrollableArea()->LayerForScrolling();
- if (WebLayer* scroll_layer = GraphicsLayerToWebLayer(layer)) {
+ if (cc::Layer* scroll_layer = GraphicsLayerToCcLayer(layer)) {
if (main_thread_scrolling_reasons) {
ScrollableArea* scrollable_area = layer->GetScrollableArea();
if (scrollable_area) {
@@ -1283,8 +1281,8 @@
if (frame_view->FrameIsScrollableDidChange())
return true;
- if (WebLayer* scroll_layer =
- frame_view ? GraphicsLayerToWebLayer(
+ if (cc::Layer* scroll_layer =
+ frame_view ? GraphicsLayerToCcLayer(
frame_view->LayoutViewportScrollableArea()
->LayerForScrolling())
: nullptr) {
diff --git a/third_party/blink/renderer/core/page/scrolling/scrolling_coordinator.h b/third_party/blink/renderer/core/page/scrolling/scrolling_coordinator.h
index 4e7b021..bc0d2bd 100644
--- a/third_party/blink/renderer/core/page/scrolling/scrolling_coordinator.h
+++ b/third_party/blink/renderer/core/page/scrolling/scrolling_coordinator.h
@@ -29,7 +29,6 @@
#include <memory>
#include "base/macros.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/platform/geometry/int_rect.h"
#include "third_party/blink/renderer/platform/graphics/compositor_element_id.h"
diff --git a/third_party/blink/renderer/core/page/scrolling/scrolling_coordinator_test.cc b/third_party/blink/renderer/core/page/scrolling/scrolling_coordinator_test.cc
index 12b6613..e6cb415 100644
--- a/third_party/blink/renderer/core/page/scrolling/scrolling_coordinator_test.cc
+++ b/third_party/blink/renderer/core/page/scrolling/scrolling_coordinator_test.cc
@@ -29,7 +29,6 @@
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/public/platform/web_cache.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/platform/web_layer_tree_view.h"
#include "third_party/blink/public/platform/web_rect.h"
#include "third_party/blink/public/platform/web_url_loader_mock_factory.h"
@@ -105,7 +104,7 @@
WebString::FromUTF8(file_name));
}
- WebLayer* GetRootScrollLayer() {
+ cc::Layer* GetRootScrollLayer() {
GraphicsLayer* layer =
GetFrame()->View()->LayoutViewportScrollableArea()->LayerForScrolling();
return layer ? layer->PlatformLayer() : nullptr;
@@ -142,7 +141,7 @@
frame_view));
// Fast scrolling should be enabled by default.
- WebLayer* root_scroll_layer = GetRootScrollLayer();
+ cc::Layer* root_scroll_layer = GetRootScrollLayer();
ASSERT_TRUE(root_scroll_layer);
ASSERT_TRUE(root_scroll_layer->scrollable());
ASSERT_FALSE(root_scroll_layer->should_scroll_on_main_thread());
@@ -153,7 +152,7 @@
GetWebLayerTreeView()->EventListenerProperties(
WebEventListenerClass::kMouseWheel));
- WebLayer* inner_viewport_scroll_layer =
+ cc::Layer* inner_viewport_scroll_layer =
page->GetVisualViewport().ScrollLayer()->PlatformLayer();
ASSERT_TRUE(inner_viewport_scroll_layer->scrollable());
ASSERT_FALSE(inner_viewport_scroll_layer->should_scroll_on_main_thread());
@@ -173,13 +172,13 @@
frame_view));
// Main scrolling should be enabled with the setting override.
- WebLayer* root_scroll_layer = GetRootScrollLayer();
+ cc::Layer* root_scroll_layer = GetRootScrollLayer();
ASSERT_TRUE(root_scroll_layer);
ASSERT_TRUE(root_scroll_layer->scrollable());
ASSERT_TRUE(root_scroll_layer->should_scroll_on_main_thread());
// Main scrolling should also propagate to inner viewport layer.
- WebLayer* inner_viewport_scroll_layer =
+ cc::Layer* inner_viewport_scroll_layer =
page->GetVisualViewport().ScrollLayer()->PlatformLayer();
ASSERT_TRUE(inner_viewport_scroll_layer->scrollable());
ASSERT_TRUE(inner_viewport_scroll_layer->should_scroll_on_main_thread());
@@ -214,14 +213,14 @@
box->Layer()->GetCompositedLayerMapping();
ASSERT_TRUE(composited_layer_mapping->HasScrollingLayer());
DCHECK(composited_layer_mapping->ScrollingContentsLayer());
- WebLayer* web_scroll_layer =
+ cc::Layer* cc_scroll_layer =
composited_layer_mapping->ScrollingContentsLayer()->PlatformLayer();
- ASSERT_TRUE(web_scroll_layer);
- ASSERT_NEAR(1.2f, web_scroll_layer->scroll_offset().x(), 0.01f);
- ASSERT_NEAR(1.2f, web_scroll_layer->scroll_offset().y(), 0.01f);
+ ASSERT_TRUE(cc_scroll_layer);
+ ASSERT_NEAR(1.2f, cc_scroll_layer->scroll_offset().x(), 0.01f);
+ ASSERT_NEAR(1.2f, cc_scroll_layer->scroll_offset().y(), 0.01f);
}
-static WebLayer* WebLayerFromElement(Element* element) {
+static cc::Layer* CcLayerFromElement(Element* element) {
if (!element)
return nullptr;
LayoutObject* layout_object = element->GetLayoutObject();
@@ -246,7 +245,7 @@
ForceFullCompositingUpdate();
// Fixed position should not fall back to main thread scrolling.
- WebLayer* root_scroll_layer = GetRootScrollLayer();
+ cc::Layer* root_scroll_layer = GetRootScrollLayer();
ASSERT_TRUE(root_scroll_layer);
ASSERT_FALSE(root_scroll_layer->should_scroll_on_main_thread());
@@ -254,7 +253,7 @@
{
Element* element = document->getElementById("div-tl");
ASSERT_TRUE(element);
- WebLayer* layer = WebLayerFromElement(element);
+ cc::Layer* layer = CcLayerFromElement(element);
ASSERT_TRUE(layer);
cc::LayerPositionConstraint constraint = layer->position_constraint();
ASSERT_TRUE(constraint.is_fixed_position());
@@ -264,7 +263,7 @@
{
Element* element = document->getElementById("div-tr");
ASSERT_TRUE(element);
- WebLayer* layer = WebLayerFromElement(element);
+ cc::Layer* layer = CcLayerFromElement(element);
ASSERT_TRUE(layer);
cc::LayerPositionConstraint constraint = layer->position_constraint();
ASSERT_TRUE(constraint.is_fixed_position());
@@ -274,7 +273,7 @@
{
Element* element = document->getElementById("div-bl");
ASSERT_TRUE(element);
- WebLayer* layer = WebLayerFromElement(element);
+ cc::Layer* layer = CcLayerFromElement(element);
ASSERT_TRUE(layer);
cc::LayerPositionConstraint constraint = layer->position_constraint();
ASSERT_TRUE(constraint.is_fixed_position());
@@ -284,7 +283,7 @@
{
Element* element = document->getElementById("div-br");
ASSERT_TRUE(element);
- WebLayer* layer = WebLayerFromElement(element);
+ cc::Layer* layer = CcLayerFromElement(element);
ASSERT_TRUE(layer);
cc::LayerPositionConstraint constraint = layer->position_constraint();
ASSERT_TRUE(constraint.is_fixed_position());
@@ -294,7 +293,7 @@
{
Element* element = document->getElementById("span-tl");
ASSERT_TRUE(element);
- WebLayer* layer = WebLayerFromElement(element);
+ cc::Layer* layer = CcLayerFromElement(element);
ASSERT_TRUE(layer);
cc::LayerPositionConstraint constraint = layer->position_constraint();
ASSERT_TRUE(constraint.is_fixed_position());
@@ -304,7 +303,7 @@
{
Element* element = document->getElementById("span-tr");
ASSERT_TRUE(element);
- WebLayer* layer = WebLayerFromElement(element);
+ cc::Layer* layer = CcLayerFromElement(element);
ASSERT_TRUE(layer);
cc::LayerPositionConstraint constraint = layer->position_constraint();
ASSERT_TRUE(constraint.is_fixed_position());
@@ -314,7 +313,7 @@
{
Element* element = document->getElementById("span-bl");
ASSERT_TRUE(element);
- WebLayer* layer = WebLayerFromElement(element);
+ cc::Layer* layer = CcLayerFromElement(element);
ASSERT_TRUE(layer);
cc::LayerPositionConstraint constraint = layer->position_constraint();
ASSERT_TRUE(constraint.is_fixed_position());
@@ -324,7 +323,7 @@
{
Element* element = document->getElementById("span-br");
ASSERT_TRUE(element);
- WebLayer* layer = WebLayerFromElement(element);
+ cc::Layer* layer = CcLayerFromElement(element);
ASSERT_TRUE(layer);
cc::LayerPositionConstraint constraint = layer->position_constraint();
ASSERT_TRUE(constraint.is_fixed_position());
@@ -339,7 +338,7 @@
ForceFullCompositingUpdate();
// Sticky position should not fall back to main thread scrolling.
- WebLayer* root_scroll_layer = GetRootScrollLayer();
+ cc::Layer* root_scroll_layer = GetRootScrollLayer();
ASSERT_TRUE(root_scroll_layer);
EXPECT_FALSE(root_scroll_layer->should_scroll_on_main_thread());
@@ -347,7 +346,7 @@
{
Element* element = document->getElementById("div-tl");
ASSERT_TRUE(element);
- WebLayer* layer = WebLayerFromElement(element);
+ cc::Layer* layer = CcLayerFromElement(element);
ASSERT_TRUE(layer);
cc::LayerStickyPositionConstraint constraint =
layer->sticky_position_constraint();
@@ -365,7 +364,7 @@
{
Element* element = document->getElementById("div-tr");
ASSERT_TRUE(element);
- WebLayer* layer = WebLayerFromElement(element);
+ cc::Layer* layer = CcLayerFromElement(element);
ASSERT_TRUE(layer);
cc::LayerStickyPositionConstraint constraint =
layer->sticky_position_constraint();
@@ -376,7 +375,7 @@
{
Element* element = document->getElementById("div-bl");
ASSERT_TRUE(element);
- WebLayer* layer = WebLayerFromElement(element);
+ cc::Layer* layer = CcLayerFromElement(element);
ASSERT_TRUE(layer);
cc::LayerStickyPositionConstraint constraint =
layer->sticky_position_constraint();
@@ -387,7 +386,7 @@
{
Element* element = document->getElementById("div-br");
ASSERT_TRUE(element);
- WebLayer* layer = WebLayerFromElement(element);
+ cc::Layer* layer = CcLayerFromElement(element);
ASSERT_TRUE(layer);
cc::LayerStickyPositionConstraint constraint =
layer->sticky_position_constraint();
@@ -398,7 +397,7 @@
{
Element* element = document->getElementById("span-tl");
ASSERT_TRUE(element);
- WebLayer* layer = WebLayerFromElement(element);
+ cc::Layer* layer = CcLayerFromElement(element);
ASSERT_TRUE(layer);
cc::LayerStickyPositionConstraint constraint =
layer->sticky_position_constraint();
@@ -410,7 +409,7 @@
{
Element* element = document->getElementById("span-tlbr");
ASSERT_TRUE(element);
- WebLayer* layer = WebLayerFromElement(element);
+ cc::Layer* layer = CcLayerFromElement(element);
ASSERT_TRUE(layer);
cc::LayerStickyPositionConstraint constraint =
layer->sticky_position_constraint();
@@ -425,7 +424,7 @@
{
Element* element = document->getElementById("composited-top");
ASSERT_TRUE(element);
- WebLayer* layer = WebLayerFromElement(element);
+ cc::Layer* layer = CcLayerFromElement(element);
ASSERT_TRUE(layer);
cc::LayerStickyPositionConstraint constraint =
layer->sticky_position_constraint();
@@ -521,7 +520,7 @@
NavigateTo(base_url_ + "clipped-body.html");
ForceFullCompositingUpdate();
- WebLayer* root_scroll_layer = GetRootScrollLayer();
+ cc::Layer* root_scroll_layer = GetRootScrollLayer();
ASSERT_TRUE(root_scroll_layer);
EXPECT_TRUE(root_scroll_layer->non_fast_scrollable_region().IsEmpty());
}
@@ -541,8 +540,8 @@
box->Layer()->GetCompositedLayerMapping();
GraphicsLayer* graphics_layer = composited_layer_mapping->MainGraphicsLayer();
- WebLayer* web_layer = graphics_layer->PlatformLayer();
- cc::Region region = web_layer->touch_action_region().GetRegionForTouchAction(
+ cc::Layer* cc_layer = graphics_layer->PlatformLayer();
+ cc::Region region = cc_layer->touch_action_region().GetRegionForTouchAction(
TouchAction::kTouchActionPanX | TouchAction::kTouchActionPanDown);
EXPECT_EQ(region.GetRegionComplexity(), 1);
EXPECT_EQ(region.bounds(), gfx::Rect(0, 0, 1000, 1000));
@@ -563,19 +562,19 @@
box->Layer()->GetCompositedLayerMapping();
GraphicsLayer* graphics_layer = composited_layer_mapping->MainGraphicsLayer();
- WebLayer* web_layer = graphics_layer->PlatformLayer();
+ cc::Layer* cc_layer = graphics_layer->PlatformLayer();
- cc::Region region = web_layer->touch_action_region().GetRegionForTouchAction(
+ cc::Region region = cc_layer->touch_action_region().GetRegionForTouchAction(
TouchAction::kTouchActionPanDown | TouchAction::kTouchActionPanX);
EXPECT_EQ(region.GetRegionComplexity(), 1);
EXPECT_EQ(region.bounds(), gfx::Rect(0, 0, 100, 100));
- region = web_layer->touch_action_region().GetRegionForTouchAction(
+ region = cc_layer->touch_action_region().GetRegionForTouchAction(
TouchAction::kTouchActionPanDown | TouchAction::kTouchActionPanRight);
EXPECT_EQ(region.GetRegionComplexity(), 1);
EXPECT_EQ(region.bounds(), gfx::Rect(0, 0, 50, 50));
- region = web_layer->touch_action_region().GetRegionForTouchAction(
+ region = cc_layer->touch_action_region().GetRegionForTouchAction(
TouchAction::kTouchActionPanDown);
EXPECT_EQ(region.GetRegionComplexity(), 1);
EXPECT_EQ(region.bounds(), gfx::Rect(0, 100, 100, 100));
@@ -596,14 +595,14 @@
box->Layer()->GetCompositedLayerMapping();
GraphicsLayer* graphics_layer = composited_layer_mapping->MainGraphicsLayer();
- WebLayer* web_layer = graphics_layer->PlatformLayer();
+ cc::Layer* cc_layer = graphics_layer->PlatformLayer();
- cc::Region region = web_layer->touch_action_region().GetRegionForTouchAction(
+ cc::Region region = cc_layer->touch_action_region().GetRegionForTouchAction(
TouchAction::kTouchActionNone);
EXPECT_EQ(region.GetRegionComplexity(), 1);
EXPECT_EQ(region.bounds(), gfx::Rect(0, 0, 100, 100));
- region = web_layer->touch_action_region().GetRegionForTouchAction(
+ region = cc_layer->touch_action_region().GetRegionForTouchAction(
TouchAction::kTouchActionPanY);
EXPECT_EQ(region.GetRegionComplexity(), 1);
EXPECT_EQ(region.bounds(), gfx::Rect(0, 0, 1000, 1000));
@@ -662,7 +661,7 @@
ForceFullCompositingUpdate();
// Verify the properties of the accelerated scrolling element starting from
- // the LayoutObject all the way to the WebLayer.
+ // the LayoutObject all the way to the cc::Layer.
Element* scrollable_element =
GetFrame()->GetDocument()->getElementById("scrollable");
DCHECK(scrollable_element);
@@ -685,11 +684,11 @@
ASSERT_EQ(box->Layer()->GetScrollableArea(),
graphics_layer->GetScrollableArea());
- WebLayer* web_scroll_layer =
+ cc::Layer* cc_scroll_layer =
composited_layer_mapping->ScrollingContentsLayer()->PlatformLayer();
- ASSERT_TRUE(web_scroll_layer->scrollable());
- ASSERT_TRUE(web_scroll_layer->user_scrollable_horizontal());
- ASSERT_TRUE(web_scroll_layer->user_scrollable_vertical());
+ ASSERT_TRUE(cc_scroll_layer->scrollable());
+ ASSERT_TRUE(cc_scroll_layer->user_scrollable_horizontal());
+ ASSERT_TRUE(cc_scroll_layer->user_scrollable_vertical());
#if defined(OS_ANDROID)
// Now verify we've attached impl-side scrollbars onto the scrollbar layers
@@ -708,7 +707,7 @@
ForceFullCompositingUpdate();
// Verify the properties of the accelerated scrolling element starting from
- // the LayoutObject all the way to the WebLayer.
+ // the LayoutObject all the way to the cc::Layer.
Element* overflow_element =
GetFrame()->GetDocument()->getElementById("unscrollable-y");
DCHECK(overflow_element);
@@ -731,11 +730,11 @@
ASSERT_EQ(box->Layer()->GetScrollableArea(),
graphics_layer->GetScrollableArea());
- WebLayer* web_scroll_layer =
+ cc::Layer* cc_scroll_layer =
composited_layer_mapping->ScrollingContentsLayer()->PlatformLayer();
- ASSERT_TRUE(web_scroll_layer->scrollable());
- ASSERT_TRUE(web_scroll_layer->user_scrollable_horizontal());
- ASSERT_FALSE(web_scroll_layer->user_scrollable_vertical());
+ ASSERT_TRUE(cc_scroll_layer->scrollable());
+ ASSERT_TRUE(cc_scroll_layer->user_scrollable_horizontal());
+ ASSERT_FALSE(cc_scroll_layer->user_scrollable_vertical());
overflow_element =
GetFrame()->GetDocument()->getElementById("unscrollable-x");
@@ -757,11 +756,11 @@
ASSERT_EQ(box->Layer()->GetScrollableArea(),
graphics_layer->GetScrollableArea());
- web_scroll_layer =
+ cc_scroll_layer =
composited_layer_mapping->ScrollingContentsLayer()->PlatformLayer();
- ASSERT_TRUE(web_scroll_layer->scrollable());
- ASSERT_FALSE(web_scroll_layer->user_scrollable_horizontal());
- ASSERT_TRUE(web_scroll_layer->user_scrollable_vertical());
+ ASSERT_TRUE(cc_scroll_layer->scrollable());
+ ASSERT_FALSE(cc_scroll_layer->user_scrollable_horizontal());
+ ASSERT_TRUE(cc_scroll_layer->user_scrollable_vertical());
}
TEST_F(ScrollingCoordinatorTest, iframeScrolling) {
@@ -771,7 +770,7 @@
ForceFullCompositingUpdate();
// Verify the properties of the accelerated scrolling element starting from
- // the LayoutObject all the way to the WebLayer.
+ // the LayoutObject all the way to the cc::Layer.
Element* scrollable_frame =
GetFrame()->GetDocument()->getElementById("scrollable");
ASSERT_TRUE(scrollable_frame);
@@ -800,8 +799,8 @@
ASSERT_EQ(inner_frame_view->LayoutViewportScrollableArea(),
scroll_layer->GetScrollableArea());
- WebLayer* web_scroll_layer = scroll_layer->PlatformLayer();
- ASSERT_TRUE(web_scroll_layer->scrollable());
+ cc::Layer* cc_scroll_layer = scroll_layer->PlatformLayer();
+ ASSERT_TRUE(cc_scroll_layer->scrollable());
#if defined(OS_ANDROID)
// Now verify we've attached impl-side scrollbars onto the scrollbar layers
@@ -825,7 +824,7 @@
ForceFullCompositingUpdate();
// Verify the properties of the accelerated scrolling element starting from
- // the LayoutObject all the way to the WebLayer.
+ // the LayoutObject all the way to the cc::Layer.
Element* scrollable_frame =
GetFrame()->GetDocument()->getElementById("scrollable");
ASSERT_TRUE(scrollable_frame);
@@ -854,8 +853,8 @@
ASSERT_EQ(inner_frame_view->LayoutViewportScrollableArea(),
scroll_layer->GetScrollableArea());
- WebLayer* web_scroll_layer = scroll_layer->PlatformLayer();
- ASSERT_TRUE(web_scroll_layer->scrollable());
+ cc::Layer* cc_scroll_layer = scroll_layer->PlatformLayer();
+ ASSERT_TRUE(cc_scroll_layer->scrollable());
int expected_scroll_position =
958 + (inner_frame_view->LayoutViewportScrollableArea()
@@ -863,7 +862,7 @@
->IsOverlayScrollbar()
? 0
: 15);
- ASSERT_EQ(expected_scroll_position, web_scroll_layer->scroll_offset().x());
+ ASSERT_EQ(expected_scroll_position, cc_scroll_layer->scroll_offset().x());
}
TEST_F(ScrollingCoordinatorTest, setupScrollbarLayerShouldNotCrash) {
@@ -894,8 +893,8 @@
composited_layer_mapping->LayerForVerticalScrollbar();
ASSERT_TRUE(scrollbar_graphics_layer);
- bool has_web_scrollbar_layer = !scrollbar_graphics_layer->DrawsContent();
- ASSERT_TRUE(has_web_scrollbar_layer ||
+ bool has_cc_scrollbar_layer = !scrollbar_graphics_layer->DrawsContent();
+ ASSERT_TRUE(has_cc_scrollbar_layer ||
scrollbar_graphics_layer->PlatformLayer()
->should_scroll_on_main_thread());
}
@@ -918,10 +917,10 @@
frame_view->LayoutViewportScrollableArea()->LayerForHorizontalScrollbar();
ASSERT_TRUE(scrollbar_graphics_layer);
- WebLayer* platform_layer = scrollbar_graphics_layer->PlatformLayer();
+ cc::Layer* platform_layer = scrollbar_graphics_layer->PlatformLayer();
ASSERT_TRUE(platform_layer);
- WebLayer* contents_layer = scrollbar_graphics_layer->ContentsLayer();
+ cc::Layer* contents_layer = scrollbar_graphics_layer->ContentsLayer();
ASSERT_TRUE(contents_layer);
// After ScrollableAreaScrollbarLayerDidChange(),
@@ -938,7 +937,7 @@
NavigateTo(base_url_ + "fixed-position-losing-backing.html");
ForceFullCompositingUpdate();
- WebLayer* scroll_layer = GetRootScrollLayer();
+ cc::Layer* scroll_layer = GetRootScrollLayer();
ASSERT_TRUE(scroll_layer);
Document* document = GetFrame()->GetDocument();
@@ -1035,9 +1034,9 @@
ASSERT_EQ(inner_frame_view->LayoutViewportScrollableArea(),
scroll_layer->GetScrollableArea());
- WebLayer* web_scroll_layer = scroll_layer->PlatformLayer();
- ASSERT_TRUE(web_scroll_layer->scrollable());
- ASSERT_TRUE(web_scroll_layer->main_thread_scrolling_reasons() &
+ cc::Layer* cc_scroll_layer = scroll_layer->PlatformLayer();
+ ASSERT_TRUE(cc_scroll_layer->scrollable());
+ ASSERT_TRUE(cc_scroll_layer->main_thread_scrolling_reasons() &
MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects);
// Remove fixed background-attachment should make the iframe
@@ -1057,9 +1056,9 @@
->LayerForScrolling();
ASSERT_TRUE(scroll_layer);
- web_scroll_layer = scroll_layer->PlatformLayer();
- ASSERT_TRUE(web_scroll_layer->scrollable());
- ASSERT_FALSE(web_scroll_layer->main_thread_scrolling_reasons() &
+ cc_scroll_layer = scroll_layer->PlatformLayer();
+ ASSERT_TRUE(cc_scroll_layer->scrollable());
+ ASSERT_FALSE(cc_scroll_layer->main_thread_scrolling_reasons() &
MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects);
// Force main frame to scroll on main thread. All its descendants
@@ -1080,9 +1079,9 @@
->LayerForScrolling();
ASSERT_TRUE(scroll_layer);
- web_scroll_layer = scroll_layer->PlatformLayer();
- ASSERT_TRUE(web_scroll_layer->scrollable());
- ASSERT_TRUE(web_scroll_layer->main_thread_scrolling_reasons() &
+ cc_scroll_layer = scroll_layer->PlatformLayer();
+ ASSERT_TRUE(cc_scroll_layer->scrollable());
+ ASSERT_TRUE(cc_scroll_layer->main_thread_scrolling_reasons() &
MainThreadScrollingReason::kHasBackgroundAttachmentFixedObjects);
}
@@ -1115,10 +1114,10 @@
->LayerForScrolling();
ASSERT_TRUE(scroll_layer);
- WebLayer* web_scroll_layer = scroll_layer->PlatformLayer();
- ASSERT_TRUE(web_scroll_layer->scrollable());
+ cc::Layer* cc_scroll_layer = scroll_layer->PlatformLayer();
+ ASSERT_TRUE(cc_scroll_layer->scrollable());
ASSERT_TRUE(
- web_scroll_layer->main_thread_scrolling_reasons() &
+ cc_scroll_layer->main_thread_scrolling_reasons() &
MainThreadScrollingReason::kHasNonLayerViewportConstrainedObjects);
// The main thread scrolling reason should be reset upon the following change
@@ -1138,7 +1137,7 @@
"<div style='position: sticky; top: 0'>sticky</div>");
ForceFullCompositingUpdate();
ScrollableArea* viewport = GetFrame()->View()->LayoutViewportScrollableArea();
- WebLayer* scroll_layer = viewport->LayerForScrolling()->PlatformLayer();
+ cc::Layer* scroll_layer = viewport->LayerForScrolling()->PlatformLayer();
ASSERT_EQ(MainThreadScrollingReason::kHasNonLayerViewportConstrainedObjects,
scroll_layer->main_thread_scrolling_reasons());
}
diff --git a/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping.cc b/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping.cc
index 9a64b54..d304acdc 100644
--- a/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping.cc
+++ b/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping.cc
@@ -444,7 +444,7 @@
if (IsTextureLayerCanvas(GetLayoutObject())) {
CanvasRenderingContext* context =
ToHTMLCanvasElement(GetLayoutObject().GetNode())->RenderingContext();
- WebLayer* layer = context ? context->PlatformLayer() : nullptr;
+ cc::Layer* layer = context ? context->PlatformLayer() : nullptr;
// Determine whether the external texture layer covers the whole graphics
// layer. This may not be the case if there are box decorations or
// shadows.
@@ -852,7 +852,7 @@
ToHTMLFrameOwnerElement(layout_object.GetNode())->ContentFrame();
if (frame->IsRemoteFrame()) {
RemoteFrame* remote = ToRemoteFrame(frame);
- WebLayer* layer = remote->GetWebLayer();
+ cc::Layer* layer = remote->GetWebLayer();
graphics_layer_->SetContentsToPlatformLayer(
layer, remote->WebLayerHasFixedContentsOpaque());
}
@@ -1974,7 +1974,7 @@
CanvasRenderingContext* context =
ToHTMLCanvasElement(GetLayoutObject().GetNode())->RenderingContext();
// Content layer may be null if context is lost.
- if (WebLayer* content_layer = context->PlatformLayer()) {
+ if (cc::Layer* content_layer = context->PlatformLayer()) {
Color bg_color(Color::kTransparent);
if (ContentLayerSupportsDirectBackgroundComposition(GetLayoutObject())) {
bg_color = LayoutObjectBackgroundColor();
@@ -2364,8 +2364,8 @@
// NB, it is illegal at this point to query an ancestor's compositing state.
// Some compositing reasons depend on the compositing state of ancestors. So
// if we want a rendering context id for the context root, we cannot ask for
- // the id of its associated WebLayer now; it may not have one yet. We could do
- // a second pass after doing the compositing updates to get these ids, but
+ // the id of its associated cc::Layer now; it may not have one yet. We could
+ // do a second pass after doing the compositing updates to get these ids, but
// this would actually be harmful. We do not want to attach any semantic
// meaning to the context id other than the fact that they group a number of
// layers together for the sake of 3d sorting. So instead we will ask the
diff --git a/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping_test.cc b/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping_test.cc
index 66a23ced..22bd45a 100644
--- a/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping_test.cc
+++ b/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping_test.cc
@@ -4,9 +4,9 @@
#include "third_party/blink/renderer/core/paint/compositing/composited_layer_mapping.h"
+#include "cc/layers/layer.h"
#include "cc/layers/picture_layer.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/renderer/core/frame/local_frame_view.h"
#include "third_party/blink/renderer/core/layout/layout_box_model_object.h"
#include "third_party/blink/renderer/core/layout/layout_image.h"
@@ -2469,7 +2469,7 @@
ToLayoutBoxModelObject(GetLayoutObjectByElementId("scroller"));
PaintLayerScrollableArea* scrollable_area = scroller->GetScrollableArea();
- WebLayer* scrolling_layer =
+ cc::Layer* scrolling_layer =
scrollable_area->LayerForScrolling()->PlatformLayer();
EXPECT_EQ(0, scrolling_layer->scroll_offset().y());
EXPECT_EQ(150, scrolling_layer->bounds().height());
diff --git a/third_party/blink/renderer/core/paint/compositing/paint_layer_compositor.cc b/third_party/blink/renderer/core/paint/compositing/paint_layer_compositor.cc
index 9fe65141..1eac18c8 100644
--- a/third_party/blink/renderer/core/paint/compositing/paint_layer_compositor.cc
+++ b/third_party/blink/renderer/core/paint/compositing/paint_layer_compositor.cc
@@ -26,7 +26,6 @@
#include "third_party/blink/renderer/core/paint/compositing/paint_layer_compositor.h"
#include "base/optional.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/renderer/core/animation/document_animations.h"
#include "third_party/blink/renderer/core/animation/document_timeline.h"
#include "third_party/blink/renderer/core/animation/element_animations.h"
diff --git a/third_party/blink/renderer/core/paint/html_canvas_painter.cc b/third_party/blink/renderer/core/paint/html_canvas_painter.cc
index d196fc5..e0c872f 100644
--- a/third_party/blink/renderer/core/paint/html_canvas_painter.cc
+++ b/third_party/blink/renderer/core/paint/html_canvas_painter.cc
@@ -44,7 +44,7 @@
if (RuntimeEnabledFeatures::SlimmingPaintV2Enabled() &&
canvas->RenderingContext() &&
canvas->RenderingContext()->IsComposited()) {
- if (WebLayer* layer = canvas->RenderingContext()->PlatformLayer()) {
+ if (cc::Layer* layer = canvas->RenderingContext()->PlatformLayer()) {
IntRect pixel_snapped_rect = PixelSnappedIntRect(content_rect);
layer->SetBounds(static_cast<gfx::Size>(pixel_snapped_rect.Size()));
layer->SetIsDrawable(true);
diff --git a/third_party/blink/renderer/core/paint/html_canvas_painter_test.cc b/third_party/blink/renderer/core/paint/html_canvas_painter_test.cc
index c3ea0ee4..40a73c4 100644
--- a/third_party/blink/renderer/core/paint/html_canvas_painter_test.cc
+++ b/third_party/blink/renderer/core/paint/html_canvas_painter_test.cc
@@ -7,7 +7,7 @@
#include <memory>
#include <utility>
-#include "third_party/blink/public/platform/web_layer.h"
+#include "cc/layers/layer.h"
#include "third_party/blink/public/platform/web_size.h"
#include "third_party/blink/renderer/core/frame/local_frame_view.h"
#include "third_party/blink/renderer/core/html/canvas/canvas_context_creation_attributes_core.h"
@@ -60,7 +60,7 @@
ChromeClient& GetChromeClient() const override { return *chrome_client_; }
- bool HasLayerAttached(const WebLayer& layer) {
+ bool HasLayerAttached(const cc::Layer& layer) {
return chrome_client_->HasLayer(layer);
}
@@ -102,7 +102,7 @@
// Fetch the layer associated with the <canvas>, and check that it was
// correctly configured in the layer tree.
- const WebLayer* layer = context->PlatformLayer();
+ const cc::Layer* layer = context->PlatformLayer();
ASSERT_TRUE(layer);
EXPECT_TRUE(HasLayerAttached(*layer));
EXPECT_EQ(gfx::Size(300, 200), layer->bounds());
diff --git a/third_party/blink/renderer/core/paint/link_highlight_impl.cc b/third_party/blink/renderer/core/paint/link_highlight_impl.cc
index 93b46fc..cbc6115 100644
--- a/third_party/blink/renderer/core/paint/link_highlight_impl.cc
+++ b/third_party/blink/renderer/core/paint/link_highlight_impl.cc
@@ -34,7 +34,6 @@
#include "cc/paint/display_item_list.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/public/platform/web_float_point.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/platform/web_rect.h"
#include "third_party/blink/public/platform/web_size.h"
#include "third_party/blink/public/web/blink.h"
@@ -123,7 +122,7 @@
return content_layer_.get();
}
-WebLayer* LinkHighlightImpl::ClipLayer() {
+cc::Layer* LinkHighlightImpl::ClipLayer() {
return clip_layer_.get();
}
@@ -409,7 +408,7 @@
geometry_needs_update_ = true;
}
-WebLayer* LinkHighlightImpl::Layer() {
+cc::Layer* LinkHighlightImpl::Layer() {
return ClipLayer();
}
diff --git a/third_party/blink/renderer/core/paint/link_highlight_impl.h b/third_party/blink/renderer/core/paint/link_highlight_impl.h
index 13a9ad7..f0c631d 100644
--- a/third_party/blink/renderer/core/paint/link_highlight_impl.h
+++ b/third_party/blink/renderer/core/paint/link_highlight_impl.h
@@ -29,7 +29,6 @@
#include <memory>
#include "cc/layers/content_layer_client.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/platform/animation/compositor_animation.h"
#include "third_party/blink/renderer/platform/animation/compositor_animation_client.h"
@@ -61,7 +60,7 @@
~LinkHighlightImpl() override;
cc::PictureLayer* ContentLayer();
- WebLayer* ClipLayer();
+ cc::Layer* ClipLayer();
void StartHighlightAnimationIfNeeded();
void UpdateGeometry();
@@ -79,7 +78,7 @@
// LinkHighlight implementation.
void Invalidate() override;
- WebLayer* Layer() override;
+ cc::Layer* Layer() override;
void ClearCurrentGraphicsLayer() override;
// CompositorAnimationClient implementation.
diff --git a/third_party/blink/renderer/core/paint/stub_chrome_client_for_spv2.h b/third_party/blink/renderer/core/paint/stub_chrome_client_for_spv2.h
index 9e3d7bc..e47a32d 100644
--- a/third_party/blink/renderer/core/paint/stub_chrome_client_for_spv2.h
+++ b/third_party/blink/renderer/core/paint/stub_chrome_client_for_spv2.h
@@ -8,6 +8,10 @@
#include "third_party/blink/renderer/core/loader/empty_clients.h"
#include "third_party/blink/renderer/platform/testing/web_layer_tree_view_impl_for_testing.h"
+namespace cc {
+class Layer;
+}
+
namespace blink {
// A simple ChromeClient implementation which forwards painted artifacts to a
@@ -17,13 +21,13 @@
public:
StubChromeClientForSPv2() : layer_tree_view_() {}
- bool HasLayer(const WebLayer& layer) {
+ bool HasLayer(const cc::Layer& layer) {
return layer_tree_view_.HasLayer(layer);
}
- // TODO(danakj): This should be a scoped_refptr<cc::Layer>.
- void AttachRootLayer(WebLayer* layer, LocalFrame* local_root) override {
- layer_tree_view_.SetRootLayer(layer);
+ void AttachRootLayer(scoped_refptr<cc::Layer> layer,
+ LocalFrame* local_root) override {
+ layer_tree_view_.SetRootLayer(std::move(layer));
}
private:
diff --git a/third_party/blink/renderer/core/paint/video_painter.cc b/third_party/blink/renderer/core/paint/video_painter.cc
index 2dbb1c0..42c4b677 100644
--- a/third_party/blink/renderer/core/paint/video_painter.cc
+++ b/third_party/blink/renderer/core/paint/video_painter.cc
@@ -4,7 +4,7 @@
#include "third_party/blink/renderer/core/paint/video_painter.h"
-#include "third_party/blink/public/platform/web_layer.h"
+#include "cc/layers/layer.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/frame/local_frame_view.h"
#include "third_party/blink/renderer/core/html/media/html_video_element.h"
@@ -50,7 +50,7 @@
!displaying_poster && !force_software_video_paint &&
RuntimeEnabledFeatures::SlimmingPaintV2Enabled();
if (paint_with_foreign_layer) {
- if (WebLayer* layer = layout_video_.MediaElement()->PlatformLayer()) {
+ if (cc::Layer* layer = layout_video_.MediaElement()->PlatformLayer()) {
IntRect pixel_snapped_rect = PixelSnappedIntRect(content_rect);
layer->SetBounds(static_cast<gfx::Size>(pixel_snapped_rect.Size()));
layer->SetIsDrawable(true);
diff --git a/third_party/blink/renderer/core/paint/video_painter_test.cc b/third_party/blink/renderer/core/paint/video_painter_test.cc
index a31aef3..07a9611 100644
--- a/third_party/blink/renderer/core/paint/video_painter_test.cc
+++ b/third_party/blink/renderer/core/paint/video_painter_test.cc
@@ -6,7 +6,6 @@
#include "cc/layers/layer.h"
#include "third_party/blink/public/platform/platform.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/platform/web_size.h"
#include "third_party/blink/renderer/core/html/media/html_media_element.h"
#include "third_party/blink/renderer/core/paint/paint_controller_paint_test.h"
@@ -24,7 +23,7 @@
public:
StubWebMediaPlayer(WebMediaPlayerClient* client) : client_(client) {}
- const WebLayer* GetWebLayer() { return layer_.get(); }
+ const cc::Layer* GetWebLayer() { return layer_.get(); }
// WebMediaPlayer
void Load(LoadType, const WebMediaPlayerSource&, CORSMode) override {
@@ -72,7 +71,7 @@
GetDocument().SetURL(KURL(NullURL(), "https://example.com/"));
}
- bool HasLayerAttached(const WebLayer& layer) {
+ bool HasLayerAttached(const cc::Layer& layer) {
return chrome_client_->HasLayer(layer);
}
@@ -96,7 +95,7 @@
ToHTMLMediaElement(GetDocument().body()->firstChild());
StubWebMediaPlayer* player =
static_cast<StubWebMediaPlayer*>(element->GetWebMediaPlayer());
- const WebLayer* layer = player->GetWebLayer();
+ const cc::Layer* layer = player->GetWebLayer();
ASSERT_TRUE(layer);
EXPECT_TRUE(HasLayerAttached(*layer));
EXPECT_EQ(gfx::Size(300, 200), layer->bounds());
diff --git a/third_party/blink/renderer/core/scheduler/frame_throttling_test.cc b/third_party/blink/renderer/core/scheduler/frame_throttling_test.cc
index 50d0243..d4e32a1 100644
--- a/third_party/blink/renderer/core/scheduler/frame_throttling_test.cc
+++ b/third_party/blink/renderer/core/scheduler/frame_throttling_test.cc
@@ -3,7 +3,6 @@
// found in the LICENSE file.
#include "testing/gtest/include/gtest/gtest.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/web/web_frame_content_dumper.h"
#include "third_party/blink/public/web/web_hit_test_result.h"
#include "third_party/blink/public/web/web_settings.h"
diff --git a/third_party/blink/renderer/core/testing/internals.cc b/third_party/blink/renderer/core/testing/internals.cc
index 3f9033c..6977eaf 100644
--- a/third_party/blink/renderer/core/testing/internals.cc
+++ b/third_party/blink/renderer/core/testing/internals.cc
@@ -37,7 +37,6 @@
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/public/platform/web_connection_type.h"
#include "third_party/blink/public/platform/web_graphics_context_3d_provider.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/renderer/bindings/core/v8/exception_messages.h"
#include "third_party/blink/renderer/bindings/core/v8/exception_state.h"
#include "third_party/blink/renderer/bindings/core/v8/script_function.h"
diff --git a/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d.cc b/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d.cc
index bb70d78..ce821e1 100644
--- a/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d.cc
+++ b/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d.cc
@@ -913,7 +913,7 @@
return GetState().IsTransformInvertible();
}
-WebLayer* CanvasRenderingContext2D::PlatformLayer() const {
+cc::Layer* CanvasRenderingContext2D::PlatformLayer() const {
return IsPaintable() ? canvas()->GetCanvas2DLayerBridge()->Layer() : nullptr;
}
diff --git a/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d.h b/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d.h
index 61bd71a..e1386efb 100644
--- a/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d.h
+++ b/third_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d.h
@@ -27,7 +27,6 @@
#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_CANVAS_CANVAS2D_CANVAS_RENDERING_CONTEXT_2D_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_CANVAS_CANVAS2D_CANVAS_RENDERING_CONTEXT_2D_H_
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/platform/web_thread.h"
#include "third_party/blink/renderer/core/html/canvas/canvas_context_creation_attributes_core.h"
#include "third_party/blink/renderer/core/html/canvas/canvas_rendering_context.h"
@@ -43,6 +42,10 @@
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
+namespace cc {
+class Layer;
+}
+
namespace blink {
class CanvasImageSource;
@@ -247,7 +250,7 @@
bool IsTransformInvertible() const override;
- WebLayer* PlatformLayer() const override;
+ cc::Layer* PlatformLayer() const override;
bool IsCanvas2DBufferValid() const override;
Member<HitRegionManager> hit_region_manager_;
diff --git a/third_party/blink/renderer/modules/canvas/imagebitmap/image_bitmap_rendering_context_base.cc b/third_party/blink/renderer/modules/canvas/imagebitmap/image_bitmap_rendering_context_base.cc
index af62f2d..e1520ed5 100644
--- a/third_party/blink/renderer/modules/canvas/imagebitmap/image_bitmap_rendering_context_base.cc
+++ b/third_party/blink/renderer/modules/canvas/imagebitmap/image_bitmap_rendering_context_base.cc
@@ -49,7 +49,7 @@
image_layer_bridge_->SetUV(left_top, right_bottom);
}
-WebLayer* ImageBitmapRenderingContextBase::PlatformLayer() const {
+cc::Layer* ImageBitmapRenderingContextBase::PlatformLayer() const {
return image_layer_bridge_->PlatformLayer();
}
diff --git a/third_party/blink/renderer/modules/canvas/imagebitmap/image_bitmap_rendering_context_base.h b/third_party/blink/renderer/modules/canvas/imagebitmap/image_bitmap_rendering_context_base.h
index 9e8a823..a23d642 100644
--- a/third_party/blink/renderer/modules/canvas/imagebitmap/image_bitmap_rendering_context_base.h
+++ b/third_party/blink/renderer/modules/canvas/imagebitmap/image_bitmap_rendering_context_base.h
@@ -11,6 +11,10 @@
#include "third_party/blink/renderer/modules/modules_export.h"
#include "third_party/blink/renderer/platform/geometry/float_point.h"
+namespace cc {
+class Layer;
+}
+
namespace blink {
class ImageBitmap;
@@ -38,7 +42,7 @@
bool IsComposited() const final { return true; }
bool IsAccelerated() const final;
- WebLayer* PlatformLayer() const final;
+ cc::Layer* PlatformLayer() const final;
// TODO(junov): handle lost contexts when content is GPU-backed
void LoseContext(LostContextMode) override {}
diff --git a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc
index 07c561b..530bea4 100644
--- a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc
+++ b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.cc
@@ -6424,7 +6424,7 @@
return context_group_->NumberOfContextLosses();
}
-WebLayer* WebGLRenderingContextBase::PlatformLayer() const {
+cc::Layer* WebGLRenderingContextBase::PlatformLayer() const {
return isContextLost() ? nullptr : GetDrawingBuffer()->PlatformLayer();
}
diff --git a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h
index a1d6312..c2423b4 100644
--- a/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h
+++ b/third_party/blink/renderer/modules/webgl/webgl_rendering_context_base.h
@@ -28,11 +28,11 @@
#include <memory>
#include <set>
+
#include "base/optional.h"
#include "base/single_thread_task_runner.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/public/platform/web_graphics_context_3d_provider.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/renderer/bindings/core/v8/script_value.h"
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/html/canvas/canvas_context_creation_attributes_core.h"
@@ -57,6 +57,10 @@
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
#include "third_party/khronos/GLES2/gl2.h"
+namespace cc {
+class Layer;
+}
+
namespace gpu {
namespace gles2 {
class GLES2Interface;
@@ -649,7 +653,7 @@
bool IsAccelerated() const override { return true; }
void SetIsHidden(bool) override;
bool PaintRenderingResultsToCanvas(SourceDrawingBuffer) override;
- WebLayer* PlatformLayer() const override;
+ cc::Layer* PlatformLayer() const override;
void Stop() override;
void FinalizeFrame() override;
void PushFrame() override;
diff --git a/third_party/blink/renderer/platform/DEPS b/third_party/blink/renderer/platform/DEPS
index bd42887e..1dcc113 100644
--- a/third_party/blink/renderer/platform/DEPS
+++ b/third_party/blink/renderer/platform/DEPS
@@ -40,8 +40,6 @@
"+base/trace_event",
"+base/values.h",
"+base/lazy_instance.h",
- # TODO(danakj): For WebLayer, remove it.
- "+cc/layers/layer.h",
"+net/base/escape.h",
"+net/base/filename_util.h",
"+net/http/http_util.h",
diff --git a/third_party/blink/renderer/platform/graphics/canvas_2d_layer_bridge.cc b/third_party/blink/renderer/platform/graphics/canvas_2d_layer_bridge.cc
index a5ff0e8..46ab20a6 100644
--- a/third_party/blink/renderer/platform/graphics/canvas_2d_layer_bridge.cc
+++ b/third_party/blink/renderer/platform/graphics/canvas_2d_layer_bridge.cc
@@ -34,7 +34,6 @@
#include "components/viz/common/resources/transferable_resource.h"
#include "gpu/command_buffer/client/gles2_interface.h"
#include "third_party/blink/public/platform/platform.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/renderer/platform/graphics/canvas_heuristic_parameters.h"
#include "third_party/blink/renderer/platform/graphics/canvas_metrics.h"
#include "third_party/blink/renderer/platform/graphics/canvas_resource.h"
@@ -653,7 +652,7 @@
return false;
}
-WebLayer* Canvas2DLayerBridge::Layer() {
+cc::Layer* Canvas2DLayerBridge::Layer() {
DCHECK(!destruction_in_progress_);
// Trigger lazy layer creation
GetOrCreateResourceProvider(kPreferAcceleration);
diff --git a/third_party/blink/renderer/platform/graphics/canvas_2d_layer_bridge.h b/third_party/blink/renderer/platform/graphics/canvas_2d_layer_bridge.h
index a9b7ad6..1406108a 100644
--- a/third_party/blink/renderer/platform/graphics/canvas_2d_layer_bridge.h
+++ b/third_party/blink/renderer/platform/graphics/canvas_2d_layer_bridge.h
@@ -32,7 +32,6 @@
#include "base/memory/weak_ptr.h"
#include "build/build_config.h"
#include "cc/layers/texture_layer_client.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/renderer/platform/geometry/float_rect.h"
#include "third_party/blink/renderer/platform/geometry/int_size.h"
#include "third_party/blink/renderer/platform/graphics/canvas_color_params.h"
@@ -52,6 +51,7 @@
struct SkImageInfo;
namespace cc {
+class Layer;
class TextureLayer;
}
@@ -101,7 +101,7 @@
void SetIsHidden(bool);
void DidDraw(const FloatRect&);
void DoPaintInvalidation(const FloatRect& dirty_rect);
- WebLayer* Layer();
+ cc::Layer* Layer();
bool Restore();
void DisableDeferral(DisableDeferralReason);
void SetFilterQuality(SkFilterQuality);
diff --git a/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.cc b/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.cc
index 02a9347..6756dda 100644
--- a/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.cc
+++ b/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.cc
@@ -12,7 +12,6 @@
#include "cc/paint/display_item_list.h"
#include "cc/trees/layer_tree_host.h"
#include "third_party/blink/public/platform/platform.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/renderer/platform/graphics/compositing/content_layer_client_impl.h"
#include "third_party/blink/renderer/platform/graphics/graphics_context.h"
#include "third_party/blink/renderer/platform/graphics/paint/clip_paint_property_node.h"
diff --git a/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.h b/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.h
index 2b7417d..8613d52 100644
--- a/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.h
+++ b/third_party/blink/renderer/platform/graphics/compositing/paint_artifact_compositor.h
@@ -10,7 +10,6 @@
#include "base/callback.h"
#include "base/memory/ptr_util.h"
#include "base/memory/scoped_refptr.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/renderer/platform/graphics/compositing/property_tree_manager.h"
#include "third_party/blink/renderer/platform/graphics/graphics_layer_client.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_controller.h"
@@ -68,9 +67,10 @@
// The root layer of the tree managed by this object.
cc::Layer* RootLayer() const { return root_layer_.get(); }
- // Wraps rootLayer(), so that it can be attached as a child of another
- // WebLayer.
- WebLayer* GetWebLayer() const { return root_layer_.get(); }
+ // Wraps RootLayer(), so that it can be attached as a child of another
+ // cc::Layer.
+ // TODO(danakj): Remove this, use RootLayer() directly.
+ cc::Layer* GetWebLayer() const { return root_layer_.get(); }
// Returns extra information recorded during unit tests.
// While not part of the normal output of this class, this provides a simple
diff --git a/third_party/blink/renderer/platform/graphics/gpu/drawing_buffer.cc b/third_party/blink/renderer/platform/graphics/gpu/drawing_buffer.cc
index 47d2212..b2473f70 100644
--- a/third_party/blink/renderer/platform/graphics/gpu/drawing_buffer.cc
+++ b/third_party/blink/renderer/platform/graphics/gpu/drawing_buffer.cc
@@ -47,7 +47,6 @@
#include "gpu/config/gpu_driver_bug_workaround_type.h"
#include "gpu/config/gpu_feature_info.h"
#include "third_party/blink/public/platform/platform.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/renderer/platform/graphics/accelerated_static_bitmap_image.h"
#include "third_party/blink/renderer/platform/graphics/gpu/extensions_3d_util.h"
#include "third_party/blink/renderer/platform/graphics/graphics_layer.h"
@@ -876,7 +875,7 @@
return true;
}
-WebLayer* DrawingBuffer::PlatformLayer() {
+cc::Layer* DrawingBuffer::PlatformLayer() {
if (!layer_) {
layer_ = cc::TextureLayer::CreateForMailbox(this);
diff --git a/third_party/blink/renderer/platform/graphics/gpu/drawing_buffer.h b/third_party/blink/renderer/platform/graphics/gpu/drawing_buffer.h
index dcc7a4b..5f665f7 100644
--- a/third_party/blink/renderer/platform/graphics/gpu/drawing_buffer.h
+++ b/third_party/blink/renderer/platform/graphics/gpu/drawing_buffer.h
@@ -38,7 +38,6 @@
#include "cc/resources/shared_bitmap_id_registrar.h"
#include "gpu/command_buffer/common/mailbox.h"
#include "gpu/command_buffer/common/sync_token.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/renderer/platform/geometry/int_size.h"
#include "third_party/blink/renderer/platform/graphics/gpu/webgl_image_conversion.h"
#include "third_party/blink/renderer/platform/graphics/graphics_types_3d.h"
@@ -51,6 +50,10 @@
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/color_space.h"
+namespace cc {
+class Layer;
+}
+
namespace gfx {
class GpuMemoryBuffer;
}
@@ -69,7 +72,7 @@
class WebGraphicsContext3DProviderWrapper;
// Manages a rendering target (framebuffer + attachment) for a canvas. Can
-// publish its rendering results to a WebLayer for compositing.
+// publish its rendering results to a cc::Layer for compositing.
class PLATFORM_EXPORT DrawingBuffer : public cc::TextureLayerClient,
public RefCounted<DrawingBuffer> {
WTF_MAKE_NONCOPYABLE(DrawingBuffer);
@@ -190,7 +193,7 @@
// default framebuffer.
bool DefaultBufferRequiresAlphaChannelToBePreserved();
- WebLayer* PlatformLayer();
+ cc::Layer* PlatformLayer();
gpu::gles2::GLES2Interface* ContextGL();
WebGraphicsContext3DProvider* ContextProvider();
diff --git a/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.cc b/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.cc
index 2a99ec8..2edf1ce 100644
--- a/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.cc
+++ b/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.cc
@@ -12,7 +12,6 @@
#include "gpu/command_buffer/client/gles2_interface.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/public/platform/web_graphics_context_3d_provider.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/renderer/platform/graphics/accelerated_static_bitmap_image.h"
#include "third_party/blink/renderer/platform/graphics/canvas_color_params.h"
#include "third_party/blink/renderer/platform/graphics/color_behavior.h"
@@ -230,7 +229,7 @@
recycled_bitmaps_.push_back(std::move(registered));
}
-WebLayer* ImageLayerBridge::PlatformLayer() const {
+cc::Layer* ImageLayerBridge::PlatformLayer() const {
return layer_.get();
}
diff --git a/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.h b/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.h
index 72b4fb7..25036a5f 100644
--- a/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.h
+++ b/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.h
@@ -10,7 +10,6 @@
#include "cc/layers/texture_layer_client.h"
#include "cc/resources/shared_bitmap_id_registrar.h"
#include "components/viz/common/resources/resource_format.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/renderer/platform/geometry/float_point.h"
#include "third_party/blink/renderer/platform/graphics/graphics_types.h"
#include "third_party/blink/renderer/platform/graphics/static_bitmap_image.h"
@@ -19,6 +18,7 @@
namespace cc {
class CrossThreadSharedBitmap;
+class Layer;
class TextureLayer;
}
@@ -49,7 +49,7 @@
scoped_refptr<StaticBitmapImage> GetImage() { return image_; }
- WebLayer* PlatformLayer() const;
+ cc::Layer* PlatformLayer() const;
void SetFilterQuality(SkFilterQuality filter_quality) {
filter_quality_ = filter_quality;
diff --git a/third_party/blink/renderer/platform/graphics/graphics_layer.cc b/third_party/blink/renderer/platform/graphics/graphics_layer.cc
index c96674f2..af3a5a5d 100644
--- a/third_party/blink/renderer/platform/graphics/graphics_layer.cc
+++ b/third_party/blink/renderer/platform/graphics/graphics_layer.cc
@@ -39,7 +39,6 @@
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/public/platform/web_float_point.h"
#include "third_party/blink/public/platform/web_float_rect.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/platform/web_point.h"
#include "third_party/blink/public/platform/web_size.h"
#include "third_party/blink/renderer/platform/bindings/runtime_call_stats.h"
@@ -419,7 +418,7 @@
}
void GraphicsLayer::UpdateChildList() {
- WebLayer* child_host = layer_.get();
+ cc::Layer* child_host = layer_.get();
child_host->RemoveAllChildren();
ClearContentsLayerIfUnregistered();
@@ -447,7 +446,7 @@
// contentsVisible.
layer_->SetIsDrawable(draws_content_ && contents_visible_);
- if (WebLayer* contents_layer = ContentsLayerIfRegistered())
+ if (cc::Layer* contents_layer = ContentsLayerIfRegistered())
contents_layer->SetIsDrawable(contents_visible_);
if (draws_content_) {
@@ -458,7 +457,7 @@
}
void GraphicsLayer::UpdateContentsRect() {
- WebLayer* contents_layer = ContentsLayerIfRegistered();
+ cc::Layer* contents_layer = ContentsLayerIfRegistered();
if (!contents_layer)
return;
@@ -501,21 +500,21 @@
static HashSet<int>* g_registered_layer_set;
-void GraphicsLayer::RegisterContentsLayer(WebLayer* layer) {
+void GraphicsLayer::RegisterContentsLayer(cc::Layer* layer) {
if (!g_registered_layer_set)
g_registered_layer_set = new HashSet<int>;
CHECK(!g_registered_layer_set->Contains(layer->id()));
g_registered_layer_set->insert(layer->id());
}
-void GraphicsLayer::UnregisterContentsLayer(WebLayer* layer) {
+void GraphicsLayer::UnregisterContentsLayer(cc::Layer* layer) {
DCHECK(g_registered_layer_set);
CHECK(g_registered_layer_set->Contains(layer->id()));
g_registered_layer_set->erase(layer->id());
layer->SetLayerClient(nullptr);
}
-void GraphicsLayer::SetContentsTo(WebLayer* layer,
+void GraphicsLayer::SetContentsTo(cc::Layer* layer,
bool prevent_contents_opaque_changes) {
bool children_changed = false;
if (layer) {
@@ -540,7 +539,7 @@
UpdateChildList();
}
-void GraphicsLayer::SetupContentsLayer(WebLayer* contents_layer) {
+void GraphicsLayer::SetupContentsLayer(cc::Layer* contents_layer) {
DCHECK(contents_layer);
SetContentsLayer(contents_layer);
@@ -555,11 +554,11 @@
// Insert the content layer first. Video elements require this, because they
// have shadow content that must display in front of the video.
layer_->InsertChild(contents_layer_, 0);
- WebLayer* border_web_layer =
+ cc::Layer* border_cc_layer =
contents_clipping_mask_layer_
? contents_clipping_mask_layer_->PlatformLayer()
: nullptr;
- contents_layer_->SetMaskLayer(border_web_layer);
+ contents_layer_->SetMaskLayer(border_cc_layer);
contents_layer_->Set3dSortingContextId(rendering_context3d_);
}
@@ -572,7 +571,7 @@
SetContentsLayer(nullptr);
}
-void GraphicsLayer::SetContentsLayer(WebLayer* contents_layer) {
+void GraphicsLayer::SetContentsLayer(cc::Layer* contents_layer) {
// If we have a previous contents layer which is still registered, then unset
// this client pointer. If unregistered, it has already nulled out the client
// pointer and may have been deleted.
@@ -591,7 +590,7 @@
return debug_info_;
}
-WebLayer* GraphicsLayer::ContentsLayerIfRegistered() {
+cc::Layer* GraphicsLayer::ContentsLayerIfRegistered() {
ClearContentsLayerIfUnregistered();
return contents_layer_;
}
@@ -642,7 +641,7 @@
if (RuntimeEnabledFeatures::PaintUnderInvalidationCheckingEnabled())
EnsureRasterInvalidator().EnsureTracking();
- // For SPv175, this only tracks invalidations that the WebLayer is fully
+ // For SPv175, this only tracks invalidations that the cc::Layer is fully
// invalidated directly, e.g. from SetContentsNeedsDisplay(), etc.
if (auto* tracking = GetRasterInvalidationTracking())
tracking->AddInvalidation(&client, client.DebugName(), rect, reason);
@@ -1089,8 +1088,8 @@
void GraphicsLayer::SetContentsVisible(bool contents_visible) {
// NOTE: This early-exit is only correct because we also properly call
- // WebLayer::setDrawsContent() whenever |m_contentsLayer| is set to a new
- // layer in setupContentsLayer().
+ // cc::Layer::SetIsDrawable() whenever |contents_layer_| is set to a new
+ // layer in SetupContentsLayer().
if (contents_visible == contents_visible_)
return;
@@ -1098,12 +1097,12 @@
UpdateLayerIsDrawable();
}
-void GraphicsLayer::SetClipParent(WebLayer* parent) {
+void GraphicsLayer::SetClipParent(cc::Layer* parent) {
has_clip_parent_ = !!parent;
layer_->SetClipParent(parent);
}
-void GraphicsLayer::SetScrollParent(WebLayer* parent) {
+void GraphicsLayer::SetScrollParent(cc::Layer* parent) {
has_scroll_parent_ = !!parent;
layer_->SetScrollParent(parent);
}
@@ -1138,14 +1137,14 @@
return;
contents_clipping_mask_layer_ = contents_clipping_mask_layer;
- WebLayer* contents_layer = ContentsLayerIfRegistered();
+ cc::Layer* contents_layer = ContentsLayerIfRegistered();
if (!contents_layer)
return;
- WebLayer* contents_clipping_mask_web_layer =
+ cc::Layer* contents_clipping_mask_cc_layer =
contents_clipping_mask_layer_
? contents_clipping_mask_layer_->PlatformLayer()
: nullptr;
- contents_layer->SetMaskLayer(contents_clipping_mask_web_layer);
+ contents_layer->SetMaskLayer(contents_clipping_mask_cc_layer);
UpdateContentsRect();
}
@@ -1182,7 +1181,7 @@
}
void GraphicsLayer::SetContentsNeedsDisplay() {
- if (WebLayer* contents_layer = ContentsLayerIfRegistered()) {
+ if (cc::Layer* contents_layer = ContentsLayerIfRegistered()) {
contents_layer->SetNeedsDisplay();
TrackRasterInvalidation(*this, contents_rect_,
PaintInvalidationReason::kFull);
@@ -1285,7 +1284,7 @@
/*prevent_contents_opaque_changes=*/true);
}
-WebLayer* GraphicsLayer::PlatformLayer() const {
+cc::Layer* GraphicsLayer::PlatformLayer() const {
return layer_.get();
}
@@ -1368,12 +1367,12 @@
}
void GraphicsLayer::SetElementId(const CompositorElementId& id) {
- if (WebLayer* layer = PlatformLayer())
+ if (cc::Layer* layer = PlatformLayer())
layer->SetElementId(id);
}
CompositorElementId GraphicsLayer::GetElementId() const {
- if (WebLayer* layer = PlatformLayer())
+ if (cc::Layer* layer = PlatformLayer())
return layer->element_id();
return CompositorElementId();
}
diff --git a/third_party/blink/renderer/platform/graphics/graphics_layer.h b/third_party/blink/renderer/platform/graphics/graphics_layer.h
index 930fe5ebf..885b17f 100644
--- a/third_party/blink/renderer/platform/graphics/graphics_layer.h
+++ b/third_party/blink/renderer/platform/graphics/graphics_layer.h
@@ -33,7 +33,6 @@
#include "cc/input/overscroll_behavior.h"
#include "cc/layers/content_layer_client.h"
#include "cc/layers/layer_client.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/renderer/platform/geometry/float_point.h"
#include "third_party/blink/renderer/platform/geometry/float_point_3d.h"
#include "third_party/blink/renderer/platform/geometry/float_size.h"
@@ -56,6 +55,7 @@
#include "third_party/skia/include/core/SkRefCnt.h"
namespace cc {
+class Layer;
class PictureImageLayer;
class PictureLayer;
}
@@ -166,8 +166,8 @@
bool ContentsAreVisible() const { return contents_visible_; }
void SetContentsVisible(bool);
- void SetScrollParent(WebLayer*);
- void SetClipParent(WebLayer*);
+ void SetScrollParent(cc::Layer*);
+ void SetClipParent(cc::Layer*);
// For special cases, e.g. drawing missing tiles on Android.
// The compositor should never paint this color in normal cases because the
@@ -224,15 +224,15 @@
// SetContentsOpaque() will not be passed on to the |layer|. Use when
// the client wants to have control of the opaqueness of the contents
// |layer| independently of what outcome painting produces.
- void SetContentsToPlatformLayer(WebLayer* layer,
+ void SetContentsToPlatformLayer(cc::Layer* layer,
bool prevent_contents_opaque_changes) {
SetContentsTo(layer, prevent_contents_opaque_changes);
}
bool HasContentsLayer() const { return contents_layer_; }
- WebLayer* ContentsLayer() const { return contents_layer_; }
+ cc::Layer* ContentsLayer() const { return contents_layer_; }
// For hosting this GraphicsLayer in a native layer hierarchy.
- WebLayer* PlatformLayer() const;
+ cc::Layer* PlatformLayer() const;
int PaintCount() const { return paint_count_; }
@@ -264,8 +264,8 @@
cc::PictureLayer* ContentLayer() const { return layer_.get(); }
- static void RegisterContentsLayer(WebLayer*);
- static void UnregisterContentsLayer(WebLayer*);
+ static void RegisterContentsLayer(cc::Layer*);
+ static void UnregisterContentsLayer(cc::Layer*);
IntRect InterestRect();
void PaintRecursively();
@@ -351,11 +351,11 @@
void UpdateLayerIsDrawable();
void UpdateContentsRect();
- void SetContentsTo(WebLayer*, bool prevent_contents_opaque_changes);
- void SetupContentsLayer(WebLayer*);
+ void SetContentsTo(cc::Layer*, bool prevent_contents_opaque_changes);
+ void SetupContentsLayer(cc::Layer*);
void ClearContentsLayerIfUnregistered();
- WebLayer* ContentsLayerIfRegistered();
- void SetContentsLayer(WebLayer*);
+ cc::Layer* ContentsLayerIfRegistered();
+ void SetContentsLayer(cc::Layer*);
typedef HashMap<int, int> RenderingContextMap;
std::unique_ptr<JSONObject> LayerTreeAsJSONInternal(
@@ -423,7 +423,7 @@
scoped_refptr<cc::PictureLayer> layer_;
scoped_refptr<cc::PictureImageLayer> image_layer_;
IntSize image_size_;
- WebLayer* contents_layer_;
+ cc::Layer* contents_layer_;
// We don't have ownership of contents_layer_, but we do want to know if a
// given layer is the same as our current layer in SetContentsTo(). Since
// |contents_layer_| may be deleted at this point, we stash an ID away when we
diff --git a/third_party/blink/renderer/platform/graphics/graphics_layer_test.cc b/third_party/blink/renderer/platform/graphics/graphics_layer_test.cc
index 30972c46..bcb9071 100644
--- a/third_party/blink/renderer/platform/graphics/graphics_layer_test.cc
+++ b/third_party/blink/renderer/platform/graphics/graphics_layer_test.cc
@@ -28,9 +28,9 @@
#include <memory>
#include <utility>
+#include "cc/layers/layer.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/platform/platform.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/platform/web_layer_tree_view.h"
#include "third_party/blink/public/platform/web_thread.h"
#include "third_party/blink/renderer/platform/animation/compositor_animation.h"
@@ -71,7 +71,7 @@
page_scale_layer_->AddChild(graphics_layer_.get());
graphics_layer_->PlatformLayer()->SetScrollable(
clip_layer_->PlatformLayer()->bounds());
- platform_layer_ = graphics_layer_->PlatformLayer();
+ cc_layer_ = graphics_layer_->PlatformLayer();
layer_tree_view_ = std::make_unique<WebLayerTreeViewImplForTesting>();
DCHECK(layer_tree_view_);
layer_tree_view_->SetRootLayer(clip_layer_->PlatformLayer());
@@ -117,7 +117,7 @@
return layer.paint_controller_.get();
}
- WebLayer* platform_layer_;
+ cc::Layer* cc_layer_;
std::unique_ptr<FakeGraphicsLayer> graphics_layer_;
std::unique_ptr<FakeGraphicsLayer> page_scale_layer_;
std::unique_ptr<FakeGraphicsLayer> scroll_elasticity_layer_;
@@ -148,7 +148,7 @@
};
TEST_P(GraphicsLayerTest, updateLayerShouldFlattenTransformWithAnimations) {
- ASSERT_FALSE(platform_layer_->HasTickingAnimationForTesting());
+ ASSERT_FALSE(cc_layer_->HasTickingAnimationForTesting());
std::unique_ptr<CompositorFloatAnimationCurve> curve =
CompositorFloatAnimationCurve::Create();
@@ -170,32 +170,31 @@
host.AddTimeline(*compositor_timeline);
compositor_timeline->AnimationAttached(animation);
- platform_layer_->SetElementId(CompositorElementId(platform_layer_->id()));
+ cc_layer_->SetElementId(CompositorElementId(cc_layer_->id()));
- animation.GetCompositorAnimation()->AttachElement(
- platform_layer_->element_id());
+ animation.GetCompositorAnimation()->AttachElement(cc_layer_->element_id());
ASSERT_TRUE(animation.GetCompositorAnimation()->IsElementAttached());
animation.GetCompositorAnimation()->AddKeyframeModel(
std::move(float_keyframe_model));
- ASSERT_TRUE(platform_layer_->HasTickingAnimationForTesting());
+ ASSERT_TRUE(cc_layer_->HasTickingAnimationForTesting());
graphics_layer_->SetShouldFlattenTransform(false);
- platform_layer_ = graphics_layer_->PlatformLayer();
- ASSERT_TRUE(platform_layer_);
+ cc_layer_ = graphics_layer_->PlatformLayer();
+ ASSERT_TRUE(cc_layer_);
- ASSERT_TRUE(platform_layer_->HasTickingAnimationForTesting());
+ ASSERT_TRUE(cc_layer_->HasTickingAnimationForTesting());
animation.GetCompositorAnimation()->RemoveKeyframeModel(keyframe_model_id);
- ASSERT_FALSE(platform_layer_->HasTickingAnimationForTesting());
+ ASSERT_FALSE(cc_layer_->HasTickingAnimationForTesting());
graphics_layer_->SetShouldFlattenTransform(true);
- platform_layer_ = graphics_layer_->PlatformLayer();
- ASSERT_TRUE(platform_layer_);
+ cc_layer_ = graphics_layer_->PlatformLayer();
+ ASSERT_TRUE(cc_layer_);
- ASSERT_FALSE(platform_layer_->HasTickingAnimationForTesting());
+ ASSERT_FALSE(cc_layer_->HasTickingAnimationForTesting());
animation.GetCompositorAnimation()->DetachElement();
ASSERT_FALSE(animation.GetCompositorAnimation()->IsElementAttached());
diff --git a/third_party/blink/renderer/platform/graphics/image_layer_chromium_test.cc b/third_party/blink/renderer/platform/graphics/image_layer_chromium_test.cc
index 8ffcaa4..01342d3a 100644
--- a/third_party/blink/renderer/platform/graphics/image_layer_chromium_test.cc
+++ b/third_party/blink/renderer/platform/graphics/image_layer_chromium_test.cc
@@ -28,7 +28,6 @@
#include <memory>
#include "testing/gtest/include/gtest/gtest.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/renderer/platform/graphics/graphics_layer.h"
#include "third_party/blink/renderer/platform/testing/fake_graphics_layer.h"
#include "third_party/blink/renderer/platform/testing/fake_graphics_layer_client.h"
diff --git a/third_party/blink/renderer/platform/graphics/link_highlight.h b/third_party/blink/renderer/platform/graphics/link_highlight.h
index 14bf161..b352afe5 100644
--- a/third_party/blink/renderer/platform/graphics/link_highlight.h
+++ b/third_party/blink/renderer/platform/graphics/link_highlight.h
@@ -5,16 +5,19 @@
#ifndef THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_LINK_HIGHLIGHT_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_LINK_HIGHLIGHT_H_
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/renderer/platform/platform_export.h"
+namespace cc {
+class Layer;
+}
+
namespace blink {
class PLATFORM_EXPORT LinkHighlight {
public:
virtual void Invalidate() = 0;
virtual void ClearCurrentGraphicsLayer() = 0;
- virtual WebLayer* Layer() = 0;
+ virtual cc::Layer* Layer() = 0;
protected:
virtual ~LinkHighlight() = default;
diff --git a/third_party/blink/renderer/platform/graphics/paint/foreign_layer_display_item.cc b/third_party/blink/renderer/platform/graphics/paint/foreign_layer_display_item.cc
index 61dac1c..360913c 100644
--- a/third_party/blink/renderer/platform/graphics/paint/foreign_layer_display_item.cc
+++ b/third_party/blink/renderer/platform/graphics/paint/foreign_layer_display_item.cc
@@ -5,8 +5,8 @@
#include "third_party/blink/renderer/platform/graphics/paint/foreign_layer_display_item.h"
#include <utility>
+
#include "cc/layers/layer.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/renderer/platform/graphics/graphics_context.h"
#include "third_party/blink/renderer/platform/graphics/paint/paint_controller.h"
#include "third_party/blink/renderer/platform/wtf/assertions.h"
@@ -60,7 +60,7 @@
void RecordForeignLayer(GraphicsContext& context,
const DisplayItemClient& client,
DisplayItem::Type type,
- WebLayer* web_layer,
+ scoped_refptr<cc::Layer> layer,
const FloatPoint& location,
const IntSize& bounds) {
PaintController& paint_controller = context.GetPaintController();
@@ -68,7 +68,7 @@
return;
paint_controller.CreateAndAppend<ForeignLayerDisplayItem>(
- client, type, web_layer, location, bounds);
+ client, type, std::move(layer), location, bounds);
}
} // namespace blink
diff --git a/third_party/blink/renderer/platform/graphics/paint/foreign_layer_display_item.h b/third_party/blink/renderer/platform/graphics/paint/foreign_layer_display_item.h
index a78c24b..b65bab8b 100644
--- a/third_party/blink/renderer/platform/graphics/paint/foreign_layer_display_item.h
+++ b/third_party/blink/renderer/platform/graphics/paint/foreign_layer_display_item.h
@@ -6,7 +6,6 @@
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_PAINT_FOREIGN_LAYER_DISPLAY_ITEM_H_
#include "base/memory/ref_counted.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/renderer/platform/graphics/paint/display_item.h"
#include "third_party/blink/renderer/platform/platform_export.h"
@@ -58,7 +57,7 @@
PLATFORM_EXPORT void RecordForeignLayer(GraphicsContext&,
const DisplayItemClient&,
DisplayItem::Type,
- WebLayer*,
+ scoped_refptr<cc::Layer>,
const FloatPoint& location,
const IntSize& bounds);
diff --git a/third_party/blink/renderer/platform/graphics/surface_layer_bridge.cc b/third_party/blink/renderer/platform/graphics/surface_layer_bridge.cc
index aff4ecf..f07c3a9 100644
--- a/third_party/blink/renderer/platform/graphics/surface_layer_bridge.cc
+++ b/third_party/blink/renderer/platform/graphics/surface_layer_bridge.cc
@@ -14,7 +14,6 @@
#include "third_party/blink/public/platform/interface_provider.h"
#include "third_party/blink/public/platform/modules/frame_sinks/embedded_frame_sink.mojom-blink.h"
#include "third_party/blink/public/platform/platform.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/platform/web_layer_tree_view.h"
#include "third_party/blink/renderer/platform/mojo/mojo_helper.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"
diff --git a/third_party/blink/renderer/platform/graphics/surface_layer_bridge.h b/third_party/blink/renderer/platform/graphics/surface_layer_bridge.h
index 77412f37..4decf44 100644
--- a/third_party/blink/renderer/platform/graphics/surface_layer_bridge.h
+++ b/third_party/blink/renderer/platform/graphics/surface_layer_bridge.h
@@ -6,11 +6,11 @@
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_GRAPHICS_SURFACE_LAYER_BRIDGE_H_
#include <memory>
+
#include "base/memory/scoped_refptr.h"
#include "components/viz/common/surfaces/surface_id.h"
#include "mojo/public/cpp/bindings/binding.h"
#include "third_party/blink/public/platform/modules/frame_sinks/embedded_frame_sink.mojom-blink.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/platform/web_surface_layer_bridge.h"
#include "third_party/blink/renderer/platform/platform_export.h"
@@ -41,7 +41,7 @@
void OnFirstSurfaceActivation(const viz::SurfaceInfo&) override;
// Implementation of WebSurfaceLayerBridge.
- WebLayer* GetWebLayer() const override { return cc_layer_.get(); }
+ cc::Layer* GetWebLayer() const override { return cc_layer_.get(); }
void ClearSurfaceId() override;
const viz::FrameSinkId& GetFrameSinkId() const override {
diff --git a/third_party/blink/renderer/platform/scroll/scroll_animator.cc b/third_party/blink/renderer/platform/scroll/scroll_animator.cc
index 5dd9997..09849e6 100644
--- a/third_party/blink/renderer/platform/scroll/scroll_animator.cc
+++ b/third_party/blink/renderer/platform/scroll/scroll_animator.cc
@@ -34,8 +34,8 @@
#include "base/memory/scoped_refptr.h"
#include "cc/animation/scroll_offset_animation_curve.h"
+#include "cc/layers/layer.h"
#include "third_party/blink/public/platform/platform.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/renderer/platform/animation/compositor_keyframe_model.h"
#include "third_party/blink/renderer/platform/graphics/graphics_layer.h"
#include "third_party/blink/renderer/platform/instrumentation/tracing/trace_event.h"
@@ -47,7 +47,7 @@
namespace {
-WebLayer* ToWebLayer(GraphicsLayer* layer) {
+cc::Layer* ToCcLayer(GraphicsLayer* layer) {
return layer ? layer->PlatformLayer() : nullptr;
}
@@ -371,16 +371,16 @@
// is a special case because its subframes cannot be scrolled
// when the reason is set. When the subframes are ready to scroll
// the reason has benn reset.
- if (WebLayer* scroll_layer =
- ToWebLayer(GetScrollableArea()->LayerForScrolling())) {
+ if (cc::Layer* scroll_layer =
+ ToCcLayer(GetScrollableArea()->LayerForScrolling())) {
scroll_layer->AddMainThreadScrollingReasons(
MainThreadScrollingReason::kHandlingScrollFromMainThread);
}
}
void ScrollAnimator::RemoveMainThreadScrollingReason() {
- if (WebLayer* scroll_layer =
- ToWebLayer(GetScrollableArea()->LayerForScrolling())) {
+ if (cc::Layer* scroll_layer =
+ ToCcLayer(GetScrollableArea()->LayerForScrolling())) {
scroll_layer->ClearMainThreadScrollingReasons(
MainThreadScrollingReason::kHandlingScrollFromMainThread);
}
diff --git a/third_party/blink/renderer/platform/scroll/scroll_animator_compositor_coordinator.cc b/third_party/blink/renderer/platform/scroll/scroll_animator_compositor_coordinator.cc
index a4ece8de..c6766406 100644
--- a/third_party/blink/renderer/platform/scroll/scroll_animator_compositor_coordinator.cc
+++ b/third_party/blink/renderer/platform/scroll/scroll_animator_compositor_coordinator.cc
@@ -8,7 +8,6 @@
#include "cc/animation/scroll_offset_animation_curve.h"
#include "third_party/blink/public/platform/platform.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/renderer/platform/animation/compositor_animation.h"
#include "third_party/blink/renderer/platform/animation/compositor_animation_host.h"
#include "third_party/blink/renderer/platform/animation/compositor_animation_timeline.h"
diff --git a/third_party/blink/renderer/platform/scroll/scrollable_area.cc b/third_party/blink/renderer/platform/scroll/scrollable_area.cc
index fee12a6..d00dab3e 100644
--- a/third_party/blink/renderer/platform/scroll/scrollable_area.cc
+++ b/third_party/blink/renderer/platform/scroll/scrollable_area.cc
@@ -33,7 +33,6 @@
#include "build/build_config.h"
#include "third_party/blink/public/platform/platform.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/renderer/platform/graphics/graphics_layer.h"
#include "third_party/blink/renderer/platform/instrumentation/tracing/trace_event.h"
#include "third_party/blink/renderer/platform/platform_chrome_client.h"
diff --git a/third_party/blink/renderer/platform/scroll/scrollable_area.h b/third_party/blink/renderer/platform/scroll/scrollable_area.h
index 0299f3a..9ca26b9 100644
--- a/third_party/blink/renderer/platform/scroll/scrollable_area.h
+++ b/third_party/blink/renderer/platform/scroll/scrollable_area.h
@@ -493,7 +493,7 @@
unsigned mouse_over_scrollbar_ : 1;
// Indicates that the next compositing update needs to call
- // WebLayer::showScrollbars on our scroll layer. Ignored if not composited.
+ // cc::Layer::ShowScrollbars() on our scroll layer. Ignored if not composited.
unsigned needs_show_scrollbar_layers_ : 1;
unsigned uses_composited_scrolling_ : 1;
diff --git a/third_party/blink/renderer/platform/testing/testing_platform_support.cc b/third_party/blink/renderer/platform/testing/testing_platform_support.cc
index 28b0815..16ec5e1 100644
--- a/third_party/blink/renderer/platform/testing/testing_platform_support.cc
+++ b/third_party/blink/renderer/platform/testing/testing_platform_support.cc
@@ -40,8 +40,6 @@
#include "base/test/test_discardable_memory_allocator.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "third_party/blink/public/platform/interface_provider.h"
-#include "third_party/blink/public/platform/web_external_texture_layer.h"
-#include "third_party/blink/public/platform/web_image_layer.h"
#include "third_party/blink/public/platform/web_runtime_features.h"
#include "third_party/blink/renderer/platform/font_family_names.h"
#include "third_party/blink/renderer/platform/heap/heap.h"
diff --git a/third_party/blink/renderer/platform/testing/web_layer_tree_view_impl_for_testing.cc b/third_party/blink/renderer/platform/testing/web_layer_tree_view_impl_for_testing.cc
index 1838957..4343a44 100644
--- a/third_party/blink/renderer/platform/testing/web_layer_tree_view_impl_for_testing.cc
+++ b/third_party/blink/renderer/platform/testing/web_layer_tree_view_impl_for_testing.cc
@@ -11,7 +11,6 @@
#include "cc/trees/layer_tree_host.h"
#include "cc/trees/layer_tree_settings.h"
#include "third_party/blink/public/platform/platform.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/platform/web_layer_tree_view.h"
#include "third_party/blink/public/platform/web_size.h"
@@ -47,7 +46,7 @@
return settings;
}
-bool WebLayerTreeViewImplForTesting::HasLayer(const WebLayer& layer) {
+bool WebLayerTreeViewImplForTesting::HasLayer(const cc::Layer& layer) {
return layer.GetLayerTreeHostForTesting() == layer_tree_host_.get();
}
@@ -61,7 +60,8 @@
layer_tree_host_->local_surface_id_from_parent());
}
-void WebLayerTreeViewImplForTesting::SetRootLayer(blink::WebLayer* root) {
+void WebLayerTreeViewImplForTesting::SetRootLayer(
+ scoped_refptr<cc::Layer> root) {
layer_tree_host_->SetRootLayer(root);
}
diff --git a/third_party/blink/renderer/platform/testing/web_layer_tree_view_impl_for_testing.h b/third_party/blink/renderer/platform/testing/web_layer_tree_view_impl_for_testing.h
index 4f4ae8e..bfe8d1a 100644
--- a/third_party/blink/renderer/platform/testing/web_layer_tree_view_impl_for_testing.h
+++ b/third_party/blink/renderer/platform/testing/web_layer_tree_view_impl_for_testing.h
@@ -9,12 +9,12 @@
#include "cc/test/test_task_graph_runner.h"
#include "cc/trees/layer_tree_host_client.h"
#include "cc/trees/layer_tree_host_single_thread_client.h"
-#include "third_party/blink/public/platform/web_layer.h"
#include "third_party/blink/public/platform/web_layer_tree_view.h"
#include "third_party/blink/renderer/platform/wtf/noncopyable.h"
namespace cc {
class AnimationHost;
+class Layer;
class LayerTreeHost;
class LayerTreeSettings;
}
@@ -35,11 +35,11 @@
static cc::LayerTreeSettings DefaultLayerTreeSettings();
cc::LayerTreeHost* GetLayerTreeHost() { return layer_tree_host_.get(); }
- bool HasLayer(const WebLayer&);
+ bool HasLayer(const cc::Layer&);
void SetViewportSize(const blink::WebSize&);
// blink::WebLayerTreeView implementation.
- void SetRootLayer(blink::WebLayer*) override;
+ void SetRootLayer(scoped_refptr<cc::Layer>) override;
void ClearRootLayer() override;
cc::AnimationHost* CompositorAnimationHost() override;
WebSize GetViewportSize() const override;
diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc
index b648013e..dd25bd9 100644
--- a/ui/compositor/layer.cc
+++ b/ui/compositor/layer.cc
@@ -150,9 +150,8 @@
for (auto& observer : observer_list_)
observer.LayerDestroyed(this);
- // Destroying the animator may cause observers to use the layer (and
- // indirectly the WebLayer). Destroy the animator first so that the WebLayer
- // is still around.
+ // Destroying the animator may cause observers to use the layer. Destroy the
+ // animator first so that the layer is still around.
SetAnimator(nullptr);
if (compositor_)
compositor_->SetRootLayer(nullptr);