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