#include "core/fpdfapi/page/cpdf_pageimagecache.h"
#include <stddef.h>
#include <stdint.h>
#include <algorithm>
#include <utility>
#include <vector>
#include "core/fpdfapi/page/cpdf_dib.h"
#include "core/fpdfapi/page/cpdf_image.h"
#include "core/fpdfapi/page/cpdf_page.h"
#include "core/fpdfapi/parser/cpdf_dictionary.h"
#include "core/fpdfapi/parser/cpdf_document.h"
#include "core/fpdfapi/parser/cpdf_stream.h"
#include "core/fxcrt/check.h"
#include "core/fxcrt/retain_ptr.h"
#include "core/fxcrt/stl_util.h"
#include "core/fxge/dib/cfx_dibbase.h"
#include "core/fxge/dib/cfx_dibitmap.h"
#if defined(PDF_USE_SKIA)
#include "core/fxcrt/data_vector.h"
#include "core/fxge/cfx_defaultrenderdevice.h"
#include "third_party/skia/include/core/SkImage.h"
#include "third_party/skia/include/core/SkRefCnt.h"
#endif
namespace {
struct CacheInfo { … };
#if defined(PDF_USE_SKIA)
class CachedImage final : public CFX_DIBBase { … };
#endif
RetainPtr<CFX_DIBBase> MakeCachedImage(RetainPtr<CFX_DIBBase> image,
bool realize_hint) { … }
}
CPDF_PageImageCache::CPDF_PageImageCache(CPDF_Page* pPage) : … { … }
CPDF_PageImageCache::~CPDF_PageImageCache() = default;
void CPDF_PageImageCache::CacheOptimization(int32_t dwLimitCacheSize) { … }
void CPDF_PageImageCache::ClearImageCacheEntry(const CPDF_Stream* pStream) { … }
bool CPDF_PageImageCache::StartGetCachedBitmap(
RetainPtr<CPDF_Image> pImage,
const CPDF_Dictionary* pFormResources,
const CPDF_Dictionary* pPageResources,
bool bStdCS,
CPDF_ColorSpace::Family eFamily,
bool bLoadMask,
const CFX_Size& max_size_required) { … }
bool CPDF_PageImageCache::Continue(PauseIndicatorIface* pPause) { … }
void CPDF_PageImageCache::ResetBitmapForImage(RetainPtr<CPDF_Image> pImage) { … }
uint32_t CPDF_PageImageCache::GetCurMatteColor() const { … }
RetainPtr<CFX_DIBBase> CPDF_PageImageCache::DetachCurBitmap() { … }
RetainPtr<CFX_DIBBase> CPDF_PageImageCache::DetachCurMask() { … }
CPDF_PageImageCache::Entry::Entry(RetainPtr<CPDF_Image> pImage)
: … { … }
CPDF_PageImageCache::Entry::~Entry() = default;
void CPDF_PageImageCache::Entry::Reset() { … }
RetainPtr<CFX_DIBBase> CPDF_PageImageCache::Entry::DetachBitmap() { … }
RetainPtr<CFX_DIBBase> CPDF_PageImageCache::Entry::DetachMask() { … }
CPDF_DIB::LoadState CPDF_PageImageCache::Entry::StartGetCachedBitmap(
CPDF_PageImageCache* pPageImageCache,
const CPDF_Dictionary* pFormResources,
const CPDF_Dictionary* pPageResources,
bool bStdCS,
CPDF_ColorSpace::Family eFamily,
bool bLoadMask,
const CFX_Size& max_size_required) { … }
bool CPDF_PageImageCache::Entry::Continue(
PauseIndicatorIface* pPause,
CPDF_PageImageCache* pPageImageCache) { … }
void CPDF_PageImageCache::Entry::ContinueGetCachedBitmap(
CPDF_PageImageCache* pPageImageCache) { … }
void CPDF_PageImageCache::Entry::CalcSize() { … }
bool CPDF_PageImageCache::Entry::IsCacheValid(
const CFX_Size& max_size_required) const { … }