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

Side by Side Diff: dm/DM.cpp

Issue 2069173002: Lots of progress switching to SkColorSpace rather than SkColorProfileType (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix bad assert Created 4 years, 6 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 | « bench/nanobench.cpp ('k') | dm/DMSrcSink.h » ('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 "CrashHandler.h" 8 #include "CrashHandler.h"
9 #include "DMJsonWriter.h" 9 #include "DMJsonWriter.h"
10 #include "DMSrcSink.h" 10 #include "DMSrcSink.h"
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 #if SK_SUPPORT_GPU 795 #if SK_SUPPORT_GPU
796 if (gpu_supported()) { 796 if (gpu_supported()) {
797 if (const SkCommandLineConfigGpu* gpuConfig = config->asConfigGpu()) { 797 if (const SkCommandLineConfigGpu* gpuConfig = config->asConfigGpu()) {
798 GrContextFactory::ContextType contextType = gpuConfig->getContextTyp e(); 798 GrContextFactory::ContextType contextType = gpuConfig->getContextTyp e();
799 GrContextFactory::ContextOptions contextOptions = 799 GrContextFactory::ContextOptions contextOptions =
800 GrContextFactory::kNone_ContextOptions; 800 GrContextFactory::kNone_ContextOptions;
801 if (gpuConfig->getUseNVPR()) { 801 if (gpuConfig->getUseNVPR()) {
802 contextOptions = static_cast<GrContextFactory::ContextOptions>( 802 contextOptions = static_cast<GrContextFactory::ContextOptions>(
803 contextOptions | GrContextFactory::kEnableNVPR_ContextOption s); 803 contextOptions | GrContextFactory::kEnableNVPR_ContextOption s);
804 } 804 }
805 if (SkColorAndProfileAreGammaCorrect(gpuConfig->getColorType(), 805 if (SkColorAndColorSpaceAreGammaCorrect(gpuConfig->getColorType(),
806 gpuConfig->getProfileType())) { 806 gpuConfig->getColorSpace())) {
807 contextOptions = static_cast<GrContextFactory::ContextOptions>( 807 contextOptions = static_cast<GrContextFactory::ContextOptions>(
808 contextOptions | GrContextFactory::kRequireSRGBSupport_Conte xtOptions); 808 contextOptions | GrContextFactory::kRequireSRGBSupport_Conte xtOptions);
809 } 809 }
810 GrContextFactory testFactory; 810 GrContextFactory testFactory;
811 if (!testFactory.get(contextType, contextOptions)) { 811 if (!testFactory.get(contextType, contextOptions)) {
812 info("WARNING: can not create GPU context for config '%s'. " 812 info("WARNING: can not create GPU context for config '%s'. "
813 "GM tests will be skipped.\n", gpuConfig->getTag().c_str()) ; 813 "GM tests will be skipped.\n", gpuConfig->getTag().c_str()) ;
814 return nullptr; 814 return nullptr;
815 } 815 }
816 return new GPUSink(contextType, contextOptions, gpuConfig->getSample s(), 816 return new GPUSink(contextType, contextOptions, gpuConfig->getSample s(),
817 gpuConfig->getUseDIText(), gpuConfig->getColorTyp e(), 817 gpuConfig->getUseDIText(), gpuConfig->getColorTyp e(),
818 gpuConfig->getProfileType(), FLAGS_gpu_threading) ; 818 sk_ref_sp(gpuConfig->getColorSpace()), FLAGS_gpu_ threading);
819 } 819 }
820 } 820 }
821 #endif 821 #endif
822 822
823 #define SINK(t, sink, ...) if (config->getBackend().equals(t)) { return new sink (__VA_ARGS__); } 823 #define SINK(t, sink, ...) if (config->getBackend().equals(t)) { return new sink (__VA_ARGS__); }
824 824
825 #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK 825 #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
826 SINK("hwui", HWUISink); 826 SINK("hwui", HWUISink);
827 #endif 827 #endif
828 828
829 if (FLAGS_cpu) { 829 if (FLAGS_cpu) {
830 auto srgbColorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named);
831
830 SINK("565", RasterSink, kRGB_565_SkColorType); 832 SINK("565", RasterSink, kRGB_565_SkColorType);
831 SINK("8888", RasterSink, kN32_SkColorType); 833 SINK("8888", RasterSink, kN32_SkColorType);
832 SINK("srgb", RasterSink, kN32_SkColorType, kSRGB_SkColorProfileType); 834 SINK("srgb", RasterSink, kN32_SkColorType, srgbColorSpace);
833 SINK("f16", RasterSink, kRGBA_F16_SkColorType); 835 SINK("f16", RasterSink, kRGBA_F16_SkColorType);
834 SINK("pdf", PDFSink); 836 SINK("pdf", PDFSink);
835 SINK("skp", SKPSink); 837 SINK("skp", SKPSink);
836 SINK("svg", SVGSink); 838 SINK("svg", SVGSink);
837 SINK("null", NullSink); 839 SINK("null", NullSink);
838 SINK("xps", XPSSink); 840 SINK("xps", XPSSink);
839 SINK("pdfa", PDFSink, true); 841 SINK("pdfa", PDFSink, true);
840 } 842 }
841 #undef SINK 843 #undef SINK
842 return nullptr; 844 return nullptr;
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
1404 #endif 1406 #endif
1405 } 1407 }
1406 } // namespace skiatest 1408 } // namespace skiatest
1407 1409
1408 #if !defined(SK_BUILD_FOR_IOS) 1410 #if !defined(SK_BUILD_FOR_IOS)
1409 int main(int argc, char** argv) { 1411 int main(int argc, char** argv) {
1410 SkCommandLineFlags::Parse(argc, argv); 1412 SkCommandLineFlags::Parse(argc, argv);
1411 return dm_main(); 1413 return dm_main();
1412 } 1414 }
1413 #endif 1415 #endif
OLDNEW
« no previous file with comments | « bench/nanobench.cpp ('k') | dm/DMSrcSink.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698