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

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

Issue 1470113002: Move TaskGraph creation to TileManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pinchfix
Patch Set: remove unnecessary include Created 5 years 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_ZERO_COPY_TILE_TASK_WORKER_POOL_H_ 5 #ifndef CC_RASTER_ZERO_COPY_TILE_TASK_WORKER_POOL_H_
6 #define CC_RASTER_ZERO_COPY_TILE_TASK_WORKER_POOL_H_ 6 #define CC_RASTER_ZERO_COPY_TILE_TASK_WORKER_POOL_H_
7 7
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "cc/raster/tile_task_runner.h" 10 #include "cc/raster/tile_task_runner.h"
(...skipping 17 matching lines...) Expand all
28 static scoped_ptr<TileTaskWorkerPool> Create( 28 static scoped_ptr<TileTaskWorkerPool> Create(
29 base::SequencedTaskRunner* task_runner, 29 base::SequencedTaskRunner* task_runner,
30 TaskGraphRunner* task_graph_runner, 30 TaskGraphRunner* task_graph_runner,
31 ResourceProvider* resource_provider, 31 ResourceProvider* resource_provider,
32 bool use_rgba_4444_texture_format); 32 bool use_rgba_4444_texture_format);
33 33
34 // Overridden from TileTaskWorkerPool: 34 // Overridden from TileTaskWorkerPool:
35 TileTaskRunner* AsTileTaskRunner() override; 35 TileTaskRunner* AsTileTaskRunner() override;
36 36
37 // Overridden from TileTaskRunner: 37 // Overridden from TileTaskRunner:
38 void SetClient(TileTaskRunnerClient* client) override;
39 void Shutdown() override; 38 void Shutdown() override;
40 void ScheduleTasks(TileTaskQueue* queue) override; 39 void ScheduleTasks(TaskGraph* graph) override;
41 void CheckForCompletedTasks() override; 40 void CheckForCompletedTasks() override;
42 ResourceFormat GetResourceFormat(bool must_support_alpha) const override; 41 ResourceFormat GetResourceFormat(bool must_support_alpha) const override;
43 bool GetResourceRequiresSwizzle(bool must_support_alpha) const override; 42 bool GetResourceRequiresSwizzle(bool must_support_alpha) const override;
44 43
45 // Overridden from TileTaskClient: 44 // Overridden from TileTaskClient:
46 scoped_ptr<RasterBuffer> AcquireBufferForRaster( 45 scoped_ptr<RasterBuffer> AcquireBufferForRaster(
47 const Resource* resource, 46 const Resource* resource,
48 uint64_t resource_content_id, 47 uint64_t resource_content_id,
49 uint64_t previous_content_id) override; 48 uint64_t previous_content_id) override;
50 void ReleaseBufferForRaster(scoped_ptr<RasterBuffer> buffer) override; 49 void ReleaseBufferForRaster(scoped_ptr<RasterBuffer> buffer) override;
51 50
52 protected: 51 protected:
53 ZeroCopyTileTaskWorkerPool(base::SequencedTaskRunner* task_runner, 52 ZeroCopyTileTaskWorkerPool(base::SequencedTaskRunner* task_runner,
54 TaskGraphRunner* task_graph_runner, 53 TaskGraphRunner* task_graph_runner,
55 ResourceProvider* resource_provider, 54 ResourceProvider* resource_provider,
56 bool use_rgba_4444_texture_format); 55 bool use_rgba_4444_texture_format);
57 56
58 private: 57 private:
59 void OnTaskSetFinished(TaskSet task_set);
60 scoped_refptr<base::trace_event::ConvertableToTraceFormat> StateAsValue() 58 scoped_refptr<base::trace_event::ConvertableToTraceFormat> StateAsValue()
61 const; 59 const;
62 60
63 scoped_refptr<base::SequencedTaskRunner> task_runner_; 61 scoped_refptr<base::SequencedTaskRunner> task_runner_;
64 TaskGraphRunner* task_graph_runner_; 62 TaskGraphRunner* task_graph_runner_;
65 const NamespaceToken namespace_token_; 63 const NamespaceToken namespace_token_;
66 TileTaskRunnerClient* client_;
67 ResourceProvider* resource_provider_; 64 ResourceProvider* resource_provider_;
68 65
69 bool use_rgba_4444_texture_format_; 66 bool use_rgba_4444_texture_format_;
70 67
71 TaskSetCollection tasks_pending_;
72
73 scoped_refptr<TileTask> task_set_finished_tasks_[kNumberOfTaskSets];
74
75 // Task graph used when scheduling tasks and vector used to gather 68 // Task graph used when scheduling tasks and vector used to gather
76 // completed tasks. 69 // completed tasks.
77 TaskGraph graph_; 70 TaskGraph* graph_;
reveman 2015/12/02 22:26:05 ditto
ericrk 2015/12/03 00:43:22 Done.
78 Task::Vector completed_tasks_; 71 Task::Vector completed_tasks_;
79 72
80 base::WeakPtrFactory<ZeroCopyTileTaskWorkerPool>
81 task_set_finished_weak_ptr_factory_;
82
83 DISALLOW_COPY_AND_ASSIGN(ZeroCopyTileTaskWorkerPool); 73 DISALLOW_COPY_AND_ASSIGN(ZeroCopyTileTaskWorkerPool);
84 }; 74 };
85 75
86 } // namespace cc 76 } // namespace cc
87 77
88 #endif // CC_RASTER_ZERO_COPY_TILE_TASK_WORKER_POOL_H_ 78 #endif // CC_RASTER_ZERO_COPY_TILE_TASK_WORKER_POOL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698