| OLD | NEW |
| 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 #ifndef CC_RASTER_GPU_RASTER_BUFFER_PROVIDER_H_ | 5 #ifndef CC_RASTER_GPU_RASTER_BUFFER_PROVIDER_H_ |
| 6 #define CC_RASTER_GPU_RASTER_BUFFER_PROVIDER_H_ | 6 #define CC_RASTER_GPU_RASTER_BUFFER_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "cc/raster/raster_buffer_provider.h" | 11 #include "cc/raster/raster_buffer_provider.h" |
| 12 | 12 |
| 13 namespace cc { | 13 namespace cc { |
| 14 class ContextProvider; | 14 class ContextProvider; |
| 15 class GpuRasterizer; | 15 class GpuRasterizer; |
| 16 class ResourceProvider; | 16 class ResourceProvider; |
| 17 | 17 |
| 18 class CC_EXPORT GpuRasterBufferProvider : public RasterBufferProvider { | 18 class CC_EXPORT GpuRasterBufferProvider : public RasterBufferProvider { |
| 19 public: | 19 public: |
| 20 GpuRasterBufferProvider(ContextProvider* compositor_context_provider, |
| 21 ContextProvider* worker_context_provider, |
| 22 ResourceProvider* resource_provider, |
| 23 bool use_distance_field_text, |
| 24 int gpu_rasterization_msaa_sample_count); |
| 20 ~GpuRasterBufferProvider() override; | 25 ~GpuRasterBufferProvider() override; |
| 21 | 26 |
| 22 static std::unique_ptr<RasterBufferProvider> Create( | |
| 23 ContextProvider* context_provider, | |
| 24 ResourceProvider* resource_provider, | |
| 25 bool use_distance_field_text, | |
| 26 int gpu_rasterization_msaa_sample_count); | |
| 27 | |
| 28 // Overridden from RasterBufferProvider: | 27 // Overridden from RasterBufferProvider: |
| 29 std::unique_ptr<RasterBuffer> AcquireBufferForRaster( | 28 std::unique_ptr<RasterBuffer> AcquireBufferForRaster( |
| 30 const Resource* resource, | 29 const Resource* resource, |
| 31 uint64_t resource_content_id, | 30 uint64_t resource_content_id, |
| 32 uint64_t previous_content_id) override; | 31 uint64_t previous_content_id) override; |
| 33 void ReleaseBufferForRaster(std::unique_ptr<RasterBuffer> buffer) override; | 32 void ReleaseBufferForRaster(std::unique_ptr<RasterBuffer> buffer) override; |
| 34 void OrderingBarrier() override; | 33 void OrderingBarrier() override; |
| 35 ResourceFormat GetResourceFormat(bool must_support_alpha) const override; | 34 ResourceFormat GetResourceFormat(bool must_support_alpha) const override; |
| 36 bool GetResourceRequiresSwizzle(bool must_support_alpha) const override; | 35 bool GetResourceRequiresSwizzle(bool must_support_alpha) const override; |
| 37 void Shutdown() override; | 36 void Shutdown() override; |
| 38 | 37 |
| 39 private: | 38 private: |
| 40 GpuRasterBufferProvider(ContextProvider* context_provider, | 39 ContextProvider* const compositor_context_provider_; |
| 41 ResourceProvider* resource_provider, | |
| 42 bool use_distance_field_text, | |
| 43 int gpu_rasterization_msaa_sample_count); | |
| 44 | |
| 45 std::unique_ptr<GpuRasterizer> rasterizer_; | 40 std::unique_ptr<GpuRasterizer> rasterizer_; |
| 46 | 41 |
| 47 DISALLOW_COPY_AND_ASSIGN(GpuRasterBufferProvider); | 42 DISALLOW_COPY_AND_ASSIGN(GpuRasterBufferProvider); |
| 48 }; | 43 }; |
| 49 | 44 |
| 50 } // namespace cc | 45 } // namespace cc |
| 51 | 46 |
| 52 #endif // CC_RASTER_GPU_RASTER_BUFFER_PROVIDER_H_ | 47 #endif // CC_RASTER_GPU_RASTER_BUFFER_PROVIDER_H_ |
| OLD | NEW |