| 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/renderer_webkitplatformsupport_impl.h" | 5 #include "content/renderer/renderer_webkitplatformsupport_impl.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
| (...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 919 | 919 |
| 920 bool RendererWebKitPlatformSupportImpl::processMemorySizesInBytes( | 920 bool RendererWebKitPlatformSupportImpl::processMemorySizesInBytes( |
| 921 size_t* private_bytes, size_t* shared_bytes) { | 921 size_t* private_bytes, size_t* shared_bytes) { |
| 922 content::RenderThread::Get()->Send( | 922 content::RenderThread::Get()->Send( |
| 923 new ViewHostMsg_GetProcessMemorySizes(private_bytes, shared_bytes)); | 923 new ViewHostMsg_GetProcessMemorySizes(private_bytes, shared_bytes)); |
| 924 return true; | 924 return true; |
| 925 } | 925 } |
| 926 | 926 |
| 927 //------------------------------------------------------------------------------ | 927 //------------------------------------------------------------------------------ |
| 928 | 928 |
| 929 |
| 929 blink::WebGraphicsContext3D* | 930 blink::WebGraphicsContext3D* |
| 930 RendererWebKitPlatformSupportImpl::createOffscreenGraphicsContext3D( | 931 RendererWebKitPlatformSupportImpl::createOffscreenGraphicsContext3D( |
| 932 #ifdef ENABLE_EXPLICIT_GL_SHARE_GROUPS |
| 933 const blink::WebGraphicsContext3D::Attributes& attributes, |
| 934 blink::WebGraphicsContext3D* share_context) { |
| 935 #else |
| 931 const blink::WebGraphicsContext3D::Attributes& attributes) { | 936 const blink::WebGraphicsContext3D::Attributes& attributes) { |
| 937 blink::WebGraphicsContext3D* share_context = NULL; |
| 938 #endif |
| 932 if (!RenderThreadImpl::current()) | 939 if (!RenderThreadImpl::current()) |
| 933 return NULL; | 940 return NULL; |
| 934 | 941 |
| 935 scoped_refptr<GpuChannelHost> gpu_channel_host( | 942 scoped_refptr<GpuChannelHost> gpu_channel_host( |
| 936 RenderThreadImpl::current()->EstablishGpuChannelSync( | 943 RenderThreadImpl::current()->EstablishGpuChannelSync( |
| 937 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE)
); | 944 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE)
); |
| 938 | 945 |
| 939 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits limits; | 946 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits limits; |
| 940 | 947 |
| 941 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 948 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 942 if (command_line->HasSwitch(switches::kWebGLCommandBufferSizeKb)) { | 949 if (command_line->HasSwitch(switches::kWebGLCommandBufferSizeKb)) { |
| 943 std::string size_string = command_line->GetSwitchValueASCII( | 950 std::string size_string = command_line->GetSwitchValueASCII( |
| 944 switches::kWebGLCommandBufferSizeKb); | 951 switches::kWebGLCommandBufferSizeKb); |
| 945 size_t buffer_size_kb; | 952 size_t buffer_size_kb; |
| 946 if (base::StringToSizeT(size_string, &buffer_size_kb)) { | 953 if (base::StringToSizeT(size_string, &buffer_size_kb)) { |
| 947 limits.command_buffer_size = buffer_size_kb * 1024; | 954 limits.command_buffer_size = buffer_size_kb * 1024; |
| 948 } | 955 } |
| 949 } | 956 } |
| 950 | 957 |
| 951 return WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( | 958 return WebGraphicsContext3DCommandBufferImpl::CreateOffscreenContext( |
| 952 gpu_channel_host.get(), | 959 gpu_channel_host.get(), |
| 953 attributes, | 960 attributes, |
| 954 GURL(attributes.topDocumentURL), | 961 GURL(attributes.topDocumentURL), |
| 955 limits); | 962 limits, |
| 963 share_context); |
| 956 } | 964 } |
| 957 | 965 |
| 958 //------------------------------------------------------------------------------ | 966 //------------------------------------------------------------------------------ |
| 959 | 967 |
| 960 blink::WebGraphicsContext3DProvider* RendererWebKitPlatformSupportImpl:: | 968 blink::WebGraphicsContext3DProvider* RendererWebKitPlatformSupportImpl:: |
| 961 createSharedOffscreenGraphicsContext3DProvider() { | 969 createSharedOffscreenGraphicsContext3DProvider() { |
| 962 scoped_refptr<cc::ContextProvider> provider = | 970 scoped_refptr<cc::ContextProvider> provider = |
| 963 RenderThreadImpl::current()->SharedMainThreadContextProvider(); | 971 RenderThreadImpl::current()->SharedMainThreadContextProvider(); |
| 964 if (!provider) | 972 if (!provider) |
| 965 return NULL; | 973 return NULL; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1064 return; | 1072 return; |
| 1065 QuotaDispatcher::ThreadSpecificInstance( | 1073 QuotaDispatcher::ThreadSpecificInstance( |
| 1066 thread_safe_sender_.get(), | 1074 thread_safe_sender_.get(), |
| 1067 quota_message_filter_.get())->QueryStorageUsageAndQuota( | 1075 quota_message_filter_.get())->QueryStorageUsageAndQuota( |
| 1068 storage_partition, | 1076 storage_partition, |
| 1069 static_cast<quota::StorageType>(type), | 1077 static_cast<quota::StorageType>(type), |
| 1070 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); | 1078 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); |
| 1071 } | 1079 } |
| 1072 | 1080 |
| 1073 } // namespace content | 1081 } // namespace content |
| OLD | NEW |