aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/GLProgramsTest.cpp
Commit message (Collapse)AuthorAge
* Factory methods for heap-allocated SkImageFilter objects.Gravatar commit-bot@chromium.org2014-03-10
| | | | | | | | | | | | | | | | | | This is part of an effort to ensure that all SkPaint effects can only be allocated on the heap. This patch makes the constructors of SkImageFilter and its subclasses non-public and instead provides factory methods for creating these objects on the heap. We temporarily keep constructor of publicly visible classes public behind a flag. BUG=skia:2187 R=scroggo@google.com, mtklein@chromium.org, reed@google.com, senorblanco@google.com, senorblanco@chromium.org, bsalomon@google.com, sugoi@chromium.org, zork@chromium.org Author: dominikg@chromium.org Review URL: https://codereview.chromium.org/182983003 git-svn-id: http://skia.googlecode.com/svn/trunk@13718 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix warnings on Ubuntu13Gravatar commit-bot@chromium.org2014-02-21
| | | | | | | | | | | | | | | | | | | Turn off warnings when building libwebp. Turn off warnings when building libjpeg. Initialize some variables immediately. NOTRY=True NOTREECHECKS=True BUG=skia:2213 BUG=skia:2214 R=bsalomon@google.com, halcanary@google.com Author: scroggo@google.com Review URL: https://codereview.chromium.org/175383002 git-svn-id: http://skia.googlecode.com/svn/trunk@13545 2bbb7eff-a529-9590-31e7-b0007b416f81
* Factory methods for heap-allocated SkColorFilter objects.Gravatar commit-bot@chromium.org2014-02-21
| | | | | | | | | | | | | | | | | | This is part of an effort to ensure that all SkPaint effects can only be allocated on the heap. This patch makes the constructors of SkColorFilter and its subclasses non-public and instead provides factory methods for creating these objects on the heap. We temporarily keep constructor of publicly visible classes public behind a flag. BUG=skia:2187 R=scroggo@google.com, mtklein@google.com, reed@google.com Author: dominikg@chromium.org Review URL: https://codereview.chromium.org/175293002 git-svn-id: http://skia.googlecode.com/svn/trunk@13539 2bbb7eff-a529-9590-31e7-b0007b416f81
* Stop discarding in frag shader when coverage is zero and stencil writes are ↵Gravatar commit-bot@chromium.org2014-02-05
| | | | | | | | | | | | | | | | | | | | | | | | enabled This fixes the corruption in the NVPR images here: http://108.170.217.252:10117/builders/Test-Win8-ShuttleA-GTX660-x86-Debug/builds/251/steps/CompareGMs/logs/stdio caused by: https://skia.googlesource.com/skia.git/+/65ee5f424cb4dabd453268902c00086605d77c1d The stencil path step writes inside and outside the clip when the clip is implemented by a coverage effect. The path cover step then doesn't write outside of the clip because the FS discards. This leaves stencil values outside of the clip non-zero which messed up subsequent path or clip draws to those samples. R=robertphillips@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/154623002 git-svn-id: http://skia.googlecode.com/svn/trunk@13320 2bbb7eff-a529-9590-31e7-b0007b416f81
* Use GrConvexPolyEffect when clip is a single convex polygonGravatar commit-bot@chromium.org2014-02-04
| | | | | | | | | | | | | | BUG=skia:2051 Committed: http://code.google.com/p/skia/source/detail?r=13286 R=robertphillips@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/151523005 git-svn-id: http://skia.googlecode.com/svn/trunk@13306 2bbb7eff-a529-9590-31e7-b0007b416f81
* Cleanup: Sanitize the order of includes under tests/Gravatar tfarina@chromium.org2014-01-24
| | | | | | | | | | | | | | | | Initially this was to make sure Test.h appeared after the Sk*.h includes. Patch generated by the following command line: $ ~/chromium/src/tools/sort-headers.py tests/*.cpp BUG=None TEST=tests R=robertphillips@google.com Review URL: https://codereview.chromium.org/145313004 git-svn-id: http://skia.googlecode.com/svn/trunk@13177 2bbb7eff-a529-9590-31e7-b0007b416f81
* Move macros from TestClassDef.h to Test.hGravatar commit-bot@chromium.org2014-01-14
| | | | | | | | | | | | | | Motivation: those macros don't make any sense without the definitions in Test.h. BUG= R=mtklein@google.com Author: halcanary@google.com Review URL: https://codereview.chromium.org/138563004 git-svn-id: http://skia.googlecode.com/svn/trunk@13074 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add a DEF_GPUTEST() macro.Gravatar tfarina@chromium.org2014-01-10
| | | | | | | | | | | | | This macro is similar to DEF_TEST() and simplifies the process of setting up a GPU test. BUG=skia:1952 TEST=tests R=mtklein@google.com Review URL: https://codereview.chromium.org/132293005 git-svn-id: http://skia.googlecode.com/svn/trunk@13033 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix build warnings in SkAlphaThresholdFilterGravatar commit-bot@chromium.org2014-01-07
| | | | | | | | | | | BUG=None R=bsalomon@google.com Author: zork@chromium.org Review URL: https://codereview.chromium.org/101763010 git-svn-id: http://skia.googlecode.com/svn/trunk@12937 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add AlphaThreshold filter.Gravatar commit-bot@chromium.org2014-01-06
| | | | | | | | | | | | | This is based on the Bitmap Alpha Threshold filter, and will be used by Chromium to implement the window shape API. R=bsalomon@chromium.org, wez@chromium.org, bsalomon@google.com, reed@google.com Author: zork@chromium.org Review URL: https://codereview.chromium.org/115633002 git-svn-id: http://skia.googlecode.com/svn/trunk@12935 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove SkBitmapAlphaThresholdShaderGravatar commit-bot@chromium.org2013-12-18
| | | | | | | | | | R=bsalomon@google.com Author: zork@chromium.org Review URL: https://codereview.chromium.org/108653012 git-svn-id: http://skia.googlecode.com/svn/trunk@12759 2bbb7eff-a529-9590-31e7-b0007b416f81
* Implement SkColorFilter as a GrGLEffectGravatar commit-bot@chromium.org2013-10-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds GrEffect::willUseInputColor() which indicates whether or not the input color affects the output of the effect. This is needed for certain Xfermodes, such as kSrc_Mode. For these modes the color filter will not use the input color. An effect with GrEffect::willUseInputColor() true will cause all color or coverage effects before it to be discarded, as their computations cannot affect the output. In these cases program is marked as having white input color. This fixes an assert when Skia is compiled in a mode that prefers using uniforms instead of attributes for constants. (Flags GR_GL_USE_NV_PATH_RENDERING or GR_GL_NO_CONSTANT_ATTRIBUTES). Using attributes hides the problem where the fragment shader does not need input color for color filters that ignore DST part of the filter. The assert would be hit when uniform manager tries to bind an uniform which has been optimized away by the shader compiler. Adds specific GrGLSLExpr4 and GrGLSLExpr1 classes. This way the GLSL expressions like "(v - src.a)" can remain somewhat readable in form of "(v - src.a())". The GrGLSLExpr<typename> template implements the generic functionality, GrGLSLExprX is the specialization that exposes the type-safe interface to this functionality. Also adds operators so that GLSL binary operators of the form "(float * vecX)" can be expressed in C++. Before only the equivalent "(vecX * float)" was possible. This reverts the common blending calculations to more conventional order, such as "(1-a) * c" instead of "c * (1-a)". Changes GrGLSLExpr1::OnesStr from 1 to 1.0 in order to preserve the color filter blending formula string the same (with the exception of variable name change). Shaders change in case of input color being needed: - vec4 filteredColor; - filteredColor = (((1.0 - uFilterColor.a) * output_Stage0) + uFilterColor); - fsColorOut = filteredColor; + vec4 output_Stage1; + { // Stage 1: ModeColorFilterEffect + output_Stage1 = (((1.0 - uFilterColor_Stage1.a) * output_Stage0) + uFilterColor_Stage1); + } + fsColorOut = output_Stage1; Shaders change in case of input color being not needed: -uniform vec4 uFilterColor; -in vec4 vColor; +uniform vec4 uFilterColor_Stage0; out vec4 fsColorOut; void main() { - vec4 filteredColor; - filteredColor = uFilterColor; - fsColorOut = filteredColor; + vec4 output_Stage0; + { // Stage 0: ModeColorFilterEffect + output_Stage0 = uFilterColor_Stage0; + } + fsColorOut = output_Stage0; } R=bsalomon@google.com, robertphillips@google.com, jvanverth@google.com Author: kkinnunen@nvidia.com Review URL: https://codereview.chromium.org/25023003 git-svn-id: http://skia.googlecode.com/svn/trunk@11912 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix GrProgramsTest to not generate tests with too many TexCoord referencesGravatar commit-bot@chromium.org2013-10-21
| | | | | | | | | | | | | | | | | | | | | | | | | | Make GrProgramsTest check how many texture coordinate sets are available and select random effects up until the amount runs out. Otherwise, following effect sequence would fail the shader compilation when Skia is compiled with nv_path_rendering on (eg. when fixed function codepath is used): * Stage 0: TextureDomain (1 texcoord) * Stage 1: Convolution (1 texcoord) * Stage 2: Bitmap Alpha Threshold (2 texcoords) * Stage 3: DisplacementMap (2 texcoords) * Stage 4: Config Conversion (1 texcoords) * Stage 5: Two-Point Conical Gradient (2 texcoords) This would use more texture coordinate sets than 8, which is fairly common amount currently. R=bsalomon@google.com, cdalton@nvidia.com Author: kkinnunen@nvidia.com Review URL: https://codereview.chromium.org/32403002 git-svn-id: http://skia.googlecode.com/svn/trunk@11881 2bbb7eff-a529-9590-31e7-b0007b416f81
* Use vertexless shaders when NVpr is availableGravatar commit-bot@chromium.org2013-10-04
| | | | | | | | | | | | | | | | Adds support for vertexless shaders and enables them when NV_path_rendering is available. This takes a GrGLFragmentOnlyShaderBuilder class, a GrGLTexGenEffectArray class, support for setting TexGen and the projection matrix in GrGpuGL, and code for setting the GL fixed function state where necessary. R=bsalomon@google.com, kkinnunen@nvidia.com Author: cdalton@nvidia.com Review URL: https://codereview.chromium.org/25846002 git-svn-id: http://skia.googlecode.com/svn/trunk@11620 2bbb7eff-a529-9590-31e7-b0007b416f81
* Use explicitly-sized enums in GrGLProgramDesc::KeyHeaderGravatar commit-bot@chromium.org2013-10-01
| | | | | | | | | | | | | | Uses enums explicitly sized to 8 bits in GrGLProgramDesc::KeyHeader, instead of storing them as uint8_t values. This avoids the need to static_cast them. R=bsalomon@google.com Author: cdalton@nvidia.com Review URL: https://codereview.chromium.org/23875048 git-svn-id: http://skia.googlecode.com/svn/trunk@11560 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
* alpha threshold bitmap shaderGravatar commit-bot@chromium.org2013-09-06
| | | | | | | | | | | | Committed: http://code.google.com/p/skia/source/detail?r=11122 R=reed@google.com Author: bsalomon@google.com Review URL: https://chromiumcodereview.appspot.com/23707019 git-svn-id: http://skia.googlecode.com/svn/trunk@11131 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert "alpha threshold bitmap shader"Gravatar bsalomon@google.com2013-09-05
| | | | | | This reverts commit r11122. git-svn-id: http://skia.googlecode.com/svn/trunk@11123 2bbb7eff-a529-9590-31e7-b0007b416f81
* alpha threshold bitmap shaderGravatar commit-bot@chromium.org2013-09-05
| | | | | | | | | | R=reed@google.com Author: bsalomon@google.com Review URL: https://chromiumcodereview.appspot.com/23707019 git-svn-id: http://skia.googlecode.com/svn/trunk@11122 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add a GrGpuGL reference for GrGLProgram/GrGLUniformManagerGravatar commit-bot@chromium.org2013-09-05
| | | | | | | | | | | | | | | Updates GrGLProgram and GrGLUniformManager to keep a GrGpuGL reference instead of one for GrGLContextInfo. No change in functionality, this is in preparation to support fixed function GL calls for vertexless shaders. R=bsalomon@google.com Author: cdalton@nvidia.com Review URL: https://chromiumcodereview.appspot.com/23636011 git-svn-id: http://skia.googlecode.com/svn/trunk@11111 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove possiblity of NULL effect in GrEffectStageGravatar commit-bot@chromium.org2013-07-15
| | | | | | | | | | R=jvanverth@google.com Author: bsalomon@google.com Review URL: https://chromiumcodereview.appspot.com/18295008 git-svn-id: http://skia.googlecode.com/svn/trunk@10075 2bbb7eff-a529-9590-31e7-b0007b416f81
* Replace fixed-size array of effect stages in GrDrawState with two appendable ↵Gravatar bsalomon@google.com2013-06-13
| | | | | | | | | | arrays, one for color, one for coverage. R=robertphillips@google.com Review URL: https://codereview.chromium.org/16952006 git-svn-id: http://skia.googlecode.com/svn/trunk@9592 2bbb7eff-a529-9590-31e7-b0007b416f81
* separate arrays for color and coverage effects.Gravatar bsalomon@google.com2013-06-06
| | | | | | | | R=robertphillips@google.com Review URL: https://codereview.chromium.org/16180006 git-svn-id: http://skia.googlecode.com/svn/trunk@9465 2bbb7eff-a529-9590-31e7-b0007b416f81
* Make GrGLProgramDesc's key variable length by compacting the effect key arrayGravatar bsalomon@google.com2013-05-22
| | | | | | | | R=robertphillips@google.com Review URL: https://codereview.chromium.org/15252004 git-svn-id: http://skia.googlecode.com/svn/trunk@9239 2bbb7eff-a529-9590-31e7-b0007b416f81
* Key shader on whether frag pos read is relative to top-left or bottom-leftGravatar bsalomon@google.com2013-05-13
| | | | | | | | R=robertphillips@google.com Review URL: https://codereview.chromium.org/14633007 git-svn-id: http://skia.googlecode.com/svn/trunk@9113 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
* Move loops that chain together effects into GrGLShaderBuilder from GrGLProgram.Gravatar bsalomon@google.com2013-05-09
| | | | | | | | R=robertphillips@google.com Review URL: https://codereview.chromium.org/14925010 git-svn-id: http://skia.googlecode.com/svn/trunk@9073 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add all remaining separable xfer modes to GPU backend.Gravatar bsalomon@google.com2013-04-19
| | | | | | Review URL: https://codereview.chromium.org/14189024 git-svn-id: http://skia.googlecode.com/svn/trunk@8768 2bbb7eff-a529-9590-31e7-b0007b416f81
* silence && || parens clang warning.Gravatar bsalomon@google.com2013-04-19
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@8764 2bbb7eff-a529-9590-31e7-b0007b416f81
* Perform coverage blend with the dst in the shader when using a dst-reading ↵Gravatar bsalomon@google.com2013-04-19
| | | | | | | | xfermode. Review URL: https://codereview.chromium.org/14233006 git-svn-id: http://skia.googlecode.com/svn/trunk@8762 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2013-04-02
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@8477 2bbb7eff-a529-9590-31e7-b0007b416f81
* Take two for r8466:Gravatar jvanverth@google.com2013-04-01
| | | | | | | | | | | | | | | Replace the old attribute binding and index interface with one where we include the binding as part of the attribute array. Also removed the fixed attribute indices for constant color and coverage attributes, and replaced with dynamic ones based on current attribute set. Removed binding of color and coverage attributes unless they're actually set. Original author: bsalomon@google.com Author: jvanverth@google.com Reviewed By: bsalomon@google.com,robertphillips@google.com Review URL: https://chromiumcodereview.appspot.com/13296005 git-svn-id: http://skia.googlecode.com/svn/trunk@8468 2bbb7eff-a529-9590-31e7-b0007b416f81
* Rolling back r8466. Gravatar jvanverth@google.com2013-04-01
| | | | | | | Not reviewed. git-svn-id: http://skia.googlecode.com/svn/trunk@8467 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revise attribute binding interface.Gravatar commit-bot@chromium.org2013-04-01
| | | | | | | | | | | | | | Replace the old attribute binding and index interface with one where we include the binding as part of the attribute array. Also removed the fixed attribute indices for constant color and coverage attributes, and replaced with dynamic ones based on current attribute set. Removed binding of color and coverage attributes unless they're actually set. Original author: bsalomon@google.com Author: jvanverth@google.com Reviewed By: bsalomon@google.com,robertphillips@google.com Review URL: https://chromiumcodereview.appspot.com/13296005 git-svn-id: http://skia.googlecode.com/svn/trunk@8466 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix GLPrograms test.Gravatar bsalomon@google.com2013-03-29
| | | | | | Review URL: https://codereview.chromium.org/13327008 git-svn-id: http://skia.googlecode.com/svn/trunk@8450 2bbb7eff-a529-9590-31e7-b0007b416f81
* Move GrGLProgram::Desc out of GrGLProgram.Gravatar bsalomon@google.com2013-03-27
| | | | | | Review URL: https://codereview.chromium.org/12942014 git-svn-id: http://skia.googlecode.com/svn/trunk@8411 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2013-03-27
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@8404 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix unit test build breakGravatar bsalomon@google.com2013-03-26
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@8394 2bbb7eff-a529-9590-31e7-b0007b416f81
* Replace edge types with GrEdgeEffect. Gravatar bsalomon@google.com2013-03-26
| | | | | | | | | This strips out last of the edge types and the fixed function edge attribute and replaces them with using GrEdgeEffect. Also fixes a minor bug when checking attribute counts -- it was using kAttribIndexCount instead of kVertexAttribCnt. Original Author: jvanverth@google.com Review URL: https://codereview.chromium.org/13069003 git-svn-id: http://skia.googlecode.com/svn/trunk@8392 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
* Make GrDrawTarget::Caps ref counted and GrGLCaps derive from it.Gravatar bsalomon@google.com2013-03-25
| | | | | | | Also rename GrDrawTarget::getCaps() -> GrDrawTarget::caps(). Review URL: https://codereview.chromium.org/12843026 git-svn-id: http://skia.googlecode.com/svn/trunk@8364 2bbb7eff-a529-9590-31e7-b0007b416f81
* Stop the GLPrograms unit test from generating out of range attrib indices ↵Gravatar commit-bot@chromium.org2013-03-21
| | | | | | | | | | | | | | for effects. R=jvanverth@google.com Author: bsalomon@google.com Reviewed By: jvanverth@google.com Review URL: https://chromiumcodereview.appspot.com/12834013 git-svn-id: http://skia.googlecode.com/svn/trunk@8298 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
* Add stroked ovals and CircleEdgeEffect.Gravatar jvanverth@google.com2013-03-19
| | | | | | | | | Adds some optimizations to the circle and ellipse shaders, static effect instances for their GrEffects, and some minor changes to GrDrawState::setEffect to make GrEffect setup faster. git-svn-id: http://skia.googlecode.com/svn/trunk@8238 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add GrEllipseEdgeEffect.Gravatar commit-bot@chromium.org2013-03-12
| | | | | | | | | | Adds the effect that replaces the old oval rendering code. Also hooks in code to set attribute names and indices for effects. Author: jvanverth@google.com Review URL: https://chromiumcodereview.appspot.com/12462008 git-svn-id: http://skia.googlecode.com/svn/trunk@8092 2bbb7eff-a529-9590-31e7-b0007b416f81
* Resubmit r7899 and r7901.Gravatar jvanverth@google.com2013-03-01
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@7929 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert r7901 & r7899 to allow DEPS rollGravatar robertphillips@google.com2013-02-28
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@7909 2bbb7eff-a529-9590-31e7-b0007b416f81
* Split GrGLContextInfo into GrGLContext & GrGLContextInfoGravatar robertphillips@google.com2013-02-28
| | | | | | | | https://codereview.appspot.com/7436045/ git-svn-id: http://skia.googlecode.com/svn/trunk@7905 2bbb7eff-a529-9590-31e7-b0007b416f81