#include "src/gpu/graphite/Surface_Graphite.h"
#include "include/core/SkCapabilities.h"
#include "include/core/SkColorSpace.h"
#include "include/gpu/graphite/BackendTexture.h"
#include "include/gpu/graphite/Recorder.h"
#include "include/gpu/graphite/Surface.h"
#include "src/core/SkSurfacePriv.h"
#include "src/gpu/RefCntedCallback.h"
#include "src/gpu/SkBackingFit.h"
#include "src/gpu/graphite/Caps.h"
#include "src/gpu/graphite/Device.h"
#include "src/gpu/graphite/Image_Graphite.h"
#include "src/gpu/graphite/Log.h"
#include "src/gpu/graphite/RecorderPriv.h"
#include "src/gpu/graphite/ResourceProvider.h"
#include "src/gpu/graphite/Texture.h"
namespace skgpu::graphite {
Surface::Surface(sk_sp<Device> device)
: … { … }
Surface::~Surface() { … }
SkImageInfo Surface::imageInfo() const { … }
Recorder* Surface::onGetRecorder() const { … }
TextureProxyView Surface::readSurfaceView() const { … }
SkCanvas* Surface::onNewCanvas() { … }
sk_sp<SkSurface> Surface::onNewSurface(const SkImageInfo& ii) { … }
sk_sp<SkImage> Surface::onNewImageSnapshot(const SkIRect* subset) { … }
sk_sp<Image> Surface::asImage() const { … }
sk_sp<Image> Surface::makeImageCopy(const SkIRect* subset, Mipmapped mipmapped) const { … }
void Surface::onWritePixels(const SkPixmap& pixmap, int x, int y) { … }
bool Surface::onCopyOnWrite(ContentChangeMode) { … }
void Surface::onAsyncRescaleAndReadPixels(const SkImageInfo& info,
SkIRect srcRect,
RescaleGamma rescaleGamma,
RescaleMode rescaleMode,
ReadPixelsCallback callback,
ReadPixelsContext context) { … }
void Surface::onAsyncRescaleAndReadPixelsYUV420(SkYUVColorSpace yuvColorSpace,
bool readAlpha,
sk_sp<SkColorSpace> dstColorSpace,
SkIRect srcRect,
SkISize dstSize,
RescaleGamma rescaleGamma,
RescaleMode rescaleMode,
ReadPixelsCallback callback,
ReadPixelsContext context) { … }
sk_sp<const SkCapabilities> Surface::onCapabilities() { … }
TextureProxy* Surface::backingTextureProxy() const { … }
sk_sp<Surface> Surface::Make(Recorder* recorder,
const SkImageInfo& info,
std::string_view label,
Budgeted budgeted,
Mipmapped mipmapped,
SkBackingFit backingFit,
const SkSurfaceProps* props,
LoadOp initialLoadOp,
bool registerWithRecorder) { … }
void Flush(sk_sp<SkSurface> surface) { … }
void Flush(SkSurface* surface) { … }
}
usingnamespaceskgpu::graphite;
namespace {
bool validate_backend_texture(const Caps* caps,
const BackendTexture& texture,
const SkColorInfo& info) { … }
}
namespace SkSurfaces {
sk_sp<SkImage> AsImage(sk_sp<const SkSurface> surface) { … }
sk_sp<SkImage> AsImageCopy(sk_sp<const SkSurface> surface,
const SkIRect* subset,
skgpu::Mipmapped mipmapped) { … }
sk_sp<SkSurface> RenderTarget(Recorder* recorder,
const SkImageInfo& info,
skgpu::Mipmapped mipmapped,
const SkSurfaceProps* props,
std::string_view label) { … }
sk_sp<SkSurface> WrapBackendTexture(Recorder* recorder,
const BackendTexture& backendTex,
SkColorType ct,
sk_sp<SkColorSpace> cs,
const SkSurfaceProps* props,
TextureReleaseProc releaseP,
ReleaseContext releaseC,
std::string_view label) { … }
}