| 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 "ppapi/shared_impl/graphics_3d_impl.h" | 5 #include "ppapi/shared_impl/graphics_3d_impl.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "gpu/command_buffer/client/gles2_cmd_helper.h" | 8 #include "gpu/command_buffer/client/gles2_cmd_helper.h" |
| 9 #include "gpu/command_buffer/client/gles2_implementation.h" | 9 #include "gpu/command_buffer/client/gles2_implementation.h" |
| 10 #include "ppapi/c/pp_errors.h" | 10 #include "ppapi/c/pp_errors.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 command_buffer->GetTransferBuffer(transfer_buffer_id_); | 76 command_buffer->GetTransferBuffer(transfer_buffer_id_); |
| 77 if (!transfer_buffer.ptr) | 77 if (!transfer_buffer.ptr) |
| 78 return false; | 78 return false; |
| 79 | 79 |
| 80 // Create the object exposing the OpenGL API. | 80 // Create the object exposing the OpenGL API. |
| 81 gles2_impl_.reset(new gpu::gles2::GLES2Implementation( | 81 gles2_impl_.reset(new gpu::gles2::GLES2Implementation( |
| 82 gles2_helper_.get(), | 82 gles2_helper_.get(), |
| 83 transfer_buffer.size, | 83 transfer_buffer.size, |
| 84 transfer_buffer.ptr, | 84 transfer_buffer.ptr, |
| 85 transfer_buffer_id_, | 85 transfer_buffer_id_, |
| 86 false)); | 86 false, |
| 87 true)); |
| 87 | 88 |
| 88 return true; | 89 return true; |
| 89 } | 90 } |
| 90 | 91 |
| 91 void Graphics3DImpl::DestroyGLES2Impl() { | 92 void Graphics3DImpl::DestroyGLES2Impl() { |
| 92 gles2_impl_.reset(); | 93 gles2_impl_.reset(); |
| 93 | 94 |
| 94 if (transfer_buffer_id_ != -1) { | 95 if (transfer_buffer_id_ != -1) { |
| 95 gpu::CommandBuffer* command_buffer = GetCommandBuffer(); | 96 gpu::CommandBuffer* command_buffer = GetCommandBuffer(); |
| 96 DCHECK(command_buffer); | 97 DCHECK(command_buffer); |
| 97 command_buffer->DestroyTransferBuffer(transfer_buffer_id_); | 98 command_buffer->DestroyTransferBuffer(transfer_buffer_id_); |
| 98 transfer_buffer_id_ = -1; | 99 transfer_buffer_id_ = -1; |
| 99 } | 100 } |
| 100 | 101 |
| 101 gles2_helper_.reset(); | 102 gles2_helper_.reset(); |
| 102 } | 103 } |
| 103 | 104 |
| 104 } // namespace ppapi | 105 } // namespace ppapi |
| 105 | 106 |
| OLD | NEW |