Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Side by Side Diff: cc/draw_properties.h

Issue 12603013: Part 10 of cc/ directory shuffles: layers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/delegated_renderer_layer_impl_unittest.cc ('k') | cc/heads_up_display_layer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CC_DRAW_PROPERTIES_H_
6 #define CC_DRAW_PROPERTIES_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "ui/gfx/rect.h"
10 #include "ui/gfx/transform.h"
11
12 namespace cc {
13
14 // Container for properties that layers need to compute before they can be
15 // drawn.
16 template<typename LayerType, typename RenderSurfaceType>
17 struct CC_EXPORT DrawProperties {
18 DrawProperties()
19 : opacity(0)
20 , opacity_is_animating(false)
21 , screen_space_opacity_is_animating(false)
22 , target_space_transform_is_animating(false)
23 , screen_space_transform_is_animating(false)
24 , can_use_lcd_text(false)
25 , is_clipped(false)
26 , render_target(0)
27 , contents_scale_x(1)
28 , contents_scale_y(1)
29 , num_descendants_that_draw_content(0)
30 , descendants_can_clip_selves(false)
31 {
32 }
33
34 // Transforms objects from content space to target surface space, where
35 // this layer would be drawn.
36 gfx::Transform target_space_transform;
37
38 // Transforms objects from content space to screen space (viewport space).
39 gfx::Transform screen_space_transform;
40
41 // DrawProperties::opacity may be different than LayerType::opacity,
42 // particularly in the case when a renderSurface re-parents the layer's
43 // opacity, or when opacity is compounded by the hierarchy.
44 float opacity;
45
46 // XXXIsAnimating flags are used to indicate whether the drawProperties
47 // are actually meaningful on the main thread. When the properties are
48 // animating, the main thread may not have the same values that are used
49 // to draw.
50 bool opacity_is_animating;
51 bool screen_space_opacity_is_animating;
52 bool target_space_transform_is_animating;
53 bool screen_space_transform_is_animating;
54
55 // True if the layer can use LCD text.
56 bool can_use_lcd_text;
57
58 // True if the layer needs to be clipped by clipRect.
59 bool is_clipped;
60
61 // The layer whose coordinate space this layer draws into. This can be
62 // either the same layer (m_drawProperties.render_target == this) or an
63 // ancestor of this layer.
64 LayerType* render_target;
65
66 // The surface that this layer and its subtree would contribute to.
67 scoped_ptr<RenderSurfaceType> render_surface;
68
69 // This rect is in the layer's content space.
70 gfx::Rect visible_content_rect;
71
72 // In target surface space, the rect that encloses the clipped, drawable
73 // content of the layer.
74 gfx::Rect drawable_content_rect;
75
76 // In target surface space, the original rect that clipped this
77 // layer. This value is used to avoid unnecessarily changing GL scissor
78 // state.
79 gfx::Rect clip_rect;
80
81 // The scale used to move between layer space and content space, and bounds
82 // of the space. One is always a function of the other, but which one
83 // depends on the layer type. For picture layers, this is an ideal scale,
84 // and not always the one used.
85 float contents_scale_x;
86 float contents_scale_y;
87 gfx::Size content_bounds;
88
89 // Does not include this layer itself, only its children and descendants.
90 int num_descendants_that_draw_content;
91
92 // If true, every descendant in the sub-tree can clip itself without the
93 // need to use hardware sissoring or a new render target.
94 bool descendants_can_clip_selves;
95 };
96
97 } // namespace cc
98
99 #endif // CC_DRAW_PROPERTIES_H_
OLDNEW
« no previous file with comments | « cc/delegated_renderer_layer_impl_unittest.cc ('k') | cc/heads_up_display_layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698