aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
Commit message (Collapse)AuthorAge
* Alloc glyph image correctly for SkMask::k3D_Format.Gravatar Ben Wagner2017-11-13
| | | | | | | | | | | | | | | | | This removes the no longer used outside Skia SK_SUPPORT_LEGACY_EMBOSSMASKFILTER define, and either deletes the code it guards or updates it to use the new emboss mask filter factory. This re-enables the code to test the emboss mask filter. Also added is a test to ensure that embossed text is drawn correctly, as before this glyphs did not allocate the proper amount of memory for the k3D_Format which this mask filter produces. This also fixes SkEmbossMask::Emboss to write the whole of the mul and add planes to avoid pixel differences and MemorySanitizer errors. Change-Id: Ib492c72a19d6a27d140e3cd48179a3ca9ce313f5 Reviewed-on: https://skia-review.googlesource.com/70260 Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Herb Derby <herb@google.com>
* Extract code for safely creating SkMasks try 2Gravatar Herb Derby2017-11-10
| | | | | | | | | | | | This is in preparation for adding a faster small radii blur. Be sure to obey the original semantics about handling dst when src.fImage is null. Change-Id: Ic0ff0ac81494799e2d5037283904f1094309c622 Reviewed-on: https://skia-review.googlesource.com/70025 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Florin Malita <fmalita@chromium.org>
* remove legacy code for resolutionGravatar Mike Reed2017-11-10
| | | | | | | | Bug: skia: Change-Id: I6909325d4ee51140ec0edb47682de18617c23cc7 Reviewed-on: https://skia-review.googlesource.com/70100 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
* Try 2 for Gauss filter calculationGravatar Herb Derby2017-11-10
| | | | | | | | | | Originally reviewed at: https://skia-review.googlesource.com/c/skia/+/67723 Change-Id: Ie62d81f818899f3a79df888c1594d3fbccf6d414 Reviewed-on: https://skia-review.googlesource.com/69681 Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Revert "Extract code for safely creating SkMasks."Gravatar Greg Daniel2017-11-10
| | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 66f2b5eab2ba03950b9d502ed3fc1863d55a9664. Reason for revert: breaking lots of bots Original change's description: > Extract code for safely creating SkMasks. > > This is in preparation for adding a faster small radii blur. > > Change-Id: I8afd4642ebafa63a45031a7a0bd7a720951dc102 > Reviewed-on: https://skia-review.googlesource.com/70040 > Reviewed-by: Florin Malita <fmalita@chromium.org> > Commit-Queue: Herb Derby <herb@google.com> TBR=herb@google.com,fmalita@chromium.org,fmalita@google.com Change-Id: I83a6953f9ae240cc5f09206e3f77490882869a9f No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/70104 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Extract code for safely creating SkMasks.Gravatar Herb Derby2017-11-10
| | | | | | | | | This is in preparation for adding a faster small radii blur. Change-Id: I8afd4642ebafa63a45031a7a0bd7a720951dc102 Reviewed-on: https://skia-review.googlesource.com/70040 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Herb Derby <herb@google.com>
* Revert "Gauss filter calculation"Gravatar Herb Derby2017-11-09
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 53ec7dc7cb523f220a9f5cd713b241c706779c81. Reason for revert: Segv on very specific machines. Original change's description: > Gauss filter calculation > > Change-Id: I921ef815d4f788c312aa729f353b6ea154140555 > Reviewed-on: https://skia-review.googlesource.com/67723 > Commit-Queue: Herb Derby <herb@google.com> > Reviewed-by: Robert Phillips <robertphillips@google.com> TBR=herb@google.com,robertphillips@google.com Change-Id: I15164809d081dee0076e815b40fbfdbc6374cfba No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/69641 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Herb Derby <herb@google.com>
* Revert "Revert "Remove MakeForLocalSpace since picture image is sufficient""Gravatar Mike Reed2017-11-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit fc45998242b6e95ff610fd2c4edcf72c10e536ab. Reason for revert: google3 updated (I think) Original change's description: > Revert "Remove MakeForLocalSpace since picture image is sufficient" > > This reverts commit 0d8766c84c80537f323947089cc196c3cca106f4. > > Reason for revert: broke google3 > > Original change's description: > > Remove MakeForLocalSpace since picture image is sufficient > > > > Bug: skia: > > Change-Id: If38e702c418e93141311490edf447d1f09ed4434 > > Reviewed-on: https://skia-review.googlesource.com/68640 > > Commit-Queue: Mike Reed <reed@google.com> > > Reviewed-by: Florin Malita <fmalita@chromium.org> > > TBR=robertphillips@google.com,fmalita@chromium.org,reed@google.com > > Change-Id: I3dec3d2c704e02b4db5977c27cc3e6d9f1c68ed5 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia: > Reviewed-on: https://skia-review.googlesource.com/69500 > Reviewed-by: Mike Reed <reed@google.com> > Commit-Queue: Mike Reed <reed@google.com> TBR=robertphillips@google.com,fmalita@chromium.org,reed@google.com Change-Id: I5751fa637d280f361dea0f248a43c1f7e9bd8bdc No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/69661 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Include target CS in SkColorSpaceXformCanvas' image infoGravatar Brian Osman2017-11-09
| | | | | | | | Bug: skia: Change-Id: Idcf9c933e1a236772e0b5edd3ba8437d1a6ae293 Reviewed-on: https://skia-review.googlesource.com/69502 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Brian Osman <brianosman@google.com>
* Gauss filter calculationGravatar Herb Derby2017-11-09
| | | | | | | Change-Id: I921ef815d4f788c312aa729f353b6ea154140555 Reviewed-on: https://skia-review.googlesource.com/67723 Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Revert "Remove MakeForLocalSpace since picture image is sufficient"Gravatar Mike Reed2017-11-09
| | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 0d8766c84c80537f323947089cc196c3cca106f4. Reason for revert: broke google3 Original change's description: > Remove MakeForLocalSpace since picture image is sufficient > > Bug: skia: > Change-Id: If38e702c418e93141311490edf447d1f09ed4434 > Reviewed-on: https://skia-review.googlesource.com/68640 > Commit-Queue: Mike Reed <reed@google.com> > Reviewed-by: Florin Malita <fmalita@chromium.org> TBR=robertphillips@google.com,fmalita@chromium.org,reed@google.com Change-Id: I3dec3d2c704e02b4db5977c27cc3e6d9f1c68ed5 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/69500 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Remove MakeForLocalSpace since picture image is sufficientGravatar Mike Reed2017-11-09
| | | | | | | | Bug: skia: Change-Id: If38e702c418e93141311490edf447d1f09ed4434 Reviewed-on: https://skia-review.googlesource.com/68640 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
* Remove dead code for the incorrect handling of small radii blurs.Gravatar Herb Derby2017-11-09
| | | | | | | Change-Id: I06be8fb092ee50df7be89c51d512791278bc4e27 Reviewed-on: https://skia-review.googlesource.com/69280 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Herb Derby <herb@google.com>
* Harden SkClassifyCubicGravatar Chris Dalton2017-11-09
| | | | | | | | BUG=chromium:743617 Change-Id: Idfb89832b48ebd60fd9109cd526bdd5cd5931ada Reviewed-on: https://skia-review.googlesource.com/68980 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* Compute more accurate containedInClipGravatar Yuqian Li2017-11-09
| | | | | | | | | | | | | Eventually, we'll remove containedInClip from the function parameters and just compute it using ir and clipBounds. The current approach is for preparing rebaseline. TBR: reed@google.com Bug: skia:7271 Change-Id: Ife60e173d9f4f1c9ec80d13a2f7a88a0433b61e9 Reviewed-on: https://skia-review.googlesource.com/69220 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Prepare to enable explicit gpu resource allocation (take 2)Gravatar Robert Phillips2017-11-08
| | | | | | | Change-Id: I3fd78d53e8bea84c0217b9fe6e180eaa9e4ac753 Reviewed-on: https://skia-review.googlesource.com/68920 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Revert "Prepare to enable explicit gpu resource allocation"Gravatar Greg Daniel2017-11-08
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit f290376736b42a19b87da78c6ba2558313896860. Reason for revert: Changed generated effect instead of FP Original change's description: > Prepare to enable explicit gpu resource allocation > > Change-Id: I407e45711c61831febbac3d3d3a88e3fdde92c5f > Reviewed-on: https://skia-review.googlesource.com/68212 > Commit-Queue: Robert Phillips <robertphillips@google.com> > Reviewed-by: Brian Salomon <bsalomon@google.com> TBR=bsalomon@google.com,robertphillips@google.com Change-Id: I949500d94c7461b7cf38d615117cfcdc9a791780 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/68900 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Prepare to enable explicit gpu resource allocationGravatar Robert Phillips2017-11-08
| | | | | | | Change-Id: I407e45711c61831febbac3d3d3a88e3fdde92c5f Reviewed-on: https://skia-review.googlesource.com/68212 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* change default props for PictureImage to be unknown_pixel_geometryGravatar Mike Reed2017-11-08
| | | | | | | | Bug: skia: Change-Id: Id61460dbe3f3d21207ae05ba5adf494b0a68fe31 Reviewed-on: https://skia-review.googlesource.com/68760 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
* move parts of SkPoint to SkPointPrivGravatar Cary Clark2017-11-08
| | | | | | | | | | | | Move specialized SkPoint methods to SkPointPriv. Use constexpr and inline initialization where possible. R=reed@google.com,bsalomon@google.com Bug: skia: 6898 Change-Id: I01ec5186f010f2dc80c068c70d9cc352f3221338 Reviewed-on: https://skia-review.googlesource.com/68700 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Ravi Mistry <rmistry@google.com>
* add surfaceprops param to SkCanvas::MakeRasterDirectGravatar Mike Reed2017-11-08
| | | | | | | | Bug: skia: Change-Id: I8b69280469cdf34c3c3cb126db9457a712143f88 Reviewed-on: https://skia-review.googlesource.com/68701 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* Glyphs without paths don't draw with paths.Gravatar Ben Wagner2017-11-08
| | | | | | | | | | | | If a glyph doesn't have a path, don't try to draw it from the non-existent path. Bug: skia:4904 Change-Id: I8d7a061146b54c2f4a975280a6fb6ae3043ea82b Reviewed-on: https://skia-review.googlesource.com/68216 Reviewed-by: Heather Miller <hcm@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* Correct edges_too_closeGravatar Yuqian Li2017-11-07
| | | | | | | | | | | | | | | | | If the next edge has 0 fDX, we should add a SLACK = 1 so two edges with fX less than 1 pixel apart should be considered close, and noRealBlitter should be true to force the use of AdditiveBlitter and the cumulation of alpha. The changed GM will show bleed through if SLACK is 0. The artifact without the fix can be seen at: https://fiddle.skia.org/c/f6912f1af6c14e054f5b5935a93380ea Bug: skia: Change-Id: I15f9c3aef25a0357cd11d447e7bf0b4fbac0ce67 Reviewed-on: https://skia-review.googlesource.com/67804 Commit-Queue: Yuqian Li <liyuqian@google.com> Reviewed-by: Cary Clark <caryclark@google.com>
* make point array methods privateGravatar Cary Clark2017-11-07
| | | | | | | | | | | | | | | | | | | | | | | Moved method are not used by chromium, google3, or android. SkPoint::setRectIFan isn't used or tested at all. SkPoint::setRectFan and SkPoint::setRectTriStrip are only used internally. These routines pretend that a SkPoint is part of an array of points. Since that's kind of an odd contract to make public, and because they aren't used outside of Skia, relegate them to a priv file. R=bsalomon@google.com,reed@google.com Bug: skia: 6898 Change-Id: I5ec2eb47799f6fd4b2994da962b1fa69ce659931 Reviewed-on: https://skia-review.googlesource.com/68121 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
* This is a reland of 67340. This CL fixes the broken layout tests byGravatar Yuqian Li2017-11-07
| | | | | | | | | | | preserving the containedInClip boolean. We will eventually remove it and rebaseline the layout tests. Bug: skia:7271 Change-Id: I20e7220340d561ea2c50d30cd5d6ac6d2b4b3743 Reviewed-on: https://skia-review.googlesource.com/68100 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* add a SkFontMgr to DM that returns portable fontsGravatar Mike Klein2017-11-06
| | | | | | | | | Controlled by --[no]nativeFonts, and still defaults to native fonts. Change-Id: Ib2879e69fadb63ddb5a17a7e4ae227941893b8cf Reviewed-on: https://skia-review.googlesource.com/67806 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Setup CCPR testing with GrMockContextGravatar Chris Dalton2017-11-06
| | | | | | | | | | | Beefs up the mock context to be able to support CCPR, sets up a framework for testing CCPR with the mock context, and adds a new test. Bug: skia: Change-Id: If95f92726f7b1a7f52ad04ca8126551f58ea8032 Reviewed-on: https://skia-review.googlesource.com/67980 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* Revert "Simplify fill path call by removing do_fill_path"Gravatar Yuqian Li2017-11-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 12f322b9d4e98619bd128f39b02d3a6f3b78ba79. Reason for revert: Unexpectedly break Chrome layout tests. Will check why. Original change's description: > Simplify fill path call by removing do_fill_path > > The git diff is not very informative for this CL. > Here's a better diff: > > 1. do_fill_path is removed and its content is copied to AntiFillPath > > 2. Any call to do_fill_path is removed. > > 3. std::function FillPathFunc is removed (and replaced by direct > AAAFillPath, DAAFillPath, and SAAFillPath call). > > 4. The old call chain is: > AntiFillPath -> (AAAFillPath/DAAFillPath/...) > -> do_fill_path > -> specific FillPathFunc > The new call chain is: > AntiFillPath -> AAAFillPath/DAAFillPath/SAAFillPath > > This is made possible by the removal of SK_SUPPORT_LEGACY_AA_CHOICE > which makes sure that AntiFillPath is the only function that makes > the choice of AAA/DAA/SAA. > > In the next CL, I'll improve the structure of SkScan::AntiFillPath > to prepare for Threaded Backend's init-once change. > > Bug: skia: > Change-Id: If6ebbdab207cadb7bfe2cb3fcf33ea3d180c3896 > Reviewed-on: https://skia-review.googlesource.com/67340 > Reviewed-by: Mike Reed <reed@google.com> > Reviewed-by: Cary Clark <caryclark@google.com> > Commit-Queue: Yuqian Li <liyuqian@google.com> TBR=caryclark@google.com,liyuqian@google.com,reed@google.com,caryclark@skia.org Change-Id: I7d9517574265db5bc372a5749e6480df8e938f2e No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/67855 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Simplify fill path call by removing do_fill_pathGravatar Yuqian Li2017-11-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The git diff is not very informative for this CL. Here's a better diff: 1. do_fill_path is removed and its content is copied to AntiFillPath 2. Any call to do_fill_path is removed. 3. std::function FillPathFunc is removed (and replaced by direct AAAFillPath, DAAFillPath, and SAAFillPath call). 4. The old call chain is: AntiFillPath -> (AAAFillPath/DAAFillPath/...) -> do_fill_path -> specific FillPathFunc The new call chain is: AntiFillPath -> AAAFillPath/DAAFillPath/SAAFillPath This is made possible by the removal of SK_SUPPORT_LEGACY_AA_CHOICE which makes sure that AntiFillPath is the only function that makes the choice of AAA/DAA/SAA. In the next CL, I'll improve the structure of SkScan::AntiFillPath to prepare for Threaded Backend's init-once change. Bug: skia: Change-Id: If6ebbdab207cadb7bfe2cb3fcf33ea3d180c3896 Reviewed-on: https://skia-review.googlesource.com/67340 Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Fix another blurring bug with sRGB sources and legacy destsGravatar Brian Osman2017-11-06
| | | | | | | | | | | | | | By default, we propagate the input image's config to the temporary surface used for blurring. Without sRGB write control (eg Vulkan), we would end up unable to suppress the linear -> sRGB conversion, causing the blur results to be far too bright. Now, if we're rendering to a non-color correct dest, ensure that we never create an sRGB surface. Bug: skia: Change-Id: I18f5760005c11f788869251e58569029ce9f5c27 Reviewed-on: https://skia-review.googlesource.com/67845 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Make SkImageGeneratorCG apply encoded originGravatar Leon Scroggins III2017-11-03
| | | | | | | | | | | | | | | | | | | | | | | | | | SkImageGeneratorCG: - Detect the origin and apply it to the output - Deprecate NewFromEncodedCG and add MakeFromEncodedCG SkCodecImageGenerator: - Move code elsewhere for sharing - Apply origin for incomplete decodes SkPixmap.cpp/SkPixmapPriv.h: - Now has the shared code for generators to apply origin DMSrcSink.cpp: - Call MakeFromEncodedCG SkCGUtils.h: - Add a version of SkCopyPixelsFromCGImage that takes an SkPixmap Bug: skia:7138 Bug: skia:3834 Change-Id: Ic6dbc76360c6a84913b67373582f328d3946d637 Reviewed-on: https://skia-review.googlesource.com/63740 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Leon Scroggins <scroggo@google.com>
* create imagepriv and name paramsGravatar Cary Clark2017-11-03
| | | | | | | | | | | | | | Named all parameters and made the names consistent for documentation. Moved SK_IMAGEFILTER_UNFLATTEN_COMMON to private file. TBR=reed@google.com Bug: skia:6898 Change-Id: I1343d2b16d4217088fa3bc9c40f1f4177fa32740 Reviewed-on: https://skia-review.googlesource.com/66521 Reviewed-by: Cary Clark <caryclark@skia.org> Commit-Queue: Cary Clark <caryclark@skia.org>
* add some lowp gradient stagesGravatar Mike Klein2017-11-03
| | | | | | | | | | | | | | I was originally going to add these to help test a lowp dither, but after looking at diffs I don't think lowp dither is a good idea. Non-dithered lowp gradients look fine to me so far. I'd have done conics, but they scare me. Change-Id: I8f5e75aec726983186214845ca38cfa0d54496b3 Reviewed-on: https://skia-review.googlesource.com/66460 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Florin Malita <fmalita@chromium.org>
* Remove SK_SUPPORT_LEGACY_AA_CHOICEGravatar Yuqian Li2017-11-02
| | | | | | | | Bug: skia: Change-Id: If754225685699c1d1e8e516fb2a4671da2d13572 Reviewed-on: https://skia-review.googlesource.com/67260 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Fix GPU blurring when using SkColorSpaceXformCanvasGravatar Brian Osman2017-11-02
| | | | | | | | | | | | | Several GMs didn't draw at all (and asserted in debug builds). This fixes all of that, so that the xform canvas (or even just pure-legaacy canvas) doesn't accidentally blur in linear space by creating sRGB render target contexts for sRGB-tagged inputs. Bug: skia: Change-Id: I37c567a1c5b0e004dc301e5c272c7b470ac5f4c8 Reviewed-on: https://skia-review.googlesource.com/66884 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Streamline legacy gradient color conversionGravatar Florin Malita2017-11-01
| | | | | | | | | | | | | | | | To produce colors for interpolation in legacy mode, we currently do something like SkColor c = Sk4f_toS32(swizzle_rb(Sk4f::Load(c4f))); color4f = swizzle_rb(SkNx_cast<float>(Sk4b::Load(&c)) * (1/255.0f)); Let's see if we can streamline some of that. Change-Id: I423b5aa8c2df8d115cc236d5f0a2e79923a9c2cc Reviewed-on: https://skia-review.googlesource.com/66142 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Brian Osman <brianosman@google.com>
* Directly use SkScalerContextRec.Gravatar Ben Wagner2017-11-01
| | | | | | | | | | | | | | | | | Some time ago SkScalerContext::Rec was made SkScalerContextRec so that it could be forward declared. However, SkScalerContext::Rec remains as a typedef to SkScalerContextRec. This removes the typedef and updates the users to use the SkScalerContextRec type directly. This change was prompted by my own confusion when looking at some code which mixed these two, by IntelliSense's confusion when declaring an argument with one and defining with the other, and reducing the general proliferation of nested 'Rec' types in Skia. Change-Id: I3a23a4bdd83a591807c78cea6aa7a0117544b614 Reviewed-on: https://skia-review.googlesource.com/66153 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* consolidate SkSRGB functions, and remove unusedGravatar Mike Klein2017-11-01
| | | | | | | | | | | | | This kills off the unused routines in this file, and folds the singly-used routines into sk_linear_to_srgb(). It also takes away the templating. No one's calling these with anything but Sk4f. Change-Id: I93ba7c59ea28c9c1a8f852167c31cdb44d53bb5a Reviewed-on: https://skia-review.googlesource.com/66152 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Plumb internal helper to enable more GPU GMs w/SkColorSpaceXformCanvasGravatar Brian Osman2017-11-01
| | | | | | | | | | | | API change isn't really public. TBR:bsalomon@google.com Bug: skia: Change-Id: I3a1ae5d7ddb562387e8b8e1248b347704f88037b Reviewed-on: https://skia-review.googlesource.com/66144 Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Brian Osman <brianosman@google.com>
* Fix undefined behavior in normalize_t_sGravatar Chris Dalton2017-10-31
| | | | | | | | | BUG=chromium:743617 Change-Id: I00ad3103cdd5b7d2eac3b6827a3c2932009042a9 Reviewed-on: https://skia-review.googlesource.com/65860 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* Some lowp refactoringGravatar Mike Klein2017-10-31
| | | | | | | | | | | | | | | | | | 1) Move a couple stages around in the enum to places that make more sense, and guass_a_to_rbga in the code too. 2) mirror the SkRasterPipeline stage enum with either: LOWP(st): the stage is implemented in low precision TODO(st): the stage should be lowp, but isn't NOPE(st): the stage shouldn't be done in lowp. 3) statically enforce that all stages are covered by one of LOWP, TODO, or NOPE. Change-Id: I06c7a7e470663ef73bf652c1b65c0d3c89f0d767 Reviewed-on: https://skia-review.googlesource.com/63800 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* clean up SK_LEGACY_LOWP_STAGESGravatar Mike Klein2017-10-31
| | | | | | | Change-Id: I5629e74c4c13ddb9217fd3c2df3388030fa03f0c Reviewed-on: https://skia-review.googlesource.com/63780 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Simplify SkColorSpace::MakeICCGravatar Leon Scroggins III2017-10-31
| | | | | | | | | | | | | | | | | | | Rather than restricting the supported ICC types in MakeICC, create any ICC type that we support, and make the client reject them as necessary by querying the SkColorSpace::Type. Remove ICCTypeFlag and replace uses of it with SkColorSpace::Type. This depends on a change in Chromium (https://chromium-review.googlesource.com/c/chromium/src/+/741843). Without that, this change will start allowing non-CMYK images to use CMYK profiles. Bug: 727128 Change-Id: I085b4665e49bc80083264496d864cc4cd62ae914 Reviewed-on: https://skia-review.googlesource.com/64841 Commit-Queue: Leon Scroggins <scroggo@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Add support for transfer functions to GrColorSpaceXformGravatar Brian Osman2017-10-31
| | | | | | | | | | | | | | | | | | | With this change, untagged sources (eg N32) are treated as sRGB data, which causes a huge number of GMs to render more correctly in GPU sRGB/F16/etc... configs. Also, because the sources are treated as having a color space, we actually do gamut conversion for wide or narrow gamut outputs. This change also applies the transfer function math to individual colors in the case of gradient stops and color shaders. (The CPU backend doesn't do this yet, but I think we've decided there's no reason not to support it). Bug: skia: Change-Id: If76e9e4a268f9f74110ff4bbe4fe189ba5d19d9f Reviewed-on: https://skia-review.googlesource.com/64100 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Have mip status match surface when snapping image from wrapped objectGravatar Greg Daniel2017-10-30
| | | | | | | | | | Also fixes some bugs involved with creating mipped SkSurfaces. Bug: skia: Change-Id: I6e0109000eadd2bdee4a907d3ee2231104528165 Reviewed-on: https://skia-review.googlesource.com/65063 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Add mip support to GrAHardwareBufferImageGeneratorGravatar Greg Daniel2017-10-30
| | | | | | | | Bug: skia: Change-Id: I482d8f9937c86ed441016afef2d8f924282dd17a Reviewed-on: https://skia-review.googlesource.com/63861 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com>
* Initialize mask to 0 during AntiRect optimizationGravatar Yuqian Li2017-10-30
| | | | | | | | | | | | Previously, the mask is uninitialized (which is probably caught by MSAN) for the region to the left and right of fAntiRect when fAntiRect is non-empty. That causes skbug.com/7192 Bug: skia:7192 Change-Id: Ida0551d00f0ac8053a1e0232cfbc4f05c9f35c6c Reviewed-on: https://skia-review.googlesource.com/65023 Commit-Queue: Yuqian Li <liyuqian@google.com> Reviewed-by: Cary Clark <caryclark@google.com>
* remove SkThread, using std::thread insteadGravatar Mike Klein2017-10-30
| | | | | | | Change-Id: I871dd5eea4496e87c206b46d9eae81cb521b11ce Reviewed-on: https://skia-review.googlesource.com/65103 Reviewed-by: Hal Canary <halcanary@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Do not TryBlitFatAntiRect if isInverseGravatar Yuqian Li2017-10-30
| | | | | | | | | | | | | This fixes https://bugs.chromium.org/p/skia/issues/detail?id=7193 That bug only exists in our FDAA (forceDAA) bots (and maybe future threaded backend) because we don't use DAA for convex paths otherwise. Bug: skia:7193 Change-Id: I5e8660012655610417b40d964ee8d21b050a7820 Reviewed-on: https://skia-review.googlesource.com/65061 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* add Type enum to SkColorSpaceGravatar Mike Reed2017-10-27
| | | | | | | | Bug: 727128 Change-Id: I116de4efd6e64504a4e1892f431f528533b1173a Reviewed-on: https://skia-review.googlesource.com/64261 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com>