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.
34 lines
628 B
C++
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;
|
|
};
|
|
|
|
}
|