Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Side by Side Diff: trunk/src/content/common/gpu/client/gl_helper_readback_support.cc

Issue 179793011: Revert 255420 "Revert 255386 "Support ARGB_8888 by default in GL..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698