OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/renderer/render_thread_impl.h" | 5 #include "content/renderer/render_thread_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <map> | 9 #include <map> |
10 #include <vector> | 10 #include <vector> |
(...skipping 983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
994 attributes.antialias = false; | 994 attributes.antialias = false; |
995 attributes.noAutomaticFlushes = true; | 995 attributes.noAutomaticFlushes = true; |
996 | 996 |
997 return make_scoped_ptr( | 997 return make_scoped_ptr( |
998 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( | 998 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( |
999 this, | 999 this, |
1000 attributes, | 1000 attributes, |
1001 GURL("chrome://gpu/RenderThreadImpl::CreateOffscreenContext3d"))); | 1001 GURL("chrome://gpu/RenderThreadImpl::CreateOffscreenContext3d"))); |
1002 } | 1002 } |
1003 | 1003 |
1004 scoped_refptr<ContextProviderCommandBuffer> | 1004 scoped_refptr<cc::ContextProvider> |
1005 RenderThreadImpl::OffscreenContextProviderForMainThread() { | 1005 RenderThreadImpl::OffscreenContextProviderForMainThread() { |
1006 DCHECK(IsMainThread()); | 1006 DCHECK(IsMainThread()); |
1007 | 1007 |
1008 #if defined(OS_ANDROID) | |
joth
2013/06/02 19:08:55
(hmm at some point we may want to move Synchronous
| |
1009 if (SynchronousCompositorFactory* factory = | |
1010 SynchronousCompositorFactory::GetInstance()) { | |
1011 return factory->OffscreenContextProviderForMainThread(); | |
1012 } | |
1013 #endif | |
1014 | |
1008 if (!shared_contexts_main_thread_ || | 1015 if (!shared_contexts_main_thread_ || |
1009 shared_contexts_main_thread_->DestroyedOnMainThread()) { | 1016 shared_contexts_main_thread_->DestroyedOnMainThread()) { |
1010 shared_contexts_main_thread_ = | 1017 shared_contexts_main_thread_ = |
1011 RendererContextProviderCommandBuffer::Create(); | 1018 RendererContextProviderCommandBuffer::Create(); |
1012 if (shared_contexts_main_thread_ && | 1019 if (shared_contexts_main_thread_ && |
1013 !shared_contexts_main_thread_->BindToCurrentThread()) | 1020 !shared_contexts_main_thread_->BindToCurrentThread()) |
1014 shared_contexts_main_thread_ = NULL; | 1021 shared_contexts_main_thread_ = NULL; |
1015 } | 1022 } |
1016 return shared_contexts_main_thread_; | 1023 return shared_contexts_main_thread_; |
1017 } | 1024 } |
1018 | 1025 |
1019 scoped_refptr<ContextProviderCommandBuffer> | 1026 scoped_refptr<cc::ContextProvider> |
1020 RenderThreadImpl::OffscreenContextProviderForCompositorThread() { | 1027 RenderThreadImpl::OffscreenContextProviderForCompositorThread() { |
1021 DCHECK(IsMainThread()); | 1028 DCHECK(IsMainThread()); |
1022 | 1029 |
1030 #if defined(OS_ANDROID) | |
1031 if (SynchronousCompositorFactory* factory = | |
1032 SynchronousCompositorFactory::GetInstance()) { | |
1033 return factory->OffscreenContextProviderForCompositorThread(); | |
1034 } | |
1035 #endif | |
joth
2013/06/02 19:08:55
this means shared_contexts_compositor_thread_ (and
boliu
2013/06/03 18:51:24
Yes, it needs to be the same one.
| |
1036 | |
1023 if (!shared_contexts_compositor_thread_ || | 1037 if (!shared_contexts_compositor_thread_ || |
1024 shared_contexts_compositor_thread_->DestroyedOnMainThread()) { | 1038 shared_contexts_compositor_thread_->DestroyedOnMainThread()) { |
1025 shared_contexts_compositor_thread_ = | 1039 shared_contexts_compositor_thread_ = |
1026 RendererContextProviderCommandBuffer::Create(); | 1040 RendererContextProviderCommandBuffer::Create(); |
1027 } | 1041 } |
1028 return shared_contexts_compositor_thread_; | 1042 return shared_contexts_compositor_thread_; |
1029 } | 1043 } |
1030 | 1044 |
1031 AudioRendererMixerManager* RenderThreadImpl::GetAudioRendererMixerManager() { | 1045 AudioRendererMixerManager* RenderThreadImpl::GetAudioRendererMixerManager() { |
1032 if (!audio_renderer_mixer_manager_) { | 1046 if (!audio_renderer_mixer_manager_) { |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1329 | 1343 |
1330 void RenderThreadImpl::SetFlingCurveParameters( | 1344 void RenderThreadImpl::SetFlingCurveParameters( |
1331 const std::vector<float>& new_touchpad, | 1345 const std::vector<float>& new_touchpad, |
1332 const std::vector<float>& new_touchscreen) { | 1346 const std::vector<float>& new_touchscreen) { |
1333 webkit_platform_support_->SetFlingCurveParameters(new_touchpad, | 1347 webkit_platform_support_->SetFlingCurveParameters(new_touchpad, |
1334 new_touchscreen); | 1348 new_touchscreen); |
1335 | 1349 |
1336 } | 1350 } |
1337 | 1351 |
1338 } // namespace content | 1352 } // namespace content |
OLD | NEW |