Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3145)

Unified Diff: components/mus/gles2/mojo_gpu_memory_buffer.cc

Issue 1857243005: Scan-out capable buffers (aka ui::NativePixmap) for Mus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: build fix for windows Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/mus/gles2/mojo_gpu_memory_buffer.h ('k') | components/mus/gles2/ozone_gpu_memory_buffer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/gles2/mojo_gpu_memory_buffer.cc
diff --git a/components/mus/gles2/mojo_gpu_memory_buffer.cc b/components/mus/gles2/mojo_gpu_memory_buffer.cc
index 545fe236e040fbad765ff4b7c1820e2f85d39131..b3cc044b25bf3f01aca5a0cefddce418fd7658bb 100644
--- a/components/mus/gles2/mojo_gpu_memory_buffer.cc
+++ b/components/mus/gles2/mojo_gpu_memory_buffer.cc
@@ -18,11 +18,10 @@ MojoGpuMemoryBufferImpl::MojoGpuMemoryBufferImpl(
const gfx::Size& size,
gfx::BufferFormat format,
scoped_ptr<base::SharedMemory> shared_memory)
- : size_(size),
- format_(format),
- shared_memory_(std::move(shared_memory)),
- mapped_(false) {}
+ : GpuMemoryBufferImpl(gfx::GenericSharedMemoryId(0), size, format),
+ shared_memory_(std::move(shared_memory)) {}
+// TODO(rjkroege): Support running a destructor callback as necessary.
MojoGpuMemoryBufferImpl::~MojoGpuMemoryBufferImpl() {}
scoped_ptr<gfx::GpuMemoryBuffer> MojoGpuMemoryBufferImpl::Create(
@@ -69,24 +68,12 @@ void MojoGpuMemoryBufferImpl::Unmap() {
mapped_ = false;
}
-gfx::Size MojoGpuMemoryBufferImpl::GetSize() const {
- return size_;
-}
-
-gfx::BufferFormat MojoGpuMemoryBufferImpl::GetFormat() const {
- return format_;
-}
-
int MojoGpuMemoryBufferImpl::stride(size_t plane) const {
DCHECK_LT(plane, gfx::NumberOfPlanesForBufferFormat(format_));
return base::checked_cast<int>(gfx::RowSizeForBufferFormat(
size_.width(), format_, static_cast<int>(plane)));
}
-gfx::GpuMemoryBufferId MojoGpuMemoryBufferImpl::GetId() const {
- return gfx::GpuMemoryBufferId(0);
-}
-
gfx::GpuMemoryBufferHandle MojoGpuMemoryBufferImpl::GetHandle() const {
gfx::GpuMemoryBufferHandle handle;
handle.type = gfx::SHARED_MEMORY_BUFFER;
@@ -94,11 +81,12 @@ gfx::GpuMemoryBufferHandle MojoGpuMemoryBufferImpl::GetHandle() const {
handle.offset = 0;
handle.stride = static_cast<int32_t>(
gfx::RowSizeForBufferFormat(size_.width(), format_, 0));
+
return handle;
}
-ClientBuffer MojoGpuMemoryBufferImpl::AsClientBuffer() {
- return reinterpret_cast<ClientBuffer>(this);
+gfx::GpuMemoryBufferType MojoGpuMemoryBufferImpl::GetBufferType() const {
+ return gfx::SHARED_MEMORY_BUFFER;
}
} // namespace mus
« no previous file with comments | « components/mus/gles2/mojo_gpu_memory_buffer.h ('k') | components/mus/gles2/ozone_gpu_memory_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698