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_PROXY_PPB_FONT_PROXY_H_ | 5 #ifndef PPAPI_PROXY_PPB_FONT_PROXY_H_ |
6 #define PPAPI_PROXY_PPB_FONT_PROXY_H_ | 6 #define PPAPI_PROXY_PPB_FONT_PROXY_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/synchronization/waitable_event.h" | 9 #include "base/synchronization/waitable_event.h" |
10 #include "ppapi/proxy/host_resource.h" | |
11 #include "ppapi/proxy/interface_proxy.h" | 10 #include "ppapi/proxy/interface_proxy.h" |
12 #include "ppapi/proxy/plugin_resource.h" | 11 #include "ppapi/proxy/plugin_resource.h" |
| 12 #include "ppapi/shared_impl/host_resource.h" |
13 #include "ppapi/shared_impl/webkit_forwarding.h" | 13 #include "ppapi/shared_impl/webkit_forwarding.h" |
14 #include "ppapi/thunk/ppb_font_api.h" | 14 #include "ppapi/thunk/ppb_font_api.h" |
15 | 15 |
16 struct PPB_Font_Dev; | 16 struct PPB_Font_Dev; |
17 | 17 |
18 namespace pp { | 18 namespace pp { |
19 namespace proxy { | 19 namespace proxy { |
20 | 20 |
21 class SerializedVarReturnValue; | 21 class SerializedVarReturnValue; |
22 | 22 |
(...skipping 20 matching lines...) Expand all Loading... |
43 }; | 43 }; |
44 | 44 |
45 class Font : public PluginResource, | 45 class Font : public PluginResource, |
46 public ppapi::thunk::PPB_Font_API { | 46 public ppapi::thunk::PPB_Font_API { |
47 public: | 47 public: |
48 // Note that there isn't a "real" resource in the renderer backing a font, | 48 // Note that there isn't a "real" resource in the renderer backing a font, |
49 // it lives entirely in the plugin process. So the resource ID in the host | 49 // it lives entirely in the plugin process. So the resource ID in the host |
50 // resource should be 0. However, various code assumes the instance in the | 50 // resource should be 0. However, various code assumes the instance in the |
51 // host resource is valid (this is how resources are associated with | 51 // host resource is valid (this is how resources are associated with |
52 // instances), so that should be set. | 52 // instances), so that should be set. |
53 Font(const HostResource& resource, const PP_FontDescription_Dev& desc); | 53 Font(const ppapi::HostResource& resource, const PP_FontDescription_Dev& desc); |
54 virtual ~Font(); | 54 virtual ~Font(); |
55 | 55 |
56 // ResourceObjectBase. | 56 // ResourceObjectBase. |
57 virtual ppapi::thunk::PPB_Font_API* AsPPB_Font_API() OVERRIDE; | 57 virtual ppapi::thunk::PPB_Font_API* AsPPB_Font_API() OVERRIDE; |
58 | 58 |
59 // PluginResource overrides. | |
60 virtual Font* AsFont() OVERRIDE; | |
61 | |
62 // PPB_Font_API implementation. | 59 // PPB_Font_API implementation. |
63 virtual PP_Bool Describe(PP_FontDescription_Dev* description, | 60 virtual PP_Bool Describe(PP_FontDescription_Dev* description, |
64 PP_FontMetrics_Dev* metrics) OVERRIDE; | 61 PP_FontMetrics_Dev* metrics) OVERRIDE; |
65 virtual PP_Bool DrawTextAt(PP_Resource image_data, | 62 virtual PP_Bool DrawTextAt(PP_Resource image_data, |
66 const PP_TextRun_Dev* text, | 63 const PP_TextRun_Dev* text, |
67 const PP_Point* position, | 64 const PP_Point* position, |
68 uint32_t color, | 65 uint32_t color, |
69 const PP_Rect* clip, | 66 const PP_Rect* clip, |
70 PP_Bool image_data_is_opaque) OVERRIDE; | 67 PP_Bool image_data_is_opaque) OVERRIDE; |
71 virtual int32_t MeasureText(const PP_TextRun_Dev* text) OVERRIDE; | 68 virtual int32_t MeasureText(const PP_TextRun_Dev* text) OVERRIDE; |
(...skipping 18 matching lines...) Expand all Loading... |
90 // destruction). | 87 // destruction). |
91 ppapi::WebKitForwarding::Font* font_forwarding_; | 88 ppapi::WebKitForwarding::Font* font_forwarding_; |
92 | 89 |
93 DISALLOW_COPY_AND_ASSIGN(Font); | 90 DISALLOW_COPY_AND_ASSIGN(Font); |
94 }; | 91 }; |
95 | 92 |
96 } // namespace proxy | 93 } // namespace proxy |
97 } // namespace pp | 94 } // namespace pp |
98 | 95 |
99 #endif // PPAPI_PROXY_PPB_FONT_PROXY_H_ | 96 #endif // PPAPI_PROXY_PPB_FONT_PROXY_H_ |
OLD | NEW |