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/draw_properties.h" | 20 #include "cc/layers/draw_properties.h" |
20 #include "cc/layers/layer_lists.h" | 21 #include "cc/layers/layer_lists.h" |
21 #include "cc/layers/layer_position_constraint.h" | 22 #include "cc/layers/layer_position_constraint.h" |
22 #include "cc/layers/render_surface_impl.h" | 23 #include "cc/layers/render_surface_impl.h" |
23 #include "cc/quads/render_pass.h" | 24 #include "cc/quads/render_pass.h" |
24 #include "cc/quads/shared_quad_state.h" | 25 #include "cc/quads/shared_quad_state.h" |
25 #include "cc/resources/resource_provider.h" | 26 #include "cc/resources/resource_provider.h" |
26 #include "skia/ext/refptr.h" | 27 #include "skia/ext/refptr.h" |
27 #include "third_party/WebKit/Source/Platform/chromium/public/WebFilterOperations
.h" | 28 #include "third_party/WebKit/Source/Platform/chromium/public/WebFilterOperations
.h" |
28 #include "third_party/skia/include/core/SkColor.h" | 29 #include "third_party/skia/include/core/SkColor.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 | 194 |
194 void SetSublayerTransform(const gfx::Transform& sublayer_transform); | 195 void SetSublayerTransform(const gfx::Transform& sublayer_transform); |
195 const gfx::Transform& sublayer_transform() const { | 196 const gfx::Transform& sublayer_transform() const { |
196 return sublayer_transform_; | 197 return sublayer_transform_; |
197 } | 198 } |
198 | 199 |
199 // Debug layer name. | 200 // Debug layer name. |
200 void SetDebugName(const std::string& debug_name) { debug_name_ = debug_name; } | 201 void SetDebugName(const std::string& debug_name) { debug_name_ = debug_name; } |
201 std::string debug_name() const { return debug_name_; } | 202 std::string debug_name() const { return debug_name_; } |
202 | 203 |
| 204 void SetCompositingReasons(CompositingReasons reasons) { |
| 205 compositing_reasons_ = reasons; |
| 206 } |
| 207 |
| 208 CompositingReasons compositing_reasons() const { |
| 209 return compositing_reasons_; |
| 210 } |
| 211 |
203 bool ShowDebugBorders() const; | 212 bool ShowDebugBorders() const; |
204 | 213 |
205 // These invalidate the host's render surface layer list. The caller | 214 // These invalidate the host's render surface layer list. The caller |
206 // is responsible for calling set_needs_update_draw_properties on the tree | 215 // is responsible for calling set_needs_update_draw_properties on the tree |
207 // so that its list can be recreated. | 216 // so that its list can be recreated. |
208 void CreateRenderSurface(); | 217 void CreateRenderSurface(); |
209 void ClearRenderSurface(); | 218 void ClearRenderSurface(); |
210 | 219 |
211 DrawProperties<LayerImpl, RenderSurfaceImpl>& draw_properties() { | 220 DrawProperties<LayerImpl, RenderSurfaceImpl>& draw_properties() { |
212 return draw_properties_; | 221 return draw_properties_; |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 gfx::Vector2d sent_scroll_delta_; | 517 gfx::Vector2d sent_scroll_delta_; |
509 gfx::Vector2d max_scroll_offset_; | 518 gfx::Vector2d max_scroll_offset_; |
510 gfx::Vector2dF last_scroll_offset_; | 519 gfx::Vector2dF last_scroll_offset_; |
511 | 520 |
512 // The global depth value of the center of the layer. This value is used | 521 // The global depth value of the center of the layer. This value is used |
513 // to sort layers from back to front. | 522 // to sort layers from back to front. |
514 float draw_depth_; | 523 float draw_depth_; |
515 | 524 |
516 // Debug layer name. | 525 // Debug layer name. |
517 std::string debug_name_; | 526 std::string debug_name_; |
| 527 CompositingReasons compositing_reasons_; |
518 | 528 |
519 WebKit::WebFilterOperations filters_; | 529 WebKit::WebFilterOperations filters_; |
520 WebKit::WebFilterOperations background_filters_; | 530 WebKit::WebFilterOperations background_filters_; |
521 skia::RefPtr<SkImageFilter> filter_; | 531 skia::RefPtr<SkImageFilter> filter_; |
522 | 532 |
523 #ifndef NDEBUG | 533 #ifndef NDEBUG |
524 bool between_will_draw_and_did_draw_; | 534 bool between_will_draw_and_did_draw_; |
525 #endif | 535 #endif |
526 | 536 |
527 // Rect indicating what was repainted/updated during update. | 537 // Rect indicating what was repainted/updated during update. |
(...skipping 17 matching lines...) Expand all Loading... |
545 // Group of properties that need to be computed based on the layer tree | 555 // Group of properties that need to be computed based on the layer tree |
546 // hierarchy before layers can be drawn. | 556 // hierarchy before layers can be drawn. |
547 DrawProperties<LayerImpl, RenderSurfaceImpl> draw_properties_; | 557 DrawProperties<LayerImpl, RenderSurfaceImpl> draw_properties_; |
548 | 558 |
549 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 559 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
550 }; | 560 }; |
551 | 561 |
552 } // namespace cc | 562 } // namespace cc |
553 | 563 |
554 #endif // CC_LAYERS_LAYER_IMPL_H_ | 564 #endif // CC_LAYERS_LAYER_IMPL_H_ |
OLD | NEW |