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

Side by Side Diff: cc/test/test_gpu_memory_buffer_manager.cc

Issue 1051503003: Add R_8 GPU memory buffers format. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address reveman's nits. Created 5 years, 8 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
OLDNEW
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: 15 case gfx::GpuMemoryBuffer::ATCIA:
16 case gfx::GpuMemoryBuffer::DXT5: 16 case gfx::GpuMemoryBuffer::DXT5:
17 return width; 17 return width;
18 case gfx::GpuMemoryBuffer::ATC: 18 case gfx::GpuMemoryBuffer::ATC:
19 case gfx::GpuMemoryBuffer::DXT1: 19 case gfx::GpuMemoryBuffer::DXT1:
20 case gfx::GpuMemoryBuffer::ETC1: 20 case gfx::GpuMemoryBuffer::ETC1:
21 DCHECK_EQ(width % 2, 0U); 21 DCHECK_EQ(width % 2, 0U);
22 return width / 2; 22 return width / 2;
23 case gfx::GpuMemoryBuffer::R_8:
24 return (width + 3) & ~0x3;
23 case gfx::GpuMemoryBuffer::RGBA_8888: 25 case gfx::GpuMemoryBuffer::RGBA_8888:
24 case gfx::GpuMemoryBuffer::RGBX_8888: 26 case gfx::GpuMemoryBuffer::RGBX_8888:
25 case gfx::GpuMemoryBuffer::BGRA_8888: 27 case gfx::GpuMemoryBuffer::BGRA_8888:
26 return width * 4; 28 return width * 4;
27 } 29 }
28 30
29 NOTREACHED(); 31 NOTREACHED();
30 return 0; 32 return 0;
31 } 33 }
32 34
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 ClientBuffer buffer) { 105 ClientBuffer buffer) {
104 return reinterpret_cast<gfx::GpuMemoryBuffer*>(buffer); 106 return reinterpret_cast<gfx::GpuMemoryBuffer*>(buffer);
105 } 107 }
106 108
107 void TestGpuMemoryBufferManager::SetDestructionSyncPoint( 109 void TestGpuMemoryBufferManager::SetDestructionSyncPoint(
108 gfx::GpuMemoryBuffer* buffer, 110 gfx::GpuMemoryBuffer* buffer,
109 uint32 sync_point) { 111 uint32 sync_point) {
110 } 112 }
111 113
112 } // namespace cc 114 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698