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 |
11 #ifndef SkGr_DEFINED | 11 #ifndef SkGr_DEFINED |
12 #define SkGr_DEFINED | 12 #define SkGr_DEFINED |
13 | 13 |
14 #include <stddef.h> | 14 #include <stddef.h> |
15 | 15 |
16 // Gr headers | 16 // Gr headers |
17 #include "GrTypes.h" | 17 #include "GrTypes.h" |
18 #include "GrContext.h" | 18 #include "GrContext.h" |
19 | 19 |
20 // skia headers | 20 // skia headers |
21 #include "SkBitmap.h" | 21 #include "SkBitmap.h" |
| 22 #include "SkClipStack.h" |
| 23 #include "SkMipMapLevel.h" |
22 #include "SkPath.h" | 24 #include "SkPath.h" |
23 #include "SkPoint.h" | 25 #include "SkPoint.h" |
24 #include "SkRegion.h" | 26 #include "SkRegion.h" |
25 #include "SkClipStack.h" | |
26 | 27 |
27 //////////////////////////////////////////////////////////////////////////////// | 28 //////////////////////////////////////////////////////////////////////////////// |
28 // Sk to Gr Type conversions | 29 // Sk to Gr Type conversions |
29 | 30 |
30 GR_STATIC_ASSERT((int)kZero_GrBlendCoeff == (int)SkXfermode::kZero_Coeff); | 31 GR_STATIC_ASSERT((int)kZero_GrBlendCoeff == (int)SkXfermode::kZero_Coeff); |
31 GR_STATIC_ASSERT((int)kOne_GrBlendCoeff == (int)SkXfermode::kOne_Coeff); | 32 GR_STATIC_ASSERT((int)kOne_GrBlendCoeff == (int)SkXfermode::kOne_Coeff); |
32 GR_STATIC_ASSERT((int)kSC_GrBlendCoeff == (int)SkXfermode::kSC_Coeff); | 33 GR_STATIC_ASSERT((int)kSC_GrBlendCoeff == (int)SkXfermode::kSC_Coeff); |
33 GR_STATIC_ASSERT((int)kISC_GrBlendCoeff == (int)SkXfermode::kISC_Coeff); | 34 GR_STATIC_ASSERT((int)kISC_GrBlendCoeff == (int)SkXfermode::kISC_Coeff); |
34 GR_STATIC_ASSERT((int)kDC_GrBlendCoeff == (int)SkXfermode::kDC_Coeff); | 35 GR_STATIC_ASSERT((int)kDC_GrBlendCoeff == (int)SkXfermode::kDC_Coeff); |
35 GR_STATIC_ASSERT((int)kIDC_GrBlendCoeff == (int)SkXfermode::kIDC_Coeff); | 36 GR_STATIC_ASSERT((int)kIDC_GrBlendCoeff == (int)SkXfermode::kIDC_Coeff); |
(...skipping 29 matching lines...) Expand all Loading... |
65 U8CPU a = SkColorGetA(c); | 66 U8CPU a = SkColorGetA(c); |
66 return GrColorPackRGBA(a, a, a, a); | 67 return GrColorPackRGBA(a, a, a, a); |
67 } | 68 } |
68 | 69 |
69 //////////////////////////////////////////////////////////////////////////////// | 70 //////////////////////////////////////////////////////////////////////////////// |
70 | 71 |
71 bool GrIsBitmapInCache(const GrContext*, const SkBitmap&, const GrTextureParams*
); | 72 bool GrIsBitmapInCache(const GrContext*, const SkBitmap&, const GrTextureParams*
); |
72 | 73 |
73 GrTexture* GrRefCachedBitmapTexture(GrContext*, const SkBitmap&, const GrTexture
Params*); | 74 GrTexture* GrRefCachedBitmapTexture(GrContext*, const SkBitmap&, const GrTexture
Params*); |
74 | 75 |
| 76 GrTexture* GrMipMapTexture(GrContext&, const SkBitmap&, SkDiscardableFactoryProc
); |
| 77 |
75 //////////////////////////////////////////////////////////////////////////////// | 78 //////////////////////////////////////////////////////////////////////////////// |
76 | 79 |
77 // Converts a SkPaint to a GrPaint, ignoring the SkPaint's shader. | 80 // Converts a SkPaint to a GrPaint, ignoring the SkPaint's shader. |
78 // Sets the color of GrPaint to the value of the parameter paintColor | 81 // Sets the color of GrPaint to the value of the parameter paintColor |
79 // Callers may subsequently modify the GrPaint. Setting constantColor indicates | 82 // Callers may subsequently modify the GrPaint. Setting constantColor indicates |
80 // that the final paint will draw the same color at every pixel. This allows | 83 // that the final paint will draw the same color at every pixel. This allows |
81 // an optimization where the color filter can be applied to the SkPaint's | 84 // an optimization where the color filter can be applied to the SkPaint's |
82 // color once while converting to GrPaint and then ignored. TODO: Remove this | 85 // color once while converting to GrPaint and then ignored. TODO: Remove this |
83 // bool and use the invariant info to automatically apply the color filter. | 86 // bool and use the invariant info to automatically apply the color filter. |
84 bool SkPaint2GrPaintNoShader(GrContext* context, GrRenderTarget*, const SkPaint&
skPaint, | 87 bool SkPaint2GrPaintNoShader(GrContext* context, GrRenderTarget*, const SkPaint&
skPaint, |
(...skipping 12 matching lines...) Expand all Loading... |
97 void GrWrapTextureInBitmap(GrTexture* src, int w, int h, bool isOpaque, SkBitmap
* dst); | 100 void GrWrapTextureInBitmap(GrTexture* src, int w, int h, bool isOpaque, SkBitmap
* dst); |
98 | 101 |
99 //////////////////////////////////////////////////////////////////////////////// | 102 //////////////////////////////////////////////////////////////////////////////// |
100 // Classes | 103 // Classes |
101 | 104 |
102 class SkGlyphCache; | 105 class SkGlyphCache; |
103 | 106 |
104 //////////////////////////////////////////////////////////////////////////////// | 107 //////////////////////////////////////////////////////////////////////////////// |
105 | 108 |
106 #endif | 109 #endif |
OLD | NEW |