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

Side by Side Diff: cc/layers/draw_properties.h

Issue 1231453002: Compute if a layer is clipped outside CalcDrawProps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DrawProperties is_clipped removed Created 5 years, 5 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
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_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 "cc/trees/occlusion.h" 9 #include "cc/trees/occlusion.h"
10 #include "third_party/skia/include/core/SkXfermode.h" 10 #include "third_party/skia/include/core/SkXfermode.h"
11 #include "ui/gfx/geometry/rect.h" 11 #include "ui/gfx/geometry/rect.h"
12 #include "ui/gfx/transform.h" 12 #include "ui/gfx/transform.h"
13 13
14 namespace cc { 14 namespace cc {
15 15
16 // Container for properties that layers need to compute before they can be 16 // Container for properties that layers need to compute before they can be
17 // drawn. 17 // drawn.
18 template <typename LayerType> 18 template <typename LayerType>
19 struct CC_EXPORT DrawProperties { 19 struct CC_EXPORT DrawProperties {
20 DrawProperties() 20 DrawProperties()
21 : opacity(0.f), 21 : opacity(0.f),
22 blend_mode(SkXfermode::kSrcOver_Mode), 22 blend_mode(SkXfermode::kSrcOver_Mode),
23 opacity_is_animating(false), 23 opacity_is_animating(false),
24 screen_space_opacity_is_animating(false), 24 screen_space_opacity_is_animating(false),
25 target_space_transform_is_animating(false), 25 target_space_transform_is_animating(false),
26 screen_space_transform_is_animating(false), 26 screen_space_transform_is_animating(false),
27 can_use_lcd_text(false), 27 can_use_lcd_text(false),
28 is_clipped(false),
29 render_target(nullptr), 28 render_target(nullptr),
30 num_unclipped_descendants(0), 29 num_unclipped_descendants(0),
31 layer_or_descendant_has_copy_request(false), 30 layer_or_descendant_has_copy_request(false),
32 layer_or_descendant_has_input_handler(false), 31 layer_or_descendant_has_input_handler(false),
33 has_child_with_a_scroll_parent(false), 32 has_child_with_a_scroll_parent(false),
34 index_of_first_descendants_addition(0), 33 index_of_first_descendants_addition(0),
35 num_descendants_added(0), 34 num_descendants_added(0),
36 index_of_first_render_surface_layer_list_addition(0), 35 index_of_first_render_surface_layer_list_addition(0),
37 num_render_surfaces_added(0), 36 num_render_surfaces_added(0),
38 last_drawn_render_surface_layer_list_id(0), 37 last_drawn_render_surface_layer_list_id(0),
(...skipping 25 matching lines...) Expand all
64 // animating, the main thread may not have the same values that are used 63 // animating, the main thread may not have the same values that are used
65 // to draw. 64 // to draw.
66 bool opacity_is_animating; 65 bool opacity_is_animating;
67 bool screen_space_opacity_is_animating; 66 bool screen_space_opacity_is_animating;
68 bool target_space_transform_is_animating; 67 bool target_space_transform_is_animating;
69 bool screen_space_transform_is_animating; 68 bool screen_space_transform_is_animating;
70 69
71 // True if the layer can use LCD text. 70 // True if the layer can use LCD text.
72 bool can_use_lcd_text; 71 bool can_use_lcd_text;
73 72
74 // True if the layer needs to be clipped by clip_rect.
75 bool is_clipped;
76
77 // The layer whose coordinate space this layer draws into. This can be 73 // The layer whose coordinate space this layer draws into. This can be
78 // either the same layer (draw_properties_.render_target == this) or an 74 // either the same layer (draw_properties_.render_target == this) or an
79 // ancestor of this layer. 75 // ancestor of this layer.
80 LayerType* render_target; 76 LayerType* render_target;
81 77
82 // This rect is a bounding box around what part of the layer is visible, in 78 // This rect is a bounding box around what part of the layer is visible, in
83 // the layer's coordinate space. 79 // the layer's coordinate space.
84 gfx::Rect visible_layer_rect; 80 gfx::Rect visible_layer_rect;
85 81
86 // In target surface space, the rect that encloses the clipped, drawable 82 // In target surface space, the rect that encloses the clipped, drawable
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 float maximum_animation_contents_scale; 130 float maximum_animation_contents_scale;
135 131
136 // The scale during the layer animation start at which content should be 132 // The scale during the layer animation start at which content should be
137 // rastered at to be crisp. 133 // rastered at to be crisp.
138 float starting_animation_contents_scale; 134 float starting_animation_contents_scale;
139 }; 135 };
140 136
141 } // namespace cc 137 } // namespace cc
142 138
143 #endif // CC_LAYERS_DRAW_PROPERTIES_H_ 139 #endif // CC_LAYERS_DRAW_PROPERTIES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698