From 4a627c598fb0beef1c600318c35d96837ca2418c Mon Sep 17 00:00:00 2001 From: vmpstr Date: Tue, 25 Nov 2014 13:24:51 -0800 Subject: [PATCH] cc: Clean-up of ManageTileState This patch removes some unused functionality that was left over from when iterators went in. R=reveman Review URL: https://codereview.chromium.org/760673002 Cr-Commit-Position: refs/heads/master@{#305698} --- cc/resources/managed_tile_state.cc | 35 +---------------------------------- cc/resources/managed_tile_state.h | 23 ----------------------- cc/resources/tile.h | 2 ++ 3 files changed, 3 insertions(+), 57 deletions(-) diff --git a/cc/resources/managed_tile_state.cc b/cc/resources/managed_tile_state.cc index 2841711dd81f..a60c28af82e2 100644 --- a/cc/resources/managed_tile_state.cc +++ b/cc/resources/managed_tile_state.cc @@ -12,38 +12,9 @@ namespace cc { -std::string ManagedTileBinToString(ManagedTileBin bin) { - switch (bin) { - case NOW_AND_READY_TO_DRAW_BIN: - return "NOW_AND_READY_TO_DRAW_BIN"; - case NOW_BIN: - return "NOW_BIN"; - case SOON_BIN: - return "SOON_BIN"; - case EVENTUALLY_AND_ACTIVE_BIN: - return "EVENTUALLY_AND_ACTIVE_BIN"; - case EVENTUALLY_BIN: - return "EVENTUALLY_BIN"; - case AT_LAST_AND_ACTIVE_BIN: - return "AT_LAST_AND_ACTIVE_BIN"; - case AT_LAST_BIN: - return "AT_LAST_BIN"; - case NEVER_BIN: - return "NEVER_BIN"; - case NUM_BINS: - NOTREACHED(); - return "Invalid Bin (NUM_BINS)"; - } - return "Invalid Bin (UNKNOWN)"; -} - ManagedTileState::ManagedTileState() - : bin(NEVER_BIN), - resolution(NON_IDEAL_RESOLUTION), - required_for_activation(false), + : resolution(NON_IDEAL_RESOLUTION), priority_bin(TilePriority::EVENTUALLY), - distance_to_visible(std::numeric_limits::infinity()), - visible_and_ready_to_draw(false), scheduled_priority(0) { } @@ -77,12 +48,8 @@ void ManagedTileState::AsValueInto(base::debug::TracedValue* state) const { state->SetBoolean("has_resource", has_resource); state->SetBoolean("is_using_gpu_memory", is_using_gpu_memory); - state->SetString("bin", ManagedTileBinToString(bin)); state->SetString("resolution", TileResolutionToString(resolution)); state->SetString("priority_bin", TilePriorityBinToString(priority_bin)); - state->SetDouble("distance_to_visible", - MathUtil::AsFloatSafely(distance_to_visible)); - state->SetBoolean("required_for_activation", required_for_activation); state->SetBoolean("is_solid_color", draw_info.mode_ == DrawInfo::SOLID_COLOR_MODE); state->SetBoolean("is_transparent", diff --git a/cc/resources/managed_tile_state.h b/cc/resources/managed_tile_state.h index 58b77c60fc3f..a0905c755bde 100644 --- a/cc/resources/managed_tile_state.h +++ b/cc/resources/managed_tile_state.h @@ -15,24 +15,6 @@ 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. - AT_LAST_AND_ACTIVE_BIN = 5, // Only do this after all other bins. - AT_LAST_BIN = 6, // Only do this after all other bins. - NEVER_BIN = 7, // Dont bother. - NUM_BINS = 8 - // NOTE: Be sure to update ManagedTileBinAsValue and kBinPolicyMap when adding - // or reordering fields. -}; -scoped_ptr ManagedTileBinAsValue(ManagedTileBin bin); - // This is state that is specific to a tile that is // managed by the TileManager. class CC_EXPORT ManagedTileState { @@ -107,13 +89,8 @@ class CC_EXPORT ManagedTileState { DrawInfo draw_info; scoped_refptr raster_task; - ManagedTileBin bin; - TileResolution resolution; - bool required_for_activation; TilePriority::PriorityBin priority_bin; - float distance_to_visible; - bool visible_and_ready_to_draw; // Priority for this state from the last time we assigned memory. unsigned scheduled_priority; diff --git a/cc/resources/tile.h b/cc/resources/tile.h index 042d5aeb570d..a35cffe86f5f 100644 --- a/cc/resources/tile.h +++ b/cc/resources/tile.h @@ -15,6 +15,8 @@ namespace cc { +class TileManager; + class CC_EXPORT Tile : public RefCountedManaged { public: enum TileRasterFlags { USE_PICTURE_ANALYSIS = 1 << 0 }; -- 2.11.4.GIT