| OLD | NEW |
| 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 void 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 } | 101 } |
| 102 | 102 |
| 103 void ZeroCopyRasterBufferProvider::Flush() {} |
| 104 |
| 103 ResourceFormat ZeroCopyRasterBufferProvider::GetResourceFormat( | 105 ResourceFormat ZeroCopyRasterBufferProvider::GetResourceFormat( |
| 104 bool must_support_alpha) const { | 106 bool must_support_alpha) const { |
| 105 if (resource_provider_->IsTextureFormatSupported(preferred_tile_format_) && | 107 if (resource_provider_->IsTextureFormatSupported(preferred_tile_format_) && |
| 106 (DoesResourceFormatSupportAlpha(preferred_tile_format_) || | 108 (DoesResourceFormatSupportAlpha(preferred_tile_format_) || |
| 107 !must_support_alpha)) { | 109 !must_support_alpha)) { |
| 108 return preferred_tile_format_; | 110 return preferred_tile_format_; |
| 109 } | 111 } |
| 110 | 112 |
| 111 return resource_provider_->best_texture_format(); | 113 return resource_provider_->best_texture_format(); |
| 112 } | 114 } |
| (...skipping 18 matching lines...) Expand all Loading... |
| 131 const ResourceProvider::ResourceIdArray& resource_ids, | 133 const ResourceProvider::ResourceIdArray& resource_ids, |
| 132 const base::Closure& callback, | 134 const base::Closure& callback, |
| 133 uint64_t pending_callback_id) const { | 135 uint64_t pending_callback_id) const { |
| 134 // Zero-copy resources are immediately ready to draw. | 136 // Zero-copy resources are immediately ready to draw. |
| 135 return 0; | 137 return 0; |
| 136 } | 138 } |
| 137 | 139 |
| 138 void ZeroCopyRasterBufferProvider::Shutdown() {} | 140 void ZeroCopyRasterBufferProvider::Shutdown() {} |
| 139 | 141 |
| 140 } // namespace cc | 142 } // namespace cc |
| OLD | NEW |