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/gfx/buffer_format_util.h" | 9 #include "ui/gfx/buffer_format_util.h" |
10 #include "ui/gl/gl_bindings.h" | 10 #include "ui/gl/gl_bindings.h" |
11 #include "ui/gl/gl_context.h" | 11 #include "ui/gl/gl_context.h" |
12 #include "ui/gl/gl_version_info.h" | 12 #include "ui/gl/gl_version_info.h" |
13 | 13 |
14 using gfx::BufferFormat; | 14 using gfx::BufferFormat; |
15 | 15 |
16 namespace gl { | 16 namespace gl { |
17 namespace { | 17 namespace { |
18 | 18 |
19 bool ValidInternalFormat(unsigned internalformat) { | 19 bool ValidInternalFormat(unsigned internalformat) { |
20 switch (internalformat) { | 20 switch (internalformat) { |
21 case GL_ATC_RGB_AMD: | 21 case GL_ATC_RGB_AMD: |
22 case GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD: | 22 case GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD: |
23 case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: | 23 case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: |
24 case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: | 24 case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: |
25 case GL_ETC1_RGB8_OES: | 25 case GL_ETC1_RGB8_OES: |
26 case GL_R8: | 26 case GL_RED: |
27 case GL_RGB: | 27 case GL_RGB: |
28 case GL_RGBA: | 28 case GL_RGBA: |
29 case GL_BGRA_EXT: | 29 case GL_BGRA_EXT: |
30 return true; | 30 return true; |
31 default: | 31 default: |
32 return false; | 32 return false; |
33 } | 33 } |
34 } | 34 } |
35 | 35 |
36 bool ValidFormat(BufferFormat format) { | 36 bool ValidFormat(BufferFormat format) { |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 return false; | 364 return false; |
365 } | 365 } |
366 | 366 |
367 // static | 367 // static |
368 unsigned GLImageMemory::GetInternalFormatForTesting(BufferFormat format) { | 368 unsigned GLImageMemory::GetInternalFormatForTesting(BufferFormat format) { |
369 DCHECK(ValidFormat(format)); | 369 DCHECK(ValidFormat(format)); |
370 return TextureFormat(format); | 370 return TextureFormat(format); |
371 } | 371 } |
372 | 372 |
373 } // namespace gl | 373 } // namespace gl |
OLD | NEW |