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. |
254 | 255 |
255 { | 256 { |
256 TRACE_EVENT0("cc", "CCLayerTreeHostImpl::calcDrawEtc"); | 257 TRACE_EVENT0("cc", "CCLayerTreeHostImpl::calcDrawEtc"); |
257 CCLayerTreeHostCommon::calculateDrawTransforms(m_rootLayerImpl.get(), de
viceViewportSize(), m_deviceScaleFactor, &m_layerSorter, layerRendererCapabiliti
es().maxTextureSize, renderSurfaceLayerList); | 258 CCLayerTreeHostCommon::calculateDrawTransforms(m_rootLayerImpl.get(), de
viceViewportSize(), m_deviceScaleFactor, &m_layerSorter, layerRendererCapabiliti
es().maxTextureSize, renderSurfaceLayerList); |
258 | 259 |
259 trackDamageForAllSurfaces(m_rootLayerImpl.get(), renderSurfaceLayerList)
; | 260 trackDamageForAllSurfaces(m_rootLayerImpl.get(), renderSurfaceLayerList)
; |
260 | 261 |
261 if (layerRendererCapabilities().usingPartialSwap) | 262 if (layerRendererCapabilities().usingPartialSwap) |
262 m_rootScissorRect = m_rootLayerImpl->renderSurface()->damageTracker(
)->currentDamageRect(); | 263 m_rootScissorRect = m_rootLayerImpl->renderSurface()->damageTracker(
)->currentDamageRect(); |
263 else | 264 else |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
817 | 818 |
818 void CCLayerTreeHostImpl::setNeedsRedraw() | 819 void CCLayerTreeHostImpl::setNeedsRedraw() |
819 { | 820 { |
820 m_client->setNeedsRedrawOnImplThread(); | 821 m_client->setNeedsRedrawOnImplThread(); |
821 } | 822 } |
822 | 823 |
823 bool CCLayerTreeHostImpl::ensureRenderSurfaceLayerList() | 824 bool CCLayerTreeHostImpl::ensureRenderSurfaceLayerList() |
824 { | 825 { |
825 if (!m_rootLayerImpl) | 826 if (!m_rootLayerImpl) |
826 return false; | 827 return false; |
| 828 if (!m_layerRenderer) |
| 829 return false; |
827 | 830 |
828 // We need both a non-empty render surface layer list and a root render | 831 // We need both a non-empty render surface layer list and a root render |
829 // surface to be able to iterate over the visible layers. | 832 // surface to be able to iterate over the visible layers. |
830 if (m_renderSurfaceLayerList.size() && m_rootLayerImpl->renderSurface()) | 833 if (m_renderSurfaceLayerList.size() && m_rootLayerImpl->renderSurface()) |
831 return true; | 834 return true; |
832 | 835 |
833 // If we are called after setRootLayer() but before prepareToDraw(), we need | 836 // If we are called after setRootLayer() but before prepareToDraw(), we need |
834 // to recalculate the visible layers. This prevents being unable to scroll | 837 // to recalculate the visible layers. This prevents being unable to scroll |
835 // during part of a commit. | 838 // during part of a commit. |
836 m_renderSurfaceLayerList.clear(); | 839 m_renderSurfaceLayerList.clear(); |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1199 | 1202 |
1200 CCScrollbarAnimationController* scrollbarController = layer->scrollbarAnimat
ionController(); | 1203 CCScrollbarAnimationController* scrollbarController = layer->scrollbarAnimat
ionController(); |
1201 if (scrollbarController && scrollbarController->animate(monotonicTime)) | 1204 if (scrollbarController && scrollbarController->animate(monotonicTime)) |
1202 m_client->setNeedsRedrawOnImplThread(); | 1205 m_client->setNeedsRedrawOnImplThread(); |
1203 | 1206 |
1204 for (size_t i = 0; i < layer->children().size(); ++i) | 1207 for (size_t i = 0; i < layer->children().size(); ++i) |
1205 animateScrollbarsRecursive(layer->children()[i].get(), monotonicTime); | 1208 animateScrollbarsRecursive(layer->children()[i].get(), monotonicTime); |
1206 } | 1209 } |
1207 | 1210 |
1208 } // namespace WebCore | 1211 } // namespace WebCore |
OLD | NEW |