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 "cc/layer_tree_host.h" | 7 #include "cc/layer_tree_host.h" |
8 | 8 |
9 #include "Region.h" | 9 #include "Region.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 if (m_fontAtlas.get()) | 295 if (m_fontAtlas.get()) |
296 m_hudLayer->setFontAtlas(m_fontAtlas.Pass()); | 296 m_hudLayer->setFontAtlas(m_fontAtlas.Pass()); |
297 | 297 |
298 if (!m_hudLayer->parent()) | 298 if (!m_hudLayer->parent()) |
299 m_rootLayer->addChild(m_hudLayer); | 299 m_rootLayer->addChild(m_hudLayer); |
300 } | 300 } |
301 } | 301 } |
302 | 302 |
303 void LayerTreeHost::commitComplete() | 303 void LayerTreeHost::commitComplete() |
304 { | 304 { |
305 m_deleteTextureAfterCommitList.clear(); | |
306 m_client->didCommit(); | 305 m_client->didCommit(); |
307 } | 306 } |
308 | 307 |
309 scoped_ptr<GraphicsContext> LayerTreeHost::createContext() | 308 scoped_ptr<GraphicsContext> LayerTreeHost::createContext() |
310 { | 309 { |
311 return m_client->createOutputSurface(); | 310 return m_client->createOutputSurface(); |
312 } | 311 } |
313 | 312 |
314 scoped_ptr<InputHandler> LayerTreeHost::createInputHandler() | 313 scoped_ptr<InputHandler> LayerTreeHost::createInputHandler() |
315 { | 314 { |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
729 | 728 |
730 bool LayerTreeHost::requestPartialTextureUpdate() | 729 bool LayerTreeHost::requestPartialTextureUpdate() |
731 { | 730 { |
732 if (m_partialTextureUpdateRequests >= m_settings.maxPartialTextureUpdates) | 731 if (m_partialTextureUpdateRequests >= m_settings.maxPartialTextureUpdates) |
733 return false; | 732 return false; |
734 | 733 |
735 m_partialTextureUpdateRequests++; | 734 m_partialTextureUpdateRequests++; |
736 return true; | 735 return true; |
737 } | 736 } |
738 | 737 |
739 void LayerTreeHost::deleteTextureAfterCommit(scoped_ptr<PrioritizedTexture> text
ure) | |
740 { | |
741 m_deleteTextureAfterCommitList.append(texture.Pass()); | |
742 } | |
743 | |
744 void LayerTreeHost::setDeviceScaleFactor(float deviceScaleFactor) | 738 void LayerTreeHost::setDeviceScaleFactor(float deviceScaleFactor) |
745 { | 739 { |
746 if (deviceScaleFactor == m_deviceScaleFactor) | 740 if (deviceScaleFactor == m_deviceScaleFactor) |
747 return; | 741 return; |
748 m_deviceScaleFactor = deviceScaleFactor; | 742 m_deviceScaleFactor = deviceScaleFactor; |
749 | 743 |
750 setNeedsCommit(); | 744 setNeedsCommit(); |
751 } | 745 } |
752 | 746 |
753 void LayerTreeHost::animateLayers(double monotonicTime) | 747 void LayerTreeHost::animateLayers(double monotonicTime) |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
792 else | 786 else |
793 layer->notifyAnimationFinished(wallClockTime); | 787 layer->notifyAnimationFinished(wallClockTime); |
794 } | 788 } |
795 } | 789 } |
796 | 790 |
797 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn
dex) | 791 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn
dex) |
798 setAnimationEventsRecursive(events, layer->children()[childIndex].get(),
wallClockTime); | 792 setAnimationEventsRecursive(events, layer->children()[childIndex].get(),
wallClockTime); |
799 } | 793 } |
800 | 794 |
801 } // namespace cc | 795 } // namespace cc |
OLD | NEW |