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

Side by Side Diff: cc/draw_properties.h

Issue 11503005: cc: Refactor content scale/bounds into draw properties (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years 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/contents_scaling_layer_unittest.cc ('k') | cc/image_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
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_DRAW_PROPERTIES_H_ 5 #ifndef CC_DRAW_PROPERTIES_H_
6 #define CC_DRAW_PROPERTIES_H_ 6 #define CC_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) 19 : opacity(0)
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(0) 26 , render_target(0)
27 , contents_scale_x(1)
28 , contents_scale_y(1)
27 , num_descendants_that_draw_content(0) 29 , num_descendants_that_draw_content(0)
28 { 30 {
29 } 31 }
30 32
31 // Transforms objects from content space to target surface space, where 33 // Transforms objects from content space to target surface space, where
32 // this layer would be drawn. 34 // this layer would be drawn.
33 gfx::Transform target_space_transform; 35 gfx::Transform target_space_transform;
34 36
35 // Transforms objects from content space to screen space (viewport space). 37 // Transforms objects from content space to screen space (viewport space).
36 gfx::Transform screen_space_transform; 38 gfx::Transform screen_space_transform;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 70
69 // In target surface space, the rect that encloses the clipped, drawable 71 // In target surface space, the rect that encloses the clipped, drawable
70 // content of the layer. 72 // content of the layer.
71 gfx::Rect drawable_content_rect; 73 gfx::Rect drawable_content_rect;
72 74
73 // In target surface space, the original rect that clipped this 75 // In target surface space, the original rect that clipped this
74 // layer. This value is used to avoid unnecessarily changing GL scissor 76 // layer. This value is used to avoid unnecessarily changing GL scissor
75 // state. 77 // state.
76 gfx::Rect clip_rect; 78 gfx::Rect clip_rect;
77 79
80 // The scale used to move between layer space and content space, and bounds
81 // of the space. One is always a function of the other, but which one
82 // depends on the layer type. For picture layers, this is an ideal scale,
83 // and not always the one used.
84 float contents_scale_x;
85 float contents_scale_y;
86 gfx::Size content_bounds;
87
78 // Does not include this layer itself, only its children and descendants. 88 // Does not include this layer itself, only its children and descendants.
79 int num_descendants_that_draw_content; 89 int num_descendants_that_draw_content;
80 }; 90 };
81 91
82 } // namespace cc 92 } // namespace cc
83 93
84 #endif // CC_DRAW_PROPERTIES_H_ 94 #endif // CC_DRAW_PROPERTIES_H_
OLDNEW
« no previous file with comments | « cc/contents_scaling_layer_unittest.cc ('k') | cc/image_layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698