Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Side by Side Diff: cc/raster/gpu_raster_buffer_provider.cc

Issue 2672553002: Use uniform initialization in raster buffer providers (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | cc/raster/one_copy_raster_buffer_provider.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 // rects. 185 // rects.
186 // TODO(crbug.com/629683): See if we can work around this limitation. 186 // TODO(crbug.com/629683): See if we can work around this limitation.
187 return msaa_sample_count_ == 0; 187 return msaa_sample_count_ == 0;
188 } 188 }
189 189
190 bool GpuRasterBufferProvider::IsResourceReadyToDraw( 190 bool GpuRasterBufferProvider::IsResourceReadyToDraw(
191 ResourceId resource_id) const { 191 ResourceId resource_id) const {
192 if (!async_worker_context_enabled_) 192 if (!async_worker_context_enabled_)
193 return true; 193 return true;
194 194
195 ResourceProvider::ResourceIdArray resources;
196 resources.push_back(resource_id);
197 gpu::SyncToken sync_token = 195 gpu::SyncToken sync_token =
198 resource_provider_->GetSyncTokenForResources(resources); 196 resource_provider_->GetSyncTokenForResources({resource_id});
199 if (!sync_token.HasData()) 197 if (!sync_token.HasData())
200 return true; 198 return true;
201 199
202 // IsSyncTokenSignalled is threadsafe, no need for worker context lock. 200 // IsSyncTokenSignalled is threadsafe, no need for worker context lock.
203 return worker_context_provider_->ContextSupport()->IsSyncTokenSignalled( 201 return worker_context_provider_->ContextSupport()->IsSyncTokenSignalled(
204 sync_token); 202 sync_token);
205 } 203 }
206 204
207 uint64_t GpuRasterBufferProvider::SetReadyToDrawCallback( 205 uint64_t GpuRasterBufferProvider::SetReadyToDrawCallback(
208 const ResourceProvider::ResourceIdArray& resource_ids, 206 const ResourceProvider::ResourceIdArray& resource_ids,
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 gl->OrderingBarrierCHROMIUM(); 265 gl->OrderingBarrierCHROMIUM();
268 266
269 // Generate sync token after the barrier for cross context synchronization. 267 // Generate sync token after the barrier for cross context synchronization.
270 gpu::SyncToken resource_sync_token; 268 gpu::SyncToken resource_sync_token;
271 gl->GenUnverifiedSyncTokenCHROMIUM(fence_sync, resource_sync_token.GetData()); 269 gl->GenUnverifiedSyncTokenCHROMIUM(fence_sync, resource_sync_token.GetData());
272 resource_lock->set_sync_token(resource_sync_token); 270 resource_lock->set_sync_token(resource_sync_token);
273 resource_lock->set_synchronized(!async_worker_context_enabled_); 271 resource_lock->set_synchronized(!async_worker_context_enabled_);
274 } 272 }
275 273
276 } // namespace cc 274 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/raster/one_copy_raster_buffer_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698