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