Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 // These invalidate the host's render surface layer list. The caller | |
| 165 // is responsible for calling setNeedsUpdateDrawProperties on the host | |
| 166 // so that its list can be recreated. | |
|
danakj
2012/12/06 19:32:20
Thanks, this comment is very clear.
| |
| 164 void createRenderSurface(); | 167 void createRenderSurface(); |
| 165 void clearRenderSurface() { m_drawProperties.render_surface.reset(); } | 168 void clearRenderSurface() { m_drawProperties.render_surface.reset(); } |
| 166 | 169 |
| 167 DrawProperties<LayerImpl, RenderSurfaceImpl>& drawProperties() { return m_dr awProperties; } | 170 DrawProperties<LayerImpl, RenderSurfaceImpl>& drawProperties() { return m_dr awProperties; } |
| 168 const DrawProperties<LayerImpl, RenderSurfaceImpl>& drawProperties() const { return m_drawProperties; } | 171 const DrawProperties<LayerImpl, RenderSurfaceImpl>& drawProperties() const { return m_drawProperties; } |
| 169 | 172 |
| 170 // The following are shortcut accessors to get various information from m_dr awProperties | 173 // 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; } | 174 const gfx::Transform& drawTransform() const { return m_drawProperties.target _space_transform; } |
| 172 const gfx::Transform& screenSpaceTransform() const { return m_drawProperties .screen_space_transform; } | 175 const gfx::Transform& screenSpaceTransform() const { return m_drawProperties .screen_space_transform; } |
| 173 float drawOpacity() const { return m_drawProperties.opacity; } | 176 float drawOpacity() const { return m_drawProperties.opacity; } |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 288 void appendDebugBorderQuad(QuadSink&, const SharedQuadState*, AppendQuadsDat a&) const; | 291 void appendDebugBorderQuad(QuadSink&, const SharedQuadState*, AppendQuadsDat a&) const; |
| 289 | 292 |
| 290 virtual void dumpLayerProperties(std::string*, int indent) const; | 293 virtual void dumpLayerProperties(std::string*, int indent) const; |
| 291 static std::string indentString(int indent); | 294 static std::string indentString(int indent); |
| 292 | 295 |
| 293 private: | 296 private: |
| 294 void setParent(LayerImpl* parent) { m_parent = parent; } | 297 void setParent(LayerImpl* parent) { m_parent = parent; } |
| 295 friend class TreeSynchronizer; | 298 friend class TreeSynchronizer; |
| 296 void clearChildList(); // Warning: This does not preserve tree structure inv ariants and so is only exposed to the tree synchronizer. | 299 void clearChildList(); // Warning: This does not preserve tree structure inv ariants and so is only exposed to the tree synchronizer. |
| 297 | 300 |
| 301 void noteLayerSurfacePropertyChanged(); | |
| 302 void noteLayerPropertyChanged(); | |
| 298 void noteLayerPropertyChangedForSubtree(); | 303 void noteLayerPropertyChangedForSubtree(); |
| 299 | 304 |
| 300 // Note carefully this does not affect the current layer. | 305 // Note carefully this does not affect the current layer. |
| 301 void noteLayerPropertyChangedForDescendants(); | 306 void noteLayerPropertyChangedForDescendants(); |
| 302 | 307 |
| 303 virtual const char* layerTypeAsString() const; | 308 virtual const char* layerTypeAsString() const; |
| 304 | 309 |
| 305 void dumpLayer(std::string*, int indent) const; | 310 void dumpLayer(std::string*, int indent) const; |
| 306 | 311 |
| 307 // Properties internal to LayerImpl | 312 // Properties internal to LayerImpl |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 397 DrawProperties<LayerImpl, RenderSurfaceImpl> m_drawProperties; | 402 DrawProperties<LayerImpl, RenderSurfaceImpl> m_drawProperties; |
| 398 | 403 |
| 399 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 404 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
| 400 }; | 405 }; |
| 401 | 406 |
| 402 void sortLayers(std::vector<LayerImpl*>::iterator first, std::vector<LayerImpl*> ::iterator end, LayerSorter*); | 407 void sortLayers(std::vector<LayerImpl*>::iterator first, std::vector<LayerImpl*> ::iterator end, LayerSorter*); |
| 403 | 408 |
| 404 } | 409 } |
| 405 | 410 |
| 406 #endif // CC_LAYER_IMPL_H_ | 411 #endif // CC_LAYER_IMPL_H_ |
| OLD | NEW |