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

Side by Side Diff: cc/raster/one_copy_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 | « cc/raster/gpu_raster_buffer_provider.cc ('k') | no next file » | 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/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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 // implementation, it cannot directly partial raster into the externally 161 // implementation, it cannot directly partial raster into the externally
162 // owned resource provided in AcquireBufferForRaster. 162 // owned resource provided in AcquireBufferForRaster.
163 return false; 163 return false;
164 } 164 }
165 165
166 bool OneCopyRasterBufferProvider::IsResourceReadyToDraw( 166 bool OneCopyRasterBufferProvider::IsResourceReadyToDraw(
167 ResourceId resource_id) const { 167 ResourceId resource_id) const {
168 if (!async_worker_context_enabled_) 168 if (!async_worker_context_enabled_)
169 return true; 169 return true;
170 170
171 ResourceProvider::ResourceIdArray resources;
172 resources.push_back(resource_id);
173 gpu::SyncToken sync_token = 171 gpu::SyncToken sync_token =
174 resource_provider_->GetSyncTokenForResources(resources); 172 resource_provider_->GetSyncTokenForResources({resource_id});
175 if (!sync_token.HasData()) 173 if (!sync_token.HasData())
176 return true; 174 return true;
177 175
178 // IsSyncTokenSignalled is threadsafe, no need for worker context lock. 176 // IsSyncTokenSignalled is threadsafe, no need for worker context lock.
179 return worker_context_provider_->ContextSupport()->IsSyncTokenSignalled( 177 return worker_context_provider_->ContextSupport()->IsSyncTokenSignalled(
180 sync_token); 178 sync_token);
181 } 179 }
182 180
183 uint64_t OneCopyRasterBufferProvider::SetReadyToDrawCallback( 181 uint64_t OneCopyRasterBufferProvider::SetReadyToDrawCallback(
184 const ResourceProvider::ResourceIdArray& resource_ids, 182 const ResourceProvider::ResourceIdArray& resource_ids,
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 resource_lock->set_synchronized(!async_worker_context_enabled_); 427 resource_lock->set_synchronized(!async_worker_context_enabled_);
430 } 428 }
431 429
432 gfx::BufferUsage OneCopyRasterBufferProvider::StagingBufferUsage() const { 430 gfx::BufferUsage OneCopyRasterBufferProvider::StagingBufferUsage() const {
433 return use_partial_raster_ 431 return use_partial_raster_
434 ? gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT 432 ? gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT
435 : gfx::BufferUsage::GPU_READ_CPU_READ_WRITE; 433 : gfx::BufferUsage::GPU_READ_CPU_READ_WRITE;
436 } 434 }
437 435
438 } // namespace cc 436 } // namespace cc
OLDNEW
« no previous file with comments | « cc/raster/gpu_raster_buffer_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698