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