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