Use noperspective interpolation for 2D draws
authorcdalton <cdalton@nvidia.com>
Fri, 12 Feb 2016 20:14:06 +0000 (12:14 -0800)
committerCommit bot <commit-bot@chromium.org>
Fri, 12 Feb 2016 20:14:06 +0000 (12:14 -0800)
commitc08f196648463d44eb85e17c5815dbf8f709a42a
treec6207815ec240c521636248118372ef3a88d4a73
parent083617b9a7247dd4c52f8dfd195fa34a083e6f1d
Use noperspective interpolation for 2D draws

Adds a mechanism to notify GrGLSLVaryingHandler that a shader will not
emit geometry in perspective. This gives it a chance to use the
noperspective keyword if it is supported.

Updates the existing processors to notify the varying handler when
there is no perspective.

Begins using the noperspective keyword in GrGLGpu internal shaders.

Web scenes with observable benefit (Pixel C, gpu config):

  tabl_nofolo.skp        4.62 -> 3.33 ms   28%
  desk_tigersvg.skp      26.5 -> 24 ms      9%
  desk_pokemonwiki.skp   16.1 -> 14.9 ms    7%
  tabl_deviantart.skp    3.97 -> 3.7 ms     7%
  desk_gws.skp           3.85 -> 3.65 ms    5%

Also adds new methods for creating varyings with flat interpolation.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1673093002

Review URL: https://codereview.chromium.org/1673093002
15 files changed:
src/gpu/GrPathProcessor.cpp
src/gpu/batches/GrPLSPathRenderer.cpp
src/gpu/gl/GrGLCaps.cpp
src/gpu/gl/GrGLGpu.cpp
src/gpu/gl/GrGLVaryingHandler.cpp
src/gpu/gl/GrGLVaryingHandler.h
src/gpu/glsl/GrGLSLCaps.cpp
src/gpu/glsl/GrGLSLCaps.h
src/gpu/glsl/GrGLSLFragmentShaderBuilder.cpp
src/gpu/glsl/GrGLSLFragmentShaderBuilder.h
src/gpu/glsl/GrGLSLGeometryProcessor.cpp
src/gpu/glsl/GrGLSLShaderBuilder.h
src/gpu/glsl/GrGLSLShaderVar.h
src/gpu/glsl/GrGLSLVarying.cpp
src/gpu/glsl/GrGLSLVarying.h