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 "content/common/gpu/client/gl_helper_readback_support.h" | 5 #include "content/common/gpu/client/gl_helper_readback_support.h" |
6 #include "base/logging.h" | 6 #include "base/logging.h" |
7 | 7 |
8 namespace content { | 8 namespace content { |
9 | 9 |
10 GLHelperReadbackSupport::GLHelperReadbackSupport(gpu::gles2::GLES2Interface* gl) | 10 GLHelperReadbackSupport::GLHelperReadbackSupport(gpu::gles2::GLES2Interface* gl) |
(...skipping 19 matching lines...) Expand all Loading... |
30 } | 30 } |
31 | 31 |
32 void GLHelperReadbackSupport::CheckForReadbackSupport( | 32 void GLHelperReadbackSupport::CheckForReadbackSupport( |
33 SkBitmap::Config texture_format) { | 33 SkBitmap::Config texture_format) { |
34 bool supports_format = false; | 34 bool supports_format = false; |
35 switch (texture_format) { | 35 switch (texture_format) { |
36 case SkBitmap::kRGB_565_Config: | 36 case SkBitmap::kRGB_565_Config: |
37 supports_format = SupportsFormat(GL_RGB, GL_UNSIGNED_SHORT_5_6_5); | 37 supports_format = SupportsFormat(GL_RGB, GL_UNSIGNED_SHORT_5_6_5); |
38 break; | 38 break; |
39 case SkBitmap::kARGB_8888_Config: | 39 case SkBitmap::kARGB_8888_Config: |
40 supports_format = SupportsFormat(GL_RGBA, GL_UNSIGNED_BYTE); | 40 // This is the baseline, assume always true. |
| 41 supports_format = true; |
41 break; | 42 break; |
42 case SkBitmap::kARGB_4444_Config: | 43 case SkBitmap::kARGB_4444_Config: |
43 supports_format = false; | 44 supports_format = false; |
44 break; | 45 break; |
45 default: | 46 default: |
46 NOTREACHED(); | 47 NOTREACHED(); |
47 supports_format = false; | 48 supports_format = false; |
48 break; | 49 break; |
49 } | 50 } |
50 DCHECK((int)texture_format < (int)SkBitmap::kConfigCount); | 51 DCHECK((int)texture_format < (int)SkBitmap::kConfigCount); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 return true; | 85 return true; |
85 case FORMAT_NOT_SUPPORTED: | 86 case FORMAT_NOT_SUPPORTED: |
86 return false; | 87 return false; |
87 default: | 88 default: |
88 NOTREACHED(); | 89 NOTREACHED(); |
89 return false; | 90 return false; |
90 } | 91 } |
91 } | 92 } |
92 | 93 |
93 } // namespace content | 94 } // namespace content |
OLD | NEW |