#include "src/gpu/ganesh/image/SkImage_Ganesh.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkImage.h"
#include "include/core/SkImageInfo.h"
#include "include/core/SkRect.h"
#include "include/core/SkSize.h"
#include "include/core/SkSurface.h"
#include "include/gpu/GpuTypes.h"
#include "include/gpu/ganesh/GrBackendSurface.h"
#include "include/gpu/ganesh/GrDirectContext.h"
#include "include/gpu/ganesh/GrRecordingContext.h"
#include "include/gpu/ganesh/GrTypes.h"
#include "include/private/base/SkAssert.h"
#include "include/private/gpu/ganesh/GrImageContext.h"
#include "include/private/gpu/ganesh/GrTypesPriv.h"
#include "src/gpu/SkBackingFit.h"
#include "src/gpu/ganesh/GrCaps.h"
#include "src/gpu/ganesh/GrColorInfo.h"
#include "src/gpu/ganesh/GrColorSpaceXform.h"
#include "src/gpu/ganesh/GrDirectContextPriv.h"
#include "src/gpu/ganesh/GrFragmentProcessor.h"
#include "src/gpu/ganesh/GrImageContextPriv.h"
#include "src/gpu/ganesh/GrImageInfo.h"
#include "src/gpu/ganesh/GrRenderTask.h"
#include "src/gpu/ganesh/GrSurfaceProxy.h"
#include "src/gpu/ganesh/GrTexture.h"
#include "src/gpu/ganesh/GrTextureProxy.h"
#include "src/gpu/ganesh/SkGr.h"
#include "src/gpu/ganesh/SurfaceContext.h"
#include "src/gpu/ganesh/SurfaceFillContext.h"
#include "src/gpu/ganesh/effects/GrTextureEffect.h"
#include "src/gpu/ganesh/image/GrImageUtils.h"
#include "src/image/SkImage_Base.h"
#include <cstddef>
#include <utility>
class SkMatrix;
enum SkColorType : int;
enum class SkTileMode;
inline SkImage_Ganesh::ProxyChooser::ProxyChooser(sk_sp<GrSurfaceProxy> stableProxy)
: … { … }
inline SkImage_Ganesh::ProxyChooser::ProxyChooser(sk_sp<GrSurfaceProxy> stableProxy,
sk_sp<GrSurfaceProxy> volatileProxy,
sk_sp<GrRenderTask> copyTask,
int volatileProxyTargetCount)
: … { … }
inline SkImage_Ganesh::ProxyChooser::~ProxyChooser() { … }
inline sk_sp<GrSurfaceProxy> SkImage_Ganesh::ProxyChooser::chooseProxy(
GrRecordingContext* context) { … }
inline sk_sp<GrSurfaceProxy> SkImage_Ganesh::ProxyChooser::switchToStableProxy() { … }
inline sk_sp<GrSurfaceProxy> SkImage_Ganesh::ProxyChooser::makeVolatileProxyStable() { … }
inline bool SkImage_Ganesh::ProxyChooser::surfaceMustCopyOnWrite(
GrSurfaceProxy* surfaceProxy) const { … }
inline size_t SkImage_Ganesh::ProxyChooser::gpuMemorySize() const { … }
inline skgpu::Mipmapped SkImage_Ganesh::ProxyChooser::mipmapped() const { … }
inline skgpu::Protected SkImage_Ganesh::ProxyChooser::isProtected() const { … }
#ifdef SK_DEBUG
inline const GrBackendFormat& SkImage_Ganesh::ProxyChooser::backendFormat() { … }
#endif
SkImage_Ganesh::SkImage_Ganesh(sk_sp<GrImageContext> context,
uint32_t uniqueID,
GrSurfaceProxyView view,
SkColorInfo info)
: … { … }
SkImage_Ganesh::SkImage_Ganesh(sk_sp<GrDirectContext> dContext,
GrSurfaceProxyView volatileSrc,
sk_sp<GrSurfaceProxy> stableCopy,
sk_sp<GrRenderTask> copyTask,
int volatileSrcTargetCount,
SkColorInfo info)
: … { … }
sk_sp<SkImage> SkImage_Ganesh::MakeWithVolatileSrc(sk_sp<GrRecordingContext> rContext,
GrSurfaceProxyView volatileSrc,
SkColorInfo colorInfo) { … }
SkImage_Ganesh::~SkImage_Ganesh() = default;
bool SkImage_Ganesh::surfaceMustCopyOnWrite(GrSurfaceProxy* surfaceProxy) const { … }
bool SkImage_Ganesh::onHasMipmaps() const { … }
bool SkImage_Ganesh::onIsProtected() const { … }
GrSemaphoresSubmitted SkImage_Ganesh::flush(GrDirectContext* dContext,
const GrFlushInfo& info) const { … }
bool SkImage_Ganesh::getExistingBackendTexture(GrBackendTexture* outTexture,
bool flushPendingGrContextIO,
GrSurfaceOrigin* origin) const { … }
size_t SkImage_Ganesh::textureSize() const { … }
sk_sp<SkImage> SkImage_Ganesh::onMakeColorTypeAndColorSpace(SkColorType targetCT,
sk_sp<SkColorSpace> targetCS,
GrDirectContext* dContext) const { … }
sk_sp<SkImage> SkImage_Ganesh::onReinterpretColorSpace(sk_sp<SkColorSpace> newCS) const { … }
void SkImage_Ganesh::onAsyncRescaleAndReadPixels(const SkImageInfo& info,
SkIRect srcRect,
RescaleGamma rescaleGamma,
RescaleMode rescaleMode,
ReadPixelsCallback callback,
ReadPixelsContext context) const { … }
void SkImage_Ganesh::onAsyncRescaleAndReadPixelsYUV420(SkYUVColorSpace yuvColorSpace,
bool readAlpha,
sk_sp<SkColorSpace> dstColorSpace,
SkIRect srcRect,
SkISize dstSize,
RescaleGamma rescaleGamma,
RescaleMode rescaleMode,
ReadPixelsCallback callback,
ReadPixelsContext context) const { … }
void SkImage_Ganesh::generatingSurfaceIsDeleted() { … }
std::tuple<GrSurfaceProxyView, GrColorType> SkImage_Ganesh::asView(
GrRecordingContext* recordingContext,
skgpu::Mipmapped mipmapped,
GrImageTexGenPolicy policy) const { … }
std::unique_ptr<GrFragmentProcessor> SkImage_Ganesh::asFragmentProcessor(
GrRecordingContext* rContext,
SkSamplingOptions sampling,
const SkTileMode tileModes[2],
const SkMatrix& m,
const SkRect* subset,
const SkRect* domain) const { … }
GrSurfaceProxyView SkImage_Ganesh::makeView(GrRecordingContext* rContext) const { … }