| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ppb_graphics_3d_shared.h" | 5 #include "ppapi/shared_impl/ppb_graphics_3d_shared.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 "gpu/command_buffer/client/transfer_buffer.h" | 10 #include "gpu/command_buffer/client/transfer_buffer.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 | 109 |
| 110 // Create a transfer buffer used to copy resources between the renderer | 110 // Create a transfer buffer used to copy resources between the renderer |
| 111 // process and the GPU process. | 111 // process and the GPU process. |
| 112 const int32 kMinTransferBufferSize = 256 * 1024; | 112 const int32 kMinTransferBufferSize = 256 * 1024; |
| 113 const int32 kMaxTransferBufferSize = 16 * 1024 * 1024; | 113 const int32 kMaxTransferBufferSize = 16 * 1024 * 1024; |
| 114 transfer_buffer_.reset(new gpu::TransferBuffer(gles2_helper_.get())); | 114 transfer_buffer_.reset(new gpu::TransferBuffer(gles2_helper_.get())); |
| 115 | 115 |
| 116 // Create the object exposing the OpenGL API. | 116 // Create the object exposing the OpenGL API. |
| 117 gles2_impl_.reset(new gpu::gles2::GLES2Implementation( | 117 gles2_impl_.reset(new gpu::gles2::GLES2Implementation( |
| 118 gles2_helper_.get(), | 118 gles2_helper_.get(), |
| 119 NULL, |
| 119 transfer_buffer_.get(), | 120 transfer_buffer_.get(), |
| 120 false, | 121 false, |
| 121 true)); | 122 true)); |
| 122 | 123 |
| 123 if (!gles2_impl_->Initialize( | 124 if (!gles2_impl_->Initialize( |
| 124 transfer_buffer_size, | 125 transfer_buffer_size, |
| 125 kMinTransferBufferSize, | 126 kMinTransferBufferSize, |
| 126 std::max(kMaxTransferBufferSize, transfer_buffer_size))) { | 127 std::max(kMaxTransferBufferSize, transfer_buffer_size))) { |
| 127 return false; | 128 return false; |
| 128 } | 129 } |
| 129 | 130 |
| 130 return true; | 131 return true; |
| 131 } | 132 } |
| 132 | 133 |
| 133 void PPB_Graphics3D_Shared::DestroyGLES2Impl() { | 134 void PPB_Graphics3D_Shared::DestroyGLES2Impl() { |
| 134 gles2_impl_.reset(); | 135 gles2_impl_.reset(); |
| 135 transfer_buffer_.reset(); | 136 transfer_buffer_.reset(); |
| 136 gles2_helper_.reset(); | 137 gles2_helper_.reset(); |
| 137 } | 138 } |
| 138 | 139 |
| 139 } // namespace ppapi | 140 } // namespace ppapi |
| 140 | 141 |
| OLD | NEW |