| OLD | NEW |
| 1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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_H_ | 5 #ifndef CC_LAYERS_LAYER_H_ |
| 6 #define CC_LAYERS_LAYER_H_ | 6 #define CC_LAYERS_LAYER_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "cc/layers/layer_lists.h" | 22 #include "cc/layers/layer_lists.h" |
| 23 #include "cc/layers/layer_position_constraint.h" | 23 #include "cc/layers/layer_position_constraint.h" |
| 24 #include "cc/layers/paint_properties.h" | 24 #include "cc/layers/paint_properties.h" |
| 25 #include "cc/layers/render_surface.h" | 25 #include "cc/layers/render_surface.h" |
| 26 #include "cc/output/filter_operations.h" | 26 #include "cc/output/filter_operations.h" |
| 27 #include "skia/ext/refptr.h" | 27 #include "skia/ext/refptr.h" |
| 28 #include "third_party/skia/include/core/SkColor.h" | 28 #include "third_party/skia/include/core/SkColor.h" |
| 29 #include "third_party/skia/include/core/SkImageFilter.h" | 29 #include "third_party/skia/include/core/SkImageFilter.h" |
| 30 #include "third_party/skia/include/core/SkPicture.h" | 30 #include "third_party/skia/include/core/SkPicture.h" |
| 31 #include "third_party/skia/include/core/SkXfermode.h" | 31 #include "third_party/skia/include/core/SkXfermode.h" |
| 32 #include "ui/gfx/point3_f.h" |
| 32 #include "ui/gfx/rect.h" | 33 #include "ui/gfx/rect.h" |
| 33 #include "ui/gfx/rect_f.h" | 34 #include "ui/gfx/rect_f.h" |
| 34 #include "ui/gfx/transform.h" | 35 #include "ui/gfx/transform.h" |
| 35 | 36 |
| 36 namespace gfx { | 37 namespace gfx { |
| 37 class BoxF; | 38 class BoxF; |
| 38 } | 39 } |
| 39 | 40 |
| 40 namespace base { | 41 namespace base { |
| 41 namespace debug { | 42 namespace debug { |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 Layer* child_at(size_t index) { return children_[index].get(); } | 97 Layer* child_at(size_t index) { return children_[index].get(); } |
| 97 | 98 |
| 98 // This requests the layer and its subtree be rendered and given to the | 99 // This requests the layer and its subtree be rendered and given to the |
| 99 // callback. If the copy is unable to be produced (the layer is destroyed | 100 // callback. If the copy is unable to be produced (the layer is destroyed |
| 100 // first), then the callback is called with a NULL/empty result. | 101 // first), then the callback is called with a NULL/empty result. |
| 101 void RequestCopyOfOutput(scoped_ptr<CopyOutputRequest> request); | 102 void RequestCopyOfOutput(scoped_ptr<CopyOutputRequest> request); |
| 102 bool HasCopyRequest() const { | 103 bool HasCopyRequest() const { |
| 103 return !copy_requests_.empty(); | 104 return !copy_requests_.empty(); |
| 104 } | 105 } |
| 105 | 106 |
| 106 void SetAnchorPoint(const gfx::PointF& anchor_point); | |
| 107 gfx::PointF anchor_point() const { return anchor_point_; } | |
| 108 | |
| 109 void SetAnchorPointZ(float anchor_point_z); | |
| 110 float anchor_point_z() const { return anchor_point_z_; } | |
| 111 | |
| 112 virtual void SetBackgroundColor(SkColor background_color); | 107 virtual void SetBackgroundColor(SkColor background_color); |
| 113 SkColor background_color() const { return background_color_; } | 108 SkColor background_color() const { return background_color_; } |
| 114 // If contents_opaque(), return an opaque color else return a | 109 // If contents_opaque(), return an opaque color else return a |
| 115 // non-opaque color. Tries to return background_color(), if possible. | 110 // non-opaque color. Tries to return background_color(), if possible. |
| 116 SkColor SafeOpaqueBackgroundColor() const; | 111 SkColor SafeOpaqueBackgroundColor() const; |
| 117 | 112 |
| 118 // A layer's bounds are in logical, non-page-scaled pixels (however, the | 113 // A layer's bounds are in logical, non-page-scaled pixels (however, the |
| 119 // root layer's bounds are in physical pixels). | 114 // root layer's bounds are in physical pixels). |
| 120 void SetBounds(const gfx::Size& bounds); | 115 void SetBounds(const gfx::Size& bounds); |
| 121 gfx::Size bounds() const { return bounds_; } | 116 gfx::Size bounds() const { return bounds_; } |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 void SetPositionConstraint(const LayerPositionConstraint& constraint); | 170 void SetPositionConstraint(const LayerPositionConstraint& constraint); |
| 176 const LayerPositionConstraint& position_constraint() const { | 171 const LayerPositionConstraint& position_constraint() const { |
| 177 return position_constraint_; | 172 return position_constraint_; |
| 178 } | 173 } |
| 179 | 174 |
| 180 void SetTransform(const gfx::Transform& transform); | 175 void SetTransform(const gfx::Transform& transform); |
| 181 const gfx::Transform& transform() const { return transform_; } | 176 const gfx::Transform& transform() const { return transform_; } |
| 182 bool TransformIsAnimating() const; | 177 bool TransformIsAnimating() const; |
| 183 bool transform_is_invertible() const { return transform_is_invertible_; } | 178 bool transform_is_invertible() const { return transform_is_invertible_; } |
| 184 | 179 |
| 180 void SetTransformOrigin(const gfx::Point3F&); |
| 181 gfx::Point3F transform_origin() { return transform_origin_; } |
| 182 |
| 185 void SetScrollParent(Layer* parent); | 183 void SetScrollParent(Layer* parent); |
| 186 | 184 |
| 187 Layer* scroll_parent() { return scroll_parent_; } | 185 Layer* scroll_parent() { return scroll_parent_; } |
| 188 const Layer* scroll_parent() const { return scroll_parent_; } | 186 const Layer* scroll_parent() const { return scroll_parent_; } |
| 189 | 187 |
| 190 void AddScrollChild(Layer* child); | 188 void AddScrollChild(Layer* child); |
| 191 void RemoveScrollChild(Layer* child); | 189 void RemoveScrollChild(Layer* child); |
| 192 | 190 |
| 193 std::set<Layer*>* scroll_children() { return scroll_children_.get(); } | 191 std::set<Layer*>* scroll_children() { return scroll_children_.get(); } |
| 194 const std::set<Layer*>* scroll_children() const { | 192 const std::set<Layer*>* scroll_children() const { |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 588 bool double_sided_ : 1; | 586 bool double_sided_ : 1; |
| 589 bool should_flatten_transform_ : 1; | 587 bool should_flatten_transform_ : 1; |
| 590 bool use_parent_backface_visibility_ : 1; | 588 bool use_parent_backface_visibility_ : 1; |
| 591 bool draw_checkerboard_for_missing_tiles_ : 1; | 589 bool draw_checkerboard_for_missing_tiles_ : 1; |
| 592 bool force_render_surface_ : 1; | 590 bool force_render_surface_ : 1; |
| 593 bool is_3d_sorted_ : 1; | 591 bool is_3d_sorted_ : 1; |
| 594 bool transform_is_invertible_ : 1; | 592 bool transform_is_invertible_ : 1; |
| 595 Region non_fast_scrollable_region_; | 593 Region non_fast_scrollable_region_; |
| 596 Region touch_event_handler_region_; | 594 Region touch_event_handler_region_; |
| 597 gfx::PointF position_; | 595 gfx::PointF position_; |
| 598 gfx::PointF anchor_point_; | |
| 599 SkColor background_color_; | 596 SkColor background_color_; |
| 600 float opacity_; | 597 float opacity_; |
| 601 SkXfermode::Mode blend_mode_; | 598 SkXfermode::Mode blend_mode_; |
| 602 FilterOperations filters_; | 599 FilterOperations filters_; |
| 603 FilterOperations background_filters_; | 600 FilterOperations background_filters_; |
| 604 float anchor_point_z_; | |
| 605 LayerPositionConstraint position_constraint_; | 601 LayerPositionConstraint position_constraint_; |
| 606 Layer* scroll_parent_; | 602 Layer* scroll_parent_; |
| 607 scoped_ptr<std::set<Layer*> > scroll_children_; | 603 scoped_ptr<std::set<Layer*> > scroll_children_; |
| 608 | 604 |
| 609 Layer* clip_parent_; | 605 Layer* clip_parent_; |
| 610 scoped_ptr<std::set<Layer*> > clip_children_; | 606 scoped_ptr<std::set<Layer*> > clip_children_; |
| 611 | 607 |
| 612 gfx::Transform transform_; | 608 gfx::Transform transform_; |
| 609 gfx::Point3F transform_origin_; |
| 613 | 610 |
| 614 // Replica layer used for reflections. | 611 // Replica layer used for reflections. |
| 615 scoped_refptr<Layer> replica_layer_; | 612 scoped_refptr<Layer> replica_layer_; |
| 616 | 613 |
| 617 // Transient properties. | 614 // Transient properties. |
| 618 float raster_scale_; | 615 float raster_scale_; |
| 619 | 616 |
| 620 LayerClient* client_; | 617 LayerClient* client_; |
| 621 | 618 |
| 622 ScopedPtrVector<CopyOutputRequest> copy_requests_; | 619 ScopedPtrVector<CopyOutputRequest> copy_requests_; |
| 623 | 620 |
| 624 base::Closure did_scroll_callback_; | 621 base::Closure did_scroll_callback_; |
| 625 | 622 |
| 626 DrawProperties<Layer> draw_properties_; | 623 DrawProperties<Layer> draw_properties_; |
| 627 | 624 |
| 628 PaintProperties paint_properties_; | 625 PaintProperties paint_properties_; |
| 629 | 626 |
| 630 DISALLOW_COPY_AND_ASSIGN(Layer); | 627 DISALLOW_COPY_AND_ASSIGN(Layer); |
| 631 }; | 628 }; |
| 632 | 629 |
| 633 } // namespace cc | 630 } // namespace cc |
| 634 | 631 |
| 635 #endif // CC_LAYERS_LAYER_H_ | 632 #endif // CC_LAYERS_LAYER_H_ |
| OLD | NEW |