| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "gpu/command_buffer/common/command_buffer.h" | 7 #include "gpu/command_buffer/common/command_buffer.h" |
| 8 #include "webkit/plugins/ppapi/common.h" | 8 #include "webkit/plugins/ppapi/common.h" |
| 9 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 9 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
| 10 #include "webkit/plugins/ppapi/ppb_surface_3d_impl.h" | 10 #include "webkit/plugins/ppapi/ppb_surface_3d_impl.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 } | 104 } |
| 105 | 105 |
| 106 PPB_Context3D_Impl* PPB_Context3D_Impl::AsPPB_Context3D_Impl() { | 106 PPB_Context3D_Impl* PPB_Context3D_Impl::AsPPB_Context3D_Impl() { |
| 107 return this; | 107 return this; |
| 108 } | 108 } |
| 109 | 109 |
| 110 bool PPB_Context3D_Impl::Init(PP_Config3D_Dev config, | 110 bool PPB_Context3D_Impl::Init(PP_Config3D_Dev config, |
| 111 PP_Resource share_context, | 111 PP_Resource share_context, |
| 112 const int32_t* attrib_list) { | 112 const int32_t* attrib_list) { |
| 113 // Create and initialize the objects required to issue GLES2 calls. | 113 // Create and initialize the objects required to issue GLES2 calls. |
| 114 platform_context_.reset(instance()->delegate()->CreateContext3D()); | 114 platform_context_.reset(instance()->CreateContext3D()); |
| 115 if (!platform_context_.get()) { | 115 if (!platform_context_.get()) { |
| 116 Destroy(); | 116 Destroy(); |
| 117 return false; | 117 return false; |
| 118 } | 118 } |
| 119 if (!platform_context_->Init()) { | 119 if (!platform_context_->Init()) { |
| 120 Destroy(); | 120 Destroy(); |
| 121 return false; | 121 return false; |
| 122 } | 122 } |
| 123 | 123 |
| 124 gles2_impl_ = platform_context_->GetGLES2Implementation(); | 124 gles2_impl_ = platform_context_->GetGLES2Implementation(); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 154 if (draw_surface_) | 154 if (draw_surface_) |
| 155 draw_surface_->BindToContext(NULL); | 155 draw_surface_->BindToContext(NULL); |
| 156 | 156 |
| 157 gles2_impl_ = NULL; | 157 gles2_impl_ = NULL; |
| 158 platform_context_.reset(); | 158 platform_context_.reset(); |
| 159 } | 159 } |
| 160 | 160 |
| 161 } // namespace ppapi | 161 } // namespace ppapi |
| 162 } // namespace webkit | 162 } // namespace webkit |
| 163 | 163 |
| OLD | NEW |