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 // This is the baseline, assume always true. | 40 supports_format = SupportsFormat(GL_RGBA, GL_UNSIGNED_BYTE); |
41 supports_format = true; | |
42 break; | 41 break; |
43 case SkBitmap::kARGB_4444_Config: | 42 case SkBitmap::kARGB_4444_Config: |
44 supports_format = false; | 43 supports_format = false; |
45 break; | 44 break; |
46 default: | 45 default: |
47 NOTREACHED(); | 46 NOTREACHED(); |
48 supports_format = false; | 47 supports_format = false; |
49 break; | 48 break; |
50 } | 49 } |
51 DCHECK((int)texture_format < (int)SkBitmap::kConfigCount); | 50 DCHECK((int)texture_format < (int)SkBitmap::kConfigCount); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 return true; | 84 return true; |
86 case FORMAT_NOT_SUPPORTED: | 85 case FORMAT_NOT_SUPPORTED: |
87 return false; | 86 return false; |
88 default: | 87 default: |
89 NOTREACHED(); | 88 NOTREACHED(); |
90 return false; | 89 return false; |
91 } | 90 } |
92 } | 91 } |
93 | 92 |
94 } // namespace content | 93 } // namespace content |
OLD | NEW |