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

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

Issue 1713503002: Reland Allow one-copy and zero-copy task tile worker pools to use compressed textures. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 10 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
« no previous file with comments | « cc/proto/renderer_settings.proto ('k') | cc/raster/one_copy_tile_task_worker_pool.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 ~OneCopyTileTaskWorkerPool() override; 46 ~OneCopyTileTaskWorkerPool() override;
47 47
48 static scoped_ptr<TileTaskWorkerPool> Create( 48 static scoped_ptr<TileTaskWorkerPool> Create(
49 base::SequencedTaskRunner* task_runner, 49 base::SequencedTaskRunner* task_runner,
50 TaskGraphRunner* task_graph_runner, 50 TaskGraphRunner* task_graph_runner,
51 ContextProvider* context_provider, 51 ContextProvider* context_provider,
52 ResourceProvider* resource_provider, 52 ResourceProvider* resource_provider,
53 int max_copy_texture_chromium_size, 53 int max_copy_texture_chromium_size,
54 bool use_partial_raster, 54 bool use_partial_raster,
55 int max_staging_buffer_usage_in_bytes, 55 int max_staging_buffer_usage_in_bytes,
56 bool use_rgba_4444_texture_format); 56 ResourceFormat preferred_tile_format);
57 57
58 // Overridden from TileTaskWorkerPool: 58 // Overridden from TileTaskWorkerPool:
59 TileTaskRunner* AsTileTaskRunner() override; 59 TileTaskRunner* AsTileTaskRunner() override;
60 60
61 // Overridden from TileTaskRunner: 61 // Overridden from TileTaskRunner:
62 void Shutdown() override; 62 void Shutdown() override;
63 void ScheduleTasks(TaskGraph* graph) override; 63 void ScheduleTasks(TaskGraph* graph) override;
64 void CheckForCompletedTasks() override; 64 void CheckForCompletedTasks() override;
65 ResourceFormat GetResourceFormat(bool must_support_alpha) const override; 65 ResourceFormat GetResourceFormat(bool must_support_alpha) const override;
66 bool GetResourceRequiresSwizzle(bool must_support_alpha) const override; 66 bool GetResourceRequiresSwizzle(bool must_support_alpha) const override;
(...skipping 21 matching lines...) Expand all
88 uint64_t resource_content_id, 88 uint64_t resource_content_id,
89 uint64_t previous_content_id); 89 uint64_t previous_content_id);
90 90
91 protected: 91 protected:
92 OneCopyTileTaskWorkerPool(base::SequencedTaskRunner* task_runner, 92 OneCopyTileTaskWorkerPool(base::SequencedTaskRunner* task_runner,
93 TaskGraphRunner* task_graph_runner, 93 TaskGraphRunner* task_graph_runner,
94 ResourceProvider* resource_provider, 94 ResourceProvider* resource_provider,
95 int max_copy_texture_chromium_size, 95 int max_copy_texture_chromium_size,
96 bool use_partial_raster, 96 bool use_partial_raster,
97 int max_staging_buffer_usage_in_bytes, 97 int max_staging_buffer_usage_in_bytes,
98 bool use_rgba_4444_texture_format); 98 ResourceFormat preferred_tile_format);
99 99
100 private: 100 private:
101 struct StagingBuffer { 101 struct StagingBuffer {
102 StagingBuffer(const gfx::Size& size, ResourceFormat format); 102 StagingBuffer(const gfx::Size& size, ResourceFormat format);
103 ~StagingBuffer(); 103 ~StagingBuffer();
104 104
105 void DestroyGLResources(gpu::gles2::GLES2Interface* gl); 105 void DestroyGLResources(gpu::gles2::GLES2Interface* gl);
106 void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd, 106 void OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd,
107 ResourceFormat format, 107 ResourceFormat format,
108 bool is_free) const; 108 bool is_free) const;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 145
146 mutable base::Lock lock_; 146 mutable base::Lock lock_;
147 // |lock_| must be acquired when accessing the following members. 147 // |lock_| must be acquired when accessing the following members.
148 using StagingBufferSet = std::set<const StagingBuffer*>; 148 using StagingBufferSet = std::set<const StagingBuffer*>;
149 StagingBufferSet buffers_; 149 StagingBufferSet buffers_;
150 using StagingBufferDeque = std::deque<scoped_ptr<StagingBuffer>>; 150 using StagingBufferDeque = std::deque<scoped_ptr<StagingBuffer>>;
151 StagingBufferDeque free_buffers_; 151 StagingBufferDeque free_buffers_;
152 StagingBufferDeque busy_buffers_; 152 StagingBufferDeque busy_buffers_;
153 int bytes_scheduled_since_last_flush_; 153 int bytes_scheduled_since_last_flush_;
154 const int max_staging_buffer_usage_in_bytes_; 154 const int max_staging_buffer_usage_in_bytes_;
155 bool use_rgba_4444_texture_format_; 155 ResourceFormat preferred_tile_format_;
156 int staging_buffer_usage_in_bytes_; 156 int staging_buffer_usage_in_bytes_;
157 int free_staging_buffer_usage_in_bytes_; 157 int free_staging_buffer_usage_in_bytes_;
158 const base::TimeDelta staging_buffer_expiration_delay_; 158 const base::TimeDelta staging_buffer_expiration_delay_;
159 bool reduce_memory_usage_pending_; 159 bool reduce_memory_usage_pending_;
160 base::Closure reduce_memory_usage_callback_; 160 base::Closure reduce_memory_usage_callback_;
161 161
162 base::WeakPtrFactory<OneCopyTileTaskWorkerPool> weak_ptr_factory_; 162 base::WeakPtrFactory<OneCopyTileTaskWorkerPool> weak_ptr_factory_;
163 163
164 DISALLOW_COPY_AND_ASSIGN(OneCopyTileTaskWorkerPool); 164 DISALLOW_COPY_AND_ASSIGN(OneCopyTileTaskWorkerPool);
165 }; 165 };
166 166
167 } // namespace cc 167 } // namespace cc
168 168
169 #endif // CC_RASTER_ONE_COPY_TILE_TASK_WORKER_POOL_H_ 169 #endif // CC_RASTER_ONE_COPY_TILE_TASK_WORKER_POOL_H_
OLDNEW
« no previous file with comments | « cc/proto/renderer_settings.proto ('k') | cc/raster/one_copy_tile_task_worker_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698