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

Unified Diff: content/renderer/compositor_bindings/web_layer_impl.cc

Issue 317163002: Moving compositor_bindings from webkit to content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changing dependencies due to failing ios bots Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/compositor_bindings/web_layer_impl.cc
diff --git a/webkit/renderer/compositor_bindings/web_layer_impl.cc b/content/renderer/compositor_bindings/web_layer_impl.cc
similarity index 86%
rename from webkit/renderer/compositor_bindings/web_layer_impl.cc
rename to content/renderer/compositor_bindings/web_layer_impl.cc
index 7a39fe0b2e86b55dfee829f73fd3f8823b07a5a8..734d75e9c6e412c7eb62f96090df7ffe648279be 100644
--- a/webkit/renderer/compositor_bindings/web_layer_impl.cc
+++ b/content/renderer/compositor_bindings/web_layer_impl.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "webkit/renderer/compositor_bindings/web_layer_impl.h"
+#include "content/renderer/compositor_bindings/web_layer_impl.h"
#include "base/bind.h"
#include "base/debug/trace_event_impl.h"
@@ -15,6 +15,10 @@
#include "cc/layers/layer.h"
#include "cc/layers/layer_position_constraint.h"
#include "cc/trees/layer_tree_host.h"
+#include "content/renderer/compositor_bindings/web_animation_impl.h"
+#include "content/renderer/compositor_bindings/web_blend_mode.h"
+#include "content/renderer/compositor_bindings/web_filter_operations_impl.h"
+#include "content/renderer/compositor_bindings/web_to_cc_animation_delegate_adapter.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"
@@ -23,10 +27,6 @@
#include "third_party/WebKit/public/platform/WebLayerScrollClient.h"
#include "third_party/WebKit/public/platform/WebSize.h"
#include "third_party/skia/include/utils/SkMatrix44.h"
-#include "webkit/renderer/compositor_bindings/web_animation_impl.h"
-#include "webkit/renderer/compositor_bindings/web_blend_mode.h"
-#include "webkit/renderer/compositor_bindings/web_filter_operations_impl.h"
-#include "webkit/renderer/compositor_bindings/web_to_cc_animation_delegate_adapter.h"
using cc::Animation;
using cc::Layer;
@@ -38,7 +38,7 @@ using blink::WebSize;
using blink::WebColor;
using blink::WebFilterOperations;
-namespace webkit {
+namespace content {
namespace {
bool g_impl_side_painting_enabled = false;
@@ -71,13 +71,17 @@ void WebLayerImpl::SetImplSidePaintingEnabled(bool enabled) {
g_impl_side_painting_enabled = enabled;
}
-int WebLayerImpl::id() const { return layer_->id(); }
+int WebLayerImpl::id() const {
+ return layer_->id();
+}
void WebLayerImpl::invalidateRect(const blink::WebFloatRect& rect) {
layer_->SetNeedsDisplayRect(rect);
}
-void WebLayerImpl::invalidate() { layer_->SetNeedsDisplay(); }
+void WebLayerImpl::invalidate() {
+ layer_->SetNeedsDisplay();
+}
void WebLayerImpl::addChild(WebLayer* child) {
layer_->AddChild(static_cast<WebLayerImpl*>(child)->layer());
@@ -92,19 +96,27 @@ void WebLayerImpl::replaceChild(WebLayer* reference, WebLayer* new_layer) {
static_cast<WebLayerImpl*>(new_layer)->layer());
}
-void WebLayerImpl::removeFromParent() { layer_->RemoveFromParent(); }
+void WebLayerImpl::removeFromParent() {
+ layer_->RemoveFromParent();
+}
-void WebLayerImpl::removeAllChildren() { layer_->RemoveAllChildren(); }
+void WebLayerImpl::removeAllChildren() {
+ layer_->RemoveAllChildren();
+}
void WebLayerImpl::setBounds(const WebSize& size) { layer_->SetBounds(size); }
-WebSize WebLayerImpl::bounds() const { return layer_->bounds(); }
+WebSize WebLayerImpl::bounds() const {
+ return layer_->bounds();
+}
void WebLayerImpl::setMasksToBounds(bool masks_to_bounds) {
layer_->SetMasksToBounds(masks_to_bounds);
}
-bool WebLayerImpl::masksToBounds() const { return layer_->masks_to_bounds(); }
+bool WebLayerImpl::masksToBounds() const {
+ return layer_->masks_to_bounds();
+}
void WebLayerImpl::setMaskLayer(WebLayer* maskLayer) {
layer_->SetMaskLayer(
@@ -116,9 +128,13 @@ void WebLayerImpl::setReplicaLayer(WebLayer* replica_layer) {
replica_layer ? static_cast<WebLayerImpl*>(replica_layer)->layer() : 0);
}
-void WebLayerImpl::setOpacity(float opacity) { layer_->SetOpacity(opacity); }
+void WebLayerImpl::setOpacity(float opacity) {
+ layer_->SetOpacity(opacity);
+}
-float WebLayerImpl::opacity() const { return layer_->opacity(); }
+float WebLayerImpl::opacity() const {
+ return layer_->opacity();
+}
void WebLayerImpl::setBlendMode(blink::WebBlendMode blend_mode) {
layer_->SetBlendMode(BlendModeToSkia(blend_mode));
@@ -136,15 +152,21 @@ bool WebLayerImpl::isRootForIsolatedGroup() {
return layer_->is_root_for_isolated_group();
}
-void WebLayerImpl::setOpaque(bool opaque) { layer_->SetContentsOpaque(opaque); }
+void WebLayerImpl::setOpaque(bool opaque) {
+ layer_->SetContentsOpaque(opaque);
+}
-bool WebLayerImpl::opaque() const { return layer_->contents_opaque(); }
+bool WebLayerImpl::opaque() const {
+ return layer_->contents_opaque();
+}
void WebLayerImpl::setPosition(const WebFloatPoint& position) {
layer_->SetPosition(position);
}
-WebFloatPoint WebLayerImpl::position() const { return layer_->position(); }
+WebFloatPoint WebLayerImpl::position() const {
+ return layer_->position();
+}
void WebLayerImpl::setTransform(const SkMatrix44& matrix) {
gfx::Transform transform;
@@ -181,7 +203,9 @@ void WebLayerImpl::setDrawsContent(bool draws_content) {
layer_->SetIsDrawable(draws_content);
}
-bool WebLayerImpl::drawsContent() const { return layer_->DrawsContent(); }
+bool WebLayerImpl::drawsContent() const {
+ return layer_->DrawsContent();
+}
void WebLayerImpl::setShouldFlattenTransform(bool flatten) {
layer_->SetShouldFlattenTransform(flatten);
@@ -216,8 +240,7 @@ void WebLayerImpl::setBackgroundFilters(const WebFilterOperations& filters) {
layer_->SetBackgroundFilters(filters_impl.AsFilterOperations());
}
-void WebLayerImpl::setAnimationDelegate(
- blink::WebAnimationDelegate* delegate) {
+void WebLayerImpl::setAnimationDelegate(blink::WebAnimationDelegate* delegate) {
animation_delegate_adapter_.reset(
new WebToCCAnimationDelegateAdapter(delegate));
layer_->set_layer_animation_delegate(animation_delegate_adapter_.get());
@@ -238,15 +261,16 @@ void WebLayerImpl::removeAnimation(
int animation_id,
blink::WebAnimation::TargetProperty target_property) {
layer_->layer_animation_controller()->RemoveAnimation(
- animation_id,
- static_cast<Animation::TargetProperty>(target_property));
+ animation_id, static_cast<Animation::TargetProperty>(target_property));
}
void WebLayerImpl::pauseAnimation(int animation_id, double time_offset) {
layer_->PauseAnimation(animation_id, time_offset);
}
-bool WebLayerImpl::hasActiveAnimation() { return layer_->HasActiveAnimation(); }
+bool WebLayerImpl::hasActiveAnimation() {
+ return layer_->HasActiveAnimation();
+}
void WebLayerImpl::setForceRenderSurface(bool force_render_surface) {
layer_->SetForceRenderSurface(force_render_surface);
@@ -268,7 +292,9 @@ void WebLayerImpl::setScrollClipLayer(WebLayer* clip_layer) {
layer_->SetScrollClipLayerId(clip_layer->id());
}
-bool WebLayerImpl::scrollable() const { return layer_->scrollable(); }
+bool WebLayerImpl::scrollable() const {
+ return layer_->scrollable();
+}
void WebLayerImpl::setUserScrollable(bool horizontal, bool vertical) {
layer_->SetUserScrollable(horizontal, vertical);
@@ -392,8 +418,7 @@ blink::WebLayerPositionConstraint WebLayerImpl::positionConstraint() const {
return ToWebLayerPositionConstraint(layer_->position_constraint());
}
-void WebLayerImpl::setScrollClient(
- blink::WebLayerScrollClient* scroll_client) {
+void WebLayerImpl::setScrollClient(blink::WebLayerScrollClient* scroll_client) {
if (scroll_client) {
layer_->set_did_scroll_callback(
base::Bind(&blink::WebLayerScrollClient::didScroll,
@@ -403,7 +428,9 @@ void WebLayerImpl::setScrollClient(
}
}
-bool WebLayerImpl::isOrphan() const { return !layer_->layer_tree_host(); }
+bool WebLayerImpl::isOrphan() const {
+ return !layer_->layer_tree_host();
+}
void WebLayerImpl::setWebLayerClient(blink::WebLayerClient* client) {
web_layer_client_ = client;
@@ -412,14 +439,15 @@ void WebLayerImpl::setWebLayerClient(blink::WebLayerClient* client) {
class TracedDebugInfo : public base::debug::ConvertableToTraceFormat {
public:
// This object takes ownership of the debug_info object.
- explicit TracedDebugInfo(blink::WebGraphicsLayerDebugInfo* debug_info) :
- debug_info_(debug_info) {}
+ explicit TracedDebugInfo(blink::WebGraphicsLayerDebugInfo* debug_info)
+ : debug_info_(debug_info) {}
virtual 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:
virtual ~TracedDebugInfo() {}
scoped_ptr<blink::WebGraphicsLayerDebugInfo> debug_info_;
@@ -427,7 +455,7 @@ class TracedDebugInfo : public base::debug::ConvertableToTraceFormat {
};
scoped_refptr<base::debug::ConvertableToTraceFormat>
- WebLayerImpl::TakeDebugInfo() {
+WebLayerImpl::TakeDebugInfo() {
if (!web_layer_client_)
return NULL;
blink::WebGraphicsLayerDebugInfo* debug_info =
@@ -453,6 +481,9 @@ void WebLayerImpl::setClipParent(blink::WebLayer* parent) {
layer_->SetClipParent(clip_parent);
}
-Layer* WebLayerImpl::layer() const { return layer_.get(); }
+Layer* WebLayerImpl::layer() const {
+ return layer_.get();
+}
+
+} // namespace content
-} // namespace webkit

Powered by Google App Engine
This is Rietveld 408576698