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 "gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.h" | 5 #include "gpu/ipc/client/gpu_memory_buffer_impl_shared_memory.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 switch (format) { | 126 switch (format) { |
127 case gfx::BufferFormat::ATC: | 127 case gfx::BufferFormat::ATC: |
128 case gfx::BufferFormat::ATCIA: | 128 case gfx::BufferFormat::ATCIA: |
129 case gfx::BufferFormat::DXT1: | 129 case gfx::BufferFormat::DXT1: |
130 case gfx::BufferFormat::DXT5: | 130 case gfx::BufferFormat::DXT5: |
131 case gfx::BufferFormat::ETC1: | 131 case gfx::BufferFormat::ETC1: |
132 // Compressed images must have a width and height that's evenly divisible | 132 // Compressed images must have a width and height that's evenly divisible |
133 // by the block size. | 133 // by the block size. |
134 return size.width() % 4 == 0 && size.height() % 4 == 0; | 134 return size.width() % 4 == 0 && size.height() % 4 == 0; |
135 case gfx::BufferFormat::R_8: | 135 case gfx::BufferFormat::R_8: |
| 136 case gfx::BufferFormat::RG_88: |
136 case gfx::BufferFormat::BGR_565: | 137 case gfx::BufferFormat::BGR_565: |
137 case gfx::BufferFormat::RGBA_4444: | 138 case gfx::BufferFormat::RGBA_4444: |
138 case gfx::BufferFormat::RGBA_8888: | 139 case gfx::BufferFormat::RGBA_8888: |
139 case gfx::BufferFormat::RGBX_8888: | 140 case gfx::BufferFormat::RGBX_8888: |
140 case gfx::BufferFormat::BGRA_8888: | 141 case gfx::BufferFormat::BGRA_8888: |
141 case gfx::BufferFormat::BGRX_8888: | 142 case gfx::BufferFormat::BGRX_8888: |
142 return true; | 143 return true; |
143 case gfx::BufferFormat::YVU_420: | 144 case gfx::BufferFormat::YVU_420: |
144 case gfx::BufferFormat::YUV_420_BIPLANAR: { | 145 case gfx::BufferFormat::YUV_420_BIPLANAR: { |
145 size_t num_planes = gfx::NumberOfPlanesForBufferFormat(format); | 146 size_t num_planes = gfx::NumberOfPlanesForBufferFormat(format); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 gfx::GpuMemoryBufferHandle handle; | 217 gfx::GpuMemoryBufferHandle handle; |
217 handle.type = gfx::SHARED_MEMORY_BUFFER; | 218 handle.type = gfx::SHARED_MEMORY_BUFFER; |
218 handle.id = id_; | 219 handle.id = id_; |
219 handle.offset = offset_; | 220 handle.offset = offset_; |
220 handle.stride = stride_; | 221 handle.stride = stride_; |
221 handle.handle = shared_memory_->handle(); | 222 handle.handle = shared_memory_->handle(); |
222 return handle; | 223 return handle; |
223 } | 224 } |
224 | 225 |
225 } // namespace gpu | 226 } // namespace gpu |
OLD | NEW |