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

Side by Side Diff: content/renderer/gpu/renderer_gl_context.cc

Issue 8919014: Revert "Revert 113479 - Revert "Revert 113250 - Add CommandBuffer::SetGetBuffer"" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
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 #include "content/renderer/gpu/renderer_gl_context.h" 5 #include "content/renderer/gpu/renderer_gl_context.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 } 373 }
374 if (!command_buffer_) { 374 if (!command_buffer_) {
375 Destroy(); 375 Destroy();
376 return false; 376 return false;
377 } 377 }
378 378
379 { 379 {
380 TRACE_EVENT0("gpu", 380 TRACE_EVENT0("gpu",
381 "RendererGLContext::Initialize::InitializeCommandBuffer"); 381 "RendererGLContext::Initialize::InitializeCommandBuffer");
382 // Initiaize the command buffer. 382 // Initiaize the command buffer.
383 if (!command_buffer_->Initialize(kCommandBufferSize)) { 383 if (!command_buffer_->Initialize()) {
384 Destroy(); 384 Destroy();
385 return false; 385 return false;
386 } 386 }
387 } 387 }
388 388
389 command_buffer_->SetChannelErrorCallback( 389 command_buffer_->SetChannelErrorCallback(
390 base::Bind(&RendererGLContext::OnContextLost, base::Unretained(this))); 390 base::Bind(&RendererGLContext::OnContextLost, base::Unretained(this)));
391 391
392 // Create the GLES2 helper, which writes the command buffer protocol. 392 // Create the GLES2 helper, which writes the command buffer protocol.
393 gles2_helper_ = new gpu::gles2::GLES2CmdHelper(command_buffer_); 393 gles2_helper_ = new gpu::gles2::GLES2CmdHelper(command_buffer_);
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 void RendererGLContext::OnContextLost() { 464 void RendererGLContext::OnContextLost() {
465 if (!context_lost_callback_.is_null()) { 465 if (!context_lost_callback_.is_null()) {
466 RendererGLContext::ContextLostReason reason = kUnknown; 466 RendererGLContext::ContextLostReason reason = kUnknown;
467 if (command_buffer_) { 467 if (command_buffer_) {
468 reason = ConvertReason( 468 reason = ConvertReason(
469 command_buffer_->GetLastState().context_lost_reason); 469 command_buffer_->GetLastState().context_lost_reason);
470 } 470 }
471 context_lost_callback_.Run(reason); 471 context_lost_callback_.Run(reason);
472 } 472 }
473 } 473 }
OLDNEW
« no previous file with comments | « content/renderer/gpu/command_buffer_proxy.cc ('k') | gpu/command_buffer/client/cmd_buffer_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698