Flutter Engine
The Flutter Engine
SkDrawProcs.h
Go to the documentation of this file.
1/*
2 * Copyright 2011 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef SkDrawProcs_DEFINED
9#define SkDrawProcs_DEFINED
10
13class SkMatrix;
14
17
18/**
19 * If the current paint is set to stroke and the stroke-width when applied to
20 * the matrix is <= 1.0, then this returns true, and sets coverage (simulating
21 * a stroke by drawing a hairline with partial coverage). If any of these
22 * conditions are false, then this returns false and coverage is ignored.
23 */
26 if (SkPaint::kStroke_Style != paint.getStyle()) {
27 return false;
28 }
29
30 SkScalar strokeWidth = paint.getStrokeWidth();
31 if (0 == strokeWidth) {
33 return true;
34 }
35
36 if (!paint.isAntiAlias()) {
37 return false;
38 }
39
41}
42
43#endif
static const int strokeWidth
Definition: BlurTest.cpp:60
bool SkDrawTreatAsHairline(const SkPaint &paint, const SkMatrix &matrix, SkScalar *coverage)
Definition: SkDrawProcs.h:24
bool SkDrawTreatAAStrokeAsHairline(SkScalar strokeWidth, const SkMatrix &, SkScalar *coverage)
Definition: SkDrawBase.cpp:262
#define SK_Scalar1
Definition: SkScalar.h:18
@ kStroke_Style
set to stroke geometry
Definition: SkPaint.h:194
const Paint & paint
Definition: color_source.cc:38
float SkScalar
Definition: extension.cpp:12
unsigned useCenter Optional< SkMatrix > matrix
Definition: SkRecords.h:258