chromium/cc/slim/damage_data.h

// Copyright 2023 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_SLIM_DAMAGE_DATA_H_
#define CC_SLIM_DAMAGE_DATA_H_

#include <unordered_map>
#include <utility>
#include <vector>

#include "ui/gfx/geometry/rect.h"

namespace cc::slim {

// Data used to compute damage.
struct DamageData {};

// For a particular render pass, store the layer or render pass ID and the
// damage data. Slim compositor render pass id is the same as the root layer
// in that render pass, which means there is never a conflict in this map
// between layers and render passes that draws into a particular render pass.
// Note this is meant to be a map similar to be used as a map and is
// specifically defined as the storage container for a flap_map. Using a vector
// instead since it's not necessary to always keep it sorted; sorting at the end
// after all data has been collected is good enough.
RenderPassDamageData;

// Map from render pass ID its damage data.
FrameDamageData;

void SortRenderPassDamageData(RenderPassDamageData& data);

}  // namespace cc::slim

#endif  // CC_SLIM_DAMAGE_DATA_H_