Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(348)

Side by Side Diff: src/gpu/GrSWMaskHelper.h

Issue 589103004: Add GrAASmallPathRenderer. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address nits Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/GrAddPathRenderers_default.cpp ('k') | src/gpu/GrSWMaskHelper.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 void draw(const SkPath& path, const SkStrokeRec& stroke, SkRegion::Op op, 61 void draw(const SkPath& path, const SkStrokeRec& stroke, SkRegion::Op op,
62 bool antiAlias, uint8_t alpha); 62 bool antiAlias, uint8_t alpha);
63 63
64 // Helper function to get a scratch texture suitable for capturing the 64 // Helper function to get a scratch texture suitable for capturing the
65 // result (i.e., right size & format) 65 // result (i.e., right size & format)
66 bool getTexture(GrAutoScratchTexture* texture); 66 bool getTexture(GrAutoScratchTexture* texture);
67 67
68 // Move the mask generation results from the internal bitmap to the gpu. 68 // Move the mask generation results from the internal bitmap to the gpu.
69 void toTexture(GrTexture* texture); 69 void toTexture(GrTexture* texture);
70 70
71 // Convert mask generation results to a signed distance field
72 void toSDF(unsigned char* sdf);
73
71 // Reset the internal bitmap 74 // Reset the internal bitmap
72 void clear(uint8_t alpha) { 75 void clear(uint8_t alpha) {
73 fBM.eraseColor(SkColorSetARGB(alpha, alpha, alpha, alpha)); 76 fBM.eraseColor(SkColorSetARGB(alpha, alpha, alpha, alpha));
74 } 77 }
75 78
76 // Canonical usage utility that draws a single path and uploads it 79 // Canonical usage utility that draws a single path and uploads it
77 // to the GPU. The result is returned in "result". 80 // to the GPU. The result is returned.
78 static GrTexture* DrawPathMaskToTexture(GrContext* context, 81 static GrTexture* DrawPathMaskToTexture(GrContext* context,
79 const SkPath& path, 82 const SkPath& path,
80 const SkStrokeRec& stroke, 83 const SkStrokeRec& stroke,
81 const SkIRect& resultBounds, 84 const SkIRect& resultBounds,
82 bool antiAlias, 85 bool antiAlias,
83 SkMatrix* matrix); 86 SkMatrix* matrix);
84 87
85 // This utility routine is used to add a path's mask to some other draw. 88 // This utility routine is used to add a path's mask to some other draw.
86 // The ClipMaskManager uses it to accumulate clip masks while the 89 // The ClipMaskManager uses it to accumulate clip masks while the
87 // GrSoftwarePathRenderer uses it to fulfill a drawPath call. 90 // GrSoftwarePathRenderer uses it to fulfill a drawPath call.
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 const void *data, int rowbytes); 130 const void *data, int rowbytes);
128 131
129 // Compresses the bitmap stored in fBM and sends the compressed data 132 // Compresses the bitmap stored in fBM and sends the compressed data
130 // to the GPU to be stored in 'texture' using sendTextureData. 133 // to the GPU to be stored in 'texture' using sendTextureData.
131 void compressTextureData(GrTexture *texture, const GrTextureDesc& desc); 134 void compressTextureData(GrTexture *texture, const GrTextureDesc& desc);
132 135
133 typedef SkNoncopyable INHERITED; 136 typedef SkNoncopyable INHERITED;
134 }; 137 };
135 138
136 #endif // GrSWMaskHelper_DEFINED 139 #endif // GrSWMaskHelper_DEFINED
OLDNEW
« no previous file with comments | « src/gpu/GrAddPathRenderers_default.cpp ('k') | src/gpu/GrSWMaskHelper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698