chromium/third_party/blink/renderer/modules/canvas/canvas2d/cached_color.h

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

#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_CANVAS_CANVAS2D_CACHED_COLOR_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_CANVAS_CANVAS2D_CACHED_COLOR_H_

#include "base/check_op.h"
#include "third_party/blink/renderer/modules/canvas/canvas2d/canvas_style.h"
#include "third_party/blink/renderer/platform/bindings/trace_wrapper_v8_reference.h"
#include "third_party/blink/renderer/platform/graphics/color.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/heap/member.h"
#include "third_party/blink/renderer/platform/wtf/allocator/allocator.h"
#include "v8/include/v8-local-handle.h"
#include "v8/include/v8-primitive.h"

namespace blink {

// Used by BaseRenderingContext2D to track cached colors.
struct CachedColor final : public GarbageCollected<CachedColor> {};

// Allows using CachedColor in a HashMap.
struct CachedColorTraits final
    : public WTF::BaseMemberHashTraits<CachedColor, Member<CachedColor>> {};

// Used for looking up CachedColors by v8::String.
struct ColorCacheHashTranslator final {};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_MODULES_CANVAS_CANVAS2D_CACHED_COLOR_H_