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/graphics_3d_dev.h" |
11 #include "ppapi/cpp/dev/surface_3d_dev.h" | 12 #include "ppapi/cpp/dev/surface_3d_dev.h" |
12 #include "ppapi/cpp/graphics_2d.h" | 13 #include "ppapi/cpp/graphics_2d.h" |
13 #include "ppapi/cpp/image_data.h" | 14 #include "ppapi/cpp/image_data.h" |
14 #include "ppapi/cpp/logging.h" | 15 #include "ppapi/cpp/logging.h" |
15 #include "ppapi/cpp/module.h" | 16 #include "ppapi/cpp/module.h" |
16 #include "ppapi/cpp/module_impl.h" | 17 #include "ppapi/cpp/module_impl.h" |
17 #include "ppapi/cpp/point.h" | 18 #include "ppapi/cpp/point.h" |
18 #include "ppapi/cpp/resource.h" | 19 #include "ppapi/cpp/resource.h" |
19 #include "ppapi/cpp/var.h" | 20 #include "ppapi/cpp/var.h" |
20 | 21 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 return; | 79 return; |
79 } | 80 } |
80 | 81 |
81 bool Instance::BindGraphics(const Graphics2D& graphics) { | 82 bool Instance::BindGraphics(const Graphics2D& graphics) { |
82 if (!has_interface<PPB_Instance>()) | 83 if (!has_interface<PPB_Instance>()) |
83 return false; | 84 return false; |
84 return PP_ToBool(get_interface<PPB_Instance>()->BindGraphics( | 85 return PP_ToBool(get_interface<PPB_Instance>()->BindGraphics( |
85 pp_instance(), graphics.pp_resource())); | 86 pp_instance(), graphics.pp_resource())); |
86 } | 87 } |
87 | 88 |
| 89 bool Instance::BindGraphics(const Graphics3D_Dev& graphics) { |
| 90 if (!has_interface<PPB_Instance>()) |
| 91 return false; |
| 92 return PP_ToBool(get_interface<PPB_Instance>()->BindGraphics( |
| 93 pp_instance(), graphics.pp_resource())); |
| 94 } |
| 95 |
88 bool Instance::BindGraphics(const Surface3D_Dev& graphics) { | 96 bool Instance::BindGraphics(const Surface3D_Dev& graphics) { |
89 if (!has_interface<PPB_Instance>()) | 97 if (!has_interface<PPB_Instance>()) |
90 return false; | 98 return false; |
91 return PP_ToBool(get_interface<PPB_Instance>()->BindGraphics( | 99 return PP_ToBool(get_interface<PPB_Instance>()->BindGraphics( |
92 pp_instance(), graphics.pp_resource())); | 100 pp_instance(), graphics.pp_resource())); |
93 } | 101 } |
94 | 102 |
95 bool Instance::IsFullFrame() { | 103 bool Instance::IsFullFrame() { |
96 if (!has_interface<PPB_Instance>()) | 104 if (!has_interface<PPB_Instance>()) |
97 return false; | 105 return false; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 if (!that) | 168 if (!that) |
161 return NULL; | 169 return NULL; |
162 InterfaceNameToObjectMap::iterator found = | 170 InterfaceNameToObjectMap::iterator found = |
163 that->interface_name_to_objects_.find(interface_name); | 171 that->interface_name_to_objects_.find(interface_name); |
164 if (found == that->interface_name_to_objects_.end()) | 172 if (found == that->interface_name_to_objects_.end()) |
165 return NULL; | 173 return NULL; |
166 return found->second; | 174 return found->second; |
167 } | 175 } |
168 | 176 |
169 } // namespace pp | 177 } // namespace pp |
OLD | NEW |