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 #ifndef SkGr_DEFINED | 9 #ifndef SkGr_DEFINED |
10 #define SkGr_DEFINED | 10 #define SkGr_DEFINED |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
58 GrColorIsPMAssert(c); | 58 GrColorIsPMAssert(c); |
59 return SkPackARGB32(GrColorUnpackA(c), GrColorUnpackR(c), GrColorUnpackG(c), GrColorUnpackB(c)); | 59 return SkPackARGB32(GrColorUnpackA(c), GrColorUnpackR(c), GrColorUnpackG(c), GrColorUnpackB(c)); |
60 } | 60 } |
61 | 61 |
62 static inline GrColor SkPMColorToGrColor(SkPMColor c) { | 62 static inline GrColor SkPMColorToGrColor(SkPMColor c) { |
63 return GrColorPackRGBA(SkGetPackedR32(c), SkGetPackedG32(c), SkGetPackedB32( c), | 63 return GrColorPackRGBA(SkGetPackedR32(c), SkGetPackedG32(c), SkGetPackedB32( c), |
64 SkGetPackedA32(c)); | 64 SkGetPackedA32(c)); |
65 } | 65 } |
66 | 66 |
67 //////////////////////////////////////////////////////////////////////////////// | 67 //////////////////////////////////////////////////////////////////////////////// |
68 /** Returns a texture representing the bitmap that is compatible with the GrText ureParams */ | |
reed1
2015/10/16 19:23:42
I presume the texture has already been "cached", a
bsalomon
2015/10/16 20:09:45
Yup, will update the comment.
| |
69 GrTexture* GrRefCachedBitmapTexture(GrContext*, const SkBitmap&, const GrTexture Params&); | |
68 | 70 |
69 GrTexture* GrRefCachedBitmapTexture(GrContext*, const SkBitmap&, const GrTexture Params&); | |
70 | |
71 // TODO: Move SkImageInfo2GrPixelConfig to SkGrPriv.h (requires cleanup to SkWin dow its subclasses). | 71 // TODO: Move SkImageInfo2GrPixelConfig to SkGrPriv.h (requires cleanup to SkWin dow its subclasses). |
72 GrPixelConfig SkImageInfo2GrPixelConfig(SkColorType, SkAlphaType, SkColorProfile Type); | 72 GrPixelConfig SkImageInfo2GrPixelConfig(SkColorType, SkAlphaType, SkColorProfile Type); |
73 | 73 |
74 static inline GrPixelConfig SkImageInfo2GrPixelConfig(const SkImageInfo& info) { | 74 static inline GrPixelConfig SkImageInfo2GrPixelConfig(const SkImageInfo& info) { |
75 return SkImageInfo2GrPixelConfig(info.colorType(), info.alphaType(), info.pr ofileType()); | 75 return SkImageInfo2GrPixelConfig(info.colorType(), info.alphaType(), info.pr ofileType()); |
76 } | 76 } |
77 | 77 |
78 GrTextureParams::FilterMode GrSkFilterQualityToGrFilterMode(SkFilterQuality pain tFilterQuality, | 78 GrTextureParams::FilterMode GrSkFilterQualityToGrFilterMode(SkFilterQuality pain tFilterQuality, |
79 const SkMatrix& view M, | 79 const SkMatrix& view M, |
80 const SkMatrix& loca lM, | 80 const SkMatrix& loca lM, |
81 bool* doBicubic); | 81 bool* doBicubic); |
82 | 82 |
83 //////////////////////////////////////////////////////////////////////////////// | 83 //////////////////////////////////////////////////////////////////////////////// |
84 | 84 |
85 SkImageInfo GrMakeInfoFromTexture(GrTexture* tex, int w, int h, bool isOpaque); | 85 SkImageInfo GrMakeInfoFromTexture(GrTexture* tex, int w, int h, bool isOpaque); |
86 | 86 |
87 // Using the dreaded SkGrPixelRef ... | 87 // Using the dreaded SkGrPixelRef ... |
88 SK_API void GrWrapTextureInBitmap(GrTexture* src, int w, int h, bool isOpaque, | 88 SK_API void GrWrapTextureInBitmap(GrTexture* src, int w, int h, bool isOpaque, |
89 SkBitmap* dst); | 89 SkBitmap* dst); |
90 | 90 |
91 #endif | 91 #endif |
OLD | NEW |