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

Side by Side Diff: src/gpu/GrPathRange.h

Issue 504313002: Make GrGpuResources register with GrResourceCache2 after fully constructed. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix insertion for GlyphPathRange. Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « src/gpu/GrGpuResource.cpp ('k') | src/gpu/GrResourceCache2.h » ('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 2014 Google Inc. 2 * Copyright 2014 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 GrPathRange_DEFINED 8 #ifndef GrPathRange_DEFINED
9 #define GrPathRange_DEFINED 9 #define GrPathRange_DEFINED
10 10
(...skipping 20 matching lines...) Expand all
31 return type; 31 return type;
32 } 32 }
33 33
34 /** 34 /**
35 * Initialize to a range with a fixed size and stroke. Stroke must not be ha irline. 35 * Initialize to a range with a fixed size and stroke. Stroke must not be ha irline.
36 */ 36 */
37 GrPathRange(GrGpu* gpu, size_t size, const SkStrokeRec& stroke) 37 GrPathRange(GrGpu* gpu, size_t size, const SkStrokeRec& stroke)
38 : INHERITED(gpu, kIsWrapped), 38 : INHERITED(gpu, kIsWrapped),
39 fSize(size), 39 fSize(size),
40 fStroke(stroke) { 40 fStroke(stroke) {
41 this->registerWithCache();
41 } 42 }
42 43
43 size_t getSize() const { return fSize; } 44 size_t getSize() const { return fSize; }
44 const SkStrokeRec& getStroke() const { return fStroke; } 45 const SkStrokeRec& getStroke() const { return fStroke; }
45 46
46 /** 47 /**
47 * Initialize a path in the range. It is invalid to call this method for a 48 * Initialize a path in the range. It is invalid to call this method for a
48 * path that has already been initialized. 49 * path that has already been initialized.
49 */ 50 */
50 virtual void initAt(size_t index, const SkPath&) = 0; 51 virtual void initAt(size_t index, const SkPath&) = 0;
51 52
52 protected: 53 protected:
53 size_t fSize; 54 size_t fSize;
54 SkStrokeRec fStroke; 55 SkStrokeRec fStroke;
55 56
56 private: 57 private:
57 typedef GrGpuResource INHERITED; 58 typedef GrGpuResource INHERITED;
58 }; 59 };
59 60
60 #endif 61 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrGpuResource.cpp ('k') | src/gpu/GrResourceCache2.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698