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

Side by Side Diff: src/core/SkEdge.h

Issue 692583002: WIP: GPU-accelerated trapezoidal path renderer. Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rename GrTrapezoidalPathRenderer -> GrAAConcavePathRenderer; swap MSAA support for a coverage ramp. Created 5 years, 3 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 | « samplecode/SampleConcavePaths.cpp ('k') | src/core/SkEdge.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 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #ifndef SkEdge_DEFINED 10 #ifndef SkEdge_DEFINED
(...skipping 11 matching lines...) Expand all
22 kLine_Type, 22 kLine_Type,
23 kQuad_Type, 23 kQuad_Type,
24 kCubic_Type 24 kCubic_Type
25 }; 25 };
26 26
27 SkEdge* fNext; 27 SkEdge* fNext;
28 SkEdge* fPrev; 28 SkEdge* fPrev;
29 29
30 SkFixed fX; 30 SkFixed fX;
31 SkFixed fDX; 31 SkFixed fDX;
32 float fFirstXf; // only used for trapezoidal renderer
33 float fFirstYf; // only used for trapezoidal renderer
32 int32_t fFirstY; 34 int32_t fFirstY;
33 int32_t fLastY; 35 int32_t fLastY;
34 int8_t fCurveCount; // only used by kQuad(+) and kCubic(-) 36 int8_t fCurveCount; // only used by kQuad(+) and kCubic(-)
35 uint8_t fCurveShift; // appled to all Dx/DDx/DDDx except for fCubicDShift exception 37 uint8_t fCurveShift; // appled to all Dx/DDx/DDDx except for fCubicDShift exception
36 uint8_t fCubicDShift; // applied to fCDx and fCDy only in cubic 38 uint8_t fCubicDShift; // applied to fCDx and fCDy only in cubic
37 int8_t fWinding; // 1 or -1 39 int8_t fWinding; // 1 or -1
38 40
39 int setLine(const SkPoint& p0, const SkPoint& p1, const SkIRect* clip, int s hiftUp); 41 int setLine(const SkPoint& p0, const SkPoint& p1, const SkIRect* clip, int s hiftUp);
40 // call this version if you know you don't have a clip 42 // call this version if you know you don't have a clip
41 inline int setLine(const SkPoint& p0, const SkPoint& p1, int shiftUp); 43 inline int setLine(const SkPoint& p0, const SkPoint& p1, int shiftUp);
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 117
116 // are we a zero-height line? 118 // are we a zero-height line?
117 if (top == bot) { 119 if (top == bot) {
118 return 0; 120 return 0;
119 } 121 }
120 122
121 SkFixed slope = SkFDot6Div(x1 - x0, y1 - y0); 123 SkFixed slope = SkFDot6Div(x1 - x0, y1 - y0);
122 const SkFDot6 dy = SkEdge_Compute_DY(top, y0); 124 const SkFDot6 dy = SkEdge_Compute_DY(top, y0);
123 125
124 fX = SkFDot6ToFixed(x0 + SkFixedMul(slope, dy)); // + SK_Fixed1/2 126 fX = SkFDot6ToFixed(x0 + SkFixedMul(slope, dy)); // + SK_Fixed1/2
127 fFirstXf = winding < 0 ? p1.fX : p0.fX;
125 fDX = slope; 128 fDX = slope;
126 fFirstY = top; 129 fFirstY = top;
130 fFirstYf = static_cast<float>(top);
127 fLastY = bot - 1; 131 fLastY = bot - 1;
128 fCurveCount = 0; 132 fCurveCount = 0;
129 fWinding = SkToS8(winding); 133 fWinding = SkToS8(winding);
130 fCurveShift = 0; 134 fCurveShift = 0;
131 return 1; 135 return 1;
132 } 136 }
133 137
134 138
135 #endif 139 #endif
OLDNEW
« no previous file with comments | « samplecode/SampleConcavePaths.cpp ('k') | src/core/SkEdge.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698