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

Side by Side Diff: content/common/gpu/client/content_gl_context.cc

Issue 9699125: Chromium implementation of discardBackbuffer WebGraphicsContext3D extension. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Renaming extension for now, so its not mistaken for the standard one Created 8 years, 9 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
OLDNEW
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/content_gl_context.h" 5 #include "content/common/gpu/client/content_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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 } 272 }
273 273
274 int ContentGLContext::GetContextID() { 274 int ContentGLContext::GetContextID() {
275 return command_buffer_->route_id(); 275 return command_buffer_->route_id();
276 } 276 }
277 277
278 bool ContentGLContext::SetSurfaceVisible(bool visible) { 278 bool ContentGLContext::SetSurfaceVisible(bool visible) {
279 return GetCommandBufferProxy()->SetSurfaceVisible(visible); 279 return GetCommandBufferProxy()->SetSurfaceVisible(visible);
280 } 280 }
281 281
282 bool ContentGLContext::DiscardBackbuffer() {
283 return GetCommandBufferProxy()->DiscardBackbuffer();
284 }
285
286 bool ContentGLContext::EnsureBackbuffer() {
287 return GetCommandBufferProxy()->EnsureBackbuffer();
288 }
289
282 void ContentGLContext::SetMemoryAllocationChangedCallback( 290 void ContentGLContext::SetMemoryAllocationChangedCallback(
283 const base::Callback<void(const GpuMemoryAllocationForRenderer&)>& 291 const base::Callback<void(const GpuMemoryAllocationForRenderer&)>&
284 callback) { 292 callback) {
285 GetCommandBufferProxy()->SetMemoryAllocationChangedCallback(callback); 293 GetCommandBufferProxy()->SetMemoryAllocationChangedCallback(callback);
286 } 294 }
287 295
288 // TODO(gman): Remove This 296 // TODO(gman): Remove This
289 void ContentGLContext::DisableShaderTranslation() { 297 void ContentGLContext::DisableShaderTranslation() {
290 NOTREACHED(); 298 NOTREACHED();
291 } 299 }
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 void ContentGLContext::OnContextLost() { 476 void ContentGLContext::OnContextLost() {
469 if (!context_lost_callback_.is_null()) { 477 if (!context_lost_callback_.is_null()) {
470 ContentGLContext::ContextLostReason reason = kUnknown; 478 ContentGLContext::ContextLostReason reason = kUnknown;
471 if (command_buffer_) { 479 if (command_buffer_) {
472 reason = ConvertReason( 480 reason = ConvertReason(
473 command_buffer_->GetLastState().context_lost_reason); 481 command_buffer_->GetLastState().context_lost_reason);
474 } 482 }
475 context_lost_callback_.Run(reason); 483 context_lost_callback_.Run(reason);
476 } 484 }
477 } 485 }
OLDNEW
« no previous file with comments | « content/common/gpu/client/content_gl_context.h ('k') | content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698