aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrSWMaskHelper.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/GrSWMaskHelper.h')
-rw-r--r--src/gpu/GrSWMaskHelper.h22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/gpu/GrSWMaskHelper.h b/src/gpu/GrSWMaskHelper.h
index 55ed3ff2e5..6ec1c821fd 100644
--- a/src/gpu/GrSWMaskHelper.h
+++ b/src/gpu/GrSWMaskHelper.h
@@ -43,7 +43,7 @@ struct GrUserStencilSettings;
*/
class GrSWMaskHelper : SkNoncopyable {
public:
- GrSWMaskHelper(GrTextureProvider* texProvider) : fTexProvider(texProvider) { }
+ GrSWMaskHelper() { }
// set up the internal state in preparation for draws. Since many masks
// may be accumulated in the helper during creation, "resultBounds"
@@ -57,8 +57,7 @@ public:
// Draw a single path into the accumuation bitmap using the specified op
void drawShape(const GrShape&, SkRegion::Op op, GrAA, uint8_t alpha);
- // Move the mask generation results from the internal bitmap to the gpu.
- void toTexture(GrTexture* texture);
+ sk_sp<GrTextureProxy> toTexture(GrContext*, SkBackingFit fit);
// Convert mask generation results to a signed distance field
void toSDF(unsigned char* sdf);
@@ -70,12 +69,12 @@ public:
// Canonical usage utility that draws a single path and uploads it
// to the GPU. The result is returned.
- static GrTexture* DrawShapeMaskToTexture(GrTextureProvider*,
- const GrShape&,
- const SkIRect& resultBounds,
- GrAA,
- SkBackingFit,
- const SkMatrix* matrix);
+ static sk_sp<GrTexture> DrawShapeMaskToTexture(GrContext*,
+ const GrShape&,
+ const SkIRect& resultBounds,
+ GrAA,
+ SkBackingFit,
+ const SkMatrix* matrix);
// This utility draws a path mask generated by DrawShapeMaskToTexture using a provided paint.
// The rectangle is drawn in device space. The 'viewMatrix' will be used to ensure the correct
@@ -90,11 +89,6 @@ public:
const SkIRect& deviceSpaceRectToDraw);
private:
- // Helper function to get a scratch texture suitable for capturing the
- // result (i.e., right size & format)
- GrTexture* createTexture(SkBackingFit);
-
- GrTextureProvider* fTexProvider;
SkMatrix fMatrix;
SkAutoPixmapStorage fPixels;
SkDraw fDraw;