From 894790d77c56cd4bae8070331d275c6d2897e33c Mon Sep 17 00:00:00 2001 From: "senorblanco@chromium.org" Date: Wed, 11 Jul 2012 16:01:22 +0000 Subject: 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 --- gyp/effects.gyp | 2 ++ gyp/gpu.gyp | 3 +++ 2 files changed, 5 insertions(+) (limited to 'gyp') 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' -- cgit v1.2.3