| 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 "gpu/command_buffer/service/image_factory.h" | 5 #include "gpu/command_buffer/service/image_factory.h" |
| 6 | 6 |
| 7 #include "gpu/command_buffer/common/capabilities.h" | 7 #include "gpu/command_buffer/common/capabilities.h" |
| 8 #include "ui/gl/gl_bindings.h" | 8 #include "ui/gl/gl_bindings.h" |
| 9 | 9 |
| 10 namespace gpu { | 10 namespace gpu { |
| 11 | 11 |
| 12 ImageFactory::ImageFactory() { | 12 ImageFactory::ImageFactory() { |
| 13 } | 13 } |
| 14 | 14 |
| 15 ImageFactory::~ImageFactory() { | 15 ImageFactory::~ImageFactory() { |
| 16 } | 16 } |
| 17 | 17 |
| 18 // static | 18 // static |
| 19 gfx::BufferFormat ImageFactory::DefaultBufferFormatForImageFormat( | 19 gfx::BufferFormat ImageFactory::DefaultBufferFormatForImageFormat( |
| 20 unsigned internalformat) { | 20 unsigned internalformat) { |
| 21 switch (internalformat) { | 21 switch (internalformat) { |
| 22 case GL_RED: | 22 case GL_RED: |
| 23 return gfx::BufferFormat::R_8; | 23 return gfx::BufferFormat::R_8; |
| 24 case GL_RGB: | 24 case GL_RGB: |
| 25 case GL_BGR_EXT: |
| 25 return gfx::BufferFormat::BGRX_8888; | 26 return gfx::BufferFormat::BGRX_8888; |
| 26 case GL_RGBA: | 27 case GL_RGBA: |
| 27 return gfx::BufferFormat::RGBA_8888; | 28 return gfx::BufferFormat::RGBA_8888; |
| 28 case GL_BGRA_EXT: | 29 case GL_BGRA_EXT: |
| 29 return gfx::BufferFormat::BGRA_8888; | 30 return gfx::BufferFormat::BGRA_8888; |
| 30 case GL_ATC_RGB_AMD: | 31 case GL_ATC_RGB_AMD: |
| 31 return gfx::BufferFormat::ATC; | 32 return gfx::BufferFormat::ATC; |
| 32 case GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD: | 33 case GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD: |
| 33 return gfx::BufferFormat::ATCIA; | 34 return gfx::BufferFormat::ATCIA; |
| 34 case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: | 35 case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 return size.width() % 2 == 0 && size.height() % 2 == 0; | 137 return size.width() % 2 == 0 && size.height() % 2 == 0; |
| 137 case gfx::BufferFormat::UYVY_422: | 138 case gfx::BufferFormat::UYVY_422: |
| 138 return size.width() % 2 == 0; | 139 return size.width() % 2 == 0; |
| 139 } | 140 } |
| 140 | 141 |
| 141 NOTREACHED(); | 142 NOTREACHED(); |
| 142 return false; | 143 return false; |
| 143 } | 144 } |
| 144 | 145 |
| 145 } // namespace gpu | 146 } // namespace gpu |
| OLD | NEW |