| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 CCRenderSurface* renderSurface = renderSurfaceLayer->renderSurface(); | 244 CCRenderSurface* renderSurface = renderSurfaceLayer->renderSurface(); |
| 245 ASSERT(renderSurface); | 245 ASSERT(renderSurface); |
| 246 renderSurface->damageTracker()->updateDamageTrackingState(renderSurface-
>layerList(), renderSurfaceLayer->id(), renderSurface->surfacePropertyChangedOnl
yFromDescendant(), renderSurface->contentRect(), renderSurfaceLayer->maskLayer()
, renderSurfaceLayer->filters()); | 246 renderSurface->damageTracker()->updateDamageTrackingState(renderSurface-
>layerList(), renderSurfaceLayer->id(), renderSurface->surfacePropertyChangedOnl
yFromDescendant(), renderSurface->contentRect(), renderSurfaceLayer->maskLayer()
, renderSurfaceLayer->filters()); |
| 247 } | 247 } |
| 248 } | 248 } |
| 249 | 249 |
| 250 void CCLayerTreeHostImpl::calculateRenderSurfaceLayerList(CCLayerList& renderSur
faceLayerList) | 250 void CCLayerTreeHostImpl::calculateRenderSurfaceLayerList(CCLayerList& renderSur
faceLayerList) |
| 251 { | 251 { |
| 252 ASSERT(renderSurfaceLayerList.isEmpty()); | 252 ASSERT(renderSurfaceLayerList.isEmpty()); |
| 253 ASSERT(m_rootLayerImpl); | 253 ASSERT(m_rootLayerImpl); |
| 254 ASSERT(m_layerRenderer); // For maxTextureSize. | |
| 255 | 254 |
| 256 { | 255 { |
| 257 TRACE_EVENT0("cc", "CCLayerTreeHostImpl::calcDrawEtc"); | 256 TRACE_EVENT0("cc", "CCLayerTreeHostImpl::calcDrawEtc"); |
| 258 CCLayerTreeHostCommon::calculateDrawTransforms(m_rootLayerImpl.get(), de
viceViewportSize(), m_deviceScaleFactor, &m_layerSorter, layerRendererCapabiliti
es().maxTextureSize, renderSurfaceLayerList); | 257 CCLayerTreeHostCommon::calculateDrawTransforms(m_rootLayerImpl.get(), de
viceViewportSize(), m_deviceScaleFactor, &m_layerSorter, layerRendererCapabiliti
es().maxTextureSize, renderSurfaceLayerList); |
| 259 | 258 |
| 260 trackDamageForAllSurfaces(m_rootLayerImpl.get(), renderSurfaceLayerList)
; | 259 trackDamageForAllSurfaces(m_rootLayerImpl.get(), renderSurfaceLayerList)
; |
| 261 | 260 |
| 262 if (layerRendererCapabilities().usingPartialSwap) | 261 if (layerRendererCapabilities().usingPartialSwap) |
| 263 m_rootScissorRect = m_rootLayerImpl->renderSurface()->damageTracker(
)->currentDamageRect(); | 262 m_rootScissorRect = m_rootLayerImpl->renderSurface()->damageTracker(
)->currentDamageRect(); |
| 264 else | 263 else |
| (...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 818 | 817 |
| 819 void CCLayerTreeHostImpl::setNeedsRedraw() | 818 void CCLayerTreeHostImpl::setNeedsRedraw() |
| 820 { | 819 { |
| 821 m_client->setNeedsRedrawOnImplThread(); | 820 m_client->setNeedsRedrawOnImplThread(); |
| 822 } | 821 } |
| 823 | 822 |
| 824 bool CCLayerTreeHostImpl::ensureRenderSurfaceLayerList() | 823 bool CCLayerTreeHostImpl::ensureRenderSurfaceLayerList() |
| 825 { | 824 { |
| 826 if (!m_rootLayerImpl) | 825 if (!m_rootLayerImpl) |
| 827 return false; | 826 return false; |
| 828 if (!m_layerRenderer) | |
| 829 return false; | |
| 830 | 827 |
| 831 // We need both a non-empty render surface layer list and a root render | 828 // We need both a non-empty render surface layer list and a root render |
| 832 // surface to be able to iterate over the visible layers. | 829 // surface to be able to iterate over the visible layers. |
| 833 if (m_renderSurfaceLayerList.size() && m_rootLayerImpl->renderSurface()) | 830 if (m_renderSurfaceLayerList.size() && m_rootLayerImpl->renderSurface()) |
| 834 return true; | 831 return true; |
| 835 | 832 |
| 836 // If we are called after setRootLayer() but before prepareToDraw(), we need | 833 // If we are called after setRootLayer() but before prepareToDraw(), we need |
| 837 // to recalculate the visible layers. This prevents being unable to scroll | 834 // to recalculate the visible layers. This prevents being unable to scroll |
| 838 // during part of a commit. | 835 // during part of a commit. |
| 839 m_renderSurfaceLayerList.clear(); | 836 m_renderSurfaceLayerList.clear(); |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1202 | 1199 |
| 1203 CCScrollbarAnimationController* scrollbarController = layer->scrollbarAnimat
ionController(); | 1200 CCScrollbarAnimationController* scrollbarController = layer->scrollbarAnimat
ionController(); |
| 1204 if (scrollbarController && scrollbarController->animate(monotonicTime)) | 1201 if (scrollbarController && scrollbarController->animate(monotonicTime)) |
| 1205 m_client->setNeedsRedrawOnImplThread(); | 1202 m_client->setNeedsRedrawOnImplThread(); |
| 1206 | 1203 |
| 1207 for (size_t i = 0; i < layer->children().size(); ++i) | 1204 for (size_t i = 0; i < layer->children().size(); ++i) |
| 1208 animateScrollbarsRecursive(layer->children()[i].get(), monotonicTime); | 1205 animateScrollbarsRecursive(layer->children()[i].get(), monotonicTime); |
| 1209 } | 1206 } |
| 1210 | 1207 |
| 1211 } // namespace WebCore | 1208 } // namespace WebCore |
| OLD | NEW |