| 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_ONE_COPY_TILE_TASK_WORKER_POOL_H_ | 5 #ifndef CC_RASTER_ONE_COPY_TILE_TASK_WORKER_POOL_H_ | 
| 6 #define CC_RASTER_ONE_COPY_TILE_TASK_WORKER_POOL_H_ | 6 #define CC_RASTER_ONE_COPY_TILE_TASK_WORKER_POOL_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/output/context_provider.h" | 11 #include "cc/output/context_provider.h" | 
| 12 #include "cc/raster/tile_task_runner.h" | 12 #include "cc/raster/tile_task_runner.h" | 
| 13 #include "cc/raster/tile_task_worker_pool.h" | 13 #include "cc/raster/tile_task_worker_pool.h" | 
| 14 #include "cc/resources/resource_provider.h" | 14 #include "cc/resources/resource_provider.h" | 
| 15 | 15 | 
| 16 namespace cc { | 16 namespace cc { | 
| 17 struct StagingBuffer; | 17 struct StagingBuffer; | 
| 18 class StagingBufferPool; | 18 class StagingBufferPool; | 
| 19 class ResourcePool; | 19 class ResourcePool; | 
| 20 | 20 | 
| 21 class CC_EXPORT OneCopyTileTaskWorkerPool : public TileTaskWorkerPool, | 21 class CC_EXPORT OneCopyTileTaskWorkerPool : public TileTaskWorkerPool, | 
| 22                                             public TileTaskRunner, | 22                                             public TileTaskRunner, | 
| 23                                             public TileTaskClient { | 23                                             public RasterBufferProvider { | 
| 24  public: | 24  public: | 
| 25   ~OneCopyTileTaskWorkerPool() override; | 25   ~OneCopyTileTaskWorkerPool() override; | 
| 26 | 26 | 
| 27   static std::unique_ptr<TileTaskWorkerPool> Create( | 27   static std::unique_ptr<TileTaskWorkerPool> Create( | 
| 28       base::SequencedTaskRunner* task_runner, | 28       base::SequencedTaskRunner* task_runner, | 
| 29       TaskGraphRunner* task_graph_runner, | 29       TaskGraphRunner* task_graph_runner, | 
| 30       ContextProvider* context_provider, | 30       ContextProvider* context_provider, | 
| 31       ResourceProvider* resource_provider, | 31       ResourceProvider* resource_provider, | 
| 32       int max_copy_texture_chromium_size, | 32       int max_copy_texture_chromium_size, | 
| 33       bool use_partial_raster, | 33       bool use_partial_raster, | 
| 34       int max_staging_buffer_usage_in_bytes, | 34       int max_staging_buffer_usage_in_bytes, | 
| 35       ResourceFormat preferred_tile_format); | 35       ResourceFormat preferred_tile_format); | 
| 36 | 36 | 
| 37   // Overridden from TileTaskWorkerPool: | 37   // Overridden from TileTaskWorkerPool: | 
| 38   TileTaskRunner* AsTileTaskRunner() override; | 38   TileTaskRunner* AsTileTaskRunner() override; | 
| 39 | 39 | 
| 40   // Overridden from TileTaskRunner: | 40   // Overridden from TileTaskRunner: | 
| 41   void Shutdown() override; | 41   void Shutdown() override; | 
| 42   void ScheduleTasks(TaskGraph* graph) override; | 42   void ScheduleTasks(TaskGraph* graph) override; | 
| 43   void CheckForCompletedTasks() override; | 43   void CheckForCompletedTasks() override; | 
| 44   ResourceFormat GetResourceFormat(bool must_support_alpha) const override; | 44   ResourceFormat GetResourceFormat(bool must_support_alpha) const override; | 
| 45   bool GetResourceRequiresSwizzle(bool must_support_alpha) const override; | 45   bool GetResourceRequiresSwizzle(bool must_support_alpha) const override; | 
|  | 46   RasterBufferProvider* AsRasterBufferProvider() override; | 
| 46 | 47 | 
| 47   // Overridden from TileTaskClient: | 48   // Overridden from RasterBufferProvider: | 
| 48   std::unique_ptr<RasterBuffer> AcquireBufferForRaster( | 49   std::unique_ptr<RasterBuffer> AcquireBufferForRaster( | 
| 49       const Resource* resource, | 50       const Resource* resource, | 
| 50       uint64_t resource_content_id, | 51       uint64_t resource_content_id, | 
| 51       uint64_t previous_content_id) override; | 52       uint64_t previous_content_id) override; | 
| 52   void ReleaseBufferForRaster(std::unique_ptr<RasterBuffer> buffer) override; | 53   void ReleaseBufferForRaster(std::unique_ptr<RasterBuffer> buffer) override; | 
| 53 | 54 | 
| 54   // Playback raster source and copy result into |resource|. | 55   // Playback raster source and copy result into |resource|. | 
| 55   void PlaybackAndCopyOnWorkerThread( | 56   void PlaybackAndCopyOnWorkerThread( | 
| 56       const Resource* resource, | 57       const Resource* resource, | 
| 57       ResourceProvider::ScopedWriteLockGL* resource_lock, | 58       ResourceProvider::ScopedWriteLockGL* resource_lock, | 
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 103   std::unique_ptr<StagingBufferPool> staging_pool_; | 104   std::unique_ptr<StagingBufferPool> staging_pool_; | 
| 104 | 105 | 
| 105   Task::Vector completed_tasks_; | 106   Task::Vector completed_tasks_; | 
| 106 | 107 | 
| 107   DISALLOW_COPY_AND_ASSIGN(OneCopyTileTaskWorkerPool); | 108   DISALLOW_COPY_AND_ASSIGN(OneCopyTileTaskWorkerPool); | 
| 108 }; | 109 }; | 
| 109 | 110 | 
| 110 }  // namespace cc | 111 }  // namespace cc | 
| 111 | 112 | 
| 112 #endif  // CC_RASTER_ONE_COPY_TILE_TASK_WORKER_POOL_H_ | 113 #endif  // CC_RASTER_ONE_COPY_TILE_TASK_WORKER_POOL_H_ | 
| OLD | NEW | 
|---|