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_context_3d_impl.h" | 5 #include "webkit/plugins/ppapi/ppb_context_3d_impl.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/shared_memory.h" | 8 #include "base/shared_memory.h" |
9 #include "gpu/command_buffer/client/gles2_cmd_helper.h" | 9 #include "gpu/command_buffer/client/gles2_cmd_helper.h" |
10 #include "gpu/command_buffer/client/gles2_implementation.h" | 10 #include "gpu/command_buffer/client/gles2_implementation.h" |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 | 286 |
287 bool PPB_Context3D_Impl::InitRaw(PP_Config3D_Dev config, | 287 bool PPB_Context3D_Impl::InitRaw(PP_Config3D_Dev config, |
288 PP_Resource share_context, | 288 PP_Resource share_context, |
289 const int32_t* attrib_list) { | 289 const int32_t* attrib_list) { |
290 // Create and initialize the objects required to issue GLES2 calls. | 290 // Create and initialize the objects required to issue GLES2 calls. |
291 platform_context_.reset(instance()->CreateContext3D()); | 291 platform_context_.reset(instance()->CreateContext3D()); |
292 if (!platform_context_.get()) { | 292 if (!platform_context_.get()) { |
293 Destroy(); | 293 Destroy(); |
294 return false; | 294 return false; |
295 } | 295 } |
296 if (!platform_context_->Init()) { | 296 if (!platform_context_->Init(NULL)) { |
297 Destroy(); | 297 Destroy(); |
298 return false; | 298 return false; |
299 } | 299 } |
300 platform_context_->SetContextLostCallback( | 300 platform_context_->SetContextLostCallback( |
301 callback_factory_.NewCallback(&PPB_Context3D_Impl::OnContextLost)); | 301 callback_factory_.NewCallback(&PPB_Context3D_Impl::OnContextLost)); |
302 return true; | 302 return true; |
303 } | 303 } |
304 | 304 |
305 bool PPB_Context3D_Impl::CreateImplementation() { | 305 bool PPB_Context3D_Impl::CreateImplementation() { |
306 gpu::CommandBuffer* command_buffer = platform_context_->GetCommandBuffer(); | 306 gpu::CommandBuffer* command_buffer = platform_context_->GetCommandBuffer(); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 | 356 |
357 void PPB_Context3D_Impl::OnContextLost() { | 357 void PPB_Context3D_Impl::OnContextLost() { |
358 if (draw_surface_) | 358 if (draw_surface_) |
359 draw_surface_->OnContextLost(); | 359 draw_surface_->OnContextLost(); |
360 if (read_surface_) | 360 if (read_surface_) |
361 read_surface_->OnContextLost(); | 361 read_surface_->OnContextLost(); |
362 } | 362 } |
363 | 363 |
364 } // namespace ppapi | 364 } // namespace ppapi |
365 } // namespace webkit | 365 } // namespace webkit |
OLD | NEW |