23 static std::atomic<uint32_t> nextID{1};
26 id = nextID.fetch_add(1, std::memory_order_relaxed);
40 fCaps = std::move(caps);
41 fTextBlobRedrawCoordinator =
42 std::make_unique<sktext::gpu::TextBlobRedrawCoordinator>(fContextID);
43 fThreadSafeCache = std::make_unique<GrThreadSafeCache>();
44 fPipelineBuilder = std::move(pipelineBuilder);
48 size_t cacheMaxResourceBytes,
58 bool vkRTSupportsInputAttachment,
59 bool forVulkanSecondaryCommandBuffer) {
73 (vkRTSupportsInputAttachment || forVulkanSecondaryCommandBuffer)) {
101 if (willUseGLFBO0 && isTextureable) {
115 vkRTSupportsInputAttachment,
116 forVulkanSecondaryCommandBuffer)) {
122 sk_ref_sp<GrContextThreadSafeProxy>(
this),
123 cacheMaxResourceBytes,
142 bool vkRTSupportsInputAttachment,
143 bool forVulkanSecondaryCommandBuffer) {
180void GrContextThreadSafeProxy::abandonContext() {
181 if (!fAbandoned.exchange(
true)) {
182 fTextBlobRedrawCoordinator->freeAll();
186bool GrContextThreadSafeProxy::abandoned()
const {
static uint32_t next_id()
static constexpr GrColorType SkColorTypeToGrColorType(SkColorType ct)
static SkColorType colorType(AImageDecoder *decoder, const AImageDecoderHeaderInfo *headerInfo)
static constexpr uint32_t SK_InvalidGenID
bool mipmapSupport() const
virtual bool isFormatTexturable(const GrBackendFormat &, GrTextureType) const =0
virtual int maxRenderTargetSampleCount(const GrBackendFormat &) const =0
virtual GrBackendFormat getBackendFormatFromCompressionType(SkTextureCompressionType) const =0
int maxRenderTargetSize() const
bool areColorTypeAndFormatCompatible(GrColorType grCT, const GrBackendFormat &format) const
GrBackendFormat getDefaultBackendFormat(GrColorType, GrRenderable) const
virtual bool isFormatAsColorTypeRenderable(GrColorType ct, const GrBackendFormat &format, int sampleCount=1) const =0
virtual int getRenderTargetSampleCount(int requestedCount, const GrBackendFormat &) const =0
GrBackend backend() const
const GrContextOptions & options() const
static sk_sp< GrContextThreadSafeProxy > Make(GrBackendApi, const GrContextOptions &)
friend class GrContextThreadSafeProxy
void init(sk_sp< const GrCaps >, sk_sp< GrThreadSafePipelineBuilder >) const
const GrCaps * caps() const
virtual ~GrContextThreadSafeProxy()
virtual bool isValidCharacterizationForVulkan(sk_sp< const GrCaps >, bool isTextureable, skgpu::Mipmapped isMipmapped, skgpu::Protected isProtected, bool vkRTSupportsInputAttachment, bool forVulkanSecondaryCommandBuffer)
int maxSurfaceSampleCountForColorType(SkColorType colorType) const
GrBackendFormat compressedBackendFormat(SkTextureCompressionType c) const
GrSurfaceCharacterization createCharacterization(size_t cacheMaxResourceBytes, const SkImageInfo &ii, const GrBackendFormat &backendFormat, int sampleCount, GrSurfaceOrigin origin, const SkSurfaceProps &surfaceProps, skgpu::Mipmapped isMipmapped, bool willUseGLFBO0=false, bool isTextureable=true, skgpu::Protected isProtected=GrProtected::kNo, bool vkRTSupportsInputAttachment=false, bool forVulkanSecondaryCommandBuffer=false)
GrBackendFormat defaultBackendFormat(SkColorType ct, GrRenderable renderable) const
GrContextThreadSafeProxy(GrBackendApi, const GrContextOptions &)
VkRTSupportsInputAttachment
VulkanSecondaryCBCompatible
uint32_t uint32_t * format
SkColorType colorType() const