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

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

Issue 1215393002: Remove SkThread.h, include SkMutex.h or SkAtomics.h as appropriate. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: skimagefilter Created 5 years, 5 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/ports/SkFontMgr_win_dw.cpp ('k') | src/ports/SkTLS_win.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 "SkDataTable.h"
9 #include "SkDWrite.h" 8 #include "SkDWrite.h"
10 #include "SkDWriteFontFileStream.h" 9 #include "SkDWriteFontFileStream.h"
10 #include "SkDataTable.h"
11 #include "SkHRESULT.h" 11 #include "SkHRESULT.h"
12 #include "SkMutex.h"
12 #include "SkRemotableFontMgr.h" 13 #include "SkRemotableFontMgr.h"
13 #include "SkStream.h" 14 #include "SkStream.h"
14 #include "SkString.h" 15 #include "SkString.h"
15 #include "SkTArray.h" 16 #include "SkTArray.h"
16 #include "SkThread.h"
17 #include "SkTScopedComPtr.h" 17 #include "SkTScopedComPtr.h"
18 #include "SkTypeface_win.h" 18 #include "SkTypeface_win.h"
19 #include "SkTypes.h" 19 #include "SkTypes.h"
20 #include "SkUtils.h" 20 #include "SkUtils.h"
21 21
22 #include <dwrite.h> 22 #include <dwrite.h>
23 23
24 class SK_API SkRemotableFontMgr_DirectWrite : public SkRemotableFontMgr { 24 class SK_API SkRemotableFontMgr_DirectWrite : public SkRemotableFontMgr {
25 private: 25 private:
26 struct DataId { 26 struct DataId {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 DataId& added = fDataIdCache.push_back(); 73 DataId& added = fDataIdCache.push_back();
74 added.fLoader = fontFileLoaderId.release(); // Ref is passed. 74 added.fLoader = fontFileLoaderId.release(); // Ref is passed.
75 added.fKey = sk_malloc_throw(refKeySize); 75 added.fKey = sk_malloc_throw(refKeySize);
76 memcpy(added.fKey, refKey, refKeySize); 76 memcpy(added.fKey, refKey, refKeySize);
77 added.fKeySize = refKeySize; 77 added.fKeySize = refKeySize;
78 78
79 return i; 79 return i;
80 } 80 }
81 81
82 public: 82 public:
83 83
84 84
85 /** localeNameLength must include the null terminator. */ 85 /** localeNameLength must include the null terminator. */
86 SkRemotableFontMgr_DirectWrite(IDWriteFontCollection* fontCollection, 86 SkRemotableFontMgr_DirectWrite(IDWriteFontCollection* fontCollection,
87 WCHAR* localeName, int localeNameLength) 87 WCHAR* localeName, int localeNameLength)
88 : fFontCollection(SkRefComPtr(fontCollection)) 88 : fFontCollection(SkRefComPtr(fontCollection))
89 , fLocaleName(localeNameLength) 89 , fLocaleName(localeNameLength)
90 { 90 {
91 memcpy(fLocaleName.get(), localeName, localeNameLength * sizeof(WCHAR)); 91 memcpy(fLocaleName.get(), localeName, localeNameLength * sizeof(WCHAR));
92 } 92 }
93 93
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 } else { 498 } else {
499 localeNameLen = getUserDefaultLocaleNameProc(localeNameStorage, LOCALE_N AME_MAX_LENGTH); 499 localeNameLen = getUserDefaultLocaleNameProc(localeNameStorage, LOCALE_N AME_MAX_LENGTH);
500 if (localeNameLen) { 500 if (localeNameLen) {
501 localeName = localeNameStorage; 501 localeName = localeNameStorage;
502 }; 502 };
503 } 503 }
504 504
505 return SkNEW_ARGS(SkRemotableFontMgr_DirectWrite, (sysFontCollection.get(), 505 return SkNEW_ARGS(SkRemotableFontMgr_DirectWrite, (sysFontCollection.get(),
506 localeName, localeNameLen )); 506 localeName, localeNameLen ));
507 } 507 }
OLDNEW
« no previous file with comments | « src/ports/SkFontMgr_win_dw.cpp ('k') | src/ports/SkTLS_win.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698