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

Side by Side Diff: cc/resources/tile_manager.h

Issue 15995033: cc: Low quality support for low res tiles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase fix Created 7 years, 6 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/resources/tile.h ('k') | cc/resources/tile_manager.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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_RESOURCES_TILE_MANAGER_H_ 5 #ifndef CC_RESOURCES_TILE_MANAGER_H_
6 #define CC_RESOURCES_TILE_MANAGER_H_ 6 #define CC_RESOURCES_TILE_MANAGER_H_
7 7
8 #include <queue> 8 #include <queue>
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/hash_tables.h" 12 #include "base/hash_tables.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/values.h" 14 #include "base/values.h"
15 #include "cc/debug/rendering_stats_instrumentation.h" 15 #include "cc/debug/rendering_stats_instrumentation.h"
16 #include "cc/resources/memory_history.h" 16 #include "cc/resources/memory_history.h"
17 #include "cc/resources/picture_pile_impl.h" 17 #include "cc/resources/picture_pile_impl.h"
18 #include "cc/resources/raster_worker_pool.h" 18 #include "cc/resources/raster_worker_pool.h"
19 #include "cc/resources/resource_pool.h" 19 #include "cc/resources/resource_pool.h"
20 #include "cc/resources/tile_priority.h" 20 #include "cc/resources/tile_priority.h"
21 21
22 namespace cc { 22 namespace cc {
23 class ResourceProvider; 23 class ResourceProvider;
24 class Tile; 24 class Tile;
25 class TileVersion; 25 class TileVersion;
26 26
27 // Low quality implies no lcd test;
28 // high quality implies lcd text.
29 // Note that the order of these matters, from "better" to "worse" in terms of
30 // quality.
31 enum TileRasterMode {
32 HIGH_QUALITY_RASTER_MODE = 0,
33 HIGH_QUALITY_NO_LCD_RASTER_MODE = 1,
34 LOW_QUALITY_RASTER_MODE = 2,
35 NUM_RASTER_MODES = 3
36 };
37
27 class CC_EXPORT TileManagerClient { 38 class CC_EXPORT TileManagerClient {
28 public: 39 public:
29 virtual void ScheduleManageTiles() = 0; 40 virtual void ScheduleManageTiles() = 0;
30 virtual void DidInitializeVisibleTile() = 0; 41 virtual void DidInitializeVisibleTile() = 0;
31 virtual bool 42 virtual bool
32 ShouldForceTileUploadsRequiredForActivationToComplete() const = 0; 43 ShouldForceTileUploadsRequiredForActivationToComplete() const = 0;
33 44
34 protected: 45 protected:
35 virtual ~TileManagerClient() {} 46 virtual ~TileManagerClient() {}
36 }; 47 };
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 128
118 private: 129 private:
119 // Data that is passed to raster tasks. 130 // Data that is passed to raster tasks.
120 struct RasterTaskMetadata { 131 struct RasterTaskMetadata {
121 scoped_ptr<base::Value> AsValue() const; 132 scoped_ptr<base::Value> AsValue() const;
122 bool is_tile_in_pending_tree_now_bin; 133 bool is_tile_in_pending_tree_now_bin;
123 TileResolution tile_resolution; 134 TileResolution tile_resolution;
124 int layer_id; 135 int layer_id;
125 const void* tile_id; 136 const void* tile_id;
126 int source_frame_number; 137 int source_frame_number;
138 TileRasterMode raster_mode;
127 }; 139 };
128 140
129 void AssignBinsToTiles(); 141 void AssignBinsToTiles();
130 void SortTiles(); 142 void SortTiles();
143 TileRasterMode DetermineRasterMode(const Tile* tile) const;
131 void AssignGpuMemoryToTiles(); 144 void AssignGpuMemoryToTiles();
145 void FreeResourceForTile(Tile* tile, TileRasterMode mode);
132 void FreeResourcesForTile(Tile* tile); 146 void FreeResourcesForTile(Tile* tile);
147 void FreeUnusedResourcesForTile(Tile* tile);
133 void ScheduleManageTiles() { 148 void ScheduleManageTiles() {
134 if (manage_tiles_pending_) 149 if (manage_tiles_pending_)
135 return; 150 return;
136 client_->ScheduleManageTiles(); 151 client_->ScheduleManageTiles();
137 manage_tiles_pending_ = true; 152 manage_tiles_pending_ = true;
138 } 153 }
139 RasterWorkerPool::Task CreateImageDecodeTask( 154 RasterWorkerPool::Task CreateImageDecodeTask(
140 Tile* tile, skia::LazyPixelRef* pixel_ref); 155 Tile* tile, skia::LazyPixelRef* pixel_ref);
141 void OnImageDecodeTaskCompleted( 156 void OnImageDecodeTaskCompleted(
142 scoped_refptr<Tile> tile, 157 scoped_refptr<Tile> tile,
143 uint32_t pixel_ref_id); 158 uint32_t pixel_ref_id);
144 RasterTaskMetadata GetRasterTaskMetadata(const Tile& tile) const; 159 RasterTaskMetadata GetRasterTaskMetadata(const Tile& tile) const;
145 RasterWorkerPool::RasterTask CreateRasterTask( 160 RasterWorkerPool::RasterTask CreateRasterTask(
146 Tile* tile, 161 Tile* tile,
147 PixelRefSet* decoded_images); 162 PixelRefSet* decoded_images);
148 void OnRasterTaskCompleted( 163 void OnRasterTaskCompleted(
149 scoped_refptr<Tile> tile, 164 scoped_refptr<Tile> tile,
150 scoped_ptr<ResourcePool::Resource> resource, 165 scoped_ptr<ResourcePool::Resource> resource,
151 PicturePileImpl::Analysis* analysis, 166 PicturePileImpl::Analysis* analysis,
167 TileRasterMode raster_mode,
152 bool was_canceled); 168 bool was_canceled);
153 void DidFinishTileInitialization(Tile* tile); 169 void DidFinishTileInitialization(Tile* tile);
154 void DidTileTreeBinChange(Tile* tile, 170 void DidTileTreeBinChange(Tile* tile,
155 TileManagerBin new_tree_bin, 171 TileManagerBin new_tree_bin,
156 WhichTree tree); 172 WhichTree tree);
157 scoped_ptr<Value> GetMemoryRequirementsAsValue() const; 173 scoped_ptr<Value> GetMemoryRequirementsAsValue() const;
158 void AddRequiredTileForActivation(Tile* tile); 174 void AddRequiredTileForActivation(Tile* tile);
159 175
160 static void RunImageDecodeTask( 176 static void RunImageDecodeTask(
161 skia::LazyPixelRef* pixel_ref, 177 skia::LazyPixelRef* pixel_ref,
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 222
207 bool use_color_estimator_; 223 bool use_color_estimator_;
208 bool did_initialize_visible_tile_; 224 bool did_initialize_visible_tile_;
209 225
210 DISALLOW_COPY_AND_ASSIGN(TileManager); 226 DISALLOW_COPY_AND_ASSIGN(TileManager);
211 }; 227 };
212 228
213 } // namespace cc 229 } // namespace cc
214 230
215 #endif // CC_RESOURCES_TILE_MANAGER_H_ 231 #endif // CC_RESOURCES_TILE_MANAGER_H_
OLDNEW
« no previous file with comments | « cc/resources/tile.h ('k') | cc/resources/tile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698