| 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 27 matching lines...) Expand all Loading... |
| 38 ContextProvider* context_provider, | 38 ContextProvider* context_provider, |
| 39 ResourceProvider::ScopedWriteLockGL* resource_lock, | 39 ResourceProvider::ScopedWriteLockGL* resource_lock, |
| 40 bool async_worker_context_enabled, | 40 bool async_worker_context_enabled, |
| 41 bool use_distance_field_text, | 41 bool use_distance_field_text, |
| 42 int msaa_sample_count) { | 42 int msaa_sample_count) { |
| 43 ScopedGpuRaster gpu_raster(context_provider); | 43 ScopedGpuRaster gpu_raster(context_provider); |
| 44 | 44 |
| 45 ResourceProvider::ScopedSkSurfaceProvider scoped_surface( | 45 ResourceProvider::ScopedSkSurfaceProvider scoped_surface( |
| 46 context_provider, resource_lock, async_worker_context_enabled, | 46 context_provider, resource_lock, async_worker_context_enabled, |
| 47 use_distance_field_text, raster_source->CanUseLCDText(), | 47 use_distance_field_text, raster_source->CanUseLCDText(), |
| 48 raster_source->HasImpliedColorSpace(), msaa_sample_count); | 48 msaa_sample_count); |
| 49 SkSurface* sk_surface = scoped_surface.sk_surface(); | 49 SkSurface* sk_surface = scoped_surface.sk_surface(); |
| 50 // Allocating an SkSurface will fail after a lost context. Pretend we | 50 // Allocating an SkSurface will fail after a lost context. Pretend we |
| 51 // rasterized, as the contents of the resource don't matter anymore. | 51 // rasterized, as the contents of the resource don't matter anymore. |
| 52 if (!sk_surface) { | 52 if (!sk_surface) { |
| 53 DLOG(ERROR) << "Failed to allocate raster surface"; | 53 DLOG(ERROR) << "Failed to allocate raster surface"; |
| 54 return; | 54 return; |
| 55 } | 55 } |
| 56 | 56 |
| 57 // Playback | 57 // Playback |
| 58 gfx::Rect playback_rect = raster_full_rect; | 58 gfx::Rect playback_rect = raster_full_rect; |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 gl->OrderingBarrierCHROMIUM(); | 268 gl->OrderingBarrierCHROMIUM(); |
| 269 | 269 |
| 270 // Generate sync token after the barrier for cross context synchronization. | 270 // Generate sync token after the barrier for cross context synchronization. |
| 271 gpu::SyncToken resource_sync_token; | 271 gpu::SyncToken resource_sync_token; |
| 272 gl->GenUnverifiedSyncTokenCHROMIUM(fence_sync, resource_sync_token.GetData()); | 272 gl->GenUnverifiedSyncTokenCHROMIUM(fence_sync, resource_sync_token.GetData()); |
| 273 resource_lock->set_sync_token(resource_sync_token); | 273 resource_lock->set_sync_token(resource_sync_token); |
| 274 resource_lock->set_synchronized(!async_worker_context_enabled_); | 274 resource_lock->set_synchronized(!async_worker_context_enabled_); |
| 275 } | 275 } |
| 276 | 276 |
| 277 } // namespace cc | 277 } // namespace cc |
| OLD | NEW |