diff options
author | Brian Salomon <bsalomon@google.com> | 2018-03-07 13:01:25 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-03-07 18:22:40 +0000 |
commit | 58389b90cd387533021c109eb28da40c08e0ead5 (patch) | |
tree | 7744ee9c23c74c61aa00a3cc01eff74cedb8f541 /tests/FloatingPointTextureTest.cpp | |
parent | ab6fd7ef91aeca8a3fbbc6c6670cb89a5a7b6d53 (diff) |
Initial texture data is never flipped when uploaded.
The first bytes of the data always refer to the pixel accessed by texture coord (0, 0).
Change-Id: I708702d90f35b3bc896a48c3c3fd6a0be73f505a
Reviewed-on: https://skia-review.googlesource.com/112261
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'tests/FloatingPointTextureTest.cpp')
-rw-r--r-- | tests/FloatingPointTextureTest.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/tests/FloatingPointTextureTest.cpp b/tests/FloatingPointTextureTest.cpp index 6d2beb33e3..dac13a5a70 100644 --- a/tests/FloatingPointTextureTest.cpp +++ b/tests/FloatingPointTextureTest.cpp @@ -20,6 +20,7 @@ #include "GrContextPriv.h" #include "GrProxyProvider.h" #include "GrTextureProxy.h" +#include "ProxyUtils.h" #include "SkHalf.h" static const int DEV_W = 100, DEV_H = 100; @@ -33,7 +34,6 @@ void runFPTest(skiatest::Reporter* reporter, GrContext* context, T min, T max, T return; } - GrProxyProvider* proxyProvider = context->contextPriv().proxyProvider(); SkTDArray<T> controlPixelData, readBuffer; controlPixelData.setCount(arraySize); readBuffer.setCount(arraySize); @@ -46,14 +46,8 @@ void runFPTest(skiatest::Reporter* reporter, GrContext* context, T min, T max, T } for (auto origin : {kTopLeft_GrSurfaceOrigin, kBottomLeft_GrSurfaceOrigin}) { - GrSurfaceDesc desc; - desc.fFlags = kRenderTarget_GrSurfaceFlag; - desc.fWidth = DEV_W; - desc.fHeight = DEV_H; - desc.fConfig = GrColorTypeToPixelConfig(colorType, GrSRGBEncoded::kNo); - - sk_sp<GrTextureProxy> fpProxy = proxyProvider->createTextureProxy( - desc, origin, SkBudgeted::kNo, controlPixelData.begin(), 0); + auto fpProxy = sk_gpu_test::MakeTextureProxyFromData(context, true, DEV_W, DEV_H, colorType, + origin, controlPixelData.begin(), 0); // Floating point textures are NOT supported everywhere if (!fpProxy) { continue; |