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

Unified Diff: gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc

Issue 1412223009: Reland: GpuMemoryBuffer interface change: Map(**) to Map() and memory(plane); stride(plane) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Win X64 compile fix Created 5 years, 2 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 | « content/test/gpu_memory_buffer_impl_test_template.h ('k') | gpu/command_buffer/tests/gl_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc
diff --git a/gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc b/gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc
index 23fc4681183bed4cb3a0505ac34cdad9df9d5f7b..280de5f3734df60ffc3508bfa8462622b0349d29 100644
--- a/gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc
+++ b/gpu/command_buffer/tests/gl_gpu_memory_buffer_unittest.cc
@@ -170,22 +170,17 @@ TEST_P(GpuMemoryBufferTest, Lifecycle) {
gfx::Size(kImageWidth, kImageHeight), GetParam()));
// Map buffer for writing.
- void* data;
- bool rv = buffer->Map(&data);
- DCHECK(rv);
-
- uint8_t* mapped_buffer = static_cast<uint8_t*>(data);
- ASSERT_TRUE(mapped_buffer != NULL);
-
+ ASSERT_TRUE(buffer->Map());
+ ASSERT_NE(nullptr, buffer->memory(0));
+ ASSERT_NE(0, buffer->stride(0));
uint8_t pixel[] = {255u, 0u, 0u, 255u};
// Assign a value to each pixel.
- int stride = 0;
- buffer->GetStride(&stride);
- ASSERT_NE(stride, 0);
- for (int y = 0; y < kImageHeight; ++y)
- SetRow(GetParam(), mapped_buffer + y * stride, kImageWidth, pixel);
-
+ for (int y = 0; y < kImageHeight; ++y) {
+ SetRow(GetParam(),
+ static_cast<uint8_t*>(buffer->memory(0)) + y * buffer->stride(0),
+ kImageWidth, pixel);
+ }
// Unmap the buffer.
buffer->Unmap();
« no previous file with comments | « content/test/gpu_memory_buffer_impl_test_template.h ('k') | gpu/command_buffer/tests/gl_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698