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

Side by Side Diff: webkit/compositor_bindings/web_layer_impl.cc

Issue 12552004: Support bottom-right anchored fixed-position elements during a pinch gesture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: correct translate order. move math to a separate function. Created 7 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "webkit/compositor_bindings/web_layer_impl.h" 5 #include "webkit/compositor_bindings/web_layer_impl.h"
6 6
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "cc/animation/animation.h" 8 #include "cc/animation/animation.h"
9 #include "cc/base/region.h" 9 #include "cc/base/region.h"
10 #include "cc/layers/layer.h" 10 #include "cc/layers/layer.h"
11 #include "cc/layers/layer_position_constraint.h"
11 #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatPoint.h" 12 #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatPoint.h"
12 #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatRect.h" 13 #include "third_party/WebKit/Source/Platform/chromium/public/WebFloatRect.h"
14 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerPositionCon straint.h"
13 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" 15 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h"
14 #include "third_party/skia/include/utils/SkMatrix44.h" 16 #include "third_party/skia/include/utils/SkMatrix44.h"
15 #include "webkit/compositor_bindings/web_animation_impl.h" 17 #include "webkit/compositor_bindings/web_animation_impl.h"
16 18
17 using cc::Animation; 19 using cc::Animation;
18 using cc::Layer; 20 using cc::Layer;
19 using WebKit::WebLayer; 21 using WebKit::WebLayer;
20 using WebKit::WebFloatPoint; 22 using WebKit::WebFloatPoint;
21 using WebKit::WebVector; 23 using WebKit::WebVector;
22 using WebKit::WebRect; 24 using WebKit::WebRect;
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 } 306 }
305 307
306 void WebLayerImpl::setIsContainerForFixedPositionLayers(bool enable) { 308 void WebLayerImpl::setIsContainerForFixedPositionLayers(bool enable) {
307 layer_->SetIsContainerForFixedPositionLayers(enable); 309 layer_->SetIsContainerForFixedPositionLayers(enable);
308 } 310 }
309 311
310 bool WebLayerImpl::isContainerForFixedPositionLayers() const { 312 bool WebLayerImpl::isContainerForFixedPositionLayers() const {
311 return layer_->is_container_for_fixed_position_layers(); 313 return layer_->is_container_for_fixed_position_layers();
312 } 314 }
313 315
314 void WebLayerImpl::setFixedToContainerLayer(bool enable) { 316 static WebKit::WebLayerPositionConstraint ToWebLayerPositionConstraint(
315 layer_->SetFixedToContainerLayer(enable); 317 const cc::LayerPositionConstraint& constraint) {
318 WebKit::WebLayerPositionConstraint web_constraint;
319 web_constraint.isFixedPosition = constraint.is_fixed_position();
320 web_constraint.isFixedToRightEdge = constraint.is_fixed_to_right_edge();
321 web_constraint.isFixedToBottomEdge = constraint.is_fixed_to_bottom_edge();
322 return web_constraint;
316 } 323 }
317 324
318 bool WebLayerImpl::fixedToContainerLayer() const { 325 static cc::LayerPositionConstraint ToLayerPositionConstraint(
319 return layer_->fixed_to_container_layer(); 326 const WebKit::WebLayerPositionConstraint& web_constraint) {
327 cc::LayerPositionConstraint constraint;
328 constraint.SetIsFixedPosition(web_constraint.isFixedPosition);
329 constraint.SetIsFixedToRightEdge(web_constraint.isFixedToRightEdge);
330 constraint.SetIsFixedToBottomEdge(web_constraint.isFixedToBottomEdge);
331 return constraint;
332 }
333
334 void WebLayerImpl::setPositionConstraint(
335 const WebKit::WebLayerPositionConstraint& constraint) {
336 layer_->SetPositionConstraint(ToLayerPositionConstraint(constraint));
337 }
338
339 WebKit::WebLayerPositionConstraint WebLayerImpl::positionConstraint() const {
340 return ToWebLayerPositionConstraint(layer_->position_constraint());
320 } 341 }
321 342
322 void WebLayerImpl::setScrollClient( 343 void WebLayerImpl::setScrollClient(
323 WebKit::WebLayerScrollClient* scroll_client) { 344 WebKit::WebLayerScrollClient* scroll_client) {
324 layer_->set_layer_scroll_client(scroll_client); 345 layer_->set_layer_scroll_client(scroll_client);
325 } 346 }
326 347
327 bool WebLayerImpl::isOrphan() const { return !layer_->layer_tree_host(); } 348 bool WebLayerImpl::isOrphan() const { return !layer_->layer_tree_host(); }
328 349
329 Layer* WebLayerImpl::layer() const { return layer_.get(); } 350 Layer* WebLayerImpl::layer() const { return layer_.get(); }
330 351
331 } // namespace WebKit 352 } // namespace WebKit
OLDNEW
« cc/trees/layer_tree_host_common.cc ('K') | « webkit/compositor_bindings/web_layer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698