| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "cc/raster/gpu_raster_buffer_provider.h" | 5 #include "cc/raster/gpu_raster_buffer_provider.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 bool GpuRasterBufferProvider::IsResourceReadyToDraw( | 193 bool GpuRasterBufferProvider::IsResourceReadyToDraw( |
| 194 ResourceId resource_id) const { | 194 ResourceId resource_id) const { |
| 195 if (!async_worker_context_enabled_) | 195 if (!async_worker_context_enabled_) |
| 196 return true; | 196 return true; |
| 197 | 197 |
| 198 gpu::SyncToken sync_token = | 198 gpu::SyncToken sync_token = |
| 199 resource_provider_->GetSyncTokenForResources({resource_id}); | 199 resource_provider_->GetSyncTokenForResources({resource_id}); |
| 200 if (!sync_token.HasData()) | 200 if (!sync_token.HasData()) |
| 201 return true; | 201 return true; |
| 202 | 202 |
| 203 // IsSyncTokenSignalled is threadsafe, no need for worker context lock. | 203 // IsSyncTokenSignaled is thread-safe, no need for worker context lock. |
| 204 return worker_context_provider_->ContextSupport()->IsSyncTokenSignalled( | 204 return worker_context_provider_->ContextSupport()->IsSyncTokenSignaled( |
| 205 sync_token); | 205 sync_token); |
| 206 } | 206 } |
| 207 | 207 |
| 208 uint64_t GpuRasterBufferProvider::SetReadyToDrawCallback( | 208 uint64_t GpuRasterBufferProvider::SetReadyToDrawCallback( |
| 209 const ResourceProvider::ResourceIdArray& resource_ids, | 209 const ResourceProvider::ResourceIdArray& resource_ids, |
| 210 const base::Closure& callback, | 210 const base::Closure& callback, |
| 211 uint64_t pending_callback_id) const { | 211 uint64_t pending_callback_id) const { |
| 212 if (!async_worker_context_enabled_) | 212 if (!async_worker_context_enabled_) |
| 213 return 0; | 213 return 0; |
| 214 | 214 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 gl->OrderingBarrierCHROMIUM(); | 269 gl->OrderingBarrierCHROMIUM(); |
| 270 | 270 |
| 271 // Generate sync token after the barrier for cross context synchronization. | 271 // Generate sync token after the barrier for cross context synchronization. |
| 272 gpu::SyncToken resource_sync_token; | 272 gpu::SyncToken resource_sync_token; |
| 273 gl->GenUnverifiedSyncTokenCHROMIUM(fence_sync, resource_sync_token.GetData()); | 273 gl->GenUnverifiedSyncTokenCHROMIUM(fence_sync, resource_sync_token.GetData()); |
| 274 resource_lock->set_sync_token(resource_sync_token); | 274 resource_lock->set_sync_token(resource_sync_token); |
| 275 resource_lock->set_synchronized(!async_worker_context_enabled_); | 275 resource_lock->set_synchronized(!async_worker_context_enabled_); |
| 276 } | 276 } |
| 277 | 277 |
| 278 } // namespace cc | 278 } // namespace cc |
| OLD | NEW |