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 993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1004 attributes.antialias = false; | 1004 attributes.antialias = false; |
1005 attributes.noAutomaticFlushes = true; | 1005 attributes.noAutomaticFlushes = true; |
1006 | 1006 |
1007 return make_scoped_ptr( | 1007 return make_scoped_ptr( |
1008 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( | 1008 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( |
1009 this, | 1009 this, |
1010 attributes, | 1010 attributes, |
1011 GURL("chrome://gpu/RenderThreadImpl::CreateOffscreenContext3d"))); | 1011 GURL("chrome://gpu/RenderThreadImpl::CreateOffscreenContext3d"))); |
1012 } | 1012 } |
1013 | 1013 |
1014 scoped_refptr<ContextProviderCommandBuffer> | 1014 scoped_refptr<cc::ContextProvider> |
1015 RenderThreadImpl::OffscreenContextProviderForMainThread() { | 1015 RenderThreadImpl::OffscreenContextProviderForMainThread() { |
1016 DCHECK(IsMainThread()); | 1016 DCHECK(IsMainThread()); |
1017 | 1017 |
| 1018 #if defined(OS_ANDROID) |
| 1019 if (SynchronousCompositorFactory* factory = |
| 1020 SynchronousCompositorFactory::GetInstance()) { |
| 1021 return factory->GetOffscreenContextProviderForMainThread(); |
| 1022 } |
| 1023 #endif |
| 1024 |
1018 if (!shared_contexts_main_thread_.get() || | 1025 if (!shared_contexts_main_thread_.get() || |
1019 shared_contexts_main_thread_->DestroyedOnMainThread()) { | 1026 shared_contexts_main_thread_->DestroyedOnMainThread()) { |
1020 shared_contexts_main_thread_ = | 1027 shared_contexts_main_thread_ = |
1021 RendererContextProviderCommandBuffer::Create(); | 1028 RendererContextProviderCommandBuffer::Create(); |
1022 if (shared_contexts_main_thread_.get() && | 1029 if (shared_contexts_main_thread_.get() && |
1023 !shared_contexts_main_thread_->BindToCurrentThread()) | 1030 !shared_contexts_main_thread_->BindToCurrentThread()) |
1024 shared_contexts_main_thread_ = NULL; | 1031 shared_contexts_main_thread_ = NULL; |
1025 } | 1032 } |
1026 return shared_contexts_main_thread_; | 1033 return shared_contexts_main_thread_; |
1027 } | 1034 } |
1028 | 1035 |
1029 scoped_refptr<ContextProviderCommandBuffer> | 1036 scoped_refptr<cc::ContextProvider> |
1030 RenderThreadImpl::OffscreenContextProviderForCompositorThread() { | 1037 RenderThreadImpl::OffscreenContextProviderForCompositorThread() { |
1031 DCHECK(IsMainThread()); | 1038 DCHECK(IsMainThread()); |
1032 | 1039 |
| 1040 #if defined(OS_ANDROID) |
| 1041 if (SynchronousCompositorFactory* factory = |
| 1042 SynchronousCompositorFactory::GetInstance()) { |
| 1043 return factory->GetOffscreenContextProviderForCompositorThread(); |
| 1044 } |
| 1045 #endif |
| 1046 |
1033 if (!shared_contexts_compositor_thread_.get() || | 1047 if (!shared_contexts_compositor_thread_.get() || |
1034 shared_contexts_compositor_thread_->DestroyedOnMainThread()) { | 1048 shared_contexts_compositor_thread_->DestroyedOnMainThread()) { |
1035 shared_contexts_compositor_thread_ = | 1049 shared_contexts_compositor_thread_ = |
1036 RendererContextProviderCommandBuffer::Create(); | 1050 RendererContextProviderCommandBuffer::Create(); |
1037 } | 1051 } |
1038 return shared_contexts_compositor_thread_; | 1052 return shared_contexts_compositor_thread_; |
1039 } | 1053 } |
1040 | 1054 |
1041 AudioRendererMixerManager* RenderThreadImpl::GetAudioRendererMixerManager() { | 1055 AudioRendererMixerManager* RenderThreadImpl::GetAudioRendererMixerManager() { |
1042 if (!audio_renderer_mixer_manager_) { | 1056 if (!audio_renderer_mixer_manager_) { |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1349 | 1363 |
1350 void RenderThreadImpl::SetFlingCurveParameters( | 1364 void RenderThreadImpl::SetFlingCurveParameters( |
1351 const std::vector<float>& new_touchpad, | 1365 const std::vector<float>& new_touchpad, |
1352 const std::vector<float>& new_touchscreen) { | 1366 const std::vector<float>& new_touchscreen) { |
1353 webkit_platform_support_->SetFlingCurveParameters(new_touchpad, | 1367 webkit_platform_support_->SetFlingCurveParameters(new_touchpad, |
1354 new_touchscreen); | 1368 new_touchscreen); |
1355 | 1369 |
1356 } | 1370 } |
1357 | 1371 |
1358 } // namespace content | 1372 } // namespace content |
OLD | NEW |