From 4cbb6e6d551e8bea2c040b1aa9dce253cffb9af0 Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Wed, 25 Oct 2017 15:12:19 -0400 Subject: Pass GrRenderTargetContext's GrColorSpaceInfo to SkShader and SkColorFilter. Also to SkColorTo(Premul|Unpremul)GrColor4f. This can avoid cache lookups to find GrColorSpaceXforms as the xform pointer is stored in GrColorSpaceInfo after the first lookup. Also uses GrColorSpaceInfo to construct GrTextUtils::Paint. Bug: skia: Change-Id: Idf19d512a60d2269e6921c7fb54d93aee499a70d Reviewed-on: https://skia-review.googlesource.com/63660 Commit-Queue: Brian Salomon Reviewed-by: Brian Osman --- include/effects/SkLumaColorFilter.h | 4 ++-- include/effects/SkOverdrawColorFilter.h | 4 ++-- include/effects/SkToSRGBColorFilter.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'include/effects') diff --git a/include/effects/SkLumaColorFilter.h b/include/effects/SkLumaColorFilter.h index 1c35fc492a..ff7fa661b9 100644 --- a/include/effects/SkLumaColorFilter.h +++ b/include/effects/SkLumaColorFilter.h @@ -29,8 +29,8 @@ public: static sk_sp Make(); #if SK_SUPPORT_GPU - std::unique_ptr asFragmentProcessor(GrContext*, - SkColorSpace*) const override; + std::unique_ptr asFragmentProcessor( + GrContext*, const GrColorSpaceInfo&) const override; #endif SK_TO_STRING_OVERRIDE() diff --git a/include/effects/SkOverdrawColorFilter.h b/include/effects/SkOverdrawColorFilter.h index ac97821269..63f636a0cc 100644 --- a/include/effects/SkOverdrawColorFilter.h +++ b/include/effects/SkOverdrawColorFilter.h @@ -28,8 +28,8 @@ public: } #if SK_SUPPORT_GPU - std::unique_ptr asFragmentProcessor(GrContext*, - SkColorSpace*) const override; + std::unique_ptr asFragmentProcessor( + GrContext*, const GrColorSpaceInfo&) const override; #endif void toString(SkString* str) const override; diff --git a/include/effects/SkToSRGBColorFilter.h b/include/effects/SkToSRGBColorFilter.h index 431cc02583..8642c019c3 100644 --- a/include/effects/SkToSRGBColorFilter.h +++ b/include/effects/SkToSRGBColorFilter.h @@ -22,8 +22,8 @@ public: static sk_sp Make(sk_sp srcColorSpace); #if SK_SUPPORT_GPU - std::unique_ptr asFragmentProcessor(GrContext*, - SkColorSpace*) const override; + std::unique_ptr asFragmentProcessor( + GrContext*, const GrColorSpaceInfo&) const override; #endif SK_TO_STRING_OVERRIDE() -- cgit v1.2.3