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

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

Issue 915083004: cc: Make occlusion a draw property. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: occlusiondrawproperty: notvirtual Created 5 years, 10 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 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_RENDER_SURFACE_IMPL_H_ 5 #ifndef CC_LAYERS_RENDER_SURFACE_IMPL_H_
6 #define CC_LAYERS_RENDER_SURFACE_IMPL_H_ 6 #define CC_LAYERS_RENDER_SURFACE_IMPL_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "cc/base/cc_export.h" 13 #include "cc/base/cc_export.h"
14 #include "cc/layers/layer_lists.h" 14 #include "cc/layers/layer_lists.h"
15 #include "cc/quads/render_pass.h" 15 #include "cc/quads/render_pass.h"
16 #include "cc/quads/shared_quad_state.h" 16 #include "cc/quads/shared_quad_state.h"
17 #include "cc/trees/occlusion.h"
17 #include "ui/gfx/geometry/rect.h" 18 #include "ui/gfx/geometry/rect.h"
18 #include "ui/gfx/geometry/rect_f.h" 19 #include "ui/gfx/geometry/rect_f.h"
19 #include "ui/gfx/transform.h" 20 #include "ui/gfx/transform.h"
20 21
21 namespace cc { 22 namespace cc {
22 23
23 class DamageTracker; 24 class DamageTracker;
24 class DelegatedRendererLayerImpl; 25 class DelegatedRendererLayerImpl;
25 class Occlusion; 26 class Occlusion;
26 class RenderPassId; 27 class RenderPassId;
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 bool contributes_to_drawn_surface() const { 119 bool contributes_to_drawn_surface() const {
119 return contributes_to_drawn_surface_; 120 return contributes_to_drawn_surface_;
120 } 121 }
121 void set_contributes_to_drawn_surface(bool contributes_to_drawn_surface) { 122 void set_contributes_to_drawn_surface(bool contributes_to_drawn_surface) {
122 contributes_to_drawn_surface_ = contributes_to_drawn_surface; 123 contributes_to_drawn_surface_ = contributes_to_drawn_surface;
123 } 124 }
124 125
125 void SetContentRect(const gfx::Rect& content_rect); 126 void SetContentRect(const gfx::Rect& content_rect);
126 gfx::Rect content_rect() const { return content_rect_; } 127 gfx::Rect content_rect() const { return content_rect_; }
127 128
129 const Occlusion& occlusion_in_content_space() const {
130 return occlusion_in_content_space_;
131 }
132 void set_occlusion_in_content_space(const Occlusion& occlusion) {
133 occlusion_in_content_space_ = occlusion;
134 }
135
136 const Occlusion& replica_occlusion_in_content_space() const {
137 return replica_occlusion_in_content_space_;
138 }
139 void set_replica_occlusion_in_content_space(const Occlusion& occlusion) {
140 replica_occlusion_in_content_space_ = occlusion;
141 }
142
128 LayerImplList& layer_list() { return layer_list_; } 143 LayerImplList& layer_list() { return layer_list_; }
129 void AddContributingDelegatedRenderPassLayer(LayerImpl* layer); 144 void AddContributingDelegatedRenderPassLayer(LayerImpl* layer);
130 void ClearLayerLists(); 145 void ClearLayerLists();
131 146
132 int OwningLayerId() const; 147 int OwningLayerId() const;
133 148
134 void ResetPropertyChangedFlag() { surface_property_changed_ = false; } 149 void ResetPropertyChangedFlag() { surface_property_changed_ = false; }
135 bool SurfacePropertyChanged() const; 150 bool SurfacePropertyChanged() const;
136 bool SurfacePropertyChangedOnlyFromDescendant() const; 151 bool SurfacePropertyChangedOnlyFromDescendant() const;
137 152
(...skipping 29 matching lines...) Expand all
167 gfx::Transform screen_space_transform_; 182 gfx::Transform screen_space_transform_;
168 gfx::Transform replica_draw_transform_; 183 gfx::Transform replica_draw_transform_;
169 gfx::Transform replica_screen_space_transform_; 184 gfx::Transform replica_screen_space_transform_;
170 185
171 // Uses the space of the surface's target surface. 186 // Uses the space of the surface's target surface.
172 gfx::Rect clip_rect_; 187 gfx::Rect clip_rect_;
173 188
174 LayerImplList layer_list_; 189 LayerImplList layer_list_;
175 std::vector<DelegatedRendererLayerImpl*> 190 std::vector<DelegatedRendererLayerImpl*>
176 contributing_delegated_render_pass_layer_list_; 191 contributing_delegated_render_pass_layer_list_;
192 Occlusion occlusion_in_content_space_;
193 Occlusion replica_occlusion_in_content_space_;
177 194
178 // The nearest ancestor target surface that will contain the contents of this 195 // The nearest ancestor target surface that will contain the contents of this
179 // surface, and that ignores outside occlusion. This can point to itself. 196 // surface, and that ignores outside occlusion. This can point to itself.
180 RenderSurfaceImpl* nearest_occlusion_immune_ancestor_; 197 RenderSurfaceImpl* nearest_occlusion_immune_ancestor_;
181 198
182 scoped_ptr<DamageTracker> damage_tracker_; 199 scoped_ptr<DamageTracker> damage_tracker_;
183 200
184 // For LayerIteratorActions 201 // For LayerIteratorActions
185 int target_render_surface_layer_index_history_; 202 int target_render_surface_layer_index_history_;
186 int current_layer_index_history_; 203 int current_layer_index_history_;
187 204
188 friend class LayerIterator<LayerImpl>; 205 friend class LayerIterator<LayerImpl>;
189 206
190 DISALLOW_COPY_AND_ASSIGN(RenderSurfaceImpl); 207 DISALLOW_COPY_AND_ASSIGN(RenderSurfaceImpl);
191 }; 208 };
192 209
193 } // namespace cc 210 } // namespace cc
194 #endif // CC_LAYERS_RENDER_SURFACE_IMPL_H_ 211 #endif // CC_LAYERS_RENDER_SURFACE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698