GrSurface -> GrGpuBuffer transfer improvements:
GrCaps now only provides the offset alignment requirement. The row bytes
is always bpp * width.
GrGpu::transferPixelsFrom now just returns bool since row bytes value is
implicit. It now asserts offset is aligned with GrCap's provided value
in base class.
Implement caps for GL.
Bug: skia:8962
Change-Id: I3299b62efe9fe05bfe02f2a6a4c2704f647d0f8a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/206686
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/mtl/GrMtlCaps.h b/src/gpu/mtl/GrMtlCaps.h
index 6ff4694..b80c349 100644
--- a/src/gpu/mtl/GrMtlCaps.h
+++ b/src/gpu/mtl/GrMtlCaps.h
@@ -85,6 +85,10 @@
bool onSurfaceSupportsWritePixels(const GrSurface*) const override;
bool onCanCopySurface(const GrSurfaceProxy* dst, const GrSurfaceProxy* src,
const SkIRect& srcRect, const SkIPoint& dstPoint) const override;
+ size_t onTransferFromOffsetAlignment(GrColorType bufferColorType) const override {
+ // Transfer buffers not yet supported.
+ return 0;
+ }
struct ConfigInfo {
ConfigInfo() : fFlags(0) {}
diff --git a/src/gpu/mtl/GrMtlGpu.h b/src/gpu/mtl/GrMtlGpu.h
index 5e5c0a9..895866d 100644
--- a/src/gpu/mtl/GrMtlGpu.h
+++ b/src/gpu/mtl/GrMtlGpu.h
@@ -169,12 +169,10 @@
// TODO: not sure this is worth the work since nobody uses it
return false;
}
- size_t onTransferPixelsFrom(GrSurface*,
- int left, int top, int width, int height,
- GrColorType, GrGpuBuffer*,
- size_t offset) override {
+ bool onTransferPixelsFrom(GrSurface*, int left, int top, int width, int height, GrColorType,
+ GrGpuBuffer*, size_t offset) override {
// TODO: Will need to implement this to support async read backs.
- return 0;
+ return false;
}
bool onRegenerateMipMapLevels(GrTexture*) override;