83class RefCntedCallback;
118 fHWVertexArrayState.setVertexArrayID(
this,
id);
124 fHWVertexArrayState.notifyVertexArrayDelete(
id);
146 return fHWProgram.
get();
158 auto* attribState = fHWVertexArrayState.bindInternalVertexArray(
this, indexBuffer);
159 attribState->enableVertexArrays(
this, numAttribs, primitiveRestart);
173 bool invalidateReadBufferAfterBlit =
false);
180 this->copySurfaceAsDraw(rt,
true, rt, drawBounds, drawBounds,
210 SkISize dimensions,
int numStencilSamples)
override;
223 return fProgramCache->precompileShader(this->
getContext(), key,
data);
226#if defined(GR_TEST_UTILS)
237 void resetShaderCacheForTesting()
const override { fProgramCache->
reset(); }
248 [[nodiscard]] std::unique_ptr<GrSemaphore>
makeSemaphore(
bool isOwned)
override;
288 std::string_view label)
override;
297 std::array<float, 4>
color)
override;
304 void onResetContext(uint32_t resetBits)
override;
306 void onResetTextureBindings()
override;
313 int renderTargetSampleCnt,
317 uint32_t levelClearMask,
318 std::string_view label)
override;
325 size_t dataSize)
override;
368 std::string_view label);
382 size_t rowBytes)
override;
390 bool prepForTexSampling)
override;
396 size_t size)
override;
404 size_t rowBytes)
override;
413 bool readOrTransferPixelsFrom(
GrSurface*,
418 int rowWidthInPixels);
429 bool onRegenerateMipMapLevels(
GrTexture*)
override;
436 void setTextureUnit(
int unitIdx);
445 bool useMultisampleFBO,
454 bool onSubmitToGpu(
GrSyncCpu sync)
override;
467 ProgramCache(
int runtimeProgramCacheSize);
468 ~ProgramCache()
override;
497 void flushColorWrite(
bool writeColor);
498 void flushClearColor(std::array<float, 4>);
511 void disableWindowRectangles();
524 void disableStencil();
526 void flushConservativeRasterState(
bool enable);
528 void flushWireframeState(
bool enable);
530 void flushFramebufferSRGB(
bool enable);
537 bool uploadColorTypeTexData(
GrGLFormat textureFormat,
550 bool uploadColorToTex(
GrGLFormat textureFormat,
553 std::array<float, 4>
color,
558 void uploadTexData(
SkISize dimensions,
593 TempFBOTarget tempFBOTarget);
598#ifdef SK_ENABLE_DUMP_GPU
602 bool createCopyProgram(
GrTexture* srcTexture);
603 bool createMipmapProgram(
int progIdx);
605 std::unique_ptr<GrGLContext> fGLContext;
613 int fHWActiveTextureUnitIdx;
637 } fHWScissorSettings;
641 bool valid()
const {
return kInvalidSurfaceOrigin != fRTOrigin; }
642 void invalidate() { fRTOrigin = kInvalidSurfaceOrigin; }
643 bool knownDisabled()
const {
return this->valid() && !fWindowState.
enabled(); }
651 fRTOrigin = rtOrigin;
654 fWindowState = windowState;
659 if (!this->valid()) {
663 (fRTOrigin != rtOrigin || fWidth !=
width || fHeight !=
height)) {
666 return fWindowState == windowState;
670 enum { kInvalidSurfaceOrigin = -1 };
676 } fHWWindowRectsState;
683 class HWVertexArrayState {
685 HWVertexArrayState() : fCoreProfileVertexArray(nullptr) { this->invalidate(); }
687 ~HWVertexArrayState() {
delete fCoreProfileVertexArray; }
690 fBoundVertexArrayIDIsValid =
false;
691 fDefaultVertexArrayAttribState.invalidate();
692 if (fCoreProfileVertexArray) {
693 fCoreProfileVertexArray->invalidateCachedState();
698 if (fBoundVertexArrayIDIsValid && fBoundVertexArrayID ==
id) {
700 fBoundVertexArrayID = 0;
709 if (!fBoundVertexArrayIDIsValid || arrayID != fBoundVertexArrayID) {
711 fBoundVertexArrayIDIsValid =
true;
712 fBoundVertexArrayID = arrayID;
730 bool fBoundVertexArrayIDIsValid;
739 } fHWVertexArrayState;
753 unsigned typeAsUInt =
static_cast<unsigned>(
type);
756 return &fHWBufferState[typeAsUInt];
765 void flush(
FlushType flushType = FlushType::kIfRequired);
767 void setNeedsFlush() { fNeedsGLFlush =
true; }
786 TriState fHWConservativeRasterEnabled;
788 TriState fHWWireframeEnabled;
792 TriState fHWStencilTestEnabled;
794 TriState fHWWriteToColor;
796 bool fHWBoundFramebufferIsMSAA;
797 TriState fHWSRGBFramebuffer;
799 class TextureUnitBindings {
801 TextureUnitBindings() =
default;
802 TextureUnitBindings(
const TextureUnitBindings&) =
delete;
803 TextureUnitBindings& operator=(
const TextureUnitBindings&) =
delete;
809 void invalidateAllTargets(
bool markUnmodified);
812 struct TargetBinding {
814 bool fHasBeenModified =
false;
816 TargetBinding fTargetBindings[3];
838 } fMipmapPrograms[4];
843 static int TextureSizeToMipmapProgramIdx(
int width,
int height) {
846 return (wide ? 0x2 : 0x0) | (tall ? 0x1 : 0x0);
853 class SamplerObjectCache;
854 std::unique_ptr<SamplerObjectCache> fSamplerObjectCache;
856 std::unique_ptr<GrGLOpsRenderPass> fCachedOpsRenderPass;
858 std::unique_ptr<GrStagingBufferManager> fStagingBufferManager;
865 bool fNeedsGLFlush =
false;
867 SkDEBUGCODE(
bool fIsExecutingCommandBuffer_DebugOnly =
false;)
869 friend class GrGLPathRendering;
#define GR_GL_TEXTURE_NONE
struct __GLsync * GrGLsync
#define GR_GL_CALL(IFACE, X)
static constexpr GrGLenum GrGLFormatToEnum(GrGLFormat format)
static const constexpr int kGrGpuBufferTypeCount
@ kTopLeft_GrSurfaceOrigin
void * GrGpuFinishedContext
void(* GrGpuFinishedProc)(GrGpuFinishedContext finishedContext)
#define INHERITED(method,...)
SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID()
static constexpr bool SkToBool(const T &x)
const GrShaderCaps * shaderCaps() const
bool vertexArrayObjectSupport() const
Is there support for Vertex Array Objects?
GrGLStandard glStandard() const
void flushScissorRect(const SkIRect &scissor, int rtHeight, GrSurfaceOrigin)
const GrGLCaps & glCaps() const
void clear(const GrScissorState &, std::array< float, 4 > color, GrRenderTarget *, bool useMultisampleFBO, GrSurfaceOrigin)
GrThreadSafePipelineBuilder * pipelineBuilder() override
void invalidateBoundRenderTarget()
skgpu::BlendEquation fEquation
void deleteSync(GrGLsync)
void bindVertexArray(GrGLuint id)
void clearErrorsAndCheckForOOM()
void bindTexture(int unitIdx, GrSamplerState samplerState, const skgpu::Swizzle &, GrGLTexture *)
void bindFramebuffer(GrGLenum fboTarget, GrGLuint fboid)
void deleteBackendTexture(const GrBackendTexture &) override
sk_sp< GrAttachment > makeMSAAAttachment(SkISize dimensions, const GrBackendFormat &format, int numSamples, GrProtected isProtected, GrMemoryless) override
void clearStencilClip(const GrScissorState &, bool insideStencilMask, GrRenderTarget *, bool useMultisampleFBO, GrSurfaceOrigin)
sk_sp< GrAttachment > makeStencilAttachment(const GrBackendFormat &colorFormat, SkISize dimensions, int numStencilSamples) override
GrGpuResource::UniqueID fBoundBufferUniqueID
void notifyVertexArrayDelete(GrGLuint id)
GrGLProgram * currentProgram()
GrGLenum prepareToDraw(GrPrimitiveType primitiveType)
const GrGLInterface * glInterface() const
void flushProgram(sk_sp< GrGLProgram >)
void didDrawTo(GrRenderTarget *)
GrStagingBufferManager * stagingBufferManager() override
GrGLenum bindBuffer(GrGpuBufferType type, const GrBuffer *)
void deleteFramebuffer(GrGLuint fboid)
skgpu::BlendCoeff fDstCoeff
void finishOutstandingGpuWork() override
void resolveRenderFBOs(GrGLRenderTarget *, const SkIRect &resolveRect, ResolveDirection, bool invalidateReadBufferAfterBlit=false)
void beginCommandBuffer(GrGLRenderTarget *, bool useMultisampleFBO, const SkIRect &bounds, GrSurfaceOrigin, const GrOpsRenderPass::LoadAndStoreInfo &colorLoadStore, const GrOpsRenderPass::StencilLoadAndStoreInfo &stencilLoadStore)
bool compile(const GrProgramDesc &, const GrProgramInfo &) override
void flushViewport(const SkIRect &viewport, int rtHeight, GrSurfaceOrigin)
bool flushGLState(GrRenderTarget *, bool useMultisampleFBO, const GrProgramInfo &)
void checkFinishProcs() override
void deleteFence(GrGLsync)
SkSL::GLSLGeneration glslGeneration() const
sk_sp< GrThreadSafePipelineBuilder > refPipelineBuilder() override
GrGLint fTexCoordXformUniform
void disconnect(DisconnectType) override
GrGLVersion glVersion() const
void drawSingleIntoMSAAFBO(GrGLRenderTarget *rt, const SkIRect &drawBounds)
std::unique_ptr< GrSemaphore > makeSemaphore(bool isOwned) override
std::unique_ptr< GrSemaphore > wrapBackendSemaphore(const GrBackendSemaphore &, GrSemaphoreWrapType, GrWrapOwnership) override
void insertSemaphore(GrSemaphore *semaphore) override
void endCommandBuffer(GrGLRenderTarget *, bool useMultisampleFBO, const GrOpsRenderPass::LoadAndStoreInfo &colorLoadStore, const GrOpsRenderPass::StencilLoadAndStoreInfo &stencilLoadStore)
std::unique_ptr< GrSemaphore > prepareTextureForCrossContextUsage(GrTexture *) override
void waitSemaphore(GrSemaphore *semaphore) override
GrGLenum getErrorAndCheckForOOM()
void submit(GrOpsRenderPass *renderPass) override
const GrGLContextInfo & ctxInfo() const
skgpu::BlendCoeff fSrcCoeff
GrGLAttribArrayState * bindInternalVertexArray(const GrBuffer *indexBuffer, int numAttribs, GrPrimitiveRestart primitiveRestart)
void willExecute() override
static std::unique_ptr< GrGpu > Make(sk_sp< const GrGLInterface >, const GrContextOptions &, GrDirectContext *)
const GrGLContext & glContext() const
bool fBufferZeroKnownBound
bool precompileShader(const SkData &key, const SkData &data) override
const GrCaps * caps() const
GrDirectContext * getContext()
GrGpu(GrDirectContext *direct)
void handleDirtyContext()
const SkIRect & rect() const
void reset(T *ptr=nullptr)
uint32_t uint32_t * format
uint32_t Hash32(const void *data, size_t bytes, uint32_t seed)
Optional< SkRect > bounds
sk_sp< SkBlender > blender SkRect rect
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not set
def timeout(deadline, cmd)
std::shared_ptr< const fml::Mapping > data