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

Unified Diff: gpu/ipc/client/gpu_memory_buffer_impl_ozone_native_pixmap.cc

Issue 2272153002: Add ClientNativePixmap multi-planar support. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@client-native-pixmap-dmabug-multiple-planes
Patch Set: ifdef USE_OZONE for unused variables. Created 4 years, 3 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
Index: gpu/ipc/client/gpu_memory_buffer_impl_ozone_native_pixmap.cc
diff --git a/gpu/ipc/client/gpu_memory_buffer_impl_ozone_native_pixmap.cc b/gpu/ipc/client/gpu_memory_buffer_impl_ozone_native_pixmap.cc
index 86855a8a3ddefd95d8dcb09454d3c0e1219f03e3..8e84b7dd73f390fdea7146d372545f78c0fcad41 100644
--- a/gpu/ipc/client/gpu_memory_buffer_impl_ozone_native_pixmap.cc
+++ b/gpu/ipc/client/gpu_memory_buffer_impl_ozone_native_pixmap.cc
@@ -35,8 +35,7 @@ GpuMemoryBufferImplOzoneNativePixmap::GpuMemoryBufferImplOzoneNativePixmap(
: GpuMemoryBufferImpl(id, size, format, callback),
pixmap_(std::move(pixmap)),
planes_(planes),
- fd_(std::move(fd)),
- data_(nullptr) {}
+ fd_(std::move(fd)) {}
GpuMemoryBufferImplOzoneNativePixmap::~GpuMemoryBufferImplOzoneNativePixmap() {}
@@ -101,33 +100,24 @@ base::Closure GpuMemoryBufferImplOzoneNativePixmap::AllocateForTesting(
bool GpuMemoryBufferImplOzoneNativePixmap::Map() {
DCHECK(!mapped_);
- DCHECK(!data_);
- data_ = pixmap_->Map();
- if (!data_)
- return false;
- mapped_ = true;
+ mapped_ = pixmap_->Map();
return mapped_;
}
void* GpuMemoryBufferImplOzoneNativePixmap::memory(size_t plane) {
DCHECK(mapped_);
- DCHECK_LT(plane, gfx::NumberOfPlanesForBufferFormat(format_));
- return data_;
+ return pixmap_->GetMemoryAddress(plane);
}
void GpuMemoryBufferImplOzoneNativePixmap::Unmap() {
DCHECK(mapped_);
- DCHECK(data_);
pixmap_->Unmap();
mapped_ = false;
- data_ = nullptr;
}
int GpuMemoryBufferImplOzoneNativePixmap::stride(size_t plane) const {
DCHECK_LT(plane, gfx::NumberOfPlanesForBufferFormat(format_));
- int stride;
- pixmap_->GetStride(&stride);
- return stride;
+ return pixmap_->GetStride(plane);
}
gfx::GpuMemoryBufferHandle GpuMemoryBufferImplOzoneNativePixmap::GetHandle()
« no previous file with comments | « gpu/ipc/client/gpu_memory_buffer_impl_ozone_native_pixmap.h ('k') | media/gpu/video_decode_accelerator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698