aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/SkLightingImageFilter.cpp
Commit message (Collapse)AuthorAge
...
* Implement crop rect support for SkMatrixConvolutionImageFilter.Gravatar senorblanco@chromium.org2013-10-18
| | | | | | | | R=bsalomon@google.com Review URL: https://codereview.chromium.org/27471002 git-svn-id: http://skia.googlecode.com/svn/trunk@11863 2bbb7eff-a529-9590-31e7-b0007b416f81
* Make SkImageFilter::asNewEffect() (and all derived-class overrides) protected.Gravatar senorblanco@chromium.org2013-10-17
| | | | | | | | R=bsalomon@google.com, bsalomon Review URL: https://codereview.chromium.org/26937006 git-svn-id: http://skia.googlecode.com/svn/trunk@11847 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove need for readFlattenableT from SkLightingImageFilter.Gravatar commit-bot@chromium.org2013-10-14
| | | | | | | | | | | | | This will need new picture version. BUG= R=reed@android.com, sugoi@google.com, senorblanco@chromium.org, reed@google.com Author: mtklein@google.com Review URL: https://codereview.chromium.org/26594008 git-svn-id: http://skia.googlecode.com/svn/trunk@11758 2bbb7eff-a529-9590-31e7-b0007b416f81
* Change SkImageFilter's cropRect from SkIRect to a CropRect struct, ↵Gravatar senorblanco@chromium.org2013-10-10
| | | | | | | | | | | | | | containing an SkRect and flags indicating which parameters are set. NOTE: this will require SK_CROP_RECT_IS_INT=1 to be set in Chrome until Blink has been updated to use SkImageFilter::CropRect. Include https://codereview.chromium.org/26528002/ with the Skia roll. Note also that SK_CROP_RECT_IS_INT is a temporary measure until all call sites in Blink have been updated to use SkRect. R=reed@google.com Review URL: https://codereview.chromium.org/26371002 git-svn-id: http://skia.googlecode.com/svn/trunk@11692 2bbb7eff-a529-9590-31e7-b0007b416f81
* Make GPU coord transforms automaticGravatar bsalomon@google.com2013-10-02
| | | | | | | | | | | | | Adds a GrCoordTransform class and updates the framework to handle coord transforms similar to how it handles textures with GrTextureAccess. Renames GrGLEffectMatrix to GrGLCoordTransform and slightly repurposes it to be used by the framework instead of effects. R=bsalomon@google.com, robertphillips@google.com Review URL: https://codereview.chromium.org/24853002 git-svn-id: http://skia.googlecode.com/svn/trunk@11569 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert 11247, 11250, 11251, 11257, and 11279 to unblock DEPS roll ↵Gravatar robertphillips@google.com2013-09-16
| | | | | | | | | | | | | | (https://codereview.chromium.org/24159002/) 11279 Sanitizing source files in Housekeeper-Nightly - https://code.google.com/p/skia/source/detail?r=11279 11257 Canary build fix - https://codereview.chromium.org/23532068 11251 More warnings as errors fixes - https://code.google.com/p/skia/source/detail?r=11251 11250 Warnings as errors fix - https://code.google.com/p/skia/source/detail?r=11250 11247 Initial error handling code - https://chromiumcodereview.appspot.com/23021015 git-svn-id: http://skia.googlecode.com/svn/trunk@11288 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert the revert of 11247, 11250, 11251 and 11279 (Chrome already relies on ↵Gravatar robertphillips@google.com2013-09-16
| | | | | | changes in r11247) git-svn-id: http://skia.googlecode.com/svn/trunk@11287 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert 11247, 11250, 11251 and 11279 to unblock DEPS roll ↵Gravatar robertphillips@google.com2013-09-16
| | | | | | | | | | | | | (https://codereview.chromium.org/24159002/) 11279 Sanitizing source files in Housekeeper-Nightly - https://code.google.com/p/skia/source/detail?r=11279 11251 More warnings as errors fixes - https://code.google.com/p/skia/source/detail?r=11251 11250 Warnings as errors fix - https://code.google.com/p/skia/source/detail?r=11250 11247 Initial error handling code - https://chromiumcodereview.appspot.com/23021015 git-svn-id: http://skia.googlecode.com/svn/trunk@11285 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fixed issues found by fuzzerGravatar commit-bot@chromium.org2013-09-13
| | | | | | | | | | | | | | | Last week, the fuzzer found a few numerical issue with filters and I had written some fixes for them. Here are the fixes with some unit tests. For senorblanco : So I figured out what was asserting when we'd get a 0 width "result" in SkBicubicImageFilter::onFilterImage(). Basically, if the "result" SkBitmap object calls SkBitmap::setConfig() with "width" and/or "height" set to 0, then the SkBitmap object will call SkBitmap::reset(), making the SkBitmap object's config invalid. At this point, calling SkBitmap::getAddr32() will assert, even without attempting to dereference the data pointer, because the SkBitmap's config is invalid. If height is valid, but width is 0, then this call to SkBitmap::getAddr32() happens directly in SkBicubicImageFilter::onFilterImage() a few lines lower and asserts right away. BUG= R=senorblanco@google.com, senorblanco@chromium.org, bsalomon@google.com Author: sugoi@chromium.org Review URL: https://chromiumcodereview.appspot.com/23533042 git-svn-id: http://skia.googlecode.com/svn/trunk@11249 2bbb7eff-a529-9590-31e7-b0007b416f81
* Initial error handling codeGravatar commit-bot@chromium.org2013-09-13
| | | | | | | | | | | | | I made it as simple as possible. The impact seems minimal and it should do what's necessary to make this code secure. BUG= R=reed@google.com, scroggo@google.com, djsollen@google.com, sugoi@google.com, bsalomon@google.com, mtklein@google.com, senorblanco@google.com, senorblanco@chromium.org Author: sugoi@chromium.org Review URL: https://chromiumcodereview.appspot.com/23021015 git-svn-id: http://skia.googlecode.com/svn/trunk@11247 2bbb7eff-a529-9590-31e7-b0007b416f81
* Change old PRG to be SkLCGRandom; change new one to SkRandomGravatar commit-bot@chromium.org2013-09-09
| | | | | | | | | | | | | | The goal here is to get people to start using the new random number generator, while leaving the old one in place so we don't have to rebaseline GMs. R=reed@google.com, bsalomon@google.com Author: jvanverth@google.com Review URL: https://chromiumcodereview.appspot.com/23576015 git-svn-id: http://skia.googlecode.com/svn/trunk@11169 2bbb7eff-a529-9590-31e7-b0007b416f81
* Rename ShaderType enum to ShaderVisibilityGravatar commit-bot@chromium.org2013-08-30
| | | | | | | | | | | | | | | | | | | | | Renames ShaderType in GrGLShaderBuilder to ShaderVisibility. It is now used solely as a bitfield. Methods that previously accepted a single ShaderType value are split into separate calls: - getShader -> vsGetShader, gsGetShader, fsGetShader - emiitFunction -> fsEmitFunction - appendTextureLookup -> fsAppendTextureLookup No change in functionality. This is a refactoring to allow us to separate the vertex/geometry and fragment parts of GrGLShaderBuilder. R=bsalomon@google.com Author: cdalton@nvidia.com Review URL: https://chromiumcodereview.appspot.com/23826002 git-svn-id: http://skia.googlecode.com/svn/trunk@11044 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix case where GrGLEffectMatrix gives back a dangling ptr for the coords var ↵Gravatar commit-bot@chromium.org2013-08-28
| | | | | | | | | | | | name. R=robertphillips@google.com Author: bsalomon@google.com Review URL: https://chromiumcodereview.appspot.com/23706003 git-svn-id: http://skia.googlecode.com/svn/trunk@10982 2bbb7eff-a529-9590-31e7-b0007b416f81
* In image filters, apply the CTM and offset to the crop rect. This is ↵Gravatar senorblanco@chromium.org2013-08-27
| | | | | | | | | | | | | | necessary to compensate for both clipping applied by the compositor (communicated via the CTM) and for cropping applied in upstream image filters (communicated via the offset). This requires a few ugly conversions, since the crop rect is an SkIRect, and the ctm is an SkMatrix. I also had to offset the matrix passed to filter evaluation by drawSprite() and internalDrawBitmap() by the primitive position. This is the same offset that is applied when drawing the primitive, to compensate for the internal saveLayer(). Also apply the total matrix to the filter params in asNewEffect(), so that (for example) lighting params are offset by both the compositor clipping and upstream crop rects. R=reed@google.com Review URL: https://codereview.chromium.org/23295017 git-svn-id: http://skia.googlecode.com/svn/trunk@10961 2bbb7eff-a529-9590-31e7-b0007b416f81
* Refactor GrGLUniformManager::UniformHandle to initialize itself by defaultGravatar commit-bot@chromium.org2013-08-14
| | | | | | | | | | | | | | | | | | | | Refactor GrGLUniformManager::UniformHandle to initialize itself to "invalid" state by default. This simplifies the effect constructors. In the future, it should also help catch potential uninitialized uniform variable usage. Remove unneeded explicit uniform handle validity assertions before the handle usage. The assertion will always be made when handle is converted to index. BUG=skia:1492 R=bsalomon@google.com Author: kkinnunen@nvidia.com Review URL: https://chromiumcodereview.appspot.com/22340010 git-svn-id: http://skia.googlecode.com/svn/trunk@10713 2bbb7eff-a529-9590-31e7-b0007b416f81
* Implement crop rect for lighting image filters. Changes for the CPU path ↵Gravatar senorblanco@chromium.org2013-07-26
| | | | | | | | | | | | | | were fairly straightforward: use the bounds rectangle when traversing the pixels, not the source rectangle. For the GPU path, this required modifying the signature of SkImageFilter::asNewEffect() to receive the bounds offset, so that the lighting filters could offset the light position by the offset. It also required modifying the base-class implementation of SkImageFilter::filterImageGPU() (which implements single-pass filters) to intersect against the bounds rect, to pass its offset to asNewEffect(), and to modify the caller's offset (so it's drawn in the correct place). Note: this will require rebaselining the lighting GM. Six new test cases were added, to accommodate a cropped version of each lighting filter. R=bsalomon@google.com, reed@google.com Review URL: https://codereview.chromium.org/20426002 git-svn-id: http://skia.googlecode.com/svn/trunk@10379 2bbb7eff-a529-9590-31e7-b0007b416f81
* Make GrGLShaderBuilder check whether GrEffect advertised that it would ↵Gravatar commit-bot@chromium.org2013-05-09
| | | | | | | | | | | | require the dst color or fragment position R=senorblanco@chromium.org, robertphillips@google.com Author: bsalomon@google.com Review URL: https://chromiumcodereview.appspot.com/14998007 git-svn-id: http://skia.googlecode.com/svn/trunk@9074 2bbb7eff-a529-9590-31e7-b0007b416f81
* Allow single-pass filters (which use asNewEffect()) to participate in the ↵Gravatar senorblanco@chromium.org2013-04-08
| | | | | | | | | | image filter DAG. This was done by introducing the SkSinglePassImageFilter abstract base class, which implements canFilterImageGPU() and filterImageGPU() on behalf of the derived class. The derived class still only needs to asNewEffect(). This allows us to recurse on the filter input in SkSinglePassImageFilter::onFilterImageGPU(). It also allows us to remove any knowledge of single-pass image filters from SkGpuDevice and from the SkImageFilter base class as well. BUG= Review URL: https://codereview.chromium.org/13602013 git-svn-id: http://skia.googlecode.com/svn/trunk@8563 2bbb7eff-a529-9590-31e7-b0007b416f81
* Move nested class GrDrawTarget::Caps out as GrDrawTargetCaps.Gravatar bsalomon@google.com2013-03-25
| | | | | | | Pass caps to GrEffect::TestCreate() functions so that they can return effects that will work with the capabilities. Review URL: https://codereview.chromium.org/12965018 git-svn-id: http://skia.googlecode.com/svn/trunk@8369 2bbb7eff-a529-9590-31e7-b0007b416f81
* Attempt to reland 8264-5 with warning-as-error fixes.Gravatar bsalomon@google.com2013-03-20
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@8272 2bbb7eff-a529-9590-31e7-b0007b416f81
* revert 8265-8264 (broke build)Gravatar reed@google.com2013-03-20
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@8268 2bbb7eff-a529-9590-31e7-b0007b416f81
* Adds local coords to GrEffect system.Gravatar bsalomon@google.com2013-03-20
| | | | | | | | | | | | | Effects can ask the builder for local coords which may or may not be distinct from positions. GrEffectStage tracks changes to relationship between pos and local coords. GrGLEffectMatrix and GrSingleTextureEffect can use either pos or textures as intput coords GrSimpleTextureEffect now allows for an explicit texture coords attribute. Review URL: https://codereview.chromium.org/12531015 git-svn-id: http://skia.googlecode.com/svn/trunk@8264 2bbb7eff-a529-9590-31e7-b0007b416f81
* Make GrGLEffects use an interface to append their code.Gravatar bsalomon@google.com2013-03-07
| | | | | | | A small step towards encapsulating GrGLShaderBuilder. Review URL: https://codereview.chromium.org/12547012 git-svn-id: http://skia.googlecode.com/svn/trunk@8018 2bbb7eff-a529-9590-31e7-b0007b416f81
* Use SkMWRandom in GLPrograms test.Gravatar bsalomon@google.com2013-02-13
| | | | | | | R=jvanverth@google.com Review URL: https://codereview.appspot.com/7306097 git-svn-id: http://skia.googlecode.com/svn/trunk@7721 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add an origin flag for backend (external) textures. Some textures in WebKit ↵Gravatar senorblanco@chromium.org2013-01-28
| | | | | | | | have a topdown orientation, and skia needs to be notified of this, so that they are not drawn upside-down. Review URL: https://codereview.appspot.com/7200048 git-svn-id: http://skia.googlecode.com/svn/trunk@7414 2bbb7eff-a529-9590-31e7-b0007b416f81
* Switch GrEffect::onIsEqual signature back to GrEffect from GrEffectRef.Gravatar bsalomon@google.com2013-01-22
| | | | | | | R=robertphillips@google.com Review URL: https://codereview.appspot.com/7188046 git-svn-id: http://skia.googlecode.com/svn/trunk@7326 2bbb7eff-a529-9590-31e7-b0007b416f81
* Let them eat GrEffectRef.Gravatar bsalomon@google.com2013-01-22
| | | | | | | Changes the remaining existing code that operates on naked GrEffects to GrEffectRef. Review URL: https://codereview.appspot.com/7124058 git-svn-id: http://skia.googlecode.com/svn/trunk@7321 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove default implementation of GrEffect::isEqual. Make ↵Gravatar bsalomon@google.com2013-01-17
| | | | | | | | GrSingleTextureEffect abstract. Review URL: https://codereview.appspot.com/7142049 git-svn-id: http://skia.googlecode.com/svn/trunk@7254 2bbb7eff-a529-9590-31e7-b0007b416f81
* Change some function/vars from EffectPtr to EffectRef to reflect ↵Gravatar bsalomon@google.com2013-01-16
| | | | | | GrEffectPtr->GrEffectRef renaming. git-svn-id: http://skia.googlecode.com/svn/trunk@7226 2bbb7eff-a529-9590-31e7-b0007b416f81
* Wrap GrEffects in GrEffectPtr.Gravatar bsalomon@google.com2013-01-16
| | | | | | | | | This is the first step towards automatic recycling of scratch resouces in the cache via ref-cnts. R=robertphillips@google.com Review URL: https://codereview.appspot.com/7092061 git-svn-id: http://skia.googlecode.com/svn/trunk@7222 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add GrEffect::updateKnownColorComponents(). It is used to determine whether ↵Gravatar bsalomon@google.com2013-01-11
| | | | | | | | the output of an effect has a constant output value for r,g,b, or a. Review URL: https://codereview.appspot.com/7064057 git-svn-id: http://skia.googlecode.com/svn/trunk@7144 2bbb7eff-a529-9590-31e7-b0007b416f81
* 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