| 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 1037 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1048 if (!decoder_) | 1048 if (!decoder_) |
| 1049 return; | 1049 return; |
| 1050 | 1050 |
| 1051 gles2::FenceManager* fence_manager = decoder_->GetFenceManager(); | 1051 gles2::FenceManager* fence_manager = decoder_->GetFenceManager(); |
| 1052 DCHECK(fence_manager); | 1052 DCHECK(fence_manager); |
| 1053 if (fence_manager->LookupFence(id)) { | 1053 if (fence_manager->LookupFence(id)) { |
| 1054 LOG(ERROR) << "Fence already exists with same ID."; | 1054 LOG(ERROR) << "Fence already exists with same ID."; |
| 1055 return; | 1055 return; |
| 1056 } | 1056 } |
| 1057 | 1057 |
| 1058 std::unique_ptr<gl::GLFence> fence = | 1058 scoped_refptr<gl::GLFence> fence = channel()->CreateFenceForGpuFence(handle); |
| 1059 channel()->CreateFenceForGpuFence(handle); | |
| 1060 if (!fence) { | 1059 if (!fence) { |
| 1061 DLOG(ERROR) << "Failed to create GLFence from GpuFence handle."; | 1060 DLOG(ERROR) << "Failed to create GLFence from GpuFence handle."; |
| 1062 return; | 1061 return; |
| 1063 } | 1062 } |
| 1064 | 1063 |
| 1065 fence_manager->AddFence(std::move(fence), id); | 1064 fence_manager->AddFence(fence.get(), id); |
| 1066 } | 1065 } |
| 1067 | 1066 |
| 1068 void GpuCommandBufferStub::OnDestroyFence(int32_t id) { | 1067 void GpuCommandBufferStub::OnDestroyFence(int32_t id) { |
| 1069 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnDestroyFence"); | 1068 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnDestroyFence"); |
| 1070 | 1069 |
| 1071 if (!decoder_) | 1070 if (!decoder_) |
| 1072 return; | 1071 return; |
| 1073 | 1072 |
| 1074 gles2::FenceManager* fence_manager = decoder_->GetFenceManager(); | 1073 gles2::FenceManager* fence_manager = decoder_->GetFenceManager(); |
| 1075 DCHECK(fence_manager); | 1074 DCHECK(fence_manager); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1158 Send(new GpuCommandBufferMsg_SwapBuffersCompleted(route_id_, params)); | 1157 Send(new GpuCommandBufferMsg_SwapBuffersCompleted(route_id_, params)); |
| 1159 } | 1158 } |
| 1160 | 1159 |
| 1161 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase, | 1160 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase, |
| 1162 base::TimeDelta interval) { | 1161 base::TimeDelta interval) { |
| 1163 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase, | 1162 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase, |
| 1164 interval)); | 1163 interval)); |
| 1165 } | 1164 } |
| 1166 | 1165 |
| 1167 } // namespace gpu | 1166 } // namespace gpu |
| OLD | NEW |