OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/renderer/pepper/ppb_graphics_3d_impl.h" | 5 #include "content/renderer/pepper/ppb_graphics_3d_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 if (!graphics_3d->InitRaw(share_api, attrib_list)) | 82 if (!graphics_3d->InitRaw(share_api, attrib_list)) |
83 return 0; | 83 return 0; |
84 return graphics_3d->GetReference(); | 84 return graphics_3d->GetReference(); |
85 } | 85 } |
86 | 86 |
87 PP_Bool PPB_Graphics3D_Impl::SetGetBuffer(int32_t transfer_buffer_id) { | 87 PP_Bool PPB_Graphics3D_Impl::SetGetBuffer(int32_t transfer_buffer_id) { |
88 GetCommandBuffer()->SetGetBuffer(transfer_buffer_id); | 88 GetCommandBuffer()->SetGetBuffer(transfer_buffer_id); |
89 return PP_TRUE; | 89 return PP_TRUE; |
90 } | 90 } |
91 | 91 |
92 gpu::CommandBuffer::State PPB_Graphics3D_Impl::GetState() { | |
93 return GetCommandBuffer()->GetState(); | |
94 } | |
95 | |
96 scoped_refptr<gpu::Buffer> PPB_Graphics3D_Impl::CreateTransferBuffer( | 92 scoped_refptr<gpu::Buffer> PPB_Graphics3D_Impl::CreateTransferBuffer( |
97 uint32_t size, | 93 uint32_t size, |
98 int32_t* id) { | 94 int32_t* id) { |
99 return GetCommandBuffer()->CreateTransferBuffer(size, id); | 95 return GetCommandBuffer()->CreateTransferBuffer(size, id); |
100 } | 96 } |
101 | 97 |
102 PP_Bool PPB_Graphics3D_Impl::DestroyTransferBuffer(int32_t id) { | 98 PP_Bool PPB_Graphics3D_Impl::DestroyTransferBuffer(int32_t id) { |
103 GetCommandBuffer()->DestroyTransferBuffer(id); | 99 GetCommandBuffer()->DestroyTransferBuffer(id); |
104 return PP_TRUE; | 100 return PP_TRUE; |
105 } | 101 } |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 instance->module()->GetPluginInterface(PPP_GRAPHICS_3D_INTERFACE)); | 289 instance->module()->GetPluginInterface(PPP_GRAPHICS_3D_INTERFACE)); |
294 // We have to check *again* that the instance exists, because it could have | 290 // We have to check *again* that the instance exists, because it could have |
295 // been deleted during GetPluginInterface(). Even the PluginModule could be | 291 // been deleted during GetPluginInterface(). Even the PluginModule could be |
296 // deleted, but in that case, the instance should also be gone, so the | 292 // deleted, but in that case, the instance should also be gone, so the |
297 // GetInstance check covers both cases. | 293 // GetInstance check covers both cases. |
298 if (ppp_graphics_3d && HostGlobals::Get()->GetInstance(this_pp_instance)) | 294 if (ppp_graphics_3d && HostGlobals::Get()->GetInstance(this_pp_instance)) |
299 ppp_graphics_3d->Graphics3DContextLost(this_pp_instance); | 295 ppp_graphics_3d->Graphics3DContextLost(this_pp_instance); |
300 } | 296 } |
301 | 297 |
302 } // namespace content | 298 } // namespace content |
OLD | NEW |