Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1219)

Issue 6302101: lighting image filters (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 3 months ago by Stephen White
Modified:
12 years, 3 months ago
Reviewers:
reed1, TomH
Base URL:
http://skia.googlecode.com/svn/trunk/
Visibility:
Public.

Description

Raster implementation of diffuse and specular lighting filters. Externally, the caller instantiates a light (distant, point or spot), and an SkDiffuseLightingFilter or SkSpecularLightingImageFilter with that light. A Sobel edge detection filter is applied to the alpha of the incoming bitmap, and the result is used as a height map for lighting calculations.

Patch Set 1 #

Patch Set 2 : create factory functions, remove SkLights from header, implement serialization #

Patch Set 3 : Moved all factory functions to SkLightingImageFilter; hid subclasses. Tweaked gm lighting params. #

Total comments: 6

Patch Set 4 : switch everything to SkScalar; fix nits #

Total comments: 12

Patch Set 5 : fixes from Tom's comments: renames, comments, non-SkScalar-clean stuff #

Unified diffs Side-by-side diffs Delta from patch set Stats (+780 lines, -0 lines) Patch
A gm/lighting.cpp View 1 2 3 1 chunk +91 lines, -0 lines 0 comments Download
M gyp/effects.gyp View 2 chunks +2 lines, -0 lines 0 comments Download
M gyp/gmslides.gypi View 1 chunk +1 line, -0 lines 0 comments Download
A include/effects/SkLightingImageFilter.h View 1 2 3 1 chunk +87 lines, -0 lines 0 comments Download
A src/effects/SkLightingImageFilter.cpp View 1 2 3 4 1 chunk +599 lines, -0 lines 0 comments Download

Messages

Total messages: 15
Stephen White
12 years, 3 months ago (2012-06-19 21:34:23 UTC) #1
reed1
Can we reformulate this as a set of factory functions, rather than exposing so much ...
12 years, 3 months ago (2012-06-20 12:12:25 UTC) #2
Stephen White
On 2012/06/20 12:12:25, reed1 wrote: > Can we reformulate this as a set of factory ...
12 years, 3 months ago (2012-06-20 14:03:44 UTC) #3
reed1
Just trying to minimize our public base-class exposure. A virtual light hierarchy can be made ...
12 years, 3 months ago (2012-06-20 14:24:21 UTC) #4
Stephen White
create factory functions, remove SkLights from header, implement serialization
12 years, 3 months ago (2012-06-20 16:17:18 UTC) #5
reed1
1. Deliberately using float instead of SkScalar in SkPoint3? 2. Can all of the factories ...
12 years, 3 months ago (2012-06-20 16:45:43 UTC) #6
Stephen White
On 2012/06/20 16:45:43, reed1 wrote: > 1. Deliberately using float instead of SkScalar in SkPoint3? ...
12 years, 3 months ago (2012-06-20 18:35:26 UTC) #7
reed1
1. Until we kill SkScalar-as-fixed globally, lets not introduce a root-level class like SkPoint3 that ...
12 years, 3 months ago (2012-06-20 20:31:18 UTC) #8
reed1
http://codereview.appspot.com/6302101/diff/10002/src/effects/SkLightingImageFilter.cpp File src/effects/SkLightingImageFilter.cpp (right): http://codereview.appspot.com/6302101/diff/10002/src/effects/SkLightingImageFilter.cpp#newcode14 src/effects/SkLightingImageFilter.cpp:14: const float oneThird = 1.0f / 3.0f; nit: gOneThird ...
12 years, 3 months ago (2012-06-20 20:37:22 UTC) #9
Stephen White
On 2012/06/20 20:31:18, reed1 wrote: > 1. Until we kill SkScalar-as-fixed globally, lets not introduce ...
12 years, 3 months ago (2012-06-20 20:52:10 UTC) #10
Stephen White
http://codereview.appspot.com/6302101/diff/10002/src/effects/SkLightingImageFilter.cpp File src/effects/SkLightingImageFilter.cpp (right): http://codereview.appspot.com/6302101/diff/10002/src/effects/SkLightingImageFilter.cpp#newcode14 src/effects/SkLightingImageFilter.cpp:14: const float oneThird = 1.0f / 3.0f; On 2012/06/20 ...
12 years, 3 months ago (2012-06-20 23:21:32 UTC) #11
TomH
Mike tackled all the tough stuff. http://codereview.appspot.com/6302101/diff/16001/src/effects/SkLightingImageFilter.cpp File src/effects/SkLightingImageFilter.cpp (right): http://codereview.appspot.com/6302101/diff/16001/src/effects/SkLightingImageFilter.cpp#newcode22 src/effects/SkLightingImageFilter.cpp:22: inline void shiftMatrix(int ...
12 years, 3 months ago (2012-06-21 15:21:20 UTC) #12
Stephen White
Thanks for the review. http://codereview.appspot.com/6302101/diff/16001/src/effects/SkLightingImageFilter.cpp File src/effects/SkLightingImageFilter.cpp (right): http://codereview.appspot.com/6302101/diff/16001/src/effects/SkLightingImageFilter.cpp#newcode22 src/effects/SkLightingImageFilter.cpp:22: inline void shiftMatrix(int m[9]) { ...
12 years, 3 months ago (2012-06-22 18:13:40 UTC) #13
TomH
LGTM
12 years, 3 months ago (2012-06-22 20:31:50 UTC) #14
Stephen White
12 years, 3 months ago (2012-06-22 21:01:50 UTC) #15
Landed as r4314; closing.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b