diff options
author | Robert Phillips <robertphillips@google.com> | 2016-12-14 12:04:46 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-12-14 12:05:06 +0000 |
commit | d316e77c1e1967b439a9a6c11146c54e367bff71 (patch) | |
tree | fbf7d3740c39507cdb2aad0267c2d96cd3d98bec /tests/CopySurfaceTest.cpp | |
parent | 2e018f548d76b0688f9873c683cffc681fec40ec (diff) |
Revert "Add a deferred copy surface (take 2)"
This reverts commit 398487a850431cf495330d4023607df5305a311f.
Reason for revert: See if this is causing the roll failure
Original change's description:
> 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>
>
TBR=bsalomon@google.com,robertphillips@google.com,brianosman@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Change-Id: I1ef40f0d5fb0bca62031f94f10eb18acd753e913
Reviewed-on: https://skia-review.googlesource.com/6024
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'tests/CopySurfaceTest.cpp')
-rw-r--r-- | tests/CopySurfaceTest.cpp | 36 |
1 files changed, 12 insertions, 24 deletions
diff --git a/tests/CopySurfaceTest.cpp b/tests/CopySurfaceTest.cpp index 68113e7ecc..053b456f57 100644 --- a/tests/CopySurfaceTest.cpp +++ b/tests/CopySurfaceTest.cpp @@ -10,9 +10,6 @@ #if SK_SUPPORT_GPU #include "GrContext.h" -#include "GrContextPriv.h" -#include "GrSurfaceContext.h" -#include "GrSurfaceProxy.h" #include "GrTexture.h" #include "GrTextureProvider.h" @@ -71,29 +68,22 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(CopySurface, reporter, ctxInfo) { dstDesc.fOrigin = dOrigin; dstDesc.fFlags = dFlags; - sk_sp<GrSurfaceProxy> src(GrSurfaceProxy::MakeDeferred( - *context->caps(), - context->textureProvider(), - srcDesc, SkBudgeted::kNo, - srcPixels.get(), - kRowBytes)); - - sk_sp<GrSurfaceProxy> dst(GrSurfaceProxy::MakeDeferred( - *context->caps(), - context->textureProvider(), - dstDesc, SkBudgeted::kNo, - dstPixels.get(), - kRowBytes)); + sk_sp<GrTexture> src( + context->textureProvider()->createTexture(srcDesc, SkBudgeted::kNo, + srcPixels.get(), + kRowBytes)); + sk_sp<GrTexture> dst( + context->textureProvider()->createTexture(dstDesc, SkBudgeted::kNo, + dstPixels.get(), + kRowBytes)); if (!src || !dst) { ERRORF(reporter, "Could not create surfaces for copy surface test."); continue; } - sk_sp<GrSurfaceContext> sContext = - context->contextPriv().makeTestSurfaceContext(dst); - - bool result = sContext->copy(src.get(), srcRect, dstPoint); + bool result + = context->copySurface(dst.get(), src.get(), srcRect, dstPoint); bool expectedResult = true; SkIPoint dstOffset = { dstPoint.fX - srcRect.fLeft, @@ -130,11 +120,9 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(CopySurface, reporter, ctxInfo) { continue; } - GrSurface* dstSurf = dst->instantiate(context->textureProvider()); - sk_memset32(read.get(), 0, kW * kH); - if (!dstSurf->readPixels(0, 0, kW, kH, baseDesc.fConfig, read.get(), - kRowBytes)) { + if (!dst->readPixels(0, 0, kW, kH, baseDesc.fConfig, read.get(), + kRowBytes)) { ERRORF(reporter, "Error calling readPixels"); continue; } |