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

Unified Diff: content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.cc

Issue 1024113003: Add multi-planar functions to GpuMemoryBuffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment and typo fix. Created 5 years, 9 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: content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.cc
diff --git a/content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.cc b/content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.cc
index 8daff2a9b80c53572bfb969572d0e4b691ca5535..d4894c8d3934a0a8aa62bfaa739d9b717ba014c5 100644
--- a/content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.cc
+++ b/content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.cc
@@ -156,10 +156,12 @@ bool GpuMemoryBufferImplSharedMemory::IsSizeValidForFormat(
return false;
}
-void* GpuMemoryBufferImplSharedMemory::Map() {
+bool GpuMemoryBufferImplSharedMemory::Map(void** data) {
DCHECK(!mapped_);
+ DCHECK_EQ(num_planes_, 1u);
mapped_ = true;
- return shared_memory_->memory();
+ data[0] = shared_memory_->memory();
+ return true;
}
void GpuMemoryBufferImplSharedMemory::Unmap() {
@@ -167,11 +169,13 @@ void GpuMemoryBufferImplSharedMemory::Unmap() {
mapped_ = false;
}
-uint32 GpuMemoryBufferImplSharedMemory::GetStride() const {
+bool GpuMemoryBufferImplSharedMemory::GetStride(uint32* stride) const {
+ DCHECK_EQ(num_planes_, 1u);
size_t stride_in_bytes = 0;
bool valid_stride = StrideInBytes(size_.width(), format_, &stride_in_bytes);
DCHECK(valid_stride);
- return stride_in_bytes;
+ stride[0] = stride_in_bytes;
+ return valid_stride;
}
gfx::GpuMemoryBufferHandle GpuMemoryBufferImplSharedMemory::GetHandle() const {

Powered by Google App Engine
This is Rietveld 408576698