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

Unified Diff: src/gpu/GrPathRange.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 | « src/gpu/GrPath.cpp ('k') | src/gpu/GrPathRange.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrPathRange.h
diff --git a/src/gpu/GrPathRange.h b/src/gpu/GrPathRange.h
index 86883e3c27083c1f07a88175669e5138c4bc8654..035837fc361d74cbecdbb4feb2f60a886ee195de 100644
--- a/src/gpu/GrPathRange.h
+++ b/src/gpu/GrPathRange.h
@@ -10,14 +10,13 @@
#include "GrGpuResource.h"
#include "SkRefCnt.h"
-#include "SkStrokeRec.h"
#include "SkTArray.h"
class SkPath;
class SkDescriptor;
/**
- * Represents a contiguous range of GPU path objects, all with a common stroke.
+ * Represents a contiguous range of GPU path objects.
* This object is immutable with the exception that individual paths may be
* initialized lazily.
*/
@@ -50,7 +49,9 @@ public:
public:
virtual int getNumPaths() = 0;
virtual void generatePath(int index, SkPath* out) = 0;
+#ifdef SK_DEBUG
virtual bool isEqualTo(const SkDescriptor&) const { return false; }
+#endif
virtual ~PathGenerator() {}
};
@@ -58,22 +59,22 @@ public:
* Initialize a lazy-loaded path range. This class will generate an SkPath and call
* onInitPath() for each path within the range before it is drawn for the first time.
*/
- GrPathRange(GrGpu*, PathGenerator*, const SkStrokeRec& stroke);
+ GrPathRange(GrGpu*, PathGenerator*);
/**
* Initialize an eager-loaded path range. The subclass is responsible for ensuring all
* the paths are initialized up front.
*/
- GrPathRange(GrGpu*, int numPaths, const SkStrokeRec& stroke);
-
- virtual bool isEqualTo(const SkDescriptor& desc) const {
- return NULL != fPathGenerator.get() && fPathGenerator->isEqualTo(desc);
- }
+ GrPathRange(GrGpu*, int numPaths);
int getNumPaths() const { return fNumPaths; }
- const SkStrokeRec& getStroke() const { return fStroke; }
const PathGenerator* getPathGenerator() const { return fPathGenerator.get(); }
+#ifdef SK_DEBUG
+ virtual bool isEqualTo(const SkDescriptor& desc) const {
+ return NULL != fPathGenerator.get() && fPathGenerator->isEqualTo(desc);
+ }
+#endif
protected:
// Initialize a path in the range before drawing. This is only called when
// fPathGenerator is non-null. The child class need not call didChangeGpuMemorySize(),
@@ -89,7 +90,6 @@ private:
mutable SkAutoTUnref<PathGenerator> fPathGenerator;
mutable SkTArray<uint8_t, true /*MEM_COPY*/> fGeneratedPaths;
const int fNumPaths;
- const SkStrokeRec fStroke;
typedef GrGpuResource INHERITED;
};
« no previous file with comments | « src/gpu/GrPath.cpp ('k') | src/gpu/GrPathRange.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698