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

Side by Side Diff: content/common/gpu/gpu_command_buffer_stub.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 #if defined(ENABLE_GPU) 5 #if defined(ENABLE_GPU)
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 } 616 }
617 617
618 void GpuCommandBufferStub::SetMemoryAllocation( 618 void GpuCommandBufferStub::SetMemoryAllocation(
619 const GpuMemoryAllocation& allocation) { 619 const GpuMemoryAllocation& allocation) {
620 if (allocation == allocation_) 620 if (allocation == allocation_)
621 return; 621 return;
622 allocation_ = allocation; 622 allocation_ = allocation;
623 623
624 SendMemoryAllocationToProxy(allocation); 624 SendMemoryAllocationToProxy(allocation);
625 625
626 DCHECK(surface_);
627
626 if (!surface_) 628 if (!surface_)
627 return; 629 return;
628 if (allocation.has_frontbuffer && allocation.has_backbuffer) 630 if (allocation.suggest_have_frontbuffer && allocation.suggest_have_backbuffer)
629 surface_->SetBufferAllocation( 631 surface_->SetBufferAllocation(
630 gfx::GLSurface::BUFFER_ALLOCATION_FRONT_AND_BACK); 632 gfx::GLSurface::BUFFER_ALLOCATION_FRONT_AND_BACK);
631 else if (allocation.has_frontbuffer) 633 else if (allocation.suggest_have_frontbuffer)
632 surface_->SetBufferAllocation( 634 surface_->SetBufferAllocation(
633 gfx::GLSurface::BUFFER_ALLOCATION_FRONT_ONLY); 635 gfx::GLSurface::BUFFER_ALLOCATION_FRONT_ONLY);
634 else 636 else
635 surface_->SetBufferAllocation( 637 surface_->SetBufferAllocation(
636 gfx::GLSurface::BUFFER_ALLOCATION_NONE); 638 gfx::GLSurface::BUFFER_ALLOCATION_NONE);
637 } 639 }
638 640
639 #endif // defined(ENABLE_GPU) 641 #endif // defined(ENABLE_GPU)
OLDNEW
« no previous file with comments | « content/common/gpu/gpu_command_buffer_stub.h ('k') | content/common/gpu/gpu_memory_allocation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698