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

Unified Diff: cc/resources/resource_format.cc

Issue 1832573004: Gpu Image Decode Controller (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: small fixes Created 4 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 side-by-side diff with in-line comments
Download patch
Index: cc/resources/resource_format.cc
diff --git a/cc/resources/resource_format.cc b/cc/resources/resource_format.cc
index ec553d8acbc9b062795f1880f11dffca620dc862..b419277f005596a4a3c5d3f33123177eedffc35c 100644
--- a/cc/resources/resource_format.cc
+++ b/cc/resources/resource_format.cc
@@ -29,6 +29,29 @@ SkColorType ResourceFormatToSkColorType(ResourceFormat format) {
return kN32_SkColorType;
}
+SkColorType ResourceFormatToClosestSkColorType(ResourceFormat format) {
vmpstr 2016/03/28 23:55:52 The only difference between this function and the
ericrk 2016/03/29 23:11:29 I think we can just drop the above one and use thi
+ // Use kN32_SkColorType if there is no corresponding SkColorType.
+ switch (format) {
+ case RGBA_4444:
+ return kARGB_4444_SkColorType;
+ case RGBA_8888:
+ case BGRA_8888:
+ return kN32_SkColorType;
+ case ALPHA_8:
+ return kAlpha_8_SkColorType;
+ case RGB_565:
+ return kRGB_565_SkColorType;
+ case LUMINANCE_8:
+ return kGray_8_SkColorType;
+ case ETC1:
+ case RED_8:
+ case LUMINANCE_F16:
+ return kN32_SkColorType;
+ }
+ NOTREACHED();
+ return kN32_SkColorType;
+}
+
int BitsPerPixel(ResourceFormat format) {
switch (format) {
case BGRA_8888:

Powered by Google App Engine
This is Rietveld 408576698