| 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_blink_platform_impl.h" | 5 #include "content/renderer/renderer_blink_platform_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1051 DCHECK_LE(web_attributes.webGLVersion, 2u); | 1051 DCHECK_LE(web_attributes.webGLVersion, 2u); |
| 1052 if (web_attributes.webGLVersion == 1) | 1052 if (web_attributes.webGLVersion == 1) |
| 1053 attributes.context_type = gpu::gles2::CONTEXT_TYPE_WEBGL1; | 1053 attributes.context_type = gpu::gles2::CONTEXT_TYPE_WEBGL1; |
| 1054 else if (web_attributes.webGLVersion == 2) | 1054 else if (web_attributes.webGLVersion == 2) |
| 1055 attributes.context_type = gpu::gles2::CONTEXT_TYPE_WEBGL2; | 1055 attributes.context_type = gpu::gles2::CONTEXT_TYPE_WEBGL2; |
| 1056 | 1056 |
| 1057 bool share_resources = false; | 1057 bool share_resources = false; |
| 1058 bool automatic_flushes = true; | 1058 bool automatic_flushes = true; |
| 1059 // Prefer discrete GPU for WebGL. | 1059 // Prefer discrete GPU for WebGL. |
| 1060 gfx::GpuPreference gpu_preference = gfx::PreferDiscreteGpu; | 1060 gfx::GpuPreference gpu_preference = gfx::PreferDiscreteGpu; |
| 1061 WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits limits; | |
| 1062 | 1061 |
| 1063 scoped_refptr<ContextProviderCommandBuffer> provider( | 1062 scoped_refptr<ContextProviderCommandBuffer> provider( |
| 1064 new ContextProviderCommandBuffer( | 1063 new ContextProviderCommandBuffer( |
| 1065 base::WrapUnique(new WebGraphicsContext3DCommandBufferImpl( | 1064 base::WrapUnique(new WebGraphicsContext3DCommandBufferImpl( |
| 1066 gpu::kNullSurfaceHandle, GURL(top_document_web_url), | 1065 gpu::kNullSurfaceHandle, GURL(top_document_web_url), |
| 1067 gpu_channel_host.get(), attributes, gpu_preference, | 1066 gpu_channel_host.get(), attributes, gpu_preference, |
| 1068 share_resources, automatic_flushes, limits, share_context)), | 1067 share_resources, automatic_flushes, share_context)), |
| 1069 RENDERER_MAINTHREAD_CONTEXT)); | 1068 gpu::SharedMemoryLimits(), RENDERER_MAINTHREAD_CONTEXT)); |
| 1070 if (!provider->BindToCurrentThread()) { | 1069 if (!provider->BindToCurrentThread()) { |
| 1071 // Collect Graphicsinfo if there is a context failure or it is failed | 1070 // Collect Graphicsinfo if there is a context failure or it is failed |
| 1072 // purposefully in case of layout tests. | 1071 // purposefully in case of layout tests. |
| 1073 Collect3DContextInformationOnFailure(gl_info, gpu_channel_host.get()); | 1072 Collect3DContextInformationOnFailure(gl_info, gpu_channel_host.get()); |
| 1074 return nullptr; | 1073 return nullptr; |
| 1075 } | 1074 } |
| 1076 return new WebGraphicsContext3DProviderImpl(std::move(provider)); | 1075 return new WebGraphicsContext3DProviderImpl(std::move(provider)); |
| 1077 } | 1076 } |
| 1078 | 1077 |
| 1079 //------------------------------------------------------------------------------ | 1078 //------------------------------------------------------------------------------ |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1291 } | 1290 } |
| 1292 | 1291 |
| 1293 //------------------------------------------------------------------------------ | 1292 //------------------------------------------------------------------------------ |
| 1294 | 1293 |
| 1295 blink::WebTrialTokenValidator* | 1294 blink::WebTrialTokenValidator* |
| 1296 RendererBlinkPlatformImpl::trialTokenValidator() { | 1295 RendererBlinkPlatformImpl::trialTokenValidator() { |
| 1297 return &trial_token_validator_; | 1296 return &trial_token_validator_; |
| 1298 } | 1297 } |
| 1299 | 1298 |
| 1300 } // namespace content | 1299 } // namespace content |
| OLD | NEW |