From 55fa647596be0952464820b46724ce4f358de7f7 Mon Sep 17 00:00:00 2001 From: Greg Daniel Date: Fri, 16 Mar 2018 16:13:10 -0400 Subject: Correctly discard or load RT when doing copies as draws in Vulkan This fixes all the copy as draw issues we've had with certain devices and the cap is no longer needed. Bug: skia: Change-Id: Id0b750849c4c920beae2d8cb3eda5f402018f194 Reviewed-on: https://skia-review.googlesource.com/114860 Commit-Queue: Greg Daniel Reviewed-by: Brian Salomon --- src/gpu/GrGpu.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/gpu/GrGpu.h') diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h index 2aacc49151..16561418aa 100644 --- a/src/gpu/GrGpu.h +++ b/src/gpu/GrGpu.h @@ -345,11 +345,13 @@ public: // Called to perform a surface to surface copy. Fallbacks to issuing a draw from the src to dst // take place at the GrOpList level and this function implement faster copy paths. The rect // and point are pre-clipped. The src rect and implied dst rect are guaranteed to be within the - // src/dst bounds and non-empty. + // src/dst bounds and non-empty. If canDiscardOutsideDstRect is set to true then we don't need + // to preserve any data on the dst surface outside of the copy. bool copySurface(GrSurface* dst, GrSurfaceOrigin dstOrigin, GrSurface* src, GrSurfaceOrigin srcOrigin, const SkIRect& srcRect, - const SkIPoint& dstPoint); + const SkIPoint& dstPoint, + bool canDiscardOutsideDstRect = false); // Creates a GrGpuRTCommandBuffer which GrOpLists send draw commands to instead of directly // to the Gpu object. @@ -599,7 +601,8 @@ private: // overridden by backend specific derived class to perform the copy surface virtual bool onCopySurface(GrSurface* dst, GrSurfaceOrigin dstOrigin, GrSurface* src, GrSurfaceOrigin srcOrigin, - const SkIRect& srcRect, const SkIPoint& dstPoint) = 0; + const SkIRect& srcRect, const SkIPoint& dstPoint, + bool canDiscardOutsideDstRect) = 0; virtual void onFinishFlush(bool insertedSemaphores) = 0; -- cgit v1.2.3