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" |
(...skipping 27 matching lines...) Expand all Loading... |
38 void Shutdown() override; | 38 void Shutdown() override; |
39 | 39 |
40 void PlaybackOnWorkerThread( | 40 void PlaybackOnWorkerThread( |
41 ResourceProvider::ScopedWriteLockGL* resource_lock, | 41 ResourceProvider::ScopedWriteLockGL* resource_lock, |
42 const gpu::SyncToken& sync_token, | 42 const gpu::SyncToken& sync_token, |
43 bool resource_has_previous_content, | 43 bool resource_has_previous_content, |
44 const RasterSource* raster_source, | 44 const RasterSource* raster_source, |
45 const gfx::Rect& raster_full_rect, | 45 const gfx::Rect& raster_full_rect, |
46 const gfx::Rect& raster_dirty_rect, | 46 const gfx::Rect& raster_dirty_rect, |
47 uint64_t new_content_id, | 47 uint64_t new_content_id, |
48 float scale, | 48 const ScaleTranslate2d& transform, |
49 const RasterSource::PlaybackSettings& playback_settings); | 49 const RasterSource::PlaybackSettings& playback_settings); |
50 | 50 |
51 private: | 51 private: |
52 class RasterBufferImpl : public RasterBuffer { | 52 class RasterBufferImpl : public RasterBuffer { |
53 public: | 53 public: |
54 RasterBufferImpl(GpuRasterBufferProvider* client, | 54 RasterBufferImpl(GpuRasterBufferProvider* client, |
55 ResourceProvider* resource_provider, | 55 ResourceProvider* resource_provider, |
56 ResourceId resource_id, | 56 ResourceId resource_id, |
57 bool async_worker_context_enabled, | 57 bool async_worker_context_enabled, |
58 bool resource_has_previous_content); | 58 bool resource_has_previous_content); |
59 ~RasterBufferImpl() override; | 59 ~RasterBufferImpl() override; |
60 | 60 |
61 // Overridden from RasterBuffer: | 61 // Overridden from RasterBuffer: |
62 void Playback( | 62 void Playback( |
63 const RasterSource* raster_source, | 63 const RasterSource* raster_source, |
64 const gfx::Rect& raster_full_rect, | 64 const gfx::Rect& raster_full_rect, |
65 const gfx::Rect& raster_dirty_rect, | 65 const gfx::Rect& raster_dirty_rect, |
66 uint64_t new_content_id, | 66 uint64_t new_content_id, |
67 float scale, | 67 const ScaleTranslate2d& transform, |
68 const RasterSource::PlaybackSettings& playback_settings) override; | 68 const RasterSource::PlaybackSettings& playback_settings) override; |
69 | 69 |
70 void set_sync_token(const gpu::SyncToken& sync_token) { | 70 void set_sync_token(const gpu::SyncToken& sync_token) { |
71 sync_token_ = sync_token; | 71 sync_token_ = sync_token; |
72 } | 72 } |
73 | 73 |
74 private: | 74 private: |
75 GpuRasterBufferProvider* const client_; | 75 GpuRasterBufferProvider* const client_; |
76 ResourceProvider::ScopedWriteLockGL lock_; | 76 ResourceProvider::ScopedWriteLockGL lock_; |
77 const bool resource_has_previous_content_; | 77 const bool resource_has_previous_content_; |
(...skipping 11 matching lines...) Expand all Loading... |
89 const bool async_worker_context_enabled_; | 89 const bool async_worker_context_enabled_; |
90 | 90 |
91 std::set<RasterBufferImpl*> pending_raster_buffers_; | 91 std::set<RasterBufferImpl*> pending_raster_buffers_; |
92 | 92 |
93 DISALLOW_COPY_AND_ASSIGN(GpuRasterBufferProvider); | 93 DISALLOW_COPY_AND_ASSIGN(GpuRasterBufferProvider); |
94 }; | 94 }; |
95 | 95 |
96 } // namespace cc | 96 } // namespace cc |
97 | 97 |
98 #endif // CC_RASTER_GPU_RASTER_BUFFER_PROVIDER_H_ | 98 #endif // CC_RASTER_GPU_RASTER_BUFFER_PROVIDER_H_ |
OLD | NEW |