aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/SkLightingImageFilter.cpp
Commit message (Collapse)AuthorAge
* Remove default texture coords / texture matrixGravatar bsalomon@google.com2012-11-05
| | | | | | Review URL: https://codereview.appspot.com/6775100 git-svn-id: http://skia.googlecode.com/svn/trunk@6293 2bbb7eff-a529-9590-31e7-b0007b416f81
* Make all remaining effects use GrGLEffectMatrixGravatar bsalomon@google.com2012-11-02
| | | | | | | R=robertphillips@google.com Review URL: https://codereview.appspot.com/6817079 git-svn-id: http://skia.googlecode.com/svn/trunk@6286 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2012-10-31
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@6210 2bbb7eff-a529-9590-31e7-b0007b416f81
* Rebase gpu_dev up to r5182Gravatar bsalomon@google.com2012-10-29
|\ | | | | | | git-svn-id: http://skia.googlecode.com/svn/branches/gpu_dev@6187 2bbb7eff-a529-9590-31e7-b0007b416f81
* | Pass GrCustomStage to key-generation functions and emitCode().Gravatar bsalomon@google.com2012-10-29
| | | | | | | | | | | | | | R=robertphillips@google.com Review URL: https://codereview.appspot.com/6819046 git-svn-id: http://skia.googlecode.com/svn/branches/gpu_dev@6182 2bbb7eff-a529-9590-31e7-b0007b416f81
| * Fix alpha computation for specular lighting filter (GPU path).Gravatar senorblanco@chromium.org2012-10-29
| | | | | | | | | | | | | | | | | | | | Change lighting GM background to show blending. NOTE: This will require new results for the lighting GM. Review URL: https://codereview.appspot.com/6812050 git-svn-id: http://skia.googlecode.com/svn/trunk@6181 2bbb7eff-a529-9590-31e7-b0007b416f81
* | Make lighting filters directly inherit from GrGLEffect.Gravatar bsalomon@google.com2012-10-29
| | | | | | | | | | | | | | Delete GrGLLegacyEffect. Review URL: https://codereview.appspot.com/6815050 git-svn-id: http://skia.googlecode.com/svn/branches/gpu_dev@6165 2bbb7eff-a529-9590-31e7-b0007b416f81
* | Make the orientation of a texture accessible from and known by GrSurface.Gravatar bsalomon@google.com2012-10-26
| | | | | | | | | | | | | | R=robertphillips@google.com Review URL: https://codereview.appspot.com/6801044 git-svn-id: http://skia.googlecode.com/svn/branches/gpu_dev@6148 2bbb7eff-a529-9590-31e7-b0007b416f81
* | Make GrGLEffect::setData take GrEffectStage rather than GrEffect.Gravatar bsalomon@google.com2012-10-26
|/ | | | | | | | | This allows the coord-change matrix to be communicated to setData(). An accessor for this matrix is also added to GrEffectStage. R=robertphillips@google.com Review URL: https://codereview.appspot.com/6779057 git-svn-id: http://skia.googlecode.com/svn/branches/gpu_dev@6143 2bbb7eff-a529-9590-31e7-b0007b416f81
* Rename StageKey and related stuff.Gravatar bsalomon@google.com2012-10-25
| | | | | | | R=robertphillips@google.com Review URL: https://codereview.appspot.com/6785049 git-svn-id: http://skia.googlecode.com/svn/trunk@6130 2bbb7eff-a529-9590-31e7-b0007b416f81
* Rename GrProgramStageFactory to GrBackendEffectFactory.Gravatar bsalomon@google.com2012-10-25
| | | | | | Review URL: https://codereview.appspot.com/6773044 git-svn-id: http://skia.googlecode.com/svn/trunk@6125 2bbb7eff-a529-9590-31e7-b0007b416f81
* GrGLProgramStage Renaming Part 3Gravatar bsalomon@google.com2012-10-25
| | | | | | | | | | s/GLProgramStage/GLEffect minor whitespace/spelling fixup R=robertphillips@google.com Review URL: https://codereview.appspot.com/6767054 git-svn-id: http://skia.googlecode.com/svn/trunk@6095 2bbb7eff-a529-9590-31e7-b0007b416f81
* GrGLProgramStage Renaming Part 2Gravatar bsalomon@google.com2012-10-25
| | | | | | | s/GrGLLegacyProgramStage/GrGLLegacyEffect Review URL: https://codereview.appspot.com/6761056 git-svn-id: http://skia.googlecode.com/svn/trunk@6091 2bbb7eff-a529-9590-31e7-b0007b416f81
* GrGLProgramStage Renaming Part 1.Gravatar bsalomon@google.com2012-10-25
| | | | | | | | Renamed cpp and h s/GrGLProgramStage/GrGLEffect/ Review URL: https://codereview.appspot.com/6759054 git-svn-id: http://skia.googlecode.com/svn/trunk@6090 2bbb7eff-a529-9590-31e7-b0007b416f81
* GrCustomStage Renaming Part 5Gravatar bsalomon@google.com2012-10-25
| | | | | | | | | Stuff found by searching for "stage". R=robertphillips@google.com Review URL: https://codereview.appspot.com/6772043 git-svn-id: http://skia.googlecode.com/svn/trunk@6089 2bbb7eff-a529-9590-31e7-b0007b416f81
* GrCustomStage Renaming Part 4Gravatar bsalomon@google.com2012-10-24
| | | | | | | Rename a bunch of things found by searching for "custom". Review URL: https://codereview.appspot.com/6765048 git-svn-id: http://skia.googlecode.com/svn/trunk@6085 2bbb7eff-a529-9590-31e7-b0007b416f81
* GrCustomStage Renaming Part 3Gravatar bsalomon@google.com2012-10-24
| | | | | | | | | Rename all things *CUSTOM_STAGE*, customStage*, and other miscellany R=robertphillips@google.com Review URL: https://codereview.appspot.com/6769048 git-svn-id: http://skia.googlecode.com/svn/trunk@6081 2bbb7eff-a529-9590-31e7-b0007b416f81
* GrCustomStage Renaming Part 2Gravatar bsalomon@google.com2012-10-24
| | | | | | | | | GrSamplerState member rename GrCustomStageUnitTest rename some comment updates Review URL: https://codereview.appspot.com/6771043 git-svn-id: http://skia.googlecode.com/svn/trunk@6078 2bbb7eff-a529-9590-31e7-b0007b416f81
* CustomStage Renaming Part 1Gravatar bsalomon@google.com2012-10-24
| | | | | | | | | | | | | | | | | | | Search and replace: GrCustomStage->GrEffect GrCustomStageTestFactory->GrEffectTestFactory renamed the cpp/h files from customStage->effect reordered gypi, #includes, forward decls to maintain alphabetical sort. manually fixed up some whitespace and linewraps deleted a commented out #include R=robertphillips@google.com Review URL: https://codereview.appspot.com/6758046 git-svn-id: http://skia.googlecode.com/svn/trunk@6076 2bbb7eff-a529-9590-31e7-b0007b416f81
* Combine the emit functions in GrGLProgramStage.Gravatar bsalomon@google.com2012-10-23
| | | | | | | R=robertphillips@google.com Review URL: https://codereview.appspot.com/6741064 git-svn-id: http://skia.googlecode.com/svn/trunk@6057 2bbb7eff-a529-9590-31e7-b0007b416f81
* Reland r6330 thru r6333 but do without enabling ↵Gravatar bsalomon@google.com2012-10-23
| | | | | | GL_ARB_fragment_coord_conventions on Intel GPUs. git-svn-id: http://skia.googlecode.com/svn/trunk@6048 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert r6330 thru 6333 while we figure out what to do about Intel bots ↵Gravatar bsalomon@google.com2012-10-22
| | | | | | (possible driver bug). git-svn-id: http://skia.googlecode.com/svn/trunk@6037 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove two params from GrGLProgramStage::setData that are no longer necessary.Gravatar bsalomon@google.com2012-10-22
| | | | | | | R=senorblanco@chromium.org Review URL: https://codereview.appspot.com/6744062 git-svn-id: http://skia.googlecode.com/svn/trunk@6031 2bbb7eff-a529-9590-31e7-b0007b416f81
* Automatically handle converting gl_FragCoord to Skia's y-down device coords.Gravatar bsalomon@google.com2012-10-22
| | | | | | | | | NOTE: THIS WILL LIKELY REQUIRE GM REBASELINING. R=robertphillips@google.com,senorblanco@chromium.org Review URL: https://codereview.appspot.com/6744061 git-svn-id: http://skia.googlecode.com/svn/trunk@6030 2bbb7eff-a529-9590-31e7-b0007b416f81
* Change SkLightingImageFilter to derive from SkSingleInputImageFilter, so ↵Gravatar senorblanco@chromium.org2012-10-05
| | | | | | | | | | that it can participate in filter DAGs. No tests yet. Review URL: https://codereview.appspot.com/6620055 git-svn-id: http://skia.googlecode.com/svn/trunk@5832 2bbb7eff-a529-9590-31e7-b0007b416f81
* Introduce GrGLShaderBuilder::TextureSamplerGravatar bsalomon@google.com2012-09-06
| | | | | | | | Review URL: https://codereview.appspot.com/6495099/ git-svn-id: http://skia.googlecode.com/svn/trunk@5422 2bbb7eff-a529-9590-31e7-b0007b416f81
* Recommit r5350 with fix for image failures (which affected GLs that don't ↵Gravatar bsalomon@google.com2012-08-30
| | | | | | support ARB_texture_swizzle). git-svn-id: http://skia.googlecode.com/svn/trunk@5353 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert 5350 while image changes are diagnosed.Gravatar bsalomon@google.com2012-08-30
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@5351 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove fModulate from GrGLShaderBuilderGravatar bsalomon@google.com2012-08-30
| | | | | | | | | Review URL: https://codereview.appspot.com/6495051/ git-svn-id: http://skia.googlecode.com/svn/trunk@5350 2bbb7eff-a529-9590-31e7-b0007b416f81
* Some GrGLShaderBuilder cleanupGravatar bsalomon@google.com2012-08-28
| | | | | | | | Review URL: https://codereview.appspot.com/6500043/ git-svn-id: http://skia.googlecode.com/svn/trunk@5322 2bbb7eff-a529-9590-31e7-b0007b416f81
* Result of running tools/sanitize_source_files.py (which was added in ↵Gravatar rmistry@google.com2012-08-23
| | | | | | | | | https://codereview.appspot.com/6465078/) This CL is part I of IV (I broke down the 1280 files into 4 CLs). Review URL: https://codereview.appspot.com/6485054 git-svn-id: http://skia.googlecode.com/svn/trunk@5262 2bbb7eff-a529-9590-31e7-b0007b416f81
* uniquely name FS functions, add lighting effects to unit testGravatar bsalomon@google.com2012-08-07
| | | | | | | Review URL: http://codereview.appspot.com/6458080/ git-svn-id: http://skia.googlecode.com/svn/trunk@4992 2bbb7eff-a529-9590-31e7-b0007b416f81
* Update SkFlattenable buffers to be more modular.Gravatar djsollen@google.com2012-08-07
| | | | | | | | | | | | | | | | | This CL is an effort to stage the conversion to named parameters for all SkFlattenable commands. This particular stage only does the following two things... 1. Move flattenable buffers from SkFlattenable.h into their own header. 2. Update and Add new read write methods for better clarity and convenience. BUG= Review URL: https://codereview.appspot.com/6448095 git-svn-id: http://skia.googlecode.com/svn/trunk@4980 2bbb7eff-a529-9590-31e7-b0007b416f81
* Introduction of set of functions to manage generation of texture fetch ↵Gravatar twiz@google.com2012-08-02
| | | | | | | | | shader code. A new set of routines have been added to GrGLShaderBuilder to emit texture fetches, taking into consideration the format of the texture to be accessed, and the channel swizzle. Review URL: https://codereview.appspot.com/6446072 git-svn-id: http://skia.googlecode.com/svn/trunk@4919 2bbb7eff-a529-9590-31e7-b0007b416f81
* Create GPU-less build of Skia.Gravatar bsalomon@google.com2012-08-02
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@4912 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove uniform names from top of GrGLProgram.cpp, builder responsible for ↵Gravatar bsalomon@google.com2012-07-25
| | | | | | | | | | | | "u" and stage num tags. Also add LF eol-style property to some files in src/gpu/effects. Review URL: http://codereview.appspot.com/6448049/ git-svn-id: http://skia.googlecode.com/svn/trunk@4770 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix static assert on non-windows compilers(?)Gravatar bsalomon@google.com2012-07-25
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@4759 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add GL uniform managerGravatar bsalomon@google.com2012-07-25
| | | | | | | | Review URL: http://codereview.appspot.com/6423066/ git-svn-id: http://skia.googlecode.com/svn/trunk@4758 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add SkScalarPow.Gravatar bungeman@google.com2012-07-25
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@4754 2bbb7eff-a529-9590-31e7-b0007b416f81
* SkNEW instead of new for lighting effects.Gravatar tomhudson@google.com2012-07-20
| | | | | | | | http://codereview.appspot.com/6351112/ git-svn-id: http://skia.googlecode.com/svn/trunk@4689 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix bad allocator access in r4616Gravatar bsalomon@google.com2012-07-16
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@4619 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove uniform var pointers from custom effectsGravatar bsalomon@google.com2012-07-16
| | | | | | | | Review URL: http://codereview.appspot.com/6374067/ git-svn-id: http://skia.googlecode.com/svn/trunk@4616 2bbb7eff-a529-9590-31e7-b0007b416f81
* There were three different problems with lighting filters:Gravatar senorblanco@chromium.org2012-07-13
| | | | | | | | | | | | | | | | | | | | | | | 1) Texture offsets (fImageIncrement) have to be signed depending on whether the texture is "right way up" (texture upload) or "upside down" (render target), so the surface normals were coming out upside down. 2) Light normals have to y-negated on upload These two bugs were cancelling each other out in SampleApp, (where we were testing w/textures) but not in Chrome (where we were testing w/render targets). 3) The extract-the-height-from-the-view-matrix hack I was using to compare light positions vs. gl_FragCoord doesn't work in Chrome where we compile with GR_STATIC_RECT_VB, and the view matrix contains more than the viewport transform (to accomodate the canonical vertex buffer). Fixed by passing the destination render target to GrGLProgramStage::setData(), so it can flip the light positions in Y on the CPU. Review URL: http://codereview.appspot.com/6343109/ git-svn-id: http://skia.googlecode.com/svn/trunk@4605 2bbb7eff-a529-9590-31e7-b0007b416f81
* Introduces new SingleTextureEffect base class for GrCustomStage objects.Gravatar tomhudson@google.com2012-07-12
| | | | | | | | | | | | | | This class tracks the texture that the object uses. A future commit will get rid of the GrTexture pointer currenty stored in the GrDrawState, allowing us to have CustomStages *without* textures. Requires gyp change on next roll. http://codereview.appspot.com/6306097/ git-svn-id: http://skia.googlecode.com/svn/trunk@4576 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix lighting filters on Windows, and re-enable the GPU path.Gravatar senorblanco@chromium.org2012-07-11
| | | | | | | | Review URL: http://codereview.appspot.com/6354094/ git-svn-id: http://skia.googlecode.com/svn/trunk@4557 2bbb7eff-a529-9590-31e7-b0007b416f81
* Disable GPU path for lighting filters, due to Windows weirdness. Unreviewed.Gravatar senorblanco@chromium.org2012-07-11
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@4547 2bbb7eff-a529-9590-31e7-b0007b416f81
* Mac GLSL fixes; unreviewed.Gravatar senorblanco@chromium.org2012-07-11
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@4539 2bbb7eff-a529-9590-31e7-b0007b416f81
* More build fixes; unreviewed.Gravatar senorblanco@chromium.org2012-07-11
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@4537 2bbb7eff-a529-9590-31e7-b0007b416f81
* Mac build fix; unreviewed.Gravatar senorblanco@chromium.org2012-07-11
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@4536 2bbb7eff-a529-9590-31e7-b0007b416f81
* This patch implements the diffuse and specular lighting filters in Ganesh. Gravatar senorblanco@chromium.org2012-07-11
| | | | | | | | | | | | | | | | | | | | | | | | | 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