aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrSWMaskHelper.h
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2016-12-14 12:19:05 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-12-14 19:04:02 +0000
commite305cc1f2a44e47d6a0dcc0ff34e2692349aed5d (patch)
tree3e49ee1ef55a8c434ef6f580576153707705c2ea /src/gpu/GrSWMaskHelper.h
parent95ada6ee732f9b3a335d6acb3cdba0bc97b5e979 (diff)
Partially defer GrSWMaskHelper
This is intended to position the writePixels in GrSWMaskHelper::toTexture for moving to GrSurfaceContext Change-Id: I6c3d24eb3b1db3b0efc63f7f4f1240a7a00ee88a Reviewed-on: https://skia-review.googlesource.com/6032 Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
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;