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/one_copy_raster_buffer_provider.h" | 5 #include "cc/raster/one_copy_raster_buffer_provider.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <limits> | 10 #include <limits> |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 bool OneCopyRasterBufferProvider::IsResourceReadyToDraw( | 166 bool OneCopyRasterBufferProvider::IsResourceReadyToDraw( |
167 ResourceId resource_id) const { | 167 ResourceId resource_id) const { |
168 if (!async_worker_context_enabled_) | 168 if (!async_worker_context_enabled_) |
169 return true; | 169 return true; |
170 | 170 |
171 gpu::SyncToken sync_token = | 171 gpu::SyncToken sync_token = |
172 resource_provider_->GetSyncTokenForResources({resource_id}); | 172 resource_provider_->GetSyncTokenForResources({resource_id}); |
173 if (!sync_token.HasData()) | 173 if (!sync_token.HasData()) |
174 return true; | 174 return true; |
175 | 175 |
176 // IsSyncTokenSignalled is threadsafe, no need for worker context lock. | 176 // IsSyncTokenSignaled is thread-safe, no need for worker context lock. |
177 return worker_context_provider_->ContextSupport()->IsSyncTokenSignalled( | 177 return worker_context_provider_->ContextSupport()->IsSyncTokenSignaled( |
178 sync_token); | 178 sync_token); |
179 } | 179 } |
180 | 180 |
181 uint64_t OneCopyRasterBufferProvider::SetReadyToDrawCallback( | 181 uint64_t OneCopyRasterBufferProvider::SetReadyToDrawCallback( |
182 const ResourceProvider::ResourceIdArray& resource_ids, | 182 const ResourceProvider::ResourceIdArray& resource_ids, |
183 const base::Closure& callback, | 183 const base::Closure& callback, |
184 uint64_t pending_callback_id) const { | 184 uint64_t pending_callback_id) const { |
185 if (!async_worker_context_enabled_) | 185 if (!async_worker_context_enabled_) |
186 return 0; | 186 return 0; |
187 | 187 |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 resource_lock->set_synchronized(!async_worker_context_enabled_); | 424 resource_lock->set_synchronized(!async_worker_context_enabled_); |
425 } | 425 } |
426 | 426 |
427 gfx::BufferUsage OneCopyRasterBufferProvider::StagingBufferUsage() const { | 427 gfx::BufferUsage OneCopyRasterBufferProvider::StagingBufferUsage() const { |
428 return use_partial_raster_ | 428 return use_partial_raster_ |
429 ? gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT | 429 ? gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT |
430 : gfx::BufferUsage::GPU_READ_CPU_READ_WRITE; | 430 : gfx::BufferUsage::GPU_READ_CPU_READ_WRITE; |
431 } | 431 } |
432 | 432 |
433 } // namespace cc | 433 } // namespace cc |
OLD | NEW |