aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects
Commit message (Collapse)AuthorAge
* Revert[2] of "stop using drawSprite (at least w/ no filters) as it is going ↵Gravatar reed2015-11-03
| | | | | | | | | | | | | | away" Fixed assert in test that was calling GrRecordReplaceDraw(). That function now uses drawBitmap, so updated the test to check for that (instead of drawSprite). This reverts commit 21b766347064837e6b78d600755901aad88cd6e0. BUG=skia: TBR= Review URL: https://codereview.chromium.org/1410343011
* Simplify SkGpuBlurUtils.Gravatar senorblanco2015-11-03
| | | | | | | | | | | | | We compute a lot of { srcRect, dstRect } pairs in this code, but they're always the same width and height, and dstRect often has a zero origin. So pass only one or the other and an offset, where required. Among other things, this simplifies the code in convolve_gaussian(), since we only have to 3-patch the dstRect. BUG=skia:4502 Review URL: https://codereview.chromium.org/1430593006
* Revert of stop using drawSprite (at least w/ no filters) as it is going away ↵Gravatar robertphillips2015-11-03
| | | | | | | | | | | | | | | | | | | | | | (patchset #2 id:20001 of https://codereview.chromium.org/1411173010/ ) Reason for revert: Breaking the bots Original issue's description: > stop using drawSprite (at least w/ no filters) as it is going away > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/4a21602982d411bb764e46dc47e009b12bd5cb39 TBR=senorblanco@google.com,senorblanco@chromium.org,reed@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1413363011
* Make SkBlurImageFilter capable of cropping during blur (raster path)Gravatar senorblanco2015-11-02
| | | | | | | | | | | | | | | | | | SkBlurImageFilter can currently only process a source image which is larger than or equal to the destination rect. If the source image (or crop rect) is smaller, it is padded out to dest size with transparent black via the 6-param version of applyCropRect(). Fixing this requires modifying all the flavours of RGBA box_blur() to accept a src crop rect. BUG=skia:4502, skia:4526 CQ_EXTRA_TRYBOTS=client.skia.android:Test-Android-GCC-Nexus5-CPU-NEON-Arm7-Release-Trybot;client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot Committed: https://skia.googlesource.com/skia/+/1b82ceb737c73327412f2e8a91748481e1aec9e4 Review URL: https://codereview.chromium.org/1415653003
* stop using drawSprite (at least w/ no filters) as it is going awayGravatar reed2015-11-02
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1411173010
* Revert of Make SkBlurImageFilter capable of cropping during blur (patchset ↵Gravatar senorblanco2015-11-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #16 id:400001 of https://codereview.chromium.org/1415653003/ ) Reason for revert: ASAN failures (see https://codereview.chromium.org/1415653003/) Original issue's description: > Make SkBlurImageFilter capable of cropping during blur (raster path) > > SkBlurImageFilter can currently only process a source image > which is larger than or equal to the destination rect. If > the source image (or crop rect) is smaller, it is padded > out to dest size with transparent black via the 6-param > version of applyCropRect(). > > Fixing this requires modifying all the flavours of RGBA > box_blur() to accept a src crop rect. > > BUG=skia:4502, skia:4526 > CQ_EXTRA_TRYBOTS=client.skia.android:Test-Android-GCC-Nexus5-CPU-NEON-Arm7-Release-Trybot;client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot > > Committed: https://skia.googlesource.com/skia/+/1b82ceb737c73327412f2e8a91748481e1aec9e4 TBR=mtklein@google.com,reed@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:4502, skia:4526 Review URL: https://codereview.chromium.org/1428053002
* Make SkBlurImageFilter capable of cropping during blur (raster path)Gravatar senorblanco2015-11-02
| | | | | | | | | | | | | | | | SkBlurImageFilter can currently only process a source image which is larger than or equal to the destination rect. If the source image (or crop rect) is smaller, it is padded out to dest size with transparent black via the 6-param version of applyCropRect(). Fixing this requires modifying all the flavours of RGBA box_blur() to accept a src crop rect. BUG=skia:4502, skia:4526 CQ_EXTRA_TRYBOTS=client.skia.android:Test-Android-GCC-Nexus5-CPU-NEON-Arm7-Release-Trybot;client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot Review URL: https://codereview.chromium.org/1415653003
* Remove GrGLProcessor and create GrGLSLTextureSampler class.Gravatar egdaniel2015-10-29
| | | | | | | | Part ??? of separating glsl and gl BUG=skia: Review URL: https://codereview.chromium.org/1425013003
* Create GLSL base class for ProgramDataManagerGravatar egdaniel2015-10-28
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1428543003
* Fix some GPU filters to use the correct size constraint.Gravatar senorblanco2015-10-23
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1412863006
* tunnel down texture-size-constraint to imagefiltersGravatar reed2015-10-22
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1421493003
* Move GrGLShaderVar to GrGLSLGravatar egdaniel2015-10-21
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1417123002
* Move shader precision modifier check onto GLSLCapsGravatar egdaniel2015-10-21
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1414373002
* Stop creating static GrProcessor instancesGravatar bsalomon2015-10-21
| | | | | | | | R=joshualitt@google.com BUG=skia:4483 Review URL: https://codereview.chromium.org/1414733007
* Use the current OpengGL standard to determine blur precision, rather than kGLESGravatar Brian Salomon2015-10-20
| | | | | | TBR=ethannicholas@google.com,robertphillips@google.com Review URL: https://codereview.chromium.org/1408123004 .
* Image filters: Replace all use of tryAllocPixels() with createDevice().Gravatar senorblanco2015-10-20
| | | | | | | | | | | | | In order to have a central pinch point for bitmap allocation, change all filters to use Proxy::createDevice() instead of allocating memory directly with SkBitmap::tryAllocPixels(). This will aid in moving filter backing stores and caches to discardable memory. BUG=skia: Review URL: https://codereview.chromium.org/1414843003
* Revert of Update feSpotLight to match spec (patchset #2 id:20001 of ↵Gravatar caryclark2015-10-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1403403003/ ) Reason for revert: re-land once layout test have been disabled (so they can be rebased) Original issue's description: > Update feSpotLight to match spec > > This change updates feSpotLight to match the spec via two changes: > > 1) specularExponent is ignored if the spotlight has no coneAngle (GPU > bug only). This change updates the GPU path so that it matches the > CPU path and the spec in this regard. > > 2) specularExponent is clamped to the 1-128 range. The spec does not > specify a clamp for the specularExponent attribute of feSpotLight. > Note that the spec *does* specify this clamp for the > specularExponent attribute of feSpecularLighting. It looks like we > incorrectly applied this to both specularExponent attributes. > > This change (along with a parallel change in Blink) allows us to pass > the SVG filter effects conformance test here: > http://www.w3.org/Graphics/SVG/Test/20110816/harness/htmlObject/filters-light-01-f.html > > Additionally, this brings our behavior in line with Safari and Edge’s > behavior on this filter. > > Two new cases were added to gm/lighting.cpp to catch these issues: > - The existing spotlight case exercised the path where our specular > exponent was between 1-128 and had a limiting cone angle. > - The first new spotlight case exercises the path where our specular > exponent is between 1-128 and we do not have a limiting cone angle. > - The second new spotlight case exercises the path where the specular > exponent is not within the 1-128 range, to ensure that we don’t > incorrectly clip to this range. > > BUG=472849 > > Committed: https://skia.googlesource.com/skia/+/c84ccb070258db2803a9e8f532bfe7239a737063 TBR=senorblanco@google.com,senorblanco@chromium.org,bsalomon@google.com,ericrk@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=472849 Review URL: https://codereview.chromium.org/1417463006
* Update feSpotLight to match specGravatar ericrk2015-10-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change updates feSpotLight to match the spec via two changes: 1) specularExponent is ignored if the spotlight has no coneAngle (GPU bug only). This change updates the GPU path so that it matches the CPU path and the spec in this regard. 2) specularExponent is clamped to the 1-128 range. The spec does not specify a clamp for the specularExponent attribute of feSpotLight. Note that the spec *does* specify this clamp for the specularExponent attribute of feSpecularLighting. It looks like we incorrectly applied this to both specularExponent attributes. This change (along with a parallel change in Blink) allows us to pass the SVG filter effects conformance test here: http://www.w3.org/Graphics/SVG/Test/20110816/harness/htmlObject/filters-light-01-f.html Additionally, this brings our behavior in line with Safari and Edge’s behavior on this filter. Two new cases were added to gm/lighting.cpp to catch these issues: - The existing spotlight case exercised the path where our specular exponent was between 1-128 and had a limiting cone angle. - The first new spotlight case exercises the path where our specular exponent is between 1-128 and we do not have a limiting cone angle. - The second new spotlight case exercises the path where the specular exponent is not within the 1-128 range, to ensure that we don’t incorrectly clip to this range. BUG=472849 Review URL: https://codereview.chromium.org/1403403003
* The SkArithmeticMode_gpu GL filters support clamping to validGravatar ericrk2015-10-19
| | | | | | | | | | | | | | premultiplied colors, however the flag for whether or not to do this, which is present in their parent filters, is dropped when creating the GL implementations. This change adds logic to forward the value from the parent filter to the GL implementation. This makes GPU behavior match software and fixes a WebKit LayoutTest. See referenced bug. BUG=473186 Review URL: https://codereview.chromium.org/1410553002
* Fix for GM:bigblurs not actually blurring some of the rectangles on Nexus 10.Gravatar ethannicholas2015-10-19
| | | | | | BUG=skia:2860 Review URL: https://codereview.chromium.org/1395693011
* Remove DrawingMgr shims from GrContextGravatar robertphillips2015-10-17
| | | | | | BUG=skia:4094 Review URL: https://codereview.chromium.org/1413673002
* Image filters: refactor input GPU processing into filterInputGPU().Gravatar senorblanco2015-10-16
| | | | | | | | | | (analog of CPU version here: https://codereview.chromium.org/1404743005/) No change in behaviour; this is a straight refactoring. BUG=skia:3194 Review URL: https://codereview.chromium.org/1393283008
* Image Filters: refactor all CPU input processing into a filterInput helper ↵Gravatar senorblanco2015-10-15
| | | | | | | | | | function. No change in behaviour; this is a straight refactoring. BUG=skia:3194 Review URL: https://codereview.chromium.org/1404743005
* GrDrawContext now holds GrRenderTarget pointerGravatar robertphillips2015-10-15
| | | | Review URL: https://codereview.chromium.org/1404823005
* change more effects to only expose factoriesGravatar reed2015-10-12
| | | | | | | BUG=skia: TBR= Review URL: https://codereview.chromium.org/1395403002
* Remove SK_SUPPORT_LEGACY_GRADIENT_DITHERING from Skia properGravatar fmalita2015-10-12
| | | | | | | | | | | | Migrating the flag to embedder defines (Chromium already guarded). Also augment gradient-focused GMs to generate both dithered/undithered results. BUG=skia:4436 R=reed@google.com,robertphillips@google.com Review URL: https://codereview.chromium.org/1400813006
* Remove image usage type enum. Use GrTextureParams instead.Gravatar bsalomon2015-10-12
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1404433002
* Move functions from SkGr to SkGrPriv.hGravatar bsalomon2015-10-09
| | | | Review URL: https://codereview.chromium.org/1397123002
* Optional gradient ditheringGravatar fmalita2015-10-09
| | | | | | | | | | | | Update raster gradient impls to observe the paint dithering flag. For now this new behavior is disabled pending internal/external client updates to mitigate diffs. BUG=skia:4436 R=reed@google.com,mtklein@google.com,tomhudson@google.com Review URL: https://codereview.chromium.org/1391303002
* Insert clip fragment processor outside GrCMMGravatar bsalomon2015-10-07
| | | | Review URL: https://codereview.chromium.org/1393553002
* Revert "Revert of factories should return baseclass, allowing the impl to ↵Gravatar reed2015-10-06
| | | | | | | | | | | specialize (patchset #4 id:60001 of https://codereview.chromium.org/1390523005/ )" This reverts commit 95376a0dde3cdf414eb97a20cef3af19ed7e0151. BUG=skia: TBR= Review URL: https://codereview.chromium.org/1389083002
* Revert of factories should return baseclass, allowing the impl to specialize ↵Gravatar schenney2015-10-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (patchset #4 id:60001 of https://codereview.chromium.org/1390523005/ ) Reason for revert: Breaks Chrome with this link error: ../../third_party/skia/include/effects/SkMorphologyImageFilter.h:75: error: undefined reference to 'SkMorphologyImageFilter::SkMorphologyImageFilter(int, int, SkImageFilter*, SkImageFilter::CropRect const*)' ../../third_party/skia/include/effects/SkMorphologyImageFilter.h:104: error: undefined reference to 'SkMorphologyImageFilter::SkMorphologyImageFilter(int, int, SkImageFilter*, SkImageFilter::CropRect const*)' Presumably due to code in third_party/WebKit/Source/platform/graphics/filters/FEMorphology.cpp that contains: #include "SkMorphologyImageFilter.h" ... if (m_type == FEMORPHOLOGY_OPERATOR_DILATE) return adoptRef(SkDilateImageFilter::Create(radiusX, radiusY, input.get(), &rect)); return adoptRef(SkErodeImageFilter::Create(radiusX, radiusY, input.get(), &rect)); Original issue's description: > factories should return baseclass, allowing the impl to specialize > > waiting on https://codereview.chromium.org/1386163002/# to land > > BUG=skia:4424 > > Committed: https://skia.googlesource.com/skia/+/80a6dcaa1b757826ed7414f64b035d512d9ccbf8 TBR=senorblanco@google.com,robertphillips@google.com,reed@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:4424 Review URL: https://codereview.chromium.org/1389063002
* factories should return baseclass, allowing the impl to specializeGravatar reed2015-10-06
| | | | | | | | waiting on https://codereview.chromium.org/1386163002/# to land BUG=skia:4424 Review URL: https://codereview.chromium.org/1390523005
* Bye bye processor data manager.Gravatar bsalomon2015-10-06
| | | | Review URL: https://codereview.chromium.org/1388113002
* Revert of Have GrRectBlurEffect use Linear filtering (rather than Nearest ↵Gravatar robertphillips2015-10-04
| | | | | | | | | | | | | | | | | | | | | Neighbor) (patchset #2 id:20001 of https://codereview.chromium.org/1378023004/ ) Reason for revert: Trial run confirmed layout test expectations - will reland after suppressions Original issue's description: > Have GrRectBlurEffect use Linear filtering (rather than Nearest Neighbor) > > Committed: https://skia.googlesource.com/skia/+/2d70bcccc9ba8f3898a7ae506ba7410ed8e9c9db > > Committed: https://skia.googlesource.com/skia/+/5175b9563055926b4969d57f06e4ae49b86e055b TBR=bsalomon@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1378813004
* Have GrRectBlurEffect use Linear filtering (rather than Nearest Neighbor)Gravatar robertphillips2015-10-04
| | | | | | Committed: https://skia.googlesource.com/skia/+/2d70bcccc9ba8f3898a7ae506ba7410ed8e9c9db Review URL: https://codereview.chromium.org/1378023004
* Base SkAutoTUnref on skstd::unique_ptr.Gravatar bungeman2015-10-01
| | | | | | | | | To further consolidate the various unique owning classes, this bases SkAutoTUnref on skstd::unique_ptr. Users are updated because of two breaking changes, swap now takes a reference and reset no longer returns its argument. Review URL: https://codereview.chromium.org/1370803002
* Revert of Have GrRectBlurEffect use Linear filtering (rather than Nearest ↵Gravatar robertphillips2015-10-01
| | | | | | | | | | | | | | | | | | | Neighbor) (patchset #1 id:1 of https://codereview.chromium.org/1378023004/ ) Reason for revert: Failing some Blink layout tests - will wait until after branch. Original issue's description: > Have GrRectBlurEffect use Linear filtering (rather than Nearest Neighbor) > > Committed: https://skia.googlesource.com/skia/+/2d70bcccc9ba8f3898a7ae506ba7410ed8e9c9db TBR=bsalomon@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/1378323002
* Have GrRectBlurEffect use Linear filtering (rather than Nearest Neighbor)Gravatar robertphillips2015-09-30
| | | | Review URL: https://codereview.chromium.org/1378023004
* Use child processors to implement compose color filter.Gravatar bsalomon2015-09-29
| | | | Review URL: https://codereview.chromium.org/1368423003
* Make skpaint->grpaint flow work for composing draws (verts and atlas)Gravatar bsalomon2015-09-28
| | | | | | One side effect is that the SkShader's (or implicit shader's) fragment processor is responsible for the transition from an unpremul paint color to a premul color. Review URL: https://codereview.chromium.org/1348583002
* Remove SkBitmapSourceGravatar fmalita2015-09-25
| | | | | | | | | To avoid breaking existing SKPs, add a deserialization stub which unflattens SkBitmapSource records to SkImageSources. R=reed@google.com,mtklein@google.com,robertphillips@google.com Review URL: https://codereview.chromium.org/1363913002
* Eliminate some clutter in SkFlattenableGravatar mdempsky2015-09-24
| | | | | | | | | | | | | | | | | | | | | The Registrar class is unnecessary, as SkFlattenable factory registration is now handled via initialization routines that can just call the Register function directly. Also, no need to lazily initialize gCount to 0, as initializing an int to a constant value does not require dynamic initialization. (C++ actually guarantees zero initialization of global ints anyway, but existing practice in Skia appears to favor the explicit "= 0"). Relatedly, this requires removing the unused/unimplemented SkLayerDrawLooper::MyRegistrar class. And removing that allows Clang to realize that SkLayerDrawLooper::fTopRec is unneeded too, so remove that too to squelch the compiler warning/error. This doesn't change any public API. TBR=reed@google.com Review URL: https://codereview.chromium.org/1361323002
* Mangle output var in GrGLFragmentProcessor::emitChildGravatar bsalomon2015-09-24
| | | | | | R=joshualitt@google.com Review URL: https://codereview.chromium.org/1362873002
* Replace GrExtractAlphaFragmentProcessor with DstIn compose processorGravatar bsalomon2015-09-22
| | | | Review URL: https://codereview.chromium.org/1347943003
* Remove SkNEW and SkDELETE macrosGravatar mdempsky2015-09-22
| | | | | | | | | | | | | | | This CL removes the uses of SkNEW that have resprouted since commit 385fe4d, and removes the macros entirely now that Android and Chromium have been cleaned up to no longer depend on them. A bunch of files implicitly depend on #include <new> from SkPostConfig.h still though, so keep that for now. To be fixed in a followup CL. [mtklein mucking around] Only public API removed. TBR=reed@google.com Review URL: https://codereview.chromium.org/1360653004
* Create fragment processor for performing input color blend with child processorGravatar bsalomon2015-09-15
| | | | | | The new FP is used to implement SkXM::Mode color filters and SkXM::Mode image filters. Also, these now support all advanced SkXM::Mode xfermodes. Review URL: https://codereview.chromium.org/1334293003
* Fix vs2015 buildGravatar bsalomon2015-09-15
| | | | | | TBR=robertphillips@google.com Review URL: https://codereview.chromium.org/1344203002
* Forward declare SkStrokeRec in SkPathEffectGravatar halcanary2015-09-15
| | | | Review URL: https://codereview.chromium.org/1312163008
* Add special case circle blur for GaneshGravatar robertphillips2015-09-15
| | | | | | | | This makes the blurcircles bench go from ~33us to ~8us on Windows desktop. It will require layout test suppressions Review URL: https://codereview.chromium.org/1311583005