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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 // It draws with "texture" as a path mask into "target" using "rect" as | 86 // It draws with "texture" as a path mask into "target" using "rect" as |
87 // geometry and the current drawState. The current drawState is altered to | 87 // geometry and the current drawState. The current drawState is altered to |
88 // accommodate the mask. | 88 // accommodate the mask. |
89 // Note that this method assumes that the GrPaint::kTotalStages slot in | 89 // Note that this method assumes that the GrPaint::kTotalStages slot in |
90 // the draw state can be used to hold the mask texture stage. | 90 // the draw state can be used to hold the mask texture stage. |
91 // This method is really only intended to be used with the | 91 // This method is really only intended to be used with the |
92 // output of DrawPathMaskToTexture. | 92 // output of DrawPathMaskToTexture. |
93 static void DrawToTargetWithPathMask(GrTexture* texture, | 93 static void DrawToTargetWithPathMask(GrTexture* texture, |
94 GrDrawTarget* target, | 94 GrDrawTarget* target, |
95 GrDrawState* drawState, | 95 GrDrawState* drawState, |
| 96 GrColor, |
96 const SkIRect& rect); | 97 const SkIRect& rect); |
97 | 98 |
98 private: | 99 private: |
99 // Helper function to get a scratch texture suitable for capturing the | 100 // Helper function to get a scratch texture suitable for capturing the |
100 // result (i.e., right size & format) | 101 // result (i.e., right size & format) |
101 GrTexture* createTexture(); | 102 GrTexture* createTexture(); |
102 | 103 |
103 GrContext* fContext; | 104 GrContext* fContext; |
104 SkMatrix fMatrix; | 105 SkMatrix fMatrix; |
105 SkBitmap fBM; | 106 SkBitmap fBM; |
(...skipping 24 matching lines...) Expand all Loading... |
130 const void *data, int rowbytes); | 131 const void *data, int rowbytes); |
131 | 132 |
132 // Compresses the bitmap stored in fBM and sends the compressed data | 133 // Compresses the bitmap stored in fBM and sends the compressed data |
133 // to the GPU to be stored in 'texture' using sendTextureData. | 134 // to the GPU to be stored in 'texture' using sendTextureData. |
134 void compressTextureData(GrTexture *texture, const GrSurfaceDesc& desc); | 135 void compressTextureData(GrTexture *texture, const GrSurfaceDesc& desc); |
135 | 136 |
136 typedef SkNoncopyable INHERITED; | 137 typedef SkNoncopyable INHERITED; |
137 }; | 138 }; |
138 | 139 |
139 #endif // GrSWMaskHelper_DEFINED | 140 #endif // GrSWMaskHelper_DEFINED |
OLD | NEW |