diff -r 000000000000 -r 6474c204b198 gfx/skia/trunk/src/core/SkDistanceFieldGen.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gfx/skia/trunk/src/core/SkDistanceFieldGen.h Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,25 @@ +/* + * Copyright 2014 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ +#ifndef SkDistanceFieldGen_DEFINED +#define SkDistanceFieldGen_DEFINED + +/** Given 8-bit mask data, generate the associated distance field + + * @param distanceField The distance field to be generated. Should already be allocated + * by the client with the padding below. + * @param image 8-bit mask we're using to generate the distance field. + * @param w Width of the image. + * @param h Height of the image. + * @param distanceMagnitude Largest possible absolute value for the distance. The distance field + * will be padded to w + 2*distanceMagnitude, h + 2*distanceMagnitude. + */ +bool SkGenerateDistanceFieldFromImage(unsigned char* distanceField, + const unsigned char* image, + int w, int h, + int distanceMagnitude); + +#endif