Chromium Code Reviews| Index: content/child/dwrite_font_proxy/font_fallback_win.h |
| diff --git a/content/child/dwrite_font_proxy/font_fallback_win.h b/content/child/dwrite_font_proxy/font_fallback_win.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..f1d6c3dac53849191e44d4b1e703fa31e824adac |
| --- /dev/null |
| +++ b/content/child/dwrite_font_proxy/font_fallback_win.h |
| @@ -0,0 +1,53 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_CHILD_DWRITE_FONT_PROXY_FONT_FALLBACK_WIN_H_ |
| +#define CONTENT_CHILD_DWRITE_FONT_PROXY_FONT_FALLBACK_WIN_H_ |
| + |
| +#include <dwrite.h> |
| +#include <dwrite_2.h> |
| +#include <wrl.h> |
| + |
| +#include "content/child/dwrite_font_proxy/dwrite_font_proxy_win.h" |
| +#include "content/common/content_export.h" |
| +#include "ipc/ipc_sender.h" |
| + |
| +namespace content { |
| + |
| +// Implements an IDWriteFontFallback that uses IPC to proxy the fallback calls |
| +// to the system fallback in the browser process. |
| +class CONTENT_EXPORT FontFallback |
| + : public Microsoft::WRL::RuntimeClass< |
| + Microsoft::WRL::RuntimeClassFlags<Microsoft::WRL::ClassicCom>, |
| + IDWriteFontFallback> { |
| + public: |
| + HRESULT STDMETHODCALLTYPE |
| + MapCharacters(IDWriteTextAnalysisSource* source, |
| + UINT32 text_position, |
| + UINT32 text_length, |
| + IDWriteFontCollection* base_font_collection, |
| + const wchar_t* base_family_name, |
| + DWRITE_FONT_WEIGHT base_weight, |
| + DWRITE_FONT_STYLE base_style, |
| + DWRITE_FONT_STRETCH base_stretch, |
| + UINT32* mapped_length, |
| + IDWriteFont** mapped_font, |
| + FLOAT* scale) override; |
| + |
| + HRESULT STDMETHODCALLTYPE |
| + RuntimeClassInitialize(DWriteFontCollectionProxy* collection, |
| + IPC::Sender* sender_override) { |
| + 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.
|
| + collection_ = collection; |
| + return S_OK; |
| + } |
| + |
| + private: |
| + IPC::Sender* sender_override_; |
| + Microsoft::WRL::ComPtr<DWriteFontCollectionProxy> collection_; |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_CHILD_DWRITE_FONT_PROXY_FONT_FALLBACK_WIN_H_ |