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

Side by Side Diff: src/gpu/gl/GrGLPathRendering.cpp

Issue 849103004: Make SkStream *not* ref counted. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase, just in case. Created 5 years, 11 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/fonts/SkFontMgr_indirect.cpp ('k') | src/images/SkDecodingImageGenerator.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 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
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
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 }
OLDNEW
« no previous file with comments | « src/fonts/SkFontMgr_indirect.cpp ('k') | src/images/SkDecodingImageGenerator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698