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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 // rects. | 185 // rects. |
186 // TODO(crbug.com/629683): See if we can work around this limitation. | 186 // TODO(crbug.com/629683): See if we can work around this limitation. |
187 return msaa_sample_count_ == 0; | 187 return msaa_sample_count_ == 0; |
188 } | 188 } |
189 | 189 |
190 bool GpuRasterBufferProvider::IsResourceReadyToDraw( | 190 bool GpuRasterBufferProvider::IsResourceReadyToDraw( |
191 ResourceId resource_id) const { | 191 ResourceId resource_id) const { |
192 if (!async_worker_context_enabled_) | 192 if (!async_worker_context_enabled_) |
193 return true; | 193 return true; |
194 | 194 |
195 ResourceProvider::ResourceIdArray resources; | |
196 resources.push_back(resource_id); | |
197 gpu::SyncToken sync_token = | 195 gpu::SyncToken sync_token = |
198 resource_provider_->GetSyncTokenForResources(resources); | 196 resource_provider_->GetSyncTokenForResources({resource_id}); |
199 if (!sync_token.HasData()) | 197 if (!sync_token.HasData()) |
200 return true; | 198 return true; |
201 | 199 |
202 // IsSyncTokenSignalled is threadsafe, no need for worker context lock. | 200 // IsSyncTokenSignalled is threadsafe, no need for worker context lock. |
203 return worker_context_provider_->ContextSupport()->IsSyncTokenSignalled( | 201 return worker_context_provider_->ContextSupport()->IsSyncTokenSignalled( |
204 sync_token); | 202 sync_token); |
205 } | 203 } |
206 | 204 |
207 uint64_t GpuRasterBufferProvider::SetReadyToDrawCallback( | 205 uint64_t GpuRasterBufferProvider::SetReadyToDrawCallback( |
208 const ResourceProvider::ResourceIdArray& resource_ids, | 206 const ResourceProvider::ResourceIdArray& resource_ids, |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 gl->OrderingBarrierCHROMIUM(); | 265 gl->OrderingBarrierCHROMIUM(); |
268 | 266 |
269 // Generate sync token after the barrier for cross context synchronization. | 267 // Generate sync token after the barrier for cross context synchronization. |
270 gpu::SyncToken resource_sync_token; | 268 gpu::SyncToken resource_sync_token; |
271 gl->GenUnverifiedSyncTokenCHROMIUM(fence_sync, resource_sync_token.GetData()); | 269 gl->GenUnverifiedSyncTokenCHROMIUM(fence_sync, resource_sync_token.GetData()); |
272 resource_lock->set_sync_token(resource_sync_token); | 270 resource_lock->set_sync_token(resource_sync_token); |
273 resource_lock->set_synchronized(!async_worker_context_enabled_); | 271 resource_lock->set_synchronized(!async_worker_context_enabled_); |
274 } | 272 } |
275 | 273 |
276 } // namespace cc | 274 } // namespace cc |
OLD | NEW |