diff options
author | Robert Phillips <robertphillips@google.com> | 2017-04-14 17:56:08 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-04-14 17:56:13 +0000 |
commit | 747636f6b9e64fbf845d93cfbaf1275b643691f6 (patch) | |
tree | 01d146d0ffc3a398c137167ac161cc06d18cdefa /tests/ReadWriteAlphaTest.cpp | |
parent | 74d5a1470378dc7dae9eec38d46f9f802fc5c249 (diff) |
Revert "Reduce read/write-SurfacePixels call sites"
This reverts commit 74d5a1470378dc7dae9eec38d46f9f802fc5c249.
Reason for revert: erg
Original change's description:
> Reduce read/write-SurfacePixels call sites
>
> Change-Id: I657c489c56b93765567be69076fb4c3d526e55a5
> Reviewed-on: https://skia-review.googlesource.com/13068
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>
>
TBR=robertphillips@google.com,brianosman@google.com,egdaniel@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Change-Id: If80f36ddae9d695ee2e5413f3eb49a1f5c32f8a4
Reviewed-on: https://skia-review.googlesource.com/13506
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'tests/ReadWriteAlphaTest.cpp')
-rw-r--r-- | tests/ReadWriteAlphaTest.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/tests/ReadWriteAlphaTest.cpp b/tests/ReadWriteAlphaTest.cpp index 531159ff6f..2a68191a2d 100644 --- a/tests/ReadWriteAlphaTest.cpp +++ b/tests/ReadWriteAlphaTest.cpp @@ -142,17 +142,13 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ReadWriteAlpha, reporter, ctxInfo) { } } - const SkImageInfo dstInfo = SkImageInfo::Make(X_SIZE, Y_SIZE, - kAlpha_8_SkColorType, - kPremul_SkAlphaType); - // Attempt to read back just alpha from a RGBA/BGRA texture. Once with a texture-only src and // once with a render target. - for (auto config : kRGBAConfigs) { + for (auto cfg : kRGBAConfigs) { for (int rt = 0; rt < 2; ++rt) { GrSurfaceDesc desc; desc.fFlags = rt ? kRenderTarget_GrSurfaceFlag : kNone_GrSurfaceFlags; - desc.fConfig = config; + desc.fConfig = cfg; desc.fWidth = X_SIZE; desc.fHeight = Y_SIZE; @@ -174,9 +170,6 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ReadWriteAlpha, reporter, ctxInfo) { continue; } - sk_sp<GrSurfaceContext> sContext = context->contextPriv().makeWrappedSurfaceContext( - std::move(proxy), nullptr); - for (auto rowBytes : kRowBytes) { size_t nonZeroRowBytes = rowBytes ? rowBytes : X_SIZE; @@ -185,7 +178,11 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ReadWriteAlpha, reporter, ctxInfo) { memset(readback.get(), kClearValue, nonZeroRowBytes * Y_SIZE); // read the texture back - bool result = sContext->readPixels(dstInfo, readback.get(), rowBytes, 0, 0); + bool result = context->contextPriv().readSurfacePixels( + proxy.get(), nullptr, + 0, 0, desc.fWidth, desc.fHeight, + kAlpha_8_GrPixelConfig, nullptr, + readback.get(), rowBytes); REPORTER_ASSERT_MESSAGE(reporter, result, "8888 readPixels failed"); // make sure the original & read back versions match |