| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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.h" | 5 #include "content/common/gpu/client/gpu_memory_buffer_impl.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/numerics/safe_math.h" | 8 #include "base/numerics/safe_math.h" |
| 9 #include "content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.h" | 9 #include "content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.h" |
| 10 #include "ui/gl/gl_bindings.h" | 10 #include "ui/gl/gl_bindings.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 backend, handle, size, format, usage, callback); | 58 backend, handle, size, format, usage, callback); |
| 59 #endif | 59 #endif |
| 60 #if defined(OS_ANDROID) | 60 #if defined(OS_ANDROID) |
| 61 case gfx::SURFACE_TEXTURE_BUFFER: | 61 case gfx::SURFACE_TEXTURE_BUFFER: |
| 62 return GpuMemoryBufferImplSurfaceTexture::CreateFromHandle( | 62 return GpuMemoryBufferImplSurfaceTexture::CreateFromHandle( |
| 63 backend, handle, size, format, callback); | 63 backend, handle, size, format, callback); |
| 64 #endif | 64 #endif |
| 65 #if defined(USE_OZONE) | 65 #if defined(USE_OZONE) |
| 66 case gfx::OZONE_NATIVE_BUFFER: | 66 case gfx::OZONE_NATIVE_BUFFER: |
| 67 return GpuMemoryBufferImplOzoneNativeBuffer::CreateFromHandle( | 67 return GpuMemoryBufferImplOzoneNativeBuffer::CreateFromHandle( |
| 68 handle, size, format, usage, callback); | 68 backend, handle, size, format, usage, callback); |
| 69 #endif | 69 #endif |
| 70 default: | 70 default: |
| 71 NOTREACHED(); | 71 NOTREACHED(); |
| 72 return nullptr; | 72 return nullptr; |
| 73 } | 73 } |
| 74 } | 74 } |
| 75 | 75 |
| 76 // static | 76 // static |
| 77 GpuMemoryBufferImpl* GpuMemoryBufferImpl::FromClientBuffer( | 77 GpuMemoryBufferImpl* GpuMemoryBufferImpl::FromClientBuffer( |
| 78 ClientBuffer buffer) { | 78 ClientBuffer buffer) { |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 | 200 |
| 201 bool GpuMemoryBufferImpl::IsMapped() const { | 201 bool GpuMemoryBufferImpl::IsMapped() const { |
| 202 return mapped_; | 202 return mapped_; |
| 203 } | 203 } |
| 204 | 204 |
| 205 ClientBuffer GpuMemoryBufferImpl::AsClientBuffer() { | 205 ClientBuffer GpuMemoryBufferImpl::AsClientBuffer() { |
| 206 return reinterpret_cast<ClientBuffer>(this); | 206 return reinterpret_cast<ClientBuffer>(this); |
| 207 } | 207 } |
| 208 | 208 |
| 209 } // namespace content | 209 } // namespace content |
| OLD | NEW |