5#ifndef FLUTTER_FLOW_RASTER_CACHE_KEY_H_
6#define FLUTTER_FLOW_RASTER_CACHE_KEY_H_
11#include <unordered_map>
15#include "flutter/fml/hash_combine.h"
16#include "flutter/fml/logging.h"
42 const std::vector<RasterCacheKeyID>&
child_ids()
const {
return child_ids_; }
49 return cached_hash_.value();
54 for (
auto& child_id : child_ids_) {
62 return unique_id_ == other.unique_id_ && type_ == other.type_ &&
71 const uint64_t unique_id_;
73 const std::vector<RasterCacheKeyID> child_ids_;
74 mutable std::optional<std::size_t> cached_hash_;
87 : id_(
std::move(
id)), matrix_(ctm) {
107 return key.id_.GetHash();
114 return lhs.id_ == rhs.id_ && lhs.matrix_ == rhs.matrix_;
118 template <
class Value>
119 using Map = std::unordered_map<RasterCacheKey, Value, Hash, Equal>;
static constexpr int kMTransY
vertical translation
static constexpr int kMTransX
horizontal translation
static constexpr uint64_t kDefaultUniqueID
bool operator==(const RasterCacheKeyID &other) const
RasterCacheKeyID(std::vector< RasterCacheKeyID > child_ids, RasterCacheKeyType type)
const std::vector< RasterCacheKeyID > & child_ids() const
RasterCacheKeyType type() const
RasterCacheKeyID(uint64_t unique_id, RasterCacheKeyType type)
bool operator!=(const RasterCacheKeyID &other) const
std::size_t GetHash() const
uint64_t unique_id() const
static std::optional< std::vector< RasterCacheKeyID > > LayerChildrenIds(const Layer *layer)
const RasterCacheKeyID & id() const
const SkMatrix & matrix() const
std::unordered_map< RasterCacheKey, Value, Hash, Equal > Map
RasterCacheKey(RasterCacheKeyID id, const SkMatrix &ctm)
RasterCacheKeyKind kind() const
RasterCacheKey(uint64_t unique_id, RasterCacheKeyType type, const SkMatrix &ctm)
constexpr std::size_t HashCombine()
constexpr void HashCombineSeed(std::size_t &seed, Type arg)
constexpr bool operator()(const RasterCacheKey &lhs, const RasterCacheKey &rhs) const
std::size_t operator()(RasterCacheKey const &key) const