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

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

Issue 1431333002: Revert of Re-land: ui: Add custom stride support to GLImageMemory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 | « content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.h ('k') | content/common/gpu/gpu_channel.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b7f750e7bbff8241e76d6a11b5c35a26c8630185..9a36a3b7d611951a517a426383586848e6181be4 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
@@ -23,12 +23,10 @@
gfx::BufferFormat format,
const DestructionCallback& callback,
scoped_ptr<base::SharedMemory> shared_memory,
- size_t offset,
- int stride)
+ size_t offset)
: GpuMemoryBufferImpl(id, size, format, callback),
shared_memory_(shared_memory.Pass()),
- offset_(offset),
- stride_(stride) {
+ offset_(offset) {
DCHECK(IsSizeValidForFormat(size, format));
}
@@ -50,8 +48,7 @@
return nullptr;
return make_scoped_ptr(new GpuMemoryBufferImplSharedMemory(
- id, size, format, callback, shared_memory.Pass(), 0,
- gfx::RowSizeForBufferFormat(size.width(), format, 0)));
+ id, size, format, callback, shared_memory.Pass(), 0));
}
// static
@@ -73,7 +70,6 @@
handle.type = gfx::SHARED_MEMORY_BUFFER;
handle.id = id;
handle.offset = 0;
- handle.stride = gfx::RowSizeForBufferFormat(size.width(), format, 0);
shared_memory.GiveToProcess(child_process, &handle.handle);
return handle;
}
@@ -92,7 +88,7 @@
return make_scoped_ptr(new GpuMemoryBufferImplSharedMemory(
handle.id, size, format, callback,
make_scoped_ptr(new base::SharedMemory(handle.handle, false)),
- handle.offset, handle.stride));
+ handle.offset));
}
// static
@@ -166,7 +162,6 @@
DCHECK(rv);
handle->type = gfx::SHARED_MEMORY_BUFFER;
handle->offset = 0;
- handle->stride = gfx::RowSizeForBufferFormat(size.width(), format, 0);
handle->handle = base::SharedMemory::DuplicateHandle(shared_memory.handle());
return base::Bind(&Noop);
}
@@ -177,8 +172,6 @@
// Map the buffer first time Map() is called then keep it mapped for the
// lifetime of the buffer. This avoids mapping the buffer unless necessary.
if (!shared_memory_->memory()) {
- DCHECK_EQ(static_cast<size_t>(stride_),
- gfx::RowSizeForBufferFormat(size_.width(), format_, 0));
size_t buffer_size = gfx::BufferSizeForBufferFormat(size_, format_);
// Note: offset_ != 0 is not common use-case. To keep it simple we
// map offset + buffer_size here but this can be avoided using MapAt().
@@ -212,7 +205,6 @@
handle.type = gfx::SHARED_MEMORY_BUFFER;
handle.id = id_;
handle.offset = offset_;
- handle.stride = stride_;
handle.handle = shared_memory_->handle();
return handle;
}
« no previous file with comments | « content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.h ('k') | content/common/gpu/gpu_channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698