| 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 "cc/thread_proxy.h" | 5 #include "cc/thread_proxy.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "cc/delay_based_time_source.h" | 9 #include "cc/delay_based_time_source.h" |
| 10 #include "cc/draw_quad.h" | 10 #include "cc/draw_quad.h" |
| (...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 911 { | 911 { |
| 912 TRACE_EVENT0("cc", "ThreadProxy::initializeImplOnImplThread"); | 912 TRACE_EVENT0("cc", "ThreadProxy::initializeImplOnImplThread"); |
| 913 DCHECK(isImplThread()); | 913 DCHECK(isImplThread()); |
| 914 m_layerTreeHostImpl = m_layerTreeHost->createLayerTreeHostImpl(this); | 914 m_layerTreeHostImpl = m_layerTreeHost->createLayerTreeHostImpl(this); |
| 915 const base::TimeDelta displayRefreshInterval = base::TimeDelta::FromMicrosec
onds(base::Time::kMicrosecondsPerSecond / 60); | 915 const base::TimeDelta displayRefreshInterval = base::TimeDelta::FromMicrosec
onds(base::Time::kMicrosecondsPerSecond / 60); |
| 916 scoped_ptr<FrameRateController> frameRateController; | 916 scoped_ptr<FrameRateController> frameRateController; |
| 917 if (m_renderVSyncEnabled) | 917 if (m_renderVSyncEnabled) |
| 918 frameRateController.reset(new FrameRateController(DelayBasedTimeSource::
create(displayRefreshInterval, Proxy::implThread()))); | 918 frameRateController.reset(new FrameRateController(DelayBasedTimeSource::
create(displayRefreshInterval, Proxy::implThread()))); |
| 919 else | 919 else |
| 920 frameRateController.reset(new FrameRateController(Proxy::implThread())); | 920 frameRateController.reset(new FrameRateController(Proxy::implThread())); |
| 921 m_schedulerOnImplThread = Scheduler::create(this, frameRateController.Pass()
); | 921 SchedulerSettings schedulerSettings; |
| 922 schedulerSettings.implSidePainting = m_layerTreeHost->settings().implSidePai
nting; |
| 923 m_schedulerOnImplThread = Scheduler::create(this, frameRateController.Pass()
, |
| 924 schedulerSettings); |
| 922 m_schedulerOnImplThread->setVisible(m_layerTreeHostImpl->visible()); | 925 m_schedulerOnImplThread->setVisible(m_layerTreeHostImpl->visible()); |
| 923 | 926 |
| 924 m_inputHandlerOnImplThread = scoped_ptr<InputHandler>(handler); | 927 m_inputHandlerOnImplThread = scoped_ptr<InputHandler>(handler); |
| 925 if (m_inputHandlerOnImplThread.get()) | 928 if (m_inputHandlerOnImplThread.get()) |
| 926 m_inputHandlerOnImplThread->bindToClient(m_layerTreeHostImpl.get()); | 929 m_inputHandlerOnImplThread->bindToClient(m_layerTreeHostImpl.get()); |
| 927 | 930 |
| 928 m_implThreadWeakPtr = m_weakFactoryOnImplThread.GetWeakPtr(); | 931 m_implThreadWeakPtr = m_weakFactoryOnImplThread.GetWeakPtr(); |
| 929 completion->signal(); | 932 completion->signal(); |
| 930 } | 933 } |
| 931 | 934 |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1042 } | 1045 } |
| 1043 | 1046 |
| 1044 void ThreadProxy::capturePictureOnImplThread(CompletionEvent* completion, skia::
RefPtr<SkPicture>* picture) | 1047 void ThreadProxy::capturePictureOnImplThread(CompletionEvent* completion, skia::
RefPtr<SkPicture>* picture) |
| 1045 { | 1048 { |
| 1046 DCHECK(isImplThread()); | 1049 DCHECK(isImplThread()); |
| 1047 *picture = m_layerTreeHostImpl->capturePicture(); | 1050 *picture = m_layerTreeHostImpl->capturePicture(); |
| 1048 completion->signal(); | 1051 completion->signal(); |
| 1049 } | 1052 } |
| 1050 | 1053 |
| 1051 } // namespace cc | 1054 } // namespace cc |
| OLD | NEW |