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

Side by Side Diff: content/common/gpu/gpu_command_buffer_stub.cc

Issue 10274009: GpuMemoryManager should limit memory allocations based on viewport size for android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adding const Created 8 years, 7 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
« no previous file with comments | « content/common/gpu/gpu_command_buffer_stub.h ('k') | content/common/gpu/gpu_memory_manager.cc » ('j') | 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) 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 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 void GpuCommandBufferStub::AddDestructionObserver( 615 void GpuCommandBufferStub::AddDestructionObserver(
616 DestructionObserver* observer) { 616 DestructionObserver* observer) {
617 destruction_observers_.AddObserver(observer); 617 destruction_observers_.AddObserver(observer);
618 } 618 }
619 619
620 void GpuCommandBufferStub::RemoveDestructionObserver( 620 void GpuCommandBufferStub::RemoveDestructionObserver(
621 DestructionObserver* observer) { 621 DestructionObserver* observer) {
622 destruction_observers_.RemoveObserver(observer); 622 destruction_observers_.RemoveObserver(observer);
623 } 623 }
624 624
625 gfx::Size GpuCommandBufferStub::GetSurfaceSize() const {
626 if (!surface_)
627 return gfx::Size();
628 return surface_->GetSize();
629 }
630
625 bool GpuCommandBufferStub::IsInSameContextShareGroup( 631 bool GpuCommandBufferStub::IsInSameContextShareGroup(
626 const GpuCommandBufferStubBase& other) const { 632 const GpuCommandBufferStubBase& other) const {
627 return context_group_ == 633 return context_group_ ==
628 static_cast<const GpuCommandBufferStub&>(other).context_group_; 634 static_cast<const GpuCommandBufferStub&>(other).context_group_;
629 } 635 }
630 636
631 bool GpuCommandBufferStub:: 637 bool GpuCommandBufferStub::
632 client_has_memory_allocation_changed_callback() const { 638 client_has_memory_allocation_changed_callback() const {
633 return client_has_memory_allocation_changed_callback_; 639 return client_has_memory_allocation_changed_callback_;
634 } 640 }
(...skipping 14 matching lines...) Expand all
649 } 655 }
650 656
651 void GpuCommandBufferStub::SetMemoryAllocation( 657 void GpuCommandBufferStub::SetMemoryAllocation(
652 const GpuMemoryAllocation& allocation) { 658 const GpuMemoryAllocation& allocation) {
653 allocation_ = allocation; 659 allocation_ = allocation;
654 660
655 SendMemoryAllocationToProxy(allocation); 661 SendMemoryAllocationToProxy(allocation);
656 } 662 }
657 663
658 #endif // defined(ENABLE_GPU) 664 #endif // defined(ENABLE_GPU)
OLDNEW
« no previous file with comments | « content/common/gpu/gpu_command_buffer_stub.h ('k') | content/common/gpu/gpu_memory_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698