aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/shaders
Commit message (Collapse)AuthorAge
* remove defines and add commasGravatar Cary Clark2018-05-21
| | | | | | | | | | | | | | | | | | | | | | | | Preparation for generating bookmaker files for all remaining interfaces Standardize enum and enum classes by including a comma after the last entry. Replace flatten-related #define in public interfaces with their equivalent. The motivation is to give documentation something to refer to. An alternative would be to move part or all of this out of the public interface; something I can work on in a follow-up CL. R=reed@google.com,bsalomon@google.com Bug: skia:6898 Change-Id: I4b865f6ec3d8f5d31e50448fef7d2714510302f0 Reviewed-on: https://skia-review.googlesource.com/129312 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Cary Clark <caryclark@skia.org>
* Revert "remove toString"Gravatar Cary Clark2018-05-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 5191880cbf3ee4d122b0d11b4945fbab0784fda7. Reason for revert: broke flutter Original change's description: > remove toString > > toString may have been used by obsolete debugger only > find out if that is so > > R=​brianosman@google.com,bsalomon@google.com > > Docs-Preview: https://skia.org/?cl=119894 > Bug:830651 > Change-Id: I737f19b7d3fbc869bea2f443fa3b5ed7c1393ffd > Reviewed-on: https://skia-review.googlesource.com/119894 > Commit-Queue: Cary Clark <caryclark@google.com> > Reviewed-by: Brian Salomon <bsalomon@google.com> TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,caryclark@skia.org Change-Id: I9f81de6c3615ee0608bcea9081b77239b4b8816c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 830651 Reviewed-on: https://skia-review.googlesource.com/129340 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
* remove toStringGravatar Cary Clark2018-05-20
| | | | | | | | | | | | | | toString may have been used by obsolete debugger only find out if that is so R=brianosman@google.com,bsalomon@google.com Docs-Preview: https://skia.org/?cl=119894 Bug:830651 Change-Id: I737f19b7d3fbc869bea2f443fa3b5ed7c1393ffd Reviewed-on: https://skia-review.googlesource.com/119894 Commit-Queue: Cary Clark <caryclark@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* validate perlin inputsGravatar Mike Reed2018-05-18
| | | | | | | | Bug: oss-fuzz:8359 Change-Id: Ib539c8549f2e00d6b0da099f48c4084d2bfbefd8 Reviewed-on: https://skia-review.googlesource.com/129180 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Return nullptr when ReadBuffer becomes invalidGravatar Kevin Lubick2018-05-17
| | | | | | | | | | | | | | | | | This especially helps in SkDrawLooper because we can bail out early instead of looping for a potentially long time, e.g. when fuzzed input says count is a large number. This also cleans up validate in a few spots, and adds validateCanReadN as a helper function. Bug: skia:7937 Change-Id: Ic5eff357c8cadc91eeafc6e39c78c570ba74df2f Reviewed-on: https://skia-review.googlesource.com/128847 Commit-Queue: Kevin Lubick <kjlubick@google.com> Commit-Queue: Mike Klein <mtklein@google.com> Reviewed-by: Mike Klein <mtklein@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
* Fix UBSAN warnings in SkPerlinNoiseShaderImplGravatar Kevin Lubick2018-05-16
| | | | | | | | | | Also update the docs in places. Bug: oss-fuzz:6138, oss-fuzz:6275, oss-fuzz:6118 Change-Id: Idfef4118dd6e58f8aa528365895f7d7b8ebc50e5 Reviewed-on: https://skia-review.googlesource.com/128300 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com>
* Avoid dividing by zero in SkTwoPointConicalGradient::CreateGravatar Yuqian Li2018-05-14
| | | | | | | | | Bug: oss-fuzz:6146 oss-fuzz:7474 Change-Id: I5f0488f4572140ccb7b9374bc9a66b8ae81dd2d4 Reviewed-on: https://skia-review.googlesource.com/127990 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Klein <mtklein@google.com> Auto-Submit: Yuqian Li <liyuqian@google.com>
* Make GrCaps and GrShaderCaps private.Gravatar Brian Salomon2018-05-11
| | | | | | | | | Moves getCaps() from GrContext to GrContextPriv and removes unused refCaps(). Change-Id: Ic6a8951b656c0d1b2773eae73bff8e88af819866 Reviewed-on: https://skia-review.googlesource.com/127389 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Validate readByteArrayAsData sizeGravatar Florin Malita2018-05-10
| | | | | | | | | | | | Check that the reader has enough data before attempting to allocate the buffer. Also update to return nullptr on read failures. Change-Id: Ia1ea8f611bad95cf3a4493b12582ac3fa7c2b00f Reviewed-on: https://skia-review.googlesource.com/127129 Reviewed-by: Kevin Lubick <kjlubick@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
* Validate gradient DescriptorScope size during deserializationGravatar Florin Malita2018-05-10
| | | | | | | | | | Check that the reader has sufficient data before allocating buffers. Bug: skia:7937 Change-Id: I2352d9a5cbace77b77c150a3a6439e8ac18b0dc5 Reviewed-on: https://skia-review.googlesource.com/127132 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Kevin Lubick <kjlubick@google.com>
* check for focaldata failureGravatar Mike Reed2018-05-09
| | | | | | | | Bug: oss-fuzz:8150 Change-Id: I061365aa5baa62405d732e92beb560a557671bf6 Reviewed-on: https://skia-review.googlesource.com/127046 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* allow div-by-zeroGravatar Mike Reed2018-05-03
| | | | | | | | Bug: oss-fuzz:6146 Change-Id: Ibac5e0730131be432330b8d07648c2ba64b1d6b5 Reviewed-on: https://skia-review.googlesource.com/125460 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
* allow div by zeroGravatar Mike Reed2018-05-02
| | | | | | | | Bug: oss-fuzz:6144 Change-Id: I0f592b1611f06b64450dd642f898ebf6fb88a03d Reviewed-on: https://skia-review.googlesource.com/125444 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* Remove stale gradient color space assertGravatar Florin Malita2018-04-26
| | | | | | | | | | | | | SkGradientShaderBase asserts gammaIsLinear() -- but we don't enforce this in factories. Based on comments, this may be a stale restriction. Can we drop it? Bug: chromium:798208 Change-Id: Id9639cb2bb87f112b26c05372f2a3181c139e5ec Reviewed-on: https://skia-review.googlesource.com/123860 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
* Fix use-of-uninitialized-value in SkPictureShader::onMakeContextGravatar Florin Malita2018-04-20
| | | | | | | | | | | | | | | | | | SkPictureShader::refBitmapShader is expected to always initialize the scale adjust vector when returning a non-null shader. But the code path returning EmptyShader does not do that. Instead of hauling around a separate scale adjustment, we can refactor to avoid this problem by adjusting the local matrix directly, if needed, in refBitmapShader. The local matrix is conveniently already stored in a SkTCopyOnFirstWrite. Bug: chromium:835048, oss-fuzz:7738 Change-Id: I2df3bde7d6237f01bc71857c2fe254e86b186dc0 Reviewed-on: https://skia-review.googlesource.com/122544 Auto-Submit: Florin Malita <fmalita@chromium.org> Reviewed-by: Kevin Lubick <kjlubick@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
* Reland "low-hanging bilerp_clamp_8888 wins"Gravatar Mike Klein2018-04-17
| | | | | | | | | | | | | | | | | | | | | | | | | This is a reland of f946b41643e049f3b81f40316373ad22e1518818 Patches since the original make sure the sample area sums to 1. Original change's description: > low-hanging bilerp_clamp_8888 wins > > - support sampling bgra too > - lowp impl > > Bug: skia:7810 > > Change-Id: I21db805483f612024802f2b508c140c42a029c54 > Reviewed-on: https://skia-review.googlesource.com/121582 > Commit-Queue: Mike Klein <mtklein@google.com> > Reviewed-by: Florin Malita <fmalita@chromium.org> Bug: skia:7810 Change-Id: If20d31b4f8c4163bdb567b4f15a62035265b1b30 Reviewed-on: https://skia-review.googlesource.com/121464 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Revert "low-hanging bilerp_clamp_8888 wins"Gravatar Mike Klein2018-04-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit f946b41643e049f3b81f40316373ad22e1518818. Reason for revert: nervous diffs Original change's description: > low-hanging bilerp_clamp_8888 wins > > - support sampling bgra too > - lowp impl > > Bug: skia:7810 > > Change-Id: I21db805483f612024802f2b508c140c42a029c54 > Reviewed-on: https://skia-review.googlesource.com/121582 > Commit-Queue: Mike Klein <mtklein@google.com> > Reviewed-by: Florin Malita <fmalita@chromium.org> TBR=mtklein@chromium.org,mtklein@google.com,fmalita@chromium.org Change-Id: Id91d583151091a082a2d3f301d85f3acb12f4b19 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:7810 Reviewed-on: https://skia-review.googlesource.com/121589 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Klein <mtklein@google.com>
* low-hanging bilerp_clamp_8888 winsGravatar Mike Klein2018-04-16
| | | | | | | | | | | | - support sampling bgra too - lowp impl Bug: skia:7810 Change-Id: I21db805483f612024802f2b508c140c42a029c54 Reviewed-on: https://skia-review.googlesource.com/121582 Commit-Queue: Mike Klein <mtklein@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
* Reland "Fix handling of MaskFilter matrices"Gravatar Florin Malita2018-04-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit c64ee20e135a336ed775ccb6dec8a87efd19ec02. Reason for revert: initial failures should be fixed in https://skia.googlesource.com/skia.git/+/8eaf64ae12696d4189d3cea9f023658494cf82b8 Original change's description: > Revert "Fix handling of MaskFilter matrices" > > This reverts commit 2097fd03ffea48bd904c48c93348b2350600870e. > > Reason for revert: This is breaking a lot of Windows bots (esp. on the shadermaskfilter_localmatrix) > > Original change's description: > > Fix handling of MaskFilter matrices > > > > 1) extend GrFPArgs to track pre/post local matrices, add helpers for > > creating pre/post wrapper args > > > > 2) add a SkShaderBase helper (totalLocalMatrix) to centralize the LM > > sandwich logic. > > > > 3) update call sites to use the above > > > > 4) rename SkMatrixFilter::makeWithLocalMatrix -> makeWithMatrix, to > > disambiguate vs. SkShader::makeWithLocalMatrix. > > > > BUG=skia:7744 > > > > Change-Id: Ib2b7b007e6924979b00649dde7c94ef4b34771f1 > > Reviewed-on: https://skia-review.googlesource.com/119330 > > Commit-Queue: Florin Malita <fmalita@chromium.org> > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > TBR=bsalomon@google.com,robertphillips@google.com,fmalita@chromium.org,reed@google.com > > Change-Id: I918dbb95bf00b3122e6699b84566ec82dbb5fc5c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:7744 > Reviewed-on: https://skia-review.googlesource.com/120340 > Reviewed-by: Robert Phillips <robertphillips@google.com> > Commit-Queue: Robert Phillips <robertphillips@google.com> TBR=bsalomon@google.com,robertphillips@google.com,fmalita@chromium.org,reed@google.com Change-Id: If194862a928d1abe22ed8fa968436c725d19a8fc No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:7744 Reviewed-on: https://skia-review.googlesource.com/120480 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Florin Malita <fmalita@chromium.org>
* Revert "Fix handling of MaskFilter matrices"Gravatar Robert Phillips2018-04-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 2097fd03ffea48bd904c48c93348b2350600870e. Reason for revert: This is breaking a lot of Windows bots (esp. on the shadermaskfilter_localmatrix) Original change's description: > Fix handling of MaskFilter matrices > > 1) extend GrFPArgs to track pre/post local matrices, add helpers for > creating pre/post wrapper args > > 2) add a SkShaderBase helper (totalLocalMatrix) to centralize the LM > sandwich logic. > > 3) update call sites to use the above > > 4) rename SkMatrixFilter::makeWithLocalMatrix -> makeWithMatrix, to > disambiguate vs. SkShader::makeWithLocalMatrix. > > BUG=skia:7744 > > Change-Id: Ib2b7b007e6924979b00649dde7c94ef4b34771f1 > Reviewed-on: https://skia-review.googlesource.com/119330 > Commit-Queue: Florin Malita <fmalita@chromium.org> > Reviewed-by: Brian Salomon <bsalomon@google.com> TBR=bsalomon@google.com,robertphillips@google.com,fmalita@chromium.org,reed@google.com Change-Id: I918dbb95bf00b3122e6699b84566ec82dbb5fc5c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:7744 Reviewed-on: https://skia-review.googlesource.com/120340 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Fix handling of MaskFilter matricesGravatar Florin Malita2018-04-11
| | | | | | | | | | | | | | | | | | | | 1) extend GrFPArgs to track pre/post local matrices, add helpers for creating pre/post wrapper args 2) add a SkShaderBase helper (totalLocalMatrix) to centralize the LM sandwich logic. 3) update call sites to use the above 4) rename SkMatrixFilter::makeWithLocalMatrix -> makeWithMatrix, to disambiguate vs. SkShader::makeWithLocalMatrix. BUG=skia:7744 Change-Id: Ib2b7b007e6924979b00649dde7c94ef4b34771f1 Reviewed-on: https://skia-review.googlesource.com/119330 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Remove unused field fBitmapBytesGravatar Yuqian Li2018-04-11
| | | | | | | | Bug: skia: Change-Id: I3544b8ed8a02447e765a5389a4c0ea9ca2f09944 Reviewed-on: https://skia-review.googlesource.com/120240 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* remove SK_IGNORE_TO_STRINGGravatar Cary Clark2018-04-05
| | | | | | | | | | | | | | | | | | | SK_IGNORE_TO_STRING is not defined anywhere. The same effect can be had by using a modern linker. Removing it simplifies bookmaker and makes our includes easier to understand. R=robertphillips@google.com TBR=reed@google.com Bug: skia:6898 Change-Id: Ib716f5ef1b42a7fbda0df43ece212d1b7c40289f Reviewed-on: https://skia-review.googlesource.com/118963 Reviewed-by: Robert Phillips <robertphillips@google.com> Reviewed-by: Cary Clark <caryclark@skia.org> Commit-Queue: Cary Clark <caryclark@skia.org>
* Fix SkLocalMatrixShader nesting semanticsGravatar Florin Malita2018-04-04
| | | | | | | | | | | | Inherited/outer local matrices are supposed to compose to the right of (preconcat) other/nested local matrices. BUG=skia:7781 Change-Id: Icd3c24f226845427be849a8be3d78293aef176b3 Reviewed-on: https://skia-review.googlesource.com/118344 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Reed <reed@google.com>
* Banish SkShaderBase::isRasterPipelineOnly()Gravatar Florin Malita2018-04-04
| | | | | | | | | | | | | | | | | Keeping related heuristics in sync with actual shader capabilities is somewhat tricky, and overall fragile. So how about this: instead of an explicit opt-in mechanism, try to instantiate a legacy shader context and fall back to raster pipeline on failure (null Context => implicit opt-in for raster pipeline). Shaders can still choose not to draw by returning both a null Context and failing appendStages(). BUG=skia:7772 Change-Id: I2e76f51af7064853a6cb851b4c30c82eba3ee828 Reviewed-on: https://skia-review.googlesource.com/118383 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Reed <reed@google.com>
* Fixing build with SK_IGNORE_TO_STRING defined.Gravatar Kaloyan Donev2018-03-29
| | | | | | | Change-Id: Id7238e427e490338d1f610255774c2069cfd4879 Reviewed-on: https://skia-review.googlesource.com/117060 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Klein <mtklein@google.com>
* Make consistent isRadiusIncreasing decisionGravatar Yuqian Li2018-03-19
| | | | | | | | | | | | This should not affect anything for now. But it may prevent some future problems where someone accidentally changed isRadiusIncreasing implementation, and getting confused by the unexpected shading behavior. Bug: skia: Change-Id: I45e83f4bc9eefbdc1ad1c196a43444e24c782711 Reviewed-on: https://skia-review.googlesource.com/115162 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Fix concentric 2pt conical gradient in GPU where r1 < r0Gravatar Yuqian Li2018-03-19
| | | | | | | | Bug: skia:7683 Change-Id: I6608e72fa695c855af6a6a447885c4889b09fc1d Reviewed-on: https://skia-review.googlesource.com/115042 Commit-Queue: Yuqian Li <liyuqian@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Fix GrTextureStripAtlasManager cleanup order bugGravatar Robert Phillips2018-03-19
| | | | | | | | Bug: 820703 Change-Id: I6f1a895ceb213d38361bc03a472cf2a48e4720a5 Reviewed-on: https://skia-review.googlesource.com/115001 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Harden initial LinearGradient4f tilingGravatar Florin Malita2018-03-13
| | | | | | | | | | | | | | | | | | Even with verified/finite inputs, fx can sometimes collapse to infinity. When that happens, attempting to apply repeat/mirror tiling produces NaN results and things go south. Catch these degenerate cases and tile to 0 (for lack of a better idea). Note: leaving fx == +/- inf in clamp mode should be safe. BUG=oss-fuzz:6622 Change-Id: I65711020057856b47045f67a52d906336ad1f173 Reviewed-on: https://skia-review.googlesource.com/114090 Reviewed-by: Kevin Lubick <kjlubick@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
* with no more offline codegen, seed_shader can be normalGravatar Mike Klein2018-03-11
| | | | | | | | | | | | | | We passed this iota array as an argument before because it was generating awkward code for our object file parser to handle (relocations, other weird things, can't quite remember). Now that we're compiling pipeline code normally, we can make seed_shader a normal stage again, with no special iota ctx pointer needed. Change-Id: I3929d61bfb6f914248f360c2c2326ce3d1f23163 Reviewed-on: https://skia-review.googlesource.com/113667 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Make GrTextureStripAtlas DDL friendlyGravatar Robert Phillips2018-03-09
| | | | | | | Change-Id: If8fdd7a1c027bc2b2791cfe1af13f99c2561d93d Reviewed-on: https://skia-review.googlesource.com/113268 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* tighten check when we might overflow legacy shader mathGravatar Mike Reed2018-03-08
| | | | | | | | Bug: skia:7700 Change-Id: I2ca06b7ba36f2e17d6addd31b1f67a07d478e207 Reviewed-on: https://skia-review.googlesource.com/113264 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Simplify decal for gradientsGravatar Mike Reed2018-02-19
| | | | | | | | | | | | Previous change extended the stored array of colors/positions, and lost the information that the intent was decal. This variant just uses custom stages already developed for imageshader, keeping the intent of decal. Bug: skia:7638 Change-Id: Ie3f30b42f4c1793487f08039cd3cea8e31aafc40 Reviewed-on: https://skia-review.googlesource.com/108280 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* add decal tilemode to shadersGravatar Mike Reed2018-02-16
| | | | | | | | | | | | | Plenty more to follow-up: - gradients - gpu impl Bug: skia:7638 Change-Id: I8e54fd0e24921f040f178c793b36c7fb855b136e Reviewed-on: https://skia-review.googlesource.com/107420 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Avoid creating MIPs until necessary when MIP bias is activeGravatar Brian Osman2018-02-16
| | | | | | | | | | | | With sharpened mips, the scale at which we begin to sample level 1 is (obviously) less than 1. This change avoids creation of mips for images that are only slightly downscaled (and for which we wouldn't have sampled those MIPs anyway). Change-Id: If8ffc79c2ce2ff1f3aae7f5732d8a50aca0e26be Reviewed-on: https://skia-review.googlesource.com/107801 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Respect FPArgs local matrix when picking a filtering mode in image shaderGravatar Brian Osman2018-02-14
| | | | | | | | | Includes a GM that previously drew bilerp, now draws bicubic. Change-Id: I5e39e8adb49057b57729d9eb9748911ee8584401 Reviewed-on: https://skia-review.googlesource.com/107280 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* clean up SK_LEGACY_HIGH_QUALITY_SCALING_CLAMPGravatar Mike Klein2018-02-12
| | | | | | | | | | | After this rolls out, we can remove -DSK_LEGACY_HIGH_QUALITY_SCALING_CLAMP from Google and Chromium, finally. Change-Id: Ie277843d5ab6e6e762b1b2eea1c23a40cca55a38 Reviewed-on: https://skia-review.googlesource.com/106622 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* yet another approach to unpremul scale pixelsGravatar Mike Klein2018-02-09
| | | | | | | | | | | This keeps punning things to premul (in anticipation of pulling back on any unpremul support outside read/write/scalePixels), and yet still clamps correctly for scalePixels() + unpremul + HQ and/or gamut transform. Change-Id: I75977cfdb94ffbe62c538ddee39f1abd2cc01935 Reviewed-on: https://skia-review.googlesource.com/106265 Reviewed-by: Brian Osman <brianosman@google.com>
* Revert "alternate approach to unpremul scalePixels()"Gravatar Mike Klein2018-02-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit c4616804bb407506c6ac1046c7e25e2016911449. Reason for revert: screwed up the guard I think Original change's description: > alternate approach to unpremul scalePixels() > > We want to keep the clamps in SkImageShader, and keep unpremul > scalePixels() happy too. > > So we extend SkImageShader's internal API to allow specifying an output > alpha type, which controls whether we premul or unpremul and how we > clamp. scalePixels() uses this to draw instead of a drawBitmap() call. > > Sort of backwards of usual, we opt our local builds into > SK_LEGACY_HIGH_QUALITY_SCALING_CLAMP (and Google3 is already defining > this). Then to rebase Chromium we will _define_ this in Chromium's user > config, fold it through as if always defined in Skia, then finally > remove the definition from Chromium's user config. > > Change-Id: I38035f0886f79700e7301c3c6042ce362c771d96 > Reviewed-on: https://skia-review.googlesource.com/90480 > Reviewed-by: Brian Osman <brianosman@google.com> > Commit-Queue: Mike Klein <mtklein@chromium.org> TBR=mtklein@chromium.org,mtklein@google.com,brianosman@google.com,reed@google.com Change-Id: Ib53a7f29c25310b667f9a61f67f8638403ec9da3 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/106220 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* alternate approach to unpremul scalePixels()Gravatar Mike Klein2018-02-09
| | | | | | | | | | | | | | | | | | | | We want to keep the clamps in SkImageShader, and keep unpremul scalePixels() happy too. So we extend SkImageShader's internal API to allow specifying an output alpha type, which controls whether we premul or unpremul and how we clamp. scalePixels() uses this to draw instead of a drawBitmap() call. Sort of backwards of usual, we opt our local builds into SK_LEGACY_HIGH_QUALITY_SCALING_CLAMP (and Google3 is already defining this). Then to rebase Chromium we will _define_ this in Chromium's user config, fold it through as if always defined in Skia, then finally remove the definition from Chromium's user config. Change-Id: I38035f0886f79700e7301c3c6042ce362c771d96 Reviewed-on: https://skia-review.googlesource.com/90480 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Move GrMakeCachedBitmapProxy work in lazy modeGravatar Greg Daniel2018-02-08
| | | | | | | | | | | This basically wraps the bitmap in an SkImage and uses the GrMakeCachedImageProxy call to create the proxy. Bug: skia: Change-Id: I648a9cac3a316231bfb1bcedaae2009b7de0356c Reviewed-on: https://skia-review.googlesource.com/105360 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Refactor explicit inverse calculation in SkImageShader::onAppendStages()Gravatar Florin Malita2018-02-07
| | | | | | | | | We have SkShaderBase::computeTotalInverse() which does exactly that. Change-Id: I77695f9261d700c3ac25fe94250b798e6edfc25d Reviewed-on: https://skia-review.googlesource.com/105000 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Fix picture shader handling of outer local matrixGravatar Florin Malita2018-02-06
| | | | | | | | | | | Instead of applying local matrices to the cached shader, pass them explicitly/composed to createContext/appendStages/asFragmentProcessor. Change-Id: I39aaf07ac883094c447c4e03e2ef9dcf8de13555 Reviewed-on: https://skia-review.googlesource.com/104580 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Reed <reed@google.com>
* Disable texture strip atlasing for DDLGravatar Robert Phillips2018-02-02
| | | | | | | | | | | | | Ultimately we will want to perform inline and ASAP uploads for the texture strip atlas. Unfortunately, that functionality relies on the existance of the flushState (which we don't have for the opList-based DDL implementation). For now we will punt and try storing the individual texture strips in their own image-based texture proxy for DDLs. Change-Id: Ic2ee0deb230172bda4a5d4b69cc802dbe84ad7ac Reviewed-on: https://skia-review.googlesource.com/102464 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* check matrix for SkFixed32.32 compatibilityGravatar Mike Reed2018-02-01
| | | | | | | | | | | Will have to see if we change any layouttest results Bug: skia:7569 Change-Id: Id9676ec76a931c9d4d40c79fb0a469c2a215ad5a Reviewed-on: https://skia-review.googlesource.com/102206 Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* add gpu impl for shadermaskfilterGravatar Mike Reed2018-02-01
| | | | | | | | | | | adds MulChildAlphaByInput renames MulOutputByInputAlpha --> MulChildByInputAlpha Bug: skia:7500 Change-Id: Ic0615d4d23a887fbee510901ed77a36f98a1b11d Reviewed-on: https://skia-review.googlesource.com/102440 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Mike Reed <reed@google.com>
* 1010102, 101010x, 888x in swGravatar Mike Klein2018-01-30
| | | | | | | | | | | | | | | | | | | Same sort of deal as before, now with all three new formats. While I was at it, I made sure RGBA 8888 and BGRA 8888 both work too. We don't want the 101010's in lowp, but 888x should be fine. After looking at the DM images on monitors at work, I decided to re-enable dither even on 10-bit images. Looking at the GMs in 888x or 101010x is interesting... I think we must not be clearing the memory allocated for layers? Seems like we want to allocate layers as 8888? Change-Id: I3a85b4f00877792a6425a7e7eb31eacb04ae9218 Reviewed-on: https://skia-review.googlesource.com/101640 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Revert "hide picture virtuals (no public callers)"Gravatar Mike Klein2018-01-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 8005bff7e631a269f0dfaae93ff9963dc0e5ff39. Reason for revert: hwui, flutter, and headless blink in G3 all still using these. Original change's description: > hide picture virtuals (no public callers) > > This prepares the way for a clean impl of a "placeholder" picture that never unrolls > > Bug: skia: > Change-Id: I3b5785c5c94432b54e9a7dc280b2a6e716592473 > Reviewed-on: https://skia-review.googlesource.com/100260 > Commit-Queue: Mike Reed <reed@google.com> > Reviewed-by: Mike Klein <mtklein@chromium.org> TBR=mtklein@chromium.org,mtklein@google.com,reed@google.com Change-Id: I385789dd420588ea9a9390c8a44c6ecb96c7f358 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/100880 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Klein <mtklein@google.com>
* hide picture virtuals (no public callers)Gravatar Mike Reed2018-01-27
| | | | | | | | | | This prepares the way for a clean impl of a "placeholder" picture that never unrolls Bug: skia: Change-Id: I3b5785c5c94432b54e9a7dc280b2a6e716592473 Reviewed-on: https://skia-review.googlesource.com/100260 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org>