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

Unified Diff: ui/gl/gl_image_shared_memory_unittest.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 | « ui/gl/gl_image_shared_memory.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_image_shared_memory_unittest.cc
diff --git a/ui/gl/gl_image_shared_memory_unittest.cc b/ui/gl/gl_image_shared_memory_unittest.cc
index da6feac37d4040512eafc5fa1b290c9312c5a82b..276996078eb0c20630301d103ca46122192cc7cc 100644
--- a/ui/gl/gl_image_shared_memory_unittest.cc
+++ b/ui/gl/gl_image_shared_memory_unittest.cc
@@ -30,8 +30,7 @@
size, gl::GLImageMemory::GetInternalFormatForTesting(format)));
rv = image->Initialize(
base::SharedMemory::DuplicateHandle(shared_memory.handle()),
- gfx::GenericSharedMemoryId(0), format, 0,
- gfx::RowSizeForBufferFormat(size.width(), format, 0));
+ gfx::GenericSharedMemoryId(0), format, 0);
EXPECT_TRUE(rv);
return image;
}
@@ -56,13 +55,10 @@
scoped_refptr<gl::GLImage> CreateSolidColorImage(
const gfx::Size& size,
const uint8_t color[4]) const {
- // Create a shared memory segment that holds an image with a stride that is
- // twice the row size and 2 pages larger than image.
- size_t stride = gfx::RowSizeForBufferFormat(
- size.width(), gfx::BufferFormat::RGBA_8888, 0) *
- 2;
+ // Create a shared memory segment that is 2 pages larger than image.
size_t pool_size =
- stride * size.height() + base::SysInfo::VMAllocationGranularity() * 3;
+ gfx::BufferSizeForBufferFormat(size, gfx::BufferFormat::RGBA_8888) +
+ base::SysInfo::VMAllocationGranularity() * 3;
base::SharedMemory shared_memory;
bool rv = shared_memory.CreateAndMapAnonymous(pool_size);
DCHECK(rv);
@@ -71,7 +67,9 @@
// Place buffer at a non-zero non-page-aligned offset in shared memory.
size_t buffer_offset = 3 * base::SysInfo::VMAllocationGranularity() / 2;
GLImageTestSupport::SetBufferDataToColor(
- size.width(), size.height(), static_cast<int>(stride),
+ size.width(), size.height(),
+ static_cast<int>(RowSizeForBufferFormat(
+ size.width(), gfx::BufferFormat::RGBA_8888, 0)),
gfx::BufferFormat::RGBA_8888, color,
reinterpret_cast<uint8_t*>(shared_memory.memory()) + buffer_offset);
scoped_refptr<gl::GLImageSharedMemory> image(
@@ -79,7 +77,7 @@
rv = image->Initialize(
base::SharedMemory::DuplicateHandle(shared_memory.handle()),
gfx::GenericSharedMemoryId(0), gfx::BufferFormat::RGBA_8888,
- buffer_offset, stride);
+ buffer_offset);
EXPECT_TRUE(rv);
return image;
}
« no previous file with comments | « ui/gl/gl_image_shared_memory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698