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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 return GrColorPackRGBA(r, g, b, a); | 61 return GrColorPackRGBA(r, g, b, a); |
62 } | 62 } |
63 | 63 |
64 static inline GrColor SkColor2GrColorJustAlpha(SkColor c) { | 64 static inline GrColor SkColor2GrColorJustAlpha(SkColor c) { |
65 U8CPU a = SkColorGetA(c); | 65 U8CPU a = SkColorGetA(c); |
66 return GrColorPackRGBA(a, a, a, a); | 66 return GrColorPackRGBA(a, a, a, a); |
67 } | 67 } |
68 | 68 |
69 //////////////////////////////////////////////////////////////////////////////// | 69 //////////////////////////////////////////////////////////////////////////////// |
70 | 70 |
| 71 // The cache listens for these messages to purge junk resources proactively. |
| 72 struct GrResourceInvalidatedMessage { |
| 73 GrResourceKey key; |
| 74 }; |
| 75 |
71 bool GrIsBitmapInCache(const GrContext*, const SkBitmap&, const GrTextureParams*
); | 76 bool GrIsBitmapInCache(const GrContext*, const SkBitmap&, const GrTextureParams*
); |
72 | 77 |
73 GrTexture* GrRefCachedBitmapTexture(GrContext*, const SkBitmap&, const GrTexture
Params*); | 78 GrTexture* GrRefCachedBitmapTexture(GrContext*, const SkBitmap&, const GrTexture
Params*); |
74 | 79 |
75 //////////////////////////////////////////////////////////////////////////////// | 80 //////////////////////////////////////////////////////////////////////////////// |
76 | 81 |
77 // Converts a SkPaint to a GrPaint, ignoring the SkPaint's shader. | 82 // Converts a SkPaint to a GrPaint, ignoring the SkPaint's shader. |
78 // Sets the color of GrPaint to the value of the parameter paintColor | 83 // Sets the color of GrPaint to the value of the parameter paintColor |
79 // Callers may subsequently modify the GrPaint. Setting constantColor indicates | 84 // Callers may subsequently modify the GrPaint. Setting constantColor indicates |
80 // that the final paint will draw the same color at every pixel. This allows | 85 // that the final paint will draw the same color at every pixel. This allows |
81 // an optimization where the the color filter can be applied to the SkPaint's | 86 // an optimization where the the color filter can be applied to the SkPaint's |
82 // color once while converting to GrPaint and then ignored. | 87 // color once while converting to GrPaint and then ignored. |
83 void SkPaint2GrPaintNoShader(GrContext* context, const SkPaint& skPaint, GrColor
paintColor, | 88 void SkPaint2GrPaintNoShader(GrContext* context, const SkPaint& skPaint, GrColor
paintColor, |
84 bool constantColor, GrPaint* grPaint); | 89 bool constantColor, GrPaint* grPaint); |
85 | 90 |
86 // This function is similar to skPaint2GrPaintNoShader but also converts | 91 // This function is similar to skPaint2GrPaintNoShader but also converts |
87 // skPaint's shader to a GrTexture/GrProcessorStage if possible. | 92 // skPaint's shader to a GrTexture/GrProcessorStage if possible. |
88 // constantColor has the same meaning as in skPaint2GrPaintNoShader. | 93 // constantColor has the same meaning as in skPaint2GrPaintNoShader. |
89 void SkPaint2GrPaintShader(GrContext* context, const SkPaint& skPaint, | 94 void SkPaint2GrPaintShader(GrContext* context, const SkPaint& skPaint, |
90 bool constantColor, GrPaint* grPaint); | 95 bool constantColor, GrPaint* grPaint); |
91 | 96 |
92 //////////////////////////////////////////////////////////////////////////////// | 97 //////////////////////////////////////////////////////////////////////////////// |
93 // Classes | 98 // Classes |
94 | 99 |
95 class SkGlyphCache; | 100 class SkGlyphCache; |
96 | 101 |
97 //////////////////////////////////////////////////////////////////////////////// | 102 //////////////////////////////////////////////////////////////////////////////// |
98 | 103 |
99 #endif | 104 #endif |
OLD | NEW |