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

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

Issue 2212493002: Convert SkAutoTUnref<SkData> to sk_sp<SkData>. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 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/image/SkImage_Gpu.cpp ('k') | src/ports/SkImageGeneratorCG.h » ('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 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 "SkTypes.h" 8 #include "SkTypes.h"
9 #if defined(SK_BUILD_FOR_WIN32) 9 #if defined(SK_BUILD_FOR_WIN32)
10 10
(...skipping 1912 matching lines...) Expand 10 before | Expand all | Expand 10 after
1923 static SkTypeface* create_from_stream(SkStreamAsset* stream) { 1923 static SkTypeface* create_from_stream(SkStreamAsset* stream) {
1924 // Create a unique and unpredictable font name. 1924 // Create a unique and unpredictable font name.
1925 // Avoids collisions and access from CSS. 1925 // Avoids collisions and access from CSS.
1926 char familyName[BASE64_GUID_ID_LEN]; 1926 char familyName[BASE64_GUID_ID_LEN];
1927 const int familyNameSize = SK_ARRAY_COUNT(familyName); 1927 const int familyNameSize = SK_ARRAY_COUNT(familyName);
1928 if (FAILED(create_unique_font_name(familyName, familyNameSize))) { 1928 if (FAILED(create_unique_font_name(familyName, familyNameSize))) {
1929 return nullptr; 1929 return nullptr;
1930 } 1930 }
1931 1931
1932 // Change the name of the font. 1932 // Change the name of the font.
1933 SkAutoTUnref<SkData> rewrittenFontData(SkOTUtils::RenameFont(stream, familyN ame, familyNameSize-1)); 1933 sk_sp<SkData> rewrittenFontData(SkOTUtils::RenameFont(stream, familyName, fa milyNameSize-1));
1934 if (nullptr == rewrittenFontData.get()) { 1934 if (nullptr == rewrittenFontData.get()) {
1935 return nullptr; 1935 return nullptr;
1936 } 1936 }
1937 1937
1938 // Register the font with GDI. 1938 // Register the font with GDI.
1939 HANDLE fontReference = activate_font(rewrittenFontData.get()); 1939 HANDLE fontReference = activate_font(rewrittenFontData.get());
1940 if (nullptr == fontReference) { 1940 if (nullptr == fontReference) {
1941 return nullptr; 1941 return nullptr;
1942 } 1942 }
1943 1943
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
2506 2506
2507 private: 2507 private:
2508 SkTDArray<ENUMLOGFONTEX> fLogFontArray; 2508 SkTDArray<ENUMLOGFONTEX> fLogFontArray;
2509 }; 2509 };
2510 2510
2511 /////////////////////////////////////////////////////////////////////////////// 2511 ///////////////////////////////////////////////////////////////////////////////
2512 2512
2513 SkFontMgr* SkFontMgr_New_GDI() { return new SkFontMgrGDI; } 2513 SkFontMgr* SkFontMgr_New_GDI() { return new SkFontMgrGDI; }
2514 2514
2515 #endif//defined(SK_BUILD_FOR_WIN32) 2515 #endif//defined(SK_BUILD_FOR_WIN32)
OLDNEW
« no previous file with comments | « src/image/SkImage_Gpu.cpp ('k') | src/ports/SkImageGeneratorCG.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698