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

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

Issue 806653006: Update GPU memory buffers to use StrideInBytes internally. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed nit Created 5 years, 11 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_surface_texture.cc
diff --git a/content/common/gpu/client/gpu_memory_buffer_impl_surface_texture.cc b/content/common/gpu/client/gpu_memory_buffer_impl_surface_texture.cc
index 401d37a39cd082097e0b84abc818e8dd54608c7c..c6c47289e7d72ba40559ca6fb5c50105251965dd 100644
--- a/content/common/gpu/client/gpu_memory_buffer_impl_surface_texture.cc
+++ b/content/common/gpu/client/gpu_memory_buffer_impl_surface_texture.cc
@@ -75,8 +75,12 @@ void* GpuMemoryBufferImplSurfaceTexture::Map() {
return NULL;
}
+ size_t stride_in_bytes = 0;
+ if (!StrideInBytes(buffer.stride, format_, &stride_in_bytes))
+ return NULL;
+
DCHECK_LE(size_.width(), buffer.stride);
- stride_ = buffer.stride * BytesPerPixel(format_);
+ stride_ = stride_in_bytes;
mapped_ = true;
return buffer.bits;
}

Powered by Google App Engine
This is Rietveld 408576698