aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/lightingshader.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>
* GM: some header cleanupGravatar Mike Klein2017-03-22
| | | | | | | | | | | | | | gm.h includes sk_tool_utils.h but does not use it. The bulk of this CL makes each gm that uses sk_tool_utils include it. sk_tool_utils.h also provided SkRandom and SkTDArray, so a couple GMs add those headers too. Change-Id: Ieb2a7c542f0ca89c3223f744fc11b0ff37af36c1 Reviewed-on: https://skia-review.googlesource.com/10014 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Herb Derby <herb@google.com>
* Replace a lot of 'static const' with 'constexpr' or 'const'.Gravatar mtklein2016-09-01
| | | | | | | | | | | | | | | | | | | | | | | 'static const' means, there must be at most one of these, and initialize it at compile time if possible or runtime if necessary. This leads to unexpected code execution, and TSAN* will complain about races on the guard variables. Generally 'constexpr' or 'const' are better choices. Neither can cause races: they're either intialized at compile time (constexpr) or intialized each time independently (const). This CL prefers constexpr where possible, and uses const where not. It even prefers constexpr over const where they don't make a difference... I want to have lots of examples of constexpr for people to see and mimic. The scoped-to-class static has nothing to do with any of this, and is not changed. * Not yet on the bots, which use an older TSAN. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2300623005 Review-Url: https://codereview.chromium.org/2300623005
* Moved ambient lights out of SkLight's light arrayGravatar vjiaoblack2016-08-29
| | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2287553002 Committed: https://skia.googlesource.com/skia/+/8f98f0aa2d3f7571a890b916c7c4b5ee831e9686 Review-Url: https://codereview.chromium.org/2287553002
* Revert of Moved ambient lights out of SkLight's light array (patchset #7 ↵Gravatar vjiaoblack2016-08-29
| | | | | | | | | | | | | | | | | | | | | | | | id:120001 of https://codereview.chromium.org/2287553002/ ) Reason for revert: Made Deigo's GM miss their ambient lights Original issue's description: > Moved ambient lights out of SkLight's light array > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2287553002 > > Committed: https://skia.googlesource.com/skia/+/8f98f0aa2d3f7571a890b916c7c4b5ee831e9686 TBR=robertphillips@google.com,djsollen@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/2291663002
* Moved ambient lights out of SkLight's light arrayGravatar vjiaoblack2016-08-29
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2287553002 Review-Url: https://codereview.chromium.org/2287553002
* Added PointLights to SkLights::LightGravatar vjiaoblack2016-08-12
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2237493002 Review-Url: https://codereview.chromium.org/2237493002
* rename FoceCopyMode to SkCopyPixelModeGravatar reed2016-08-05
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2220603002 Review-Url: https://codereview.chromium.org/2220603002
* Changed SkLightingShader API to take in a shader as color sourceGravatar dvonbeck2016-07-10
| | | | | | | | | This CL's base is the CL for the same modification, but in the implementation side: https://codereview.chromium.org/2062703003/ BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2064153002 Review-Url: https://codereview.chromium.org/2064153002
* 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
* Make use of new SkLights classGravatar robertphillips2016-05-31
| | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2026763002 Review-Url: https://codereview.chromium.org/2026763002
* 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
* move setshader to sk_sp, re-using SK_SUPPORT_LEGACY_CREATESHADER_PTRGravatar reed2016-03-25
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1829303002 Review URL: https://codereview.chromium.org/1829303002
* Minor code cleanup (left over from prior CL)Gravatar robertphillips2015-09-03
| | | | | | This was requested in https://codereview.chromium.org/1309543012/ (Add new GM to directly exercise perspective bitmap drawing) Review URL: https://codereview.chromium.org/1320673011
* Style Change: SkNEW->new; SkDELETE->deleteGravatar halcanary2015-08-26
| | | | | | DOCS_PREVIEW= https://skia.org/?cl=1316123003 Review URL: https://codereview.chromium.org/1316123003
* Update SkLightingShader to support rotationGravatar robertphillips2015-08-20
| | | | | | | | | | | | | This also: makes the SkLightingShader handle normal maps where the rects aren't aligned between the diffuse and normal maps. adds a light aggregating class (Lights) to SkLightingShader (along with a Builder nested class). Split out of https://codereview.chromium.org/1261433009/ (Add SkCanvas::drawLitAtlas call) Committed: https://skia.googlesource.com/skia/+/45b59ed6e4e231814dbdb9f707b3d2a7ee50de84 Review URL: https://codereview.chromium.org/1291783003
* Revert "Update SkLightingShader to support rotation"Gravatar robertphillips2015-08-19
| | | | | | | | This reverts commit 45b59ed6e4e231814dbdb9f707b3d2a7ee50de84. TBR=herb@google.com Review URL: https://codereview.chromium.org/1304673002
* Update SkLightingShader to support rotationGravatar robertphillips2015-08-19
| | | | | | | | | | | This also: makes the SkLightingShader handle normal maps where the rects aren't aligned between the diffuse and normal maps. adds a light aggregating class (Lights) to SkLightingShader (along with a Builder nested class). Split out of https://codereview.chromium.org/1261433009/ (Add SkCanvas::drawLitAtlas call) Review URL: https://codereview.chromium.org/1291783003
* Move normal map creation methods to sk_toolsGravatar robertphillips2015-08-17
| | | | | | Split off of https://codereview.chromium.org/1261433009/ (Add SkCanvas::drawLitAtlas call) Review URL: https://codereview.chromium.org/1298763002
* Fix warnings on VS2015 x86_64 buildGravatar bsalomon2015-08-06
| | | | | | TBR=bungeman@google.com Review URL: https://codereview.chromium.org/1276133002
* Address some SkLightingShader TODOsGravatar robertphillips2015-07-31
| | | | | | | | This CL: switches the light colors to be 3 scalars (SkColor3f) adds some dox Review URL: https://codereview.chromium.org/1265983003
* Update SkLightingShader to take a localMatrixGravatar robertphillips2015-07-30
| | | | | | W/o this we can't draw lit objects anywhere but the origin. Review URL: https://codereview.chromium.org/1253223003
* Move LightingShader to effectsGravatar robertphillips2015-07-29
Additionally this CL: forces the light colors to be opaque forces the light direction to be normalized adds a raster implementation adds a gm Review URL: https://codereview.chromium.org/1245883003