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

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

Issue 10052018: Drop frontbuffers with ui-use-gpu-process, synchronized with browser, decoupled from backbuffer dro… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 6 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/gpu_command_buffer_stub.h" 5 #include "content/common/gpu/gpu_command_buffer_stub.h"
6 #include "content/common/gpu/gpu_memory_allocation.h" 6 #include "content/common/gpu/gpu_memory_allocation.h"
7 #include "content/common/gpu/gpu_memory_manager.h" 7 #include "content/common/gpu/gpu_memory_manager.h"
8 8
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 23 matching lines...) Expand all
34 return surface_state_; 34 return surface_state_;
35 } 35 }
36 36
37 virtual gfx::Size GetSurfaceSize() const { 37 virtual gfx::Size GetSurfaceSize() const {
38 return size_; 38 return size_;
39 } 39 }
40 virtual bool IsInSameContextShareGroup( 40 virtual bool IsInSameContextShareGroup(
41 const GpuCommandBufferStubBase& stub) const { 41 const GpuCommandBufferStubBase& stub) const {
42 return false; 42 return false;
43 } 43 }
44 virtual void SendMemoryAllocationToProxy(const GpuMemoryAllocation& alloc) {
45 }
46 virtual void SetMemoryAllocation(const GpuMemoryAllocation& alloc) { 44 virtual void SetMemoryAllocation(const GpuMemoryAllocation& alloc) {
47 allocation_ = alloc; 45 allocation_ = alloc;
48 } 46 }
49 }; 47 };
50 48
51 class FakeCommandBufferStubWithoutSurface : public GpuCommandBufferStubBase { 49 class FakeCommandBufferStubWithoutSurface : public GpuCommandBufferStubBase {
52 public: 50 public:
53 GpuMemoryAllocation allocation_; 51 GpuMemoryAllocation allocation_;
54 std::vector<GpuCommandBufferStubBase*> share_group_; 52 std::vector<GpuCommandBufferStubBase*> share_group_;
55 53
(...skipping 14 matching lines...) Expand all
70 68
71 virtual gfx::Size GetSurfaceSize() const { 69 virtual gfx::Size GetSurfaceSize() const {
72 return gfx::Size(); 70 return gfx::Size();
73 } 71 }
74 virtual bool IsInSameContextShareGroup( 72 virtual bool IsInSameContextShareGroup(
75 const GpuCommandBufferStubBase& stub) const { 73 const GpuCommandBufferStubBase& stub) const {
76 return std::find(share_group_.begin(), 74 return std::find(share_group_.begin(),
77 share_group_.end(), 75 share_group_.end(),
78 &stub) != share_group_.end(); 76 &stub) != share_group_.end();
79 } 77 }
80 virtual void SendMemoryAllocationToProxy(const GpuMemoryAllocation& alloc) {
81 }
82 virtual void SetMemoryAllocation(const GpuMemoryAllocation& alloc) { 78 virtual void SetMemoryAllocation(const GpuMemoryAllocation& alloc) {
83 allocation_ = alloc; 79 allocation_ = alloc;
84 } 80 }
85 }; 81 };
86 82
87 class FakeClient : public GpuMemoryManagerClient { 83 class FakeClient : public GpuMemoryManagerClient {
88 public: 84 public:
89 std::vector<GpuCommandBufferStubBase*> stubs_; 85 std::vector<GpuCommandBufferStubBase*> stubs_;
90 86
91 virtual void AppendAllCommandBufferStubs( 87 virtual void AppendAllCommandBufferStubs(
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 EXPECT_NE(allocation, GpuMemoryAllocation(sz+1, buffer_allocation)); 588 EXPECT_NE(allocation, GpuMemoryAllocation(sz+1, buffer_allocation));
593 589
594 for(size_t k = 0; k != suggested_buffer_allocation_values.size(); ++k) { 590 for(size_t k = 0; k != suggested_buffer_allocation_values.size(); ++k) {
595 int buffer_allocation_other = suggested_buffer_allocation_values[k]; 591 int buffer_allocation_other = suggested_buffer_allocation_values[k];
596 if (buffer_allocation == buffer_allocation_other) continue; 592 if (buffer_allocation == buffer_allocation_other) continue;
597 EXPECT_NE(allocation, GpuMemoryAllocation(sz, buffer_allocation_other)); 593 EXPECT_NE(allocation, GpuMemoryAllocation(sz, buffer_allocation_other));
598 } 594 }
599 } 595 }
600 } 596 }
601 } 597 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698