diff options
author | Robert Phillips <robertphillips@google.com> | 2017-04-05 12:18:58 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-04-05 17:00:10 +0000 |
commit | aaee31f18c0845417103d84285e365575def3c40 (patch) | |
tree | 9d0cea264cacdf51f64919ffc8f2b2d5dc83e961 /tests/PackedConfigsTextureTest.cpp | |
parent | babb101291784b844a99b20b5164b271758f6d33 (diff) |
Rm readPixels from GrSurface & move read/writeSurfacePixels to GrContextPriv (take 2)
This is in service of: https://skia-review.googlesource.com/c/11125/ (Add parallel proxyID to StencilOps & RenderTargetOpList) where I want a better choke point for texture creation to improve discard handling.
This is a reland of: https://skia-review.googlesource.com/c/11200/ (Rm readPixels from GrSurface & move read/writeSurfacePixels to GrContextPriv)
Change-Id: Icd0a90d2beb483dc24ed87c3bace9c817019e148
Reviewed-on: https://skia-review.googlesource.com/11326
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'tests/PackedConfigsTextureTest.cpp')
-rw-r--r-- | tests/PackedConfigsTextureTest.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/PackedConfigsTextureTest.cpp b/tests/PackedConfigsTextureTest.cpp index 7a51651e7f..35d9dfc3c5 100644 --- a/tests/PackedConfigsTextureTest.cpp +++ b/tests/PackedConfigsTextureTest.cpp @@ -15,6 +15,7 @@ #if SK_SUPPORT_GPU #include "GrContext.h" +#include "GrContextPriv.h" #include "GrResourceProvider.h" #include "GrTexture.h" @@ -116,10 +117,13 @@ void runTest(skiatest::Reporter* reporter, GrContext* context, desc.fHeight = DEV_H; desc.fConfig = config; desc.fOrigin = 0 == origin ? kTopLeft_GrSurfaceOrigin : kBottomLeft_GrSurfaceOrigin; - sk_sp<GrTexture> fpTexture(context->resourceProvider()->createTexture( - desc, SkBudgeted::kNo, controlPixelData.begin(), 0)); - SkASSERT(fpTexture); - fpTexture->readPixels(0, 0, DEV_W, DEV_H, kRGBA_8888_GrPixelConfig, readBuffer.begin(), 0); + sk_sp<GrTextureProxy> fpProxy = GrSurfaceProxy::MakeDeferred(context->resourceProvider(), + desc, SkBudgeted::kNo, + controlPixelData.begin(), 0); + SkASSERT(fpProxy); + context->contextPriv().readSurfacePixels(fpProxy.get(), nullptr, 0, 0, DEV_W, DEV_H, + kRGBA_8888_GrPixelConfig, nullptr, + readBuffer.begin(), 0); if (kRGBA_4444_GrPixelConfig == config) { check_4444(reporter, controlPixelData, readBuffer); } else { |