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

Side by Side Diff: src/gpu/effects/GrDistanceFieldGeoProc.h

Issue 1776383002: Use correct gradient calculation for rotated distance fields. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix android error Created 4 years, 9 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/batches/GrAtlasTextBatch.cpp ('k') | src/gpu/effects/GrDistanceFieldGeoProc.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 2013 Google Inc. 2 * Copyright 2013 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 GrDistanceFieldGeoProc_DEFINED 8 #ifndef GrDistanceFieldGeoProc_DEFINED
9 #define GrDistanceFieldGeoProc_DEFINED 9 #define GrDistanceFieldGeoProc_DEFINED
10 10
11 #include "GrProcessor.h" 11 #include "GrProcessor.h"
12 #include "GrGeometryProcessor.h" 12 #include "GrGeometryProcessor.h"
13 13
14 class GrGLDistanceFieldA8TextGeoProc; 14 class GrGLDistanceFieldA8TextGeoProc;
15 class GrGLDistanceFieldPathGeoProc; 15 class GrGLDistanceFieldPathGeoProc;
16 class GrGLDistanceFieldLCDTextGeoProc; 16 class GrGLDistanceFieldLCDTextGeoProc;
17 class GrInvariantOutput; 17 class GrInvariantOutput;
18 18
19 enum GrDistanceFieldEffectFlags { 19 enum GrDistanceFieldEffectFlags {
20 kSimilarity_DistanceFieldEffectFlag = 0x01, // ctm is similarity matrix 20 kSimilarity_DistanceFieldEffectFlag = 0x01, // ctm is similarity matrix
21 kRectToRect_DistanceFieldEffectFlag = 0x02, // ctm maps rects to rects 21 kScaleOnly_DistanceFieldEffectFlag = 0x02, // ctm has only scale and tran slate
22 kUseLCD_DistanceFieldEffectFlag = 0x04, // use lcd text 22 kUseLCD_DistanceFieldEffectFlag = 0x04, // use lcd text
23 kBGR_DistanceFieldEffectFlag = 0x08, // lcd display has bgr order 23 kBGR_DistanceFieldEffectFlag = 0x08, // lcd display has bgr order
24 kPortrait_DistanceFieldEffectFlag = 0x10, // lcd display is in portrait mode (not used yet) 24 kPortrait_DistanceFieldEffectFlag = 0x10, // lcd display is in portrait mode (not used yet)
25 25
26 kInvalid_DistanceFieldEffectFlag = 0x80, // invalid state (for initiali zation) 26 kInvalid_DistanceFieldEffectFlag = 0x80, // invalid state (for initiali zation)
27 27
28 kUniformScale_DistanceFieldEffectMask = kSimilarity_DistanceFieldEffectFlag | 28 kUniformScale_DistanceFieldEffectMask = kSimilarity_DistanceFieldEffectFlag |
29 kRectToRect_DistanceFieldEffectFlag, 29 kScaleOnly_DistanceFieldEffectFlag,
30 // The subset of the flags relevant to GrDistanceFieldA8TextGeoProc 30 // The subset of the flags relevant to GrDistanceFieldA8TextGeoProc
31 kNonLCD_DistanceFieldEffectMask = kSimilarity_DistanceFieldEffectFlag, 31 kNonLCD_DistanceFieldEffectMask = kSimilarity_DistanceFieldEffectFlag |
32 kScaleOnly_DistanceFieldEffectFlag,
32 // The subset of the flags relevant to GrDistanceFieldLCDTextGeoProc 33 // The subset of the flags relevant to GrDistanceFieldLCDTextGeoProc
33 kLCD_DistanceFieldEffectMask = kSimilarity_DistanceFieldEffectFlag | 34 kLCD_DistanceFieldEffectMask = kSimilarity_DistanceFieldEffectFlag |
34 kRectToRect_DistanceFieldEffectFlag | 35 kScaleOnly_DistanceFieldEffectFlag |
35 kUseLCD_DistanceFieldEffectFlag | 36 kUseLCD_DistanceFieldEffectFlag |
36 kBGR_DistanceFieldEffectFlag, 37 kBGR_DistanceFieldEffectFlag,
37 }; 38 };
38 39
39 /** 40 /**
40 * The output color of this effect is a modulation of the input color and a samp le from a 41 * The output color of this effect is a modulation of the input color and a samp le from a
41 * distance field texture (using a smoothed step function near 0.5). 42 * distance field texture (using a smoothed step function near 0.5).
42 * It allows explicit specification of the filtering and wrap modes (GrTexturePa rams). The input 43 * It allows explicit specification of the filtering and wrap modes (GrTexturePa rams). The input
43 * coords are a custom attribute. Gamma correction is handled via a texture LUT. 44 * coords are a custom attribute. Gamma correction is handled via a texture LUT.
44 */ 45 */
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 const Attribute* fInColor; 222 const Attribute* fInColor;
222 const Attribute* fInTextureCoords; 223 const Attribute* fInTextureCoords;
223 bool fUsesLocalCoords; 224 bool fUsesLocalCoords;
224 225
225 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; 226 GR_DECLARE_GEOMETRY_PROCESSOR_TEST;
226 227
227 typedef GrGeometryProcessor INHERITED; 228 typedef GrGeometryProcessor INHERITED;
228 }; 229 };
229 230
230 #endif 231 #endif
OLDNEW
« no previous file with comments | « src/gpu/batches/GrAtlasTextBatch.cpp ('k') | src/gpu/effects/GrDistanceFieldGeoProc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698