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

Side by Side Diff: src/ports/SkFontHost_linux.cpp

Issue 210383002: SkFontHost_linux - dup stream instead of ref (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 9 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 | « no previous file | no next file » | 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 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
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 "SkFontHost.h" 8 #include "SkFontHost.h"
9 #include "SkFontHost_FreeType_common.h" 9 #include "SkFontHost_FreeType_common.h"
10 #include "SkFontDescriptor.h" 10 #include "SkFontDescriptor.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 bool isFixedPitch, const SkString familyName) 79 bool isFixedPitch, const SkString familyName)
80 : INHERITED(style, sysFont, isFixedPitch, familyName) 80 : INHERITED(style, sysFont, isFixedPitch, familyName)
81 , fStream(SkRef(stream)) 81 , fStream(SkRef(stream))
82 { } 82 { }
83 83
84 virtual const char* getUniqueString() const SK_OVERRIDE { return NULL; } 84 virtual const char* getUniqueString() const SK_OVERRIDE { return NULL; }
85 85
86 protected: 86 protected:
87 virtual SkStream* onOpenStream(int* ttcIndex) const SK_OVERRIDE { 87 virtual SkStream* onOpenStream(int* ttcIndex) const SK_OVERRIDE {
88 *ttcIndex = 0; 88 *ttcIndex = 0;
89 return SkRef(fStream.get()); 89 return fStream->duplicate();
90 } 90 }
91 91
92 private: 92 private:
93 SkAutoTUnref<SkStream> fStream; 93 SkAutoTUnref<SkStream> fStream;
94 94
95 typedef SkTypeface_Custom INHERITED; 95 typedef SkTypeface_Custom INHERITED;
96 }; 96 };
97 97
98 /** The file SkTypeface implementation for the custom font manager. */ 98 /** The file SkTypeface implementation for the custom font manager. */
99 class SkTypeface_File : public SkTypeface_Custom { 99 class SkTypeface_File : public SkTypeface_Custom {
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 } 399 }
400 400
401 SkTArray<SkAutoTUnref<SkFontStyleSet_Custom>, true> fFamilies; 401 SkTArray<SkAutoTUnref<SkFontStyleSet_Custom>, true> fFamilies;
402 SkFontStyleSet_Custom* gDefaultFamily; 402 SkFontStyleSet_Custom* gDefaultFamily;
403 SkTypeface* gDefaultNormal; 403 SkTypeface* gDefaultNormal;
404 }; 404 };
405 405
406 SkFontMgr* SkFontMgr::Factory() { 406 SkFontMgr* SkFontMgr::Factory() {
407 return new SkFontMgr_Custom(SK_FONT_FILE_PREFIX); 407 return new SkFontMgr_Custom(SK_FONT_FILE_PREFIX);
408 } 408 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698