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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrPath.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef GrPath_DEFINED 8 #ifndef GrPath_DEFINED
9 #define GrPath_DEFINED 9 #define GrPath_DEFINED
10 10
11 #include "GrResource.h" 11 #include "GrResource.h"
12 #include "GrResourceCache.h"
13 #include "SkPath.h"
12 #include "SkRect.h" 14 #include "SkRect.h"
13 #include "SkStrokeRec.h" 15 #include "SkStrokeRec.h"
14 16
15 class GrPath : public GrResource { 17 class GrPath : public GrResource {
16 public: 18 public:
17 SK_DECLARE_INST_COUNT(GrPath); 19 SK_DECLARE_INST_COUNT(GrPath);
18 20
19 GrPath(GrGpu* gpu, bool isWrapped, const SkStrokeRec& stroke) 21 GrPath(GrGpu* gpu, bool isWrapped, const SkPath& skPath, const SkStrokeRec& stroke)
20 : INHERITED(gpu, isWrapped), 22 : INHERITED(gpu, isWrapped),
21 fStroke(stroke) { 23 fSkPath(skPath),
24 fStroke(stroke),
25 fBounds(skPath.getBounds()) {
26 }
27
28 static GrResourceKey ComputeKey(const SkPath& path, const SkStrokeRec& strok e);
29
30 bool isEqualTo(const SkPath& path, const SkStrokeRec& stroke) {
31 return fSkPath == path && fStroke == stroke;
22 } 32 }
23 33
24 const SkRect& getBounds() const { return fBounds; } 34 const SkRect& getBounds() const { return fBounds; }
25 35
26 const SkStrokeRec& getStroke() const { return fStroke; } 36 const SkStrokeRec& getStroke() const { return fStroke; }
27 37
28 protected: 38 protected:
39 SkPath fSkPath;
40 SkStrokeRec fStroke;
29 SkRect fBounds; 41 SkRect fBounds;
30 SkStrokeRec fStroke;
31 42
32 private: 43 private:
33 typedef GrResource INHERITED; 44 typedef GrResource INHERITED;
34 }; 45 };
35 46
36 #endif 47 #endif
OLDNEW
« 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