aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrGpu.h
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2018-03-16 16:13:10 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-16 20:54:26 +0000
commit55fa647596be0952464820b46724ce4f358de7f7 (patch)
tree16d38e728a5ad9512383a231601cc3ed31276dc6 /src/gpu/GrGpu.h
parent041e7ced7c39710ad48e78f19aa769fa4f0e33fa (diff)
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 <egdaniel@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/GrGpu.h')
-rw-r--r--src/gpu/GrGpu.h9
1 files changed, 6 insertions, 3 deletions
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;