| 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 } | 146 } |
| 147 | 147 |
| 148 return resource_provider_->best_texture_format(); | 148 return resource_provider_->best_texture_format(); |
| 149 } | 149 } |
| 150 | 150 |
| 151 bool OneCopyRasterBufferProvider::IsResourceSwizzleRequired( | 151 bool OneCopyRasterBufferProvider::IsResourceSwizzleRequired( |
| 152 bool must_support_alpha) const { | 152 bool must_support_alpha) const { |
| 153 return ResourceFormatRequiresSwizzle(GetResourceFormat(must_support_alpha)); | 153 return ResourceFormatRequiresSwizzle(GetResourceFormat(must_support_alpha)); |
| 154 } | 154 } |
| 155 | 155 |
| 156 bool OneCopyRasterBufferProvider::IsPartialRasterSupported() const { | 156 bool OneCopyRasterBufferProvider::CanPartialRasterIntoProvidedResource() const { |
| 157 return true; | 157 // While OneCopyRasterBufferProvider has an internal partial raster |
| 158 // implementation, it cannot directly partial raster into the externally |
| 159 // owned resource provided in AcquireBufferForRaster. |
| 160 return false; |
| 158 } | 161 } |
| 159 | 162 |
| 160 void OneCopyRasterBufferProvider::Shutdown() { | 163 void OneCopyRasterBufferProvider::Shutdown() { |
| 161 staging_pool_.Shutdown(); | 164 staging_pool_.Shutdown(); |
| 162 pending_raster_buffers_.clear(); | 165 pending_raster_buffers_.clear(); |
| 163 } | 166 } |
| 164 | 167 |
| 165 void OneCopyRasterBufferProvider::PlaybackAndCopyOnWorkerThread( | 168 void OneCopyRasterBufferProvider::PlaybackAndCopyOnWorkerThread( |
| 166 const Resource* resource, | 169 const Resource* resource, |
| 167 ResourceProvider::ScopedWriteLockGL* resource_lock, | 170 ResourceProvider::ScopedWriteLockGL* resource_lock, |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 gl->OrderingBarrierCHROMIUM(); | 377 gl->OrderingBarrierCHROMIUM(); |
| 375 | 378 |
| 376 // Generate sync token after the barrier for cross context synchronization. | 379 // Generate sync token after the barrier for cross context synchronization. |
| 377 gpu::SyncToken resource_sync_token; | 380 gpu::SyncToken resource_sync_token; |
| 378 gl->GenUnverifiedSyncTokenCHROMIUM(fence_sync, resource_sync_token.GetData()); | 381 gl->GenUnverifiedSyncTokenCHROMIUM(fence_sync, resource_sync_token.GetData()); |
| 379 resource_lock->set_sync_token(resource_sync_token); | 382 resource_lock->set_sync_token(resource_sync_token); |
| 380 resource_lock->set_synchronized(!async_worker_context_enabled_); | 383 resource_lock->set_synchronized(!async_worker_context_enabled_); |
| 381 } | 384 } |
| 382 | 385 |
| 383 } // namespace cc | 386 } // namespace cc |
| OLD | NEW |