OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_DRAW_PROPERTIES_H_ | 5 #ifndef CC_LAYERS_DRAW_PROPERTIES_H_ |
6 #define CC_LAYERS_DRAW_PROPERTIES_H_ | 6 #define CC_LAYERS_DRAW_PROPERTIES_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "ui/gfx/rect.h" | 9 #include "ui/gfx/rect.h" |
10 #include "ui/gfx/transform.h" | 10 #include "ui/gfx/transform.h" |
11 | 11 |
12 namespace cc { | 12 namespace cc { |
13 | 13 |
14 // Container for properties that layers need to compute before they can be | 14 // Container for properties that layers need to compute before they can be |
15 // drawn. | 15 // drawn. |
16 template <typename LayerType, typename RenderSurfaceType> | 16 template <typename LayerType, typename RenderSurfaceType> |
17 struct CC_EXPORT DrawProperties { | 17 struct CC_EXPORT DrawProperties { |
18 DrawProperties() | 18 DrawProperties() |
19 : opacity(0.f), | 19 : opacity(0.f), |
20 opacity_is_animating(false), | 20 opacity_is_animating(false), |
21 screen_space_opacity_is_animating(false), | 21 screen_space_opacity_is_animating(false), |
22 target_space_transform_is_animating(false), | 22 target_space_transform_is_animating(false), |
23 screen_space_transform_is_animating(false), | 23 screen_space_transform_is_animating(false), |
24 can_use_lcd_text(false), | 24 can_use_lcd_text(false), |
25 is_clipped(false), | 25 is_clipped(false), |
26 render_target(NULL), | 26 render_target(NULL), |
27 contents_scale_x(1.f), | 27 contents_scale_x(1.f), |
28 contents_scale_y(1.f), | 28 contents_scale_y(1.f), |
29 num_descendants_that_draw_content(0), | 29 num_descendants_that_draw_content(0), |
30 descendants_can_clip_selves(false) {} | 30 descendants_can_clip_selves(false), |
| 31 can_draw_directly_to_backbuffer(false) {} |
31 | 32 |
32 // Transforms objects from content space to target surface space, where | 33 // Transforms objects from content space to target surface space, where |
33 // this layer would be drawn. | 34 // this layer would be drawn. |
34 gfx::Transform target_space_transform; | 35 gfx::Transform target_space_transform; |
35 | 36 |
36 // Transforms objects from content space to screen space (viewport space). | 37 // Transforms objects from content space to screen space (viewport space). |
37 gfx::Transform screen_space_transform; | 38 gfx::Transform screen_space_transform; |
38 | 39 |
39 // DrawProperties::opacity may be different than LayerType::opacity, | 40 // DrawProperties::opacity may be different than LayerType::opacity, |
40 // particularly in the case when a RenderSurface re-parents the layer's | 41 // particularly in the case when a RenderSurface re-parents the layer's |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 float contents_scale_x; | 83 float contents_scale_x; |
83 float contents_scale_y; | 84 float contents_scale_y; |
84 gfx::Size content_bounds; | 85 gfx::Size content_bounds; |
85 | 86 |
86 // Does not include this layer itself, only its children and descendants. | 87 // Does not include this layer itself, only its children and descendants. |
87 int num_descendants_that_draw_content; | 88 int num_descendants_that_draw_content; |
88 | 89 |
89 // If true, every descendant in the sub-tree can clip itself without the | 90 // If true, every descendant in the sub-tree can clip itself without the |
90 // need to use hardware sissoring or a new render target. | 91 // need to use hardware sissoring or a new render target. |
91 bool descendants_can_clip_selves; | 92 bool descendants_can_clip_selves; |
| 93 |
| 94 bool can_draw_directly_to_backbuffer; |
92 }; | 95 }; |
93 | 96 |
94 } // namespace cc | 97 } // namespace cc |
95 | 98 |
96 #endif // CC_LAYERS_DRAW_PROPERTIES_H_ | 99 #endif // CC_LAYERS_DRAW_PROPERTIES_H_ |
OLD | NEW |