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

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

Issue 1155593002: Move GrPath(Range) creation to ResourceProvider. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase 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 unified diff | Download patch
« no previous file with comments | « src/gpu/GrAddPathRenderers_default.cpp ('k') | src/gpu/GrResourceProvider.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 2015 Google Inc. 2 * Copyright 2015 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 GrResourceProvider_DEFINED 8 #ifndef GrResourceProvider_DEFINED
9 #define GrResourceProvider_DEFINED 9 #define GrResourceProvider_DEFINED
10 10
11 #include "GrTextureProvider.h" 11 #include "GrTextureProvider.h"
12 #include "GrPathRange.h"
12 13
13 class GrIndexBuffer; 14 class GrIndexBuffer;
15 class GrPath;
16 class GrStrokeInfo;
14 class GrVertexBuffer; 17 class GrVertexBuffer;
18 class SkDescriptor;
19 class SkPath;
20 class SkTypeface;
15 21
16 /** 22 /**
17 * An extension of the texture provider for arbitrary resource types. This class is intended for 23 * An extension of the texture provider for arbitrary resource types. This class is intended for
18 * use within the Gr code base, not by clients or extensions (e.g. third party G rProcessor 24 * use within the Gr code base, not by clients or extensions (e.g. third party G rProcessor
19 * derivatives). 25 * derivatives).
20 */ 26 */
21 class GrResourceProvider : public GrTextureProvider { 27 class GrResourceProvider : public GrTextureProvider {
22 public: 28 public:
23 29
24 GrResourceProvider(GrGpu* gpu, GrResourceCache* cache); 30 GrResourceProvider(GrGpu* gpu, GrResourceCache* cache);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 * @ return the quad index buffer 65 * @ return the quad index buffer
60 */ 66 */
61 const GrIndexBuffer* refQuadIndexBuffer() { 67 const GrIndexBuffer* refQuadIndexBuffer() {
62 if (GrIndexBuffer* buffer = 68 if (GrIndexBuffer* buffer =
63 this->findAndRefTByUniqueKey<GrIndexBuffer>(fQuadIndexBufferKey)) { 69 this->findAndRefTByUniqueKey<GrIndexBuffer>(fQuadIndexBufferKey)) {
64 return buffer; 70 return buffer;
65 } 71 }
66 return this->createQuadIndexBuffer(); 72 return this->createQuadIndexBuffer();
67 } 73 }
68 74
75 /**
76 * Factories for GrPath and GrPathRange objects. It's an error to call these if path rendering
77 * is not supported.
78 */
79 GrPath* createPath(const SkPath&, const GrStrokeInfo&);
80 GrPathRange* createPathRange(GrPathRange::PathGenerator*, const GrStrokeInfo &);
81 GrPathRange* createGlyphs(const SkTypeface*, const SkDescriptor*, const GrSt rokeInfo&);
82
69 83
70 using GrTextureProvider::assignUniqueKeyToResource; 84 using GrTextureProvider::assignUniqueKeyToResource;
71 using GrTextureProvider::findAndRefResourceByUniqueKey; 85 using GrTextureProvider::findAndRefResourceByUniqueKey;
72 using GrTextureProvider::abandon; 86 using GrTextureProvider::abandon;
73 87
74 private: 88 private:
75 const GrIndexBuffer* createInstancedIndexBuffer(const uint16_t* pattern, 89 const GrIndexBuffer* createInstancedIndexBuffer(const uint16_t* pattern,
76 int patternSize, 90 int patternSize,
77 int reps, 91 int reps,
78 int vertCount, 92 int vertCount,
79 const GrUniqueKey& key); 93 const GrUniqueKey& key);
80 94
81 const GrIndexBuffer* createQuadIndexBuffer(); 95 const GrIndexBuffer* createQuadIndexBuffer();
82 96
83 GrUniqueKey fQuadIndexBufferKey; 97 GrUniqueKey fQuadIndexBufferKey;
84 98
85 typedef GrTextureProvider INHERITED; 99 typedef GrTextureProvider INHERITED;
86 }; 100 };
87 101
88 #endif 102 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrAddPathRenderers_default.cpp ('k') | src/gpu/GrResourceProvider.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698