| 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 "gpu/ipc/service/gpu_command_buffer_stub.h" | 5 #include "gpu/ipc/service/gpu_command_buffer_stub.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 executor_.reset(); | 421 executor_.reset(); |
| 422 | 422 |
| 423 sync_point_client_.reset(); | 423 sync_point_client_.reset(); |
| 424 | 424 |
| 425 bool have_context = false; | 425 bool have_context = false; |
| 426 if (decoder_ && decoder_->GetGLContext()) { | 426 if (decoder_ && decoder_->GetGLContext()) { |
| 427 // Try to make the context current regardless of whether it was lost, so we | 427 // Try to make the context current regardless of whether it was lost, so we |
| 428 // don't leak resources. | 428 // don't leak resources. |
| 429 have_context = decoder_->GetGLContext()->MakeCurrent(surface_.get()); | 429 have_context = decoder_->GetGLContext()->MakeCurrent(surface_.get()); |
| 430 } | 430 } |
| 431 FOR_EACH_OBSERVER(DestructionObserver, | 431 for (auto& observer : destruction_observers_) |
| 432 destruction_observers_, | 432 observer.OnWillDestroyStub(); |
| 433 OnWillDestroyStub()); | |
| 434 | 433 |
| 435 if (decoder_) { | 434 if (decoder_) { |
| 436 decoder_->Destroy(have_context); | 435 decoder_->Destroy(have_context); |
| 437 decoder_.reset(); | 436 decoder_.reset(); |
| 438 } | 437 } |
| 439 | 438 |
| 440 command_buffer_.reset(); | 439 command_buffer_.reset(); |
| 441 | 440 |
| 442 // Remove this after crbug.com/248395 is sorted out. | 441 // Remove this after crbug.com/248395 is sorted out. |
| 443 surface_ = NULL; | 442 surface_ = NULL; |
| (...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1114 Send(new GpuCommandBufferMsg_SwapBuffersCompleted(route_id_, params)); | 1113 Send(new GpuCommandBufferMsg_SwapBuffersCompleted(route_id_, params)); |
| 1115 } | 1114 } |
| 1116 | 1115 |
| 1117 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase, | 1116 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase, |
| 1118 base::TimeDelta interval) { | 1117 base::TimeDelta interval) { |
| 1119 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase, | 1118 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase, |
| 1120 interval)); | 1119 interval)); |
| 1121 } | 1120 } |
| 1122 | 1121 |
| 1123 } // namespace gpu | 1122 } // namespace gpu |
| OLD | NEW |