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

Unified Diff: cc/resources/resource_format.cc

Issue 1713503002: Reland Allow one-copy and zero-copy task tile worker pools to use compressed textures. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 10 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 | « cc/resources/resource_format.h ('k') | cc/resources/resource_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/resource_format.cc
diff --git a/cc/resources/resource_format.cc b/cc/resources/resource_format.cc
index ba4e65d570a8c79f2128026f6f0c47ae641a4016..ec553d8acbc9b062795f1880f11dffca620dc862 100644
--- a/cc/resources/resource_format.cc
+++ b/cc/resources/resource_format.cc
@@ -101,10 +101,11 @@ gfx::BufferFormat BufferFormat(ResourceFormat format) {
return gfx::BufferFormat::RGBA_4444;
case RGBA_8888:
return gfx::BufferFormat::RGBA_8888;
+ case ETC1:
+ return gfx::BufferFormat::ETC1;
case ALPHA_8:
case LUMINANCE_8:
case RGB_565:
- case ETC1:
case LUMINANCE_F16:
break;
}
@@ -112,4 +113,26 @@ gfx::BufferFormat BufferFormat(ResourceFormat format) {
return gfx::BufferFormat::RGBA_8888;
}
+bool IsResourceFormatCompressed(ResourceFormat format) {
+ return format == ETC1;
+}
+
+bool DoesResourceFormatSupportAlpha(ResourceFormat format) {
+ switch (format) {
+ case RGBA_4444:
+ case RGBA_8888:
+ case BGRA_8888:
+ case ALPHA_8:
+ return true;
+ case LUMINANCE_8:
+ case RGB_565:
+ case ETC1:
+ case RED_8:
+ case LUMINANCE_F16:
+ return false;
+ }
+ NOTREACHED();
+ return false;
+}
+
} // namespace cc
« no previous file with comments | « cc/resources/resource_format.h ('k') | cc/resources/resource_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698