| 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/cpp/instance.h" | 5 #include "ppapi/cpp/instance.h" |
| 6 | 6 |
| 7 #include "ppapi/c/pp_errors.h" | 7 #include "ppapi/c/pp_errors.h" |
| 8 #include "ppapi/c/ppb_input_event.h" | 8 #include "ppapi/c/ppb_input_event.h" |
| 9 #include "ppapi/c/ppb_instance.h" | 9 #include "ppapi/c/ppb_instance.h" |
| 10 #include "ppapi/c/ppb_messaging.h" | 10 #include "ppapi/c/ppb_messaging.h" |
| 11 #include "ppapi/cpp/common.h" | |
| 12 #include "ppapi/cpp/dev/surface_3d_dev.h" | 11 #include "ppapi/cpp/dev/surface_3d_dev.h" |
| 13 #include "ppapi/cpp/graphics_2d.h" | 12 #include "ppapi/cpp/graphics_2d.h" |
| 14 #include "ppapi/cpp/image_data.h" | 13 #include "ppapi/cpp/image_data.h" |
| 15 #include "ppapi/cpp/logging.h" | 14 #include "ppapi/cpp/logging.h" |
| 16 #include "ppapi/cpp/module.h" | 15 #include "ppapi/cpp/module.h" |
| 17 #include "ppapi/cpp/module_impl.h" | 16 #include "ppapi/cpp/module_impl.h" |
| 18 #include "ppapi/cpp/point.h" | 17 #include "ppapi/cpp/point.h" |
| 19 #include "ppapi/cpp/resource.h" | 18 #include "ppapi/cpp/resource.h" |
| 20 #include "ppapi/cpp/var.h" | 19 #include "ppapi/cpp/var.h" |
| 21 | 20 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 } | 105 } |
| 107 | 106 |
| 108 Var Instance::GetInstanceObject() { | 107 Var Instance::GetInstanceObject() { |
| 109 return Var(); | 108 return Var(); |
| 110 } | 109 } |
| 111 #endif | 110 #endif |
| 112 | 111 |
| 113 bool Instance::BindGraphics(const Graphics2D& graphics) { | 112 bool Instance::BindGraphics(const Graphics2D& graphics) { |
| 114 if (!has_interface<PPB_Instance>()) | 113 if (!has_interface<PPB_Instance>()) |
| 115 return false; | 114 return false; |
| 116 return PPBoolToBool(get_interface<PPB_Instance>()->BindGraphics( | 115 return PP_ToBool(get_interface<PPB_Instance>()->BindGraphics( |
| 117 pp_instance(), graphics.pp_resource())); | 116 pp_instance(), graphics.pp_resource())); |
| 118 } | 117 } |
| 119 | 118 |
| 120 bool Instance::BindGraphics(const Surface3D_Dev& graphics) { | 119 bool Instance::BindGraphics(const Surface3D_Dev& graphics) { |
| 121 if (!has_interface<PPB_Instance>()) | 120 if (!has_interface<PPB_Instance>()) |
| 122 return false; | 121 return false; |
| 123 return PPBoolToBool(get_interface<PPB_Instance>()->BindGraphics( | 122 return PP_ToBool(get_interface<PPB_Instance>()->BindGraphics( |
| 124 pp_instance(), graphics.pp_resource())); | 123 pp_instance(), graphics.pp_resource())); |
| 125 } | 124 } |
| 126 | 125 |
| 127 bool Instance::IsFullFrame() { | 126 bool Instance::IsFullFrame() { |
| 128 if (!has_interface<PPB_Instance>()) | 127 if (!has_interface<PPB_Instance>()) |
| 129 return false; | 128 return false; |
| 130 return PPBoolToBool(get_interface<PPB_Instance>()->IsFullFrame( | 129 return PP_ToBool(get_interface<PPB_Instance>()->IsFullFrame(pp_instance())); |
| 131 pp_instance())); | |
| 132 } | 130 } |
| 133 | 131 |
| 134 int32_t Instance::RequestInputEvents(uint32_t event_classes) { | 132 int32_t Instance::RequestInputEvents(uint32_t event_classes) { |
| 135 if (!has_interface<PPB_InputEvent>()) | 133 if (!has_interface<PPB_InputEvent>()) |
| 136 return PP_ERROR_NOINTERFACE; | 134 return PP_ERROR_NOINTERFACE; |
| 137 return get_interface<PPB_InputEvent>()->RequestInputEvents(pp_instance(), | 135 return get_interface<PPB_InputEvent>()->RequestInputEvents(pp_instance(), |
| 138 event_classes); | 136 event_classes); |
| 139 } | 137 } |
| 140 | 138 |
| 141 int32_t Instance::RequestFilteringInputEvents(uint32_t event_classes) { | 139 int32_t Instance::RequestFilteringInputEvents(uint32_t event_classes) { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 if (!that) | 191 if (!that) |
| 194 return NULL; | 192 return NULL; |
| 195 InterfaceNameToObjectMap::iterator found = | 193 InterfaceNameToObjectMap::iterator found = |
| 196 that->interface_name_to_objects_.find(interface_name); | 194 that->interface_name_to_objects_.find(interface_name); |
| 197 if (found == that->interface_name_to_objects_.end()) | 195 if (found == that->interface_name_to_objects_.end()) |
| 198 return NULL; | 196 return NULL; |
| 199 return found->second; | 197 return found->second; |
| 200 } | 198 } |
| 201 | 199 |
| 202 } // namespace pp | 200 } // namespace pp |
| OLD | NEW |