| 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 <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 | 132 |
| 133 void setFixedToContainerLayer(bool fixedToContainerLayer = true) { m_fixedTo
ContainerLayer = fixedToContainerLayer;} | 133 void setFixedToContainerLayer(bool fixedToContainerLayer = true) { m_fixedTo
ContainerLayer = fixedToContainerLayer;} |
| 134 bool fixedToContainerLayer() const { return m_fixedToContainerLayer; } | 134 bool fixedToContainerLayer() const { return m_fixedToContainerLayer; } |
| 135 | 135 |
| 136 void setPreserves3D(bool); | 136 void setPreserves3D(bool); |
| 137 bool preserves3D() const { return m_preserves3D; } | 137 bool preserves3D() const { return m_preserves3D; } |
| 138 | 138 |
| 139 void setUseParentBackfaceVisibility(bool useParentBackfaceVisibility) { m_us
eParentBackfaceVisibility = useParentBackfaceVisibility; } | 139 void setUseParentBackfaceVisibility(bool useParentBackfaceVisibility) { m_us
eParentBackfaceVisibility = useParentBackfaceVisibility; } |
| 140 bool useParentBackfaceVisibility() const { return m_useParentBackfaceVisibil
ity; } | 140 bool useParentBackfaceVisibility() const { return m_useParentBackfaceVisibil
ity; } |
| 141 | 141 |
| 142 void setUseLCDText(bool useLCDText) { m_useLCDText = useLCDText; } | 142 void setCanUseLCDText(bool useLCDText) { m_canUseLCDText = useLCDText; } |
| 143 bool useLCDText() const { return m_useLCDText; } | 143 bool useCanLCDText() const { return m_canUseLCDText; } |
| 144 | 144 |
| 145 void setSublayerTransform(const WebKit::WebTransformationMatrix&); | 145 void setSublayerTransform(const WebKit::WebTransformationMatrix&); |
| 146 const WebKit::WebTransformationMatrix& sublayerTransform() const { return m_
sublayerTransform; } | 146 const WebKit::WebTransformationMatrix& sublayerTransform() const { return m_
sublayerTransform; } |
| 147 | 147 |
| 148 // Debug layer border - visual effect only, do not change geometry/clipping/
etc. | 148 // Debug layer border - visual effect only, do not change geometry/clipping/
etc. |
| 149 void setDebugBorderColor(SkColor); | 149 void setDebugBorderColor(SkColor); |
| 150 SkColor debugBorderColor() const { return m_debugBorderColor; } | 150 SkColor debugBorderColor() const { return m_debugBorderColor; } |
| 151 void setDebugBorderWidth(float); | 151 void setDebugBorderWidth(float); |
| 152 float debugBorderWidth() const { return m_debugBorderWidth; } | 152 float debugBorderWidth() const { return m_debugBorderWidth; } |
| 153 bool hasDebugBorders() const; | 153 bool hasDebugBorders() const; |
| 154 | 154 |
| 155 // Debug layer name. | 155 // Debug layer name. |
| 156 void setDebugName(const std::string& debugName) { m_debugName = debugName; } | 156 void setDebugName(const std::string& debugName) { m_debugName = debugName; } |
| 157 std::string debugName() const { return m_debugName; } | 157 std::string debugName() const { return m_debugName; } |
| 158 | 158 |
| 159 RenderSurfaceImpl* renderSurface() const { return m_renderSurface.get(); } | 159 RenderSurfaceImpl* renderSurface() const { return m_renderSurface.get(); } |
| 160 void createRenderSurface(); | 160 void createRenderSurface(); |
| 161 void clearRenderSurface() { m_renderSurface.reset(); } | 161 void clearRenderSurface() { m_renderSurface.reset(); } |
| 162 | 162 |
| 163 float drawOpacity() const { return m_drawOpacity; } | 163 float drawOpacity() const { return m_drawOpacity; } |
| 164 void setDrawOpacity(float opacity) { m_drawOpacity = opacity; } | 164 void setDrawOpacity(float opacity) { m_drawOpacity = opacity; } |
| 165 | 165 |
| 166 bool drawOpacityIsAnimating() const { return m_drawOpacityIsAnimating; } | 166 bool drawOpacityIsAnimating() const { return m_drawOpacityIsAnimating; } |
| 167 void setDrawOpacityIsAnimating(bool drawOpacityIsAnimating) { m_drawOpacityI
sAnimating = drawOpacityIsAnimating; } | 167 void setDrawOpacityIsAnimating(bool drawOpacityIsAnimating) { m_drawOpacityI
sAnimating = drawOpacityIsAnimating; } |
| 168 bool screenSpaceOpacityIsAnimating() const { return m_screenSpaceOpacityIsAn
imating; } |
| 169 void setScreenSpaceOpacityIsAnimating(bool animating) { m_screenSpaceOpacity
IsAnimating = animating; } |
| 168 | 170 |
| 169 LayerImpl* renderTarget() const { DCHECK(!m_renderTarget || m_renderTarget->
renderSurface()); return m_renderTarget; } | 171 LayerImpl* renderTarget() const { DCHECK(!m_renderTarget || m_renderTarget->
renderSurface()); return m_renderTarget; } |
| 170 void setRenderTarget(LayerImpl* target) { m_renderTarget = target; } | 172 void setRenderTarget(LayerImpl* target) { m_renderTarget = target; } |
| 171 | 173 |
| 172 // The client should be responsible for setting bounds, contentBounds and | 174 // The client should be responsible for setting bounds, contentBounds and |
| 173 // contentsScale to appropriate values. LayerImpl doesn't calculate any of | 175 // contentsScale to appropriate values. LayerImpl doesn't calculate any of |
| 174 // them from the other values. | 176 // them from the other values. |
| 175 | 177 |
| 176 void setBounds(const gfx::Size&); | 178 void setBounds(const gfx::Size&); |
| 177 const gfx::Size& bounds() const { return m_bounds; } | 179 const gfx::Size& bounds() const { return m_bounds; } |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 gfx::Rect m_visibleContentRect; | 343 gfx::Rect m_visibleContentRect; |
| 342 bool m_masksToBounds; | 344 bool m_masksToBounds; |
| 343 bool m_contentsOpaque; | 345 bool m_contentsOpaque; |
| 344 float m_opacity; | 346 float m_opacity; |
| 345 gfx::PointF m_position; | 347 gfx::PointF m_position; |
| 346 bool m_preserves3D; | 348 bool m_preserves3D; |
| 347 bool m_useParentBackfaceVisibility; | 349 bool m_useParentBackfaceVisibility; |
| 348 bool m_drawCheckerboardForMissingTiles; | 350 bool m_drawCheckerboardForMissingTiles; |
| 349 WebKit::WebTransformationMatrix m_sublayerTransform; | 351 WebKit::WebTransformationMatrix m_sublayerTransform; |
| 350 WebKit::WebTransformationMatrix m_transform; | 352 WebKit::WebTransformationMatrix m_transform; |
| 351 bool m_useLCDText; | 353 bool m_canUseLCDText; |
| 352 | 354 |
| 353 bool m_drawsContent; | 355 bool m_drawsContent; |
| 354 bool m_forceRenderSurface; | 356 bool m_forceRenderSurface; |
| 355 | 357 |
| 356 // Set for the layer that other layers are fixed to. | 358 // Set for the layer that other layers are fixed to. |
| 357 bool m_isContainerForFixedPositionLayers; | 359 bool m_isContainerForFixedPositionLayers; |
| 358 // This is true if the layer should be fixed to the closest ancestor contain
er. | 360 // This is true if the layer should be fixed to the closest ancestor contain
er. |
| 359 bool m_fixedToContainerLayer; | 361 bool m_fixedToContainerLayer; |
| 360 | 362 |
| 361 gfx::Vector2dF m_scrollDelta; | 363 gfx::Vector2dF m_scrollDelta; |
| 362 gfx::Vector2d m_sentScrollDelta; | 364 gfx::Vector2d m_sentScrollDelta; |
| 363 gfx::Vector2d m_maxScrollOffset; | 365 gfx::Vector2d m_maxScrollOffset; |
| 364 WebKit::WebTransformationMatrix m_implTransform; | 366 WebKit::WebTransformationMatrix m_implTransform; |
| 365 | 367 |
| 366 // The layer whose coordinate space this layer draws into. This can be | 368 // The layer whose coordinate space this layer draws into. This can be |
| 367 // either the same layer (m_renderTarget == this) or an ancestor of this | 369 // either the same layer (m_renderTarget == this) or an ancestor of this |
| 368 // layer. | 370 // layer. |
| 369 LayerImpl* m_renderTarget; | 371 LayerImpl* m_renderTarget; |
| 370 | 372 |
| 371 // The global depth value of the center of the layer. This value is used | 373 // The global depth value of the center of the layer. This value is used |
| 372 // to sort layers from back to front. | 374 // to sort layers from back to front. |
| 373 float m_drawDepth; | 375 float m_drawDepth; |
| 374 float m_drawOpacity; | 376 float m_drawOpacity; |
| 375 bool m_drawOpacityIsAnimating; | 377 bool m_drawOpacityIsAnimating; |
| 378 bool m_screenSpaceOpacityIsAnimating; |
| 376 | 379 |
| 377 // Debug borders. | 380 // Debug borders. |
| 378 SkColor m_debugBorderColor; | 381 SkColor m_debugBorderColor; |
| 379 float m_debugBorderWidth; | 382 float m_debugBorderWidth; |
| 380 | 383 |
| 381 // Debug layer name. | 384 // Debug layer name. |
| 382 std::string m_debugName; | 385 std::string m_debugName; |
| 383 | 386 |
| 384 WebKit::WebFilterOperations m_filters; | 387 WebKit::WebFilterOperations m_filters; |
| 385 WebKit::WebFilterOperations m_backgroundFilters; | 388 WebKit::WebFilterOperations m_backgroundFilters; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 414 scoped_ptr<ScrollbarAnimationController> m_scrollbarAnimationController; | 417 scoped_ptr<ScrollbarAnimationController> m_scrollbarAnimationController; |
| 415 | 418 |
| 416 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 419 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
| 417 }; | 420 }; |
| 418 | 421 |
| 419 void sortLayers(std::vector<LayerImpl*>::iterator first, std::vector<LayerImpl*>
::iterator end, LayerSorter*); | 422 void sortLayers(std::vector<LayerImpl*>::iterator first, std::vector<LayerImpl*>
::iterator end, LayerSorter*); |
| 420 | 423 |
| 421 } | 424 } |
| 422 | 425 |
| 423 #endif // CC_LAYER_IMPL_H_ | 426 #endif // CC_LAYER_IMPL_H_ |
| OLD | NEW |