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

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

Issue 1672063002: SkTArray to move when moving. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Disable bad language extensions, fix existing code. Created 4 years, 10 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 | « include/ports/SkFontMgr_indirect.h ('k') | 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 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 #include "SkTypes.h" 7 #include "SkTypes.h"
8 #if defined(SK_BUILD_FOR_WIN32) 8 #if defined(SK_BUILD_FOR_WIN32)
9 9
10 #include "SkDWrite.h" 10 #include "SkDWrite.h"
(...skipping 14 matching lines...) Expand all
25 25
26 class SK_API SkRemotableFontMgr_DirectWrite : public SkRemotableFontMgr { 26 class SK_API SkRemotableFontMgr_DirectWrite : public SkRemotableFontMgr {
27 private: 27 private:
28 struct DataId { 28 struct DataId {
29 IUnknown* fLoader; // In COM only IUnknown pointers may be safely used for identity. 29 IUnknown* fLoader; // In COM only IUnknown pointers may be safely used for identity.
30 void* fKey; 30 void* fKey;
31 UINT32 fKeySize; 31 UINT32 fKeySize;
32 32
33 DataId() { } 33 DataId() { }
34 34
35 // This is actually a move!!! 35 DataId(DataId&& that) : fLoader(that.fLoader), fKey(that.fKey), fKeySize (that.fKeySize) {
36 explicit DataId(DataId& that)
37 : fLoader(that.fLoader), fKey(that.fKey), fKeySize(that.fKeySize)
38 {
39 that.fLoader = nullptr; 36 that.fLoader = nullptr;
40 that.fKey = nullptr; 37 that.fKey = nullptr;
41 SkDEBUGCODE(that.fKeySize = 0xFFFFFFFF;) 38 SkDEBUGCODE(that.fKeySize = 0xFFFFFFFF;)
42 } 39 }
43 40
44 ~DataId() { 41 ~DataId() {
45 if (fLoader) { 42 if (fLoader) {
46 fLoader->Release(); 43 fLoader->Release();
47 } 44 }
48 sk_free(fKey); 45 sk_free(fKey);
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 } else { 497 } else {
501 localeNameLen = getUserDefaultLocaleNameProc(localeNameStorage, LOCALE_N AME_MAX_LENGTH); 498 localeNameLen = getUserDefaultLocaleNameProc(localeNameStorage, LOCALE_N AME_MAX_LENGTH);
502 if (localeNameLen) { 499 if (localeNameLen) {
503 localeName = localeNameStorage; 500 localeName = localeNameStorage;
504 }; 501 };
505 } 502 }
506 503
507 return new SkRemotableFontMgr_DirectWrite(sysFontCollection.get(), localeNam e, localeNameLen); 504 return new SkRemotableFontMgr_DirectWrite(sysFontCollection.get(), localeNam e, localeNameLen);
508 } 505 }
509 #endif//defined(SK_BUILD_FOR_WIN32) 506 #endif//defined(SK_BUILD_FOR_WIN32)
OLDNEW
« no previous file with comments | « include/ports/SkFontMgr_indirect.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698