OLD | NEW |
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 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
882 } else { | 882 } else { |
883 check_images_same(reporter, image.get(), texImage.get()); | 883 check_images_same(reporter, image.get(), texImage.get()); |
884 } | 884 } |
885 } | 885 } |
886 } | 886 } |
887 } | 887 } |
888 | 888 |
889 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(DeferredTextureImage, reporter, ctxInfo) { | 889 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(DeferredTextureImage, reporter, ctxInfo) { |
890 GrContext* context = ctxInfo.grContext(); | 890 GrContext* context = ctxInfo.grContext(); |
891 sk_gpu_test::TestContext* testContext = ctxInfo.testContext(); | 891 sk_gpu_test::TestContext* testContext = ctxInfo.testContext(); |
892 SkAutoTUnref<GrContextThreadSafeProxy> proxy(context->threadSafeProxy()); | 892 sk_sp<GrContextThreadSafeProxy> proxy = context->threadSafeProxy(); |
893 | 893 |
894 GrContextFactory otherFactory; | 894 GrContextFactory otherFactory; |
895 ContextInfo otherContextInfo = | 895 ContextInfo otherContextInfo = |
896 otherFactory.getContextInfo(GrContextFactory::kNativeGL_ContextType); | 896 otherFactory.getContextInfo(GrContextFactory::kNativeGL_ContextType); |
897 | 897 |
898 testContext->makeCurrent(); | 898 testContext->makeCurrent(); |
899 REPORTER_ASSERT(reporter, proxy); | 899 REPORTER_ASSERT(reporter, proxy); |
900 struct { | 900 struct { |
901 std::function<sk_sp<SkImage> ()> fImageFactory; | 901 std::function<sk_sp<SkImage> ()> fImageFactory; |
902 std::vector<SkImage::DeferredTextureImageUsageParams> fParams; | 902 std::vector<SkImage::DeferredTextureImageUsageParams> fParams; |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1044 SkBitmap bm1; | 1044 SkBitmap bm1; |
1045 bm1.allocPixels(SkImageInfo::MakeN32(256, 256, kUnpremul_SkAlphaType)); | 1045 bm1.allocPixels(SkImageInfo::MakeN32(256, 256, kUnpremul_SkAlphaType)); |
1046 bm0.readPixels(bm1.info(), bm1.getPixels(), bm1.rowBytes(), 0, 0); | 1046 bm0.readPixels(bm1.info(), bm1.getPixels(), bm1.rowBytes(), 0, 0); |
1047 | 1047 |
1048 SkBitmap bm2; | 1048 SkBitmap bm2; |
1049 bm2.allocPixels(SkImageInfo::MakeN32(256, 256, kPremul_SkAlphaType)); | 1049 bm2.allocPixels(SkImageInfo::MakeN32(256, 256, kPremul_SkAlphaType)); |
1050 bm1.readPixels(bm2.info(), bm2.getPixels(), bm2.rowBytes(), 0, 0); | 1050 bm1.readPixels(bm2.info(), bm2.getPixels(), bm2.rowBytes(), 0, 0); |
1051 | 1051 |
1052 REPORTER_ASSERT(reporter, equal(bm0, bm2)); | 1052 REPORTER_ASSERT(reporter, equal(bm0, bm2)); |
1053 } | 1053 } |
OLD | NEW |