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

Unified Diff: cc/resources/platform_color.h

Issue 1379783002: Allow one-copy task tile worker pool to use compressed textures. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove needs_conversion, fix tile size unit test and move modulo 4 DCHECK (for tests) Created 5 years 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
Index: cc/resources/platform_color.h
diff --git a/cc/resources/platform_color.h b/cc/resources/platform_color.h
index 17eddc1faa7552fde72ce800d2d636bc524e86e2..7e498635b2b8a73a020947753ad7752c0a4a4e8b 100644
--- a/cc/resources/platform_color.h
+++ b/cc/resources/platform_color.h
@@ -24,7 +24,19 @@ class PlatformColor {
}
// Returns the most efficient texture format for this platform.
- static ResourceFormat BestTextureFormat(bool supports_bgra8888) {
+ static ResourceFormat BestTextureFormat() {
+ switch (Format()) {
+ case SOURCE_FORMAT_BGRA8:
+ return BGRA_8888;
+ case SOURCE_FORMAT_RGBA8:
+ return RGBA_8888;
+ }
+ NOTREACHED();
+ return RGBA_8888;
+ }
+
+ // Returns the most efficient supported texture format for this platform.
+ static ResourceFormat BestSupportedTextureFormat(bool supports_bgra8888) {
switch (Format()) {
case SOURCE_FORMAT_BGRA8:
return (supports_bgra8888) ? BGRA_8888 : RGBA_8888;

Powered by Google App Engine
This is Rietveld 408576698