Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Functions | Variables
GraphitePrimitivesSlide.cpp File Reference
#include "include/core/SkCanvas.h"
#include "include/core/SkM44.h"
#include "include/core/SkPaint.h"
#include "include/core/SkRRect.h"
#include "include/core/SkVertices.h"
#include "include/private/base/SkTPin.h"
#include "tools/viewer/ClickHandlerSlide.h"
#include <unordered_set>

Go to the source code of this file.

Classes

struct  LocalCornerVert
 
class  GraphitePrimitivesSlide
 
class  GraphitePrimitivesSlide::Click
 

Functions

static SkPaint paint (SkColor color, float strokeWidth=-1.f, SkPaint::Join join=SkPaint::kMiter_Join)
 
static std::pair< float, float > singular_values (float a, float b, float c, float d)
 
static float local_aa_radius (const SkM44 &matrix, const SkV2 &p)
 
static void compute_corner (SkV3 devPts[19], const SkM44 &m, const SkV4 &cornerMapping, const SkV2 &cornerPt, const SkV2 &cornerRadii, const SkV4 &center, float centerWeight, float localAARadius, float strokeRadius, SkPaint::Join join)
 
static void compute_vertices (SkV3 devPts[kVertexCount], const SkM44 &m, const SkRRect &rrect, float strokeRadius, SkPaint::Join join)
 

Variables

static constexpr float kAARadius = 10.f
 
static constexpr float kMiterScale = 1.f
 
static constexpr float kBevelScale = 0.0f
 
static constexpr float kRoundScale = SK_FloatSqrt2 - 1.f
 
static constexpr float kHR2 = SK_ScalarRoot2Over2
 
static constexpr LocalCornerVert kCornerTemplate [19]
 
static const uint16_t kBR = 0*std::size(kCornerTemplate)
 
static const uint16_t kTR = 1*std::size(kCornerTemplate)
 
static const uint16_t kTL = 2*std::size(kCornerTemplate)
 
static const uint16_t kBL = 3*std::size(kCornerTemplate)
 
static const size_t kVertexCount = 4*std::size(kCornerTemplate)
 
static const uint16_t kIndices []
 
static const uint16_t kOuterCornerIndices []
 
static const uint16_t kInnerCornerIndices []
 
static const uint16_t kInteriorIndices []
 
static const uint16_t kEdgeIndices []
 

Function Documentation

◆ compute_corner()

static void compute_corner ( SkV3  devPts[19],
const SkM44 m,
const SkV4 cornerMapping,
const SkV2 cornerPt,
const SkV2 cornerRadii,
const SkV4 center,
float  centerWeight,
float  localAARadius,
float  strokeRadius,
SkPaint::Join  join 
)
static

Definition at line 254 of file GraphitePrimitivesSlide.cpp.

257 {
258 float joinScale;
259
260 // TODO: checking against localAARadius can snap to rect corner unexpectedly under high skew
261 // because localAARadius gets so big, but would be nice to be fuzzy here.
262 if (cornerRadii.x <= 0.f || cornerRadii.y <= 0.f) {
263 // Effectively a rectangular corner
264 joinScale = kMiterScale; // default for rect corners
265 if (strokeRadius > 0.f) {
266 // Non-hairline strokes need to adjust the join scale factor to match style.
267 if (join == SkPaint::kBevel_Join) {
268 joinScale = kBevelScale;
269 } else if (join == SkPaint::kRound_Join) {
270 joinScale = kRoundScale;
271 }
272 }
273 } else {
274 // Rounded filled corner vertices are always positioned for a round join since the
275 // underlying geometry has no real tangent discontinuity.
276 joinScale = kRoundScale;
277 }
278
279 for (size_t i = 0; i < std::size(kCornerTemplate); ++i) {
280 devPts[i] = kCornerTemplate[i].transform(m, cornerMapping, cornerPt, cornerRadii,
281 center, centerWeight, strokeRadius, joinScale,
282 localAARadius);
283 }
284}
static constexpr float kMiterScale
static constexpr float kBevelScale
static constexpr LocalCornerVert kCornerTemplate[19]
static constexpr float kRoundScale
static SkScalar center(float pos0, float pos1)
@ kRound_Join
adds circle
Definition SkPaint.h:360
@ kBevel_Join
connects outside edges
Definition SkPaint.h:361
SkV3 transform(const SkM44 &m, const SkV4 &cornerMapping, const SkV2 &cornerPt, const SkV2 &cornerRadii, const SkV4 &devCenter, float centerWeight, float strokeRadius, float joinScale, float localAARadius) const
float x
Definition SkM44.h:20
float y
Definition SkM44.h:20

