aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/PackedConfigsTextureTest.cpp
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2018-03-19 18:42:25 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-19 18:42:36 +0000
commitbe5947c2f38a79b7c709accfb1047d8fd06a0227 (patch)
tree22d4d6e3f37d2a417656f1d74e9eff507d88b6d9 /tests/PackedConfigsTextureTest.cpp
parentc9a642edf2d1c7f5380fe829adbb1a692f9969a6 (diff)
Revert "New read pixels implementation that is simpler but does all conversions on CPU."
This reverts commit c9a642edf2d1c7f5380fe829adbb1a692f9969a6. Reason for revert: 1010102 gms broke Original change's description: > New read pixels implementation that is simpler but does all conversions on CPU. > > Change-Id: Ia548cd24a8544b35a233311706faf48de353b7cf > Reviewed-on: https://skia-review.googlesource.com/109902 > Commit-Queue: Brian Salomon <bsalomon@google.com> > Reviewed-by: Robert Phillips <robertphillips@google.com> TBR=bsalomon@google.com,robertphillips@google.com,brianosman@google.com Change-Id: I7724a6eef79885ba2a32c1ac871e5b2a9a3c0c12 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/115140 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'tests/PackedConfigsTextureTest.cpp')
-rw-r--r--tests/PackedConfigsTextureTest.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/tests/PackedConfigsTextureTest.cpp b/tests/PackedConfigsTextureTest.cpp
index 5f18ef3d57..b1fbc77977 100644
--- a/tests/PackedConfigsTextureTest.cpp
+++ b/tests/PackedConfigsTextureTest.cpp
@@ -97,7 +97,7 @@ static void check_565(skiatest::Reporter* reporter,
}
static void run_test(skiatest::Reporter* reporter, GrContext* context, int arraySize,
- SkColorType colorType) {
+ GrColorType colorType) {
SkTDArray<uint16_t> controlPixelData;
// We will read back into an 8888 buffer since 565/4444 read backs aren't supported
SkTDArray<GrColor> readBuffer;
@@ -113,24 +113,19 @@ static void run_test(skiatest::Reporter* reporter, GrContext* context, int array
kRGBA_8888_SkColorType, kOpaque_SkAlphaType);
for (auto origin : { kTopLeft_GrSurfaceOrigin, kBottomLeft_GrSurfaceOrigin }) {
- auto proxy = sk_gpu_test::MakeTextureProxyFromData(context, false, DEV_W, DEV_H,
- SkColorTypeToGrColorType(colorType),
+ auto proxy = sk_gpu_test::MakeTextureProxyFromData(context, false, DEV_W, DEV_H, colorType,
origin, controlPixelData.begin(), 0);
SkASSERT(proxy);
sk_sp<GrSurfaceContext> sContext = context->contextPriv().makeWrappedSurfaceContext(
std::move(proxy));
- if (!sContext->readPixels(dstInfo, readBuffer.begin(), 0, 0, 0)) {
- // We only require this to succeed if the format is renderable.
- REPORTER_ASSERT(reporter, !context->colorTypeSupportedAsSurface(colorType));
- return;
- }
+ SkAssertResult(sContext->readPixels(dstInfo, readBuffer.begin(), 0, 0, 0));
- if (kARGB_4444_SkColorType == colorType) {
+ if (GrColorType::kABGR_4444 == colorType) {
check_4444(reporter, controlPixelData, readBuffer);
} else {
- SkASSERT(kRGB_565_SkColorType == colorType);
+ SkASSERT(GrColorType::kRGB_565 == colorType);
check_565(reporter, controlPixelData, readBuffer);
}
}
@@ -139,11 +134,11 @@ static void run_test(skiatest::Reporter* reporter, GrContext* context, int array
static const int CONTROL_ARRAY_SIZE = DEV_W * DEV_H;
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(RGBA4444TextureTest, reporter, ctxInfo) {
- run_test(reporter, ctxInfo.grContext(), CONTROL_ARRAY_SIZE, kARGB_4444_SkColorType);
+ run_test(reporter, ctxInfo.grContext(), CONTROL_ARRAY_SIZE, GrColorType::kABGR_4444);
}
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(RGB565TextureTest, reporter, ctxInfo) {
- run_test(reporter, ctxInfo.grContext(), CONTROL_ARRAY_SIZE, kRGB_565_SkColorType);
+ run_test(reporter, ctxInfo.grContext(), CONTROL_ARRAY_SIZE, GrColorType::kRGB_565);
}
#endif