| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 | 97 |
| 98 void ZeroCopyRasterBufferProvider::ReleaseBufferForRaster( | 98 void ZeroCopyRasterBufferProvider::ReleaseBufferForRaster( |
| 99 std::unique_ptr<RasterBuffer> buffer) { | 99 std::unique_ptr<RasterBuffer> buffer) { |
| 100 // Nothing to do here. RasterBufferImpl destructor cleans up after itself. | 100 // Nothing to do here. RasterBufferImpl destructor cleans up after itself. |
| 101 } | 101 } |
| 102 | 102 |
| 103 void ZeroCopyRasterBufferProvider::OrderingBarrier() { | 103 void ZeroCopyRasterBufferProvider::OrderingBarrier() { |
| 104 // No need to sync resources as this provider does not use GL context. | 104 // No need to sync resources as this provider does not use GL context. |
| 105 } | 105 } |
| 106 | 106 |
| 107 bool ZeroCopyRasterBufferProvider::IsResourceReadyToDraw( |
| 108 const Resource* resource) { |
| 109 return true; |
| 110 } |
| 111 |
| 112 void ZeroCopyRasterBufferProvider::SignalResourcesReadyToDraw( |
| 113 const std::vector<const Resource*>& resources, |
| 114 const base::Closure& callback) { |
| 115 if (!callback.is_null()) |
| 116 callback.Run(); |
| 117 } |
| 118 |
| 107 ResourceFormat ZeroCopyRasterBufferProvider::GetResourceFormat( | 119 ResourceFormat ZeroCopyRasterBufferProvider::GetResourceFormat( |
| 108 bool must_support_alpha) const { | 120 bool must_support_alpha) const { |
| 109 if (resource_provider_->IsResourceFormatSupported(preferred_tile_format_) && | 121 if (resource_provider_->IsResourceFormatSupported(preferred_tile_format_) && |
| 110 (DoesResourceFormatSupportAlpha(preferred_tile_format_) || | 122 (DoesResourceFormatSupportAlpha(preferred_tile_format_) || |
| 111 !must_support_alpha)) { | 123 !must_support_alpha)) { |
| 112 return preferred_tile_format_; | 124 return preferred_tile_format_; |
| 113 } | 125 } |
| 114 | 126 |
| 115 return resource_provider_->best_texture_format(); | 127 return resource_provider_->best_texture_format(); |
| 116 } | 128 } |
| 117 | 129 |
| 118 bool ZeroCopyRasterBufferProvider::IsResourceSwizzleRequired( | 130 bool ZeroCopyRasterBufferProvider::IsResourceSwizzleRequired( |
| 119 bool must_support_alpha) const { | 131 bool must_support_alpha) const { |
| 120 return ResourceFormatRequiresSwizzle(GetResourceFormat(must_support_alpha)); | 132 return ResourceFormatRequiresSwizzle(GetResourceFormat(must_support_alpha)); |
| 121 } | 133 } |
| 122 | 134 |
| 123 bool ZeroCopyRasterBufferProvider::CanPartialRasterIntoProvidedResource() | 135 bool ZeroCopyRasterBufferProvider::CanPartialRasterIntoProvidedResource() |
| 124 const { | 136 const { |
| 125 return false; | 137 return false; |
| 126 } | 138 } |
| 127 | 139 |
| 128 void ZeroCopyRasterBufferProvider::Shutdown() {} | 140 void ZeroCopyRasterBufferProvider::Shutdown() {} |
| 129 | 141 |
| 130 } // namespace cc | 142 } // namespace cc |
| OLD | NEW |