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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 gl->GetGraphicsResetStatusKHR() != GL_NO_ERROR); | 168 gl->GetGraphicsResetStatusKHR() != GL_NO_ERROR); |
169 | 169 |
170 for (RasterBufferImpl* buffer : pending_raster_buffers_) | 170 for (RasterBufferImpl* buffer : pending_raster_buffers_) |
171 buffer->set_sync_token(sync_token); | 171 buffer->set_sync_token(sync_token); |
172 } else { | 172 } else { |
173 gl->OrderingBarrierCHROMIUM(); | 173 gl->OrderingBarrierCHROMIUM(); |
174 } | 174 } |
175 pending_raster_buffers_.clear(); | 175 pending_raster_buffers_.clear(); |
176 } | 176 } |
177 | 177 |
| 178 void GpuRasterBufferProvider::Flush() { |
| 179 worker_context_provider_->ContextSupport()->EnsureWorkVisibleAsync(); |
| 180 } |
| 181 |
178 ResourceFormat GpuRasterBufferProvider::GetResourceFormat( | 182 ResourceFormat GpuRasterBufferProvider::GetResourceFormat( |
179 bool must_support_alpha) const { | 183 bool must_support_alpha) const { |
180 if (resource_provider_->IsRenderBufferFormatSupported( | 184 if (resource_provider_->IsRenderBufferFormatSupported( |
181 preferred_tile_format_) && | 185 preferred_tile_format_) && |
182 (DoesResourceFormatSupportAlpha(preferred_tile_format_) || | 186 (DoesResourceFormatSupportAlpha(preferred_tile_format_) || |
183 !must_support_alpha)) { | 187 !must_support_alpha)) { |
184 return preferred_tile_format_; | 188 return preferred_tile_format_; |
185 } | 189 } |
186 | 190 |
187 return resource_provider_->best_render_buffer_format(); | 191 return resource_provider_->best_render_buffer_format(); |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 gl->OrderingBarrierCHROMIUM(); | 283 gl->OrderingBarrierCHROMIUM(); |
280 | 284 |
281 // Generate sync token after the barrier for cross context synchronization. | 285 // Generate sync token after the barrier for cross context synchronization. |
282 gpu::SyncToken resource_sync_token; | 286 gpu::SyncToken resource_sync_token; |
283 gl->GenUnverifiedSyncTokenCHROMIUM(fence_sync, resource_sync_token.GetData()); | 287 gl->GenUnverifiedSyncTokenCHROMIUM(fence_sync, resource_sync_token.GetData()); |
284 resource_lock->set_sync_token(resource_sync_token); | 288 resource_lock->set_sync_token(resource_sync_token); |
285 resource_lock->set_synchronized(!async_worker_context_enabled_); | 289 resource_lock->set_synchronized(!async_worker_context_enabled_); |
286 } | 290 } |
287 | 291 |
288 } // namespace cc | 292 } // namespace cc |
OLD | NEW |