OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "cc/test/test_gpu_memory_buffer_manager.h" | 5 #include "cc/test/test_gpu_memory_buffer_manager.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "ui/gfx/gpu_memory_buffer.h" | 8 #include "ui/gfx/gpu_memory_buffer.h" |
9 | 9 |
10 namespace cc { | 10 namespace cc { |
11 namespace { | 11 namespace { |
12 | 12 |
13 size_t StrideInBytes(size_t width, gfx::GpuMemoryBuffer::Format format) { | 13 size_t StrideInBytes(size_t width, gfx::GpuMemoryBuffer::Format format) { |
14 switch (format) { | 14 switch (format) { |
| 15 case gfx::GpuMemoryBuffer::ATCIA: |
| 16 case gfx::GpuMemoryBuffer::DXT5: |
| 17 return width; |
| 18 case gfx::GpuMemoryBuffer::ATC: |
| 19 case gfx::GpuMemoryBuffer::DXT1: |
| 20 case gfx::GpuMemoryBuffer::ETC1: |
| 21 DCHECK_EQ(width % 2, 0U); |
| 22 return width / 2; |
15 case gfx::GpuMemoryBuffer::RGBA_8888: | 23 case gfx::GpuMemoryBuffer::RGBA_8888: |
16 case gfx::GpuMemoryBuffer::RGBX_8888: | 24 case gfx::GpuMemoryBuffer::RGBX_8888: |
17 case gfx::GpuMemoryBuffer::BGRA_8888: | 25 case gfx::GpuMemoryBuffer::BGRA_8888: |
18 return width * 4; | 26 return width * 4; |
19 } | 27 } |
20 | 28 |
21 NOTREACHED(); | 29 NOTREACHED(); |
22 return 0; | 30 return 0; |
23 } | 31 } |
24 | 32 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 ClientBuffer buffer) { | 102 ClientBuffer buffer) { |
95 return reinterpret_cast<gfx::GpuMemoryBuffer*>(buffer); | 103 return reinterpret_cast<gfx::GpuMemoryBuffer*>(buffer); |
96 } | 104 } |
97 | 105 |
98 void TestGpuMemoryBufferManager::SetDestructionSyncPoint( | 106 void TestGpuMemoryBufferManager::SetDestructionSyncPoint( |
99 gfx::GpuMemoryBuffer* buffer, | 107 gfx::GpuMemoryBuffer* buffer, |
100 uint32 sync_point) { | 108 uint32 sync_point) { |
101 } | 109 } |
102 | 110 |
103 } // namespace cc | 111 } // namespace cc |
OLD | NEW |