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

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

Issue 806653006: Update GPU memory buffers to use StrideInBytes internally. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use StrideInBytes Created 6 years 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.cc
diff --git a/content/common/gpu/client/gpu_memory_buffer_impl.cc b/content/common/gpu/client/gpu_memory_buffer_impl.cc
index d3c08bdb1a09b0d1256c297148cd190d2fae5690..e02109054071dd41bdadeadfd5d167f5df50757f 100644
--- a/content/common/gpu/client/gpu_memory_buffer_impl.cc
+++ b/content/common/gpu/client/gpu_memory_buffer_impl.cc
@@ -76,12 +76,12 @@ GpuMemoryBufferImpl* GpuMemoryBufferImpl::FromClientBuffer(
}
// static
-size_t GpuMemoryBufferImpl::BytesPerPixel(Format format) {
+size_t GpuMemoryBufferImpl::StrideInBytes(size_t width, Format format) {
reveman 2014/12/18 18:49:56 I think this needs to be using CheckedNumeric. See
christiank 2015/01/12 10:35:22 Agreed, it's now updated to use CheckedNumeric.
switch (format) {
case RGBA_8888:
case RGBX_8888:
case BGRA_8888:
- return 4;
+ return width * 4;
}
NOTREACHED();

Powered by Google App Engine
This is Rietveld 408576698