OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_CHILD_DWRITE_FONT_PROXY_FONT_FALLBACK_WIN_H_ | |
6 #define CONTENT_CHILD_DWRITE_FONT_PROXY_FONT_FALLBACK_WIN_H_ | |
7 | |
8 #include <dwrite.h> | |
9 #include <dwrite_2.h> | |
10 #include <wrl.h> | |
11 | |
12 #include "content/child/dwrite_font_proxy/dwrite_font_proxy_win.h" | |
13 #include "content/common/content_export.h" | |
14 #include "ipc/ipc_sender.h" | |
15 | |
16 namespace content { | |
17 | |
18 // Implements an IDWriteFontFallback that uses IPC to proxy the fallback calls | |
19 // to the system fallback in the browser process. | |
20 class CONTENT_EXPORT FontFallback | |
21 : public Microsoft::WRL::RuntimeClass< | |
22 Microsoft::WRL::RuntimeClassFlags<Microsoft::WRL::ClassicCom>, | |
23 IDWriteFontFallback> { | |
24 public: | |
25 HRESULT STDMETHODCALLTYPE | |
26 MapCharacters(IDWriteTextAnalysisSource* source, | |
27 UINT32 text_position, | |
28 UINT32 text_length, | |
29 IDWriteFontCollection* base_font_collection, | |
30 const wchar_t* base_family_name, | |
31 DWRITE_FONT_WEIGHT base_weight, | |
32 DWRITE_FONT_STYLE base_style, | |
33 DWRITE_FONT_STRETCH base_stretch, | |
34 UINT32* mapped_length, | |
35 IDWriteFont** mapped_font, | |
36 FLOAT* scale) override; | |
37 | |
38 HRESULT STDMETHODCALLTYPE | |
39 RuntimeClassInitialize(DWriteFontCollectionProxy* collection, | |
40 IPC::Sender* sender_override) { | |
41 sender_override_ = sender_override; | |
ananta
2016/04/12 23:44:39
Please move this to the cc file.
Ilya Kulshin
2016/04/13 01:33:28
Done.
| |
42 collection_ = collection; | |
43 return S_OK; | |
44 } | |
45 | |
46 private: | |
47 IPC::Sender* sender_override_; | |
48 Microsoft::WRL::ComPtr<DWriteFontCollectionProxy> collection_; | |
49 }; | |
50 | |
51 } // namespace content | |
52 | |
53 #endif // CONTENT_CHILD_DWRITE_FONT_PROXY_FONT_FALLBACK_WIN_H_ | |
OLD | NEW |