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

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

Issue 1951193002: cc: Add mailbox support to ResourceProvider write locks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@worker_context_stream
Patch Set: vmpstr's review Created 4 years, 6 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/zero_copy_raster_buffer_provider.h ('k') | cc/resources/resource_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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/zero_copy_raster_buffer_provider.h" 5 #include "cc/raster/zero_copy_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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 uint64_t previous_content_id) { 89 uint64_t previous_content_id) {
90 return base::WrapUnique<RasterBuffer>( 90 return base::WrapUnique<RasterBuffer>(
91 new RasterBufferImpl(resource_provider_, resource)); 91 new RasterBufferImpl(resource_provider_, resource));
92 } 92 }
93 93
94 void ZeroCopyRasterBufferProvider::ReleaseBufferForRaster( 94 void ZeroCopyRasterBufferProvider::ReleaseBufferForRaster(
95 std::unique_ptr<RasterBuffer> buffer) { 95 std::unique_ptr<RasterBuffer> buffer) {
96 // Nothing to do here. RasterBufferImpl destructor cleans up after itself. 96 // Nothing to do here. RasterBufferImpl destructor cleans up after itself.
97 } 97 }
98 98
99 void ZeroCopyRasterBufferProvider::OrderingBarrier() { 99 bool ZeroCopyRasterBufferProvider::OrderingBarrier() {
100 // No need to sync resources as this provider does not use GL context. 100 // No need to sync resources as this provider does not use GL context.
101 return true;
101 } 102 }
102 103
103 ResourceFormat ZeroCopyRasterBufferProvider::GetResourceFormat( 104 ResourceFormat ZeroCopyRasterBufferProvider::GetResourceFormat(
104 bool must_support_alpha) const { 105 bool must_support_alpha) const {
105 if (resource_provider_->IsResourceFormatSupported(preferred_tile_format_) && 106 if (resource_provider_->IsResourceFormatSupported(preferred_tile_format_) &&
106 (DoesResourceFormatSupportAlpha(preferred_tile_format_) || 107 (DoesResourceFormatSupportAlpha(preferred_tile_format_) ||
107 !must_support_alpha)) { 108 !must_support_alpha)) {
108 return preferred_tile_format_; 109 return preferred_tile_format_;
109 } 110 }
110 111
111 return resource_provider_->best_texture_format(); 112 return resource_provider_->best_texture_format();
112 } 113 }
113 114
114 bool ZeroCopyRasterBufferProvider::GetResourceRequiresSwizzle( 115 bool ZeroCopyRasterBufferProvider::GetResourceRequiresSwizzle(
115 bool must_support_alpha) const { 116 bool must_support_alpha) const {
116 return ResourceFormatRequiresSwizzle(GetResourceFormat(must_support_alpha)); 117 return ResourceFormatRequiresSwizzle(GetResourceFormat(must_support_alpha));
117 } 118 }
118 119
119 void ZeroCopyRasterBufferProvider::Shutdown() {} 120 void ZeroCopyRasterBufferProvider::Shutdown() {}
120 121
121 } // namespace cc 122 } // namespace cc
OLDNEW
« no previous file with comments | « cc/raster/zero_copy_raster_buffer_provider.h ('k') | cc/resources/resource_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698