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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 void draw(const SkPath& path, const SkStrokeRec& stroke, SkRegion::Op op, | 58 void draw(const SkPath& path, const SkStrokeRec& stroke, SkRegion::Op op, |
59 bool antiAlias, uint8_t alpha); | 59 bool antiAlias, uint8_t alpha); |
60 | 60 |
61 // Helper function to get a scratch texture suitable for capturing the | 61 // Helper function to get a scratch texture suitable for capturing the |
62 // result (i.e., right size & format) | 62 // result (i.e., right size & format) |
63 bool getTexture(GrAutoScratchTexture* texture); | 63 bool getTexture(GrAutoScratchTexture* texture); |
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 GrTexture* toLATCTexture(GrContext* ctx); |
| 69 |
68 // Reset the internal bitmap | 70 // Reset the internal bitmap |
69 void clear(uint8_t alpha) { | 71 void clear(uint8_t alpha) { |
70 fBM.eraseColor(SkColorSetARGB(alpha, alpha, alpha, alpha)); | 72 fBM.eraseColor(SkColorSetARGB(alpha, alpha, alpha, alpha)); |
71 } | 73 } |
72 | 74 |
73 // Canonical usage utility that draws a single path and uploads it | 75 // Canonical usage utility that draws a single path and uploads it |
74 // to the GPU. The result is returned in "result". | 76 // to the GPU. The result is returned in "result". |
75 static GrTexture* DrawPathMaskToTexture(GrContext* context, | 77 static GrTexture* DrawPathMaskToTexture(GrContext* context, |
76 const SkPath& path, | 78 const SkPath& path, |
77 const SkStrokeRec& stroke, | 79 const SkStrokeRec& stroke, |
(...skipping 20 matching lines...) Expand all Loading... |
98 GrContext* fContext; | 100 GrContext* fContext; |
99 SkMatrix fMatrix; | 101 SkMatrix fMatrix; |
100 SkBitmap fBM; | 102 SkBitmap fBM; |
101 SkDraw fDraw; | 103 SkDraw fDraw; |
102 SkRasterClip fRasterClip; | 104 SkRasterClip fRasterClip; |
103 | 105 |
104 typedef SkNoncopyable INHERITED; | 106 typedef SkNoncopyable INHERITED; |
105 }; | 107 }; |
106 | 108 |
107 #endif // GrSWMaskHelper_DEFINED | 109 #endif // GrSWMaskHelper_DEFINED |
OLD | NEW |