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 #include "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "CCLayerTreeHostImpl.h" | 7 #include "CCLayerTreeHostImpl.h" |
8 | 8 |
9 #include "CCAppendQuadsData.h" | 9 #include "CCAppendQuadsData.h" |
10 #include "CCDamageTracker.h" | 10 #include "CCDamageTracker.h" |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 // in the future. | 284 // in the future. |
285 bool drawFrame = true; | 285 bool drawFrame = true; |
286 | 286 |
287 CCLayerIteratorType end = CCLayerIteratorType::end(frame.renderSurfaceLayerL
ist); | 287 CCLayerIteratorType end = CCLayerIteratorType::end(frame.renderSurfaceLayerL
ist); |
288 for (CCLayerIteratorType it = CCLayerIteratorType::begin(frame.renderSurface
LayerList); it != end; ++it) { | 288 for (CCLayerIteratorType it = CCLayerIteratorType::begin(frame.renderSurface
LayerList); it != end; ++it) { |
289 CCRenderPass::Id targetRenderPassId = it.targetRenderSurfaceLayer()->ren
derSurface()->renderPassId(); | 289 CCRenderPass::Id targetRenderPassId = it.targetRenderSurfaceLayer()->ren
derSurface()->renderPassId(); |
290 CCRenderPass* targetRenderPass = frame.renderPassesById.get(targetRender
PassId); | 290 CCRenderPass* targetRenderPass = frame.renderPassesById.get(targetRender
PassId); |
291 | 291 |
292 occlusionTracker.enterLayer(it); | 292 occlusionTracker.enterLayer(it); |
293 | 293 |
294 CCAppendQuadsData appendQuadsData; | 294 CCAppendQuadsData appendQuadsData(targetRenderPass->id()); |
295 | 295 |
296 if (it.representsContributingRenderSurface()) { | 296 if (it.representsContributingRenderSurface()) { |
297 CCRenderPass::Id contributingRenderPassId = it->renderSurface()->ren
derPassId(); | 297 CCRenderPass::Id contributingRenderPassId = it->renderSurface()->ren
derPassId(); |
298 CCRenderPass* contributingRenderPass = frame.renderPassesById.get(co
ntributingRenderPassId); | 298 CCRenderPass* contributingRenderPass = frame.renderPassesById.get(co
ntributingRenderPassId); |
299 targetRenderPass->appendQuadsForRenderSurfaceLayer(*it, contributing
RenderPass, &occlusionTracker, appendQuadsData); | 299 targetRenderPass->appendQuadsForRenderSurfaceLayer(*it, contributing
RenderPass, &occlusionTracker, appendQuadsData); |
300 } else if (it.representsItself() && !it->visibleContentRect().isEmpty())
{ | 300 } else if (it.representsItself() && !it->visibleContentRect().isEmpty())
{ |
301 bool hasOcclusionFromOutsideTargetSurface; | 301 bool hasOcclusionFromOutsideTargetSurface; |
302 if (occlusionTracker.occluded(*it, it->visibleContentRect(), &hasOcc
lusionFromOutsideTargetSurface)) | 302 if (occlusionTracker.occluded(*it, it->visibleContentRect(), &hasOcc
lusionFromOutsideTargetSurface)) |
303 appendQuadsData.hadOcclusionFromOutsideTargetSurface |= hasOcclu
sionFromOutsideTargetSurface; | 303 appendQuadsData.hadOcclusionFromOutsideTargetSurface |= hasOcclu
sionFromOutsideTargetSurface; |
304 else { | 304 else { |
305 it->willDraw(m_resourceProvider.get()); | 305 it->willDraw(m_resourceProvider.get()); |
306 frame.willDrawLayers.append(*it); | 306 frame.willDrawLayers.append(*it); |
| 307 |
| 308 if (it->hasContributingDelegatedRenderPasses()) { |
| 309 CCRenderPass::Id contributingRenderPassId = it->firstContrib
utingRenderPassId(); |
| 310 while (frame.renderPassesById.contains(contributingRenderPas
sId)) { |
| 311 CCRenderPass* renderPass = frame.renderPassesById.get(co
ntributingRenderPassId); |
| 312 |
| 313 CCAppendQuadsData appendQuadsData(renderPass->id()); |
| 314 renderPass->appendQuadsForLayer(*it, &occlusionTracker,
appendQuadsData); |
| 315 |
| 316 contributingRenderPassId = it->nextContributingRenderPas
sId(contributingRenderPassId); |
| 317 } |
| 318 } |
| 319 |
307 targetRenderPass->appendQuadsForLayer(*it, &occlusionTracker, ap
pendQuadsData); | 320 targetRenderPass->appendQuadsForLayer(*it, &occlusionTracker, ap
pendQuadsData); |
308 } | 321 } |
309 } | 322 } |
310 | 323 |
311 if (appendQuadsData.hadOcclusionFromOutsideTargetSurface) | 324 if (appendQuadsData.hadOcclusionFromOutsideTargetSurface) |
312 targetRenderPass->setHasOcclusionFromOutsideTargetSurface(true); | 325 targetRenderPass->setHasOcclusionFromOutsideTargetSurface(true); |
313 | 326 |
314 if (appendQuadsData.hadMissingTiles) { | 327 if (appendQuadsData.hadMissingTiles) { |
315 bool layerHasAnimatingTransform = it->screenSpaceTransformIsAnimatin
g() || it->drawTransformIsAnimating(); | 328 bool layerHasAnimatingTransform = it->screenSpaceTransformIsAnimatin
g() || it->drawTransformIsAnimating(); |
316 if (layerHasAnimatingTransform) | 329 if (layerHasAnimatingTransform) |
(...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1291 | 1304 |
1292 CCScrollbarAnimationController* scrollbarController = layer->scrollbarAnimat
ionController(); | 1305 CCScrollbarAnimationController* scrollbarController = layer->scrollbarAnimat
ionController(); |
1293 if (scrollbarController && scrollbarController->animate(monotonicTime)) | 1306 if (scrollbarController && scrollbarController->animate(monotonicTime)) |
1294 m_client->setNeedsRedrawOnImplThread(); | 1307 m_client->setNeedsRedrawOnImplThread(); |
1295 | 1308 |
1296 for (size_t i = 0; i < layer->children().size(); ++i) | 1309 for (size_t i = 0; i < layer->children().size(); ++i) |
1297 animateScrollbarsRecursive(layer->children()[i], monotonicTime); | 1310 animateScrollbarsRecursive(layer->children()[i], monotonicTime); |
1298 } | 1311 } |
1299 | 1312 |
1300 } // namespace cc | 1313 } // namespace cc |
OLD | NEW |