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