OLD | NEW |
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 #include "GrResourceProvider.h" | 8 #include "GrResourceProvider.h" |
9 | 9 |
10 #include "GrGpu.h" | 10 #include "GrGpu.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 } | 56 } |
57 | 57 |
58 const GrIndexBuffer* GrResourceProvider::createQuadIndexBuffer() { | 58 const GrIndexBuffer* GrResourceProvider::createQuadIndexBuffer() { |
59 static const int kMaxQuads = 1 << 12; // max possible: (1 << 14) - 1; | 59 static const int kMaxQuads = 1 << 12; // max possible: (1 << 14) - 1; |
60 GR_STATIC_ASSERT(4 * kMaxQuads <= 65535); | 60 GR_STATIC_ASSERT(4 * kMaxQuads <= 65535); |
61 static const uint16_t kPattern[] = { 0, 1, 2, 0, 2, 3 }; | 61 static const uint16_t kPattern[] = { 0, 1, 2, 0, 2, 3 }; |
62 | 62 |
63 return this->createInstancedIndexBuffer(kPattern, 6, kMaxQuads, 4, fQuadInde
xBufferKey); | 63 return this->createInstancedIndexBuffer(kPattern, 6, kMaxQuads, 4, fQuadInde
xBufferKey); |
64 } | 64 } |
65 | 65 |
| 66 GrPath* GrResourceProvider::createPath(const SkPath& path, const GrStrokeInfo& s
troke) { |
| 67 SkASSERT(this->gpu()->pathRendering()); |
| 68 return this->gpu()->pathRendering()->createPath(path, stroke); |
| 69 } |
| 70 |
| 71 GrPathRange* GrResourceProvider::createPathRange(GrPathRange::PathGenerator* gen
, |
| 72 const GrStrokeInfo& stroke) { |
| 73 SkASSERT(this->gpu()->pathRendering()); |
| 74 return this->gpu()->pathRendering()->createPathRange(gen, stroke); |
| 75 } |
| 76 |
| 77 GrPathRange* GrResourceProvider::createGlyphs(const SkTypeface* tf, const SkDesc
riptor* desc, |
| 78 const GrStrokeInfo& stroke) { |
| 79 |
| 80 SkASSERT(this->gpu()->pathRendering()); |
| 81 return this->gpu()->pathRendering()->createGlyphs(tf, desc, stroke); |
| 82 } |
| 83 |
OLD | NEW |