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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 return resource_provider_->best_render_buffer_format(); | 219 return resource_provider_->best_render_buffer_format(); |
220 } | 220 } |
221 | 221 |
222 bool GpuRasterBufferProvider::IsResourceSwizzleRequired( | 222 bool GpuRasterBufferProvider::IsResourceSwizzleRequired( |
223 bool must_support_alpha) const { | 223 bool must_support_alpha) const { |
224 // This doesn't require a swizzle because we rasterize to the correct format. | 224 // This doesn't require a swizzle because we rasterize to the correct format. |
225 return false; | 225 return false; |
226 } | 226 } |
227 | 227 |
228 bool GpuRasterBufferProvider::CanPartialRasterIntoProvidedResource() const { | 228 bool GpuRasterBufferProvider::CanPartialRasterIntoProvidedResource() const { |
229 return false; | 229 // Partial raster doesn't support MSAA, as the MSAA resolve is unaware of clip |
| 230 // rects. |
| 231 // TODO(crbug.com/629683): See if we can work around this limitation. |
| 232 return msaa_sample_count_ == 0; |
230 } | 233 } |
231 | 234 |
232 void GpuRasterBufferProvider::Shutdown() { | 235 void GpuRasterBufferProvider::Shutdown() { |
233 pending_raster_buffers_.clear(); | 236 pending_raster_buffers_.clear(); |
234 } | 237 } |
235 | 238 |
236 void GpuRasterBufferProvider::PlaybackOnWorkerThread( | 239 void GpuRasterBufferProvider::PlaybackOnWorkerThread( |
237 ResourceProvider::ScopedWriteLockGL* resource_lock, | 240 ResourceProvider::ScopedWriteLockGL* resource_lock, |
238 const gpu::SyncToken& sync_token, | 241 const gpu::SyncToken& sync_token, |
239 bool resource_has_previous_content, | 242 bool resource_has_previous_content, |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 gl->OrderingBarrierCHROMIUM(); | 280 gl->OrderingBarrierCHROMIUM(); |
278 | 281 |
279 // Generate sync token after the barrier for cross context synchronization. | 282 // Generate sync token after the barrier for cross context synchronization. |
280 gpu::SyncToken resource_sync_token; | 283 gpu::SyncToken resource_sync_token; |
281 gl->GenUnverifiedSyncTokenCHROMIUM(fence_sync, resource_sync_token.GetData()); | 284 gl->GenUnverifiedSyncTokenCHROMIUM(fence_sync, resource_sync_token.GetData()); |
282 resource_lock->set_sync_token(resource_sync_token); | 285 resource_lock->set_sync_token(resource_sync_token); |
283 resource_lock->set_synchronized(!async_worker_context_enabled_); | 286 resource_lock->set_synchronized(!async_worker_context_enabled_); |
284 } | 287 } |
285 | 288 |
286 } // namespace cc | 289 } // namespace cc |
OLD | NEW |