| OLD | NEW |
| 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 <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 #include "cc/animation/layer_animation_controller.h" | 13 #include "cc/animation/layer_animation_controller.h" |
| 14 #include "cc/animation/layer_animation_value_observer.h" | 14 #include "cc/animation/layer_animation_value_observer.h" |
| 15 #include "cc/base/cc_export.h" | 15 #include "cc/base/cc_export.h" |
| 16 #include "cc/base/region.h" | 16 #include "cc/base/region.h" |
| 17 #include "cc/base/scoped_ptr_vector.h" | 17 #include "cc/base/scoped_ptr_vector.h" |
| 18 #include "cc/input/input_handler.h" | 18 #include "cc/input/input_handler.h" |
| 19 #include "cc/layers/compositing_reasons.h" | 19 #include "cc/layers/compositing_reasons.h" |
| 20 #include "cc/layers/draw_properties.h" | 20 #include "cc/layers/draw_properties.h" |
| 21 #include "cc/layers/layer_lists.h" | 21 #include "cc/layers/layer_lists.h" |
| 22 #include "cc/layers/layer_position_constraint.h" | 22 #include "cc/layers/layer_position_constraint.h" |
| 23 #include "cc/layers/render_surface_impl.h" | 23 #include "cc/layers/render_surface_impl.h" |
| 24 #include "cc/output/filter_operations.h" |
| 24 #include "cc/quads/render_pass.h" | 25 #include "cc/quads/render_pass.h" |
| 25 #include "cc/quads/shared_quad_state.h" | 26 #include "cc/quads/shared_quad_state.h" |
| 26 #include "cc/resources/resource_provider.h" | 27 #include "cc/resources/resource_provider.h" |
| 27 #include "skia/ext/refptr.h" | 28 #include "skia/ext/refptr.h" |
| 28 #include "third_party/WebKit/public/platform/WebFilterOperations.h" | |
| 29 #include "third_party/skia/include/core/SkColor.h" | 29 #include "third_party/skia/include/core/SkColor.h" |
| 30 #include "third_party/skia/include/core/SkImageFilter.h" | 30 #include "third_party/skia/include/core/SkImageFilter.h" |
| 31 #include "third_party/skia/include/core/SkPicture.h" | 31 #include "third_party/skia/include/core/SkPicture.h" |
| 32 #include "ui/gfx/rect.h" | 32 #include "ui/gfx/rect.h" |
| 33 #include "ui/gfx/rect_f.h" | 33 #include "ui/gfx/rect_f.h" |
| 34 #include "ui/gfx/transform.h" | 34 #include "ui/gfx/transform.h" |
| 35 | 35 |
| 36 namespace base { | 36 namespace base { |
| 37 class DictionaryValue; | 37 class DictionaryValue; |
| 38 } | 38 } |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 | 141 |
| 142 void SetAnchorPointZ(float anchor_point_z); | 142 void SetAnchorPointZ(float anchor_point_z); |
| 143 float anchor_point_z() const { return anchor_point_z_; } | 143 float anchor_point_z() const { return anchor_point_z_; } |
| 144 | 144 |
| 145 void SetBackgroundColor(SkColor background_color); | 145 void SetBackgroundColor(SkColor background_color); |
| 146 SkColor background_color() const { return background_color_; } | 146 SkColor background_color() const { return background_color_; } |
| 147 // If contents_opaque(), return an opaque color else return a | 147 // If contents_opaque(), return an opaque color else return a |
| 148 // non-opaque color. Tries to return background_color(), if possible. | 148 // non-opaque color. Tries to return background_color(), if possible. |
| 149 SkColor SafeOpaqueBackgroundColor() const; | 149 SkColor SafeOpaqueBackgroundColor() const; |
| 150 | 150 |
| 151 void SetFilters(const WebKit::WebFilterOperations& filters); | 151 void SetFilters(const FilterOperations& filters); |
| 152 const WebKit::WebFilterOperations& filters() const { return filters_; } | 152 const FilterOperations& filters() const { return filters_; } |
| 153 | 153 |
| 154 void SetBackgroundFilters(const WebKit::WebFilterOperations& filters); | 154 void SetBackgroundFilters(const FilterOperations& filters); |
| 155 const WebKit::WebFilterOperations& background_filters() const { | 155 const FilterOperations& background_filters() const { |
| 156 return background_filters_; | 156 return background_filters_; |
| 157 } | 157 } |
| 158 | 158 |
| 159 void SetFilter(const skia::RefPtr<SkImageFilter>& filter); | 159 void SetFilter(const skia::RefPtr<SkImageFilter>& filter); |
| 160 skia::RefPtr<SkImageFilter> filter() const { return filter_; } | 160 skia::RefPtr<SkImageFilter> filter() const { return filter_; } |
| 161 | 161 |
| 162 void SetMasksToBounds(bool masks_to_bounds); | 162 void SetMasksToBounds(bool masks_to_bounds); |
| 163 bool masks_to_bounds() const { return masks_to_bounds_; } | 163 bool masks_to_bounds() const { return masks_to_bounds_; } |
| 164 | 164 |
| 165 void SetContentsOpaque(bool opaque); | 165 void SetContentsOpaque(bool opaque); |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 gfx::Vector2dF last_scroll_offset_; | 534 gfx::Vector2dF last_scroll_offset_; |
| 535 | 535 |
| 536 // The global depth value of the center of the layer. This value is used | 536 // The global depth value of the center of the layer. This value is used |
| 537 // to sort layers from back to front. | 537 // to sort layers from back to front. |
| 538 float draw_depth_; | 538 float draw_depth_; |
| 539 | 539 |
| 540 // Debug layer name. | 540 // Debug layer name. |
| 541 std::string debug_name_; | 541 std::string debug_name_; |
| 542 CompositingReasons compositing_reasons_; | 542 CompositingReasons compositing_reasons_; |
| 543 | 543 |
| 544 WebKit::WebFilterOperations filters_; | 544 FilterOperations filters_; |
| 545 WebKit::WebFilterOperations background_filters_; | 545 FilterOperations background_filters_; |
| 546 skia::RefPtr<SkImageFilter> filter_; | 546 skia::RefPtr<SkImageFilter> filter_; |
| 547 | 547 |
| 548 protected: | 548 protected: |
| 549 DrawMode current_draw_mode_; | 549 DrawMode current_draw_mode_; |
| 550 | 550 |
| 551 private: | 551 private: |
| 552 // Rect indicating what was repainted/updated during update. | 552 // Rect indicating what was repainted/updated during update. |
| 553 // Note that plugin layers bypass this and leave it empty. | 553 // Note that plugin layers bypass this and leave it empty. |
| 554 // Uses layer's content space. | 554 // Uses layer's content space. |
| 555 gfx::RectF update_rect_; | 555 gfx::RectF update_rect_; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 570 // Group of properties that need to be computed based on the layer tree | 570 // Group of properties that need to be computed based on the layer tree |
| 571 // hierarchy before layers can be drawn. | 571 // hierarchy before layers can be drawn. |
| 572 DrawProperties<LayerImpl, RenderSurfaceImpl> draw_properties_; | 572 DrawProperties<LayerImpl, RenderSurfaceImpl> draw_properties_; |
| 573 | 573 |
| 574 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 574 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
| 575 }; | 575 }; |
| 576 | 576 |
| 577 } // namespace cc | 577 } // namespace cc |
| 578 | 578 |
| 579 #endif // CC_LAYERS_LAYER_IMPL_H_ | 579 #endif // CC_LAYERS_LAYER_IMPL_H_ |
| OLD | NEW |