diff options
author | 2016-12-13 15:29:42 -0500 | |
---|---|---|
committer | 2016-12-13 22:01:58 +0000 | |
commit | 398487a850431cf495330d4023607df5305a311f (patch) | |
tree | 7ab227c99eaab21554428f7a94e0c2df67be009a /include/private/GrSurfaceProxy.h | |
parent | 24f19780d1e76595c049d8cad4352de839cfc6b5 (diff) |
Add a deferred copy surface (take 2)
This CL forces all GrSurface copies to go through a GrSurfaceContext (rather than GrContext).
There is a bit of goofiness going on here until read/writePixels is also consolidated in GrSurfaceContext and a proxy-backed SkImage/SkSurface is added.
This is a reland of https://skia-review.googlesource.com/c/5773/ (Add a deferred copy surface)
Change-Id: Ide560f569aede5e622420dc2f30eef76357d69f4
Reviewed-on: https://skia-review.googlesource.com/5939
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'include/private/GrSurfaceProxy.h')
-rw-r--r-- | include/private/GrSurfaceProxy.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/private/GrSurfaceProxy.h b/include/private/GrSurfaceProxy.h index 731603b2c9..12972c21be 100644 --- a/include/private/GrSurfaceProxy.h +++ b/include/private/GrSurfaceProxy.h @@ -266,6 +266,20 @@ public: return fGpuMemorySize; } + // Helper function that creates a temporary SurfaceContext to perform the copy + static sk_sp<GrSurfaceProxy> Copy(GrContext*, GrSurfaceProxy* src, + SkIRect srcRect, SkBudgeted); + + // Copy the entire 'src' + static sk_sp<GrSurfaceProxy> Copy(GrContext* context, GrSurfaceProxy* src, + SkBudgeted budgeted) { + return Copy(context, src, SkIRect::MakeWH(src->width(), src->height()), budgeted); + } + + // Test-only entry point - should decrease in use as proxies propagate + static sk_sp<GrSurfaceProxy> TestCopy(GrContext* context, const GrSurfaceDesc& dstDesc, + GrTexture* srcTexture, SkBudgeted budgeted); + bool isWrapped_ForTesting() const; SkDEBUGCODE(void validate(GrContext*) const;) |