| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 // GrSoftwarePathRenderer uses it to fulfill a drawPath call. | 85 // GrSoftwarePathRenderer uses it to fulfill a drawPath call. |
| 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 const SkIRect& rect); | 96 const SkIRect& rect); |
| 96 | 97 |
| 97 private: | 98 private: |
| 98 // Helper function to get a scratch texture suitable for capturing the | 99 // Helper function to get a scratch texture suitable for capturing the |
| 99 // result (i.e., right size & format) | 100 // result (i.e., right size & format) |
| 100 GrTexture* createTexture(); | 101 GrTexture* createTexture(); |
| 101 | 102 |
| 102 GrContext* fContext; | 103 GrContext* fContext; |
| 103 SkMatrix fMatrix; | 104 SkMatrix fMatrix; |
| 104 SkBitmap fBM; | 105 SkBitmap fBM; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 129 const void *data, int rowbytes); | 130 const void *data, int rowbytes); |
| 130 | 131 |
| 131 // Compresses the bitmap stored in fBM and sends the compressed data | 132 // Compresses the bitmap stored in fBM and sends the compressed data |
| 132 // to the GPU to be stored in 'texture' using sendTextureData. | 133 // to the GPU to be stored in 'texture' using sendTextureData. |
| 133 void compressTextureData(GrTexture *texture, const GrSurfaceDesc& desc); | 134 void compressTextureData(GrTexture *texture, const GrSurfaceDesc& desc); |
| 134 | 135 |
| 135 typedef SkNoncopyable INHERITED; | 136 typedef SkNoncopyable INHERITED; |
| 136 }; | 137 }; |
| 137 | 138 |
| 138 #endif // GrSWMaskHelper_DEFINED | 139 #endif // GrSWMaskHelper_DEFINED |
| OLD | NEW |