| 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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 } | 411 } |
| 412 | 412 |
| 413 const uint64_t fence_sync = gl->InsertFenceSyncCHROMIUM(); | 413 const uint64_t fence_sync = gl->InsertFenceSyncCHROMIUM(); |
| 414 | 414 |
| 415 // Barrier to sync worker context output to cc context. | 415 // Barrier to sync worker context output to cc context. |
| 416 gl->OrderingBarrierCHROMIUM(); | 416 gl->OrderingBarrierCHROMIUM(); |
| 417 | 417 |
| 418 // Generate sync token after the barrier for cross context synchronization. | 418 // Generate sync token after the barrier for cross context synchronization. |
| 419 gpu::SyncToken resource_sync_token; | 419 gpu::SyncToken resource_sync_token; |
| 420 gl->GenUnverifiedSyncTokenCHROMIUM(fence_sync, resource_sync_token.GetData()); | 420 gl->GenUnverifiedSyncTokenCHROMIUM(fence_sync, resource_sync_token.GetData()); |
| 421 resource_lock->set_sync_token(resource_sync_token); | 421 resource_lock->UpdateSyncToken(resource_sync_token); |
| 422 resource_lock->set_synchronized(!async_worker_context_enabled_); | |
| 423 } | 422 } |
| 424 | 423 |
| 425 gfx::BufferUsage OneCopyRasterBufferProvider::StagingBufferUsage() const { | 424 gfx::BufferUsage OneCopyRasterBufferProvider::StagingBufferUsage() const { |
| 426 return use_partial_raster_ | 425 return use_partial_raster_ |
| 427 ? gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT | 426 ? gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT |
| 428 : gfx::BufferUsage::GPU_READ_CPU_READ_WRITE; | 427 : gfx::BufferUsage::GPU_READ_CPU_READ_WRITE; |
| 429 } | 428 } |
| 430 | 429 |
| 431 } // namespace cc | 430 } // namespace cc |
| OLD | NEW |