chromium/third_party/skia/src/gpu/ganesh/GrHashMapWithCache.h

/*
 * Copyright 2020 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef GrHashMapWithCache_DEFINED
#define GrHashMapWithCache_DEFINED

#include "include/private/base/SkNoncopyable.h"
#include "src/core/SkChecksum.h"
#include "src/core/SkTHash.h"

// Cheaper than SkGoodHash and good enough for UniqueID tables.
struct GrCheapHash {};

/** A hash map that caches the most recently accessed entry.
    The API is a subset of SkHashMap, and you must provide a
    sentinel key that will never be present, such as SK_InvalidUniqueID.

    KeyTraits must have:
      - static K GetInvalidKey()
*/
template <typename K, typename V, typename KeyTraits, typename HashT = SkGoodHash>
class GrHashMapWithCache : public SkNoncopyable {};

#endif