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

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

Issue 2814843002: gpu: GPU service scheduler. (Closed)
Patch Set: rebase Created 3 years, 7 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
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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 gl->GetGraphicsResetStatusKHR() != GL_NO_ERROR); 133 gl->GetGraphicsResetStatusKHR() != GL_NO_ERROR);
134 134
135 for (RasterBufferImpl* buffer : pending_raster_buffers_) 135 for (RasterBufferImpl* buffer : pending_raster_buffers_)
136 buffer->set_sync_token(sync_token); 136 buffer->set_sync_token(sync_token);
137 } else { 137 } else {
138 gl->OrderingBarrierCHROMIUM(); 138 gl->OrderingBarrierCHROMIUM();
139 } 139 }
140 pending_raster_buffers_.clear(); 140 pending_raster_buffers_.clear();
141 } 141 }
142 142
143 void OneCopyRasterBufferProvider::Flush() {
144 worker_context_provider_->ContextSupport()->EnsureWorkVisibleAsync();
145 }
146
143 ResourceFormat OneCopyRasterBufferProvider::GetResourceFormat( 147 ResourceFormat OneCopyRasterBufferProvider::GetResourceFormat(
144 bool must_support_alpha) const { 148 bool must_support_alpha) const {
145 if (resource_provider_->IsTextureFormatSupported(preferred_tile_format_) && 149 if (resource_provider_->IsTextureFormatSupported(preferred_tile_format_) &&
146 (DoesResourceFormatSupportAlpha(preferred_tile_format_) || 150 (DoesResourceFormatSupportAlpha(preferred_tile_format_) ||
147 !must_support_alpha)) { 151 !must_support_alpha)) {
148 return preferred_tile_format_; 152 return preferred_tile_format_;
149 } 153 }
150 154
151 return resource_provider_->best_texture_format(); 155 return resource_provider_->best_texture_format();
152 } 156 }
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 resource_lock->set_synchronized(!async_worker_context_enabled_); 428 resource_lock->set_synchronized(!async_worker_context_enabled_);
425 } 429 }
426 430
427 gfx::BufferUsage OneCopyRasterBufferProvider::StagingBufferUsage() const { 431 gfx::BufferUsage OneCopyRasterBufferProvider::StagingBufferUsage() const {
428 return use_partial_raster_ 432 return use_partial_raster_
429 ? gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT 433 ? gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT
430 : gfx::BufferUsage::GPU_READ_CPU_READ_WRITE; 434 : gfx::BufferUsage::GPU_READ_CPU_READ_WRITE;
431 } 435 }
432 436
433 } // namespace cc 437 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698