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

Unified Diff: ui/gl/gl_image_memory.cc

Issue 988693005: Chromium roll (https://codereview.chromium.org/976353002) (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: fixed bad android build patch Created 5 years, 9 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 | « ui/gl/gl_image_memory.h ('k') | ui/gl/gl_image_shared_memory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_image_memory.cc
diff --git a/ui/gl/gl_image_memory.cc b/ui/gl/gl_image_memory.cc
index 6b9a51967a0f2e42d41dc192585a4160236ef923..ca106b7cb2941bdb202e00c0632b40a1cb128a5e 100644
--- a/ui/gl/gl_image_memory.cc
+++ b/ui/gl/gl_image_memory.cc
@@ -183,30 +183,6 @@ bool GLImageMemory::StrideInBytes(size_t width,
return false;
}
-// static
-bool GLImageMemory::ValidSize(const gfx::Size& size,
- gfx::GpuMemoryBuffer::Format format) {
- switch (format) {
- case gfx::GpuMemoryBuffer::ATC:
- case gfx::GpuMemoryBuffer::ATCIA:
- case gfx::GpuMemoryBuffer::DXT1:
- case gfx::GpuMemoryBuffer::DXT5:
- case gfx::GpuMemoryBuffer::ETC1:
- // Compressed images must have a width and height that's evenly divisible
- // by the block size.
- return size.width() % 4 == 0 && size.height() % 4 == 0;
- case gfx::GpuMemoryBuffer::RGBA_8888:
- case gfx::GpuMemoryBuffer::BGRA_8888:
- return true;
- case gfx::GpuMemoryBuffer::RGBX_8888:
- NOTREACHED();
- return false;
- }
-
- NOTREACHED();
- return false;
-}
-
bool GLImageMemory::Initialize(const unsigned char* memory,
gfx::GpuMemoryBuffer::Format format) {
if (!ValidInternalFormat(internalformat_)) {
@@ -221,6 +197,8 @@ bool GLImageMemory::Initialize(const unsigned char* memory,
DCHECK(memory);
DCHECK(!memory_);
+ DCHECK_IMPLIES(IsCompressedFormat(format), size_.width() % 4 == 0);
+ DCHECK_IMPLIES(IsCompressedFormat(format), size_.height() % 4 == 0);
memory_ = memory;
format_ = format;
return true;
« no previous file with comments | « ui/gl/gl_image_memory.h ('k') | ui/gl/gl_image_shared_memory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698