skia2/include/core
Mike Klein cb92744d3d SkColorFilters::WithWorkingFormat
https://docs.google.com/document/d/1z9ZODlZX4XXbfOjh2t1-1Z7FJcCCcOfbrEjiFzPE4vg/edit?usp=sharing&resourcekey=0-Io-07D1zm1yKMQN2UAiYBw

This approach lets us write color filters that want to work in
particular color spaces and alpha formats and adapt them to our normal
pipeline.  It should work with pre-canned and runtime effects, and we
can do the same sort of thing for shaders too.

Some features are designed for using this with the high-contrast filter:

   - ability to change working tf and gamut separately: as written the
     HC effect only wants to work in linear space without changing
     gamut, which is I bet will be a common desired mode.  But other
     effects may want to fully change the working color space, e.g. to
     sRGB or XYZ.

   - adapting the alpha type to unpremul is mostly a flourish: you could
     do it yourself in sksl, but we might as well do it if doing other
     transforms anyway (it's cheaper this way than doing it yourself),
     and this may make it easier to adapt non-runtime effects.
     (I bet most color filters actually want to be unpremul.)

I briefly also included a knob to control how this effect treats a
nullptr dst color space, but I've come back around to that not being a
parameter.  I think this is a situation where we know best.

New GM to demo.

Cq-Include-Trybots: luci.chromium.try:linux-blink-rel
Change-Id: I420e3a2aa648f314c019a98bfdcd44e810a3dac6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/368336
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2021-02-11 19:44:33 +00:00
..
SkAnnotation.h
SkBBHFactory.h Fix clang 12 Wsuggest-override and Wsuggest-destructor-override 2020-07-22 01:11:36 +00:00
SkBitmap.h Bitmap.asImage() 2020-12-23 15:54:57 +00:00
SkBlendMode.h Work to improve blendmode dox 2021-02-08 18:41:01 +00:00
SkBlurTypes.h
SkCanvas.h Remove dead code for 2021-02-11 01:19:21 +00:00
SkCanvasVirtualEnforcer.h Pass sampling to drawImageSet 2021-01-05 19:40:31 +00:00
SkClipOp.h Update SkClipOp::kMax_EnumValue to match non-deprecated values 2020-09-28 15:30:33 +00:00
SkColor.h Support luminance-alpha GL format for YUVA planes 2020-12-17 14:54:25 +00:00
SkColorFilter.h SkColorFilters::WithWorkingFormat 2021-02-11 19:44:33 +00:00
SkColorPriv.h move SkTPin to include/private 2020-10-16 19:45:11 +00:00
SkColorSpace.h Enable ClangTidy check llvm-namespace-comment. 2020-08-06 19:07:52 +00:00
SkContourMeasure.h [canvaskit] Flesh out remaining docs for core CanvasKit. 2020-10-05 11:47:40 +00:00
SkCoverageMode.h
SkCubicMap.h
SkData.h Replace 'typedef xxxxx INHERITED' with 'using INHERITED = xxxx;'. 2020-09-03 03:41:26 +00:00
SkDataTable.h Replace 'typedef xxxxx INHERITED' with 'using INHERITED = xxxx;'. 2020-09-03 03:41:26 +00:00
SkDeferredDisplayList.h Require a direct context to precompile a DDL's programs 2020-08-14 14:35:41 +00:00
SkDeferredDisplayListRecorder.h Remove SkYUVASizeInfo, make SkYUVAIndex a private part of SkYUVAInfo 2021-01-12 15:06:26 +00:00
SkDocument.h Replace 'typedef xxxxx INHERITED' with 'using INHERITED = xxxx;'. 2020-09-03 03:41:26 +00:00
SkDrawable.h
SkDrawLooper.h Hide (unused) SkDrawLooper 2021-02-07 12:49:53 +00:00
SkEncodedImageFormat.h Reland "heif: Add AVIF type and AVIF sniffing" 2020-11-05 15:25:52 +00:00
SkExecutor.h Allow SkThreadPool to be non-borrowing 2020-04-23 16:11:28 +00:00
SkFilterQuality.h
SkFlattenable.h Replace 'typedef xxxxx INHERITED' with 'using INHERITED = xxxx;'. 2020-09-03 03:41:26 +00:00
SkFont.h Update SkFont::measureText documentation. 2020-11-11 17:15:35 +00:00
SkFontArguments.h Remove SkFontArguments::Axis. 2020-07-15 20:59:22 +00:00
SkFontMetrics.h SkCustomTypefaceBuilder to set SkFontStyle 2020-08-19 00:09:55 +00:00
SkFontMgr.h Replace 'typedef xxxxx INHERITED' with 'using INHERITED = xxxx;'. 2020-09-03 03:41:26 +00:00
SkFontParameters.h Fix DWrite axis design parameters. 2020-12-01 15:00:33 +00:00
SkFontStyle.h move SkTPin to include/private 2020-10-16 19:45:11 +00:00
SkFontTypes.h
SkGraphics.h add SkGraphics::AllowJIT() 2020-08-06 14:38:26 +00:00
SkICC.h
SkImage.h SkImage::textureSize replacement for GrDirectContext::ComputeImageSize. 2021-02-11 16:08:55 +00:00
SkImageEncoder.h Bitmap.asImage() 2020-12-23 15:54:57 +00:00
SkImageFilter.h Reland "Remove deprecated SkImageFilter::MakeMatrixFilter" 2021-02-04 21:17:58 +00:00
SkImageGenerator.h Remove SkYUVASizeInfo, make SkYUVAIndex a private part of SkYUVAInfo 2021-01-12 15:06:26 +00:00
SkImageInfo.h Add several more values to SkYUVColorSpace 2020-07-24 18:49:10 +00:00
SkM44.h Add rc accessor method to SkMatrix. 2020-09-22 21:32:20 +00:00
SkMallocPixelRef.h Enable ClangTidy check llvm-namespace-comment. 2020-08-06 19:07:52 +00:00
SkMaskFilter.h remove unused maskfilter helpers: Combine, Compose 2020-05-05 19:10:00 +00:00
SkMath.h impl SkMulDiv255Round with SkMul16ShiftRound 2020-09-09 17:01:17 +00:00
SkMatrix44.h Revert "transition matrix44 to opt-in only" 2020-04-16 10:01:29 +00:00
SkMatrix.h [skottie] Implement skew & skew axis support 2021-02-08 22:24:38 +00:00
SkMilestone.h Update Skia milestone to 90 2021-01-14 14:50:08 +00:00
SkOverdrawCanvas.h remove dead code from old drawimage virtuals 2021-01-21 01:26:15 +00:00
SkPaint.h Work on hiding filter-quality 2020-12-23 17:05:17 +00:00
SkPath.h Add query to test our cached convexity 2021-01-19 14:54:44 +00:00
SkPathBuilder.h SkPathBuider::addPath() 2021-01-26 03:53:49 +00:00
SkPathEffect.h Replace 'typedef xxxxx INHERITED' with 'using INHERITED = xxxx;'. 2020-09-03 03:41:26 +00:00
SkPathMeasure.h [canvaskit] Flesh out remaining docs for core CanvasKit. 2020-10-05 11:47:40 +00:00
SkPathTypes.h Move convexity enum out of public 2020-08-30 13:04:22 +00:00
SkPicture.h Add filter param to picture-shader 2021-01-15 21:05:56 +00:00
SkPictureRecorder.h Almost remove GrContext 2020-10-20 15:52:01 +00:00
SkPixelRef.h Revert "Migrate uses of deferred proxies to lazy proxies" 2021-02-10 14:52:53 +00:00
SkPixmap.h Remove dead code (from old flags) 2020-12-11 02:35:49 +00:00
SkPngChunkReader.h
SkPoint3.h
SkPoint.h
SkPromiseImageTexture.h Simplify promise image callbacks. 2020-11-10 02:47:56 +00:00
SkRasterHandleAllocator.h
SkRect.h Add GrSurfaceFillContext 2020-12-16 20:48:43 +00:00
SkRefCnt.h
SkRegion.h
SkRRect.h Add halfWidth/halfHeight functions to SkRectPriv 2020-12-22 20:42:43 +00:00
SkRSXform.h
SkSamplingOptions.h Name common cubic resamplers 2021-02-05 19:21:04 +00:00
SkScalar.h Format and comment SkScalarInterpFunc 2020-08-26 20:50:34 +00:00
SkSerialProcs.h
SkShader.h Almost remove GrContext 2020-10-20 15:52:01 +00:00
SkSize.h
SkStream.h Add SkFILEStream constructor which takes a size. 2020-09-11 19:50:24 +00:00
SkString.h Use SkScalar type where appropriate. 2020-07-28 20:13:37 +00:00
SkStrokeRec.h Relax SkStrokeRec::hasEqualEffect 2020-09-15 20:05:40 +00:00
SkSurface.h Remove obsolete flag SK_SUPPORT_LEGACY_ASYNCRESCALE_QUALITY 2021-01-11 18:02:07 +00:00
SkSurfaceCharacterization.h Add GrInternalSurfaceFlag for vulkan input attachment. 2020-08-27 20:05:29 +00:00
SkSurfaceProps.h Remove code guarded by SK_LEGACY_SURFACE_PROPS. 2020-10-23 22:41:36 +00:00
SkSwizzle.h
SkTextBlob.h Replace 'typedef xxxxx INHERITED' with 'using INHERITED = xxxx;'. 2020-09-03 03:41:26 +00:00
SkTileMode.h
SkTime.h Remove SK_REQUIRE_LOCAL_VAR macro. 2020-07-31 02:32:01 +00:00
SkTraceMemoryDump.h
SkTypeface.h Make onCreateScalerContext return unique_ptr. 2020-12-28 17:31:09 +00:00
SkTypes.h remove SK_BUILD_NO_OPTS 2020-12-08 19:44:02 +00:00
SkUnPreMultiply.h
SkVertices.h Enable ClangTidy check readability-const-return-type. 2020-08-07 17:42:38 +00:00
SkYUVAInfo.h Reland "Push SkYUVAInfo into GrYUVToRGBEffect." 2021-01-13 22:08:44 +00:00
SkYUVAPixmaps.h Remove SkYUVASizeInfo, make SkYUVAIndex a private part of SkYUVAInfo 2021-01-12 15:06:26 +00:00