OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef PPAPI_SHARED_IMPL_PRIVATE_PPB_FONT_SHARED_H_ | 5 #ifndef PPAPI_SHARED_IMPL_PRIVATE_PPB_FONT_SHARED_H_ |
6 #define PPAPI_SHARED_IMPL_PRIVATE_PPB_FONT_SHARED_H_ | 6 #define PPAPI_SHARED_IMPL_PRIVATE_PPB_FONT_SHARED_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 uint32_t color, | 52 uint32_t color, |
53 const PP_Rect* clip, | 53 const PP_Rect* clip, |
54 PP_Bool image_data_is_opaque) OVERRIDE; | 54 PP_Bool image_data_is_opaque) OVERRIDE; |
55 virtual int32_t MeasureText(const PP_TextRun_Dev* text) OVERRIDE; | 55 virtual int32_t MeasureText(const PP_TextRun_Dev* text) OVERRIDE; |
56 virtual uint32_t CharacterOffsetForPixel(const PP_TextRun_Dev* text, | 56 virtual uint32_t CharacterOffsetForPixel(const PP_TextRun_Dev* text, |
57 int32_t pixel_position) OVERRIDE; | 57 int32_t pixel_position) OVERRIDE; |
58 virtual int32_t PixelOffsetForCharacter(const PP_TextRun_Dev* text, | 58 virtual int32_t PixelOffsetForCharacter(const PP_TextRun_Dev* text, |
59 uint32_t char_offset) OVERRIDE; | 59 uint32_t char_offset) OVERRIDE; |
60 | 60 |
61 private: | 61 private: |
62 PPB_Font_Shared(PP_Instance instance, const PP_FontDescription_Dev& desc, | 62 struct InitAsImpl {}; |
| 63 struct InitAsProxy {}; |
| 64 |
| 65 // The dummy arguments control which version of Resource's constructor is |
| 66 // called for this base class. |
| 67 PPB_Font_Shared(const InitAsImpl&, |
| 68 PP_Instance instance, |
| 69 const PP_FontDescription_Dev& desc, |
| 70 const ::ppapi::Preferences& prefs); |
| 71 PPB_Font_Shared(const InitAsProxy&, |
| 72 PP_Instance instance, |
| 73 const PP_FontDescription_Dev& desc, |
| 74 const ::ppapi::Preferences& prefs); |
| 75 |
| 76 void Initialize(const PP_FontDescription_Dev& desc, |
63 const ::ppapi::Preferences& prefs); | 77 const ::ppapi::Preferences& prefs); |
64 | 78 |
65 scoped_ptr< ::ppapi::WebKitForwarding::Font> font_impl_; | 79 scoped_ptr< ::ppapi::WebKitForwarding::Font> font_impl_; |
66 | 80 |
67 DISALLOW_COPY_AND_ASSIGN(PPB_Font_Shared); | 81 DISALLOW_COPY_AND_ASSIGN(PPB_Font_Shared); |
68 }; | 82 }; |
69 | 83 |
70 } // namespace ppapi | 84 } // namespace ppapi |
71 | 85 |
72 #endif // PPAPI_SHARED_IMPL_PRIVATE_PPB_FONT_SHARED_H_ | 86 #endif // PPAPI_SHARED_IMPL_PRIVATE_PPB_FONT_SHARED_H_ |
OLD | NEW |