ladybird/Libraries/LibGfx/DecodedImageFrameSkiaImageCache.h
Aliaksandr Kalenik 9d605f1237 LibGfx: Hide Skia types behind pImpl in DecodedImageFrameSkiaImageCache
Move the cache's Skia-dependent members (sk_sp<SkImage>, the
DecodedImageFrame-keyed HashMap, and the SkColorSpace-based key traits)
into a private Impl struct defined in the .cpp file. The header now only
needs forward declarations for SkImage and sk_sp, so including the cache
no longer drags in Skia headers into translation units that just want to
hold a pointer to the cache.
2026-05-10 19:49:29 +02:00

34 lines
628 B
C++

/*
* Copyright (c) 2026, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/OwnPtr.h>
#include <AK/RefPtr.h>
#include <LibGfx/Forward.h>
class SkImage;
template<typename T>
class sk_sp;
namespace Gfx {
class DecodedImageFrameSkiaImageCache final {
public:
DecodedImageFrameSkiaImageCache();
explicit DecodedImageFrameSkiaImageCache(RefPtr<SkiaBackendContext>);
~DecodedImageFrameSkiaImageCache();
sk_sp<SkImage> image_for_frame(DecodedImageFrame const&);
void prune();
private:
struct Impl;
OwnPtr<Impl> m_impl;
};
}