OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkColorSpace_Base.h" | 10 #include "SkColorSpace_Base.h" |
(...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
914 #endif | 914 #endif |
915 | 915 |
916 static void test_surface_creation_and_snapshot_with_color_space( | 916 static void test_surface_creation_and_snapshot_with_color_space( |
917 skiatest::Reporter* reporter, | 917 skiatest::Reporter* reporter, |
918 const char* prefix, | 918 const char* prefix, |
919 bool f16Support, | 919 bool f16Support, |
920 std::function<sk_sp<SkSurface>(const SkImageInfo&)> surfaceMaker) { | 920 std::function<sk_sp<SkSurface>(const SkImageInfo&)> surfaceMaker) { |
921 | 921 |
922 auto srgbColorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named); | 922 auto srgbColorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named); |
923 auto adobeColorSpace = SkColorSpace::NewNamed(SkColorSpace::kAdobeRGB_Named)
; | 923 auto adobeColorSpace = SkColorSpace::NewNamed(SkColorSpace::kAdobeRGB_Named)
; |
924 SkMatrix44 srgbMatrix = srgbColorSpace->toXYZD50(); | 924 SkMatrix44 srgbMatrix = as_CSB(srgbColorSpace)->toXYZD50(); |
925 const float oddGamma[] = { 2.4f, 2.4f, 2.4f }; | 925 const float oddGamma[] = { 2.4f, 2.4f, 2.4f }; |
926 auto oddColorSpace = SkColorSpace_Base::NewRGB(oddGamma, srgbMatrix); | 926 auto oddColorSpace = SkColorSpace_Base::NewRGB(oddGamma, srgbMatrix); |
927 auto linearColorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGBLinear_Nam
ed); | 927 auto linearColorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGBLinear_Nam
ed); |
928 | 928 |
929 const struct { | 929 const struct { |
930 SkColorType fColorType; | 930 SkColorType fColorType; |
931 sk_sp<SkColorSpace> fColorSpace; | 931 sk_sp<SkColorSpace> fColorSpace; |
932 bool fShouldWork; | 932 bool fShouldWork; |
933 const char* fDescription; | 933 const char* fDescription; |
934 } testConfigs[] = { | 934 } testConfigs[] = { |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1007 }; | 1007 }; |
1008 | 1008 |
1009 test_surface_creation_and_snapshot_with_color_space(reporter, "wrapped", f16
Support, | 1009 test_surface_creation_and_snapshot_with_color_space(reporter, "wrapped", f16
Support, |
1010 wrappedSurfaceMaker); | 1010 wrappedSurfaceMaker); |
1011 | 1011 |
1012 for (auto textureHandle : textureHandles) { | 1012 for (auto textureHandle : textureHandles) { |
1013 context->getGpu()->deleteTestingOnlyBackendTexture(textureHandle); | 1013 context->getGpu()->deleteTestingOnlyBackendTexture(textureHandle); |
1014 } | 1014 } |
1015 } | 1015 } |
1016 #endif | 1016 #endif |
OLD | NEW |