#include "SkTextureCompressor.h"
#include "SkTypes.h"
-class GrAutoScratchTexture;
class GrContext;
class GrTexture;
class SkPath;
void draw(const SkPath& path, const SkStrokeRec& stroke, SkRegion::Op op,
bool antiAlias, uint8_t alpha);
- // Helper function to get a scratch texture suitable for capturing the
- // result (i.e., right size & format)
- bool getTexture(GrAutoScratchTexture* texture);
-
// Move the mask generation results from the internal bitmap to the gpu.
void toTexture(GrTexture* texture);
+ // Convert mask generation results to a signed distance field
+ void toSDF(unsigned char* sdf);
+
// Reset the internal bitmap
void clear(uint8_t alpha) {
fBM.eraseColor(SkColorSetARGB(alpha, alpha, alpha, alpha));
}
// Canonical usage utility that draws a single path and uploads it
- // to the GPU. The result is returned in "result".
+ // to the GPU. The result is returned.
static GrTexture* DrawPathMaskToTexture(GrContext* context,
const SkPath& path,
const SkStrokeRec& stroke,
const SkIRect& rect);
private:
+ // Helper function to get a scratch texture suitable for capturing the
+ // result (i.e., right size & format)
+ GrTexture* createTexture();
+
GrContext* fContext;
SkMatrix fMatrix;
SkBitmap fBM;
// Actually sends the texture data to the GPU. This is called from
// toTexture with the data filled in depending on the texture config.
- void sendTextureData(GrTexture *texture, const GrTextureDesc& desc,
+ void sendTextureData(GrTexture *texture, const GrSurfaceDesc& desc,
const void *data, int rowbytes);
// Compresses the bitmap stored in fBM and sends the compressed data
// to the GPU to be stored in 'texture' using sendTextureData.
- void compressTextureData(GrTexture *texture, const GrTextureDesc& desc);
+ void compressTextureData(GrTexture *texture, const GrSurfaceDesc& desc);
typedef SkNoncopyable INHERITED;
};