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 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 return NULL; | 259 return NULL; |
260 return gles2_impl_->MapTexSubImage2DCHROMIUM( | 260 return gles2_impl_->MapTexSubImage2DCHROMIUM( |
261 target, level, xoffset, yoffset, width, height, format, type, access); | 261 target, level, xoffset, yoffset, width, height, format, type, access); |
262 } | 262 } |
263 | 263 |
264 void PPB_Context3D_Impl::UnmapTexSubImage2DCHROMIUM(const void* mem) { | 264 void PPB_Context3D_Impl::UnmapTexSubImage2DCHROMIUM(const void* mem) { |
265 if (gles2_impl_.get()) | 265 if (gles2_impl_.get()) |
266 gles2_impl_->UnmapTexSubImage2DCHROMIUM(mem); | 266 gles2_impl_->UnmapTexSubImage2DCHROMIUM(mem); |
267 } | 267 } |
268 | 268 |
| 269 gpu::gles2::GLES2Implementation* PPB_Context3D_Impl::GetGLES2Impl() { |
| 270 return gles2_impl(); |
| 271 } |
| 272 |
269 bool PPB_Context3D_Impl::Init(PP_Config3D_Dev config, | 273 bool PPB_Context3D_Impl::Init(PP_Config3D_Dev config, |
270 PP_Resource share_context, | 274 PP_Resource share_context, |
271 const int32_t* attrib_list) { | 275 const int32_t* attrib_list) { |
272 if (!InitRaw(config, share_context, attrib_list)) | 276 if (!InitRaw(config, share_context, attrib_list)) |
273 return false; | 277 return false; |
274 | 278 |
275 if (!CreateImplementation()) { | 279 if (!CreateImplementation()) { |
276 Destroy(); | 280 Destroy(); |
277 return false; | 281 return false; |
278 } | 282 } |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 | 356 |
353 void PPB_Context3D_Impl::OnContextLost() { | 357 void PPB_Context3D_Impl::OnContextLost() { |
354 if (draw_surface_) | 358 if (draw_surface_) |
355 draw_surface_->OnContextLost(); | 359 draw_surface_->OnContextLost(); |
356 if (read_surface_) | 360 if (read_surface_) |
357 read_surface_->OnContextLost(); | 361 read_surface_->OnContextLost(); |
358 } | 362 } |
359 | 363 |
360 } // namespace ppapi | 364 } // namespace ppapi |
361 } // namespace webkit | 365 } // namespace webkit |
OLD | NEW |