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 <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1010 return nullptr; | 1010 return nullptr; |
1011 } | 1011 } |
1012 share_context = share_provider_impl->context_provider(); | 1012 share_context = share_provider_impl->context_provider(); |
1013 } | 1013 } |
1014 | 1014 |
1015 bool is_software_rendering = gpu_channel_host->gpu_info().software_rendering; | 1015 bool is_software_rendering = gpu_channel_host->gpu_info().software_rendering; |
1016 | 1016 |
1017 // This is an offscreen context, which doesn't use the default frame buffer, | 1017 // This is an offscreen context, which doesn't use the default frame buffer, |
1018 // so don't request any alpha, depth, stencil, antialiasing. | 1018 // so don't request any alpha, depth, stencil, antialiasing. |
1019 gpu::gles2::ContextCreationAttribHelper attributes; | 1019 gpu::gles2::ContextCreationAttribHelper attributes; |
1020 attributes.alpha_size = -1; | 1020 |
1021 attributes.depth_size = 0; | 1021 if (web_attributes.supportOwnOffscreenSurface) { |
1022 attributes.stencil_size = 0; | 1022 attributes.own_offscreen_surface = true; |
1023 attributes.samples = 0; | 1023 attributes.alpha_size = web_attributes.supportAlpha ? 8 : -1; |
1024 attributes.sample_buffers = 0; | 1024 attributes.depth_size = web_attributes.supportDepth ? 24 : 0; |
1025 attributes.stencil_size = web_attributes.supportStencil ? 8 : 0; | |
1026 attributes.samples = web_attributes.supportAntialias ? 4 : 0; | |
1027 attributes.sample_buffers = 0; | |
1028 } else { | |
1029 attributes.depth_size = 0; | |
mthiesse
2017/02/15 21:36:43
Are you missing attributes.alpha_size = -1? Or was
klausw
2017/02/15 22:16:33
Re-added.
I had removed it in http://crrev.com/25
| |
1030 attributes.stencil_size = 0; | |
1031 attributes.samples = 0; | |
1032 attributes.sample_buffers = 0; | |
1033 } | |
1025 attributes.bind_generates_resource = false; | 1034 attributes.bind_generates_resource = false; |
1026 // Prefer discrete GPU for WebGL. | 1035 // Prefer discrete GPU for WebGL. |
1027 attributes.gpu_preference = gl::PreferDiscreteGpu; | 1036 attributes.gpu_preference = gl::PreferDiscreteGpu; |
1028 | 1037 |
1029 attributes.fail_if_major_perf_caveat = | 1038 attributes.fail_if_major_perf_caveat = |
1030 web_attributes.failIfMajorPerformanceCaveat; | 1039 web_attributes.failIfMajorPerformanceCaveat; |
1040 | |
1031 DCHECK_GT(web_attributes.webGLVersion, 0u); | 1041 DCHECK_GT(web_attributes.webGLVersion, 0u); |
1032 DCHECK_LE(web_attributes.webGLVersion, 2u); | 1042 DCHECK_LE(web_attributes.webGLVersion, 2u); |
1033 if (web_attributes.webGLVersion == 2) | 1043 if (web_attributes.webGLVersion == 2) |
1034 attributes.context_type = gpu::gles2::CONTEXT_TYPE_WEBGL2; | 1044 attributes.context_type = gpu::gles2::CONTEXT_TYPE_WEBGL2; |
1035 else | 1045 else |
1036 attributes.context_type = gpu::gles2::CONTEXT_TYPE_WEBGL1; | 1046 attributes.context_type = gpu::gles2::CONTEXT_TYPE_WEBGL1; |
1037 | 1047 |
1038 constexpr bool automatic_flushes = true; | 1048 constexpr bool automatic_flushes = true; |
1039 constexpr bool support_locking = false; | 1049 constexpr bool support_locking = false; |
1040 | 1050 |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1283 return &trial_token_validator_; | 1293 return &trial_token_validator_; |
1284 } | 1294 } |
1285 | 1295 |
1286 void RendererBlinkPlatformImpl::workerContextCreated( | 1296 void RendererBlinkPlatformImpl::workerContextCreated( |
1287 const v8::Local<v8::Context>& worker) { | 1297 const v8::Local<v8::Context>& worker) { |
1288 GetContentClient()->renderer()->DidInitializeWorkerContextOnWorkerThread( | 1298 GetContentClient()->renderer()->DidInitializeWorkerContextOnWorkerThread( |
1289 worker); | 1299 worker); |
1290 } | 1300 } |
1291 | 1301 |
1292 } // namespace content | 1302 } // namespace content |
OLD | NEW |