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

Side by Side Diff: tests/SurfaceTest.cpp

Issue 2377763002: Added kSRGBLinear_Named color space, along with tests (Closed)
Patch Set: Update assert. Better comment. Created 4 years, 2 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/ColorSpaceTest.cpp ('k') | no next file » | 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 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 906 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 = 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 = srgbColorSpace->makeLinearGamma(); 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[] = {
935 { kN32_SkColorType, nullptr, true, "N32-nullptr" }, 935 { kN32_SkColorType, nullptr, true, "N32-nullptr" },
936 { kN32_SkColorType, linearColorSpace, false, "N32-linear" }, 936 { kN32_SkColorType, linearColorSpace, false, "N32-linear" },
937 { kN32_SkColorType, srgbColorSpace, true, "N32-srgb" }, 937 { kN32_SkColorType, srgbColorSpace, true, "N32-srgb" },
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « tests/ColorSpaceTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698