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

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

Issue 1908593002: cc : Stop pushing transform origin from Layer and LayerImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « cc/layers/layer.cc ('k') | cc/layers/layer_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef CC_LAYERS_LAYER_IMPL_H_ 5 #ifndef CC_LAYERS_LAYER_IMPL_H_
6 #define CC_LAYERS_LAYER_IMPL_H_ 6 #define CC_LAYERS_LAYER_IMPL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
11 #include <map> 11 #include <map>
12 #include <memory> 12 #include <memory>
13 #include <set> 13 #include <set>
14 #include <string> 14 #include <string>
15 #include <vector> 15 #include <vector>
16 16
17 #include "base/logging.h" 17 #include "base/logging.h"
18 #include "base/macros.h" 18 #include "base/macros.h"
19 #include "base/memory/ptr_util.h" 19 #include "base/memory/ptr_util.h"
20 #include "base/values.h" 20 #include "base/values.h"
21 #include "cc/animation/target_property.h" 21 #include "cc/animation/target_property.h"
22 #include "cc/base/cc_export.h" 22 #include "cc/base/cc_export.h"
23 #include "cc/base/region.h" 23 #include "cc/base/region.h"
24 #include "cc/base/synced_property.h" 24 #include "cc/base/synced_property.h"
25 #include "cc/input/input_handler.h" 25 #include "cc/input/input_handler.h"
26 #include "cc/layers/draw_properties.h" 26 #include "cc/layers/draw_properties.h"
27 #include "cc/layers/layer_collections.h" 27 #include "cc/layers/layer_collections.h"
28 #include "cc/layers/layer_impl_test_properties.h"
28 #include "cc/layers/layer_position_constraint.h" 29 #include "cc/layers/layer_position_constraint.h"
29 #include "cc/layers/performance_properties.h" 30 #include "cc/layers/performance_properties.h"
30 #include "cc/layers/render_surface_impl.h" 31 #include "cc/layers/render_surface_impl.h"
31 #include "cc/output/filter_operations.h" 32 #include "cc/output/filter_operations.h"
32 #include "cc/quads/shared_quad_state.h" 33 #include "cc/quads/shared_quad_state.h"
33 #include "cc/resources/resource_provider.h" 34 #include "cc/resources/resource_provider.h"
34 #include "cc/tiles/tile_priority.h" 35 #include "cc/tiles/tile_priority.h"
35 #include "third_party/skia/include/core/SkColor.h" 36 #include "third_party/skia/include/core/SkColor.h"
36 #include "third_party/skia/include/core/SkImageFilter.h" 37 #include "third_party/skia/include/core/SkImageFilter.h"
37 #include "ui/gfx/geometry/point3_f.h" 38 #include "ui/gfx/geometry/point3_f.h"
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 virtual ScrollbarLayerImplBase* ToScrollbarLayer(); 232 virtual ScrollbarLayerImplBase* ToScrollbarLayer();
232 233
233 // Returns true if this layer has content to draw. 234 // Returns true if this layer has content to draw.
234 void SetDrawsContent(bool draws_content); 235 void SetDrawsContent(bool draws_content);
235 bool DrawsContent() const { return draws_content_; } 236 bool DrawsContent() const { return draws_content_; }
236 237
237 int NumDescendantsThatDrawContent() const; 238 int NumDescendantsThatDrawContent() const;
238 void SetHideLayerAndSubtree(bool hide); 239 void SetHideLayerAndSubtree(bool hide);
239 bool hide_layer_and_subtree() const { return hide_layer_and_subtree_; } 240 bool hide_layer_and_subtree() const { return hide_layer_and_subtree_; }
240 241
241 void SetTransformOrigin(const gfx::Point3F& transform_origin); 242 void SetTransformOriginForTesting(const gfx::Point3F& transform_origin);
242 gfx::Point3F transform_origin() const { return transform_origin_; } 243 gfx::Point3F transform_origin_for_testing() const {
ajuma 2016/04/20 18:09:52 This approach is fine for this CL, but as we move
jaydasika 2016/04/20 18:46:06 Done.
244 return test_properties_ ? test_properties_->transform_origin
245 : gfx::Point3F();
246 }
243 247
244 void SetBackgroundColor(SkColor background_color); 248 void SetBackgroundColor(SkColor background_color);
245 SkColor background_color() const { return background_color_; } 249 SkColor background_color() const { return background_color_; }
246 void SetSafeOpaqueBackgroundColor(SkColor background_color); 250 void SetSafeOpaqueBackgroundColor(SkColor background_color);
247 // If contents_opaque(), return an opaque color else return a 251 // If contents_opaque(), return an opaque color else return a
248 // non-opaque color. Tries to return background_color(), if possible. 252 // non-opaque color. Tries to return background_color(), if possible.
249 SkColor SafeOpaqueBackgroundColor() const; 253 SkColor SafeOpaqueBackgroundColor() const;
250 254
251 void SetFilters(const FilterOperations& filters); 255 void SetFilters(const FilterOperations& filters);
252 const FilterOperations& filters() const { return filters_; } 256 const FilterOperations& filters() const { return filters_; }
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 634
631 // mask_layer_ can be temporarily stolen during tree sync, we need this ID to 635 // mask_layer_ can be temporarily stolen during tree sync, we need this ID to
632 // confirm newly assigned layer is still the previous one 636 // confirm newly assigned layer is still the previous one
633 int mask_layer_id_; 637 int mask_layer_id_;
634 LayerImpl* mask_layer_; 638 LayerImpl* mask_layer_;
635 int replica_layer_id_; // ditto 639 int replica_layer_id_; // ditto
636 LayerImpl* replica_layer_; 640 LayerImpl* replica_layer_;
637 int layer_id_; 641 int layer_id_;
638 LayerTreeImpl* layer_tree_impl_; 642 LayerTreeImpl* layer_tree_impl_;
639 643
644 struct LayerImplTestProperties* test_properties_;
ajuma 2016/04/20 18:09:52 This needs to be a unique_ptr.
jaydasika 2016/04/20 18:46:06 Done.
645
640 gfx::Vector2dF bounds_delta_; 646 gfx::Vector2dF bounds_delta_;
641 647
642 // Properties synchronized from the associated Layer. 648 // Properties synchronized from the associated Layer.
643 gfx::Point3F transform_origin_;
644 gfx::Size bounds_; 649 gfx::Size bounds_;
645 int scroll_clip_layer_id_; 650 int scroll_clip_layer_id_;
646 651
647 gfx::Vector2dF offset_to_transform_parent_; 652 gfx::Vector2dF offset_to_transform_parent_;
648 uint32_t main_thread_scrolling_reasons_; 653 uint32_t main_thread_scrolling_reasons_;
649 654
650 bool user_scrollable_horizontal_ : 1; 655 bool user_scrollable_horizontal_ : 1;
651 bool user_scrollable_vertical_ : 1; 656 bool user_scrollable_vertical_ : 1;
652 // Whether the "back" of this layer should draw. 657 // Whether the "back" of this layer should draw.
653 bool double_sided_ : 1; 658 bool double_sided_ : 1;
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 bool scrolls_drawn_descendant_; 752 bool scrolls_drawn_descendant_;
748 // If true, the layer or one of its descendants has a touch handler. 753 // If true, the layer or one of its descendants has a touch handler.
749 bool layer_or_descendant_has_touch_handler_; 754 bool layer_or_descendant_has_touch_handler_;
750 755
751 DISALLOW_COPY_AND_ASSIGN(LayerImpl); 756 DISALLOW_COPY_AND_ASSIGN(LayerImpl);
752 }; 757 };
753 758
754 } // namespace cc 759 } // namespace cc
755 760
756 #endif // CC_LAYERS_LAYER_IMPL_H_ 761 #endif // CC_LAYERS_LAYER_IMPL_H_
OLDNEW
« no previous file with comments | « cc/layers/layer.cc ('k') | cc/layers/layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698