Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: cc/raster/one_copy_tile_task_worker_pool.h

Issue 1854723002: cc: Simplify task and its derived classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Corrected scope of dependencies. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <deque> 10 #include <deque>
(...skipping 22 matching lines...) Expand all
33 class GLES2Interface; 33 class GLES2Interface;
34 } 34 }
35 } 35 }
36 36
37 namespace cc { 37 namespace cc {
38 class ResourcePool; 38 class ResourcePool;
39 39
40 class CC_EXPORT OneCopyTileTaskWorkerPool 40 class CC_EXPORT OneCopyTileTaskWorkerPool
41 : public TileTaskWorkerPool, 41 : public TileTaskWorkerPool,
42 public TileTaskRunner, 42 public TileTaskRunner,
43 public TileTaskClient,
44 public base::trace_event::MemoryDumpProvider { 43 public base::trace_event::MemoryDumpProvider {
45 public: 44 public:
46 ~OneCopyTileTaskWorkerPool() override; 45 ~OneCopyTileTaskWorkerPool() override;
47 46
48 static scoped_ptr<TileTaskWorkerPool> Create( 47 static scoped_ptr<TileTaskWorkerPool> Create(
49 base::SequencedTaskRunner* task_runner, 48 base::SequencedTaskRunner* task_runner,
50 TaskGraphRunner* task_graph_runner, 49 TaskGraphRunner* task_graph_runner,
51 ContextProvider* context_provider, 50 ContextProvider* context_provider,
52 ResourceProvider* resource_provider, 51 ResourceProvider* resource_provider,
53 int max_copy_texture_chromium_size, 52 int max_copy_texture_chromium_size,
54 bool use_partial_raster, 53 bool use_partial_raster,
55 int max_staging_buffer_usage_in_bytes, 54 int max_staging_buffer_usage_in_bytes,
56 ResourceFormat preferred_tile_format); 55 ResourceFormat preferred_tile_format);
57 56
58 // Overridden from TileTaskWorkerPool: 57 // Overridden from TileTaskWorkerPool:
59 TileTaskRunner* AsTileTaskRunner() override; 58 TileTaskRunner* AsTileTaskRunner() override;
60 59
60 // Overridden from RasterBufferProvider:
61 scoped_ptr<RasterBuffer> AcquireBufferForRaster(
62 const Resource* resource,
63 uint64_t resource_content_id,
64 uint64_t previous_content_id) override;
65 void ReleaseBufferForRaster(scoped_ptr<RasterBuffer> buffer) override;
66
61 // Overridden from TileTaskRunner: 67 // Overridden from TileTaskRunner:
62 void Shutdown() override; 68 void Shutdown() override;
63 void ScheduleTasks(TaskGraph* graph) override; 69 void ScheduleTasks(TaskGraph* graph) override;
64 void CheckForCompletedTasks() override; 70 void CheckForCompletedTasks() override;
65 ResourceFormat GetResourceFormat(bool must_support_alpha) const override; 71 ResourceFormat GetResourceFormat(bool must_support_alpha) const override;
66 bool GetResourceRequiresSwizzle(bool must_support_alpha) const override; 72 bool GetResourceRequiresSwizzle(bool must_support_alpha) const override;
67 73
68 // Overridden from TileTaskClient:
69 scoped_ptr<RasterBuffer> AcquireBufferForRaster(
70 const Resource* resource,
71 uint64_t resource_content_id,
72 uint64_t previous_content_id) override;
73 void ReleaseBufferForRaster(scoped_ptr<RasterBuffer> buffer) override;
74
75 // Overridden from base::trace_event::MemoryDumpProvider: 74 // Overridden from base::trace_event::MemoryDumpProvider:
76 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, 75 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args,
77 base::trace_event::ProcessMemoryDump* pmd) override; 76 base::trace_event::ProcessMemoryDump* pmd) override;
78 77
79 // Playback raster source and copy result into |resource|. 78 // Playback raster source and copy result into |resource|.
80 void PlaybackAndCopyOnWorkerThread( 79 void PlaybackAndCopyOnWorkerThread(
81 const Resource* resource, 80 const Resource* resource,
82 ResourceProvider::ScopedWriteLockGL* resource_lock, 81 ResourceProvider::ScopedWriteLockGL* resource_lock,
83 const RasterSource* raster_source, 82 const RasterSource* raster_source,
84 const gfx::Rect& raster_full_rect, 83 const gfx::Rect& raster_full_rect,
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 base::Closure reduce_memory_usage_callback_; 158 base::Closure reduce_memory_usage_callback_;
160 159
161 base::WeakPtrFactory<OneCopyTileTaskWorkerPool> weak_ptr_factory_; 160 base::WeakPtrFactory<OneCopyTileTaskWorkerPool> weak_ptr_factory_;
162 161
163 DISALLOW_COPY_AND_ASSIGN(OneCopyTileTaskWorkerPool); 162 DISALLOW_COPY_AND_ASSIGN(OneCopyTileTaskWorkerPool);
164 }; 163 };
165 164
166 } // namespace cc 165 } // namespace cc
167 166
168 #endif // CC_RASTER_ONE_COPY_TILE_TASK_WORKER_POOL_H_ 167 #endif // CC_RASTER_ONE_COPY_TILE_TASK_WORKER_POOL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698