aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkNormalSource.cpp
Commit message (Collapse)AuthorAge
* Restore SkLightingShader and associated classesGravatar Robert Phillips2018-07-17
| | | | | | | | | This reverts https://skia-review.googlesource.com/c/skia/+/31140 (Remove SkLightingShader and associated classes) and updates the classes to ToT Change-Id: I3b1df1704cca8907aa00f081a7e93339b65ad4fa Reviewed-on: https://skia-review.googlesource.com/141545 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Remove SkLightingShader and associated classesGravatar Robert Phillips2017-08-07
| | | | | | | | Change-Id: I8050414c30dfdb5df23ca79955adc5ba3a29d3f5 Reviewed-on: https://skia-review.googlesource.com/31140 Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Remove support in GPU backend for distance vector field.Gravatar Brian Salomon2017-06-02
| | | | | | | | | Also, remvoes SkNormalBevelSource as this was the last use case for the distance vector field. Change-Id: Ib0176c78e500e6b5130310934253a75860245812 Reviewed-on: https://skia-review.googlesource.com/18482 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Added API for Bevel NormalSource.Gravatar dvonbeck2016-07-28
| | | | | | | | | | | This CL adds an API for Bevel normal source and a dummy implementation that returns a normal (0, 0, 1) every time. This CL's base is the CL for accepting nullptrs: https://codereview.chromium.org/2132113002 BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2080993002 Review-Url: https://codereview.chromium.org/2080993002
* require semi at the end of SkASSERT and friendsGravatar caryclark2016-07-27
| | | | | | | | R=bungeman@google.com TBR=reed@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2185063002 Review-Url: https://codereview.chromium.org/2185063002
* Bundle SkShader::asFragmentProcessor arguments in a structGravatar brianosman2016-07-22
| | | | | | | | | | The signature of this thing keeps changing (and is about to change again). This just makes maintenance much easier. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2175563003 Review-Url: https://codereview.chromium.org/2175563003
* SkLS now accepting nullptr for diffuse shader and normal source, now ↵Gravatar dvonbeck2016-07-20
| | | | | | | | | | | accurately handling alpha This CL's base is the CL for taking in a diffuse shader into SkLS on the API side: https://codereview.chromium.org/2064153002 BUG=skia:5502,skia:5517 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2132113002 Review-Url: https://codereview.chromium.org/2132113002
* Abstracted diffuse color map out of SkLightingShaderImpl into a generic SkShaderGravatar dvonbeck2016-07-09
| | | | | | | | | | | | Will not run until after landing https://codereview.chromium.org/2106893003/ This CL's base is the CL for the addition of NormalSource to the API: https://codereview.chromium.org/2063793002/ BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2062703003 Committed: https://skia.googlesource.com/skia/+/3f58cd0eb8bf4499c4f179aa6111d7e005809df8 Review-Url: https://codereview.chromium.org/2062703003
* Fixed error when normal.z = 1 in GPUs with binary16 floatsGravatar dvonbeck2016-07-08
| | | | | | | | | Check failed in GPUs with low-precision floats since 0.9999 was too small a difference from 1 to be detected by a 16-bit float comparison. Changed it to 0.999 which fixed the issue and results in indistinguishable correct behavior. BUG=skia:5499 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2124183004 Review-Url: https://codereview.chromium.org/2124183004
* Revert of Abstracted diffuse color map out of SkLightingShaderImpl into a ↵Gravatar rmistry2016-07-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | generic SkShader (patchset #11 id:200001 of https://codereview.chromium.org/2062703003/ ) Reason for revert: Causing the Test-Ubuntu-GCC-ShuttleA-GPU-GTX550Ti-x86_64-Release-Valgrind builder to fail. Started failing at this build: https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Ubuntu-GCC-ShuttleA-GPU-GTX550Ti-x86_64-Release-Valgrind/builds/1214 Snippet from build log: ==3016== Invalid read of size 4 ==3016== at 0xCD1901: GrFragmentProcessor::registerChildProcessor(sk_sp<GrFragmentProcessor>) (SkTArray.h:163) ==3016== by 0xA58B47: _Z10sk_make_spI11NormalMapFPI5sk_spI19GrFragmentProcessorERK8SkMatrixEES1_IT_EDpOT0_ (SkNormalSource.cpp:84) ==3016== by 0xA582E8: NormalMapSourceImpl::asFragmentProcessor(GrContext*, SkMatrix const&, SkMatrix const*, SkFilterQuality, SkSourceGammaTreatment) const (SkNormalSource.cpp:187) ==3016== by 0xA0ADB5: SkLightingShaderImpl::asFragmentProcessor(GrContext*, SkMatrix const&, SkMatrix const*, SkFilterQuality, SkSourceGammaTreatment) const (SkLightingShader.cpp:268) ==3016== by 0xDA17E6: skpaint_to_grpaint_impl(GrContext*, SkPaint const&, SkMatrix const&, sk_sp<GrFragmentProcessor>*, SkXfermode::Mode*, bool, bool, GrPaint*) (SkGr.cpp:552) ==3016== by 0xDA4532: SkPaintToGrPaint(GrContext*, SkPaint const&, SkMatrix const&, bool, GrPaint*) (SkGr.cpp:668) ==3016== by 0xD99B51: SkGpuDevice::drawRect(SkDraw const&, SkRect const&, SkPaint const&) (SkGpuDevice.cpp:534) ==3016== by 0x9DDB1C: SkCanvas::onDrawRect(SkRect const&, SkPaint const&) (SkCanvas.cpp:2148) ==3016== by 0x9DBF40: SkCanvas::drawRect(SkRect const&, SkPaint const&) (SkCanvas.cpp:1919) ==3016== by 0x8D2A55: skiagm::LightingShaderGM::onDraw(SkCanvas*) (lightingshader.cpp:110) ==3016== by 0x625659: skiagm::GM::drawContent(SkCanvas*) (gm.cpp:32) ==3016== by 0x6256AD: skiagm::GM::draw(SkCanvas*) (gm.cpp:24) ==3016== by 0x61B747: DM::GMSrc::draw(SkCanvas*) const (DMSrcSink.cpp:61) ==3016== by 0x61F37B: DM::GPUSink::draw(DM::Src const&, SkBitmap*, SkWStream*, SkString*) const (DMSrcSink.cpp:1115) ==3016== by 0x619261: dm_main() (DM.cpp:1016) ==3016== by 0x619841: main (DM.cpp:1409) ==3016== Address 0xf4 is not stack'd, malloc'd or (recently) free'd ==3016== Caught signal 11 [Segmentation fault], was running: gpu gm lightingshader Original issue's description: > Abstracted diffuse color map out of SkLightingShaderImpl into a generic SkShader > > Will not run until after landing https://codereview.chromium.org/2106893003/ > > This CL's base is the CL for the addition of NormalSource to the API: https://codereview.chromium.org/2063793002/ > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2062703003 > > Committed: https://skia.googlesource.com/skia/+/3f58cd0eb8bf4499c4f179aa6111d7e005809df8 TBR=egdaniel@google.com,robertphillips@google.com,dvonbeck@google.com # Not skipping CQ checks because original CL landed more than 1 days ago. BUG=skia: NOTRY=true Review-Url: https://codereview.chromium.org/2137513002
* Abstracted diffuse color map out of SkLightingShaderImpl into a generic SkShaderGravatar dvonbeck2016-07-06
| | | | | | | | | | | Will not run until after landing https://codereview.chromium.org/2106893003/ This CL's base is the CL for the addition of NormalSource to the API: https://codereview.chromium.org/2063793002/ BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2062703003 Review-Url: https://codereview.chromium.org/2062703003
* API change to allow for NormalSource selection at the user level.Gravatar dvonbeck2016-07-06
| | | | | | | | | This CL's base is the CL for CPU handling: https://codereview.chromium.org/2050773002/ BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2063793002 Review-Url: https://codereview.chromium.org/2063793002
* SkLightingShader normal vector CPU computation refactor.Gravatar dvonbeck2016-06-27
| | | | | | | | | | | | | | | | The purpose of this change is to refactor the handling of normal maps out of SkLightingShader, laying the groundwork to eventually allow for multiple normal sources. This CL's base was the CL for GPU handling: https://codereview.chromium.org/2043393002/ What this CL includes: - A refactor of the SkLightingShader context's code that deals with reading normals off of a normal map. This is now abstracted out into a NormalSource::Provider class that the context uses. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2050773002 Committed: https://skia.googlesource.com/skia/+/790a70118327a129cb6b48fabe80f4e184c1e67c Review-Url: https://codereview.chromium.org/2050773002
* Revert of Refactoring of CPU NormalMap handling out into its own class ↵Gravatar dvonbeck2016-06-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (patchset #13 id:240001 of https://codereview.chromium.org/2050773002/ ) Reason for revert: GMs are crashing on Windows Test trybots Original issue's description: > SkLightingShader normal vector CPU computation refactor. > > The purpose of this change is to refactor the handling of normal maps out of SkLightingShader, laying the groundwork to eventually allow for multiple normal sources. > > This CL's base was the CL for GPU handling: https://codereview.chromium.org/2043393002/ > > What this CL includes: > > - A refactor of the SkLightingShader context's code that deals with reading normals off of a normal map. This is now abstracted out into a NormalSource::Provider class that the context uses. > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2050773002 > > Committed: https://skia.googlesource.com/skia/+/790a70118327a129cb6b48fabe80f4e184c1e67c TBR=egdaniel@google.com,reed@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review-Url: https://codereview.chromium.org/2101653002
* SkLightingShader normal vector CPU computation refactor.Gravatar dvonbeck2016-06-27
The purpose of this change is to refactor the handling of normal maps out of SkLightingShader, laying the groundwork to eventually allow for multiple normal sources. This CL's base was the CL for GPU handling: https://codereview.chromium.org/2043393002/ What this CL includes: - A refactor of the SkLightingShader context's code that deals with reading normals off of a normal map. This is now abstracted out into a NormalSource::Provider class that the context uses. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2050773002 Review-Url: https://codereview.chromium.org/2050773002