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 #include "webkit/plugins/ppapi/ppb_font_impl.h" | 5 #include "webkit/plugins/ppapi/ppb_font_impl.h" |
6 | 6 |
7 #include "ppapi/c/dev/ppb_font_dev.h" | 7 #include "ppapi/c/dev/ppb_font_dev.h" |
8 #include "ppapi/thunk/thunk.h" | 8 #include "ppapi/thunk/thunk.h" |
9 #include "webkit/plugins/ppapi/common.h" | 9 #include "webkit/plugins/ppapi/common.h" |
10 #include "webkit/plugins/ppapi/plugin_module.h" | 10 #include "webkit/plugins/ppapi/plugin_module.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 WebKitForwarding::Font* result = NULL; | 44 WebKitForwarding::Font* result = NULL; |
45 instance->module()->GetWebKitForwarding()->CreateFontForwarding( | 45 instance->module()->GetWebKitForwarding()->CreateFontForwarding( |
46 NULL, desc, face_name ? face_name->value() : std::string(), &result); | 46 NULL, desc, face_name ? face_name->value() : std::string(), &result); |
47 font_forwarding_.reset(result); | 47 font_forwarding_.reset(result); |
48 } | 48 } |
49 | 49 |
50 PPB_Font_Impl::~PPB_Font_Impl() { | 50 PPB_Font_Impl::~PPB_Font_Impl() { |
51 } | 51 } |
52 | 52 |
53 // static | |
54 const PPB_Font_Dev* PPB_Font_Impl::GetInterface() { | |
55 return ::ppapi::thunk::GetPPB_Font_Thunk(); | |
56 } | |
57 | |
58 ::ppapi::thunk::PPB_Font_API* PPB_Font_Impl::AsFont_API() { | 53 ::ppapi::thunk::PPB_Font_API* PPB_Font_Impl::AsFont_API() { |
59 return this; | 54 return this; |
60 } | 55 } |
61 | 56 |
62 PPB_Font_Impl* PPB_Font_Impl::AsPPB_Font_Impl() { | 57 PPB_Font_Impl* PPB_Font_Impl::AsPPB_Font_Impl() { |
63 return this; | 58 return this; |
64 } | 59 } |
65 | 60 |
66 PP_Bool PPB_Font_Impl::Describe(PP_FontDescription_Dev* description, | 61 PP_Bool PPB_Font_Impl::Describe(PP_FontDescription_Dev* description, |
67 PP_FontMetrics_Dev* metrics) { | 62 PP_FontMetrics_Dev* metrics) { |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 int32_t PPB_Font_Impl::PixelOffsetForCharacter(const PP_TextRun_Dev* text, | 118 int32_t PPB_Font_Impl::PixelOffsetForCharacter(const PP_TextRun_Dev* text, |
124 uint32_t char_offset) { | 119 uint32_t char_offset) { |
125 int32_t result = -1; | 120 int32_t result = -1; |
126 WebKitForwarding::Font::TextRun run; | 121 WebKitForwarding::Font::TextRun run; |
127 if (PPTextRunToTextRun(text, &run)) { | 122 if (PPTextRunToTextRun(text, &run)) { |
128 font_forwarding_->PixelOffsetForCharacter(NULL, run, char_offset, &result); | 123 font_forwarding_->PixelOffsetForCharacter(NULL, run, char_offset, &result); |
129 } | 124 } |
130 return result; | 125 return result; |
131 } | 126 } |
132 | 127 |
| 128 PPB_Font_FunctionImpl::PPB_Font_FunctionImpl() { |
| 129 } |
| 130 |
| 131 PPB_Font_FunctionImpl::~PPB_Font_FunctionImpl() { |
| 132 } |
| 133 |
| 134 ::ppapi::thunk::PPB_Font_FunctionAPI* |
| 135 PPB_Font_FunctionImpl::AsFont_FunctionAPI() { |
| 136 return this; |
| 137 } |
| 138 |
| 139 PP_Var PPB_Font_FunctionImpl::GetFontFamilies(PP_Instance instance) { |
| 140 return PP_MakeUndefined(); |
| 141 } |
| 142 |
133 } // namespace ppapi | 143 } // namespace ppapi |
134 } // namespace webkit | 144 } // namespace webkit |
135 | 145 |
OLD | NEW |