Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
|
jvanverth1
2017/01/04 21:12:27
Is there a reason this file is in src/gpu and not
Joel.Liang
2017/01/06 05:28:09
It's because we used the GrPathUtils::convertCubic
| |
| 2 * Copyright 2016 ARM Ltd. | |
| 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 GrDistanceFieldGenFromVector_DEFINED | |
| 9 #define GrDistanceFieldGenFromVector_DEFINED | |
| 10 | |
| 11 #include "SkDistanceFieldGen.h" | |
|
jvanverth1
2017/01/04 21:12:27
This include could be in GrDistanceFieldGenFromVec
Joel.Liang
2017/01/06 05:28:09
Done.
| |
| 12 #include "SkPath.h" | |
| 13 #include "SkMatrix.h" | |
|
jvanverth1
2017/01/04 21:12:27
This could be replaced by
class Matrix;
and pu
Joel.Liang
2017/01/06 05:28:09
Done.
| |
| 14 | |
|
jvanverth1
2017/01/04 21:12:27
Add #define SK_USE_LEGACY_DISTANCE_FIELDS here?
Joel.Liang
2017/01/06 05:28:09
Done.
And I have added an #ifndef directive to su
| |
| 15 /** Given a vector path, generate the associated distance field. | |
| 16 | |
| 17 * @param distanceField The distance field to be generated. Should already be allocated | |
| 18 * by the client with the padding defined in "SkDistan ceFieldGen.h". | |
| 19 * @param path The path we're using to generate the distance field . | |
| 20 * @param matrix Transformation matrix for path. | |
| 21 * @param width Width of the distance field. | |
| 22 * @param height Height of the distance field. | |
| 23 * @param rowBytes Size of each row in the distance field, in bytes. | |
| 24 */ | |
| 25 bool GrGenerateDistanceFieldFromPath(unsigned char* distanceField, | |
| 26 const SkPath& path, const SkMatrix& viewMat rix, | |
| 27 int width, int height, size_t rowBytes); | |
| 28 | |
| 29 inline bool IsDistanceFieldSupportedFillType(SkPath::FillType fFillType) | |
| 30 { | |
| 31 return (SkPath::kEvenOdd_FillType == fFillType || | |
| 32 SkPath::kInverseEvenOdd_FillType == fFillType); | |
| 33 } | |
| 34 | |
| 35 #endif | |
| OLD | NEW |