diff options
author | Timothy Liang <timliang@google.com> | 2018-07-13 13:24:05 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-07-13 18:38:14 +0000 |
commit | 36848f6b30ddaca461c98e13b9976b2c449ca547 (patch) | |
tree | ed1626f12d90a0f8f154c2b89fb938f64c8ed499 /tests/VkUploadPixelsTests.cpp | |
parent | 81d151103faca621cfe62c9dfbec842ec9f337c4 (diff) |
implemented metal gpu backend texture upload testing
Bug: skia:
Change-Id: Ia3af58a0710f7f9792b37682a3cc45dd14282b71
Reviewed-on: https://skia-review.googlesource.com/140248
Commit-Queue: Timothy Liang <timliang@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'tests/VkUploadPixelsTests.cpp')
-rw-r--r-- | tests/VkUploadPixelsTests.cpp | 31 |
1 files changed, 1 insertions, 30 deletions
diff --git a/tests/VkUploadPixelsTests.cpp b/tests/VkUploadPixelsTests.cpp index bd87d19cd1..b13de41571 100644 --- a/tests/VkUploadPixelsTests.cpp +++ b/tests/VkUploadPixelsTests.cpp @@ -18,40 +18,11 @@ #include "ProxyUtils.h" #include "SkGr.h" #include "Test.h" +#include "TestUtils.h" #include "vk/GrVkGpu.h" using sk_gpu_test::GrContextFactory; -void fill_pixel_data(int width, int height, GrColor* data) { - - // build red-green gradient - for (int j = 0; j < height; ++j) { - for (int i = 0; i < width; ++i) { - unsigned int red = (unsigned int)(256.f*(i / (float)width)); - unsigned int green = (unsigned int)(256.f*(j / (float)height)); - data[i + j*width] = GrColorPackRGBA(red - (red>>8), green - (green>>8), 0xff, 0xff); - } - } -} - -bool does_full_buffer_contain_correct_color(GrColor* srcBuffer, - GrColor* dstBuffer, - int width, - int height) { - GrColor* srcPtr = srcBuffer; - GrColor* dstPtr = dstBuffer; - for (int j = 0; j < height; ++j) { - for (int i = 0; i < width; ++i) { - if (srcPtr[i] != dstPtr[i]) { - return false; - } - } - srcPtr += width; - dstPtr += width; - } - return true; -} - void basic_texture_test(skiatest::Reporter* reporter, GrContext* context, SkColorType ct, bool renderTarget) { const int kWidth = 16; |