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 "CCActiveGestureAnimation.h" | 9 #include "CCActiveGestureAnimation.h" |
| 10 #include "CCAppendQuadsData.h" |
10 #include "CCDamageTracker.h" | 11 #include "CCDamageTracker.h" |
11 #include "CCDebugRectHistory.h" | 12 #include "CCDebugRectHistory.h" |
12 #include "CCDelayBasedTimeSource.h" | 13 #include "CCDelayBasedTimeSource.h" |
13 #include "CCFontAtlas.h" | 14 #include "CCFontAtlas.h" |
14 #include "CCFrameRateCounter.h" | 15 #include "CCFrameRateCounter.h" |
15 #include "CCHeadsUpDisplayLayerImpl.h" | 16 #include "CCHeadsUpDisplayLayerImpl.h" |
16 #include "CCLayerIterator.h" | 17 #include "CCLayerIterator.h" |
17 #include "CCLayerTreeHost.h" | 18 #include "CCLayerTreeHost.h" |
18 #include "CCLayerTreeHostCommon.h" | 19 #include "CCLayerTreeHostCommon.h" |
19 #include "CCMathUtil.h" | 20 #include "CCMathUtil.h" |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 | 280 |
280 // Typically when we are missing a texture and use a checkerboard quad, we s
till draw the frame. However when the layer being | 281 // Typically when we are missing a texture and use a checkerboard quad, we s
till draw the frame. However when the layer being |
281 // checkerboarded is moving due to an impl-animation, we drop the frame to a
void flashing due to the texture suddenly appearing | 282 // checkerboarded is moving due to an impl-animation, we drop the frame to a
void flashing due to the texture suddenly appearing |
282 // in the future. | 283 // in the future. |
283 bool drawFrame = true; | 284 bool drawFrame = true; |
284 | 285 |
285 CCLayerIteratorType end = CCLayerIteratorType::end(frame.renderSurfaceLayerL
ist); | 286 CCLayerIteratorType end = CCLayerIteratorType::end(frame.renderSurfaceLayerL
ist); |
286 for (CCLayerIteratorType it = CCLayerIteratorType::begin(frame.renderSurface
LayerList); it != end; ++it) { | 287 for (CCLayerIteratorType it = CCLayerIteratorType::begin(frame.renderSurface
LayerList); it != end; ++it) { |
287 int targetRenderPassId = it.targetRenderSurfaceLayer()->id(); | 288 int targetRenderPassId = it.targetRenderSurfaceLayer()->id(); |
288 CCRenderPass* targetRenderPass = frame.renderPassesById.get(targetRender
PassId); | 289 CCRenderPass* targetRenderPass = frame.renderPassesById.get(targetRender
PassId); |
289 bool hadMissingTiles = false; | |
290 | 290 |
291 occlusionTracker.enterLayer(it); | 291 occlusionTracker.enterLayer(it); |
292 | 292 |
| 293 CCAppendQuadsData appendQuadsData; |
| 294 |
293 if (it.representsContributingRenderSurface()) { | 295 if (it.representsContributingRenderSurface()) { |
294 int contributingRenderPassId = it->id(); | 296 int contributingRenderPassId = it->id(); |
295 CCRenderPass* contributingRenderPass = frame.renderPassesById.get(co
ntributingRenderPassId); | 297 CCRenderPass* contributingRenderPass = frame.renderPassesById.get(co
ntributingRenderPassId); |
296 targetRenderPass->appendQuadsForRenderSurfaceLayer(*it, contributing
RenderPass, &occlusionTracker); | 298 targetRenderPass->appendQuadsForRenderSurfaceLayer(*it, contributing
RenderPass, &occlusionTracker, appendQuadsData); |
297 } else if (it.representsItself() && !it->visibleContentRect().isEmpty())
{ | 299 } else if (it.representsItself() && !it->visibleContentRect().isEmpty())
{ |
298 bool hasOcclusionFromOutsideTargetSurface; | 300 bool hasOcclusionFromOutsideTargetSurface; |
299 if (occlusionTracker.occluded(*it, it->visibleContentRect(), &hasOcc
lusionFromOutsideTargetSurface)) { | 301 if (occlusionTracker.occluded(*it, it->visibleContentRect(), &hasOcc
lusionFromOutsideTargetSurface)) |
300 if (hasOcclusionFromOutsideTargetSurface) | 302 appendQuadsData.hadOcclusionFromOutsideTargetSurface |= hasOcclu
sionFromOutsideTargetSurface; |
301 targetRenderPass->setHasOcclusionFromOutsideTargetSurface(ha
sOcclusionFromOutsideTargetSurface); | 303 else { |
302 } else { | |
303 it->willDraw(m_resourceProvider.get()); | 304 it->willDraw(m_resourceProvider.get()); |
304 frame.willDrawLayers.append(*it); | 305 frame.willDrawLayers.append(*it); |
305 targetRenderPass->appendQuadsForLayer(*it, &occlusionTracker, ha
dMissingTiles); | 306 targetRenderPass->appendQuadsForLayer(*it, &occlusionTracker, ap
pendQuadsData); |
306 } | 307 } |
307 } | 308 } |
308 | 309 |
309 if (hadMissingTiles) { | 310 if (appendQuadsData.hadOcclusionFromOutsideTargetSurface) |
| 311 targetRenderPass->setHasOcclusionFromOutsideTargetSurface(true); |
| 312 |
| 313 if (appendQuadsData.hadMissingTiles) { |
310 bool layerHasAnimatingTransform = it->screenSpaceTransformIsAnimatin
g() || it->drawTransformIsAnimating(); | 314 bool layerHasAnimatingTransform = it->screenSpaceTransformIsAnimatin
g() || it->drawTransformIsAnimating(); |
311 if (layerHasAnimatingTransform) | 315 if (layerHasAnimatingTransform) |
312 drawFrame = false; | 316 drawFrame = false; |
313 } | 317 } |
314 | 318 |
315 occlusionTracker.leaveLayer(it); | 319 occlusionTracker.leaveLayer(it); |
316 } | 320 } |
317 | 321 |
318 #if !ASSERT_DISABLED | 322 #if !ASSERT_DISABLED |
319 for (size_t i = 0; i < frame.renderPasses.size(); ++i) { | 323 for (size_t i = 0; i < frame.renderPasses.size(); ++i) { |
(...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1264 | 1268 |
1265 CCScrollbarAnimationController* scrollbarController = layer->scrollbarAnimat
ionController(); | 1269 CCScrollbarAnimationController* scrollbarController = layer->scrollbarAnimat
ionController(); |
1266 if (scrollbarController && scrollbarController->animate(monotonicTime)) | 1270 if (scrollbarController && scrollbarController->animate(monotonicTime)) |
1267 m_client->setNeedsRedrawOnImplThread(); | 1271 m_client->setNeedsRedrawOnImplThread(); |
1268 | 1272 |
1269 for (size_t i = 0; i < layer->children().size(); ++i) | 1273 for (size_t i = 0; i < layer->children().size(); ++i) |
1270 animateScrollbarsRecursive(layer->children()[i].get(), monotonicTime); | 1274 animateScrollbarsRecursive(layer->children()[i].get(), monotonicTime); |
1271 } | 1275 } |
1272 | 1276 |
1273 } // namespace WebCore | 1277 } // namespace WebCore |
OLD | NEW |