| 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 m_schedulerOnImplThread = Scheduler::create(this, frameRateController.Pass()
, |
| 922 m_layerTreeHost->settings().impl
SidePainting); |
| 922 m_schedulerOnImplThread->setVisible(m_layerTreeHostImpl->visible()); | 923 m_schedulerOnImplThread->setVisible(m_layerTreeHostImpl->visible()); |
| 923 | 924 |
| 924 m_inputHandlerOnImplThread = scoped_ptr<InputHandler>(handler); | 925 m_inputHandlerOnImplThread = scoped_ptr<InputHandler>(handler); |
| 925 if (m_inputHandlerOnImplThread.get()) | 926 if (m_inputHandlerOnImplThread.get()) |
| 926 m_inputHandlerOnImplThread->bindToClient(m_layerTreeHostImpl.get()); | 927 m_inputHandlerOnImplThread->bindToClient(m_layerTreeHostImpl.get()); |
| 927 | 928 |
| 928 m_implThreadWeakPtr = m_weakFactoryOnImplThread.GetWeakPtr(); | 929 m_implThreadWeakPtr = m_weakFactoryOnImplThread.GetWeakPtr(); |
| 929 completion->signal(); | 930 completion->signal(); |
| 930 } | 931 } |
| 931 | 932 |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1039 } | 1040 } |
| 1040 | 1041 |
| 1041 void ThreadProxy::capturePictureOnImplThread(CompletionEvent* completion, skia::
RefPtr<SkPicture>* picture) | 1042 void ThreadProxy::capturePictureOnImplThread(CompletionEvent* completion, skia::
RefPtr<SkPicture>* picture) |
| 1042 { | 1043 { |
| 1043 DCHECK(isImplThread()); | 1044 DCHECK(isImplThread()); |
| 1044 *picture = m_layerTreeHostImpl->capturePicture(); | 1045 *picture = m_layerTreeHostImpl->capturePicture(); |
| 1045 completion->signal(); | 1046 completion->signal(); |
| 1046 } | 1047 } |
| 1047 | 1048 |
| 1048 } // namespace cc | 1049 } // namespace cc |
| OLD | NEW |