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

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

Issue 852283003: Revert of Update GPU memory buffers to use StrideInBytes internally. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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.cc
diff --git a/content/common/gpu/client/gpu_memory_buffer_impl.cc b/content/common/gpu/client/gpu_memory_buffer_impl.cc
index 4b05bbff2aa1c4ce67da55713b3d020a4a9d8f0a..d3c08bdb1a09b0d1256c297148cd190d2fae5690 100644
--- a/content/common/gpu/client/gpu_memory_buffer_impl.cc
+++ b/content/common/gpu/client/gpu_memory_buffer_impl.cc
@@ -5,7 +5,6 @@
#include "content/common/gpu/client/gpu_memory_buffer_impl.h"
#include "base/logging.h"
-#include "base/numerics/safe_math.h"
#include "content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.h"
#include "ui/gl/gl_bindings.h"
@@ -77,24 +76,16 @@
}
// static
-bool GpuMemoryBufferImpl::StrideInBytes(size_t width,
- Format format,
- size_t* stride_in_bytes) {
- base::CheckedNumeric<size_t> s = width;
+size_t GpuMemoryBufferImpl::BytesPerPixel(Format format) {
switch (format) {
case RGBA_8888:
case RGBX_8888:
case BGRA_8888:
- s *= 4;
- if (!s.IsValid())
- return false;
-
- *stride_in_bytes = s.ValueOrDie();
- return true;
+ return 4;
}
NOTREACHED();
- return false;
+ return 0;
}
gfx::GpuMemoryBuffer::Format GpuMemoryBufferImpl::GetFormat() const {
« no previous file with comments | « content/common/gpu/client/gpu_memory_buffer_impl.h ('k') | content/common/gpu/client/gpu_memory_buffer_impl_shared_memory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698