OLD | NEW |
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 19 matching lines...) Expand all Loading... |
30 return surface_state_.surface_id != 0; | 30 return surface_state_.surface_id != 0; |
31 } | 31 } |
32 virtual const SurfaceState& surface_state() const { | 32 virtual const SurfaceState& surface_state() const { |
33 return surface_state_; | 33 return surface_state_; |
34 } | 34 } |
35 | 35 |
36 virtual bool IsInSameContextShareGroup( | 36 virtual bool IsInSameContextShareGroup( |
37 const GpuCommandBufferStubBase& stub) const { | 37 const GpuCommandBufferStubBase& stub) const { |
38 return false; | 38 return false; |
39 } | 39 } |
40 virtual void SendMemoryAllocationToProxy(const GpuMemoryAllocation& alloc) { | |
41 } | |
42 virtual void SetMemoryAllocation(const GpuMemoryAllocation& alloc) { | 40 virtual void SetMemoryAllocation(const GpuMemoryAllocation& alloc) { |
43 allocation_ = alloc; | 41 allocation_ = alloc; |
44 } | 42 } |
45 }; | 43 }; |
46 | 44 |
47 class FakeCommandBufferStubWithoutSurface : public GpuCommandBufferStubBase { | 45 class FakeCommandBufferStubWithoutSurface : public GpuCommandBufferStubBase { |
48 public: | 46 public: |
49 GpuMemoryAllocation allocation_; | 47 GpuMemoryAllocation allocation_; |
50 std::vector<GpuCommandBufferStubBase*> share_group_; | 48 std::vector<GpuCommandBufferStubBase*> share_group_; |
51 | 49 |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 EXPECT_NE(allocation, GpuMemoryAllocation(sz+1, buffer_allocation)); | 552 EXPECT_NE(allocation, GpuMemoryAllocation(sz+1, buffer_allocation)); |
555 | 553 |
556 for(size_t k = 0; k != suggested_buffer_allocation_values.size(); ++k) { | 554 for(size_t k = 0; k != suggested_buffer_allocation_values.size(); ++k) { |
557 int buffer_allocation_other = suggested_buffer_allocation_values[k]; | 555 int buffer_allocation_other = suggested_buffer_allocation_values[k]; |
558 if (buffer_allocation == buffer_allocation_other) continue; | 556 if (buffer_allocation == buffer_allocation_other) continue; |
559 EXPECT_NE(allocation, GpuMemoryAllocation(sz, buffer_allocation_other)); | 557 EXPECT_NE(allocation, GpuMemoryAllocation(sz, buffer_allocation_other)); |
560 } | 558 } |
561 } | 559 } |
562 } | 560 } |
563 } | 561 } |
OLD | NEW |