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/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 5 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
6 | 6 |
7 #include "third_party/khronos/GLES2/gl2.h" | 7 #include "third_party/khronos/GLES2/gl2.h" |
8 #ifndef GL_GLEXT_PROTOTYPES | 8 #ifndef GL_GLEXT_PROTOTYPES |
9 #define GL_GLEXT_PROTOTYPES 1 | 9 #define GL_GLEXT_PROTOTYPES 1 |
10 #endif | 10 #endif |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
347 attribs.push_back(STENCIL_SIZE); | 347 attribs.push_back(STENCIL_SIZE); |
348 attribs.push_back(attributes_.stencil ? 8 : 0); | 348 attribs.push_back(attributes_.stencil ? 8 : 0); |
349 attribs.push_back(SAMPLES); | 349 attribs.push_back(SAMPLES); |
350 attribs.push_back(attributes_.antialias ? 4 : 0); | 350 attribs.push_back(attributes_.antialias ? 4 : 0); |
351 attribs.push_back(SAMPLE_BUFFERS); | 351 attribs.push_back(SAMPLE_BUFFERS); |
352 attribs.push_back(attributes_.antialias ? 1 : 0); | 352 attribs.push_back(attributes_.antialias ? 1 : 0); |
353 attribs.push_back(FAIL_IF_MAJOR_PERF_CAVEAT); | 353 attribs.push_back(FAIL_IF_MAJOR_PERF_CAVEAT); |
354 attribs.push_back(attributes_.failIfMajorPerformanceCaveat ? 1 : 0); | 354 attribs.push_back(attributes_.failIfMajorPerformanceCaveat ? 1 : 0); |
355 attribs.push_back(LOSE_CONTEXT_WHEN_OUT_OF_MEMORY); | 355 attribs.push_back(LOSE_CONTEXT_WHEN_OUT_OF_MEMORY); |
356 attribs.push_back(lose_context_when_out_of_memory_ ? 1 : 0); | 356 attribs.push_back(lose_context_when_out_of_memory_ ? 1 : 0); |
357 attribs.push_back(BIND_GENERATES_RESOURCES); | |
358 attribs.push_back(bind_generates_resources_ ? 1 : 0); | |
piman
2014/04/02 22:23:00
nit: how about removing bind_generates_resources_
vmiura
2014/04/02 22:44:25
Done.
| |
357 attribs.push_back(NONE); | 359 attribs.push_back(NONE); |
358 | 360 |
359 // Create a proxy to a command buffer in the GPU process. | 361 // Create a proxy to a command buffer in the GPU process. |
360 if (onscreen) { | 362 if (onscreen) { |
361 command_buffer_.reset(host_->CreateViewCommandBuffer( | 363 command_buffer_.reset(host_->CreateViewCommandBuffer( |
362 surface_id_, | 364 surface_id_, |
363 share_group_command_buffer, | 365 share_group_command_buffer, |
364 attribs, | 366 attribs, |
365 active_url_, | 367 active_url_, |
366 gpu_preference_)); | 368 gpu_preference_)); |
(...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1400 | 1402 |
1401 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( | 1403 void WebGraphicsContext3DCommandBufferImpl::OnErrorMessage( |
1402 const std::string& message, int id) { | 1404 const std::string& message, int id) { |
1403 if (error_message_callback_) { | 1405 if (error_message_callback_) { |
1404 blink::WebString str = blink::WebString::fromUTF8(message.c_str()); | 1406 blink::WebString str = blink::WebString::fromUTF8(message.c_str()); |
1405 error_message_callback_->onErrorMessage(str, id); | 1407 error_message_callback_->onErrorMessage(str, id); |
1406 } | 1408 } |
1407 } | 1409 } |
1408 | 1410 |
1409 } // namespace content | 1411 } // namespace content |
OLD | NEW |