OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 GrSWMaskHelper_DEFINED | 8 #ifndef GrSWMaskHelper_DEFINED |
9 #define GrSWMaskHelper_DEFINED | 9 #define GrSWMaskHelper_DEFINED |
10 | 10 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 // Draw a single path into the accumuation bitmap using the specified op | 61 // Draw a single path into the accumuation bitmap using the specified op |
62 void draw(const SkPath& path, const SkStrokeRec& stroke, SkRegion::Op op, | 62 void draw(const SkPath& path, const SkStrokeRec& stroke, SkRegion::Op op, |
63 bool antiAlias, uint8_t alpha); | 63 bool antiAlias, uint8_t alpha); |
64 | 64 |
65 // Move the mask generation results from the internal bitmap to the gpu. | 65 // Move the mask generation results from the internal bitmap to the gpu. |
66 void toTexture(GrTexture* texture); | 66 void toTexture(GrTexture* texture); |
67 | 67 |
68 // Convert mask generation results to a signed distance field | 68 // Convert mask generation results to a signed distance field |
69 void toSDF(unsigned char* sdf); | 69 void toSDF(unsigned char* sdf); |
70 | 70 |
71 // Reset the internal bitmap | 71 // Reset the internal bitmap |
72 void clear(uint8_t alpha) { | 72 void clear(uint8_t alpha) { |
73 fPixels.erase(SkColorSetARGB(alpha, 0xFF, 0xFF, 0xFF)); | 73 fPixels.erase(SkColorSetARGB(alpha, 0xFF, 0xFF, 0xFF)); |
74 } | 74 } |
75 | 75 |
76 // Canonical usage utility that draws a single path and uploads it | 76 // Canonical usage utility that draws a single path and uploads it |
77 // to the GPU. The result is returned. | 77 // to the GPU. The result is returned. |
78 static GrTexture* DrawPathMaskToTexture(GrContext* context, | 78 static GrTexture* DrawPathMaskToTexture(GrContext* context, |
79 const SkPath& path, | 79 const SkPath& path, |
80 const SkStrokeRec& stroke, | 80 const SkStrokeRec& stroke, |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 const void *data, size_t rowbytes); | 134 const void *data, size_t rowbytes); |
135 | 135 |
136 // Compresses the bitmap stored in fBM and sends the compressed data | 136 // Compresses the bitmap stored in fBM and sends the compressed data |
137 // to the GPU to be stored in 'texture' using sendTextureData. | 137 // to the GPU to be stored in 'texture' using sendTextureData. |
138 void compressTextureData(GrTexture *texture, const GrSurfaceDesc& desc); | 138 void compressTextureData(GrTexture *texture, const GrSurfaceDesc& desc); |
139 | 139 |
140 typedef SkNoncopyable INHERITED; | 140 typedef SkNoncopyable INHERITED; |
141 }; | 141 }; |
142 | 142 |
143 #endif // GrSWMaskHelper_DEFINED | 143 #endif // GrSWMaskHelper_DEFINED |
OLD | NEW |