#include "src/gpu/ganesh/surface/SkSurface_Ganesh.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkColorType.h"
#include "include/core/SkImage.h"
#include "include/core/SkRect.h"
#include "include/core/SkSize.h"
#include "include/core/SkSurface.h"
#include "include/core/SkSurfaceProps.h"
#include "include/gpu/GpuTypes.h"
#include "include/gpu/ganesh/GrBackendSurface.h"
#include "include/gpu/ganesh/GrContextThreadSafeProxy.h"
#include "include/gpu/ganesh/GrDirectContext.h"
#include "include/gpu/ganesh/GrRecordingContext.h"
#include "include/gpu/ganesh/GrTypes.h"
#include "include/gpu/ganesh/SkSurfaceGanesh.h"
#include "include/private/base/SkTo.h"
#include "include/private/chromium/GrDeferredDisplayList.h"
#include "include/private/chromium/GrSurfaceCharacterization.h"
#include "include/private/gpu/ganesh/GrTypesPriv.h"
#include "src/core/SkDevice.h"
#include "src/core/SkSurfacePriv.h"
#include "src/gpu/RefCntedCallback.h"
#include "src/gpu/SkBackingFit.h"
#include "src/gpu/SkRenderEngineAbortf.h"
#include "src/gpu/ganesh/Device.h"
#include "src/gpu/ganesh/GrCaps.h"
#include "src/gpu/ganesh/GrContextThreadSafeProxyPriv.h"
#include "src/gpu/ganesh/GrDirectContextPriv.h"
#include "src/gpu/ganesh/GrGpuResourcePriv.h"
#include "src/gpu/ganesh/GrProxyProvider.h"
#include "src/gpu/ganesh/GrRecordingContextPriv.h"
#include "src/gpu/ganesh/GrRenderTarget.h"
#include "src/gpu/ganesh/GrRenderTargetProxy.h"
#include "src/gpu/ganesh/GrSurfaceProxy.h"
#include "src/gpu/ganesh/GrSurfaceProxyPriv.h"
#include "src/gpu/ganesh/GrSurfaceProxyView.h"
#include "src/gpu/ganesh/GrTexture.h"
#include "src/gpu/ganesh/GrTextureProxy.h"
#include "src/gpu/ganesh/image/SkImage_Ganesh.h"
#include "src/image/SkImage_Base.h"
#ifdef SK_IN_RENDERENGINE
#include "include/gpu/ganesh/gl/GrGLBackendSurface.h"
#include "include/gpu/ganesh/gl/GrGLTypes.h"
#endif
#include <algorithm>
#include <cstddef>
#include <utility>
class GrBackendSemaphore;
class SkCapabilities;
class SkPaint;
class SkPixmap;
SkSurface_Ganesh::SkSurface_Ganesh(sk_sp<skgpu::ganesh::Device> device)
: … { … }
SkSurface_Ganesh::~SkSurface_Ganesh() { … }
GrRecordingContext* SkSurface_Ganesh::onGetRecordingContext() const { … }
skgpu::ganesh::Device* SkSurface_Ganesh::getDevice() { … }
SkImageInfo SkSurface_Ganesh::imageInfo() const { … }
static GrRenderTarget* prepare_rt_for_external_access(SkSurface_Ganesh* surface,
SkSurfaces::BackendHandleAccess access) { … }
GrBackendTexture SkSurface_Ganesh::getBackendTexture(BackendHandleAccess access) { … }
GrBackendRenderTarget SkSurface_Ganesh::getBackendRenderTarget(BackendHandleAccess access) { … }
SkCanvas* SkSurface_Ganesh::onNewCanvas() { … }
sk_sp<SkSurface> SkSurface_Ganesh::onNewSurface(const SkImageInfo& info) { … }
sk_sp<SkImage> SkSurface_Ganesh::onNewImageSnapshot(const SkIRect* subset) { … }
void SkSurface_Ganesh::onWritePixels(const SkPixmap& src, int x, int y) { … }
void SkSurface_Ganesh::onAsyncRescaleAndReadPixels(const SkImageInfo& info,
SkIRect srcRect,
RescaleGamma rescaleGamma,
RescaleMode rescaleMode,
ReadPixelsCallback callback,
ReadPixelsContext context) { … }
void SkSurface_Ganesh::onAsyncRescaleAndReadPixelsYUV420(SkYUVColorSpace yuvColorSpace,
bool readAlpha,
sk_sp<SkColorSpace> dstColorSpace,
SkIRect srcRect,
SkISize dstSize,
RescaleGamma rescaleGamma,
RescaleMode rescaleMode,
ReadPixelsCallback callback,
ReadPixelsContext context) { … }
bool SkSurface_Ganesh::onCopyOnWrite(ContentChangeMode mode) { … }
void SkSurface_Ganesh::onDiscard() { … }
void SkSurface_Ganesh::resolveMSAA() { … }
bool SkSurface_Ganesh::onWait(int numSemaphores,
const GrBackendSemaphore* waitSemaphores,
bool deleteSemaphoresAfterWait) { … }
bool SkSurface_Ganesh::onCharacterize(GrSurfaceCharacterization* characterization) const { … }
void SkSurface_Ganesh::onDraw(SkCanvas* canvas,
SkScalar x,
SkScalar y,
const SkSamplingOptions& sampling,
const SkPaint* paint) { … }
bool SkSurface_Ganesh::onIsCompatible(const GrSurfaceCharacterization& characterization) const { … }
bool SkSurface_Ganesh::draw(sk_sp<const GrDeferredDisplayList> ddl) { … }
sk_sp<const SkCapabilities> SkSurface_Ganesh::onCapabilities() { … }
static bool validate_backend_texture(const GrCaps* caps,
const GrBackendTexture& tex,
int sampleCnt,
GrColorType grCT,
bool texturable) { … }
bool SkSurface_Ganesh::replaceBackendTexture(const GrBackendTexture& backendTexture,
GrSurfaceOrigin origin,
ContentChangeMode mode,
TextureReleaseProc releaseProc,
ReleaseContext releaseContext) { … }
bool validate_backend_render_target(const GrCaps* caps,
const GrBackendRenderTarget& rt,
GrColorType grCT) { … }
namespace SkSurfaces {
sk_sp<SkSurface> RenderTarget(GrRecordingContext* rContext,
const GrSurfaceCharacterization& c,
skgpu::Budgeted budgeted) { … }
sk_sp<SkSurface> RenderTarget(GrRecordingContext* rContext,
skgpu::Budgeted budgeted,
const SkImageInfo& info,
int sampleCount,
GrSurfaceOrigin origin,
const SkSurfaceProps* props,
bool shouldCreateWithMips,
bool isProtected) { … }
sk_sp<SkSurface> WrapBackendTexture(GrRecordingContext* rContext,
const GrBackendTexture& tex,
GrSurfaceOrigin origin,
int sampleCnt,
SkColorType colorType,
sk_sp<SkColorSpace> colorSpace,
const SkSurfaceProps* props,
TextureReleaseProc textureReleaseProc,
ReleaseContext releaseContext) { … }
sk_sp<SkSurface> WrapBackendRenderTarget(GrRecordingContext* rContext,
const GrBackendRenderTarget& rt,
GrSurfaceOrigin origin,
SkColorType colorType,
sk_sp<SkColorSpace> colorSpace,
const SkSurfaceProps* props,
RenderTargetReleaseProc relProc,
ReleaseContext releaseContext) { … }
GrBackendTexture GetBackendTexture(SkSurface* surface, BackendHandleAccess access) { … }
GrBackendRenderTarget GetBackendRenderTarget(SkSurface* surface, BackendHandleAccess access) { … }
void ResolveMSAA(SkSurface* surface) { … }
}
namespace skgpu::ganesh {
GrSemaphoresSubmitted Flush(SkSurface* surface) { … }
GrSemaphoresSubmitted Flush(sk_sp<SkSurface> surface) { … }
void FlushAndSubmit(SkSurface* surface) { … }
void FlushAndSubmit(sk_sp<SkSurface> surface) { … }
}