summaryrefslogtreecommitdiffstats
path: root/cc
diff options
context:
space:
mode:
authorjbroman <jbroman@chromium.org>2015-11-20 09:43:58 -0800
committerCommit bot <commit-bot@chromium.org>2015-11-20 17:44:52 +0000
commit69698f992d3c6b2badd01f718c71df7a52b099fb (patch)
tree3197b8b473d41995125ee43802c2dab35158657c /cc
parentf6bdd77f4054f011d9eab9b45605af0e1a53c357 (diff)
downloadchromium_src-69698f992d3c6b2badd01f718c71df7a52b099fb.zip
chromium_src-69698f992d3c6b2badd01f718c71df7a52b099fb.tar.gz
chromium_src-69698f992d3c6b2badd01f718c71df7a52b099fb.tar.bz2
Remove blink::WebLayerClient and WebGraphicsLayerDebugInfo.
It is now legal for Blink to provide an implementation of cc::LayerClient. CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1419913002 Cr-Commit-Position: refs/heads/master@{#360855}
Diffstat (limited to 'cc')
-rw-r--r--cc/blink/web_layer_impl.cc42
-rw-r--r--cc/blink/web_layer_impl.h11
-rw-r--r--cc/layers/layer.cc2
-rw-r--r--cc/layers/layer_client.h9
4 files changed, 14 insertions, 50 deletions
diff --git a/cc/blink/web_layer_impl.cc b/cc/blink/web_layer_impl.cc
index 726cfa6..bde0bdf 100644
--- a/cc/blink/web_layer_impl.cc
+++ b/cc/blink/web_layer_impl.cc
@@ -25,8 +25,6 @@
#include "cc/trees/layer_tree_host.h"
#include "third_party/WebKit/public/platform/WebFloatPoint.h"
#include "third_party/WebKit/public/platform/WebFloatRect.h"
-#include "third_party/WebKit/public/platform/WebGraphicsLayerDebugInfo.h"
-#include "third_party/WebKit/public/platform/WebLayerClient.h"
#include "third_party/WebKit/public/platform/WebLayerPositionConstraint.h"
#include "third_party/WebKit/public/platform/WebLayerScrollClient.h"
#include "third_party/WebKit/public/platform/WebSize.h"
@@ -54,20 +52,15 @@ base::LazyInstance<cc::LayerSettings> g_layer_settings =
WebLayerImpl::WebLayerImpl()
: layer_(Layer::Create(LayerSettings())), contents_opaque_is_fixed_(false) {
- web_layer_client_ = nullptr;
- layer_->SetLayerClient(this);
}
WebLayerImpl::WebLayerImpl(scoped_refptr<Layer> layer)
: layer_(layer), contents_opaque_is_fixed_(false) {
- web_layer_client_ = nullptr;
- layer_->SetLayerClient(this);
}
WebLayerImpl::~WebLayerImpl() {
if (animation_delegate_adapter_.get())
layer_->set_layer_animation_delegate(nullptr);
- web_layer_client_ = nullptr;
layer_->SetLayerClient(nullptr);
}
@@ -493,39 +486,12 @@ bool WebLayerImpl::isOrphan() const {
return !layer_->layer_tree_host();
}
-void WebLayerImpl::setWebLayerClient(blink::WebLayerClient* client) {
- web_layer_client_ = client;
+void WebLayerImpl::setLayerClient(cc::LayerClient* client) {
+ layer_->SetLayerClient(client);
}
-class TracedDebugInfo : public base::trace_event::ConvertableToTraceFormat {
- public:
- // This object takes ownership of the debug_info object.
- explicit TracedDebugInfo(blink::WebGraphicsLayerDebugInfo* debug_info)
- : debug_info_(debug_info) {}
- void AppendAsTraceFormat(std::string* out) const override {
- DCHECK(thread_checker_.CalledOnValidThread());
- blink::WebString web_string;
- debug_info_->appendAsTraceFormat(&web_string);
- out->append(web_string.utf8());
- }
-
- private:
- ~TracedDebugInfo() override {}
- scoped_ptr<blink::WebGraphicsLayerDebugInfo> debug_info_;
- base::ThreadChecker thread_checker_;
-};
-
-scoped_refptr<base::trace_event::ConvertableToTraceFormat>
-WebLayerImpl::TakeDebugInfo() {
- if (!web_layer_client_)
- return nullptr;
- blink::WebGraphicsLayerDebugInfo* debug_info =
- web_layer_client_->takeDebugInfoFor(this);
-
- if (debug_info)
- return new TracedDebugInfo(debug_info);
- else
- return nullptr;
+const cc::Layer* WebLayerImpl::ccLayer() const {
+ return layer_.get();
}
void WebLayerImpl::setScrollParent(blink::WebLayer* parent) {
diff --git a/cc/blink/web_layer_impl.h b/cc/blink/web_layer_impl.h
index e9f79c0..eb5be7e 100644
--- a/cc/blink/web_layer_impl.h
+++ b/cc/blink/web_layer_impl.h
@@ -27,7 +27,6 @@
namespace blink {
class WebFilterOperations;
-class WebLayerClient;
struct WebFloatRect;
}
@@ -46,7 +45,7 @@ namespace cc_blink {
class WebToCCAnimationDelegateAdapter;
-class WebLayerImpl : public blink::WebLayer, public cc::LayerClient {
+class WebLayerImpl : public blink::WebLayer {
public:
CC_BLINK_EXPORT WebLayerImpl();
CC_BLINK_EXPORT explicit WebLayerImpl(scoped_refptr<cc::Layer>);
@@ -146,18 +145,14 @@ class WebLayerImpl : public blink::WebLayer, public cc::LayerClient {
blink::WebLayerPositionConstraint positionConstraint() const override;
void setScrollClient(blink::WebLayerScrollClient* client) override;
bool isOrphan() const override;
- void setWebLayerClient(blink::WebLayerClient* client) override;
-
- // LayerClient implementation.
- scoped_refptr<base::trace_event::ConvertableToTraceFormat> TakeDebugInfo()
- override;
+ void setLayerClient(cc::LayerClient* client) override;
+ const cc::Layer* ccLayer() const override;
void setScrollParent(blink::WebLayer* parent) override;
void setClipParent(blink::WebLayer* parent) override;
protected:
scoped_refptr<cc::Layer> layer_;
- blink::WebLayerClient* web_layer_client_;
bool contents_opaque_is_fixed_;
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index 68b34df..d6b1fb0 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -1531,7 +1531,7 @@ bool Layer::IsSuitableForGpuRasterization() const {
scoped_refptr<base::trace_event::ConvertableToTraceFormat>
Layer::TakeDebugInfo() {
if (client_)
- return client_->TakeDebugInfo();
+ return client_->TakeDebugInfo(this);
else
return nullptr;
}
diff --git a/cc/layers/layer_client.h b/cc/layers/layer_client.h
index bcdf1c3..524399d 100644
--- a/cc/layers/layer_client.h
+++ b/cc/layers/layer_client.h
@@ -5,8 +5,6 @@
#ifndef CC_LAYERS_LAYER_CLIENT_H_
#define CC_LAYERS_LAYER_CLIENT_H_
-#include <string>
-
#include "base/memory/ref_counted.h"
#include "cc/base/cc_export.h"
@@ -18,14 +16,19 @@ class ConvertableToTraceFormat;
namespace cc {
+class Layer;
+
class CC_EXPORT LayerClient {
public:
// Returns a pointer to a debug info object, if one has been computed.
// If not, returns nullptr.
// If the returned pointer is non-nullptr, the caller takes
// ownership of the pointer.
+ //
+ // A pointer to the layer is provided for the convenience of layer clients
+ // which service multiple layers.
virtual scoped_refptr<base::trace_event::ConvertableToTraceFormat>
- TakeDebugInfo() = 0;
+ TakeDebugInfo(Layer* layer) = 0;
protected:
virtual ~LayerClient() {}