◆ compute_vertices()

static void compute_vertices ( SkV3  devPts[kVertexCount],
const SkM44 m,
const SkRRect rrect,
float  strokeRadius,
SkPaint::Join  join 
)
static

Definition at line 291 of file GraphitePrimitivesSlide.cpp.

295 {
296 SkV4 devCenter = m.map(rrect.getBounds().centerX(), rrect.getBounds().centerY(), 0.f, 1.f);
297
298 float localAARadius = std::max({
303 });
304
305 float centerWeight = 0.f; // No center snapping
306 if (strokeRadius < 0.f) {
307 // A fill, so inner vertices need to snap to the center and then adjust the stroke radius
308 // to 0 for later math to work out nicely.
309 strokeRadius = 0.f;
310 centerWeight = 1.f;
311 }
312
313 // Check if the inset amount (max stroke-radius + local-aa-radius) would interfere with the
314 // opposite edge's inset or interfere with the adjacent corner's curve. When this happens, snap
315 // all the interior vertices to the center and let the fragment shader work through it.
316 // TODO: Could force centerWeight = 2 for filled rects and quads for simplicity around non
317 // orthogonal inset overlap calculations.
318 float maxInset = strokeRadius + localAARadius;
319 if (maxInset >= rrect.width() - maxInset || // L/R stroke insets would cross over
320 maxInset >= rrect.height() - maxInset || // T/B stroke insets would cross over
321 maxInset >= rrect.width() - rrect.radii(SkRRect::kLowerLeft_Corner).fX || // X corner cross
325 maxInset >= rrect.height() - rrect.radii(SkRRect::kLowerLeft_Corner).fY || // Y corner cross
329 // All interior vertices need to snap to the center
330 centerWeight = 2.f;
331 }
332
333 // The normalized corner template is defined relative to the quarter circle with positive X
334 // and positive Y, with a counter clockwise winding (if +Y points down). This corresponds to
335 // the bottom-right corner.
336 static constexpr SkV4 kBRBasis = { 1.f, 0.f, 0.f, 1.f};
337 static constexpr SkV4 kTRBasis = { 0.f, 1.f, -1.f, 0.f};
338 static constexpr SkV4 kTLBasis = {-1.f, 0.f, 0.f, -1.f};
339 static constexpr SkV4 kBLBasis = { 0.f, -1.f, 1.f, 0.f};
340
341 compute_corner(devPts + kBR, m, kBRBasis,
342 {rrect.getBounds().fRight,
346 devCenter, centerWeight, localAARadius, strokeRadius, join);
347 compute_corner(devPts + kTR, m, kTRBasis,
348 {rrect.getBounds().fRight,
352 devCenter, centerWeight, localAARadius,strokeRadius, join);
353 compute_corner(devPts + kTL, m, kTLBasis,
354 {rrect.getBounds().fLeft,
358 devCenter, centerWeight, localAARadius,strokeRadius, join);
359 compute_corner(devPts + kBL, m, kBLBasis,
360 {rrect.getBounds().fLeft,
364 devCenter, centerWeight, localAARadius,strokeRadius, join);
365}
static const uint16_t kTL
static const uint16_t kBL
static const uint16_t kBR
static const uint16_t kTR
static float local_aa_radius(const SkM44 &matrix, const SkV2 &p)
static void compute_corner(SkV3 devPts[19], const SkM44 &m, const SkV4 &cornerMapping, const SkV2 &cornerPt, const SkV2 &cornerRadii, const SkV4 &center, float centerWeight, float localAARadius, float strokeRadius, SkPaint::Join join)
SkVector radii(Corner corner) const
Definition SkRRect.h:271
@ kUpperLeft_Corner
index of top-left corner radii
Definition SkRRect.h:252
@ kLowerRight_Corner
index of bottom-right corner radii
Definition SkRRect.h:254
@ kUpperRight_Corner
index of top-right corner radii
Definition SkRRect.h:253
@ kLowerLeft_Corner
index of bottom-left corner radii
Definition SkRRect.h:255
SkScalar width() const
Definition SkRRect.h:95
SkScalar height() const
Definition SkRRect.h:102
const SkRect & getBounds() const
Definition SkRRect.h:279
SkRRect rrect
Definition SkRecords.h:232
SINT Vec< 2 *N, T > join(const Vec< N, T > &lo, const Vec< N, T > &hi)
Definition SkVx.h:242
float fX
x-axis value
float fY
y-axis value
SkScalar fBottom
larger y-axis bounds
Definition extension.cpp:17
constexpr float centerX() const
Definition SkRect.h:776
constexpr float centerY() const
Definition SkRect.h:785
SkScalar fTop
smaller y-axis bounds
Definition extension.cpp:15
Definition SkM44.h:98

◆ local_aa_radius()

static float local_aa_radius ( const SkM44 matrix,
const SkV2 p 
)
static

Definition at line 73 of file GraphitePrimitivesSlide.cpp.

73 {
74 SkV4 devP = matrix.map(p.x, p.y, 0.f, 1.f);
75
76 const float dxdu = matrix.rc(0,0);
77 const float dxdv = matrix.rc(0,1);
78 const float dydu = matrix.rc(1,0);
79 const float dydv = matrix.rc(1,1);
80 const float dwdu = matrix.rc(3,0);
81 const float dwdv = matrix.rc(3,1);
82
83 float invW2 = 1.f / (devP.w * devP.w);
84 // non-persp has invW2 = 1, devP.w = 1, dwdu = 0, dwdv = 0
85 float dfdu = (devP.w*dxdu - devP.x*dwdu) * invW2; // non-persp -> dxdu -> m00
86 float dfdv = (devP.w*dxdv - devP.x*dwdv) * invW2; // non-persp -> dxdv -> m01
87 float dgdu = (devP.w*dydu - devP.y*dwdu) * invW2; // non-persp -> dydu -> m10
88 float dgdv = (devP.w*dydv - devP.y*dwdv) * invW2; // non-persp -> dydv -> m11
89
90 // no-persp, this is the singular values of [m00,m01][m10,m11], which is just the upper 2x2
91 // and equivalent to SkMatrix::getMinmaxScales().
92 auto [sv1, sv2] = singular_values(dfdu, dfdv, dgdu, dgdv);
93
94 // The minimum and maximum singular values of the above matrix represent the min and maximum
95 // scale factors that could be applied by the 'matrix'. So if 'p' is moved 1px locally it will
96 // move between [min, max]px after transformation. Thus, moving 1/min px locally will move
97 // between [1, max/min]px after transformation, ensuring the device-space offset exceeds the
98 // minimum AA offset for analytic AA.
99 float minScale = std::min(sv1, sv2);
100 return kAARadius / minScale;
101}
static constexpr float kAARadius
static std::pair< float, float > singular_values(float a, float b, float c, float d)
unsigned useCenter Optional< SkMatrix > matrix
Definition SkRecords.h:258
float w
Definition SkM44.h:99
float y
Definition SkM44.h:99
float x
Definition SkM44.h:99

◆ paint()

static SkPaint paint ( SkColor  color,
float  strokeWidth = -1.f,
SkPaint::Join  join = SkPaint::kMiter_Join 
)
static

Definition at line 18 of file GraphitePrimitivesSlide.cpp.

20 {
22 paint.setColor(color);
23 paint.setAntiAlias(true);
24 if (strokeWidth >= 0.f) {
26 paint.setStrokeWidth(strokeWidth);
27 paint.setStrokeJoin(join);
28 }
29 return paint;
30}
static const int strokeWidth
Definition BlurTest.cpp:60
SkColor4f color
@ kStroke_Style
set to stroke geometry
Definition SkPaint.h:194
const Paint & paint

◆ singular_values()

static std::pair< float, float > singular_values ( float  a,
float  b,
float  c,
float  d 
)
static

Definition at line 33 of file GraphitePrimitivesSlide.cpp.

33 {
34 float s1 = a*a + b*b + c*c + d*d;
35
36 float e = a*a + b*b - c*c - d*d;
37 float f = a*c + b*d;
38 float s2 = SkScalarSqrt(e*e + 4*f*f);
39
40 float singular1 = SkScalarSqrt(0.5f * (s1 + s2));
41 float singular2 = SkScalarSqrt(0.5f * (s1 - s2));
42
43 return {singular1, singular2};
44}
#define SkScalarSqrt(x)
Definition SkScalar.h:42
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
Definition main.cc:19
static bool b
struct MyStruct a[10]

Variable Documentation

◆ kAARadius

constexpr float kAARadius = 10.f
staticconstexpr

Definition at line 46 of file GraphitePrimitivesSlide.cpp.

◆ kBevelScale

constexpr float kBevelScale = 0.0f
staticconstexpr

Definition at line 104 of file GraphitePrimitivesSlide.cpp.

◆ kBL

const uint16_t kBL = 3*std::size(kCornerTemplate)
static

Definition at line 289 of file GraphitePrimitivesSlide.cpp.

◆ kBR

const uint16_t kBR = 0*std::size(kCornerTemplate)
static

Definition at line 286 of file GraphitePrimitivesSlide.cpp.

◆ kCornerTemplate

constexpr LocalCornerVert kCornerTemplate[19]
staticconstexpr

Definition at line 216 of file GraphitePrimitivesSlide.cpp.

216 {
217 // Stroke-scale should be -1, 0, or 1.
218 // Mirror-scale should be 0 or 1.
219 // Center-weight should be -2 to never snap to center, -1 to snap when stroke coords would
220 // overlap, and 0 to snap for fill-style or overlapping coords.
221 // Local-aa-scale should be 0 or 1.
222
223 // position, normal, stroke-scale mirror-scale center-weight
224 // Device-space AA outsets from outer curve
225 { {0.0f, 1.0f}, { 0.0f, 1.0f}, 1.0f, 0.0f, -2.f },
226 { {0.0f, 1.0f}, { 0.0f, 1.0f}, 1.0f, 1.0f, -2.f },
227 { {0.0f, 1.0f}, { kHR2, kHR2}, 1.0f, 1.0f, -2.f },
228 { {1.0f, 0.0f}, { kHR2, kHR2}, 1.0f, 1.0f, -2.f },
229 { {1.0f, 0.0f}, { 1.0f, 0.0f}, 1.0f, 1.0f, -2.f },
230 { {1.0f, 0.0f}, { 1.0f, 0.0f}, 1.0f, 0.0f, -2.f },
231
232 // Outer anchors (no local or device-space normal outset)
233 { {0.0f, 1.0f}, { 0.0f, 0.0f}, 1.0f, 0.0f, -2.f },
234 { {0.0f, 1.0f}, { 0.0f, 0.0f}, 1.0f, 1.0f, -2.f },
235 { {1.0f, 0.0f}, { 0.0f, 0.0f}, 1.0f, 1.0f, -2.f },
236 { {1.0f, 0.0f}, { 0.0f, 0.0f}, 1.0f, 0.0f, -2.f },
237
238 // Center of stroke (equivalent to outer anchors when filling)
239 { {0.0f, 1.0f}, { 0.0f, 0.0f}, 0.0f, 0.0f, -2.f },
240 { {0.0f, 1.0f}, { 0.0f, 0.0f}, 0.0f, 1.0f, -2.f },
241 { {1.0f, 0.0f}, { 0.0f, 0.0f}, 0.0f, 1.0f, -2.f },
242 { {1.0f, 0.0f}, { 0.0f, 0.0f}, 0.0f, 0.0f, -2.f },
243
244 // Inner AA insets from inner curve
245 { {0.0f, 1.0f}, { 0.0f, -1.0f}, -1.0f, 0.0f, -1.f },
246 { {0.5f, 0.5f}, {-kHR2, -kHR2}, -1.0f, 1.0f, -1.f },
247 { {1.0f, 0.0f}, {-1.0f, 0.0f}, -1.0f, 0.0f, -1.f },
248
249 // Center filling vertices (equal to inner AA insets unless center-weight = 1)
250 { {0.5f, 0.5f}, {-kHR2, -kHR2}, -1.0f, 1.0f, 0.f },
251 { {1.0f, 0.0f}, {-1.0f, 0.0f}, -1.0f, 0.0f, 0.f },
252};
static constexpr float kHR2

◆ kEdgeIndices

const uint16_t kEdgeIndices[]
static
Initial value:
= {
kBR+5, kBR+5,kBR+9,kTR+0,kTR+6, kTR+6,
kBR+9, kBR+9,kBR+13,kTR+6,kTR+10, kTR+10,
kBR+13, kBR+13,kBR+16,kTR+10,kTR+14, kTR+14,
kTR+5, kTR+5,kTR+9,kTL+0,kTL+6, kTL+6,
kTR+9, kTR+9,kTR+13,kTL+6,kTL+10, kTL+10,
kTR+13, kTR+13,kTR+16,kTL+10,kTL+14, kTL+14,
kTL+5, kTL+5,kTL+9,kBL+0,kBL+6, kBL+6,
kTL+9, kTL+9,kTL+13,kBL+6,kBL+10, kBL+10,
kTL+13, kTL+13,kTL+16,kBL+10,kBL+14, kBL+14,
kBL+5, kBL+5,kBL+9,kBR+0,kBR+6, kBR+6,
kBL+9, kBL+9,kBL+13,kBR+6,kBR+10, kBR+10,
kBL+13, kBL+13,kBL+16,kBR+10,kBR+14, kBR+14,
}

Definition at line 422 of file GraphitePrimitivesSlide.cpp.

422 {
423 kBR+5, kBR+5,kBR+9,kTR+0,kTR+6, kTR+6,
424 kBR+9, kBR+9,kBR+13,kTR+6,kTR+10, kTR+10,
425 kBR+13, kBR+13,kBR+16,kTR+10,kTR+14, kTR+14,
426
427 kTR+5, kTR+5,kTR+9,kTL+0,kTL+6, kTL+6,
428 kTR+9, kTR+9,kTR+13,kTL+6,kTL+10, kTL+10,
429 kTR+13, kTR+13,kTR+16,kTL+10,kTL+14, kTL+14,
430
431 kTL+5, kTL+5,kTL+9,kBL+0,kBL+6, kBL+6,
432 kTL+9, kTL+9,kTL+13,kBL+6,kBL+10, kBL+10,
433 kTL+13, kTL+13,kTL+16,kBL+10,kBL+14, kBL+14,
434
435 kBL+5, kBL+5,kBL+9,kBR+0,kBR+6, kBR+6,
436 kBL+9, kBL+9,kBL+13,kBR+6,kBR+10, kBR+10,
437 kBL+13, kBL+13,kBL+16,kBR+10,kBR+14, kBR+14,
438};

◆ kHR2

constexpr float kHR2 = SK_ScalarRoot2Over2
staticconstexpr

Definition at line 214 of file GraphitePrimitivesSlide.cpp.

◆ kIndices

const uint16_t kIndices[]
static
Initial value:
= {
kBR+0,kBR+6,kBR+1,kBR+7,kBR+2,kBR+8,kBR+3,kBR+8,kBR+4,kBR+9,kBR+5,kBR+9,
kTR+0,kTR+6,kTR+1,kTR+7,kTR+2,kTR+8,kTR+3,kTR+8,kTR+4,kTR+9,kTR+5,kTR+9,
kTL+0,kTL+6,kTL+1,kTL+7,kTL+2,kTL+8,kTL+3,kTL+8,kTL+4,kTL+9,kTL+5,kTL+9,
kBL+0,kBL+6,kBL+1,kBL+7,kBL+2,kBL+8,kBL+3,kBL+8,kBL+4,kBL+9,kBL+5,kBL+9,
kBR+0,kBR+6,kBR+6,
kBR+6,kBR+10,kBR+7,kBR+11,kBR+8,kBR+12,kBR+9,kBR+13,
kTR+6,kTR+10,kTR+7,kTR+11,kTR+8,kTR+12,kTR+9,kTR+13,
kTL+6,kTL+10,kTL+7,kTL+11,kTL+8,kTL+12,kTL+9,kTL+13,
kBL+6,kBL+10,kBL+7,kBL+11,kBL+8,kBL+12,kBL+9,kBL+13,
kBR+6,kBR+10,kBR+10,
kBR+10,kBR+14,kBR+11,kBR+15,kBR+12,kBR+16,kBR+13,kBR+16,
kTR+10,kTR+14,kTR+11,kTR+15,kTR+12,kTR+16,kTR+13,kTR+16,
kTL+10,kTL+14,kTL+11,kTL+15,kTL+12,kTL+16,kTL+13,kTL+16,
kBL+10,kBL+14,kBL+11,kBL+15,kBL+12,kBL+16,kBL+13,kBL+16,
kBR+10,kBR+14,kBR+14,
kBR+14,kBR+17,kBR+15,kBR+17,kBR+16,kBR+16,kBR+18,kTR+14,
kTR+14,kTR+17,kTR+15,kTR+17,kTR+16,kTR+16,kTR+18,kTL+14,
kTL+14,kTL+17,kTL+15,kTL+17,kTL+16,kTL+16,kTL+18,kBL+14,
kBL+14,kBL+17,kBL+15,kBL+17,kBL+16,kBL+16,kBL+18,kBR+14
}

Definition at line 368 of file GraphitePrimitivesSlide.cpp.

368 {
369 // Exterior AA ramp outset
370 kBR+0,kBR+6,kBR+1,kBR+7,kBR+2,kBR+8,kBR+3,kBR+8,kBR+4,kBR+9,kBR+5,kBR+9,
371 kTR+0,kTR+6,kTR+1,kTR+7,kTR+2,kTR+8,kTR+3,kTR+8,kTR+4,kTR+9,kTR+5,kTR+9,
372 kTL+0,kTL+6,kTL+1,kTL+7,kTL+2,kTL+8,kTL+3,kTL+8,kTL+4,kTL+9,kTL+5,kTL+9,
373 kBL+0,kBL+6,kBL+1,kBL+7,kBL+2,kBL+8,kBL+3,kBL+8,kBL+4,kBL+9,kBL+5,kBL+9,
374 kBR+0,kBR+6,kBR+6, // close and extra vertex to jump to next strip
375 // Outer to central curve
376 kBR+6,kBR+10,kBR+7,kBR+11,kBR+8,kBR+12,kBR+9,kBR+13,
377 kTR+6,kTR+10,kTR+7,kTR+11,kTR+8,kTR+12,kTR+9,kTR+13,
378 kTL+6,kTL+10,kTL+7,kTL+11,kTL+8,kTL+12,kTL+9,kTL+13,
379 kBL+6,kBL+10,kBL+7,kBL+11,kBL+8,kBL+12,kBL+9,kBL+13,
380 kBR+6,kBR+10,kBR+10, // close and extra vertex to jump to next strip
381 // Center to inner curve's insets
382 kBR+10,kBR+14,kBR+11,kBR+15,kBR+12,kBR+16,kBR+13,kBR+16,
383 kTR+10,kTR+14,kTR+11,kTR+15,kTR+12,kTR+16,kTR+13,kTR+16,
384 kTL+10,kTL+14,kTL+11,kTL+15,kTL+12,kTL+16,kTL+13,kTL+16,
385 kBL+10,kBL+14,kBL+11,kBL+15,kBL+12,kBL+16,kBL+13,kBL+16,
386 kBR+10,kBR+14,kBR+14, // close and extra vertex to jump to next strip
387 // Inner inset to center of shape
388 kBR+14,kBR+17,kBR+15,kBR+17,kBR+16,kBR+16,kBR+18,kTR+14,
389 kTR+14,kTR+17,kTR+15,kTR+17,kTR+16,kTR+16,kTR+18,kTL+14,
390 kTL+14,kTL+17,kTL+15,kTL+17,kTL+16,kTL+16,kTL+18,kBL+14,
391 kBL+14,kBL+17,kBL+15,kBL+17,kBL+16,kBL+16,kBL+18,kBR+14 // close
392};

◆ kInnerCornerIndices

const uint16_t kInnerCornerIndices[]
static
Initial value:
= {
kBR+10, kBR+10,kBR+14,kBR+11,kBR+15,kBR+12,kBR+16,kBR+13, kBR+13,
kTR+10, kTR+10,kTR+14,kTR+11,kTR+15,kTR+12,kTR+16,kTR+13, kTR+13,
kTL+10, kTL+10,kTL+14,kTL+11,kTL+15,kTL+12,kTL+16,kTL+13, kTL+13,
kBL+10, kBL+10,kBL+14,kBL+11,kBL+15,kBL+12,kBL+16,kBL+13, kBL+13,
}

Definition at line 407 of file GraphitePrimitivesSlide.cpp.

407 {
408 kBR+10, kBR+10,kBR+14,kBR+11,kBR+15,kBR+12,kBR+16,kBR+13, kBR+13,
409 kTR+10, kTR+10,kTR+14,kTR+11,kTR+15,kTR+12,kTR+16,kTR+13, kTR+13,
410 kTL+10, kTL+10,kTL+14,kTL+11,kTL+15,kTL+12,kTL+16,kTL+13, kTL+13,
411 kBL+10, kBL+10,kBL+14,kBL+11,kBL+15,kBL+12,kBL+16,kBL+13, kBL+13,
412};

◆ kInteriorIndices

const uint16_t kInteriorIndices[]
static
Initial value:
= {
kBR+14,kBR+17,kBR+15,kBR+17,kBR+16,kBR+16,kBR+18,kTR+14,
kTR+14,kTR+17,kTR+15,kTR+17,kTR+16,kTR+16,kTR+18,kTL+14,
kTL+14,kTL+17,kTL+15,kTL+17,kTL+16,kTL+16,kTL+18,kBL+14,
kBL+14,kBL+17,kBL+15,kBL+17,kBL+16,kBL+16,kBL+18,kBR+14
}

Definition at line 414 of file GraphitePrimitivesSlide.cpp.

414 {
415 kBR+14,kBR+17,kBR+15,kBR+17,kBR+16,kBR+16,kBR+18,kTR+14,
416 kTR+14,kTR+17,kTR+15,kTR+17,kTR+16,kTR+16,kTR+18,kTL+14,
417 kTL+14,kTL+17,kTL+15,kTL+17,kTL+16,kTL+16,kTL+18,kBL+14,
418 kBL+14,kBL+17,kBL+15,kBL+17,kBL+16,kBL+16,kBL+18,kBR+14 // close
419};

◆ kMiterScale

constexpr float kMiterScale = 1.f
staticconstexpr

Definition at line 103 of file GraphitePrimitivesSlide.cpp.

◆ kOuterCornerIndices

const uint16_t kOuterCornerIndices[]
static
Initial value:
= {
kBR+0, kBR+0,kBR+6,kBR+1,kBR+7,kBR+2,kBR+8,kBR+3,kBR+8,kBR+4,kBR+9,kBR+5, kBR+5,
kTR+0, kTR+0,kTR+6,kTR+1,kTR+7,kTR+2,kTR+8,kTR+3,kTR+8,kTR+4,kTR+9,kTR+5, kTR+5,
kTL+0, kTL+0,kTL+6,kTL+1,kTL+7,kTL+2,kTL+8,kTL+3,kTL+8,kTL+4,kTL+9,kTL+5, kTL+5,
kBL+0, kBL+0,kBL+6,kBL+1,kBL+7,kBL+2,kBL+8,kBL+3,kBL+8,kBL+4,kBL+9,kBL+5, kBL+5,
kBR+6, kBR+6,kBR+10,kBR+7,kBR+11,kBR+8,kBR+12,kBR+9,kBR+13, kBR+13,
kTR+6, kTR+6,kTR+10,kTR+7,kTR+11,kTR+8,kTR+12,kTR+9,kTR+13, kTR+13,
kTL+6, kTL+6,kTL+10,kTL+7,kTL+11,kTL+8,kTL+12,kTL+9,kTL+13, kTL+13,
kBL+6, kBL+6,kBL+10,kBL+7,kBL+11,kBL+8,kBL+12,kBL+9,kBL+13, kBL+13
}

Definition at line 395 of file GraphitePrimitivesSlide.cpp.

395 {
396 kBR+0, kBR+0,kBR+6,kBR+1,kBR+7,kBR+2,kBR+8,kBR+3,kBR+8,kBR+4,kBR+9,kBR+5, kBR+5,
397 kTR+0, kTR+0,kTR+6,kTR+1,kTR+7,kTR+2,kTR+8,kTR+3,kTR+8,kTR+4,kTR+9,kTR+5, kTR+5,
398 kTL+0, kTL+0,kTL+6,kTL+1,kTL+7,kTL+2,kTL+8,kTL+3,kTL+8,kTL+4,kTL+9,kTL+5, kTL+5,
399 kBL+0, kBL+0,kBL+6,kBL+1,kBL+7,kBL+2,kBL+8,kBL+3,kBL+8,kBL+4,kBL+9,kBL+5, kBL+5,
400
401 kBR+6, kBR+6,kBR+10,kBR+7,kBR+11,kBR+8,kBR+12,kBR+9,kBR+13, kBR+13,
402 kTR+6, kTR+6,kTR+10,kTR+7,kTR+11,kTR+8,kTR+12,kTR+9,kTR+13, kTR+13,
403 kTL+6, kTL+6,kTL+10,kTL+7,kTL+11,kTL+8,kTL+12,kTL+9,kTL+13, kTL+13,
404 kBL+6, kBL+6,kBL+10,kBL+7,kBL+11,kBL+8,kBL+12,kBL+9,kBL+13, kBL+13
405};

◆ kRoundScale

constexpr float kRoundScale = SK_FloatSqrt2 - 1.f
staticconstexpr

Definition at line 105 of file GraphitePrimitivesSlide.cpp.

◆ kTL

const uint16_t kTL = 2*std::size(kCornerTemplate)
static

Definition at line 288 of file GraphitePrimitivesSlide.cpp.

◆ kTR

const uint16_t kTR = 1*std::size(kCornerTemplate)
static

Definition at line 287 of file GraphitePrimitivesSlide.cpp.

◆ kVertexCount

const size_t kVertexCount = 4*std::size(kCornerTemplate)
static

Definition at line 290 of file GraphitePrimitivesSlide.cpp.