aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/WritePixelsTest.cpp
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2018-02-26 14:32:39 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-02-26 20:43:18 +0000
commit5f33a8ccac141dfaddddc7b9fc39a8428cc233fe (patch)
treebc01188bd6ffbce272ce0bccb8f13da1163f26a8 /tests/WritePixelsTest.cpp
parent5ba448c21aa002055aa68942f1f50fd4cdfd8033 (diff)
Start on new GPU pixel ops implementation.
The new ops attempt to be less optimal by falling back to CPU conversions rather than relying on intermediate draws and complex coordination between GrContext and GrGpu to determine how conversions are performed. This adds the new writePixels implementation. Change-Id: I7496d86d5a40277ed2ca63668881c160e54d80d3 Reviewed-on: https://skia-review.googlesource.com/109880 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'tests/WritePixelsTest.cpp')
-rw-r--r--tests/WritePixelsTest.cpp16
1 files changed, 3 insertions, 13 deletions
diff --git a/tests/WritePixelsTest.cpp b/tests/WritePixelsTest.cpp
index f2ad10c4f3..1a0f7a549d 100644
--- a/tests/WritePixelsTest.cpp
+++ b/tests/WritePixelsTest.cpp
@@ -423,22 +423,12 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WritePixelsNonTexture_Gpu, reporter, ctxInfo)
for (int sampleCnt : {1, 4}) {
GrBackendTexture backendTex = gpu->createTestingOnlyBackendTexture(
nullptr, DEV_W, DEV_H, kSkia8888_GrPixelConfig, true, GrMipMapped::kNo);
- SkColorType colorType;
- if (kRGBA_8888_GrPixelConfig == kSkia8888_GrPixelConfig) {
- colorType = kRGBA_8888_SkColorType;
- } else {
- colorType = kBGRA_8888_SkColorType;
- }
+ SkColorType colorType = kN32_SkColorType;
sk_sp<SkSurface> surface(SkSurface::MakeFromBackendTextureAsRenderTarget(
context, backendTex, origin, sampleCnt, colorType, nullptr, nullptr));
- if (!surface) {
- gpu->deleteTestingOnlyBackendTexture(&backendTex);
- continue;
+ if (surface) {
+ test_write_pixels(reporter, surface.get());
}
-
- test_write_pixels(reporter, surface.get());
-
- surface.reset();
gpu->deleteTestingOnlyBackendTexture(&backendTex);
}
}