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 "webkit/plugins/ppapi/ppb_surface_3d_impl.h" | 5 #include "webkit/plugins/ppapi/ppb_surface_3d_impl.h" |
6 | 6 |
7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
8 #include "gpu/command_buffer/client/gles2_implementation.h" | 8 #include "gpu/command_buffer/client/gles2_implementation.h" |
9 #include "gpu/command_buffer/common/command_buffer.h" | 9 #include "gpu/command_buffer/common/command_buffer.h" |
10 #include "ppapi/c/dev/ppb_graphics_3d_dev.h" | 10 #include "ppapi/c/dev/ppb_graphics_3d_dev.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 int32_t attribute, | 49 int32_t attribute, |
50 int32_t* value) { | 50 int32_t* value) { |
51 // TODO(alokp): Implement me. | 51 // TODO(alokp): Implement me. |
52 return 0; | 52 return 0; |
53 } | 53 } |
54 | 54 |
55 int32_t SwapBuffers(PP_Resource surface_id, | 55 int32_t SwapBuffers(PP_Resource surface_id, |
56 PP_CompletionCallback callback) { | 56 PP_CompletionCallback callback) { |
57 scoped_refptr<PPB_Surface3D_Impl> surface( | 57 scoped_refptr<PPB_Surface3D_Impl> surface( |
58 Resource::GetAs<PPB_Surface3D_Impl>(surface_id)); | 58 Resource::GetAs<PPB_Surface3D_Impl>(surface_id)); |
59 return surface->SwapBuffers(callback); | 59 return MayForceCallback(callback, surface->SwapBuffers(callback)); |
60 } | 60 } |
61 | 61 |
62 const PPB_Surface3D_Dev ppb_surface3d = { | 62 const PPB_Surface3D_Dev ppb_surface3d = { |
63 &Create, | 63 &Create, |
64 &IsSurface3D, | 64 &IsSurface3D, |
65 &SetAttrib, | 65 &SetAttrib, |
66 &GetAttrib, | 66 &GetAttrib, |
67 &SwapBuffers | 67 &SwapBuffers |
68 }; | 68 }; |
69 | 69 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 const PPP_Graphics3D_Dev* ppp_graphics_3d = | 196 const PPP_Graphics3D_Dev* ppp_graphics_3d = |
197 static_cast<const PPP_Graphics3D_Dev*>( | 197 static_cast<const PPP_Graphics3D_Dev*>( |
198 instance()->module()->GetPluginInterface( | 198 instance()->module()->GetPluginInterface( |
199 PPP_GRAPHICS_3D_DEV_INTERFACE)); | 199 PPP_GRAPHICS_3D_DEV_INTERFACE)); |
200 if (ppp_graphics_3d) | 200 if (ppp_graphics_3d) |
201 ppp_graphics_3d->Graphics3DContextLost(instance()->pp_instance()); | 201 ppp_graphics_3d->Graphics3DContextLost(instance()->pp_instance()); |
202 } | 202 } |
203 | 203 |
204 } // namespace ppapi | 204 } // namespace ppapi |
205 } // namespace webkit | 205 } // namespace webkit |
OLD | NEW |