| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/mus/gles2/mojo_gpu_memory_buffer.h" | 5 #include "components/mus/gles2/mojo_gpu_memory_buffer.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/shared_memory.h" | 8 #include "base/memory/shared_memory.h" |
| 9 #include "base/numerics/safe_conversions.h" | 9 #include "base/numerics/safe_conversions.h" |
| 10 #include "ui/gfx/buffer_format_util.h" | 10 #include "ui/gfx/buffer_format_util.h" |
| 11 | 11 |
| 12 namespace mus { | 12 namespace gles2 { |
| 13 | 13 |
| 14 MojoGpuMemoryBufferImpl::MojoGpuMemoryBufferImpl( | 14 MojoGpuMemoryBufferImpl::MojoGpuMemoryBufferImpl( |
| 15 const gfx::Size& size, | 15 const gfx::Size& size, |
| 16 gfx::BufferFormat format, | 16 gfx::BufferFormat format, |
| 17 scoped_ptr<base::SharedMemory> shared_memory) | 17 scoped_ptr<base::SharedMemory> shared_memory) |
| 18 : size_(size), | 18 : size_(size), |
| 19 format_(format), | 19 format_(format), |
| 20 shared_memory_(shared_memory.Pass()), | 20 shared_memory_(shared_memory.Pass()), |
| 21 mapped_(false) {} | 21 mapped_(false) {} |
| 22 | 22 |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 gfx::GpuMemoryBufferHandle handle; | 90 gfx::GpuMemoryBufferHandle handle; |
| 91 handle.type = gfx::SHARED_MEMORY_BUFFER; | 91 handle.type = gfx::SHARED_MEMORY_BUFFER; |
| 92 handle.handle = shared_memory_->handle(); | 92 handle.handle = shared_memory_->handle(); |
| 93 return handle; | 93 return handle; |
| 94 } | 94 } |
| 95 | 95 |
| 96 ClientBuffer MojoGpuMemoryBufferImpl::AsClientBuffer() { | 96 ClientBuffer MojoGpuMemoryBufferImpl::AsClientBuffer() { |
| 97 return reinterpret_cast<ClientBuffer>(this); | 97 return reinterpret_cast<ClientBuffer>(this); |
| 98 } | 98 } |
| 99 | 99 |
| 100 } // namespace mus | 100 } // namespace gles2 |
| OLD | NEW |