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

Side by Side Diff: cc/tile_manager.h

Issue 11453014: Implement the logic to kick off image decoding jobs for TileManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: adding more null checks Created 8 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 | Annotate | Revision Log
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_TILE_MANAGER_H_ 5 #ifndef CC_TILE_MANAGER_H_
6 #define CC_TILE_MANAGER_H_ 6 #define CC_TILE_MANAGER_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 bool can_use_gpu_memory; 50 bool can_use_gpu_memory;
51 bool can_be_freed; 51 bool can_be_freed;
52 scoped_ptr<ResourcePool::Resource> resource; 52 scoped_ptr<ResourcePool::Resource> resource;
53 bool resource_is_being_initialized; 53 bool resource_is_being_initialized;
54 bool contents_swizzled; 54 bool contents_swizzled;
55 55
56 // Ephemeral state, valid only during Manage. 56 // Ephemeral state, valid only during Manage.
57 TileManagerBin bin; 57 TileManagerBin bin;
58 TileResolution resolution; 58 TileResolution resolution;
59 float time_to_needed_in_seconds; 59 float time_to_needed_in_seconds;
60 bool has_image_decoding_info;
61 std::vector<SkPixelRef*> pending_pixel_refs;
reveman 2012/12/10 17:58:12 Should these be in the persistent state group abov
qinmin 2012/12/10 22:52:51 Done.
60 }; 62 };
61 63
62 // This class manages tiles, deciding which should get rasterized and which 64 // This class manages tiles, deciding which should get rasterized and which
63 // should no longer have any memory assigned to them. Tile objects are "owned" 65 // should no longer have any memory assigned to them. Tile objects are "owned"
64 // by layers; they automatically register with the manager when they are 66 // by layers; they automatically register with the manager when they are
65 // created, and unregister from the manager when they are deleted. 67 // created, and unregister from the manager when they are deleted.
66 class CC_EXPORT TileManager { 68 class CC_EXPORT TileManager {
67 public: 69 public:
68 TileManager(TileManagerClient* client, 70 TileManager(TileManagerClient* client,
69 ResourceProvider *resource_provider, 71 ResourceProvider *resource_provider,
(...skipping 19 matching lines...) Expand all
89 void FreeResourcesForTile(Tile*); 91 void FreeResourcesForTile(Tile*);
90 void ScheduleManageTiles(); 92 void ScheduleManageTiles();
91 void DispatchMoreRasterTasks(); 93 void DispatchMoreRasterTasks();
92 void DispatchOneRasterTask(RasterThread*, scoped_refptr<Tile>); 94 void DispatchOneRasterTask(RasterThread*, scoped_refptr<Tile>);
93 void OnRasterTaskCompleted( 95 void OnRasterTaskCompleted(
94 scoped_refptr<Tile>, 96 scoped_refptr<Tile>,
95 scoped_ptr<ResourcePool::Resource>, 97 scoped_ptr<ResourcePool::Resource>,
96 scoped_refptr<PicturePileImpl>, 98 scoped_refptr<PicturePileImpl>,
97 RenderingStats*); 99 RenderingStats*);
98 void DidFinishTileInitialization(Tile*, scoped_ptr<ResourcePool::Resource>); 100 void DidFinishTileInitialization(Tile*, scoped_ptr<ResourcePool::Resource>);
101 bool HasDispatchedImageDecodingTasks(Tile*);
102 void OnImageDecodingTaskCompleted(scoped_refptr<Tile>, uint32_t);
103 void DispatchOneImageDecodingTask(
104 RasterThread*, scoped_refptr<Tile>, SkPixelRef*);
105 void GetImageInformationForTile(Tile*);
106 RasterThread* GetFreeRasterThread();
99 107
100 TileManagerClient* client_; 108 TileManagerClient* client_;
101 scoped_ptr<ResourcePool> resource_pool_; 109 scoped_ptr<ResourcePool> resource_pool_;
102 bool manage_tiles_pending_; 110 bool manage_tiles_pending_;
103 111
104 GlobalStateThatImpactsTilePriority global_state_; 112 GlobalStateThatImpactsTilePriority global_state_;
105 113
106 typedef std::vector<Tile*> TileVector; 114 typedef std::vector<Tile*> TileVector;
107 TileVector tiles_; 115 TileVector tiles_;
108 TileVector tiles_that_need_to_be_rasterized_; 116 TileVector tiles_that_need_to_be_rasterized_;
117 // Tiles that are waiting for image decoding tasks.
118 TileVector tiles_waiting_for_image_decoding_;
119
120 typedef base::hash_map<uint32_t, SkPixelRef*> PixelRefMap;
121 PixelRefMap pending_decode_tasks_;
109 122
110 typedef ScopedPtrVector<RasterThread> RasterThreadVector; 123 typedef ScopedPtrVector<RasterThread> RasterThreadVector;
111 RasterThreadVector raster_threads_; 124 RasterThreadVector raster_threads_;
112 125
113 RenderingStats rendering_stats_; 126 RenderingStats rendering_stats_;
114 }; 127 };
115 128
116 } // namespace cc 129 } // namespace cc
117 130
118 #endif // CC_TILE_MANAGER_H_ 131 #endif // CC_TILE_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698