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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 | 144 |
145 void setFixedToContainerLayer(bool fixedToContainerLayer = true) { m_fixedTo
ContainerLayer = fixedToContainerLayer;} | 145 void setFixedToContainerLayer(bool fixedToContainerLayer = true) { m_fixedTo
ContainerLayer = fixedToContainerLayer;} |
146 bool fixedToContainerLayer() const { return m_fixedToContainerLayer; } | 146 bool fixedToContainerLayer() const { return m_fixedToContainerLayer; } |
147 | 147 |
148 void setPreserves3D(bool); | 148 void setPreserves3D(bool); |
149 bool preserves3D() const { return m_preserves3D; } | 149 bool preserves3D() const { return m_preserves3D; } |
150 | 150 |
151 void setUseParentBackfaceVisibility(bool useParentBackfaceVisibility) { m_us
eParentBackfaceVisibility = useParentBackfaceVisibility; } | 151 void setUseParentBackfaceVisibility(bool useParentBackfaceVisibility) { m_us
eParentBackfaceVisibility = useParentBackfaceVisibility; } |
152 bool useParentBackfaceVisibility() const { return m_useParentBackfaceVisibil
ity; } | 152 bool useParentBackfaceVisibility() const { return m_useParentBackfaceVisibil
ity; } |
153 | 153 |
154 void setUseLCDText(bool useLCDText) { m_useLCDText = useLCDText; } | 154 void setCanUseLCDText(bool useLCDText) { m_canUseLCDText = useLCDText; } |
155 bool useLCDText() const { return m_useLCDText; } | 155 bool canUseLCDText() const { return m_canUseLCDText; } |
156 | 156 |
157 void setSublayerTransform(const gfx::Transform&); | 157 void setSublayerTransform(const gfx::Transform&); |
158 const gfx::Transform& sublayerTransform() const { return m_sublayerTransform
; } | 158 const gfx::Transform& sublayerTransform() const { return m_sublayerTransform
; } |
159 | 159 |
160 // Debug layer name. | 160 // Debug layer name. |
161 void setDebugName(const std::string& debugName) { m_debugName = debugName; } | 161 void setDebugName(const std::string& debugName) { m_debugName = debugName; } |
162 std::string debugName() const { return m_debugName; } | 162 std::string debugName() const { return m_debugName; } |
163 | 163 |
164 bool showDebugBorders() const; | 164 bool showDebugBorders() const; |
165 | 165 |
166 // These invalidate the host's render surface layer list. The caller | 166 // These invalidate the host's render surface layer list. The caller |
167 // is responsible for calling setNeedsUpdateDrawProperties on the host | 167 // is responsible for calling setNeedsUpdateDrawProperties on the host |
168 // so that its list can be recreated. | 168 // so that its list can be recreated. |
169 void createRenderSurface(); | 169 void createRenderSurface(); |
170 void clearRenderSurface() { m_drawProperties.render_surface.reset(); } | 170 void clearRenderSurface() { m_drawProperties.render_surface.reset(); } |
171 | 171 |
172 DrawProperties<LayerImpl, RenderSurfaceImpl>& drawProperties() { return m_dr
awProperties; } | 172 DrawProperties<LayerImpl, RenderSurfaceImpl>& drawProperties() { return m_dr
awProperties; } |
173 const DrawProperties<LayerImpl, RenderSurfaceImpl>& drawProperties() const {
return m_drawProperties; } | 173 const DrawProperties<LayerImpl, RenderSurfaceImpl>& drawProperties() const {
return m_drawProperties; } |
174 | 174 |
175 // The following are shortcut accessors to get various information from m_dr
awProperties | 175 // The following are shortcut accessors to get various information from m_dr
awProperties |
176 const gfx::Transform& drawTransform() const { return m_drawProperties.target
_space_transform; } | 176 const gfx::Transform& drawTransform() const { return m_drawProperties.target
_space_transform; } |
177 const gfx::Transform& screenSpaceTransform() const { return m_drawProperties
.screen_space_transform; } | 177 const gfx::Transform& screenSpaceTransform() const { return m_drawProperties
.screen_space_transform; } |
178 float drawOpacity() const { return m_drawProperties.opacity; } | 178 float drawOpacity() const { return m_drawProperties.opacity; } |
179 bool drawOpacityIsAnimating() const { return m_drawProperties.opacity_is_ani
mating; } | 179 bool drawOpacityIsAnimating() const { return m_drawProperties.opacity_is_ani
mating; } |
180 bool drawTransformIsAnimating() const { return m_drawProperties.target_space
_transform_is_animating; } | 180 bool drawTransformIsAnimating() const { return m_drawProperties.target_space
_transform_is_animating; } |
181 bool screenSpaceTransformIsAnimating() const { return m_drawProperties.scree
n_space_transform_is_animating; } | 181 bool screenSpaceTransformIsAnimating() const { return m_drawProperties.scree
n_space_transform_is_animating; } |
| 182 bool screenSpaceOpacityIsAnimating() const { return m_drawProperties.screen_
space_opacity_is_animating; } |
182 bool isClipped() const { return m_drawProperties.is_clipped; } | 183 bool isClipped() const { return m_drawProperties.is_clipped; } |
183 const gfx::Rect& clipRect() const { return m_drawProperties.clip_rect; } | 184 const gfx::Rect& clipRect() const { return m_drawProperties.clip_rect; } |
184 const gfx::Rect& drawableContentRect() const { return m_drawProperties.drawa
ble_content_rect; } | 185 const gfx::Rect& drawableContentRect() const { return m_drawProperties.drawa
ble_content_rect; } |
185 const gfx::Rect& visibleContentRect() const { return m_drawProperties.visibl
e_content_rect; } | 186 const gfx::Rect& visibleContentRect() const { return m_drawProperties.visibl
e_content_rect; } |
186 LayerImpl* renderTarget() { DCHECK(!m_drawProperties.render_target || m_draw
Properties.render_target->renderSurface()); return m_drawProperties.render_targe
t; } | 187 LayerImpl* renderTarget() { DCHECK(!m_drawProperties.render_target || m_draw
Properties.render_target->renderSurface()); return m_drawProperties.render_targe
t; } |
187 const LayerImpl* renderTarget() const { DCHECK(!m_drawProperties.render_targ
et || m_drawProperties.render_target->renderSurface()); return m_drawProperties.
render_target; } | 188 const LayerImpl* renderTarget() const { DCHECK(!m_drawProperties.render_targ
et || m_drawProperties.render_target->renderSurface()); return m_drawProperties.
render_target; } |
188 RenderSurfaceImpl* renderSurface() const { return m_drawProperties.render_su
rface.get(); } | 189 RenderSurfaceImpl* renderSurface() const { return m_drawProperties.render_su
rface.get(); } |
189 | 190 |
190 // The client should be responsible for setting bounds, contentBounds and | 191 // The client should be responsible for setting bounds, contentBounds and |
191 // contentsScale to appropriate values. LayerImpl doesn't calculate any of | 192 // contentsScale to appropriate values. LayerImpl doesn't calculate any of |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 | 353 |
353 bool m_masksToBounds; | 354 bool m_masksToBounds; |
354 bool m_contentsOpaque; | 355 bool m_contentsOpaque; |
355 float m_opacity; | 356 float m_opacity; |
356 gfx::PointF m_position; | 357 gfx::PointF m_position; |
357 bool m_preserves3D; | 358 bool m_preserves3D; |
358 bool m_useParentBackfaceVisibility; | 359 bool m_useParentBackfaceVisibility; |
359 bool m_drawCheckerboardForMissingTiles; | 360 bool m_drawCheckerboardForMissingTiles; |
360 gfx::Transform m_sublayerTransform; | 361 gfx::Transform m_sublayerTransform; |
361 gfx::Transform m_transform; | 362 gfx::Transform m_transform; |
362 bool m_useLCDText; | 363 bool m_canUseLCDText; |
363 | 364 |
364 bool m_drawsContent; | 365 bool m_drawsContent; |
365 bool m_forceRenderSurface; | 366 bool m_forceRenderSurface; |
366 | 367 |
367 // Set for the layer that other layers are fixed to. | 368 // Set for the layer that other layers are fixed to. |
368 bool m_isContainerForFixedPositionLayers; | 369 bool m_isContainerForFixedPositionLayers; |
369 // This is true if the layer should be fixed to the closest ancestor contain
er. | 370 // This is true if the layer should be fixed to the closest ancestor contain
er. |
370 bool m_fixedToContainerLayer; | 371 bool m_fixedToContainerLayer; |
371 | 372 |
372 gfx::Vector2dF m_scrollDelta; | 373 gfx::Vector2dF m_scrollDelta; |
(...skipping 30 matching lines...) Expand all Loading... |
403 // Group of properties that need to be computed based on the layer tree | 404 // Group of properties that need to be computed based on the layer tree |
404 // hierarchy before layers can be drawn. | 405 // hierarchy before layers can be drawn. |
405 DrawProperties<LayerImpl, RenderSurfaceImpl> m_drawProperties; | 406 DrawProperties<LayerImpl, RenderSurfaceImpl> m_drawProperties; |
406 | 407 |
407 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 408 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
408 }; | 409 }; |
409 | 410 |
410 } | 411 } |
411 | 412 |
412 #endif // CC_LAYER_IMPL_H_ | 413 #endif // CC_LAYER_IMPL_H_ |
OLD | NEW |