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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 // It draws with "texture" as a path mask into "target" using "rect" as | 80 // It draws with "texture" as a path mask into "target" using "rect" as |
81 // geometry and the current drawState. The current drawState is altered to | 81 // geometry and the current drawState. The current drawState is altered to |
82 // accommodate the mask. | 82 // accommodate the mask. |
83 // Note that this method assumes that the GrPaint::kTotalStages slot in | 83 // Note that this method assumes that the GrPaint::kTotalStages slot in |
84 // the draw state can be used to hold the mask texture stage. | 84 // the draw state can be used to hold the mask texture stage. |
85 // This method is really only intended to be used with the | 85 // This method is really only intended to be used with the |
86 // output of DrawPathMaskToTexture. | 86 // output of DrawPathMaskToTexture. |
87 static void DrawToTargetWithShapeMask(GrTexture* texture, | 87 static void DrawToTargetWithShapeMask(GrTexture* texture, |
88 GrDrawContext*, | 88 GrDrawContext*, |
89 const GrPaint& paint, | 89 const GrPaint& paint, |
90 const GrUserStencilSettings* userStenc
ilSettings, | 90 const GrUserStencilSettings& userStenc
ilSettings, |
91 const GrClip&, | 91 const GrClip&, |
92 const SkMatrix& viewMatrix, | 92 const SkMatrix& viewMatrix, |
93 const SkIRect& rect); | 93 const SkIRect& rect); |
94 | 94 |
95 private: | 95 private: |
96 // Helper function to get a scratch texture suitable for capturing the | 96 // Helper function to get a scratch texture suitable for capturing the |
97 // result (i.e., right size & format) | 97 // result (i.e., right size & format) |
98 GrTexture* createTexture(); | 98 GrTexture* createTexture(); |
99 | 99 |
100 GrTextureProvider* fTexProvider; | 100 GrTextureProvider* fTexProvider; |
101 SkMatrix fMatrix; | 101 SkMatrix fMatrix; |
102 SkAutoPixmapStorage fPixels; | 102 SkAutoPixmapStorage fPixels; |
103 SkDraw fDraw; | 103 SkDraw fDraw; |
104 SkRasterClip fRasterClip; | 104 SkRasterClip fRasterClip; |
105 | 105 |
106 typedef SkNoncopyable INHERITED; | 106 typedef SkNoncopyable INHERITED; |
107 }; | 107 }; |
108 | 108 |
109 #endif // GrSWMaskHelper_DEFINED | 109 #endif // GrSWMaskHelper_DEFINED |
OLD | NEW |