Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/gl/gl_image_memory.h" | 5 #include "ui/gl/gl_image_memory.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/trace_event/trace_event.h" | 8 #include "base/trace_event/trace_event.h" |
| 9 #include "ui/gl/gl_bindings.h" | 9 #include "ui/gl/gl_bindings.h" |
| 10 #include "ui/gl/scoped_binders.h" | 10 #include "ui/gl/scoped_binders.h" |
| 11 | 11 |
| 12 #if defined(OS_WIN) || defined(USE_X11) || defined(OS_ANDROID) || \ | 12 #if defined(OS_WIN) || defined(USE_X11) || defined(OS_ANDROID) || \ |
| 13 defined(USE_OZONE) | 13 defined(USE_OZONE) |
| 14 #include "ui/gl/gl_surface_egl.h" | 14 #include "ui/gl/gl_surface_egl.h" |
| 15 #endif | 15 #endif |
| 16 | 16 |
| 17 namespace gfx { | 17 namespace gfx { |
| 18 namespace { | 18 namespace { |
| 19 | 19 |
| 20 bool ValidInternalFormat(unsigned internalformat) { | 20 bool ValidInternalFormat(unsigned internalformat) { |
| 21 switch (internalformat) { | 21 switch (internalformat) { |
| 22 case GL_ATC_RGB_AMD: | |
| 23 case GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD: | |
| 24 case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: | |
| 25 case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: | |
| 26 case GL_ETC1_RGB8_OES: | |
|
piman
2015/05/13 16:41:57
Just to check: the enum is validated upstream agai
christiank
2015/05/18 11:10:52
Yes, it's validated against extensions in GpuComma
| |
| 22 case GL_R8: | 27 case GL_R8: |
| 23 case GL_RGBA: | 28 case GL_RGBA: |
| 24 case GL_BGRA_EXT: | 29 case GL_BGRA_EXT: |
| 25 return true; | 30 return true; |
| 26 default: | 31 default: |
| 27 return false; | 32 return false; |
| 28 } | 33 } |
| 29 } | 34 } |
| 30 | 35 |
| 31 bool ValidFormat(GpuMemoryBuffer::Format format) { | 36 bool ValidFormat(GpuMemoryBuffer::Format format) { |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 402 size_.width(), | 407 size_.width(), |
| 403 size_.height(), | 408 size_.height(), |
| 404 0, // border | 409 0, // border |
| 405 DataFormat(format_), | 410 DataFormat(format_), |
| 406 DataType(format_), | 411 DataType(format_), |
| 407 memory_); | 412 memory_); |
| 408 } | 413 } |
| 409 } | 414 } |
| 410 | 415 |
| 411 } // namespace gfx | 416 } // namespace gfx |
| OLD | NEW |