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

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

Issue 2775723002: Enable RGBA_4444 in GpuRasterBufferProvider (Closed)
Patch Set: comment Created 3 years, 9 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') | cc/raster/raster_buffer_provider_perftest.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/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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 ResourceFormat OneCopyRasterBufferProvider::GetResourceFormat( 143 ResourceFormat OneCopyRasterBufferProvider::GetResourceFormat(
144 bool must_support_alpha) const { 144 bool must_support_alpha) const {
145 if (resource_provider_->IsResourceFormatSupported(preferred_tile_format_) && 145 if (resource_provider_->IsTextureFormatSupported(preferred_tile_format_) &&
146 (DoesResourceFormatSupportAlpha(preferred_tile_format_) || 146 (DoesResourceFormatSupportAlpha(preferred_tile_format_) ||
147 !must_support_alpha)) { 147 !must_support_alpha)) {
148 return preferred_tile_format_; 148 return preferred_tile_format_;
149 } 149 }
150 150
151 return resource_provider_->best_texture_format(); 151 return resource_provider_->best_texture_format();
152 } 152 }
153 153
154 bool OneCopyRasterBufferProvider::IsResourceSwizzleRequired( 154 bool OneCopyRasterBufferProvider::IsResourceSwizzleRequired(
155 bool must_support_alpha) const { 155 bool must_support_alpha) const {
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 resource_lock->set_synchronized(!async_worker_context_enabled_); 424 resource_lock->set_synchronized(!async_worker_context_enabled_);
425 } 425 }
426 426
427 gfx::BufferUsage OneCopyRasterBufferProvider::StagingBufferUsage() const { 427 gfx::BufferUsage OneCopyRasterBufferProvider::StagingBufferUsage() const {
428 return use_partial_raster_ 428 return use_partial_raster_
429 ? gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT 429 ? gfx::BufferUsage::GPU_READ_CPU_READ_WRITE_PERSISTENT
430 : gfx::BufferUsage::GPU_READ_CPU_READ_WRITE; 430 : gfx::BufferUsage::GPU_READ_CPU_READ_WRITE;
431 } 431 }
432 432
433 } // namespace cc 433 } // namespace cc
OLDNEW
« no previous file with comments | « cc/raster/gpu_raster_buffer_provider.cc ('k') | cc/raster/raster_buffer_provider_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698