| 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; | |
| 19 class GrContext; | 18 class GrContext; |
| 20 class GrTexture; | 19 class GrTexture; |
| 21 class GrTextureParams; | 20 class GrTextureParams; |
| 22 class SkBitmap; | 21 class SkBitmap; |
| 23 | 22 |
| 24 //////////////////////////////////////////////////////////////////////////////// | 23 //////////////////////////////////////////////////////////////////////////////// |
| 25 // Sk to Gr Type conversions | 24 // Sk to Gr Type conversions |
| 26 | 25 |
| 27 static inline GrColor SkColorToPremulGrColor(SkColor c) { | 26 static inline GrColor SkColorToPremulGrColor(SkColor c) { |
| 28 SkPMColor pm = SkPreMultiplyColor(c); | 27 SkPMColor pm = SkPreMultiplyColor(c); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 SkGetPackedA32(c)); | 63 SkGetPackedA32(c)); |
| 65 } | 64 } |
| 66 | 65 |
| 67 //////////////////////////////////////////////////////////////////////////////// | 66 //////////////////////////////////////////////////////////////////////////////// |
| 68 /** Returns a texture representing the bitmap that is compatible with the GrText
ureParams. The | 67 /** Returns a texture representing the bitmap that is compatible with the GrText
ureParams. The |
| 69 texture is inserted into the cache (unless the bitmap is marked volatile) an
d can be | 68 texture is inserted into the cache (unless the bitmap is marked volatile) an
d can be |
| 70 retrieved again via this function. */ | 69 retrieved again via this function. */ |
| 71 GrTexture* GrRefCachedBitmapTexture(GrContext*, const SkBitmap&, const GrTexture
Params&); | 70 GrTexture* GrRefCachedBitmapTexture(GrContext*, const SkBitmap&, const GrTexture
Params&); |
| 72 | 71 |
| 73 // TODO: Move SkImageInfo2GrPixelConfig to SkGrPriv.h (requires cleanup to SkWin
dow its subclasses). | 72 // TODO: Move SkImageInfo2GrPixelConfig to SkGrPriv.h (requires cleanup to SkWin
dow its subclasses). |
| 74 GrPixelConfig SkImageInfo2GrPixelConfig(SkColorType, SkAlphaType, SkColorProfile
Type, const GrCaps&); | 73 GrPixelConfig SkImageInfo2GrPixelConfig(SkColorType, SkAlphaType, SkColorProfile
Type); |
| 75 | 74 |
| 76 static inline GrPixelConfig SkImageInfo2GrPixelConfig(const SkImageInfo& info, c
onst GrCaps& caps) { | 75 static inline GrPixelConfig SkImageInfo2GrPixelConfig(const SkImageInfo& info) { |
| 77 return SkImageInfo2GrPixelConfig(info.colorType(), info.alphaType(), info.pr
ofileType(), caps); | 76 return SkImageInfo2GrPixelConfig(info.colorType(), info.alphaType(), info.pr
ofileType()); |
| 78 } | 77 } |
| 79 | 78 |
| 80 GrTextureParams::FilterMode GrSkFilterQualityToGrFilterMode(SkFilterQuality pain
tFilterQuality, | 79 GrTextureParams::FilterMode GrSkFilterQualityToGrFilterMode(SkFilterQuality pain
tFilterQuality, |
| 81 const SkMatrix& view
M, | 80 const SkMatrix& view
M, |
| 82 const SkMatrix& loca
lM, | 81 const SkMatrix& loca
lM, |
| 83 bool* doBicubic); | 82 bool* doBicubic); |
| 84 | 83 |
| 85 //////////////////////////////////////////////////////////////////////////////// | 84 //////////////////////////////////////////////////////////////////////////////// |
| 86 | 85 |
| 87 SkImageInfo GrMakeInfoFromTexture(GrTexture* tex, int w, int h, bool isOpaque); | 86 SkImageInfo GrMakeInfoFromTexture(GrTexture* tex, int w, int h, bool isOpaque); |
| 88 | 87 |
| 89 // Using the dreaded SkGrPixelRef ... | 88 // Using the dreaded SkGrPixelRef ... |
| 90 SK_API void GrWrapTextureInBitmap(GrTexture* src, int w, int h, bool isOpaque, | 89 SK_API void GrWrapTextureInBitmap(GrTexture* src, int w, int h, bool isOpaque, |
| 91 SkBitmap* dst); | 90 SkBitmap* dst); |
| 92 | 91 |
| 93 #endif | 92 #endif |
| OLD | NEW |