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

Side by Side Diff: cc/layer_impl.h

Issue 11447028: cc: Split out calcDrawEtc from drawLayers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clean up unnecessary test changes 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 | « no previous file | cc/layer_impl.cc » ('j') | cc/layer_impl.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_LAYER_IMPL_H_ 5 #ifndef CC_LAYER_IMPL_H_
6 #define CC_LAYER_IMPL_H_ 6 #define CC_LAYER_IMPL_H_
7 7
8 #include <public/WebFilterOperations.h> 8 #include <public/WebFilterOperations.h>
9 #include <string> 9 #include <string>
10 10
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 71
72 void setReplicaLayer(scoped_ptr<LayerImpl>); 72 void setReplicaLayer(scoped_ptr<LayerImpl>);
73 LayerImpl* replicaLayer() { return m_replicaLayer.get(); } 73 LayerImpl* replicaLayer() { return m_replicaLayer.get(); }
74 const LayerImpl* replicaLayer() const { return m_replicaLayer.get(); } 74 const LayerImpl* replicaLayer() const { return m_replicaLayer.get(); }
75 75
76 bool hasMask() const { return m_maskLayer; } 76 bool hasMask() const { return m_maskLayer; }
77 bool hasReplica() const { return m_replicaLayer; } 77 bool hasReplica() const { return m_replicaLayer; }
78 bool replicaHasMask() const { return m_replicaLayer && (m_maskLayer || m_rep licaLayer->m_maskLayer); } 78 bool replicaHasMask() const { return m_replicaLayer && (m_maskLayer || m_rep licaLayer->m_maskLayer); }
79 79
80 LayerTreeHostImpl* layerTreeHostImpl() const { return m_layerTreeHostImpl; } 80 LayerTreeHostImpl* layerTreeHostImpl() const { return m_layerTreeHostImpl; }
81 void setLayerTreeHostImpl(LayerTreeHostImpl* hostImpl) { m_layerTreeHostImpl = hostImpl; } 81 void setLayerTreeHostImpl(LayerTreeHostImpl* hostImpl);
82 82
83 scoped_ptr<SharedQuadState> createSharedQuadState() const; 83 scoped_ptr<SharedQuadState> createSharedQuadState() const;
84 // willDraw must be called before appendQuads. If willDraw is called, 84 // willDraw must be called before appendQuads. If willDraw is called,
85 // didDraw is guaranteed to be called before another willDraw or before 85 // didDraw is guaranteed to be called before another willDraw or before
86 // the layer is destroyed. To enforce this, any class that overrides 86 // the layer is destroyed. To enforce this, any class that overrides
87 // willDraw/didDraw must call the base class version. 87 // willDraw/didDraw must call the base class version.
88 virtual void willDraw(ResourceProvider*); 88 virtual void willDraw(ResourceProvider*);
89 virtual void appendQuads(QuadSink&, AppendQuadsData&) { } 89 virtual void appendQuads(QuadSink&, AppendQuadsData&) { }
90 virtual void didDraw(ResourceProvider*); 90 virtual void didDraw(ResourceProvider*);
91 91
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 154
155 void setSublayerTransform(const gfx::Transform&); 155 void setSublayerTransform(const gfx::Transform&);
156 const gfx::Transform& sublayerTransform() const { return m_sublayerTransform ; } 156 const gfx::Transform& sublayerTransform() const { return m_sublayerTransform ; }
157 157
158 // Debug layer name. 158 // Debug layer name.
159 void setDebugName(const std::string& debugName) { m_debugName = debugName; } 159 void setDebugName(const std::string& debugName) { m_debugName = debugName; }
160 std::string debugName() const { return m_debugName; } 160 std::string debugName() const { return m_debugName; }
161 161
162 bool showDebugBorders() const; 162 bool showDebugBorders() const;
163 163
164 // Creating and destroying render surfaces should only be performed by
danakj 2012/12/06 19:12:10 I'm not sure about the destroying part here? Won't
enne (OOO) 2012/12/06 19:25:42 So, here's my thought process. Setting a draw pro
165 // calcDrawProperties.
164 void createRenderSurface(); 166 void createRenderSurface();
165 void clearRenderSurface() { m_drawProperties.render_surface.reset(); } 167 void clearRenderSurface() { m_drawProperties.render_surface.reset(); }
166 168
167 DrawProperties<LayerImpl, RenderSurfaceImpl>& drawProperties() { return m_dr awProperties; } 169 DrawProperties<LayerImpl, RenderSurfaceImpl>& drawProperties() { return m_dr awProperties; }
168 const DrawProperties<LayerImpl, RenderSurfaceImpl>& drawProperties() const { return m_drawProperties; } 170 const DrawProperties<LayerImpl, RenderSurfaceImpl>& drawProperties() const { return m_drawProperties; }
169 171
170 // The following are shortcut accessors to get various information from m_dr awProperties 172 // The following are shortcut accessors to get various information from m_dr awProperties
171 const gfx::Transform& drawTransform() const { return m_drawProperties.target _space_transform; } 173 const gfx::Transform& drawTransform() const { return m_drawProperties.target _space_transform; }
172 const gfx::Transform& screenSpaceTransform() const { return m_drawProperties .screen_space_transform; } 174 const gfx::Transform& screenSpaceTransform() const { return m_drawProperties .screen_space_transform; }
173 float drawOpacity() const { return m_drawProperties.opacity; } 175 float drawOpacity() const { return m_drawProperties.opacity; }
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 void appendDebugBorderQuad(QuadSink&, const SharedQuadState*, AppendQuadsDat a&) const; 290 void appendDebugBorderQuad(QuadSink&, const SharedQuadState*, AppendQuadsDat a&) const;
289 291
290 virtual void dumpLayerProperties(std::string*, int indent) const; 292 virtual void dumpLayerProperties(std::string*, int indent) const;
291 static std::string indentString(int indent); 293 static std::string indentString(int indent);
292 294
293 private: 295 private:
294 void setParent(LayerImpl* parent) { m_parent = parent; } 296 void setParent(LayerImpl* parent) { m_parent = parent; }
295 friend class TreeSynchronizer; 297 friend class TreeSynchronizer;
296 void clearChildList(); // Warning: This does not preserve tree structure inv ariants and so is only exposed to the tree synchronizer. 298 void clearChildList(); // Warning: This does not preserve tree structure inv ariants and so is only exposed to the tree synchronizer.
297 299
300 void noteLayerSurfacePropertyChanged();
301 void noteLayerPropertyChanged();
298 void noteLayerPropertyChangedForSubtree(); 302 void noteLayerPropertyChangedForSubtree();
299 303
300 // Note carefully this does not affect the current layer. 304 // Note carefully this does not affect the current layer.
301 void noteLayerPropertyChangedForDescendants(); 305 void noteLayerPropertyChangedForDescendants();
302 306
303 virtual const char* layerTypeAsString() const; 307 virtual const char* layerTypeAsString() const;
304 308
305 void dumpLayer(std::string*, int indent) const; 309 void dumpLayer(std::string*, int indent) const;
306 310
307 // Properties internal to LayerImpl 311 // Properties internal to LayerImpl
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 DrawProperties<LayerImpl, RenderSurfaceImpl> m_drawProperties; 401 DrawProperties<LayerImpl, RenderSurfaceImpl> m_drawProperties;
398 402
399 DISALLOW_COPY_AND_ASSIGN(LayerImpl); 403 DISALLOW_COPY_AND_ASSIGN(LayerImpl);
400 }; 404 };
401 405
402 void sortLayers(std::vector<LayerImpl*>::iterator first, std::vector<LayerImpl*> ::iterator end, LayerSorter*); 406 void sortLayers(std::vector<LayerImpl*>::iterator first, std::vector<LayerImpl*> ::iterator end, LayerSorter*);
403 407
404 } 408 }
405 409
406 #endif // CC_LAYER_IMPL_H_ 410 #endif // CC_LAYER_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | cc/layer_impl.cc » ('j') | cc/layer_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698