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

Side by Side Diff: cc/layers/layer_impl.cc

Issue 1231453002: Compute if a layer is clipped outside CalcDrawProps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: is_clipped moved from draw_properties to layer Created 5 years, 5 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "cc/layers/layer_impl.h" 5 #include "cc/layers/layer_impl.h"
6 6
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/numerics/safe_conversions.h" 8 #include "base/numerics/safe_conversions.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 should_scroll_on_main_thread_(false), 53 should_scroll_on_main_thread_(false),
54 have_wheel_event_handlers_(false), 54 have_wheel_event_handlers_(false),
55 have_scroll_event_handlers_(false), 55 have_scroll_event_handlers_(false),
56 scroll_blocks_on_(SCROLL_BLOCKS_ON_NONE), 56 scroll_blocks_on_(SCROLL_BLOCKS_ON_NONE),
57 user_scrollable_horizontal_(true), 57 user_scrollable_horizontal_(true),
58 user_scrollable_vertical_(true), 58 user_scrollable_vertical_(true),
59 stacking_order_changed_(false), 59 stacking_order_changed_(false),
60 double_sided_(true), 60 double_sided_(true),
61 should_flatten_transform_(true), 61 should_flatten_transform_(true),
62 should_flatten_transform_from_property_tree_(false), 62 should_flatten_transform_from_property_tree_(false),
63 is_clipped_from_property_tree_(false),
63 layer_property_changed_(false), 64 layer_property_changed_(false),
64 masks_to_bounds_(false), 65 masks_to_bounds_(false),
65 contents_opaque_(false), 66 contents_opaque_(false),
66 is_root_for_isolated_group_(false), 67 is_root_for_isolated_group_(false),
67 use_parent_backface_visibility_(false), 68 use_parent_backface_visibility_(false),
68 draw_checkerboard_for_missing_tiles_(false), 69 draw_checkerboard_for_missing_tiles_(false),
69 draws_content_(false), 70 draws_content_(false),
70 hide_layer_and_subtree_(false), 71 hide_layer_and_subtree_(false),
71 transform_is_invertible_(true), 72 transform_is_invertible_(true),
72 is_container_for_fixed_position_layers_(false), 73 is_container_for_fixed_position_layers_(false),
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
539 layer->SetOpacity(opacity_); 540 layer->SetOpacity(opacity_);
540 layer->SetBlendMode(blend_mode_); 541 layer->SetBlendMode(blend_mode_);
541 layer->SetIsRootForIsolatedGroup(is_root_for_isolated_group_); 542 layer->SetIsRootForIsolatedGroup(is_root_for_isolated_group_);
542 layer->SetPosition(position_); 543 layer->SetPosition(position_);
543 layer->SetIsContainerForFixedPositionLayers( 544 layer->SetIsContainerForFixedPositionLayers(
544 is_container_for_fixed_position_layers_); 545 is_container_for_fixed_position_layers_);
545 layer->SetPositionConstraint(position_constraint_); 546 layer->SetPositionConstraint(position_constraint_);
546 layer->SetShouldFlattenTransform(should_flatten_transform_); 547 layer->SetShouldFlattenTransform(should_flatten_transform_);
547 layer->set_should_flatten_transform_from_property_tree( 548 layer->set_should_flatten_transform_from_property_tree(
548 should_flatten_transform_from_property_tree_); 549 should_flatten_transform_from_property_tree_);
550 layer->set_is_clipped_from_property_tree(is_clipped_from_property_tree_);
549 layer->SetUseParentBackfaceVisibility(use_parent_backface_visibility_); 551 layer->SetUseParentBackfaceVisibility(use_parent_backface_visibility_);
550 layer->SetTransformAndInvertibility(transform_, transform_is_invertible_); 552 layer->SetTransformAndInvertibility(transform_, transform_is_invertible_);
551 553
552 layer->SetScrollClipLayer(scroll_clip_layer_ ? scroll_clip_layer_->id() 554 layer->SetScrollClipLayer(scroll_clip_layer_ ? scroll_clip_layer_->id()
553 : Layer::INVALID_ID); 555 : Layer::INVALID_ID);
554 layer->set_user_scrollable_horizontal(user_scrollable_horizontal_); 556 layer->set_user_scrollable_horizontal(user_scrollable_horizontal_);
555 layer->set_user_scrollable_vertical(user_scrollable_vertical_); 557 layer->set_user_scrollable_vertical(user_scrollable_vertical_);
556 558
557 layer->SetScrollCompensationAdjustment(scroll_compensation_adjustment_); 559 layer->SetScrollCompensationAdjustment(scroll_compensation_adjustment_);
558 560
(...skipping 1229 matching lines...) Expand 10 before | Expand all | Expand 10 after
1788 gfx::Rect LayerImpl::GetScaledEnclosingRectInTargetSpace(float scale) const { 1790 gfx::Rect LayerImpl::GetScaledEnclosingRectInTargetSpace(float scale) const {
1789 gfx::Transform scaled_draw_transform = 1791 gfx::Transform scaled_draw_transform =
1790 draw_properties_.target_space_transform; 1792 draw_properties_.target_space_transform;
1791 scaled_draw_transform.Scale(SK_MScalar1 / scale, SK_MScalar1 / scale); 1793 scaled_draw_transform.Scale(SK_MScalar1 / scale, SK_MScalar1 / scale);
1792 gfx::Size scaled_bounds = gfx::ToCeiledSize(gfx::ScaleSize(bounds(), scale)); 1794 gfx::Size scaled_bounds = gfx::ToCeiledSize(gfx::ScaleSize(bounds(), scale));
1793 return MathUtil::MapEnclosingClippedRect(scaled_draw_transform, 1795 return MathUtil::MapEnclosingClippedRect(scaled_draw_transform,
1794 gfx::Rect(scaled_bounds)); 1796 gfx::Rect(scaled_bounds));
1795 } 1797 }
1796 1798
1797 } // namespace cc 1799 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698