aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrPath.h
diff options
context:
space:
mode:
authorGravatar kkinnunen <kkinnunen@nvidia.com>2015-05-18 23:02:07 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-05-18 23:02:07 -0700
commit50b58e6fbcc50785ceffacb2c51b22c6e67a7ab7 (patch)
tree90e4c1dbf12534523f1f7e8a1cece158bd58cb45 /src/gpu/GrPath.h
parent54b8511189bb5da6bfd248fa63f5c4156e9e2bd6 (diff)
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
Diffstat (limited to 'src/gpu/GrPath.h')
-rw-r--r--src/gpu/GrPath.h34
1 files changed, 19 insertions, 15 deletions
diff --git a/src/gpu/GrPath.h b/src/gpu/GrPath.h
index ab8c51f2af..a535e697ca 100644
--- a/src/gpu/GrPath.h
+++ b/src/gpu/GrPath.h
@@ -9,9 +9,9 @@
#define GrPath_DEFINED
#include "GrGpuResource.h"
+#include "GrStrokeInfo.h"
#include "SkPath.h"
#include "SkRect.h"
-#include "SkStrokeRec.h"
class GrPath : public GrGpuResource {
public:
@@ -20,28 +20,32 @@ public:
/**
* Initialize to a path with a fixed stroke. Stroke must not be hairline.
*/
- GrPath(GrGpu* gpu, const SkPath& skPath, const SkStrokeRec& stroke)
- : INHERITED(gpu, kCached_LifeCycle),
- fSkPath(skPath),
- fStroke(stroke),
- fBounds(skPath.getBounds()) {
+ GrPath(GrGpu* gpu, const SkPath& skPath, const GrStrokeInfo& stroke)
+ : INHERITED(gpu, kCached_LifeCycle)
+ , fBounds(skPath.getBounds())
+#ifdef SK_DEBUG
+ , fSkPath(skPath)
+ , fStroke(stroke)
+#endif
+ {
}
- static void ComputeKey(const SkPath& path, const SkStrokeRec& stroke, GrUniqueKey* key);
- static uint64_t ComputeStrokeKey(const SkStrokeRec&);
-
- bool isEqualTo(const SkPath& path, const SkStrokeRec& stroke) {
- return fSkPath == path && fStroke.hasEqualEffect(stroke);
- }
+ static void ComputeKey(const SkPath& path, const GrStrokeInfo& stroke, GrUniqueKey* key);
const SkRect& getBounds() const { return fBounds; }
- const SkStrokeRec& getStroke() const { return fStroke; }
+#ifdef SK_DEBUG
+ bool isEqualTo(const SkPath& path, const GrStrokeInfo& stroke) {
+ return fSkPath == path && fStroke.hasEqualEffect(stroke);
+ }
+#endif
protected:
- SkPath fSkPath;
- SkStrokeRec fStroke;
SkRect fBounds;
+#ifdef SK_DEBUG
+ SkPath fSkPath;
+ GrStrokeInfo fStroke;
+#endif
private:
typedef GrGpuResource INHERITED;