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" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 gfx::GpuMemoryBufferId MojoGpuMemoryBufferImpl::GetId() const { | 81 gfx::GpuMemoryBufferId MojoGpuMemoryBufferImpl::GetId() const { |
82 return gfx::GpuMemoryBufferId(0); | 82 return gfx::GpuMemoryBufferId(0); |
83 } | 83 } |
84 | 84 |
85 gfx::GpuMemoryBufferHandle MojoGpuMemoryBufferImpl::GetHandle() const { | 85 gfx::GpuMemoryBufferHandle MojoGpuMemoryBufferImpl::GetHandle() const { |
86 gfx::GpuMemoryBufferHandle handle; | 86 gfx::GpuMemoryBufferHandle handle; |
87 handle.type = gfx::SHARED_MEMORY_BUFFER; | 87 handle.type = gfx::SHARED_MEMORY_BUFFER; |
88 handle.handle = shared_memory_->handle(); | 88 handle.handle = shared_memory_->handle(); |
89 handle.offset = 0; | 89 handle.offset = 0; |
90 handle.stride = gfx::RowSizeForBufferFormat(size_.width(), format_, 0); | |
91 return handle; | 90 return handle; |
92 } | 91 } |
93 | 92 |
94 ClientBuffer MojoGpuMemoryBufferImpl::AsClientBuffer() { | 93 ClientBuffer MojoGpuMemoryBufferImpl::AsClientBuffer() { |
95 return reinterpret_cast<ClientBuffer>(this); | 94 return reinterpret_cast<ClientBuffer>(this); |
96 } | 95 } |
97 | 96 |
98 } // namespace mus | 97 } // namespace mus |
OLD | NEW |