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 1008 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1019 attributes.antialias = false; | 1019 attributes.antialias = false; |
1020 attributes.noAutomaticFlushes = true; | 1020 attributes.noAutomaticFlushes = true; |
1021 | 1021 |
1022 return make_scoped_ptr( | 1022 return make_scoped_ptr( |
1023 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( | 1023 WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( |
1024 this, | 1024 this, |
1025 attributes, | 1025 attributes, |
1026 GURL("chrome://gpu/RenderThreadImpl::CreateOffscreenContext3d"))); | 1026 GURL("chrome://gpu/RenderThreadImpl::CreateOffscreenContext3d"))); |
1027 } | 1027 } |
1028 | 1028 |
1029 scoped_refptr<ContextProviderCommandBuffer> | 1029 scoped_refptr<cc::ContextProvider> |
1030 RenderThreadImpl::OffscreenContextProviderForMainThread() { | 1030 RenderThreadImpl::OffscreenContextProviderForMainThread() { |
1031 DCHECK(IsMainThread()); | 1031 DCHECK(IsMainThread()); |
1032 | 1032 |
| 1033 #if defined(OS_ANDROID) |
| 1034 if (SynchronousCompositorFactory* factory = |
| 1035 SynchronousCompositorFactory::GetInstance()) { |
| 1036 return factory->GetOffscreenContextProviderForMainThread(); |
| 1037 } |
| 1038 #endif |
| 1039 |
1033 if (!shared_contexts_main_thread_.get() || | 1040 if (!shared_contexts_main_thread_.get() || |
1034 shared_contexts_main_thread_->DestroyedOnMainThread()) { | 1041 shared_contexts_main_thread_->DestroyedOnMainThread()) { |
1035 shared_contexts_main_thread_ = | 1042 shared_contexts_main_thread_ = |
1036 RendererContextProviderCommandBuffer::Create(); | 1043 RendererContextProviderCommandBuffer::Create(); |
1037 if (shared_contexts_main_thread_.get() && | 1044 if (shared_contexts_main_thread_.get() && |
1038 !shared_contexts_main_thread_->BindToCurrentThread()) | 1045 !shared_contexts_main_thread_->BindToCurrentThread()) |
1039 shared_contexts_main_thread_ = NULL; | 1046 shared_contexts_main_thread_ = NULL; |
1040 } | 1047 } |
1041 return shared_contexts_main_thread_; | 1048 return shared_contexts_main_thread_; |
1042 } | 1049 } |
1043 | 1050 |
1044 scoped_refptr<ContextProviderCommandBuffer> | 1051 scoped_refptr<cc::ContextProvider> |
1045 RenderThreadImpl::OffscreenContextProviderForCompositorThread() { | 1052 RenderThreadImpl::OffscreenContextProviderForCompositorThread() { |
1046 DCHECK(IsMainThread()); | 1053 DCHECK(IsMainThread()); |
1047 | 1054 |
| 1055 #if defined(OS_ANDROID) |
| 1056 if (SynchronousCompositorFactory* factory = |
| 1057 SynchronousCompositorFactory::GetInstance()) { |
| 1058 return factory->GetOffscreenContextProviderForCompositorThread(); |
| 1059 } |
| 1060 #endif |
| 1061 |
1048 if (!shared_contexts_compositor_thread_.get() || | 1062 if (!shared_contexts_compositor_thread_.get() || |
1049 shared_contexts_compositor_thread_->DestroyedOnMainThread()) { | 1063 shared_contexts_compositor_thread_->DestroyedOnMainThread()) { |
1050 shared_contexts_compositor_thread_ = | 1064 shared_contexts_compositor_thread_ = |
1051 RendererContextProviderCommandBuffer::Create(); | 1065 RendererContextProviderCommandBuffer::Create(); |
1052 } | 1066 } |
1053 return shared_contexts_compositor_thread_; | 1067 return shared_contexts_compositor_thread_; |
1054 } | 1068 } |
1055 | 1069 |
1056 AudioRendererMixerManager* RenderThreadImpl::GetAudioRendererMixerManager() { | 1070 AudioRendererMixerManager* RenderThreadImpl::GetAudioRendererMixerManager() { |
1057 if (!audio_renderer_mixer_manager_) { | 1071 if (!audio_renderer_mixer_manager_) { |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1364 | 1378 |
1365 void RenderThreadImpl::SetFlingCurveParameters( | 1379 void RenderThreadImpl::SetFlingCurveParameters( |
1366 const std::vector<float>& new_touchpad, | 1380 const std::vector<float>& new_touchpad, |
1367 const std::vector<float>& new_touchscreen) { | 1381 const std::vector<float>& new_touchscreen) { |
1368 webkit_platform_support_->SetFlingCurveParameters(new_touchpad, | 1382 webkit_platform_support_->SetFlingCurveParameters(new_touchpad, |
1369 new_touchscreen); | 1383 new_touchscreen); |
1370 | 1384 |
1371 } | 1385 } |
1372 | 1386 |
1373 } // namespace content | 1387 } // namespace content |
OLD | NEW |