Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / third_party / skia / src / gpu / GrSWMaskHelper.h
index f8cce8b..22d04ef 100644 (file)
@@ -18,7 +18,6 @@
 #include "SkTextureCompressor.h"
 #include "SkTypes.h"
 
-class GrAutoScratchTexture;
 class GrContext;
 class GrTexture;
 class SkPath;
@@ -61,20 +60,19 @@ public:
     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,
@@ -97,6 +95,10 @@ public:
                                          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;
@@ -123,12 +125,12 @@ private:
 
     // 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;
 };