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

Unified Diff: content/common/gpu/client/gl_helper_readback_support.cc

Issue 570003002: [Aura] Use GLHelper support to validate format before processing texture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/compositor/delegated_frame_host.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/client/gl_helper_readback_support.cc
diff --git a/content/common/gpu/client/gl_helper_readback_support.cc b/content/common/gpu/client/gl_helper_readback_support.cc
index 4412c9546dece7a44a74d070574a6f082ef7b8d0..f5b9fc64186a9ac85a9ce497298cc56c149cea57 100644
--- a/content/common/gpu/client/gl_helper_readback_support.cc
+++ b/content/common/gpu/client/gl_helper_readback_support.cc
@@ -25,6 +25,8 @@ void GLHelperReadbackSupport::InitializeReadbackSupport() {
for (int i = 0; i <= kLastEnum_SkColorType; ++i) {
format_support_table_[i] = GLHelperReadbackSupport::NOT_SUPPORTED;
}
+
+ CheckForReadbackSupport(kAlpha_8_SkColorType);
CheckForReadbackSupport(kRGB_565_SkColorType);
CheckForReadbackSupport(kARGB_4444_SkColorType);
CheckForReadbackSupport(kRGBA_8888_SkColorType);
@@ -39,6 +41,9 @@ void GLHelperReadbackSupport::CheckForReadbackSupport(
case kRGB_565_SkColorType:
supports_format = SupportsFormat(GL_RGB, GL_UNSIGNED_SHORT_5_6_5);
break;
+ // kAlpha_8_SkColorType is supported here via a special encoding
+ // using a 32-bit texture to represent an 8-bit image.
+ case kAlpha_8_SkColorType:
case kRGBA_8888_SkColorType:
// This is the baseline, assume always true.
supports_format = true;
@@ -140,6 +145,7 @@ GLHelperReadbackSupport::GetReadbackConfig(SkColorType color_type,
return GLHelperReadbackSupport::SUPPORTED;
}
break;
+ case kAlpha_8_SkColorType:
piman 2014/09/17 19:52:31 I think we need more logic to handle this. In the
sivag 2014/09/18 13:19:03 Done.
case kRGBA_8888_SkColorType:
*format = GL_RGBA;
if (can_swizzle) {
« no previous file with comments | « content/browser/compositor/delegated_frame_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698