#ifndef GrImageUtils_DEFINED
#define GrImageUtils_DEFINED
#include "include/core/SkRefCnt.h"
#include "include/core/SkSamplingOptions.h"
#include "include/core/SkYUVAPixmaps.h"
#include "src/gpu/ganesh/GrFragmentProcessor.h"
#include "src/gpu/ganesh/GrSurfaceProxyView.h"
#include "src/gpu/ganesh/SkGr.h"
#include <cstdint>
#include <memory>
#include <string_view>
#include <tuple>
class GrCaps;
class GrImageContext;
class GrRecordingContext;
class SkImage;
class SkImage_Lazy;
class SkImage_Raster;
class SkMatrix;
class SkSurfaceProps;
enum GrSurfaceOrigin : int;
enum SkAlphaType : int;
enum SkColorType : int;
enum class GrColorType;
enum class SkTileMode;
namespace skgpu { enum class Mipmapped : bool; }
struct SkRect;
namespace skgpu::ganesh {
std::tuple<GrSurfaceProxyView, GrColorType> AsView(
GrRecordingContext*,
const SkImage*,
skgpu::Mipmapped,
GrImageTexGenPolicy = GrImageTexGenPolicy::kDraw);
inline std::tuple<GrSurfaceProxyView, GrColorType> AsView(
GrRecordingContext* ctx,
const sk_sp<const SkImage>& img,
skgpu::Mipmapped mm,
GrImageTexGenPolicy policy = GrImageTexGenPolicy::kDraw) { … }
std::tuple<GrSurfaceProxyView, GrColorType> RasterAsView(
GrRecordingContext*,
const SkImage_Raster*,
skgpu::Mipmapped,
GrImageTexGenPolicy = GrImageTexGenPolicy::kDraw);
GrSurfaceProxyView CopyView(GrRecordingContext*,
GrSurfaceProxyView src,
skgpu::Mipmapped,
GrImageTexGenPolicy,
std::string_view label);
GrSurfaceProxyView LockTextureProxyView(GrRecordingContext*,
const SkImage_Lazy*,
GrImageTexGenPolicy,
skgpu::Mipmapped);
GrColorType ColorTypeOfLockTextureProxy(const GrCaps*, SkColorType);
std::unique_ptr<GrFragmentProcessor> AsFragmentProcessor(GrRecordingContext*,
const SkImage*,
SkSamplingOptions,
const SkTileMode[2],
const SkMatrix&,
const SkRect* subset = nullptr,
const SkRect* domain = nullptr);
inline std::unique_ptr<GrFragmentProcessor> AsFragmentProcessor(GrRecordingContext* ctx,
const sk_sp<const SkImage>& img,
SkSamplingOptions opt,
const SkTileMode tm[2],
const SkMatrix& m,
const SkRect* subset = nullptr,
const SkRect* domain = nullptr) { … }
std::unique_ptr<GrFragmentProcessor> MakeFragmentProcessorFromView(GrRecordingContext*,
GrSurfaceProxyView,
SkAlphaType,
SkSamplingOptions,
const SkTileMode[2],
const SkMatrix&,
const SkRect* subset,
const SkRect* domain);
GrSurfaceProxyView FindOrMakeCachedMipmappedView(GrRecordingContext*,
GrSurfaceProxyView,
uint32_t imageUniqueID);
SkYUVAPixmapInfo::SupportedDataTypes SupportedTextureFormats(const GrImageContext&);
}
namespace skif {
class Backend;
sk_sp<Backend> MakeGaneshBackend(sk_sp<GrRecordingContext> context,
GrSurfaceOrigin origin,
const SkSurfaceProps& surfaceProps,
SkColorType colorType);
}
#endif