| 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/glue/plugins/pepper_graphics_3d.h" | 5 #include "webkit/glue/plugins/pepper_graphics_3d.h" |
| 6 | 6 |
| 7 #include "gpu/command_buffer/common/command_buffer.h" | 7 #include "gpu/command_buffer/common/command_buffer.h" |
| 8 #include "base/singleton.h" | 8 #include "base/singleton.h" |
| 9 #include "base/thread_local.h" | 9 #include "base/thread_local.h" |
| 10 #include "ppapi/c/dev/ppb_graphics_3d_dev.h" | 10 #include "ppapi/c/dev/ppb_graphics_3d_dev.h" |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 } | 138 } |
| 139 | 139 |
| 140 Graphics3D* Graphics3D::GetCurrent() { | 140 Graphics3D* Graphics3D::GetCurrent() { |
| 141 return CurrentContextKey::get()->Get(); | 141 return CurrentContextKey::get()->Get(); |
| 142 } | 142 } |
| 143 | 143 |
| 144 void Graphics3D::ResetCurrent() { | 144 void Graphics3D::ResetCurrent() { |
| 145 CurrentContextKey::get()->Set(NULL); | 145 CurrentContextKey::get()->Set(NULL); |
| 146 } | 146 } |
| 147 | 147 |
| 148 Graphics3D* Graphics3D::AsGraphics3D() { |
| 149 return this; |
| 150 } |
| 151 |
| 148 Graphics3D::~Graphics3D() { | 152 Graphics3D::~Graphics3D() { |
| 149 Destroy(); | 153 Destroy(); |
| 150 } | 154 } |
| 151 | 155 |
| 152 bool Graphics3D::Init(PP_Instance instance_id, int32_t config, | 156 bool Graphics3D::Init(PP_Instance instance_id, int32_t config, |
| 153 const int32_t* attrib_list) { | 157 const int32_t* attrib_list) { |
| 154 PluginInstance* instance = ResourceTracker::Get()->GetInstance(instance_id); | 158 PluginInstance* instance = ResourceTracker::Get()->GetInstance(instance_id); |
| 155 if (!instance) { | 159 if (!instance) { |
| 156 return false; | 160 return false; |
| 157 } | 161 } |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 ResetCurrent(); | 251 ResetCurrent(); |
| 248 } | 252 } |
| 249 | 253 |
| 250 gles2_implementation_ = NULL; | 254 gles2_implementation_ = NULL; |
| 251 | 255 |
| 252 platform_context_.reset(); | 256 platform_context_.reset(); |
| 253 } | 257 } |
| 254 | 258 |
| 255 } // namespace pepper | 259 } // namespace pepper |
| 256 | 260 |
| OLD | NEW |