OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 | 10 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 /////////////////////////////////////////////////////////////////////////////// | 44 /////////////////////////////////////////////////////////////////////////////// |
45 | 45 |
46 #include "SkColorPriv.h" | 46 #include "SkColorPriv.h" |
47 | 47 |
48 /** | 48 /** |
49 * Convert the SkBitmap::Config to the corresponding PixelConfig, or | 49 * Convert the SkBitmap::Config to the corresponding PixelConfig, or |
50 * kUnknown_PixelConfig if the conversion cannot be done. | 50 * kUnknown_PixelConfig if the conversion cannot be done. |
51 */ | 51 */ |
52 GrPixelConfig SkBitmapConfig2GrPixelConfig(SkBitmap::Config); | 52 GrPixelConfig SkBitmapConfig2GrPixelConfig(SkBitmap::Config); |
53 GrPixelConfig SkImageInfo2GrPixelConfig(SkColorType, SkAlphaType); | 53 GrPixelConfig SkImageInfo2GrPixelConfig(SkColorType, SkAlphaType); |
| 54 |
| 55 static inline GrPixelConfig SkImageInfo2GrPixelConfig(const SkImageInfo& info) { |
| 56 return SkImageInfo2GrPixelConfig(info.colorType(), info.alphaType()); |
| 57 } |
| 58 |
54 bool GrPixelConfig2ColorType(GrPixelConfig, SkColorType*); | 59 bool GrPixelConfig2ColorType(GrPixelConfig, SkColorType*); |
55 | 60 |
56 static inline GrColor SkColor2GrColor(SkColor c) { | 61 static inline GrColor SkColor2GrColor(SkColor c) { |
57 SkPMColor pm = SkPreMultiplyColor(c); | 62 SkPMColor pm = SkPreMultiplyColor(c); |
58 unsigned r = SkGetPackedR32(pm); | 63 unsigned r = SkGetPackedR32(pm); |
59 unsigned g = SkGetPackedG32(pm); | 64 unsigned g = SkGetPackedG32(pm); |
60 unsigned b = SkGetPackedB32(pm); | 65 unsigned b = SkGetPackedB32(pm); |
61 unsigned a = SkGetPackedA32(pm); | 66 unsigned a = SkGetPackedA32(pm); |
62 return GrColorPackRGBA(r, g, b, a); | 67 return GrColorPackRGBA(r, g, b, a); |
63 } | 68 } |
(...skipping 29 matching lines...) Expand all Loading... |
93 | 98 |
94 private: | 99 private: |
95 SkGlyphCache* fStrike; | 100 SkGlyphCache* fStrike; |
96 GrKey* fKey; | 101 GrKey* fKey; |
97 // DECLARE_INSTANCE_COUNTER(SkGrFontScaler); | 102 // DECLARE_INSTANCE_COUNTER(SkGrFontScaler); |
98 }; | 103 }; |
99 | 104 |
100 //////////////////////////////////////////////////////////////////////////////// | 105 //////////////////////////////////////////////////////////////////////////////// |
101 | 106 |
102 #endif | 107 #endif |
OLD | NEW |