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

Unified Diff: cc/tile_manager.h

Issue 11348384: cc: Use asynchronous set pixels API for impl-side painting. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: cc/tile_manager.h
diff --git a/cc/tile_manager.h b/cc/tile_manager.h
index 4a02dede82ae2c7e87a06bc0899e2af748db9bdb..403bc4e4a3feb633d0c5ca5c8c59b7ee940ea50e 100644
--- a/cc/tile_manager.h
+++ b/cc/tile_manager.h
@@ -10,6 +10,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/values.h"
#include "cc/resource_pool.h"
+#include "cc/scoped_ptr_deque.h"
#include "cc/tile_priority.h"
namespace base {
@@ -62,6 +63,25 @@ class CC_EXPORT ManagedTileState {
float time_to_needed_in_seconds;
};
+class PendingSetPixels {
+ public:
+ PendingSetPixels(Tile*, scoped_ptr<ResourcePool::Resource>);
+ ~PendingSetPixels();
+
+ Tile* tile() { return tile_.get(); }
+ ResourcePool::Resource* resource() { return resource_.get(); }
+ scoped_ptr<ResourcePool::Resource> takeResource() {
+ return resource_.Pass();
+ }
+
+ private:
+ scoped_refptr<Tile> tile_;
+ scoped_ptr<ResourcePool::Resource> resource_;
+
+ DISALLOW_COPY_AND_ASSIGN(PendingSetPixels);
+};
+
+
// This class manages tiles, deciding which should get rasterized and which
// should no longer have any memory assigned to them. Tile objects are "owned"
// by layers; they automatically register with the manager when they are
@@ -77,6 +97,7 @@ class CC_EXPORT TileManager {
void SetGlobalState(const GlobalStateThatImpactsTilePriority& state);
void ManageTiles();
+ void PrepareToDraw();
void renderingStats(RenderingStats* stats);
@@ -98,6 +119,7 @@ class CC_EXPORT TileManager {
scoped_ptr<ResourcePool::Resource>,
scoped_refptr<PicturePileImpl>,
RenderingStats*);
+ void CheckForPendingSetPixelsCompletion();
void DidFinishTileInitialization(Tile*, scoped_ptr<ResourcePool::Resource>);
TileManagerClient* client_;
@@ -106,6 +128,7 @@ class CC_EXPORT TileManager {
int pending_raster_tasks_;
size_t num_raster_threads_;
scoped_refptr<base::SequencedWorkerPool> worker_pool_;
+ bool in_prepare_to_draw_;
GlobalStateThatImpactsTilePriority global_state_;
@@ -113,7 +136,12 @@ class CC_EXPORT TileManager {
TileVector tiles_;
TileVector tiles_that_need_to_be_rasterized_;
+ typedef ScopedPtrDeque<PendingSetPixels> PendingSetPixelsDeque;
+ PendingSetPixelsDeque pending_set_pixels_;
+
RenderingStats rendering_stats_;
+
+ DISALLOW_COPY_AND_ASSIGN(TileManager);
};
} // namespace cc
« no previous file with comments | « cc/layer_tree_host_impl.cc ('k') | cc/tile_manager.cc » ('j') | cc/tile_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698