aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/SkLightingImageFilter.cpp
Commit message (Collapse)AuthorAge
* Rename GrContext's newDrawContext & drawContext to makeDrawContextGravatar robertphillips2016-07-27
| | | | | | | | These both return sk_sp. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2186073002 Review-Url: https://codereview.chromium.org/2186073002
* Add SkColorSpace to GrDrawContextGravatar brianosman2016-07-21
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2164363002 Review-Url: https://codereview.chromium.org/2164363002
* Adding color space to SkSpecialImageGravatar brianosman2016-07-21
| | | | | | | | | | Mostly means that GPU backed special images need to be supplied (and store) a color space object. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2163343002 Review-Url: https://codereview.chromium.org/2163343002
* Introduce GrColorSpaceXform, for gamut conversion on texturesGravatar brianosman2016-07-18
| | | | | | | | | | | | | | | | | | | | | | | | | GrTextureAccess optionally includes an instance, computed from the src and dst color spaces. In all common cases (no color space for either src or dst, or same color space for both), no object is allocated. This change is orthogonal to my attempts to get color space attached to render targets - regardless of how we choose to do that, this will give us the source color space at all points where we are connecting src to dst. There are many dangling injection points where I've been inserting nullptr, but I have a record of all of them. Additionally, there are now three places (the most common simple paths for bitmap/image rendering) where things are plumbed enough that I expect to have access to the dst color space (all marked with XFORMTODO). In addition to getting the dst color space, I need to inject shader code and uniform uploading for appendTextureLookup and friends. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2154753003 Review-Url: https://codereview.chromium.org/2154753003
* sk_sp for Ganesh.Gravatar bungeman2016-06-09
| | | | | | | | | | Convert use of GrFragmentProcessor, GrGeometryProcessor, and GrXPFactory to sk_sp. This clarifies ownership and should reduce reference count churn by moving ownership. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2041113004 Review-Url: https://codereview.chromium.org/2041113004
* Convert GrClip to an abstract base classGravatar cdalton2016-05-13
| | | | | | | | | | | | | | | | Converts GrClip to an abstract base class and adds a "GrFixedClip" implementation. GrFixedClip denotes a clip implemented with fixed- function hardware. GrFixedClip allows us to remove the stateful "fClipMode" member from GrClipMaskManager, and in the future will be able to nicely encapsulate window rectangles. After this change GrClipMaskManager is just a wrapper around GrDrawTarget. We may want to consider removing it altogether. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1971343002 Review-Url: https://codereview.chromium.org/1971343002
* Add Gr*Proxy classesGravatar robertphillips2016-05-04
| | | | | | | | | | | | This isn't wired in anywhere yet. GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1937553002 Committed: https://skia.googlesource.com/skia/+/de5bf0cfeca908b81a28cc50065f7bc2da3d2fd1 Committed: https://skia.googlesource.com/skia/+/92605b35efa0155c44d24bd8415b4cc1db8831db Review-Url: https://codereview.chromium.org/1937553002
* Revert of Add Gr*Proxy classes (patchset #10 id:220001 of ↵Gravatar robertphillips2016-05-03
| | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1937553002/ ) Reason for revert: ASAN Original issue's description: > Add Gr*Proxy classes > > This isn't wired in anywhere yet. > > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1937553002 > > Committed: https://skia.googlesource.com/skia/+/de5bf0cfeca908b81a28cc50065f7bc2da3d2fd1 > > Committed: https://skia.googlesource.com/skia/+/92605b35efa0155c44d24bd8415b4cc1db8831db TBR=bsalomon@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review-Url: https://codereview.chromium.org/1944953002
* Add Gr*Proxy classesGravatar robertphillips2016-05-03
| | | | | | | | | | This isn't wired in anywhere yet. GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1937553002 Committed: https://skia.googlesource.com/skia/+/de5bf0cfeca908b81a28cc50065f7bc2da3d2fd1 Review-Url: https://codereview.chromium.org/1937553002
* Revert of Add Gr*Proxy classes (patchset #9 id:160001 of ↵Gravatar robertphillips2016-05-03
| | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1937553002/ ) Reason for revert: Seems to be breaking N7 & ANGLE bots Original issue's description: > Add Gr*Proxy classes > > This isn't wired in anywhere yet. > > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1937553002 > > Committed: https://skia.googlesource.com/skia/+/de5bf0cfeca908b81a28cc50065f7bc2da3d2fd1 TBR=bsalomon@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review-Url: https://codereview.chromium.org/1949463002
* Add Gr*Proxy classesGravatar robertphillips2016-05-03
| | | | | | | | This isn't wired in anywhere yet. GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1937553002 Review-Url: https://codereview.chromium.org/1937553002
* Refactor drawContext/RenderTarget creationGravatar robertphillips2016-04-28
| | | | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1914883002 Committed: https://skia.googlesource.com/skia/+/2f1c42e8448bbbadeb3df1c626faa90aa33f8907 Review-Url: https://codereview.chromium.org/1914883002
* Revert of Refactor drawContext/RenderTarget creation (patchset #8 id:140001 ↵Gravatar robertphillips2016-04-28
| | | | | | | | | | | | | | | | | | | | | of https://codereview.chromium.org/1914883002/ ) Reason for revert: Experimental revert to see if this is blocking the DEPS roll. Original issue's description: > Refactor drawContext/RenderTarget creation > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1914883002 > > Committed: https://skia.googlesource.com/skia/+/2f1c42e8448bbbadeb3df1c626faa90aa33f8907 TBR=bsalomon@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review-Url: https://codereview.chromium.org/1929833004
* Refactor drawContext/RenderTarget creationGravatar robertphillips2016-04-27
| | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1914883002 Review-Url: https://codereview.chromium.org/1914883002
* Bring sk_sp to GrDrawContextGravatar robertphillips2016-04-27
| | | | | | | | This is split out of: https://codereview.chromium.org/1914883002/ (Refactor drawContext/RenderTarget creation) GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1918003003 Review-Url: https://codereview.chromium.org/1918003003
* Add another dollop of sk_sp to SkSpecialImage and SkSpecialSurfaceGravatar robertphillips2016-04-25
| | | | | | | | This is split out of https://codereview.chromium.org/1914883002/ (Refactor drawContext/RenderTarget creation) GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1913743002 Review URL: https://codereview.chromium.org/1913743002
* Begin removing deprecated (and now, unused) ImageFilter code pathsGravatar robertphillips2016-04-20
| | | | | | | | | | | This CL focuses on removing the Proxy objects but takes some other stuff with it. BUG=skia:4965 TBR=reed@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1896383003 Review URL: https://codereview.chromium.org/1896383003
* Switch SkLightingImageFilter over to new onFilterImage interfaceGravatar robertphillips2016-04-15
| | | | | | | | TBR=reed@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1887103002 Review URL: https://codereview.chromium.org/1887103002
* Rename EmitArgs::fSamplers to fTexSamplersGravatar cdalton2016-04-11
| | | | | | | | | | | Renames fSamplers to fTexSamplers in GrProcessor EmitArgs, and renames GrGLSLTextureSampler to GrGLSLSampler. This will allow us to add a second array of buffer samplers. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1862373003 Review URL: https://codereview.chromium.org/1862373003
* Fix roll bot's win gn buildGravatar robertphillips2016-04-10
| | | | | | | | TBR=borenet@google.com,bsalomon@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1873063002 Review URL: https://codereview.chromium.org/1873063002
* Update LightingImageFilter to sk_spGravatar robertphillips2016-04-08
| | | | | | | | TBR=reed@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1869763002 Review URL: https://codereview.chromium.org/1869763002
* SkSurfaceProps now has a gamma-correct ("AllowSRGBInputs") flag. That's ↵Gravatar brianosman2016-04-06
| | | | | | | | | | | | propagated in a few places so that the backend can do the right thing for L32 vs S32 mode. Also added SkSurfaceProps to SkSpecialImage, so that Image -> Surface conversion can preserve the desired behavior during filtering. Many small changes, including a bunch of comments about places where we may be losing information right now. My approach was to ensure that if anything fails, it will always fall back to "legacy" mode - gamma-correctness is opt-in, so I'll just have to feed things through as missing cases are exposed. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1838953007 Review URL: https://codereview.chromium.org/1845283003
* change flattenable factory to return sk_spGravatar reed2016-04-03
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1855733002 Review URL: https://codereview.chromium.org/1855733002
* Update SkMergeImageFilter to sk_spGravatar robertphillips2016-03-30
| | | | | | | | TBR=reed@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1847583002 Review URL: https://codereview.chromium.org/1847583002
* Style bikeshed - remove extraneous whitespaceGravatar halcanary2016-03-29
| | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1842753002 Review URL: https://codereview.chromium.org/1842753002
* Add more specialized fragment buildersGravatar cdalton2016-02-18
| | | | | | | | | | | Adds specialized fragment builders for primitive and fragment processors. Removes fragment-specific functionality from the Xfer fragment builder. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1709153002 Review URL: https://codereview.chromium.org/1709153002
* Mark existing image filter entry points that will be going away with DeprecatedGravatar robertphillips2016-02-17
| | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1709753002 Review URL: https://codereview.chromium.org/1709753002
* Remove 6-param applyCropRect() from lighting filters (GPU path).Gravatar senorblanco2016-02-17
| | | | | | | | | This required adding a texture domain effect if the destination bounds are not contained within the source bounds. BUG=skia:4502 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1698913004 Review URL: https://codereview.chromium.org/1698913004
* Remove 6-param applyCropRect() from lighting filters (raster path).Gravatar senorblanco2016-02-16
| | | | | | | BUG=skia:4502 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1701133002 Review URL: https://codereview.chromium.org/1701133002
* Add GrShaderFlags enumGravatar cdalton2016-02-11
| | | | | | | | | Replaces GrGLSLUniformHandler::ShaderVisibility with GrShaderFlags. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1684063006 Review URL: https://codereview.chromium.org/1684063006
* Last bit of GrGLSLFragmentProcessor-derived class cleanupGravatar robertphillips2016-02-05
| | | | | | | | I believe these are the last two that used the dispreferred constructor pattern. GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1667953005 Review URL: https://codereview.chromium.org/1667953005
* Refactor to use GrWrapTextureInBitmap moreGravatar robertphillips2016-01-14
| | | | | | | | Too many wrap_texture methods! GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1584933002 Review URL: https://codereview.chromium.org/1584933002
* remove imagefilter::sizeconstraintGravatar reed2016-01-11
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1571033002 Review URL: https://codereview.chromium.org/1571033002
* Create GLSLUniformHandler class for gpu backendGravatar egdaniel2015-12-03
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1490283004
* Don't create a GXPFactory when blend is SrcOverGravatar egdaniel2015-11-23
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1471053002
* Add ShaderBuilders to EmitArgs and remove gettings from ProgBuilder.Gravatar egdaniel2015-11-18
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1457543003
* Increase the amount of debug information printed out by batchesGravatar robertphillips2015-11-16
| | | | | | | | | Untangling MDB bugs requires more information. In particular the render targets. BUG=skia:4094 TBR=bsalomon@google.com Review URL: https://codereview.chromium.org/1443763002
* Rename some processor functions from GL to GLSLGravatar egdaniel2015-11-13
| | | | | | | | TBR=bsalomon@google.com BUG=skia: Review URL: https://codereview.chromium.org/1443743002
* Make all GrFragmentProcessors GL independent.Gravatar egdaniel2015-11-13
| | | | | | | | TBR=bsalomon@google.com BUG=skia: Review URL: https://codereview.chromium.org/1434313002
* Move all ShaderBuilder files to GLSLGravatar egdaniel2015-11-11
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1438003003
* Make GrGLSLProgramBuilder base class for GrGLProgramBuilder.Gravatar egdaniel2015-11-11
| | | | | | | | | | | | | | This CL still keeps the weird diamond shape we have for all our ProgramBuilders. However, the GrGLSL base class will allow us to pull multiple other parts of our program setup away from GL which will eventually allow us to break up the diamond. As part of this all ShaderBuilder subclass have been made gl independent, however I will move them to GLSL files/class names in a follow on CL. BUG=skia: Review URL: https://codereview.chromium.org/1416423003
* Rename non-aa rect methods on GrDrawContext in anticipation of making them ↵Gravatar bsalomon2015-11-05
| | | | | | | | support aa R=joshualitt@google.com Review URL: https://codereview.chromium.org/1409753008
* 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
* Move GrGLShaderVar to GrGLSLGravatar egdaniel2015-10-21
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1417123002
* 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
* 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