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

Side by Side Diff: sky/viewer/cc/web_layer_impl.cc

Issue 686653002: Remove a bunch of fixed position dead code. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « sky/viewer/cc/web_layer_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "sky/viewer/cc/web_layer_impl.h" 5 #include "sky/viewer/cc/web_layer_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/debug/trace_event_impl.h" 8 #include "base/debug/trace_event_impl.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
11 #include "base/threading/thread_checker.h" 11 #include "base/threading/thread_checker.h"
12 #include "cc/animation/animation.h" 12 #include "cc/animation/animation.h"
13 #include "cc/base/region.h" 13 #include "cc/base/region.h"
14 #include "cc/base/switches.h" 14 #include "cc/base/switches.h"
15 #include "sky/viewer/cc/web_animation_impl.h" 15 #include "sky/viewer/cc/web_animation_impl.h"
16 #include "sky/viewer/cc/web_blend_mode.h" 16 #include "sky/viewer/cc/web_blend_mode.h"
17 #include "sky/viewer/cc/web_filter_operations_impl.h" 17 #include "sky/viewer/cc/web_filter_operations_impl.h"
18 #include "sky/viewer/cc/web_to_cc_animation_delegate_adapter.h" 18 #include "sky/viewer/cc/web_to_cc_animation_delegate_adapter.h"
19 #include "cc/layers/layer.h" 19 #include "cc/layers/layer.h"
20 #include "cc/layers/layer_position_constraint.h" 20 #include "cc/layers/layer_position_constraint.h"
21 #include "cc/trees/layer_tree_host.h" 21 #include "cc/trees/layer_tree_host.h"
22 #include "sky/engine/public/platform/WebFloatPoint.h" 22 #include "sky/engine/public/platform/WebFloatPoint.h"
23 #include "sky/engine/public/platform/WebFloatRect.h" 23 #include "sky/engine/public/platform/WebFloatRect.h"
24 #include "sky/engine/public/platform/WebGraphicsLayerDebugInfo.h" 24 #include "sky/engine/public/platform/WebGraphicsLayerDebugInfo.h"
25 #include "sky/engine/public/platform/WebLayerClient.h" 25 #include "sky/engine/public/platform/WebLayerClient.h"
26 #include "sky/engine/public/platform/WebLayerPositionConstraint.h"
27 #include "sky/engine/public/platform/WebLayerScrollClient.h" 26 #include "sky/engine/public/platform/WebLayerScrollClient.h"
28 #include "sky/engine/public/platform/WebSize.h" 27 #include "sky/engine/public/platform/WebSize.h"
29 #include "third_party/skia/include/utils/SkMatrix44.h" 28 #include "third_party/skia/include/utils/SkMatrix44.h"
30 #include "ui/gfx/geometry/rect_conversions.h" 29 #include "ui/gfx/geometry/rect_conversions.h"
31 30
32 using cc::Animation; 31 using cc::Animation;
33 using cc::Layer; 32 using cc::Layer;
34 using blink::WebLayer; 33 using blink::WebLayer;
35 using blink::WebFloatPoint; 34 using blink::WebFloatPoint;
36 using blink::WebVector; 35 using blink::WebVector;
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 } 380 }
382 381
383 void WebLayerImpl::setIsContainerForFixedPositionLayers(bool enable) { 382 void WebLayerImpl::setIsContainerForFixedPositionLayers(bool enable) {
384 layer_->SetIsContainerForFixedPositionLayers(enable); 383 layer_->SetIsContainerForFixedPositionLayers(enable);
385 } 384 }
386 385
387 bool WebLayerImpl::isContainerForFixedPositionLayers() const { 386 bool WebLayerImpl::isContainerForFixedPositionLayers() const {
388 return layer_->IsContainerForFixedPositionLayers(); 387 return layer_->IsContainerForFixedPositionLayers();
389 } 388 }
390 389
391 static blink::WebLayerPositionConstraint ToWebLayerPositionConstraint(
392 const cc::LayerPositionConstraint& constraint) {
393 blink::WebLayerPositionConstraint web_constraint;
394 web_constraint.isFixedPosition = constraint.is_fixed_position();
395 web_constraint.isFixedToRightEdge = constraint.is_fixed_to_right_edge();
396 web_constraint.isFixedToBottomEdge = constraint.is_fixed_to_bottom_edge();
397 return web_constraint;
398 }
399
400 static cc::LayerPositionConstraint ToLayerPositionConstraint(
401 const blink::WebLayerPositionConstraint& web_constraint) {
402 cc::LayerPositionConstraint constraint;
403 constraint.set_is_fixed_position(web_constraint.isFixedPosition);
404 constraint.set_is_fixed_to_right_edge(web_constraint.isFixedToRightEdge);
405 constraint.set_is_fixed_to_bottom_edge(web_constraint.isFixedToBottomEdge);
406 return constraint;
407 }
408
409 void WebLayerImpl::setPositionConstraint(
410 const blink::WebLayerPositionConstraint& constraint) {
411 layer_->SetPositionConstraint(ToLayerPositionConstraint(constraint));
412 }
413
414 blink::WebLayerPositionConstraint WebLayerImpl::positionConstraint() const {
415 return ToWebLayerPositionConstraint(layer_->position_constraint());
416 }
417
418 void WebLayerImpl::setScrollClient(blink::WebLayerScrollClient* scroll_client) { 390 void WebLayerImpl::setScrollClient(blink::WebLayerScrollClient* scroll_client) {
419 if (scroll_client) { 391 if (scroll_client) {
420 layer_->set_did_scroll_callback( 392 layer_->set_did_scroll_callback(
421 base::Bind(&blink::WebLayerScrollClient::didScroll, 393 base::Bind(&blink::WebLayerScrollClient::didScroll,
422 base::Unretained(scroll_client))); 394 base::Unretained(scroll_client)));
423 } else { 395 } else {
424 layer_->set_did_scroll_callback(base::Closure()); 396 layer_->set_did_scroll_callback(base::Closure());
425 } 397 }
426 } 398 }
427 399
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 if (parent) 448 if (parent)
477 clip_parent = static_cast<WebLayerImpl*>(parent)->layer(); 449 clip_parent = static_cast<WebLayerImpl*>(parent)->layer();
478 layer_->SetClipParent(clip_parent); 450 layer_->SetClipParent(clip_parent);
479 } 451 }
480 452
481 Layer* WebLayerImpl::layer() const { 453 Layer* WebLayerImpl::layer() const {
482 return layer_.get(); 454 return layer_.get();
483 } 455 }
484 456
485 } // namespace sky_viewer_cc 457 } // namespace sky_viewer_cc
OLDNEW
« no previous file with comments | « sky/viewer/cc/web_layer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698