Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(248)

Unified Diff: src/gpu/GrPath.h

Issue 1116123003: Improve caching of dashed paths in GrStencilAndCoverPathRenderer (Closed) Base URL: https://skia.googlesource.com/skia.git@dashing-nvpr-01
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/gpu/GrPath.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrPath.h
diff --git a/src/gpu/GrPath.h b/src/gpu/GrPath.h
index ab8c51f2afb6143998b6cedfdac32aa2e4366c7e..a535e697caafefb9416dd9721d0617c9a1526d68 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;
« no previous file with comments | « no previous file | src/gpu/GrPath.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698