diff options
author | Robert Phillips <robertphillips@google.com> | 2017-04-05 18:56:21 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-04-05 18:56:33 +0000 |
commit | 1b35256f1166358056b2aad8ce09caa6f07912d5 (patch) | |
tree | 9d9bcd6bffc6126d656efefee15bb376dab81d42 /tests/FloatingPointTextureTest.cpp | |
parent | 1987366b3c0a9dd9280620e62e0edb7d5087a828 (diff) |
Revert "Rm readPixels from GrSurface & move read/writeSurfacePixels to GrContextPriv (take 2)"
This reverts commit aaee31f18c0845417103d84285e365575def3c40.
Reason for revert: possible valgrind leak
Original change's description:
> 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>
>
TBR=bsalomon@google.com,robertphillips@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Change-Id: Ia0b92bf6402cb5f9607310d356f43bff2e3e75eb
Reviewed-on: https://skia-review.googlesource.com/11361
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'tests/FloatingPointTextureTest.cpp')
-rw-r--r-- | tests/FloatingPointTextureTest.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/tests/FloatingPointTextureTest.cpp b/tests/FloatingPointTextureTest.cpp index 5adc2e7892..4214e4eebf 100644 --- a/tests/FloatingPointTextureTest.cpp +++ b/tests/FloatingPointTextureTest.cpp @@ -17,7 +17,6 @@ #if SK_SUPPORT_GPU #include "GrContext.h" -#include "GrContextPriv.h" #include "GrResourceProvider.h" #include "GrTexture.h" #include "SkHalf.h" @@ -52,18 +51,14 @@ void runFPTest(skiatest::Reporter* reporter, GrContext* context, desc.fHeight = DEV_H; desc.fConfig = config; desc.fOrigin = 0 == origin ? kTopLeft_GrSurfaceOrigin : kBottomLeft_GrSurfaceOrigin; - sk_sp<GrTextureProxy> fpProxy = GrSurfaceProxy::MakeDeferred(context->resourceProvider(), - desc, SkBudgeted::kNo, - controlPixelData.begin(), 0); + sk_sp<GrTexture> fpTexture(context->resourceProvider()->createTexture( + desc, SkBudgeted::kNo, controlPixelData.begin(), 0)); // Floating point textures are NOT supported everywhere - if (!fpProxy) { + if (nullptr == fpTexture) { continue; } - bool result = context->contextPriv().readSurfacePixels(fpProxy.get(), nullptr, - 0, 0, DEV_W, DEV_H, - desc.fConfig, nullptr, - readBuffer.begin(), 0); - REPORTER_ASSERT(reporter, result); + REPORTER_ASSERT(reporter, + fpTexture->readPixels(0, 0, DEV_W, DEV_H, desc.fConfig, readBuffer.begin(), 0)); REPORTER_ASSERT(reporter, 0 == memcmp(readBuffer.begin(), controlPixelData.begin(), readBuffer.bytes())); } |