| 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 CCLayerImpl_h | 5 #ifndef CCLayerImpl_h |
| 6 #define CCLayerImpl_h | 6 #define CCLayerImpl_h |
| 7 | 7 |
| 8 #include "base/logging.h" |
| 9 #include "cc/own_ptr_vector.h" |
| 8 #include "CCInputHandler.h" | 10 #include "CCInputHandler.h" |
| 9 #include "CCLayerAnimationController.h" | 11 #include "CCLayerAnimationController.h" |
| 10 #include "CCRenderPass.h" | 12 #include "CCRenderPass.h" |
| 11 #include "CCRenderSurface.h" | 13 #include "CCRenderSurface.h" |
| 12 #include "CCResourceProvider.h" | 14 #include "CCResourceProvider.h" |
| 13 #include "CCSharedQuadState.h" | 15 #include "CCSharedQuadState.h" |
| 14 #include "FloatRect.h" | 16 #include "FloatRect.h" |
| 15 #include "IntRect.h" | 17 #include "IntRect.h" |
| 16 #include "Region.h" | 18 #include "Region.h" |
| 17 #include "SkColor.h" | 19 #include "SkColor.h" |
| 18 #include "cc/own_ptr_vector.h" | |
| 19 #include <public/WebFilterOperations.h> | 20 #include <public/WebFilterOperations.h> |
| 20 #include <public/WebTransformationMatrix.h> | 21 #include <public/WebTransformationMatrix.h> |
| 21 #include <string> | 22 #include <string> |
| 22 #include <wtf/OwnPtr.h> | 23 #include <wtf/OwnPtr.h> |
| 23 #include <wtf/PassRefPtr.h> | 24 #include <wtf/PassRefPtr.h> |
| 24 #include <wtf/RefCounted.h> | 25 #include <wtf/RefCounted.h> |
| 25 | 26 |
| 26 namespace cc { | 27 namespace cc { |
| 27 | 28 |
| 28 class CCLayerSorter; | 29 class CCLayerSorter; |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 CCRenderSurface* renderSurface() const { return m_renderSurface.get(); } | 156 CCRenderSurface* renderSurface() const { return m_renderSurface.get(); } |
| 156 void createRenderSurface(); | 157 void createRenderSurface(); |
| 157 void clearRenderSurface() { m_renderSurface.clear(); } | 158 void clearRenderSurface() { m_renderSurface.clear(); } |
| 158 | 159 |
| 159 float drawOpacity() const { return m_drawOpacity; } | 160 float drawOpacity() const { return m_drawOpacity; } |
| 160 void setDrawOpacity(float opacity) { m_drawOpacity = opacity; } | 161 void setDrawOpacity(float opacity) { m_drawOpacity = opacity; } |
| 161 | 162 |
| 162 bool drawOpacityIsAnimating() const { return m_drawOpacityIsAnimating; } | 163 bool drawOpacityIsAnimating() const { return m_drawOpacityIsAnimating; } |
| 163 void setDrawOpacityIsAnimating(bool drawOpacityIsAnimating) { m_drawOpacityI
sAnimating = drawOpacityIsAnimating; } | 164 void setDrawOpacityIsAnimating(bool drawOpacityIsAnimating) { m_drawOpacityI
sAnimating = drawOpacityIsAnimating; } |
| 164 | 165 |
| 165 CCLayerImpl* renderTarget() const { ASSERT(!m_renderTarget || m_renderTarget
->renderSurface()); return m_renderTarget; } | 166 CCLayerImpl* renderTarget() const { DCHECK(!m_renderTarget || m_renderTarget
->renderSurface()); return m_renderTarget; } |
| 166 void setRenderTarget(CCLayerImpl* target) { m_renderTarget = target; } | 167 void setRenderTarget(CCLayerImpl* target) { m_renderTarget = target; } |
| 167 | 168 |
| 168 void setBounds(const IntSize&); | 169 void setBounds(const IntSize&); |
| 169 const IntSize& bounds() const { return m_bounds; } | 170 const IntSize& bounds() const { return m_bounds; } |
| 170 | 171 |
| 171 const IntSize& contentBounds() const { return m_contentBounds; } | 172 const IntSize& contentBounds() const { return m_contentBounds; } |
| 172 void setContentBounds(const IntSize&); | 173 void setContentBounds(const IntSize&); |
| 173 | 174 |
| 174 const IntPoint& scrollPosition() const { return m_scrollPosition; } | 175 const IntPoint& scrollPosition() const { return m_scrollPosition; } |
| 175 void setScrollPosition(const IntPoint&); | 176 void setScrollPosition(const IntPoint&); |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 std::string m_debugName; | 363 std::string m_debugName; |
| 363 | 364 |
| 364 WebKit::WebFilterOperations m_filters; | 365 WebKit::WebFilterOperations m_filters; |
| 365 WebKit::WebFilterOperations m_backgroundFilters; | 366 WebKit::WebFilterOperations m_backgroundFilters; |
| 366 | 367 |
| 367 WebKit::WebTransformationMatrix m_drawTransform; | 368 WebKit::WebTransformationMatrix m_drawTransform; |
| 368 WebKit::WebTransformationMatrix m_screenSpaceTransform; | 369 WebKit::WebTransformationMatrix m_screenSpaceTransform; |
| 369 bool m_drawTransformIsAnimating; | 370 bool m_drawTransformIsAnimating; |
| 370 bool m_screenSpaceTransformIsAnimating; | 371 bool m_screenSpaceTransformIsAnimating; |
| 371 | 372 |
| 372 #ifndef NDEBUG | |
| 373 bool m_betweenWillDrawAndDidDraw; | 373 bool m_betweenWillDrawAndDidDraw; |
| 374 #endif | |
| 375 | 374 |
| 376 // Render surface associated with this layer. The layer and its descendants | 375 // Render surface associated with this layer. The layer and its descendants |
| 377 // will render to this surface. | 376 // will render to this surface. |
| 378 OwnPtr<CCRenderSurface> m_renderSurface; | 377 OwnPtr<CCRenderSurface> m_renderSurface; |
| 379 | 378 |
| 380 // Hierarchical bounding rect containing the layer and its descendants. | 379 // Hierarchical bounding rect containing the layer and its descendants. |
| 381 // Uses target surface's space. | 380 // Uses target surface's space. |
| 382 IntRect m_drawableContentRect; | 381 IntRect m_drawableContentRect; |
| 383 | 382 |
| 384 // Rect indicating what was repainted/updated during update. | 383 // Rect indicating what was repainted/updated during update. |
| 385 // Note that plugin layers bypass this and leave it empty. | 384 // Note that plugin layers bypass this and leave it empty. |
| 386 // Uses layer's content space. | 385 // Uses layer's content space. |
| 387 FloatRect m_updateRect; | 386 FloatRect m_updateRect; |
| 388 | 387 |
| 389 // Manages animations for this layer. | 388 // Manages animations for this layer. |
| 390 OwnPtr<CCLayerAnimationController> m_layerAnimationController; | 389 OwnPtr<CCLayerAnimationController> m_layerAnimationController; |
| 391 | 390 |
| 392 // Manages scrollbars for this layer | 391 // Manages scrollbars for this layer |
| 393 OwnPtr<CCScrollbarAnimationController> m_scrollbarAnimationController; | 392 OwnPtr<CCScrollbarAnimationController> m_scrollbarAnimationController; |
| 394 }; | 393 }; |
| 395 | 394 |
| 396 void sortLayers(std::vector<CCLayerImpl*>::iterator first, std::vector<CCLayerIm
pl*>::iterator end, CCLayerSorter*); | 395 void sortLayers(std::vector<CCLayerImpl*>::iterator first, std::vector<CCLayerIm
pl*>::iterator end, CCLayerSorter*); |
| 397 | 396 |
| 398 } | 397 } |
| 399 | 398 |
| 400 #endif // CCLayerImpl_h | 399 #endif // CCLayerImpl_h |
| OLD | NEW |