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

Unified Diff: ui/gl/gl_image_shared_memory.cc

Issue 806653006: Update GPU memory buffers to use StrideInBytes internally. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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: ui/gl/gl_image_shared_memory.cc
diff --git a/ui/gl/gl_image_shared_memory.cc b/ui/gl/gl_image_shared_memory.cc
index 0bbf54910fcc9c9fe7391954f8c9adcb1e8434c5..866e24479ed6c8f594b2610fe2e4e7d99a78a271 100644
--- a/ui/gl/gl_image_shared_memory.cc
+++ b/ui/gl/gl_image_shared_memory.cc
@@ -17,9 +17,11 @@ bool SizeInBytes(const gfx::Size& size,
size_t* size_in_bytes) {
if (size.IsEmpty())
return false;
- base::CheckedNumeric<size_t> s = GLImageMemory::BytesPerPixel(format);
+ DCHECK_EQ(size.GetArea() * GLImageMemory::BitsPerPixel(format) % 8, 0u);
reveman 2014/12/15 17:33:34 Hm, so this will fail for a 1x1 buffer with bpp <
christiank 2014/12/16 12:02:52 Currently we don't support images with a width and
reveman 2014/12/16 16:40:12 A renderer should not be able cause the GPU servic
+ base::CheckedNumeric<size_t> s = GLImageMemory::BitsPerPixel(format);
s *= size.width();
s *= size.height();
+ s /= 8;
if (!s.IsValid())
return false;
*size_in_bytes = s.ValueOrDie();
« content/common/gpu/client/gpu_memory_buffer_impl.h ('K') | « ui/gl/gl_image_memory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698