252 {
257
260
267
270
271
273 canvas->
drawRect(fOuterRect, linePaint);
274
275 bool valid = this->isValid();
276
277 if (valid) {
280
281 for (
int i = 0;
i < 4; ++
i) {
282 make_aa_line(fCorners[
i], fCorners[(
i + 1) % 4], fEdgeAA[
i],
true, outsets +
i * 2);
283 make_aa_line(fCorners[
i], fCorners[(
i + 1) % 4], fEdgeAA[
i],
false, insets +
i * 2);
284 }
285
286
292 this->getTessellatedPoints(gpuInset, gpuInsetCoverage, gpuOutset, gpuOutsetCoverage,
293 &gpuDomain);
294
295
296
302
303
304 SkPoint pixelCenter = {px + 0.5f, py + 0.5f};
306 if (fCoverageMode == CoverageMode::kArea) {
308 } else if (fCoverageMode == CoverageMode::kEdgeDistance) {
310 pixelCenter);
311 } else {
312 SkASSERT(fCoverageMode == CoverageMode::kGPUMesh);
314 gpuInset, gpuInsetCoverage, gpuDomain,
315 pixelCenter);
316 }
317
319 pixelRect.
inset(0.1f, 0.1f);
320
323 canvas->
drawRect(pixelRect, pixelPaint);
324
326 pixelRect.
inset(0.38f, 0.38f);
327 canvas->
drawRect(pixelRect, pixelPaint);
328 }
329 }
330
332
333 if (fCoverageMode == CoverageMode::kEdgeDistance) {
334 for (
int i = 0;
i < 4; ++
i) {
340 } else {
341
344 }
345 }
346 }
347
349
350 if (fCoverageMode == CoverageMode::kGPUMesh) {
352 outsetPath.
addPoly(gpuOutset, 4,
true);
354 canvas->
drawPath(outsetPath, linePaint);
355
357 insetPath.
addPoly(gpuInset, 4,
true);
359 canvas->
drawPath(insetPath, linePaint);
360
361 SkPaint domainPaint = linePaint;
365 canvas->
drawRect(gpuDomain, domainPaint);
366 }
367
368
370 path.addPoly(fCorners, 4,
true);
373 } else {
374
376 path.addPoly(fCorners, 4,
true);
380 }
381
382
384 for (
int i = 0;
i < 4; ++
i) {
386 }
387 }
static constexpr SkScalar kViewScale
static SkScalar get_area_coverage(const bool edgeAA[4], const SkPoint corners[4], const SkPoint &point)
static SkScalar get_edge_dist_coverage(const bool edgeAA[4], const SkPoint corners[4], const SkPoint outsetLines[8], const SkPoint insetLines[8], const SkPoint &point)
static void make_aa_line(const SkPoint &p0, const SkPoint &p1, bool aaOn, bool outset, SkPoint line[2])
static void draw_extended_line(SkCanvas *canvas, const SkPaint &paint, const SkPoint &p0, const SkPoint &p1)
static constexpr SkScalar kViewOffset
static SkScalar get_framed_coverage(const SkPoint outer[4], const SkScalar outerCoverages[4], const SkPoint inner[4], const SkScalar innerCoverages[4], const SkRect &geomDomain, const SkPoint &point)
constexpr SkColor SK_ColorMAGENTA
constexpr SkColor SK_ColorCYAN
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorRED
constexpr SkColor SK_ColorBLACK
constexpr SkColor SK_ColorGREEN
void drawRect(const SkRect &rect, const SkPaint &paint)
void translate(SkScalar dx, SkScalar dy)
void drawPath(const SkPath &path, const SkPaint &paint)
void scale(SkScalar sx, SkScalar sy)
void drawCircle(SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint &paint)
static sk_sp< SkPathEffect > Make(const SkScalar intervals[], int count, SkScalar phase)
void setStyle(Style style)
void setColor(SkColor color)
void setAntiAlias(bool aa)
void setStrokeCap(Cap cap)
@ kStroke_Style
set to stroke geometry
void setStrokeJoin(Join join)
void setColor4f(const SkColor4f &color, SkColorSpace *colorSpace=nullptr)
void setPathEffect(sk_sp< SkPathEffect > pathEffect)
void setStrokeWidth(SkScalar width)
SkPath & addPoly(const SkPoint pts[], int count, bool close)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
SkScalar fBottom
larger y-axis bounds
void inset(float dx, float dy)
SkScalar fLeft
smaller x-axis bounds
SkRect makeOutset(float dx, float dy) const
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
SkScalar fRight
larger x-axis bounds
SkScalar fTop
smaller y-axis bounds