Remove handleDirtyContext calls from backends for which they don't make sense

and add a default implementation of onResetContext (which only the GL backend implements)

Change-Id: I20bb4cd2a60dba3200fc8ef4c9e4fd6a9f54ceef
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/359497
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This commit is contained in:
Robert Phillips 2021-01-26 13:03:39 -05:00 committed by Skia Commit-Bot
parent 68c77d4ae7
commit 15f6d744a6
8 changed files with 1 additions and 19 deletions

View File

@ -787,7 +787,7 @@ private:
// called when the 3D context state is unknown. Subclass should emit any
// assumed 3D context state and dirty any state cache.
virtual void onResetContext(uint32_t resetBits) = 0;
virtual void onResetContext(uint32_t resetBits) {}
// Implementation of resetTextureBindings.
virtual void onResetTextureBindings() {}

View File

@ -1013,8 +1013,6 @@ GrBackendTexture GrD3DGpu::onCreateBackendTexture(SkISize dimensions,
GrRenderable renderable,
GrMipmapped mipMapped,
GrProtected isProtected) {
this->handleDirtyContext();
const GrD3DCaps& caps = this->d3dCaps();
if (this->protectedContext() != (isProtected == GrProtected::kYes)) {
@ -1222,8 +1220,6 @@ GrBackendRenderTarget GrD3DGpu::createTestingOnlyBackendRenderTarget(SkISize dim
GrColorType colorType,
int sampleCnt,
GrProtected isProtected) {
this->handleDirtyContext();
if (dimensions.width() > this->caps()->maxRenderTargetSize() ||
dimensions.height() > this->caps()->maxRenderTargetSize()) {
return {};

View File

@ -130,8 +130,6 @@ private:
void destroyResources();
void onResetContext(uint32_t resetBits) override {}
sk_sp<GrTexture> onCreateTexture(SkISize,
const GrBackendFormat&,
GrRenderable,

View File

@ -107,8 +107,6 @@ public:
private:
GrDawnGpu(GrDirectContext*, const GrContextOptions&, const wgpu::Device&);
void onResetContext(uint32_t resetBits) override {}
virtual void querySampleLocations(GrRenderTarget*, SkTArray<SkPoint>*) override {}
sk_sp<GrTexture> onCreateTexture(SkISize,

View File

@ -50,8 +50,6 @@ public:
private:
GrMockGpu(GrDirectContext*, const GrMockOptions&, const GrContextOptions&);
void onResetContext(uint32_t resetBits) override {}
void querySampleLocations(GrRenderTarget*, SkTArray<SkPoint>* sampleLocations) override;
void xferBarrier(GrRenderTarget*, GrXferBarrierType) override {}

View File

@ -116,8 +116,6 @@ private:
void destroyResources();
void onResetContext(uint32_t resetBits) override {}
void querySampleLocations(GrRenderTarget*, SkTArray<SkPoint>*) override {
SkASSERT(!this->caps()->sampleLocationsSupport());
SK_ABORT("Sample locations not yet implemented for Metal.");

View File

@ -1753,8 +1753,6 @@ GrBackendTexture GrVkGpu::onCreateBackendTexture(SkISize dimensions,
GrRenderable renderable,
GrMipmapped mipMapped,
GrProtected isProtected) {
this->handleDirtyContext();
const GrVkCaps& caps = this->vkCaps();
if (fProtectedContext != isProtected) {
@ -2029,8 +2027,6 @@ GrBackendRenderTarget GrVkGpu::createTestingOnlyBackendRenderTarget(SkISize dime
GrColorType ct,
int sampleCnt,
GrProtected isProtected) {
this->handleDirtyContext();
if (dimensions.width() > this->caps()->maxRenderTargetSize() ||
dimensions.height() > this->caps()->maxRenderTargetSize()) {
return {};

View File

@ -198,8 +198,6 @@ private:
sk_sp<const GrVkInterface>, uint32_t instanceVersion, uint32_t physicalDeviceVersion,
sk_sp<GrVkMemoryAllocator>);
void onResetContext(uint32_t resetBits) override {}
void destroyResources();
GrBackendTexture onCreateBackendTexture(SkISize dimensions,