chromium/cc/tiles/tile_priority.h

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CC_TILES_TILE_PRIORITY_H_
#define CC_TILES_TILE_PRIORITY_H_

#include <stddef.h>

#include <algorithm>
#include <limits>
#include <memory>
#include <string>

#include "base/trace_event/traced_value.h"
#include "base/tracing/protos/chrome_track_event.pbzero.h"
#include "cc/cc_export.h"

namespace cc {

enum WhichTree {};

enum TileResolution {};
std::string TileResolutionToString(TileResolution resolution);

struct CC_EXPORT TilePriority {};

std::string TilePriorityBinToString(TilePriority::PriorityBin bin);

// It is expected the values are ordered from most restrictive to least
// restrictive. See IsTileMemoryLimitPolicyMoreRestictive().
enum TileMemoryLimitPolicy {};
std::string TileMemoryLimitPolicyToString(TileMemoryLimitPolicy policy);

// Returns true if `policy1` is more restrictive than `policy2`.
bool IsTileMemoryLimitPolicyMoreRestictive(TileMemoryLimitPolicy policy1,
                                           TileMemoryLimitPolicy policy2);

enum TreePriority {};
// TODO(nuskos): remove TreePriorityToString once we have a utility function to
// take protozero to strings.
std::string TreePriorityToString(TreePriority prio);
perfetto::protos::pbzero::ChromeCompositorStateMachineV2::MinorStateV2::
    TreePriority
    TreePriorityToProtozeroEnum(TreePriority priority);

class GlobalStateThatImpactsTilePriority {};

}  // namespace cc

#endif  // CC_TILES_TILE_PRIORITY_H_