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

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

Issue 9702081: Splitting GpuMemoryAllocation into two parts: for renderer and browser (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adding unittests for GpuMemoryAllocation comparison functions since they have become not as trivial. 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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 void ContentGLContext::SetMemoryAllocationChangedCallback( 282 void ContentGLContext::SetMemoryAllocationChangedCallback(
283 const base::Callback<void(const GpuMemoryAllocation&)>& callback) { 283 const base::Callback<void(const GpuMemoryAllocationForRenderer&)>&
284 callback) {
284 GetCommandBufferProxy()->SetMemoryAllocationChangedCallback(callback); 285 GetCommandBufferProxy()->SetMemoryAllocationChangedCallback(callback);
285 } 286 }
286 287
287 // TODO(gman): Remove This 288 // TODO(gman): Remove This
288 void ContentGLContext::DisableShaderTranslation() { 289 void ContentGLContext::DisableShaderTranslation() {
289 NOTREACHED(); 290 NOTREACHED();
290 } 291 }
291 292
292 gpu::gles2::GLES2Implementation* ContentGLContext::GetImplementation() { 293 gpu::gles2::GLES2Implementation* ContentGLContext::GetImplementation() {
293 return gles2_implementation_; 294 return gles2_implementation_;
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 void ContentGLContext::OnContextLost() { 468 void ContentGLContext::OnContextLost() {
468 if (!context_lost_callback_.is_null()) { 469 if (!context_lost_callback_.is_null()) {
469 ContentGLContext::ContextLostReason reason = kUnknown; 470 ContentGLContext::ContextLostReason reason = kUnknown;
470 if (command_buffer_) { 471 if (command_buffer_) {
471 reason = ConvertReason( 472 reason = ConvertReason(
472 command_buffer_->GetLastState().context_lost_reason); 473 command_buffer_->GetLastState().context_lost_reason);
473 } 474 }
474 context_lost_callback_.Run(reason); 475 context_lost_callback_.Run(reason);
475 } 476 }
476 } 477 }
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