| 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 #ifndef CC_RASTER_RASTER_BUFFER_PROVIDER_H_ | 5 #ifndef CC_RASTER_RASTER_BUFFER_PROVIDER_H_ |
| 6 #define CC_RASTER_RASTER_BUFFER_PROVIDER_H_ | 6 #define CC_RASTER_RASTER_BUFFER_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include "cc/playback/raster_source.h" | 10 #include "cc/playback/raster_source.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 // Acquire raster buffer. | 44 // Acquire raster buffer. |
| 45 virtual std::unique_ptr<RasterBuffer> AcquireBufferForRaster( | 45 virtual std::unique_ptr<RasterBuffer> AcquireBufferForRaster( |
| 46 const Resource* resource, | 46 const Resource* resource, |
| 47 uint64_t resource_content_id, | 47 uint64_t resource_content_id, |
| 48 uint64_t previous_content_id) = 0; | 48 uint64_t previous_content_id) = 0; |
| 49 | 49 |
| 50 // Release raster buffer. | 50 // Release raster buffer. |
| 51 virtual void ReleaseBufferForRaster(std::unique_ptr<RasterBuffer> buffer) = 0; | 51 virtual void ReleaseBufferForRaster(std::unique_ptr<RasterBuffer> buffer) = 0; |
| 52 | 52 |
| 53 virtual bool IsResourceReadyToDraw(const Resource* resource) = 0; |
| 54 |
| 55 virtual void SignalResourcesReadyToDraw( |
| 56 const std::vector<const Resource*>& resources, |
| 57 const base::Closure& callback) = 0; |
| 58 |
| 53 // Used for syncing resources to the worker context. | 59 // Used for syncing resources to the worker context. |
| 54 virtual void OrderingBarrier() = 0; | 60 virtual void OrderingBarrier() = 0; |
| 55 | 61 |
| 56 // Returns the format to use for the tiles. | 62 // Returns the format to use for the tiles. |
| 57 virtual ResourceFormat GetResourceFormat(bool must_support_alpha) const = 0; | 63 virtual ResourceFormat GetResourceFormat(bool must_support_alpha) const = 0; |
| 58 | 64 |
| 59 // Determine if the resource requires swizzling. | 65 // Determine if the resource requires swizzling. |
| 60 virtual bool IsResourceSwizzleRequired(bool must_support_alpha) const = 0; | 66 virtual bool IsResourceSwizzleRequired(bool must_support_alpha) const = 0; |
| 61 | 67 |
| 62 // Determine if the RasterBufferProvider can handle partial raster into | 68 // Determine if the RasterBufferProvider can handle partial raster into |
| 63 // the Resource provided in AcquireBufferForRaster. | 69 // the Resource provided in AcquireBufferForRaster. |
| 64 virtual bool CanPartialRasterIntoProvidedResource() const = 0; | 70 virtual bool CanPartialRasterIntoProvidedResource() const = 0; |
| 65 | 71 |
| 66 // Shutdown for doing cleanup. | 72 // Shutdown for doing cleanup. |
| 67 virtual void Shutdown() = 0; | 73 virtual void Shutdown() = 0; |
| 68 | 74 |
| 69 protected: | 75 protected: |
| 70 // Check if resource format matches output format. | 76 // Check if resource format matches output format. |
| 71 static bool ResourceFormatRequiresSwizzle(ResourceFormat format); | 77 static bool ResourceFormatRequiresSwizzle(ResourceFormat format); |
| 72 }; | 78 }; |
| 73 | 79 |
| 74 } // namespace cc | 80 } // namespace cc |
| 75 | 81 |
| 76 #endif // CC_RASTER_RASTER_BUFFER_PROVIDER_H_ | 82 #endif // CC_RASTER_RASTER_BUFFER_PROVIDER_H_ |
| OLD | NEW |