diff --git a/docs/SkSurface_Reference.bmh b/docs/SkSurface_Reference.bmh index e9c520106b..d3fb13529f 100644 --- a/docs/SkSurface_Reference.bmh +++ b/docs/SkSurface_Reference.bmh @@ -989,7 +989,7 @@ Caller must overwrite the entire back-end object. canvas->drawString(str, 20, y += 20, paint); ## -#SeeAlso getTextureHandle getRenderTargetHandle +#SeeAlso getTextureHandle #Enum ## @@ -1032,58 +1032,7 @@ or when Surface is deleted. } ## -#SeeAlso getRenderTargetHandle GrBackendObject BackendHandleAccess - -#Method ## - -# ------------------------------------------------------------------------------ - -#Method bool getRenderTargetHandle(GrBackendObject* backendObject, - BackendHandleAccess backendHandleAccess) -#In Property -#Line # returns the GPU reference to render target ## - -Returns true and stores the GPU back-end reference of the render target used -by Surface in backendObject. - -Return false if Surface is not backed by a GPU render target, and leaves -backendObject unchanged. - -The returned render target handle is only valid until the next draw into Surface, -or when Surface is deleted. - -In OpenGL this returns the frame buffer object ID. - -#Param backendObject GPU intermediate memory buffer ## -#Param backendHandleAccess one of: kFlushRead_BackendHandleAccess, - kFlushWrite_BackendHandleAccess, kDiscardWrite_BackendHandleAccess -## - -#Return true if Surface is backed by GPU texture ## - -#Example -#Platform gpu -#Height 64 - SkPaint paint; - paint.setTextSize(32); - GrContext* context = canvas->getGrContext(); - if (!context) { - canvas->drawString("GPU only!", 20, 40, paint); - return; - } - sk_sp gpuSurface = SkSurface::MakeRenderTarget( - context, SkBudgeted::kYes, SkImageInfo::MakeN32Premul(10, 10)); - GrBackendObject backendObject; - if (gpuSurface->getRenderTargetHandle(&backendObject, - SkSurface::kFlushRead_BackendHandleAccess)) { - SkString str; - str.printf("backendObject=%ld", backendObject); - paint.setTextSize(16); - canvas->drawString(str, 20, 40, paint); - } -## - -#SeeAlso getTextureHandle GrBackendObject BackendHandleAccess +#SeeAlso GrBackendObject BackendHandleAccess #Method ## diff --git a/include/core/SkSurface.h b/include/core/SkSurface.h index fb0a3685d7..e071ec4494 100644 --- a/include/core/SkSurface.h +++ b/include/core/SkSurface.h @@ -440,25 +440,6 @@ public: @return GPU texture reference */ GrBackendObject getTextureHandle(BackendHandleAccess backendHandleAccess); - - /** Returns true and stores the GPU back-end reference of the render target used - by SkSurface in backendObject. - - Return false if SkSurface is not backed by a GPU render target, and leaves - backendObject unchanged. - - The returned render target handle is only valid until the next draw into SkSurface, - or when SkSurface is deleted. - - In OpenGL this returns the frame buffer object ID. - - @param backendObject GPU intermediate memory buffer - @param backendHandleAccess one of: kFlushRead_BackendHandleAccess, - kFlushWrite_BackendHandleAccess, kDiscardWrite_BackendHandleAccess - @return true if SkSurface is backed by GPU texture - */ - bool getRenderTargetHandle(GrBackendObject* backendObject, - BackendHandleAccess backendHandleAccess); #endif /** Retrieves the backend texture. If Surface has no backend texture, an invalid diff --git a/include/gpu/GrRenderTarget.h b/include/gpu/GrRenderTarget.h index 1c86eaa374..784e15f8b0 100644 --- a/include/gpu/GrRenderTarget.h +++ b/include/gpu/GrRenderTarget.h @@ -99,14 +99,6 @@ public: }; virtual ResolveType getResolveType() const = 0; -#ifdef SK_SUPPORT_LEGACY_BACKEND_OBJECTS - /** - * Return the native ID or handle to the rendertarget, depending on the - * platform. e.g. on OpenGL, return the FBO ID. - */ - virtual GrBackendObject getRenderTargetHandle() const = 0; -#endif - virtual GrBackendRenderTarget getBackendRenderTarget() const = 0; // Checked when this object is asked to attach a stencil buffer. 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/mock/GrMockTexture.h b/src/gpu/mock/GrMockTexture.h index 071b4f4615..571b9cafd6 100644 --- a/src/gpu/mock/GrMockTexture.h +++ b/src/gpu/mock/GrMockTexture.h @@ -120,12 +120,6 @@ public: return {this->width(), this->height(), this->numColorSamples(), numStencilBits, fInfo}; } -#ifdef SK_SUPPORT_LEGACY_BACKEND_OBJECTS - GrBackendObject getRenderTargetHandle() const override { - return reinterpret_cast(&fInfo); - } -#endif - protected: // constructor for subclasses GrMockRenderTarget(GrMockGpu* gpu, const GrSurfaceDesc& desc, @@ -160,10 +154,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(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/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/image/SkSurface.cpp b/src/image/SkSurface.cpp index 73f3175ab9..f779d2d3d3 100644 --- a/src/image/SkSurface.cpp +++ b/src/image/SkSurface.cpp @@ -222,10 +222,6 @@ void SkSurface::writePixels(const SkBitmap& src, int x, int y) { GrBackendObject SkSurface::getTextureHandle(BackendHandleAccess access) { return asSB(this)->onGetTextureHandle(access); } - -bool SkSurface::getRenderTargetHandle(GrBackendObject* obj, BackendHandleAccess access) { - return asSB(this)->onGetRenderTargetHandle(obj, access); -} #endif GrBackendTexture SkSurface::getBackendTexture(BackendHandleAccess access) { diff --git a/src/image/SkSurface_Base.h b/src/image/SkSurface_Base.h index 90bcdff1dd..f4230d37d4 100644 --- a/src/image/SkSurface_Base.h +++ b/src/image/SkSurface_Base.h @@ -23,10 +23,6 @@ public: virtual GrBackendObject onGetTextureHandle(BackendHandleAccess) { return 0; } - - virtual bool onGetRenderTargetHandle(GrBackendObject*, BackendHandleAccess) { - return false; - } #endif virtual GrBackendTexture onGetBackendTexture(BackendHandleAccess); diff --git a/src/image/SkSurface_Gpu.cpp b/src/image/SkSurface_Gpu.cpp index e9ae9104e2..892e15b690 100644 --- a/src/image/SkSurface_Gpu.cpp +++ b/src/image/SkSurface_Gpu.cpp @@ -63,15 +63,6 @@ GrBackendObject SkSurface_Gpu::onGetTextureHandle(BackendHandleAccess access) { } return 0; } - -bool SkSurface_Gpu::onGetRenderTargetHandle(GrBackendObject* obj, BackendHandleAccess access) { - GrRenderTarget* rt = prepare_rt_for_external_access(this, access); - if (!rt) { - return false; - } - *obj = rt->getRenderTargetHandle(); - return true; -} #endif GrBackendTexture SkSurface_Gpu::onGetBackendTexture(BackendHandleAccess access) { diff --git a/src/image/SkSurface_Gpu.h b/src/image/SkSurface_Gpu.h index fc014c2cd2..35ad823625 100644 --- a/src/image/SkSurface_Gpu.h +++ b/src/image/SkSurface_Gpu.h @@ -25,7 +25,6 @@ public: #ifdef SK_SUPPORT_LEGACY_BACKEND_OBJECTS GrBackendObject onGetTextureHandle(BackendHandleAccess) override; - bool onGetRenderTargetHandle(GrBackendObject*, BackendHandleAccess) override; #endif GrBackendTexture onGetBackendTexture(BackendHandleAccess) override;