| Index: cc/resources/managed_tile_state.h
|
| diff --git a/cc/resources/managed_tile_state.h b/cc/resources/managed_tile_state.h
|
| index 3220add53dd93780958489ea5fddf70e12aa0c24..ab323e212e48b494c0ce0e267e2a79cfccaaac09 100644
|
| --- a/cc/resources/managed_tile_state.h
|
| +++ b/cc/resources/managed_tile_state.h
|
| @@ -6,6 +6,7 @@
|
| #define CC_RESOURCES_MANAGED_TILE_STATE_H_
|
|
|
| #include "base/memory/scoped_ptr.h"
|
| +#include "cc/base/util.h"
|
| #include "cc/resources/platform_color.h"
|
| #include "cc/resources/raster_worker_pool.h"
|
| #include "cc/resources/resource_pool.h"
|
| @@ -16,26 +17,33 @@ namespace cc {
|
| class TileManager;
|
|
|
| // Tile manager classifying tiles into a few basic bins:
|
| -enum ManagedTileBin {
|
| - NOW_AND_READY_TO_DRAW_BIN = 0, // Ready to draw and within viewport.
|
| - NOW_BIN = 1, // Needed ASAP.
|
| - SOON_BIN = 2, // Impl-side version of prepainting.
|
| - EVENTUALLY_AND_ACTIVE_BIN = 3, // Nice to have, and has a task or resource.
|
| - EVENTUALLY_BIN = 4, // Nice to have, if we've got memory and time.
|
| - NEVER_AND_ACTIVE_BIN = 5, // Dont bother, but has a task or resource.
|
| - NEVER_BIN = 6, // Dont bother.
|
| - NUM_BINS = 7
|
| - // NOTE: Be sure to update ManagedTileBinAsValue and kBinPolicyMap when adding
|
| - // or reordering fields.
|
| -};
|
| -scoped_ptr<base::Value> ManagedTileBinAsValue(
|
| - ManagedTileBin bin);
|
| +// NOTE: Be sure to update kBinPolicyMap when adding fields.
|
| +DEFINE_ENUM(ManagedTileBin,
|
| + // Ready to draw and within viewport.
|
| + NOW_AND_READY_TO_DRAW_BIN,
|
|
|
| -enum ManagedTileBinPriority {
|
| - HIGH_PRIORITY_BIN = 0,
|
| - LOW_PRIORITY_BIN = 1,
|
| - NUM_BIN_PRIORITIES = 2
|
| -};
|
| + // Needed ASAP.
|
| + NOW_BIN,
|
| +
|
| + // Impl-side version of prepainting.
|
| + SOON_BIN,
|
| +
|
| + // Nice to have, and has a task or resource.
|
| + EVENTUALLY_AND_ACTIVE_BIN,
|
| +
|
| + // Nice to have, if we've got memory and time.
|
| + EVENTUALLY_BIN,
|
| +
|
| + // Dont bother, but has a task or resource.
|
| + NEVER_AND_ACTIVE_BIN,
|
| +
|
| + // Dont bother.
|
| + NEVER_BIN);
|
| +scoped_ptr<base::Value> ManagedTileBinAsValue(ManagedTileBin bin);
|
| +
|
| +DEFINE_ENUM(ManagedTileBinPriority,
|
| + HIGH_PRIORITY_BIN,
|
| + LOW_PRIORITY_BIN);
|
| scoped_ptr<base::Value> ManagedTileBinPriorityAsValue(
|
| ManagedTileBinPriority bin);
|
|
|
| @@ -128,7 +136,7 @@ class CC_EXPORT ManagedTileState {
|
| scoped_ptr<base::Value> AsValue() const;
|
|
|
| // Persisted state: valid all the time.
|
| - TileVersion tile_versions[NUM_RASTER_MODES];
|
| + TileVersion tile_versions[RasterMode_ARRAYSIZE];
|
| RasterMode raster_mode;
|
|
|
| // Ephemeral state, valid only during TileManager::ManageTiles.
|
| @@ -139,8 +147,8 @@ class CC_EXPORT ManagedTileState {
|
| bin[LOW_PRIORITY_BIN] == NEVER_AND_ACTIVE_BIN);
|
| }
|
|
|
| - ManagedTileBin bin[NUM_BIN_PRIORITIES];
|
| - ManagedTileBin tree_bin[NUM_TREES];
|
| + ManagedTileBin bin[ManagedTileBinPriority_ARRAYSIZE];
|
| + ManagedTileBin tree_bin[WhichTree_ARRAYSIZE];
|
|
|
| // The bin that the tile would have if the GPU memory manager had
|
| // a maximally permissive policy, send to the GPU memory manager
|
|
|