Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(449)

Side by Side Diff: webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc

Issue 7633060: Add option to not generate resources on bind in OpenGL ES (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nacl fix Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/shared_impl/graphics_3d_impl.cc ('k') | webkit/plugins/ppapi/ppb_context_3d_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #if defined(ENABLE_GPU) 5 #if defined(ENABLE_GPU)
6 6
7 #include "webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h" 7 #include "webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h"
8 8
9 #include <GLES2/gl2.h> 9 #include <GLES2/gl2.h>
10 #ifndef GL_GLEXT_PROTOTYPES 10 #ifndef GL_GLEXT_PROTOTYPES
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 attribs.push_back(NONE); 457 attribs.push_back(NONE);
458 attrib_list = NULL; 458 attrib_list = NULL;
459 break; 459 break;
460 } 460 }
461 } 461 }
462 462
463 command_buffer_.reset(new CommandBufferService); 463 command_buffer_.reset(new CommandBufferService);
464 if (!command_buffer_->Initialize(kCommandBufferSize)) 464 if (!command_buffer_->Initialize(kCommandBufferSize))
465 return false; 465 return false;
466 466
467 // TODO(gman): This needs to be true if this is Pepper.
468 bool bind_generates_resource = false;
467 gpu_scheduler_ = GpuScheduler::Create( 469 gpu_scheduler_ = GpuScheduler::Create(
468 command_buffer_.get(), 470 command_buffer_.get(),
469 NULL, 471 NULL,
470 context_group ? 472 context_group ?
471 context_group->gpu_scheduler_->decoder()->GetContextGroup() : 473 context_group->gpu_scheduler_->decoder()->GetContextGroup() :
472 new ::gpu::gles2::ContextGroup); 474 new ::gpu::gles2::ContextGroup(bind_generates_resource));
473 475
474 if (onscreen) { 476 if (onscreen) {
475 if (render_surface == gfx::kNullPluginWindow) { 477 if (render_surface == gfx::kNullPluginWindow) {
476 LOG(ERROR) << "Invalid surface handle for onscreen context."; 478 LOG(ERROR) << "Invalid surface handle for onscreen context.";
477 command_buffer_.reset(); 479 command_buffer_.reset();
478 } else { 480 } else {
479 if (!gpu_scheduler_->Initialize(render_surface, 481 if (!gpu_scheduler_->Initialize(render_surface,
480 gfx::Size(), 482 gfx::Size(),
481 false, 483 false,
482 ::gpu::gles2::DisallowedExtensions(), 484 ::gpu::gles2::DisallowedExtensions(),
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 Destroy(); 538 Destroy();
537 return false; 539 return false;
538 } 540 }
539 541
540 // Create the object exposing the OpenGL API. 542 // Create the object exposing the OpenGL API.
541 gles2_implementation_ = new GLES2Implementation( 543 gles2_implementation_ = new GLES2Implementation(
542 gles2_helper_, 544 gles2_helper_,
543 transfer_buffer.size, 545 transfer_buffer.size,
544 transfer_buffer.ptr, 546 transfer_buffer.ptr,
545 transfer_buffer_id_, 547 transfer_buffer_id_,
546 true); 548 true,
549 false);
547 550
548 size_ = size; 551 size_ = size;
549 552
550 return true; 553 return true;
551 } 554 }
552 555
553 void GLInProcessContext::Destroy() { 556 void GLInProcessContext::Destroy() {
554 if (parent_.get() && parent_texture_id_ != 0) { 557 if (parent_.get() && parent_texture_id_ != 0) {
555 parent_->gles2_implementation_->FreeTextureId(parent_texture_id_); 558 parent_->gles2_implementation_->FreeTextureId(parent_texture_id_);
556 parent_texture_id_ = 0; 559 parent_texture_id_ = 0;
(...skipping 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after
1629 if (context_lost_callback_) { 1632 if (context_lost_callback_) {
1630 context_lost_callback_->onContextLost(); 1633 context_lost_callback_->onContextLost();
1631 } 1634 }
1632 } 1635 }
1633 1636
1634 } // namespace gpu 1637 } // namespace gpu
1635 } // namespace webkit 1638 } // namespace webkit
1636 1639
1637 #endif // defined(ENABLE_GPU) 1640 #endif // defined(ENABLE_GPU)
1638 1641
OLDNEW
« no previous file with comments | « ppapi/shared_impl/graphics_3d_impl.cc ('k') | webkit/plugins/ppapi/ppb_context_3d_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698