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

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

Issue 8953006: Free the command buffer when tabs are switched (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years 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 | « gpu/command_buffer/service/gpu_scheduler_unittest.cc ('k') | no next file » | 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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 } 469 }
470 470
471 // TODO(gman): This needs to be true if this is Pepper. 471 // TODO(gman): This needs to be true if this is Pepper.
472 bool bind_generates_resource = false; 472 bool bind_generates_resource = false;
473 decoder_.reset(::gpu::gles2::GLES2Decoder::Create(context_group ? 473 decoder_.reset(::gpu::gles2::GLES2Decoder::Create(context_group ?
474 context_group->decoder_->GetContextGroup() : 474 context_group->decoder_->GetContextGroup() :
475 new ::gpu::gles2::ContextGroup(bind_generates_resource))); 475 new ::gpu::gles2::ContextGroup(bind_generates_resource)));
476 476
477 gpu_scheduler_.reset(new GpuScheduler(command_buffer_.get(), 477 gpu_scheduler_.reset(new GpuScheduler(command_buffer_.get(),
478 decoder_.get(), 478 decoder_.get(),
479 NULL)); 479 decoder_.get()));
480 480
481 decoder_->set_engine(gpu_scheduler_.get()); 481 decoder_->set_engine(gpu_scheduler_.get());
482 482
483 if (onscreen) { 483 if (onscreen) {
484 if (render_surface == gfx::kNullPluginWindow) { 484 if (render_surface == gfx::kNullPluginWindow) {
485 LOG(ERROR) << "Invalid surface handle for onscreen context."; 485 LOG(ERROR) << "Invalid surface handle for onscreen context.";
486 command_buffer_.reset(); 486 command_buffer_.reset();
487 } else { 487 } else {
488 surface_ = gfx::GLSurface::CreateViewGLSurface(false, render_surface); 488 surface_ = gfx::GLSurface::CreateViewGLSurface(false, render_surface);
489 } 489 }
(...skipping 1199 matching lines...) Expand 10 before | Expand all | Expand 10 after
1689 context_lost_reason_ = GL_UNKNOWN_CONTEXT_RESET_ARB; 1689 context_lost_reason_ = GL_UNKNOWN_CONTEXT_RESET_ARB;
1690 if (context_lost_callback_) { 1690 if (context_lost_callback_) {
1691 context_lost_callback_->onContextLost(); 1691 context_lost_callback_->onContextLost();
1692 } 1692 }
1693 } 1693 }
1694 1694
1695 } // namespace gpu 1695 } // namespace gpu
1696 } // namespace webkit 1696 } // namespace webkit
1697 1697
1698 #endif // defined(ENABLE_GPU) 1698 #endif // defined(ENABLE_GPU)
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gpu_scheduler_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698