21#if defined(SK_GRAPHITE)
52#if defined(SK_GRAPHITE)
60#if defined(SK_GRAPHITE)
69 TestingImageProvider() : fCache(kDefaultNumCachedImages) {}
70 ~TestingImageProvider()
override {}
80 ImageKey mipMappedKey(
image,
true);
81 auto result = fCache.find(mipMappedKey);
99 result = fCache.insert(
key, std::move(newImage));
106 static constexpr int kDefaultNumCachedImages = 256;
111 uint32_t
flags = mipmapped ? 0x1 : 0x0;
113 fValues[kNumValues-1] =
flags;
117 uint32_t
hash()
const {
return fValues[0]; }
119 bool operator==(
const ImageKey& other)
const {
120 for (
int i = 0;
i < kNumValues; ++
i) {
121 if (fValues[
i] != other.fValues[
i]) {
128 bool operator!=(
const ImageKey& other)
const {
return !(*
this == other); }
133 uint32_t fValues[kNumValues];
137 size_t operator()(
const ImageKey&
key)
const {
return key.hash(); }
146 options.fImageProvider.reset(
new TestingImageProvider);
static uint32_t hash(const SkShaderBase::GradientInfo &v)
const GrCaps * caps() const
int maxTextureSize() const
virtual GrDirectContext * asDirectContext()
GrDirectContextPriv priv()
virtual GrRecordingContext * recordingContext() const
virtual skgpu::graphite::Recorder * recorder() const
FlutterSemanticsFlag flags
uint32_t Hash32(const void *data, size_t bytes, uint32_t seed)
SK_API sk_sp< SkImage > TextureFromImage(GrDirectContext *, const SkImage *, skgpu::Mipmapped=skgpu::Mipmapped::kNo, skgpu::Budgeted=skgpu::Budgeted::kYes)
sk_sp< const SkImage > image
static constexpr int kNumImageKeyValues
SK_API void GetImageKeyValues(const SkImage *image, uint32_t keyValues[kNumImageKeyValues])
bool operator==(C p1, const scoped_nsprotocol< C > &p2)
bool operator!=(C p1, const scoped_nsprotocol< C > &p2)