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 "ppapi/proxy/ppb_flash_proxy.h" | 5 #include "ppapi/proxy/ppb_flash_proxy.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "ppapi/c/dev/ppb_font_dev.h" | 10 #include "ppapi/c/dev/ppb_font_dev.h" |
11 #include "ppapi/c/dev/ppb_var_deprecated.h" | 11 #include "ppapi/c/dev/ppb_var_deprecated.h" |
12 #include "ppapi/c/pp_errors.h" | 12 #include "ppapi/c/pp_errors.h" |
13 #include "ppapi/c/pp_resource.h" | 13 #include "ppapi/c/pp_resource.h" |
14 #include "ppapi/c/private/ppb_flash.h" | 14 #include "ppapi/c/private/ppb_flash.h" |
15 #include "ppapi/proxy/host_dispatcher.h" | 15 #include "ppapi/proxy/host_dispatcher.h" |
16 #include "ppapi/proxy/plugin_dispatcher.h" | 16 #include "ppapi/proxy/plugin_dispatcher.h" |
| 17 #include "ppapi/proxy/plugin_resource_tracker.h" |
17 #include "ppapi/proxy/ppapi_messages.h" | 18 #include "ppapi/proxy/ppapi_messages.h" |
18 #include "ppapi/proxy/proxy_module.h" | 19 #include "ppapi/proxy/proxy_module.h" |
19 #include "ppapi/proxy/serialized_var.h" | 20 #include "ppapi/proxy/serialized_var.h" |
20 #include "ppapi/shared_impl/ppapi_globals.h" | |
21 #include "ppapi/shared_impl/resource.h" | 21 #include "ppapi/shared_impl/resource.h" |
22 #include "ppapi/shared_impl/resource_tracker.h" | |
23 #include "ppapi/shared_impl/scoped_pp_resource.h" | 22 #include "ppapi/shared_impl/scoped_pp_resource.h" |
24 #include "ppapi/shared_impl/var.h" | 23 #include "ppapi/shared_impl/var.h" |
25 #include "ppapi/thunk/enter.h" | 24 #include "ppapi/thunk/enter.h" |
26 #include "ppapi/thunk/ppb_url_request_info_api.h" | 25 #include "ppapi/thunk/ppb_url_request_info_api.h" |
27 #include "ppapi/thunk/resource_creation_api.h" | 26 #include "ppapi/thunk/resource_creation_api.h" |
28 | 27 |
29 namespace ppapi { | 28 namespace ppapi { |
30 namespace proxy { | 29 namespace proxy { |
31 | 30 |
32 namespace { | 31 namespace { |
33 | 32 |
34 void SetInstanceAlwaysOnTop(PP_Instance pp_instance, PP_Bool on_top) { | 33 void SetInstanceAlwaysOnTop(PP_Instance pp_instance, PP_Bool on_top) { |
35 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(pp_instance); | 34 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(pp_instance); |
36 if (dispatcher) { | 35 if (dispatcher) { |
37 dispatcher->Send(new PpapiHostMsg_PPBFlash_SetInstanceAlwaysOnTop( | 36 dispatcher->Send(new PpapiHostMsg_PPBFlash_SetInstanceAlwaysOnTop( |
38 INTERFACE_ID_PPB_FLASH, pp_instance, on_top)); | 37 INTERFACE_ID_PPB_FLASH, pp_instance, on_top)); |
39 } | 38 } |
40 } | 39 } |
41 | 40 |
42 PP_Bool DrawGlyphs(PP_Instance instance, | 41 PP_Bool DrawGlyphs(PP_Instance instance, |
43 PP_Resource pp_image_data, | 42 PP_Resource pp_image_data, |
44 const PP_FontDescription_Dev* font_desc, | 43 const PP_FontDescription_Dev* font_desc, |
45 uint32_t color, | 44 uint32_t color, |
46 PP_Point position, | 45 PP_Point position, |
47 PP_Rect clip, | 46 PP_Rect clip, |
48 const float transformation[3][3], | 47 const float transformation[3][3], |
49 uint32_t glyph_count, | 48 uint32_t glyph_count, |
50 const uint16_t glyph_indices[], | 49 const uint16_t glyph_indices[], |
51 const PP_Point glyph_advances[]) { | 50 const PP_Point glyph_advances[]) { |
52 Resource* image_data = | 51 Resource* image_data = PluginResourceTracker::GetInstance()->GetResource( |
53 PpapiGlobals::Get()->GetResourceTracker()->GetResource(pp_image_data); | 52 pp_image_data); |
54 if (!image_data) | 53 if (!image_data) |
55 return PP_FALSE; | 54 return PP_FALSE; |
56 // The instance parameter isn't strictly necessary but we check that it | 55 // The instance parameter isn't strictly necessary but we check that it |
57 // matches anyway. | 56 // matches anyway. |
58 if (image_data->pp_instance() != instance) | 57 if (image_data->pp_instance() != instance) |
59 return PP_FALSE; | 58 return PP_FALSE; |
60 | 59 |
61 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance( | 60 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance( |
62 image_data->pp_instance()); | 61 image_data->pp_instance()); |
63 if (!dispatcher) | 62 if (!dispatcher) |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 } | 305 } |
307 | 306 |
308 void PPB_Flash_Proxy::OnMsgGetLocalTimeZoneOffset(PP_Instance instance, | 307 void PPB_Flash_Proxy::OnMsgGetLocalTimeZoneOffset(PP_Instance instance, |
309 PP_Time t, | 308 PP_Time t, |
310 double* result) { | 309 double* result) { |
311 *result = ppb_flash_impl_->GetLocalTimeZoneOffset(instance, t); | 310 *result = ppb_flash_impl_->GetLocalTimeZoneOffset(instance, t); |
312 } | 311 } |
313 | 312 |
314 } // namespace proxy | 313 } // namespace proxy |
315 } // namespace ppapi | 314 } // namespace ppapi |
OLD | NEW |