implemented copy surface as blit for metal gpu backend
Bug: skia:
Change-Id: Ic59fe585c02168a361985f0864242b3c11e9d98e
Reviewed-on: https://skia-review.googlesource.com/142684
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Timothy Liang <timliang@google.com>
diff --git a/src/gpu/mtl/GrMtlGpuCommandBuffer.h b/src/gpu/mtl/GrMtlGpuCommandBuffer.h
index 8f1fd20..df1738d 100644
--- a/src/gpu/mtl/GrMtlGpuCommandBuffer.h
+++ b/src/gpu/mtl/GrMtlGpuCommandBuffer.h
@@ -18,14 +18,14 @@
GrMtlGpuTextureCommandBuffer(GrMtlGpu* gpu, GrTexture* texture, GrSurfaceOrigin origin)
: INHERITED(texture, origin)
, fGpu(gpu) {
- // Silence unused var warning
- (void)fGpu;
}
~GrMtlGpuTextureCommandBuffer() override {}
void copy(GrSurface* src, GrSurfaceOrigin srcOrigin, const SkIRect& srcRect,
- const SkIPoint& dstPoint) override {}
+ const SkIPoint& dstPoint) override {
+ fGpu->copySurface(fTexture, fOrigin, src, srcOrigin, srcRect, dstPoint);
+ }
void insertEventMarker(const char* msg) override {}
@@ -63,7 +63,9 @@
void inlineUpload(GrOpFlushState* state, GrDeferredTextureUploadFn& upload) override {}
void copy(GrSurface* src, GrSurfaceOrigin srcOrigin, const SkIRect& srcRect,
- const SkIPoint& dstPoint) override {}
+ const SkIPoint& dstPoint) override {
+ fGpu->copySurface(fRenderTarget, fOrigin, src, srcOrigin, srcRect, dstPoint);
+ }
void submit() override {}