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 const gpu::SyncToken& sync_token, |
| 42 bool resource_has_previous_content, |
| 43 const RasterSource* raster_source, |
| 44 const gfx::Rect& raster_full_rect, |
| 45 const gfx::Rect& raster_dirty_rect, |
| 46 uint64_t new_content_id, |
| 47 float scale, |
| 48 const RasterSource::PlaybackSettings& playback_settings); |
| 49 |
38 private: | 50 private: |
39 ContextProvider* const compositor_context_provider_; | 51 ContextProvider* const compositor_context_provider_; |
40 std::unique_ptr<GpuRasterizer> rasterizer_; | 52 ContextProvider* const worker_context_provider_; |
| 53 ResourceProvider* const resource_provider_; |
| 54 const bool use_distance_field_text_; |
| 55 const int msaa_sample_count_; |
| 56 const bool async_worker_context_enabled_; |
| 57 |
| 58 std::set<RasterBuffer*> pending_raster_buffers_; |
41 | 59 |
42 DISALLOW_COPY_AND_ASSIGN(GpuRasterBufferProvider); | 60 DISALLOW_COPY_AND_ASSIGN(GpuRasterBufferProvider); |
43 }; | 61 }; |
44 | 62 |
45 } // namespace cc | 63 } // namespace cc |
46 | 64 |
47 #endif // CC_RASTER_GPU_RASTER_BUFFER_PROVIDER_H_ | 65 #endif // CC_RASTER_GPU_RASTER_BUFFER_PROVIDER_H_ |
OLD | NEW |