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

Side by Side Diff: tests/SurfaceTest.cpp

Issue 2389983002: Refactored SkColorSpace and added in a Lab PCS GM (Closed)
Patch Set: migrated call from SkColorSpace_Base::makeLinearGamma() to SkColorSpace_XYZ::makeLinearGamma() 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/ColorSpaceXformTest.cpp ('k') | tests/TestConfigParsing.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 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
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 = as_CSB(srgbColorSpace)->toXYZD50(); 924 const SkMatrix44* srgbMatrix = as_CSB(srgbColorSpace)->toXYZD50();
925 SkASSERT(srgbMatrix);
925 const float oddGamma[] = { 2.4f, 2.4f, 2.4f }; 926 const float oddGamma[] = { 2.4f, 2.4f, 2.4f };
926 auto oddColorSpace = SkColorSpace::NewRGB(oddGamma, srgbMatrix); 927 auto oddColorSpace = SkColorSpace::NewRGB(oddGamma, *srgbMatrix);
927 auto linearColorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGBLinear_Nam ed); 928 auto linearColorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGBLinear_Nam ed);
928 929
929 const struct { 930 const struct {
930 SkColorType fColorType; 931 SkColorType fColorType;
931 sk_sp<SkColorSpace> fColorSpace; 932 sk_sp<SkColorSpace> fColorSpace;
932 bool fShouldWork; 933 bool fShouldWork;
933 const char* fDescription; 934 const char* fDescription;
934 } testConfigs[] = { 935 } testConfigs[] = {
935 { kN32_SkColorType, nullptr, true, "N32-nullptr" }, 936 { kN32_SkColorType, nullptr, true, "N32-nullptr" },
936 { kN32_SkColorType, linearColorSpace, false, "N32-linear" }, 937 { kN32_SkColorType, linearColorSpace, false, "N32-linear" },
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
1007 }; 1008 };
1008 1009
1009 test_surface_creation_and_snapshot_with_color_space(reporter, "wrapped", f16 Support, 1010 test_surface_creation_and_snapshot_with_color_space(reporter, "wrapped", f16 Support,
1010 wrappedSurfaceMaker); 1011 wrappedSurfaceMaker);
1011 1012
1012 for (auto textureHandle : textureHandles) { 1013 for (auto textureHandle : textureHandles) {
1013 context->getGpu()->deleteTestingOnlyBackendTexture(textureHandle); 1014 context->getGpu()->deleteTestingOnlyBackendTexture(textureHandle);
1014 } 1015 }
1015 } 1016 }
1016 #endif 1017 #endif
OLDNEW
« no previous file with comments | « tests/ColorSpaceXformTest.cpp ('k') | tests/TestConfigParsing.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698