| 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 "content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.h" | 5 #include "content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/numerics/safe_math.h" | 8 #include "base/numerics/safe_math.h" |
| 9 #include "ui/gl/gl_bindings.h" | 9 #include "ui/gl/gl_bindings.h" |
| 10 | 10 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 handle.id, | 108 handle.id, |
| 109 size, | 109 size, |
| 110 format, | 110 format, |
| 111 callback, | 111 callback, |
| 112 shared_memory.Pass())); | 112 shared_memory.Pass())); |
| 113 } | 113 } |
| 114 | 114 |
| 115 // static | 115 // static |
| 116 bool GpuMemoryBufferImplSharedMemory::IsFormatSupported(Format format) { | 116 bool GpuMemoryBufferImplSharedMemory::IsFormatSupported(Format format) { |
| 117 switch (format) { | 117 switch (format) { |
| 118 case ATC: |
| 119 case ATCIA: |
| 120 case DXT1: |
| 121 case DXT5: |
| 122 case ETC1: |
| 118 case RGBA_8888: | 123 case RGBA_8888: |
| 119 case BGRA_8888: | 124 case BGRA_8888: |
| 120 return true; | 125 return true; |
| 121 case RGBX_8888: | 126 case RGBX_8888: |
| 122 return false; | 127 return false; |
| 123 } | 128 } |
| 124 | 129 |
| 125 NOTREACHED(); | 130 NOTREACHED(); |
| 126 return false; | 131 return false; |
| 127 } | 132 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 146 | 151 |
| 147 gfx::GpuMemoryBufferHandle GpuMemoryBufferImplSharedMemory::GetHandle() const { | 152 gfx::GpuMemoryBufferHandle GpuMemoryBufferImplSharedMemory::GetHandle() const { |
| 148 gfx::GpuMemoryBufferHandle handle; | 153 gfx::GpuMemoryBufferHandle handle; |
| 149 handle.type = gfx::SHARED_MEMORY_BUFFER; | 154 handle.type = gfx::SHARED_MEMORY_BUFFER; |
| 150 handle.id = id_; | 155 handle.id = id_; |
| 151 handle.handle = shared_memory_->handle(); | 156 handle.handle = shared_memory_->handle(); |
| 152 return handle; | 157 return handle; |
| 153 } | 158 } |
| 154 | 159 |
| 155 } // namespace content | 160 } // namespace content |
| OLD | NEW |