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

Unified Diff: src/gpu/GrPath.h

Issue 26557003: Add a GPU paths to resource cache of the context (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rebase Created 7 years, 1 month 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/GrContext.cpp ('k') | 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 37dc9591a63deb5f2c809515ed9f49f99ac2c5b8..f481ea428644788af0add1c1fd1a1000214d8bca 100644
--- a/src/gpu/GrPath.h
+++ b/src/gpu/GrPath.h
@@ -9,6 +9,8 @@
#define GrPath_DEFINED
#include "GrResource.h"
+#include "GrResourceCache.h"
+#include "SkPath.h"
#include "SkRect.h"
#include "SkStrokeRec.h"
@@ -16,9 +18,17 @@ class GrPath : public GrResource {
public:
SK_DECLARE_INST_COUNT(GrPath);
- GrPath(GrGpu* gpu, bool isWrapped, const SkStrokeRec& stroke)
+ GrPath(GrGpu* gpu, bool isWrapped, const SkPath& skPath, const SkStrokeRec& stroke)
: INHERITED(gpu, isWrapped),
- fStroke(stroke) {
+ fSkPath(skPath),
+ fStroke(stroke),
+ fBounds(skPath.getBounds()) {
+ }
+
+ static GrResourceKey ComputeKey(const SkPath& path, const SkStrokeRec& stroke);
+
+ bool isEqualTo(const SkPath& path, const SkStrokeRec& stroke) {
+ return fSkPath == path && fStroke == stroke;
}
const SkRect& getBounds() const { return fBounds; }
@@ -26,8 +36,9 @@ public:
const SkStrokeRec& getStroke() const { return fStroke; }
protected:
- SkRect fBounds;
+ SkPath fSkPath;
SkStrokeRec fStroke;
+ SkRect fBounds;
private:
typedef GrResource INHERITED;
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrPath.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698