| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef SkGr_DEFINED | 8 #ifndef SkGr_DEFINED |
| 9 #define SkGr_DEFINED | 9 #define SkGr_DEFINED |
| 10 | 10 |
| 11 #include "GrColor.h" | 11 #include "GrColor.h" |
| 12 #include "GrTextureAccess.h" | 12 #include "GrTextureAccess.h" |
| 13 #include "SkColor.h" | 13 #include "SkColor.h" |
| 14 #include "SkColorPriv.h" | 14 #include "SkColorPriv.h" |
| 15 #include "SkFilterQuality.h" | 15 #include "SkFilterQuality.h" |
| 16 #include "SkImageInfo.h" | 16 #include "SkImageInfo.h" |
| 17 | 17 |
| 18 class GrCaps; |
| 18 class GrContext; | 19 class GrContext; |
| 19 class GrTexture; | 20 class GrTexture; |
| 20 class GrTextureParams; | 21 class GrTextureParams; |
| 21 class SkBitmap; | 22 class SkBitmap; |
| 22 | 23 |
| 23 //////////////////////////////////////////////////////////////////////////////// | 24 //////////////////////////////////////////////////////////////////////////////// |
| 24 // Sk to Gr Type conversions | 25 // Sk to Gr Type conversions |
| 25 | 26 |
| 26 static inline GrColor SkColorToPremulGrColor(SkColor c) { | 27 static inline GrColor SkColorToPremulGrColor(SkColor c) { |
| 27 SkPMColor pm = SkPreMultiplyColor(c); | 28 SkPMColor pm = SkPreMultiplyColor(c); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 SkGetPackedA32(c)); | 64 SkGetPackedA32(c)); |
| 64 } | 65 } |
| 65 | 66 |
| 66 //////////////////////////////////////////////////////////////////////////////// | 67 //////////////////////////////////////////////////////////////////////////////// |
| 67 /** Returns a texture representing the bitmap that is compatible with the GrText
ureParams. The | 68 /** Returns a texture representing the bitmap that is compatible with the GrText
ureParams. The |
| 68 texture is inserted into the cache (unless the bitmap is marked volatile) an
d can be | 69 texture is inserted into the cache (unless the bitmap is marked volatile) an
d can be |
| 69 retrieved again via this function. */ | 70 retrieved again via this function. */ |
| 70 GrTexture* GrRefCachedBitmapTexture(GrContext*, const SkBitmap&, const GrTexture
Params&); | 71 GrTexture* GrRefCachedBitmapTexture(GrContext*, const SkBitmap&, const GrTexture
Params&); |
| 71 | 72 |
| 72 // TODO: Move SkImageInfo2GrPixelConfig to SkGrPriv.h (requires cleanup to SkWin
dow its subclasses). | 73 // TODO: Move SkImageInfo2GrPixelConfig to SkGrPriv.h (requires cleanup to SkWin
dow its subclasses). |
| 73 GrPixelConfig SkImageInfo2GrPixelConfig(SkColorType, SkAlphaType, SkColorProfile
Type); | 74 GrPixelConfig SkImageInfo2GrPixelConfig(SkColorType, SkAlphaType, SkColorProfile
Type, const GrCaps&); |
| 74 | 75 |
| 75 static inline GrPixelConfig SkImageInfo2GrPixelConfig(const SkImageInfo& info) { | 76 static inline GrPixelConfig SkImageInfo2GrPixelConfig(const SkImageInfo& info, c
onst GrCaps& caps) { |
| 76 return SkImageInfo2GrPixelConfig(info.colorType(), info.alphaType(), info.pr
ofileType()); | 77 return SkImageInfo2GrPixelConfig(info.colorType(), info.alphaType(), info.pr
ofileType(), caps); |
| 77 } | 78 } |
| 78 | 79 |
| 79 GrTextureParams::FilterMode GrSkFilterQualityToGrFilterMode(SkFilterQuality pain
tFilterQuality, | 80 GrTextureParams::FilterMode GrSkFilterQualityToGrFilterMode(SkFilterQuality pain
tFilterQuality, |
| 80 const SkMatrix& view
M, | 81 const SkMatrix& view
M, |
| 81 const SkMatrix& loca
lM, | 82 const SkMatrix& loca
lM, |
| 82 bool* doBicubic); | 83 bool* doBicubic); |
| 83 | 84 |
| 84 //////////////////////////////////////////////////////////////////////////////// | 85 //////////////////////////////////////////////////////////////////////////////// |
| 85 | 86 |
| 86 SkImageInfo GrMakeInfoFromTexture(GrTexture* tex, int w, int h, bool isOpaque); | 87 SkImageInfo GrMakeInfoFromTexture(GrTexture* tex, int w, int h, bool isOpaque); |
| 87 | 88 |
| 88 // Using the dreaded SkGrPixelRef ... | 89 // Using the dreaded SkGrPixelRef ... |
| 89 SK_API void GrWrapTextureInBitmap(GrTexture* src, int w, int h, bool isOpaque, | 90 SK_API void GrWrapTextureInBitmap(GrTexture* src, int w, int h, bool isOpaque, |
| 90 SkBitmap* dst); | 91 SkBitmap* dst); |
| 91 | 92 |
| 92 #endif | 93 #endif |
| OLD | NEW |