| 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 #include "cc/resources/resource_provider.h" |
| 13 #include "gpu/command_buffer/common/sync_token.h" |
| 12 | 14 |
| 13 namespace cc { | 15 namespace cc { |
| 14 class ContextProvider; | 16 class ContextProvider; |
| 15 class GpuRasterizer; | |
| 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, | 20 GpuRasterBufferProvider(ContextProvider* compositor_context_provider, |
| 21 ContextProvider* worker_context_provider, | 21 ContextProvider* worker_context_provider, |
| 22 ResourceProvider* resource_provider, | 22 ResourceProvider* resource_provider, |
| 23 bool use_distance_field_text, | 23 bool use_distance_field_text, |
| 24 int gpu_rasterization_msaa_sample_count); | 24 int gpu_rasterization_msaa_sample_count, |
| 25 bool async_worker_context_enabled); |
| 25 ~GpuRasterBufferProvider() override; | 26 ~GpuRasterBufferProvider() override; |
| 26 | 27 |
| 27 // Overridden from RasterBufferProvider: | 28 // Overridden from RasterBufferProvider: |
| 28 std::unique_ptr<RasterBuffer> AcquireBufferForRaster( | 29 std::unique_ptr<RasterBuffer> AcquireBufferForRaster( |
| 29 const Resource* resource, | 30 const Resource* resource, |
| 30 uint64_t resource_content_id, | 31 uint64_t resource_content_id, |
| 31 uint64_t previous_content_id) override; | 32 uint64_t previous_content_id) override; |
| 32 void ReleaseBufferForRaster(std::unique_ptr<RasterBuffer> buffer) override; | 33 void ReleaseBufferForRaster(std::unique_ptr<RasterBuffer> buffer) override; |
| 33 void OrderingBarrier() override; | 34 void OrderingBarrier() override; |
| 34 ResourceFormat GetResourceFormat(bool must_support_alpha) const override; | 35 ResourceFormat GetResourceFormat(bool must_support_alpha) const override; |
| 35 bool GetResourceRequiresSwizzle(bool must_support_alpha) const override; | 36 bool GetResourceRequiresSwizzle(bool must_support_alpha) const override; |
| 36 void Shutdown() override; | 37 void Shutdown() override; |
| 37 | 38 |
| 39 void PlaybackOnWorkerThread( |
| 40 ResourceProvider::ScopedWriteLockGL* resource_lock, |
| 41 bool resource_has_previous_content, |
| 42 const RasterSource* raster_source, |
| 43 const gfx::Rect& raster_full_rect, |
| 44 const gfx::Rect& raster_dirty_rect, |
| 45 uint64_t new_content_id, |
| 46 float scale, |
| 47 const RasterSource::PlaybackSettings& playback_settings); |
| 48 |
| 38 private: | 49 private: |
| 39 ContextProvider* const compositor_context_provider_; | 50 ContextProvider* const compositor_context_provider_; |
| 40 std::unique_ptr<GpuRasterizer> rasterizer_; | 51 ContextProvider* const worker_context_provider_; |
| 52 ResourceProvider* const resource_provider_; |
| 53 const bool use_distance_field_text_; |
| 54 const int msaa_sample_count_; |
| 55 const bool async_worker_context_enabled_; |
| 56 gpu::SyncToken sync_token_; |
| 41 | 57 |
| 42 DISALLOW_COPY_AND_ASSIGN(GpuRasterBufferProvider); | 58 DISALLOW_COPY_AND_ASSIGN(GpuRasterBufferProvider); |
| 43 }; | 59 }; |
| 44 | 60 |
| 45 } // namespace cc | 61 } // namespace cc |
| 46 | 62 |
| 47 #endif // CC_RASTER_GPU_RASTER_BUFFER_PROVIDER_H_ | 63 #endif // CC_RASTER_GPU_RASTER_BUFFER_PROVIDER_H_ |
| OLD | NEW |