Improve caching of dashed paths in GrStencilAndCoverPathRenderer
Improve caching of dashed paths in GrStencilAndCoverPathRenderer.
Look up the (NVPR specific) GrGLPath based on GrStrokeInfo and
the original path.
Use unique keys for all GrPaths.
Dash the path with Skia dash stroker and use that path geometry for
NVPR path.
NVPR internal dashing stroke is not used, because the dashing
implementation of NVPR does not match Skia implementation.
Review URL: https://codereview.chromium.org/1116123003
diff --git a/src/gpu/gl/GrGLPath.h b/src/gpu/gl/GrGLPath.h
index f02f705..b394050 100644
--- a/src/gpu/gl/GrGLPath.h
+++ b/src/gpu/gl/GrGLPath.h
@@ -25,11 +25,13 @@
static void InitPathObject(GrGLGpu*,
GrGLuint pathID,
const SkPath&,
- const SkStrokeRec&);
+ const GrStrokeInfo&);
- GrGLPath(GrGLGpu* gpu, const SkPath& path, const SkStrokeRec& stroke);
+ GrGLPath(GrGLGpu* gpu, const SkPath& path, const GrStrokeInfo& stroke);
GrGLuint pathID() const { return fPathID; }
+ bool shouldStroke() const { return fShouldStroke; }
+ bool shouldFill() const { return fShouldFill; }
protected:
void onRelease() override;
void onAbandon() override;
@@ -39,6 +41,8 @@
size_t onGpuMemorySize() const override { return 100; }
GrGLuint fPathID;
+ bool fShouldStroke;
+ bool fShouldFill;
typedef GrPath INHERITED;
};