aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2018-05-03 16:54:03 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-21 18:25:38 +0000
commit6d138bf681eee54a8b4a40e5dbbd08a137ae0d93 (patch)
tree7eb05a8c09ad212fc9a693296287f2b62b2f99f8 /src/gpu
parentbe3c1d22c7d3e18cee9f1697827392e16b436df2 (diff)
Reland "Remove GrBackendObject and all related functions from Skia."
This is a reland of ccd4cfc23ebbbecbc6b292359352aad335ad7b73 Original change's description: > Remove GrBackendObject and all related functions from Skia. > > Bug: skia: > Change-Id: I59434b7477c0bc26fd982bd81eb97ab94bbba073 > Reviewed-on: https://skia-review.googlesource.com/125822 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Greg Daniel <egdaniel@google.com> Bug: skia: Change-Id: Ibd1b9bd04b36840d9d872e2f0970dd6bac378bc9 Reviewed-on: https://skia-review.googlesource.com/129380 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/gl/GrGLRenderTarget.h4
-rw-r--r--src/gpu/gl/GrGLTexture.cpp6
-rw-r--r--src/gpu/gl/GrGLTexture.h3
-rw-r--r--src/gpu/mock/GrMockTexture.h15
-rw-r--r--src/gpu/mtl/GrMtlRenderTarget.h4
-rw-r--r--src/gpu/mtl/GrMtlRenderTarget.mm7
-rw-r--r--src/gpu/mtl/GrMtlTexture.h3
-rw-r--r--src/gpu/mtl/GrMtlTexture.mm7
-rw-r--r--src/gpu/vk/GrVkImage.h25
-rw-r--r--src/gpu/vk/GrVkRenderTarget.cpp9
-rw-r--r--src/gpu/vk/GrVkRenderTarget.h4
-rw-r--r--src/gpu/vk/GrVkTexture.cpp6
-rw-r--r--src/gpu/vk/GrVkTexture.h3
13 files changed, 0 insertions, 96 deletions
diff --git a/src/gpu/gl/GrGLRenderTarget.h b/src/gpu/gl/GrGLRenderTarget.h
index 4412dcf425..a9ec3c385c 100644
--- a/src/gpu/gl/GrGLRenderTarget.h
+++ b/src/gpu/gl/GrGLRenderTarget.h
@@ -61,10 +61,6 @@ public:
}
}
-#ifdef SK_SUPPORT_LEGACY_BACKEND_OBJECTS
- GrBackendObject getRenderTargetHandle() const override { return fRTFBOID; }
-#endif
-
GrBackendRenderTarget getBackendRenderTarget() const override;
bool canAttemptStencilAttachment() const override;
diff --git a/src/gpu/gl/GrGLTexture.cpp b/src/gpu/gl/GrGLTexture.cpp
index bf22bdb751..2d674f4756 100644
--- a/src/gpu/gl/GrGLTexture.cpp
+++ b/src/gpu/gl/GrGLTexture.cpp
@@ -97,12 +97,6 @@ void GrGLTexture::onAbandon() {
INHERITED::onAbandon();
}
-#ifdef SK_SUPPORT_LEGACY_BACKEND_OBJECTS
-GrBackendObject GrGLTexture::getTextureHandle() const {
- return reinterpret_cast<GrBackendObject>(&fInfo);
-}
-#endif
-
GrBackendTexture GrGLTexture::getBackendTexture() const {
return GrBackendTexture(this->width(), this->height(), this->texturePriv().mipMapped(), fInfo);
}
diff --git a/src/gpu/gl/GrGLTexture.h b/src/gpu/gl/GrGLTexture.h
index fcc85bc700..67eab4312e 100644
--- a/src/gpu/gl/GrGLTexture.h
+++ b/src/gpu/gl/GrGLTexture.h
@@ -39,9 +39,6 @@ public:
SkASSERT(!fReleaseHelper);
}
-#ifdef SK_SUPPORT_LEGACY_BACKEND_OBJECTS
- GrBackendObject getTextureHandle() const override;
-#endif
GrBackendTexture getBackendTexture() const override;
void textureParamsModified() override { fTexParams.invalidate(); }
diff --git a/src/gpu/mock/GrMockTexture.h b/src/gpu/mock/GrMockTexture.h
index 071b4f4615..24ef009229 100644
--- a/src/gpu/mock/GrMockTexture.h
+++ b/src/gpu/mock/GrMockTexture.h
@@ -31,11 +31,6 @@ public:
~GrMockTexture() override {}
-#ifdef SK_SUPPORT_LEGACY_BACKEND_OBJECTS
- GrBackendObject getTextureHandle() const override {
- return reinterpret_cast<GrBackendObject>(&fInfo);
- }
-#endif
GrBackendTexture getBackendTexture() const override {
return GrBackendTexture(this->width(), this->height(), this->texturePriv().mipMapped(),
fInfo);
@@ -120,12 +115,6 @@ public:
return {this->width(), this->height(), this->numColorSamples(), numStencilBits, fInfo};
}
-#ifdef SK_SUPPORT_LEGACY_BACKEND_OBJECTS
- GrBackendObject getRenderTargetHandle() const override {
- return reinterpret_cast<GrBackendObject>(&fInfo);
- }
-#endif
-
protected:
// constructor for subclasses
GrMockRenderTarget(GrMockGpu* gpu, const GrSurfaceDesc& desc,
@@ -160,10 +149,6 @@ public:
this->registerWithCacheWrapped();
}
-#ifdef SK_SUPPORT_LEGACY_BACKEND_OBJECTS
- GrBackendObject getRenderTargetHandle() const override { return 0; }
-#endif
-
GrTexture* asTexture() override { return this; }
GrRenderTarget* asRenderTarget() override { return this; }
const GrTexture* asTexture() const override { return this; }
diff --git a/src/gpu/mtl/GrMtlRenderTarget.h b/src/gpu/mtl/GrMtlRenderTarget.h
index c653952482..c0f0cf57e1 100644
--- a/src/gpu/mtl/GrMtlRenderTarget.h
+++ b/src/gpu/mtl/GrMtlRenderTarget.h
@@ -40,10 +40,6 @@ public:
return true;
}
-#ifdef SK_SUPPORT_LEGACY_BACKEND_OBJECTS
- GrBackendObject getRenderTargetHandle() const override;
-#endif
-
GrBackendRenderTarget getBackendRenderTarget() const override {
return GrBackendRenderTarget(); // invalid
}
diff --git a/src/gpu/mtl/GrMtlRenderTarget.mm b/src/gpu/mtl/GrMtlRenderTarget.mm
index c8060cf88c..c102e6dcfc 100644
--- a/src/gpu/mtl/GrMtlRenderTarget.mm
+++ b/src/gpu/mtl/GrMtlRenderTarget.mm
@@ -63,13 +63,6 @@ GrMtlGpu* GrMtlRenderTarget::getMtlGpu() const {
return static_cast<GrMtlGpu*>(this->getGpu());
}
-#ifdef SK_SUPPORT_LEGACY_BACKEND_OBJECTS
-GrBackendObject GrMtlRenderTarget::getRenderTargetHandle() const {
- void* voidRT = (__bridge_retained void*)fRenderTexture;
- return (GrBackendObject)voidRT;
-}
-#endif
-
void GrMtlRenderTarget::onAbandon() {
fRenderTexture = nil;
fResolveTexture = nil;
diff --git a/src/gpu/mtl/GrMtlTexture.h b/src/gpu/mtl/GrMtlTexture.h
index 21f5e13b19..f75083272a 100644
--- a/src/gpu/mtl/GrMtlTexture.h
+++ b/src/gpu/mtl/GrMtlTexture.h
@@ -26,9 +26,6 @@ public:
id<MTLTexture> mtlTexture() const { return fTexture; }
-#ifdef SK_SUPPORT_LEGACY_BACKEND_OBJECTS
- GrBackendObject getTextureHandle() const override;
-#endif
GrBackendTexture getBackendTexture() const override;
void textureParamsModified() override {}
diff --git a/src/gpu/mtl/GrMtlTexture.mm b/src/gpu/mtl/GrMtlTexture.mm
index 534eb6baf7..e029836b60 100644
--- a/src/gpu/mtl/GrMtlTexture.mm
+++ b/src/gpu/mtl/GrMtlTexture.mm
@@ -71,13 +71,6 @@ GrMtlGpu* GrMtlTexture::getMtlGpu() const {
return static_cast<GrMtlGpu*>(this->getGpu());
}
-#ifdef SK_SUPPORT_LEGACY_BACKEND_OBJECTS
-GrBackendObject GrMtlTexture::getTextureHandle() const {
- void* voidTex = (__bridge_retained void*)fTexture;
- return (GrBackendObject)voidTex;
-}
-#endif
-
GrBackendTexture GrMtlTexture::getBackendTexture() const {
return GrBackendTexture(); // invalid
}
diff --git a/src/gpu/vk/GrVkImage.h b/src/gpu/vk/GrVkImage.h
index 9e99743fe7..038b0ee86d 100644
--- a/src/gpu/vk/GrVkImage.h
+++ b/src/gpu/vk/GrVkImage.h
@@ -30,7 +30,6 @@ public:
, fLayout(std::move(layout))
, fIsBorrowed(GrBackendObjectOwnership::kBorrowed == ownership) {
SkASSERT(fLayout->getImageLayout() == fInfo.fImageLayout);
- fTempLayoutTracker = fLayout->getImageLayout();
if (fIsBorrowed) {
fResource = new BorrowedResource(info.fImage, info.fAlloc, info.fImageTiling);
} else {
@@ -52,23 +51,6 @@ public:
sk_sp<GrVkImageLayout> grVkImageLayout() const { return fLayout; }
VkImageLayout currentLayout() const {
- // This check and set is temporary since clients can still change the layout using
- // the old GrBackendObject call and we need a way to respect those changes. This only works
- // if the client isn't using GrBackendObjects and GrBackendTextures to update the layout
- // at the same time. This check and set should all be made atomic but the plan is to remove
- // the use of fInfo.fImageLayout so ignoring this issue for now.
- // TODO: Delete all this ugliness as soon as we get rid of GrBackendObject getters.
- if (fInfo.fImageLayout != fLayout->getImageLayout()) {
- if (fLayout->getImageLayout() == fTempLayoutTracker) {
- fLayout->setImageLayout(fInfo.fImageLayout);
- } else {
- SkASSERT(fInfo.fImageLayout == fTempLayoutTracker);
- *const_cast<VkImageLayout*>(&fInfo.fImageLayout) = fLayout->getImageLayout();
- }
- *const_cast<VkImageLayout*>(&fTempLayoutTracker) = fLayout->getImageLayout();
- }
- SkASSERT(fInfo.fImageLayout == fTempLayoutTracker &&
- fLayout->getImageLayout() == fTempLayoutTracker);
return fLayout->getImageLayout();
}
@@ -83,8 +65,6 @@ public:
// blit each layer, and then at the end need to update our tracking.
void updateImageLayout(VkImageLayout newLayout) {
fLayout->setImageLayout(newLayout);
- fInfo.fImageLayout = newLayout;
- fTempLayoutTracker = newLayout;
}
struct ImageDesc {
@@ -128,11 +108,6 @@ protected:
GrVkImageInfo fInfo;
sk_sp<GrVkImageLayout> fLayout;
- // This is used while we still have GrBackendObjects around that are able to change our image
- // layout without using the ref count method. This helps us determine which value has gotten out
- // of sync.
- // TODO: Delete this when get rid of a GrBackendObject getters
- VkImageLayout fTempLayoutTracker;
bool fIsBorrowed;
private:
diff --git a/src/gpu/vk/GrVkRenderTarget.cpp b/src/gpu/vk/GrVkRenderTarget.cpp
index 3cab94d7dc..9ca8a98928 100644
--- a/src/gpu/vk/GrVkRenderTarget.cpp
+++ b/src/gpu/vk/GrVkRenderTarget.cpp
@@ -352,15 +352,6 @@ void GrVkRenderTarget::onAbandon() {
}
-#ifdef SK_SUPPORT_LEGACY_BACKEND_OBJECTS
-GrBackendObject GrVkRenderTarget::getRenderTargetHandle() const {
- // If the render target is multisampled, we currently return the ImageInfo for the resolved
- // image. If we only wrap the msaa target (currently not implemented) we should return a handle
- // to that instead.
- return (GrBackendObject)&fInfo;
-}
-#endif
-
GrBackendRenderTarget GrVkRenderTarget::getBackendRenderTarget() const {
return GrBackendRenderTarget(this->width(), this->height(), this->numColorSamples(),
fInfo, this->grVkImageLayout());
diff --git a/src/gpu/vk/GrVkRenderTarget.h b/src/gpu/vk/GrVkRenderTarget.h
index ed840fc226..de2317ef06 100644
--- a/src/gpu/vk/GrVkRenderTarget.h
+++ b/src/gpu/vk/GrVkRenderTarget.h
@@ -70,10 +70,6 @@ public:
return true;
}
-#ifdef SK_SUPPORT_LEGACY_BACKEND_OBJECTS
- GrBackendObject getRenderTargetHandle() const override;
-#endif
-
GrBackendRenderTarget getBackendRenderTarget() const override;
void getAttachmentsDescriptor(GrVkRenderPass::AttachmentsDescriptor* desc,
diff --git a/src/gpu/vk/GrVkTexture.cpp b/src/gpu/vk/GrVkTexture.cpp
index c4393fdd36..116b37eddd 100644
--- a/src/gpu/vk/GrVkTexture.cpp
+++ b/src/gpu/vk/GrVkTexture.cpp
@@ -161,12 +161,6 @@ void GrVkTexture::onAbandon() {
INHERITED::onAbandon();
}
-#ifdef SK_SUPPORT_LEGACY_BACKEND_OBJECTS
-GrBackendObject GrVkTexture::getTextureHandle() const {
- return (GrBackendObject)&fInfo;
-}
-#endif
-
GrBackendTexture GrVkTexture::getBackendTexture() const {
return GrBackendTexture(this->width(), this->height(), fInfo, this->grVkImageLayout());
}
diff --git a/src/gpu/vk/GrVkTexture.h b/src/gpu/vk/GrVkTexture.h
index 79506eff9e..55239e3903 100644
--- a/src/gpu/vk/GrVkTexture.h
+++ b/src/gpu/vk/GrVkTexture.h
@@ -29,9 +29,6 @@ public:
~GrVkTexture() override;
-#ifdef SK_SUPPORT_LEGACY_BACKEND_OBJECTS
- GrBackendObject getTextureHandle() const override;
-#endif
GrBackendTexture getBackendTexture() const override;
void textureParamsModified() override {}