diff options
author | Robert Phillips <robertphillips@google.com> | 2017-04-06 07:59:41 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-04-06 12:45:02 +0000 |
commit | e78b7259c3d5cbed77b4390150cfb699b0b59cd4 (patch) | |
tree | b31944a68b1c88c5f87d2023157b473f01348feb /tests/ReadWriteAlphaTest.cpp | |
parent | 43b9c6bbf66b0927a99062c68dff9ea8358f82db (diff) |
Rm readPixels from GrSurface & move read/writeSurfacePixels to GrContextPriv (take 3)
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 re-reland of: https://skia-review.googlesource.com/c/11200/ (Rm readPixels from GrSurface & move read/writeSurfacePixels to GrContextPriv)
Change-Id: Icfb9dd223418dd460405efd2bfd9d1c356beed1a
Reviewed-on: https://skia-review.googlesource.com/11412
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 | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/ReadWriteAlphaTest.cpp b/tests/ReadWriteAlphaTest.cpp index ac34b9dc32..2a68191a2d 100644 --- a/tests/ReadWriteAlphaTest.cpp +++ b/tests/ReadWriteAlphaTest.cpp @@ -159,9 +159,10 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ReadWriteAlpha, reporter, ctxInfo) { rgbaData[y * X_SIZE + x] = GrColorPackRGBA(6, 7, 8, alphaData[y * X_SIZE + x]); } } - sk_sp<GrTexture> texture( - context->resourceProvider()->createTexture(desc, SkBudgeted::kNo, rgbaData, 0)); - if (!texture) { + sk_sp<GrTextureProxy> proxy = + GrSurfaceProxy::MakeDeferred(context->resourceProvider(), desc, SkBudgeted::kNo, + rgbaData, 0); + if (!proxy) { // We always expect to be able to create a RGBA texture if (!rt && kRGBA_8888_GrPixelConfig == desc.fConfig) { ERRORF(reporter, "Failed to create RGBA texture."); @@ -177,8 +178,10 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ReadWriteAlpha, reporter, ctxInfo) { memset(readback.get(), kClearValue, nonZeroRowBytes * Y_SIZE); // read the texture back - bool result = texture->readPixels(0, 0, desc.fWidth, desc.fHeight, - kAlpha_8_GrPixelConfig, + 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"); |