diff options
author | senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-07-11 16:01:22 +0000 |
---|---|---|
committer | senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-07-11 16:01:22 +0000 |
commit | 894790d77c56cd4bae8070331d275c6d2897e33c (patch) | |
tree | 3eb922a14915b4a54f5788b323ae6d2c6c80fe45 /gyp | |
parent | eb715c8d5caa2191d611c4f9cfb22b4afc6c8d02 (diff) |
This patch implements the diffuse and specular lighting filters in Ganesh.
There are three light types for each: distant, point and spot, whose code
generation lives in a GrGLLight class hierarchy. This similar to the CPU
implementation, where each light type provides a function to compute the vector
from the surface plane to the light (surfaceToLight) and to compute the light
colour (emitLightColour). Instead of templated member functions, as in the CPU
implementation, these are virtual functions to emit the light-specific GLSL
code.
All of the code for the GPU path lives in the same file as that for the CPU
path, SkLightingImageFilter.cpp. In order to provide Ganesh a hook to access
it, SkImageFilter now has a asNewCustomStage() virtual, which allows an image
filter to return a GrCustomStage representing that filter.
Note that this patch does not handle the border conditions correctly (the
[top|bottom][Left|Right]Normal() functions in the CPU implementation). That
will come in a future patch.
Review URL: http://codereview.appspot.com/6345081/
git-svn-id: http://skia.googlecode.com/svn/trunk@4535 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gyp')
-rw-r--r-- | gyp/effects.gyp | 2 | ||||
-rw-r--r-- | gyp/gpu.gyp | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/gyp/effects.gyp b/gyp/effects.gyp index fbccb401b9..cb15a2ac2e 100644 --- a/gyp/effects.gyp +++ b/gyp/effects.gyp @@ -7,6 +7,8 @@ '../include/config', '../include/core', '../include/effects', + '../include/gpu', + '../src/gpu', ], 'sources': [ '../include/effects/Sk1DPathEffect.h', diff --git a/gyp/gpu.gyp b/gyp/gpu.gyp index 91e7385fdf..2874054bd3 100644 --- a/gyp/gpu.gyp +++ b/gyp/gpu.gyp @@ -163,6 +163,9 @@ 'include_dirs': [ '../include/core', '../include/config', + '../include/effects', # This is only to get Sk effects into + # GrGpuGL_unittest.cpp, not for general + # consumption in src/gpu. '../include/gpu', '../src/core', # SkRasterClip.h '../src/gpu' |