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

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

Issue 2110083004: Partial raster for GPU (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@partialuma2
Patch Set: Add missing resource cleanup to unit tests. Created 4 years, 5 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/one_copy_raster_buffer_provider.h ('k') | cc/raster/raster_buffer_provider.h » ('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/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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 } 146 }
147 147
148 return resource_provider_->best_texture_format(); 148 return resource_provider_->best_texture_format();
149 } 149 }
150 150
151 bool OneCopyRasterBufferProvider::IsResourceSwizzleRequired( 151 bool OneCopyRasterBufferProvider::IsResourceSwizzleRequired(
152 bool must_support_alpha) const { 152 bool must_support_alpha) const {
153 return ResourceFormatRequiresSwizzle(GetResourceFormat(must_support_alpha)); 153 return ResourceFormatRequiresSwizzle(GetResourceFormat(must_support_alpha));
154 } 154 }
155 155
156 bool OneCopyRasterBufferProvider::IsPartialRasterSupported() const { 156 bool OneCopyRasterBufferProvider::CanPartialRasterIntoProvidedResource() const {
157 return true; 157 // While OneCopyRasterBufferProvider has an internal partial raster
158 // implementation, it cannot directly partial raster into the externally
159 // owned resource provided in AcquireBufferForRaster.
160 return false;
158 } 161 }
159 162
160 void OneCopyRasterBufferProvider::Shutdown() { 163 void OneCopyRasterBufferProvider::Shutdown() {
161 staging_pool_.Shutdown(); 164 staging_pool_.Shutdown();
162 pending_raster_buffers_.clear(); 165 pending_raster_buffers_.clear();
163 } 166 }
164 167
165 void OneCopyRasterBufferProvider::PlaybackAndCopyOnWorkerThread( 168 void OneCopyRasterBufferProvider::PlaybackAndCopyOnWorkerThread(
166 const Resource* resource, 169 const Resource* resource,
167 ResourceProvider::ScopedWriteLockGL* resource_lock, 170 ResourceProvider::ScopedWriteLockGL* resource_lock,
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 gl->OrderingBarrierCHROMIUM(); 377 gl->OrderingBarrierCHROMIUM();
375 378
376 // Generate sync token after the barrier for cross context synchronization. 379 // Generate sync token after the barrier for cross context synchronization.
377 gpu::SyncToken resource_sync_token; 380 gpu::SyncToken resource_sync_token;
378 gl->GenUnverifiedSyncTokenCHROMIUM(fence_sync, resource_sync_token.GetData()); 381 gl->GenUnverifiedSyncTokenCHROMIUM(fence_sync, resource_sync_token.GetData());
379 resource_lock->set_sync_token(resource_sync_token); 382 resource_lock->set_sync_token(resource_sync_token);
380 resource_lock->set_synchronized(!async_worker_context_enabled_); 383 resource_lock->set_synchronized(!async_worker_context_enabled_);
381 } 384 }
382 385
383 } // namespace cc 386 } // namespace cc
OLDNEW
« no previous file with comments | « cc/raster/one_copy_raster_buffer_provider.h ('k') | cc/raster/raster_buffer_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698