OLD | NEW |
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 #include "gl/GrGLPathRendering.h" | 8 #include "gl/GrGLPathRendering.h" |
9 #include "gl/GrGLNameAllocator.h" | 9 #include "gl/GrGLNameAllocator.h" |
10 #include "gl/GrGLUtil.h" | 10 #include "gl/GrGLUtil.h" |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 if (NULL != desc || !caps().glyphLoadingSupport) { | 118 if (NULL != desc || !caps().glyphLoadingSupport) { |
119 return GrPathRendering::createGlyphs(typeface, desc, stroke); | 119 return GrPathRendering::createGlyphs(typeface, desc, stroke); |
120 } | 120 } |
121 | 121 |
122 if (NULL == typeface) { | 122 if (NULL == typeface) { |
123 typeface = SkTypeface::GetDefaultTypeface(); | 123 typeface = SkTypeface::GetDefaultTypeface(); |
124 SkASSERT(NULL != typeface); | 124 SkASSERT(NULL != typeface); |
125 } | 125 } |
126 | 126 |
127 int faceIndex; | 127 int faceIndex; |
128 SkAutoTUnref<SkStream> fontStream(typeface->openStream(&faceIndex)); | 128 SkAutoTDelete<SkStream> fontStream(typeface->openStream(&faceIndex)); |
129 | 129 |
130 const size_t fontDataLength = fontStream->getLength(); | 130 const size_t fontDataLength = fontStream->getLength(); |
131 if (0 == fontDataLength) { | 131 if (0 == fontDataLength) { |
132 return GrPathRendering::createGlyphs(typeface, NULL, stroke); | 132 return GrPathRendering::createGlyphs(typeface, NULL, stroke); |
133 } | 133 } |
134 | 134 |
135 SkTArray<uint8_t> fontTempBuffer; | 135 SkTArray<uint8_t> fontTempBuffer; |
136 const void* fontData = fontStream->getMemoryBase(); | 136 const void* fontData = fontStream->getMemoryBase(); |
137 if (NULL == fontData) { | 137 if (NULL == fontData) { |
138 // TODO: Find a more efficient way to pass the font data (e.g. open file
descriptor). | 138 // TODO: Find a more efficient way to pass the font data (e.g. open file
descriptor). |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 reference, mask, coverMode,
transformType, | 470 reference, mask, coverMode,
transformType, |
471 transformValues)); | 471 transformValues)); |
472 return; | 472 return; |
473 } | 473 } |
474 | 474 |
475 GL_CALL(StencilStrokePathInstanced(numPaths, pathNameType, paths, pathBase, | 475 GL_CALL(StencilStrokePathInstanced(numPaths, pathNameType, paths, pathBase, |
476 reference, mask, transformType, transform
Values)); | 476 reference, mask, transformType, transform
Values)); |
477 GL_CALL(CoverStrokePathInstanced(numPaths, pathNameType, paths, pathBase, | 477 GL_CALL(CoverStrokePathInstanced(numPaths, pathNameType, paths, pathBase, |
478 coverMode, transformType, transformValues))
; | 478 coverMode, transformType, transformValues))
; |
479 } | 479 } |
OLD | NEW |