| 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 // A class to emulate GLES2 over command buffers. | 5 // A class to emulate GLES2 over command buffers. |
| 6 | 6 |
| 7 #include "gpu/command_buffer/client/gles2_implementation.h" | 7 #include "gpu/command_buffer/client/gles2_implementation.h" |
| 8 | 8 |
| 9 #include <GLES2/gl2ext.h> | 9 #include <GLES2/gl2ext.h> |
| 10 #include <GLES2/gl2extchromium.h> | 10 #include <GLES2/gl2extchromium.h> |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 } | 203 } |
| 204 | 204 |
| 205 GLES2Implementation::~GLES2Implementation() { | 205 GLES2Implementation::~GLES2Implementation() { |
| 206 // Make sure the queries are finished otherwise we'll delete the | 206 // Make sure the queries are finished otherwise we'll delete the |
| 207 // shared memory (mapped_memory_) which will free the memory used | 207 // shared memory (mapped_memory_) which will free the memory used |
| 208 // by the queries. The GPU process when validating that memory is still | 208 // by the queries. The GPU process when validating that memory is still |
| 209 // shared will fail and abort (ie, it will stop running). | 209 // shared will fail and abort (ie, it will stop running). |
| 210 WaitForCmd(); | 210 WaitForCmd(); |
| 211 query_tracker_.reset(); | 211 query_tracker_.reset(); |
| 212 | 212 |
| 213 if (support_client_side_arrays_) | 213 // GLES2Implementation::Initialize() could fail before allocating |
| 214 // reserved_ids_, so we need delete them carefully. |
| 215 if (support_client_side_arrays_ && reserved_ids_[0]) { |
| 214 DeleteBuffers(arraysize(reserved_ids_), &reserved_ids_[0]); | 216 DeleteBuffers(arraysize(reserved_ids_), &reserved_ids_[0]); |
| 217 } |
| 215 | 218 |
| 216 // Release any per-context data in share group. | 219 // Release any per-context data in share group. |
| 217 share_group_->FreeContext(this); | 220 share_group_->FreeContext(this); |
| 218 | 221 |
| 219 buffer_tracker_.reset(); | 222 buffer_tracker_.reset(); |
| 220 | 223 |
| 221 FreeAllAsyncUploadBuffers(); | 224 FreeAllAsyncUploadBuffers(); |
| 222 | 225 |
| 223 if (async_upload_sync_) { | 226 if (async_upload_sync_) { |
| 224 mapped_memory_->Free(async_upload_sync_); | 227 mapped_memory_->Free(async_upload_sync_); |
| (...skipping 3677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3902 return true; | 3905 return true; |
| 3903 } | 3906 } |
| 3904 | 3907 |
| 3905 // Include the auto-generated part of this file. We split this because it means | 3908 // Include the auto-generated part of this file. We split this because it means |
| 3906 // we can easily edit the non-auto generated parts right here in this file | 3909 // we can easily edit the non-auto generated parts right here in this file |
| 3907 // instead of having to edit some template or the code generator. | 3910 // instead of having to edit some template or the code generator. |
| 3908 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" | 3911 #include "gpu/command_buffer/client/gles2_implementation_impl_autogen.h" |
| 3909 | 3912 |
| 3910 } // namespace gles2 | 3913 } // namespace gles2 |
| 3911 } // namespace gpu | 3914 } // namespace gpu |
| OLD | NEW |