Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Side by Side Diff: tests/ImageTest.cpp

Issue 2103133002: Enable many more tests for Vulkan (Closed) Base URL: https://skia.googlesource.com/skia.git@unitTests3
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tests/ImageIsOpaqueTest.cpp ('k') | tests/ProxyTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include <functional> 8 #include <functional>
9 #include <initializer_list> 9 #include <initializer_list>
10 #include <vector> 10 #include <vector>
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 RasterDataHolder dataHolder; 590 RasterDataHolder dataHolder;
591 image = create_rasterproc_image(&dataHolder); 591 image = create_rasterproc_image(&dataHolder);
592 test_read_pixels(reporter, image.get()); 592 test_read_pixels(reporter, image.get());
593 image.reset(); 593 image.reset();
594 REPORTER_ASSERT(reporter, 1 == dataHolder.fReleaseCount); 594 REPORTER_ASSERT(reporter, 1 == dataHolder.fReleaseCount);
595 595
596 image = create_codec_image(); 596 image = create_codec_image();
597 test_read_pixels(reporter, image.get()); 597 test_read_pixels(reporter, image.get());
598 } 598 }
599 #if SK_SUPPORT_GPU 599 #if SK_SUPPORT_GPU
600 DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ImageReadPixels_Gpu, reporter, ctxInfo) { 600 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageReadPixels_Gpu, reporter, ctxInfo) {
601 test_read_pixels(reporter, create_gpu_image(ctxInfo.grContext()).get()); 601 test_read_pixels(reporter, create_gpu_image(ctxInfo.grContext()).get());
602 } 602 }
603 #endif 603 #endif
604 604
605 static void check_legacy_bitmap(skiatest::Reporter* reporter, const SkImage* ima ge, 605 static void check_legacy_bitmap(skiatest::Reporter* reporter, const SkImage* ima ge,
606 const SkBitmap& bitmap, SkImage::LegacyBitmapMod e mode) { 606 const SkBitmap& bitmap, SkImage::LegacyBitmapMod e mode) {
607 REPORTER_ASSERT(reporter, image->width() == bitmap.width()); 607 REPORTER_ASSERT(reporter, image->width() == bitmap.width());
608 REPORTER_ASSERT(reporter, image->height() == bitmap.height()); 608 REPORTER_ASSERT(reporter, image->height() == bitmap.height());
609 REPORTER_ASSERT(reporter, image->isOpaque() == bitmap.isOpaque()); 609 REPORTER_ASSERT(reporter, image->isOpaque() == bitmap.isOpaque());
610 610
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
697 RasterDataHolder dataHolder; 697 RasterDataHolder dataHolder;
698 image = create_rasterproc_image(&dataHolder); 698 image = create_rasterproc_image(&dataHolder);
699 test_peek(reporter, image.get(), true); 699 test_peek(reporter, image.get(), true);
700 image.reset(); 700 image.reset();
701 REPORTER_ASSERT(reporter, 1 == dataHolder.fReleaseCount); 701 REPORTER_ASSERT(reporter, 1 == dataHolder.fReleaseCount);
702 702
703 image = create_codec_image(); 703 image = create_codec_image();
704 test_peek(reporter, image.get(), false); 704 test_peek(reporter, image.get(), false);
705 } 705 }
706 #if SK_SUPPORT_GPU 706 #if SK_SUPPORT_GPU
707 DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ImagePeek_Gpu, reporter, ctxInfo) { 707 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImagePeek_Gpu, reporter, ctxInfo) {
708 sk_sp<SkImage> image(create_gpu_image(ctxInfo.grContext())); 708 sk_sp<SkImage> image(create_gpu_image(ctxInfo.grContext()));
709 test_peek(reporter, image.get(), false); 709 test_peek(reporter, image.get(), false);
710 } 710 }
711 #endif 711 #endif
712 712
713 #if SK_SUPPORT_GPU 713 #if SK_SUPPORT_GPU
714 struct TextureReleaseChecker { 714 struct TextureReleaseChecker {
715 TextureReleaseChecker() : fReleaseCount(0) {} 715 TextureReleaseChecker() : fReleaseCount(0) {}
716 int fReleaseCount; 716 int fReleaseCount;
717 static void Release(void* self) { 717 static void Release(void* self) {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
812 uint32_t pixelB = *bpm.addr32(x, y); 812 uint32_t pixelB = *bpm.addr32(x, y);
813 if (pixelA != pixelB) { 813 if (pixelA != pixelB) {
814 ERRORF(reporter, "Expected image pixels to be the same. At %d,%d 0x%08x != 0x%08x", 814 ERRORF(reporter, "Expected image pixels to be the same. At %d,%d 0x%08x != 0x%08x",
815 x, y, pixelA, pixelB); 815 x, y, pixelA, pixelB);
816 return; 816 return;
817 } 817 }
818 } 818 }
819 } 819 }
820 } 820 }
821 821
822 DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(NewTextureFromPixmap, reporter, ctxInfo) { 822 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(NewTextureFromPixmap, reporter, ctxInfo) {
823 for (auto create : {&create_image, 823 for (auto create : {&create_image,
824 &create_image_565, 824 &create_image_565,
825 &create_image_ct}) { 825 &create_image_ct}) {
826 sk_sp<SkImage> image((*create)()); 826 sk_sp<SkImage> image((*create)());
827 if (!image) { 827 if (!image) {
828 ERRORF(reporter, "Could not create image"); 828 ERRORF(reporter, "Could not create image");
829 return; 829 return;
830 } 830 }
831 831
832 SkPixmap pixmap; 832 SkPixmap pixmap;
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
936 otherContextInfo.grContext(), buffer, budgeted)); 936 otherContextInfo.grContext(), buffer, budgeted));
937 REPORTER_ASSERT(reporter, !newImage2); 937 REPORTER_ASSERT(reporter, !newImage2);
938 testContext->makeCurrent(); 938 testContext->makeCurrent();
939 } 939 }
940 } 940 }
941 sk_free(buffer); 941 sk_free(buffer);
942 } 942 }
943 } 943 }
944 } 944 }
945 #endif 945 #endif
OLDNEW
« no previous file with comments | « tests/ImageIsOpaqueTest.cpp ('k') | tests/ProxyTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698