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/dev/surface_3d_dev.h" | |
12 #include "ppapi/cpp/graphics_2d.h" | 11 #include "ppapi/cpp/graphics_2d.h" |
13 #include "ppapi/cpp/graphics_3d.h" | 12 #include "ppapi/cpp/graphics_3d.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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 pp_instance(), graphics.pp_resource())); | 81 pp_instance(), graphics.pp_resource())); |
83 } | 82 } |
84 | 83 |
85 bool Instance::BindGraphics(const Graphics3D& graphics) { | 84 bool Instance::BindGraphics(const Graphics3D& graphics) { |
86 if (!has_interface<PPB_Instance>()) | 85 if (!has_interface<PPB_Instance>()) |
87 return false; | 86 return false; |
88 return PP_ToBool(get_interface<PPB_Instance>()->BindGraphics( | 87 return PP_ToBool(get_interface<PPB_Instance>()->BindGraphics( |
89 pp_instance(), graphics.pp_resource())); | 88 pp_instance(), graphics.pp_resource())); |
90 } | 89 } |
91 | 90 |
92 bool Instance::BindGraphics(const Surface3D_Dev& graphics) { | |
93 if (!has_interface<PPB_Instance>()) | |
94 return false; | |
95 return PP_ToBool(get_interface<PPB_Instance>()->BindGraphics( | |
96 pp_instance(), graphics.pp_resource())); | |
97 } | |
98 | |
99 bool Instance::IsFullFrame() { | 91 bool Instance::IsFullFrame() { |
100 if (!has_interface<PPB_Instance>()) | 92 if (!has_interface<PPB_Instance>()) |
101 return false; | 93 return false; |
102 return PP_ToBool(get_interface<PPB_Instance>()->IsFullFrame(pp_instance())); | 94 return PP_ToBool(get_interface<PPB_Instance>()->IsFullFrame(pp_instance())); |
103 } | 95 } |
104 | 96 |
105 int32_t Instance::RequestInputEvents(uint32_t event_classes) { | 97 int32_t Instance::RequestInputEvents(uint32_t event_classes) { |
106 if (!has_interface<PPB_InputEvent>()) | 98 if (!has_interface<PPB_InputEvent>()) |
107 return PP_ERROR_NOINTERFACE; | 99 return PP_ERROR_NOINTERFACE; |
108 return get_interface<PPB_InputEvent>()->RequestInputEvents(pp_instance(), | 100 return get_interface<PPB_InputEvent>()->RequestInputEvents(pp_instance(), |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 if (!that) | 156 if (!that) |
165 return NULL; | 157 return NULL; |
166 InterfaceNameToObjectMap::iterator found = | 158 InterfaceNameToObjectMap::iterator found = |
167 that->interface_name_to_objects_.find(interface_name); | 159 that->interface_name_to_objects_.find(interface_name); |
168 if (found == that->interface_name_to_objects_.end()) | 160 if (found == that->interface_name_to_objects_.end()) |
169 return NULL; | 161 return NULL; |
170 return found->second; | 162 return found->second; |
171 } | 163 } |
172 | 164 |
173 } // namespace pp | 165 } // namespace pp |
OLD | NEW |