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)); | |
88 | 87 |
89 return true; | 88 return true; |
90 } | 89 } |
91 | 90 |
92 void Graphics3DImpl::DestroyGLES2Impl() { | 91 void Graphics3DImpl::DestroyGLES2Impl() { |
93 gles2_impl_.reset(); | 92 gles2_impl_.reset(); |
94 | 93 |
95 if (transfer_buffer_id_ != -1) { | 94 if (transfer_buffer_id_ != -1) { |
96 gpu::CommandBuffer* command_buffer = GetCommandBuffer(); | 95 gpu::CommandBuffer* command_buffer = GetCommandBuffer(); |
97 DCHECK(command_buffer); | 96 DCHECK(command_buffer); |
98 command_buffer->DestroyTransferBuffer(transfer_buffer_id_); | 97 command_buffer->DestroyTransferBuffer(transfer_buffer_id_); |
99 transfer_buffer_id_ = -1; | 98 transfer_buffer_id_ = -1; |
100 } | 99 } |
101 | 100 |
102 gles2_helper_.reset(); | 101 gles2_helper_.reset(); |
103 } | 102 } |
104 | 103 |
105 } // namespace ppapi | 104 } // namespace ppapi |
106 | 105 |
OLD | NEW |