aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2018-05-03 15:28:58 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-03 20:13:02 +0000
commitba2c826038a77046b99b9d2583e2eae70087ceed (patch)
treee33bb5afe218bccc5f0b64c402595be5dd94314f
parent3288d63918da3387e2e5fe4900fd7d30d4184ecb (diff)
Implement canCopySurface for GrMock and GrMtl.
Bug: skia: Change-Id: I60730bacb03b43e872c68fd7eb8e845ac0910f67 Reviewed-on: https://skia-review.googlesource.com/125730 Commit-Queue: Greg Daniel <egdaniel@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com> Auto-Submit: Greg Daniel <egdaniel@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
-rw-r--r--include/gpu/GrCaps.h6
-rw-r--r--src/gpu/mock/GrMockCaps.h5
-rw-r--r--src/gpu/mtl/GrMtlCaps.h5
3 files changed, 12 insertions, 4 deletions
diff --git a/include/gpu/GrCaps.h b/include/gpu/GrCaps.h
index b88146f374..0e81e236ef 100644
--- a/include/gpu/GrCaps.h
+++ b/include/gpu/GrCaps.h
@@ -236,10 +236,8 @@ public:
/**
* Returns whether or not we will be able to do a copy given the passed in params
*/
- virtual bool canCopySurface(const GrSurfaceProxy* /*dst*/, const GrSurfaceProxy* /*src*/,
- const SkIRect& /*srcRect*/, const SkIPoint& /*dstPoint*/) const {
- return true;
- }
+ virtual bool canCopySurface(const GrSurfaceProxy* dst, const GrSurfaceProxy* src,
+ const SkIRect& srcRect, const SkIPoint& dstPoint) const = 0;
/**
* This is can be called before allocating a texture to be a dst for copySurface. This is only
diff --git a/src/gpu/mock/GrMockCaps.h b/src/gpu/mock/GrMockCaps.h
index 65dd766d8d..e8d1cbdd5a 100644
--- a/src/gpu/mock/GrMockCaps.h
+++ b/src/gpu/mock/GrMockCaps.h
@@ -70,6 +70,11 @@ public:
bool surfaceSupportsWritePixels(const GrSurface*) const override { return true; }
bool surfaceSupportsReadPixels(const GrSurface*) const override { return true; }
+ bool canCopySurface(const GrSurfaceProxy* dst, const GrSurfaceProxy* src,
+ const SkIRect& srcRect, const SkIPoint& dstPoint) const override {
+ return true;
+ }
+
bool initDescForDstCopy(const GrRenderTargetProxy* src, GrSurfaceDesc* desc, GrSurfaceOrigin*,
bool* rectsMustMatch, bool* disallowSubrect) const override {
return false;
diff --git a/src/gpu/mtl/GrMtlCaps.h b/src/gpu/mtl/GrMtlCaps.h
index c43d596e7f..0918f36807 100644
--- a/src/gpu/mtl/GrMtlCaps.h
+++ b/src/gpu/mtl/GrMtlCaps.h
@@ -46,6 +46,11 @@ public:
return fPreferedStencilFormat;
}
#endif
+ bool canCopySurface(const GrSurfaceProxy* dst, const GrSurfaceProxy* src,
+ const SkIRect& srcRect, const SkIPoint& dstPoint) const override {
+ return false;
+ }
+
bool initDescForDstCopy(const GrRenderTargetProxy* src, GrSurfaceDesc* desc, GrSurfaceOrigin*,
bool* rectsMustMatch, bool* disallowSubrect) const override {
return false;