skia2/include/core
senorblanco@chromium.org 894790d77c 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
2012-07-11 16:01:22 +00:00
..
Sk64.h Make SkMath.h less visible in public header files. 2011-09-27 17:38:17 +00:00
SkAdvancedTypefaceMetrics.h Expanded distribution of instance counting 2012-06-21 20:25:03 +00:00
SkAutoKern.h Automatic update of all copyright notices to reflect new license terms. 2011-07-28 14:26:00 +00:00
SkBitmap.h AutoScratchTexture can now release its texture and it will return to the texture cache when freed 2012-06-22 12:41:43 +00:00
SkBlitRow.h Punctuation cleanup to satisfy idiosyncracies of OpenBSD gcc 4.2.1. 2012-06-01 13:15:47 +00:00
SkBlitter.h Tighten up restrictions on blit width: some shaders assert that they 2011-12-29 16:09:31 +00:00
SkBounder.h add more SkInstCnt plumbing 2012-06-26 17:43:26 +00:00
SkBuffer.h Automatic update of all copyright notices to reflect new license terms. 2011-07-28 14:26:00 +00:00
SkCanvas.h Expanded distribution of instance counting 2012-06-21 20:25:03 +00:00
SkChecksum.h restore 4478 w/ fixed assert (no long need 8-byte alignment) 2012-07-09 17:44:44 +00:00
SkChunkAlloc.h change SkChunkAlloc to grow its allocations geometrically (not linearly) 2012-05-17 14:28:11 +00:00
SkClipStack.h pass the region-op to the clipstack for SkCanvas::clipRegion. 2012-05-16 18:50:40 +00:00
SkColor.h Automatic update of all copyright notices to reflect new license terms. 2011-07-28 14:26:00 +00:00
SkColorFilter.h Added Inst counting to SkFlattenable-derived classes 2012-06-27 14:03:26 +00:00
SkColorPriv.h add SkFourByteInterp256 variant, when the caller has already scaled the last 2012-03-12 14:25:18 +00:00
SkColorShader.h Cleanup code related to SkFlattenable::flatten() 2012-03-29 15:18:04 +00:00
SkColorTable.h Added Inst counting to SkFlattenable-derived classes 2012-06-27 14:03:26 +00:00
SkComposeShader.h Cleanup code related to SkFlattenable::flatten() 2012-03-29 15:18:04 +00:00
SkData.h Fixed Windows compiler complaints 2012-07-10 17:30:58 +00:00
SkDeque.h Automatic update of all copyright notices to reflect new license terms. 2011-07-28 14:26:00 +00:00
SkDescriptor.h restore 4478 w/ fixed assert (no long need 8-byte alignment) 2012-07-09 17:44:44 +00:00
SkDevice.h Rolling back r4034 (Proposed plumbing to propagate save & restore) 2012-07-03 19:12:29 +00:00
SkDeviceProfile.h Expanded distribution of instance counting 2012-06-21 20:25:03 +00:00
SkDither.h Automatic update of all copyright notices to reflect new license terms. 2011-07-28 14:26:00 +00:00
SkDraw.h Fixing the drawing of blurred shodows for hairline paths with software rendering 2012-04-04 15:16:51 +00:00
SkDrawFilter.h add more SkInstCnt plumbing 2012-06-26 17:43:26 +00:00
SkDrawLooper.h Added Inst counting to SkFlattenable-derived classes 2012-06-27 14:03:26 +00:00
SkEdgeClipper.h Automatic update of all copyright notices to reflect new license terms. 2011-07-28 14:26:00 +00:00
SkEmptyShader.h Cleanup code related to SkFlattenable::flatten() 2012-03-29 15:18:04 +00:00
SkEndian.h Open type table definitions. 2012-02-02 19:15:21 +00:00
SkFDot6.h Automatic update of all copyright notices to reflect new license terms. 2011-07-28 14:26:00 +00:00
SkFixed.h remove SK_CAN_USE_FLOAT (deprecated) 2012-06-11 21:21:26 +00:00
SkFlate.h Automatic update of all copyright notices to reflect new license terms. 2011-07-28 14:26:00 +00:00
SkFlattenable.h export flags on the state of the world when a picture was serialized. 2012-06-25 14:36:28 +00:00
SkFloatBits.h remove SK_CAN_USE_FLOAT (deprecated) 2012-06-11 21:21:26 +00:00
SkFloatingPoint.h remove SK_CAN_USE_FLOAT (deprecated) 2012-06-11 21:21:26 +00:00
SkFontHost.h Punctuation cleanup to satisfy idiosyncracies of OpenBSD gcc 4.2.1. 2012-06-01 13:15:47 +00:00
SkGeometry.h Add perspective support to the gpu aa hairline renderer. 2011-09-12 14:59:34 +00:00
SkGraphics.h change SetTLSFontCacheLimit to be void, since it doesn't easily know the prev value 2012-05-17 13:50:36 +00:00
SkImageFilter.h This patch implements the diffuse and specular lighting filters in Ganesh. 2012-07-11 16:01:22 +00:00
SkInstCnt.h Fixed memory deletion error in instance counting mechanism 2012-06-28 21:30:45 +00:00
SkLineClipper.h Automatic update of all copyright notices to reflect new license terms. 2011-07-28 14:26:00 +00:00
SkMallocPixelRef.h Cleanup code related to SkFlattenable::flatten() 2012-03-29 15:18:04 +00:00
SkMask.h move SkAutoMaskFreeImage from SkMaskFilter.h to SkMask.h 2011-10-18 17:35:26 +00:00
SkMaskFilter.h Added Inst counting to SkFlattenable-derived classes 2012-06-27 14:03:26 +00:00
SkMath.h Automatic update of all copyright notices to reflect new license terms. 2011-07-28 14:26:00 +00:00
SkMatrix.h Rename the existing flatten(void*) methods. 2012-06-08 18:30:46 +00:00
SkMetaData.h Automatic update of all copyright notices to reflect new license terms. 2011-07-28 14:26:00 +00:00
SkMMapStream.h Closing fd for mmap after mapping succeeds. 2011-12-09 21:19:38 +00:00
SkOrderedReadBuffer.h Rename the existing flatten(void*) methods. 2012-06-08 18:30:46 +00:00
SkOrderedWriteBuffer.h Rename the existing flatten(void*) methods. 2012-06-08 18:30:46 +00:00
SkOSFile.h Adding support to trunk for building Skia using the Android NDK. 2011-11-03 13:08:29 +00:00
SkPackBits.h Automatic update of all copyright notices to reflect new license terms. 2011-07-28 14:26:00 +00:00
SkPaint.h Punctuation cleanup to satisfy idiosyncracies of OpenBSD gcc 4.2.1. 2012-06-01 13:15:47 +00:00
SkPath.h add SkPath::contains(x, y) 2012-07-11 01:51:33 +00:00
SkPathEffect.h Added Inst counting to SkFlattenable-derived classes 2012-06-27 14:03:26 +00:00
SkPathMeasure.h add SK_WARN_UNUSED_RESULT warning to SkPathMeasure methods that might leave 2012-04-12 19:44:38 +00:00
SkPerspIter.h Automatic update of all copyright notices to reflect new license terms. 2011-07-28 14:26:00 +00:00
SkPicture.h export flags on the state of the world when a picture was serialized. 2012-06-25 14:36:28 +00:00
SkPixelRef.h Added Inst counting to SkFlattenable-derived classes 2012-06-27 14:03:26 +00:00
SkPoint.h add SkPoint::isZero(), match the existing method on SkIPoint 2012-05-29 01:40:15 +00:00
SkPostConfig.h Revert SkNO_RETURN_HINT fix in favor of a simpler fix 2012-07-11 13:30:08 +00:00
SkPreConfig.h define SK_CPU_SSE_LEVEL to a min of SSE2 if we're on 64bit x86 2012-07-09 13:02:35 +00:00
SkPtrRecorder.h Expanded distribution of instance counting 2012-06-21 20:25:03 +00:00
SkRandom.h Automatic update of all copyright notices to reflect new license terms. 2011-07-28 14:26:00 +00:00
SkRasterizer.h Added Inst counting to SkFlattenable-derived classes 2012-06-27 14:03:26 +00:00
SkReader32.h fix 64bit warnings (use: GYP_DEFINES=skia_arch_width=64 make ... ) 2012-07-09 13:13:23 +00:00
SkRect.h We often rgn-diff an area >= the other rgn. now we detect that and return empty 2012-05-31 18:28:59 +00:00
SkRefCnt.h AutoScratchTexture can now release its texture and it will return to the texture cache when freed 2012-06-22 12:41:43 +00:00
SkRefDict.h Automatic update of all copyright notices to reflect new license terms. 2011-07-28 14:26:00 +00:00
SkRegion.h Rename the existing flatten(void*) methods. 2012-06-08 18:30:46 +00:00
SkRelay.h Automatic update of all copyright notices to reflect new license terms. 2011-07-28 14:26:00 +00:00
SkScalar.h faster SkScalarIsFinite() 2012-06-13 13:03:08 +00:00
SkScalarCompare.h Automatic update of all copyright notices to reflect new license terms. 2011-07-28 14:26:00 +00:00
SkScalerContext.h Punctuation cleanup to satisfy idiosyncracies of OpenBSD gcc 4.2.1. 2012-06-01 13:15:47 +00:00
SkScan.h fix scalar=fixed by implementing SkRegion form of AntiFillRect 2011-10-24 12:56:20 +00:00
SkShader.h Added GPU implementation of 2-point conical gradient. 2012-07-03 13:43:35 +00:00
SkShape.h Added Inst counting to SkFlattenable-derived classes 2012-06-27 14:03:26 +00:00
SkSize.h Automatic update of all copyright notices to reflect new license terms. 2011-07-28 14:26:00 +00:00
SkStream.h add read/write SkData methods 2012-07-02 19:35:13 +00:00
SkString.h Add an SK_PRINTF_LIKE macro, which declares a function to have printf-like 2012-07-09 18:22:08 +00:00
SkTArray.h replacing Gr* with Sk* in SkTArray.h 2011-11-30 18:35:19 +00:00
SkTDArray.h fix 64bit warnings (use: GYP_DEFINES=skia_arch_width=64 make ... ) 2012-07-09 13:13:23 +00:00
SkTDict.h Automatic update of all copyright notices to reflect new license terms. 2011-07-28 14:26:00 +00:00
SkTDStack.h Automatic update of all copyright notices to reflect new license terms. 2011-07-28 14:26:00 +00:00
SkTemplates.h GrTArray->SkTArray & docs 2011-09-14 13:54:05 +00:00
SkThread_platform.h fix warnings on Mac in miscellaneous files 2012-06-06 12:11:10 +00:00
SkThread.h WeakRefCnt 2012-05-16 18:21:56 +00:00
SkTime.h Automatic update of all copyright notices to reflect new license terms. 2011-07-28 14:26:00 +00:00
SkTLazy.h Shutup strict aliasing warnings in SkTLazy 2011-09-14 12:44:13 +00:00
SkTrace.h Automatic update of all copyright notices to reflect new license terms. 2011-07-28 14:26:00 +00:00
SkTRegistry.h Update files to use SK_BUILD_FOR_ANDROID. 2011-11-08 19:00:26 +00:00
SkTScopedPtr.h Automatic update of all copyright notices to reflect new license terms. 2011-07-28 14:26:00 +00:00
SkTSearch.h Make SkTSearch variants with compare func as template param 2012-07-03 15:03:10 +00:00
SkTypeface.h more SkInstCnt plumbing 2012-06-26 17:55:30 +00:00
SkTypes.h add SkAlign8 and SkIsAlign8 macros 2012-06-27 15:07:11 +00:00
SkUnitMapper.h Added Inst counting to SkFlattenable-derived classes 2012-06-27 14:03:26 +00:00
SkUnPreMultiply.h Automatic update of all copyright notices to reflect new license terms. 2011-07-28 14:26:00 +00:00
SkUtils.h Add ARM optimizations to the build. 2012-01-09 14:38:25 +00:00
SkUtilsArm.h arm: First step towards dynamic NEON support. 2012-05-30 13:54:41 +00:00
SkWeakRefCnt.h more SkInstCnt plumbing 2012-06-26 17:55:30 +00:00
SkWriter32.h add readPtr and writePtr to SkReader32 and SkWriter32 2012-06-12 20:47:53 +00:00
SkXfermode.h Added Inst counting to SkFlattenable-derived classes 2012-06-27 14:03:26 +00:00