#include "cc/tiles/software_image_decode_cache.h"
#include "base/strings/stringprintf.h"
#include "cc/paint/draw_image.h"
#include "cc/paint/paint_image_builder.h"
#include "cc/test/fake_paint_image_generator.h"
#include "cc/test/skia_common.h"
#include "cc/test/test_tile_task_runner.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkRefCnt.h"
namespace cc {
namespace {
size_t kLockedMemoryLimitBytes = …;
SkM44 CreateMatrix(const SkSize& scale, bool is_decomposable) { … }
class BaseTest : public testing::Test { … };
class N32Cache : public virtual BaseTest { … };
class RGBA4444Cache : public virtual BaseTest { … };
class RGBA_F16Cache : public virtual BaseTest { … };
class AtRaster : public virtual BaseTest { … };
class Predecode : public virtual BaseTest { … };
class NoDecodeToScaleSupport : public virtual BaseTest { … };
class NoDecodeToScaleSupportF16 : public virtual BaseTest { … };
class DefaultColorSpace : public virtual BaseTest { … };
class ExoticColorSpace : public virtual BaseTest { … };
class WideGamutCanvasColorSpace : public virtual BaseTest { … };
class HdrCanvasColorSpace : public virtual BaseTest { … };
class SoftwareImageDecodeCacheTest_Typical : public N32Cache,
public Predecode,
public NoDecodeToScaleSupport,
public DefaultColorSpace { … };
TEST_F(SoftwareImageDecodeCacheTest_Typical, UseClosestAvailableDecode) { … }
TEST_F(SoftwareImageDecodeCacheTest_Typical,
UseClosestAvailableDecodeNotSmaller) { … }
TEST_F(SoftwareImageDecodeCacheTest_Typical,
UseClosestAvailableDecodeFirstImageSubrected) { … }
TEST_F(SoftwareImageDecodeCacheTest_Typical,
UseClosestAvailableDecodeSecondImageSubrected) { … }
TEST_F(SoftwareImageDecodeCacheTest_Typical,
UseClosestAvailableDecodeBothSubrected) { … }
TEST_F(SoftwareImageDecodeCacheTest_Typical,
UseClosestAvailableDecodeBothPastPostScaleSize) { … }
class SoftwareImageDecodeCacheTest_AtRaster : public N32Cache,
public AtRaster,
public NoDecodeToScaleSupport,
public DefaultColorSpace { … };
TEST_F(SoftwareImageDecodeCacheTest_AtRaster, UseClosestAvailableDecode) { … }
TEST_F(SoftwareImageDecodeCacheTest_AtRaster,
UseClosestAvailableDecodeSubrected) { … }
class SoftwareImageDecodeCacheTest_ExoticColorSpace
: public N32Cache,
public Predecode,
public NoDecodeToScaleSupport,
public ExoticColorSpace { … };
TEST_F(SoftwareImageDecodeCacheTest_ExoticColorSpace,
UseClosestAvailableDecode) { … }
class SoftwareImageDecodeCacheTest_F16_ExoticColorSpace
: public RGBA_F16Cache,
public Predecode,
public NoDecodeToScaleSupportF16,
public ExoticColorSpace { … };
TEST_F(SoftwareImageDecodeCacheTest_F16_ExoticColorSpace,
UseClosestAvailableDecode_F16_ExoticColorSpace) { … }
class SoftwareImageDecodeCacheTest_F16_WideGamutCanvasColorSpace
: public RGBA_F16Cache,
public Predecode,
public NoDecodeToScaleSupportF16,
public WideGamutCanvasColorSpace { … };
TEST_F(SoftwareImageDecodeCacheTest_F16_WideGamutCanvasColorSpace,
UseClosestAvailableDecode_F16_WideGamutCanvasColorSpace) { … }
class PaintImageN32HDR : public virtual BaseTest { … };
class SoftwareImageDecodeCacheTest_N32HDR : public N32Cache,
public Predecode,
public PaintImageN32HDR,
public HdrCanvasColorSpace { … };
TEST_F(SoftwareImageDecodeCacheTest_N32HDR, DontForceF16Decode) { … }
class PaintImageF16HDR : public virtual BaseTest { … };
class SoftwareImageDecodeCacheTest_F16HDR : public N32Cache,
public Predecode,
public PaintImageF16HDR,
public HdrCanvasColorSpace { … };
TEST_F(SoftwareImageDecodeCacheTest_F16HDR, AllowF16Decode) { … }
}
}