| 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 "CCLayerTreeHost.h" | 7 #include "CCLayerTreeHost.h" |
| 8 | 8 |
| 9 #include "CCFontAtlas.h" | 9 #include "CCFontAtlas.h" |
| 10 #include "CCGraphicsContext.h" | 10 #include "CCGraphicsContext.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 , m_deviceScaleFactor(1) | 104 , m_deviceScaleFactor(1) |
| 105 , m_visible(true) | 105 , m_visible(true) |
| 106 , m_pageScaleFactor(1) | 106 , m_pageScaleFactor(1) |
| 107 , m_minPageScaleFactor(1) | 107 , m_minPageScaleFactor(1) |
| 108 , m_maxPageScaleFactor(1) | 108 , m_maxPageScaleFactor(1) |
| 109 , m_triggerIdleUpdates(true) | 109 , m_triggerIdleUpdates(true) |
| 110 , m_backgroundColor(SK_ColorWHITE) | 110 , m_backgroundColor(SK_ColorWHITE) |
| 111 , m_hasTransparentBackground(false) | 111 , m_hasTransparentBackground(false) |
| 112 , m_partialTextureUpdateRequests(0) | 112 , m_partialTextureUpdateRequests(0) |
| 113 { | 113 { |
| 114 ASSERT(CCProxy::isMainThread()); | 114 DCHECK(CCProxy::isMainThread()); |
| 115 numLayerTreeInstances++; | 115 numLayerTreeInstances++; |
| 116 } | 116 } |
| 117 | 117 |
| 118 bool CCLayerTreeHost::initialize() | 118 bool CCLayerTreeHost::initialize() |
| 119 { | 119 { |
| 120 TRACE_EVENT0("cc", "CCLayerTreeHost::initialize"); | 120 TRACE_EVENT0("cc", "CCLayerTreeHost::initialize"); |
| 121 | 121 |
| 122 if (CCProxy::hasImplThread()) | 122 if (CCProxy::hasImplThread()) |
| 123 m_proxy = CCThreadProxy::create(this); | 123 m_proxy = CCThreadProxy::create(this); |
| 124 else | 124 else |
| 125 m_proxy = CCSingleThreadProxy::create(this); | 125 m_proxy = CCSingleThreadProxy::create(this); |
| 126 m_proxy->start(); | 126 m_proxy->start(); |
| 127 | 127 |
| 128 return m_proxy->initializeContext(); | 128 return m_proxy->initializeContext(); |
| 129 } | 129 } |
| 130 | 130 |
| 131 CCLayerTreeHost::~CCLayerTreeHost() | 131 CCLayerTreeHost::~CCLayerTreeHost() |
| 132 { | 132 { |
| 133 if (m_rootLayer) | 133 if (m_rootLayer) |
| 134 m_rootLayer->setLayerTreeHost(0); | 134 m_rootLayer->setLayerTreeHost(0); |
| 135 ASSERT(CCProxy::isMainThread()); | 135 DCHECK(CCProxy::isMainThread()); |
| 136 TRACE_EVENT0("cc", "CCLayerTreeHost::~CCLayerTreeHost"); | 136 TRACE_EVENT0("cc", "CCLayerTreeHost::~CCLayerTreeHost"); |
| 137 ASSERT(m_proxy.get()); | 137 DCHECK(m_proxy.get()); |
| 138 m_proxy->stop(); | 138 m_proxy->stop(); |
| 139 m_proxy.reset(); | 139 m_proxy.reset(); |
| 140 numLayerTreeInstances--; | 140 numLayerTreeInstances--; |
| 141 RateLimiterMap::iterator it = m_rateLimiters.begin(); | 141 RateLimiterMap::iterator it = m_rateLimiters.begin(); |
| 142 if (it != m_rateLimiters.end()) | 142 if (it != m_rateLimiters.end()) |
| 143 it->second->stop(); | 143 it->second->stop(); |
| 144 } | 144 } |
| 145 | 145 |
| 146 void CCLayerTreeHost::setSurfaceReady() | 146 void CCLayerTreeHost::setSurfaceReady() |
| 147 { | 147 { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 170 | 170 |
| 171 m_settings.defaultTileSize = IntSize(min(m_settings.defaultTileSize.width(),
m_proxy->rendererCapabilities().maxTextureSize), | 171 m_settings.defaultTileSize = IntSize(min(m_settings.defaultTileSize.width(),
m_proxy->rendererCapabilities().maxTextureSize), |
| 172 min(m_settings.defaultTileSize.height()
, m_proxy->rendererCapabilities().maxTextureSize)); | 172 min(m_settings.defaultTileSize.height()
, m_proxy->rendererCapabilities().maxTextureSize)); |
| 173 m_settings.maxUntiledLayerSize = IntSize(min(m_settings.maxUntiledLayerSize.
width(), m_proxy->rendererCapabilities().maxTextureSize), | 173 m_settings.maxUntiledLayerSize = IntSize(min(m_settings.maxUntiledLayerSize.
width(), m_proxy->rendererCapabilities().maxTextureSize), |
| 174 min(m_settings.maxUntiledLayerSize.
height(), m_proxy->rendererCapabilities().maxTextureSize)); | 174 min(m_settings.maxUntiledLayerSize.
height(), m_proxy->rendererCapabilities().maxTextureSize)); |
| 175 } | 175 } |
| 176 | 176 |
| 177 CCLayerTreeHost::RecreateResult CCLayerTreeHost::recreateContext() | 177 CCLayerTreeHost::RecreateResult CCLayerTreeHost::recreateContext() |
| 178 { | 178 { |
| 179 TRACE_EVENT0("cc", "CCLayerTreeHost::recreateContext"); | 179 TRACE_EVENT0("cc", "CCLayerTreeHost::recreateContext"); |
| 180 ASSERT(m_contextLost); | 180 DCHECK(m_contextLost); |
| 181 | 181 |
| 182 bool recreated = false; | 182 bool recreated = false; |
| 183 if (!m_numTimesRecreateShouldFail) | 183 if (!m_numTimesRecreateShouldFail) |
| 184 recreated = m_proxy->recreateContext(); | 184 recreated = m_proxy->recreateContext(); |
| 185 else | 185 else |
| 186 m_numTimesRecreateShouldFail--; | 186 m_numTimesRecreateShouldFail--; |
| 187 | 187 |
| 188 if (recreated) { | 188 if (recreated) { |
| 189 m_client->didRecreateOutputSurface(true); | 189 m_client->didRecreateOutputSurface(true); |
| 190 m_contextLost = false; | 190 m_contextLost = false; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 204 } | 204 } |
| 205 | 205 |
| 206 // We have tried too many times to recreate the context. Tell the host to fa
ll | 206 // We have tried too many times to recreate the context. Tell the host to fa
ll |
| 207 // back to software rendering. | 207 // back to software rendering. |
| 208 m_client->didRecreateOutputSurface(false); | 208 m_client->didRecreateOutputSurface(false); |
| 209 return RecreateFailedAndGaveUp; | 209 return RecreateFailedAndGaveUp; |
| 210 } | 210 } |
| 211 | 211 |
| 212 void CCLayerTreeHost::deleteContentsTexturesOnImplThread(CCResourceProvider* res
ourceProvider) | 212 void CCLayerTreeHost::deleteContentsTexturesOnImplThread(CCResourceProvider* res
ourceProvider) |
| 213 { | 213 { |
| 214 ASSERT(CCProxy::isImplThread()); | 214 DCHECK(CCProxy::isImplThread()); |
| 215 if (m_rendererInitialized) | 215 if (m_rendererInitialized) |
| 216 m_contentsTextureManager->clearAllMemory(resourceProvider); | 216 m_contentsTextureManager->clearAllMemory(resourceProvider); |
| 217 } | 217 } |
| 218 | 218 |
| 219 void CCLayerTreeHost::acquireLayerTextures() | 219 void CCLayerTreeHost::acquireLayerTextures() |
| 220 { | 220 { |
| 221 ASSERT(CCProxy::isMainThread()); | 221 DCHECK(CCProxy::isMainThread()); |
| 222 m_proxy->acquireLayerTextures(); | 222 m_proxy->acquireLayerTextures(); |
| 223 } | 223 } |
| 224 | 224 |
| 225 void CCLayerTreeHost::updateAnimations(double monotonicFrameBeginTime) | 225 void CCLayerTreeHost::updateAnimations(double monotonicFrameBeginTime) |
| 226 { | 226 { |
| 227 m_animating = true; | 227 m_animating = true; |
| 228 m_client->animate(monotonicFrameBeginTime); | 228 m_client->animate(monotonicFrameBeginTime); |
| 229 animateLayers(monotonicFrameBeginTime); | 229 animateLayers(monotonicFrameBeginTime); |
| 230 m_animating = false; | 230 m_animating = false; |
| 231 | 231 |
| 232 m_renderingStats.numAnimationFrames++; | 232 m_renderingStats.numAnimationFrames++; |
| 233 } | 233 } |
| 234 | 234 |
| 235 void CCLayerTreeHost::layout() | 235 void CCLayerTreeHost::layout() |
| 236 { | 236 { |
| 237 m_client->layout(); | 237 m_client->layout(); |
| 238 } | 238 } |
| 239 | 239 |
| 240 void CCLayerTreeHost::beginCommitOnImplThread(CCLayerTreeHostImpl* hostImpl) | 240 void CCLayerTreeHost::beginCommitOnImplThread(CCLayerTreeHostImpl* hostImpl) |
| 241 { | 241 { |
| 242 ASSERT(CCProxy::isImplThread()); | 242 DCHECK(CCProxy::isImplThread()); |
| 243 TRACE_EVENT0("cc", "CCLayerTreeHost::commitTo"); | 243 TRACE_EVENT0("cc", "CCLayerTreeHost::commitTo"); |
| 244 } | 244 } |
| 245 | 245 |
| 246 // This function commits the CCLayerTreeHost to an impl tree. When modifying | 246 // This function commits the CCLayerTreeHost to an impl tree. When modifying |
| 247 // this function, keep in mind that the function *runs* on the impl thread! Any | 247 // this function, keep in mind that the function *runs* on the impl thread! Any |
| 248 // code that is logically a main thread operation, e.g. deletion of a LayerChrom
ium, | 248 // code that is logically a main thread operation, e.g. deletion of a LayerChrom
ium, |
| 249 // should be delayed until the CCLayerTreeHost::commitComplete, which will run | 249 // should be delayed until the CCLayerTreeHost::commitComplete, which will run |
| 250 // after the commit, but on the main thread. | 250 // after the commit, but on the main thread. |
| 251 void CCLayerTreeHost::finishCommitOnImplThread(CCLayerTreeHostImpl* hostImpl) | 251 void CCLayerTreeHost::finishCommitOnImplThread(CCLayerTreeHostImpl* hostImpl) |
| 252 { | 252 { |
| 253 ASSERT(CCProxy::isImplThread()); | 253 DCHECK(CCProxy::isImplThread()); |
| 254 | 254 |
| 255 m_contentsTextureManager->updateBackingsInDrawingImplTree(); | 255 m_contentsTextureManager->updateBackingsInDrawingImplTree(); |
| 256 m_contentsTextureManager->reduceMemory(hostImpl->resourceProvider()); | 256 m_contentsTextureManager->reduceMemory(hostImpl->resourceProvider()); |
| 257 | 257 |
| 258 hostImpl->setRootLayer(TreeSynchronizer::synchronizeTrees(rootLayer(), hostI
mpl->detachLayerTree(), hostImpl)); | 258 hostImpl->setRootLayer(TreeSynchronizer::synchronizeTrees(rootLayer(), hostI
mpl->detachLayerTree(), hostImpl)); |
| 259 | 259 |
| 260 if (m_rootLayer && m_hudLayer) | 260 if (m_rootLayer && m_hudLayer) |
| 261 hostImpl->setHudLayer(static_cast<CCHeadsUpDisplayLayerImpl*>(CCLayerTre
eHostCommon::findLayerInSubtree(hostImpl->rootLayer(), m_hudLayer->id()))); | 261 hostImpl->setHudLayer(static_cast<CCHeadsUpDisplayLayerImpl*>(CCLayerTre
eHostCommon::findLayerInSubtree(hostImpl->rootLayer(), m_hudLayer->id()))); |
| 262 else | 262 else |
| 263 hostImpl->setHudLayer(0); | 263 hostImpl->setHudLayer(0); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 } | 315 } |
| 316 | 316 |
| 317 scoped_ptr<CCLayerTreeHostImpl> CCLayerTreeHost::createLayerTreeHostImpl(CCLayer
TreeHostImplClient* client) | 317 scoped_ptr<CCLayerTreeHostImpl> CCLayerTreeHost::createLayerTreeHostImpl(CCLayer
TreeHostImplClient* client) |
| 318 { | 318 { |
| 319 return CCLayerTreeHostImpl::create(m_settings, client); | 319 return CCLayerTreeHostImpl::create(m_settings, client); |
| 320 } | 320 } |
| 321 | 321 |
| 322 void CCLayerTreeHost::didLoseContext() | 322 void CCLayerTreeHost::didLoseContext() |
| 323 { | 323 { |
| 324 TRACE_EVENT0("cc", "CCLayerTreeHost::didLoseContext"); | 324 TRACE_EVENT0("cc", "CCLayerTreeHost::didLoseContext"); |
| 325 ASSERT(CCProxy::isMainThread()); | 325 DCHECK(CCProxy::isMainThread()); |
| 326 m_contextLost = true; | 326 m_contextLost = true; |
| 327 m_numFailedRecreateAttempts = 0; | 327 m_numFailedRecreateAttempts = 0; |
| 328 setNeedsCommit(); | 328 setNeedsCommit(); |
| 329 } | 329 } |
| 330 | 330 |
| 331 bool CCLayerTreeHost::compositeAndReadback(void *pixels, const IntRect& rect) | 331 bool CCLayerTreeHost::compositeAndReadback(void *pixels, const IntRect& rect) |
| 332 { | 332 { |
| 333 m_triggerIdleUpdates = false; | 333 m_triggerIdleUpdates = false; |
| 334 bool ret = m_proxy->compositeAndReadback(pixels, rect); | 334 bool ret = m_proxy->compositeAndReadback(pixels, rect); |
| 335 m_triggerIdleUpdates = true; | 335 m_triggerIdleUpdates = true; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 349 m_proxy->renderingStats(stats); | 349 m_proxy->renderingStats(stats); |
| 350 } | 350 } |
| 351 | 351 |
| 352 const RendererCapabilities& CCLayerTreeHost::rendererCapabilities() const | 352 const RendererCapabilities& CCLayerTreeHost::rendererCapabilities() const |
| 353 { | 353 { |
| 354 return m_proxy->rendererCapabilities(); | 354 return m_proxy->rendererCapabilities(); |
| 355 } | 355 } |
| 356 | 356 |
| 357 void CCLayerTreeHost::setNeedsAnimate() | 357 void CCLayerTreeHost::setNeedsAnimate() |
| 358 { | 358 { |
| 359 ASSERT(CCProxy::hasImplThread()); | 359 DCHECK(CCProxy::hasImplThread()); |
| 360 m_proxy->setNeedsAnimate(); | 360 m_proxy->setNeedsAnimate(); |
| 361 } | 361 } |
| 362 | 362 |
| 363 void CCLayerTreeHost::setNeedsCommit() | 363 void CCLayerTreeHost::setNeedsCommit() |
| 364 { | 364 { |
| 365 m_proxy->setNeedsCommit(); | 365 m_proxy->setNeedsCommit(); |
| 366 } | 366 } |
| 367 | 367 |
| 368 void CCLayerTreeHost::setNeedsRedraw() | 368 void CCLayerTreeHost::setNeedsRedraw() |
| 369 { | 369 { |
| 370 m_proxy->setNeedsRedraw(); | 370 m_proxy->setNeedsRedraw(); |
| 371 if (!CCThreadProxy::implThread()) | 371 if (!CCThreadProxy::implThread()) |
| 372 m_client->scheduleComposite(); | 372 m_client->scheduleComposite(); |
| 373 } | 373 } |
| 374 | 374 |
| 375 bool CCLayerTreeHost::commitRequested() const | 375 bool CCLayerTreeHost::commitRequested() const |
| 376 { | 376 { |
| 377 return m_proxy->commitRequested(); | 377 return m_proxy->commitRequested(); |
| 378 } | 378 } |
| 379 | 379 |
| 380 void CCLayerTreeHost::setAnimationEvents(scoped_ptr<CCAnimationEventsVector> eve
nts, double wallClockTime) | 380 void CCLayerTreeHost::setAnimationEvents(scoped_ptr<CCAnimationEventsVector> eve
nts, double wallClockTime) |
| 381 { | 381 { |
| 382 ASSERT(CCThreadProxy::isMainThread()); | 382 DCHECK(CCThreadProxy::isMainThread()); |
| 383 setAnimationEventsRecursive(*events.get(), m_rootLayer.get(), wallClockTime)
; | 383 setAnimationEventsRecursive(*events.get(), m_rootLayer.get(), wallClockTime)
; |
| 384 } | 384 } |
| 385 | 385 |
| 386 void CCLayerTreeHost::didAddAnimation() | 386 void CCLayerTreeHost::didAddAnimation() |
| 387 { | 387 { |
| 388 m_needsAnimateLayers = true; | 388 m_needsAnimateLayers = true; |
| 389 m_proxy->didAddAnimation(); | 389 m_proxy->didAddAnimation(); |
| 390 } | 390 } |
| 391 | 391 |
| 392 void CCLayerTreeHost::setRootLayer(scoped_refptr<LayerChromium> rootLayer) | 392 void CCLayerTreeHost::setRootLayer(scoped_refptr<LayerChromium> rootLayer) |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 m_proxy->loseContext(); | 448 m_proxy->loseContext(); |
| 449 } | 449 } |
| 450 | 450 |
| 451 CCPrioritizedTextureManager* CCLayerTreeHost::contentsTextureManager() const | 451 CCPrioritizedTextureManager* CCLayerTreeHost::contentsTextureManager() const |
| 452 { | 452 { |
| 453 return m_contentsTextureManager.get(); | 453 return m_contentsTextureManager.get(); |
| 454 } | 454 } |
| 455 | 455 |
| 456 void CCLayerTreeHost::composite() | 456 void CCLayerTreeHost::composite() |
| 457 { | 457 { |
| 458 ASSERT(!CCThreadProxy::implThread()); | 458 DCHECK(!CCThreadProxy::implThread()); |
| 459 static_cast<CCSingleThreadProxy*>(m_proxy.get())->compositeImmediately(); | 459 static_cast<CCSingleThreadProxy*>(m_proxy.get())->compositeImmediately(); |
| 460 } | 460 } |
| 461 | 461 |
| 462 void CCLayerTreeHost::scheduleComposite() | 462 void CCLayerTreeHost::scheduleComposite() |
| 463 { | 463 { |
| 464 m_client->scheduleComposite(); | 464 m_client->scheduleComposite(); |
| 465 } | 465 } |
| 466 | 466 |
| 467 bool CCLayerTreeHost::initializeRendererIfNeeded() | 467 bool CCLayerTreeHost::initializeRendererIfNeeded() |
| 468 { | 468 { |
| 469 if (!m_rendererInitialized) { | 469 if (!m_rendererInitialized) { |
| 470 initializeRenderer(); | 470 initializeRenderer(); |
| 471 // If we couldn't initialize, then bail since we're returning to softwar
e mode. | 471 // If we couldn't initialize, then bail since we're returning to softwar
e mode. |
| 472 if (!m_rendererInitialized) | 472 if (!m_rendererInitialized) |
| 473 return false; | 473 return false; |
| 474 } | 474 } |
| 475 if (m_contextLost) { | 475 if (m_contextLost) { |
| 476 if (recreateContext() != RecreateSucceeded) | 476 if (recreateContext() != RecreateSucceeded) |
| 477 return false; | 477 return false; |
| 478 } | 478 } |
| 479 return true; | 479 return true; |
| 480 } | 480 } |
| 481 | 481 |
| 482 void CCLayerTreeHost::updateLayers(CCTextureUpdateQueue& queue, size_t memoryAll
ocationLimitBytes) | 482 void CCLayerTreeHost::updateLayers(CCTextureUpdateQueue& queue, size_t memoryAll
ocationLimitBytes) |
| 483 { | 483 { |
| 484 ASSERT(m_rendererInitialized); | 484 DCHECK(m_rendererInitialized); |
| 485 ASSERT(memoryAllocationLimitBytes); | 485 DCHECK(memoryAllocationLimitBytes); |
| 486 | 486 |
| 487 if (!rootLayer()) | 487 if (!rootLayer()) |
| 488 return; | 488 return; |
| 489 | 489 |
| 490 if (layoutViewportSize().isEmpty()) | 490 if (layoutViewportSize().isEmpty()) |
| 491 return; | 491 return; |
| 492 | 492 |
| 493 m_contentsTextureManager->setMaxMemoryLimitBytes(memoryAllocationLimitBytes)
; | 493 m_contentsTextureManager->setMaxMemoryLimitBytes(memoryAllocationLimitBytes)
; |
| 494 | 494 |
| 495 updateLayers(rootLayer(), queue); | 495 updateLayers(rootLayer(), queue); |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 666 CCOcclusionTracker occlusionTracker(m_rootLayer->renderSurface()->contentRec
t(), recordMetricsForFrame); | 666 CCOcclusionTracker occlusionTracker(m_rootLayer->renderSurface()->contentRec
t(), recordMetricsForFrame); |
| 667 occlusionTracker.setMinimumTrackingSize(m_settings.minimumOcclusionTrackingS
ize); | 667 occlusionTracker.setMinimumTrackingSize(m_settings.minimumOcclusionTrackingS
ize); |
| 668 | 668 |
| 669 prioritizeTextures(renderSurfaceLayerList, occlusionTracker.overdrawMetrics(
)); | 669 prioritizeTextures(renderSurfaceLayerList, occlusionTracker.overdrawMetrics(
)); |
| 670 | 670 |
| 671 CCLayerIteratorType end = CCLayerIteratorType::end(&renderSurfaceLayerList); | 671 CCLayerIteratorType end = CCLayerIteratorType::end(&renderSurfaceLayerList); |
| 672 for (CCLayerIteratorType it = CCLayerIteratorType::begin(&renderSurfaceLayer
List); it != end; ++it) { | 672 for (CCLayerIteratorType it = CCLayerIteratorType::begin(&renderSurfaceLayer
List); it != end; ++it) { |
| 673 occlusionTracker.enterLayer(it); | 673 occlusionTracker.enterLayer(it); |
| 674 | 674 |
| 675 if (it.representsTargetRenderSurface()) { | 675 if (it.representsTargetRenderSurface()) { |
| 676 ASSERT(it->renderSurface()->drawOpacity() || it->renderSurface()->dr
awOpacityIsAnimating()); | 676 DCHECK(it->renderSurface()->drawOpacity() || it->renderSurface()->dr
awOpacityIsAnimating()); |
| 677 needMoreUpdates |= paintMasksForRenderSurface(*it, queue); | 677 needMoreUpdates |= paintMasksForRenderSurface(*it, queue); |
| 678 } else if (it.representsItself()) { | 678 } else if (it.representsItself()) { |
| 679 ASSERT(!it->bounds().isEmpty()); | 679 DCHECK(!it->bounds().isEmpty()); |
| 680 it->update(queue, &occlusionTracker, m_renderingStats); | 680 it->update(queue, &occlusionTracker, m_renderingStats); |
| 681 needMoreUpdates |= it->needMoreUpdates(); | 681 needMoreUpdates |= it->needMoreUpdates(); |
| 682 } | 682 } |
| 683 | 683 |
| 684 occlusionTracker.leaveLayer(it); | 684 occlusionTracker.leaveLayer(it); |
| 685 } | 685 } |
| 686 | 686 |
| 687 occlusionTracker.overdrawMetrics().recordMetrics(this); | 687 occlusionTracker.overdrawMetrics().recordMetrics(this); |
| 688 | 688 |
| 689 return needMoreUpdates; | 689 return needMoreUpdates; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 713 void CCLayerTreeHost::setImplTransform(const WebKit::WebTransformationMatrix& tr
ansform) | 713 void CCLayerTreeHost::setImplTransform(const WebKit::WebTransformationMatrix& tr
ansform) |
| 714 { | 714 { |
| 715 m_implTransform = transform; | 715 m_implTransform = transform; |
| 716 } | 716 } |
| 717 | 717 |
| 718 void CCLayerTreeHost::startRateLimiter(WebKit::WebGraphicsContext3D* context) | 718 void CCLayerTreeHost::startRateLimiter(WebKit::WebGraphicsContext3D* context) |
| 719 { | 719 { |
| 720 if (m_animating) | 720 if (m_animating) |
| 721 return; | 721 return; |
| 722 | 722 |
| 723 ASSERT(context); | 723 DCHECK(context); |
| 724 RateLimiterMap::iterator it = m_rateLimiters.find(context); | 724 RateLimiterMap::iterator it = m_rateLimiters.find(context); |
| 725 if (it != m_rateLimiters.end()) | 725 if (it != m_rateLimiters.end()) |
| 726 it->second->start(); | 726 it->second->start(); |
| 727 else { | 727 else { |
| 728 scoped_refptr<RateLimiter> rateLimiter = RateLimiter::create(context, th
is); | 728 scoped_refptr<RateLimiter> rateLimiter = RateLimiter::create(context, th
is); |
| 729 m_rateLimiters[context] = rateLimiter; | 729 m_rateLimiters[context] = rateLimiter; |
| 730 rateLimiter->start(); | 730 rateLimiter->start(); |
| 731 } | 731 } |
| 732 } | 732 } |
| 733 | 733 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 817 else | 817 else |
| 818 layer->notifyAnimationFinished(wallClockTime); | 818 layer->notifyAnimationFinished(wallClockTime); |
| 819 } | 819 } |
| 820 } | 820 } |
| 821 | 821 |
| 822 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn
dex) | 822 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn
dex) |
| 823 setAnimationEventsRecursive(events, layer->children()[childIndex].get(),
wallClockTime); | 823 setAnimationEventsRecursive(events, layer->children()[childIndex].get(),
wallClockTime); |
| 824 } | 824 } |
| 825 | 825 |
| 826 } // namespace cc | 826 } // namespace cc |
| OLD | NEW |