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

Side by Side Diff: cc/resources/resource_format_utils.cc

Issue 2020993004: Implement TransferableResource StructTraits (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 6 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
« no previous file with comments | « cc/resources/resource_format_utils.h ('k') | cc/tiles/gpu_image_decode_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "cc/resources/resource_format_utils.h"
6
7 namespace cc {
8
9 SkColorType ResourceFormatToClosestSkColorType(ResourceFormat format) {
10 // Use kN32_SkColorType if there is no corresponding SkColorType.
11 switch (format) {
12 case RGBA_4444:
13 return kARGB_4444_SkColorType;
14 case RGBA_8888:
15 case BGRA_8888:
16 return kN32_SkColorType;
17 case ALPHA_8:
18 return kAlpha_8_SkColorType;
19 case RGB_565:
20 return kRGB_565_SkColorType;
21 case LUMINANCE_8:
22 return kGray_8_SkColorType;
23 case ETC1:
24 case RED_8:
25 case LUMINANCE_F16:
26 return kN32_SkColorType;
27 }
28 NOTREACHED();
29 return kN32_SkColorType;
30 }
31
32 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/resource_format_utils.h ('k') | cc/tiles/gpu_image_decode_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698