| 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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 387 } | 387 } | 
| 388 | 388 | 
| 389 void CCLayerTreeHost::setVisible(bool visible) | 389 void CCLayerTreeHost::setVisible(bool visible) | 
| 390 { | 390 { | 
| 391     if (m_visible == visible) | 391     if (m_visible == visible) | 
| 392         return; | 392         return; | 
| 393     m_visible = visible; | 393     m_visible = visible; | 
| 394     m_proxy->setVisible(visible); | 394     m_proxy->setVisible(visible); | 
| 395 } | 395 } | 
| 396 | 396 | 
| 397 void CCLayerTreeHost::unlinkAllContentTextures() | 397 void CCLayerTreeHost::reduceContentsTexturesMemoryOnImplThread(size_t limitBytes
     , CCResourceProvider* resourceProvider) | 
|  | 398 { | 
|  | 399     ASSERT(CCProxy::isImplThread()); | 
|  | 400     ASSERT(m_contentsTextureManager.get()); | 
|  | 401     m_contentsTextureManager->reduceMemoryOnImplThread(limitBytes, resourceProvi
     der); | 
|  | 402 } | 
|  | 403 | 
|  | 404 void CCLayerTreeHost::getEvictedContentTexturesBackings(CCPrioritizedTextureMana
     ger::BackingVector& evictedBackings) | 
|  | 405 { | 
|  | 406     ASSERT(CCProxy::isImplThread()); | 
|  | 407     evictedBackings.clear(); | 
|  | 408     if (m_rendererInitialized) | 
|  | 409         m_contentsTextureManager->getEvictedBackings(evictedBackings); | 
|  | 410 } | 
|  | 411 | 
|  | 412 void CCLayerTreeHost::unlinkEvictedContentTexturesBackings(const CCPrioritizedTe
     xtureManager::BackingVector& evictedBackings) | 
| 398 { | 413 { | 
| 399     ASSERT(CCProxy::isMainThread()); | 414     ASSERT(CCProxy::isMainThread()); | 
| 400     ASSERT(m_contentsTextureManager.get()); | 415     ASSERT(m_contentsTextureManager.get()); | 
| 401     m_contentsTextureManager->unlinkAllBackings(); | 416     m_contentsTextureManager->unlinkEvictedBackings(evictedBackings); | 
| 402 } | 417 } | 
| 403 | 418 | 
| 404 void CCLayerTreeHost::deleteUnlinkedTextures() | 419 bool CCLayerTreeHost::deleteEvictedContentTexturesBackings() | 
| 405 { | 420 { | 
| 406     ASSERT(CCProxy::isImplThread() && CCProxy::isMainThreadBlocked()); | 421     ASSERT(CCProxy::isImplThread() && CCProxy::isMainThreadBlocked()); | 
| 407     ASSERT(m_contentsTextureManager.get()); | 422     ASSERT(m_contentsTextureManager.get()); | 
| 408     m_contentsTextureManager->deleteAllUnlinkedBackings(); | 423     return m_contentsTextureManager->deleteEvictedBackings(); | 
| 409 } | 424 } | 
| 410 | 425 | 
| 411 void CCLayerTreeHost::startPageScaleAnimation(const IntSize& targetPosition, boo
     l useAnchor, float scale, double durationSec) | 426 void CCLayerTreeHost::startPageScaleAnimation(const IntSize& targetPosition, boo
     l useAnchor, float scale, double durationSec) | 
| 412 { | 427 { | 
| 413     m_proxy->startPageScaleAnimation(targetPosition, useAnchor, scale, durationS
     ec); | 428     m_proxy->startPageScaleAnimation(targetPosition, useAnchor, scale, durationS
     ec); | 
| 414 } | 429 } | 
| 415 | 430 | 
| 416 void CCLayerTreeHost::loseContext(int numTimes) | 431 void CCLayerTreeHost::loseContext(int numTimes) | 
| 417 { | 432 { | 
| 418     TRACE_EVENT1("cc", "CCLayerTreeHost::loseCompositorContext", "numTimes", num
     Times); | 433     TRACE_EVENT1("cc", "CCLayerTreeHost::loseCompositorContext", "numTimes", num
     Times); | 
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 779             else | 794             else | 
| 780                 layer->notifyAnimationFinished(wallClockTime); | 795                 layer->notifyAnimationFinished(wallClockTime); | 
| 781         } | 796         } | 
| 782     } | 797     } | 
| 783 | 798 | 
| 784     for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn
     dex) | 799     for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn
     dex) | 
| 785         setAnimationEventsRecursive(events, layer->children()[childIndex].get(),
      wallClockTime); | 800         setAnimationEventsRecursive(events, layer->children()[childIndex].get(),
      wallClockTime); | 
| 786 } | 801 } | 
| 787 | 802 | 
| 788 } // namespace cc | 803 } // namespace cc | 
| OLD | NEW | 
|---|