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

Unified Diff: ui/gl/gl_image_memory.cc

Issue 1263043006: Implement the texture uploading of ASTC compression for WebGL (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup and Remove unnecessary enum/OES extensions. Created 5 years, 4 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
« ui/gfx/gpu_memory_buffer.h ('K') | « ui/gfx/gpu_memory_buffer.h ('k') | no next file » | 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 5ccb9d160f8c7d124a4e58e631b1ff9811778243..b7f90db6d66aa10fefbba3f6e0663ab3bac1c05f 100644
--- a/ui/gl/gl_image_memory.cc
+++ b/ui/gl/gl_image_memory.cc
@@ -35,6 +35,7 @@ bool ValidInternalFormat(unsigned internalformat) {
bool ValidFormat(GpuMemoryBuffer::Format format) {
switch (format) {
+ case GpuMemoryBuffer::ASTC:
case GpuMemoryBuffer::ATC:
case GpuMemoryBuffer::ATCIA:
case GpuMemoryBuffer::DXT1:
@@ -56,6 +57,7 @@ bool ValidFormat(GpuMemoryBuffer::Format format) {
bool IsCompressedFormat(GpuMemoryBuffer::Format format) {
switch (format) {
+ case GpuMemoryBuffer::ASTC:
case GpuMemoryBuffer::ATC:
case GpuMemoryBuffer::ATCIA:
case GpuMemoryBuffer::DXT1:
@@ -77,6 +79,8 @@ bool IsCompressedFormat(GpuMemoryBuffer::Format format) {
GLenum TextureFormat(GpuMemoryBuffer::Format format) {
switch (format) {
+ case GpuMemoryBuffer::ASTC:
+ return GL_COMPRESSED_RGBA_ASTC_4x4_KHR;
case GpuMemoryBuffer::ATC:
return GL_ATC_RGB_AMD;
case GpuMemoryBuffer::ATCIA:
@@ -116,6 +120,7 @@ GLenum DataType(GpuMemoryBuffer::Format format) {
case GpuMemoryBuffer::BGRA_8888:
case GpuMemoryBuffer::R_8:
return GL_UNSIGNED_BYTE;
+ case GpuMemoryBuffer::ASTC:
case GpuMemoryBuffer::ATC:
case GpuMemoryBuffer::ATCIA:
case GpuMemoryBuffer::DXT1:
@@ -177,6 +182,7 @@ bool GLImageMemory::StrideInBytes(size_t width,
case GpuMemoryBuffer::DXT5:
*stride_in_bytes = width;
return true;
+ case GpuMemoryBuffer::ASTC:
case GpuMemoryBuffer::ATC:
case GpuMemoryBuffer::DXT1:
case GpuMemoryBuffer::ETC1:
« ui/gfx/gpu_memory_buffer.h ('K') | « ui/gfx/gpu_memory_buffer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698