| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 handle.id, | 94 handle.id, |
| 95 size, | 95 size, |
| 96 format, | 96 format, |
| 97 callback, | 97 callback, |
| 98 make_scoped_ptr(new base::SharedMemory(handle.handle, false)))); | 98 make_scoped_ptr(new base::SharedMemory(handle.handle, false)))); |
| 99 } | 99 } |
| 100 | 100 |
| 101 // static | 101 // static |
| 102 bool GpuMemoryBufferImplSharedMemory::IsFormatSupported(Format format) { | 102 bool GpuMemoryBufferImplSharedMemory::IsFormatSupported(Format format) { |
| 103 switch (format) { | 103 switch (format) { |
| 104 case ATC: |
| 105 case ATCIA: |
| 106 case DXT1: |
| 107 case DXT5: |
| 108 case ETC1: |
| 104 case RGBA_8888: | 109 case RGBA_8888: |
| 105 case BGRA_8888: | 110 case BGRA_8888: |
| 106 return true; | 111 return true; |
| 107 case RGBX_8888: | 112 case RGBX_8888: |
| 108 return false; | 113 return false; |
| 109 } | 114 } |
| 110 | 115 |
| 111 NOTREACHED(); | 116 NOTREACHED(); |
| 112 return false; | 117 return false; |
| 113 } | 118 } |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 | 150 |
| 146 gfx::GpuMemoryBufferHandle GpuMemoryBufferImplSharedMemory::GetHandle() const { | 151 gfx::GpuMemoryBufferHandle GpuMemoryBufferImplSharedMemory::GetHandle() const { |
| 147 gfx::GpuMemoryBufferHandle handle; | 152 gfx::GpuMemoryBufferHandle handle; |
| 148 handle.type = gfx::SHARED_MEMORY_BUFFER; | 153 handle.type = gfx::SHARED_MEMORY_BUFFER; |
| 149 handle.id = id_; | 154 handle.id = id_; |
| 150 handle.handle = shared_memory_->handle(); | 155 handle.handle = shared_memory_->handle(); |
| 151 return handle; | 156 return handle; |
| 152 } | 157 } |
| 153 | 158 |
| 154 } // namespace content | 159 } // namespace content |
| OLD | NEW |