Commit Graph

1294 Commits

Author SHA1 Message Date
mtklein
2766c00fc0 remove SkInstCnt
It's been outclassed by Valgrind and leak sanitizer,
and it seems to be causing problems for external folks building Skia.

I'm not sure why our own builds seem unaffected.

Latest thread:
https://groups.google.com/forum/#!topic/skia-discuss/oj9FsQwwSF0

BUG=skia:

Review URL: https://codereview.chromium.org/1217573002
2015-06-26 11:45:03 -07:00
reed
0e72b7e2c6 add/fix copyrights
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1212393002
2015-06-26 07:26:19 -07:00
fmalita
538bacb4bb Revert of Cleanup legacy NVPR-related definitions (patchset #3 id:40001 of https://codereview.chromium.org/1177243004/)
Reason for revert:
Broke the GPU SAN bots: https://build.chromium.org/p/client.skia/builders/Test-Ubuntu-GCC-Golo-GPU-GT610-x86_64-Debug-ASAN/builds/779/steps/dm/logs/stdio

Original issue's description:
> Cleanup legacy NVPR-related definitions
>
> Fixed-function NVPR codepaths were removed a while ago. Only NVPR API
> version 1.3 (PathFragmentInputGen) was left working. Remove
> backwards-compatibility code that was left behind.
>
> Remove some NVPR API function typedefs that were left from initial
> commits.
>
> Remove PathCoords function pointer from GrGLInterface, it has
> never been called and causes problems in the future, since it will
> not be implemented in the Chromium pseudo extension.
>
> Committed: https://skia.googlesource.com/skia/+/fb8d6884e0e01d0c2f8596adf5af1efb0d08de7e

TBR=joshualitt@google.com,cdalton@nvidia.com,bsalomon@google.com,kkinnunen@nvidia.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1206333003
2015-06-25 08:42:24 -07:00
kkinnunen
fb8d6884e0 Cleanup legacy NVPR-related definitions
Fixed-function NVPR codepaths were removed a while ago. Only NVPR API
version 1.3 (PathFragmentInputGen) was left working. Remove
backwards-compatibility code that was left behind.

Remove some NVPR API function typedefs that were left from initial
commits.

Remove PathCoords function pointer from GrGLInterface, it has
never been called and causes problems in the future, since it will
not be implemented in the Chromium pseudo extension.

Review URL: https://codereview.chromium.org/1177243004
2015-06-25 02:06:56 -07:00
bsalomon
47c1ccbcd8 Revert of remove workaround for dx9 angle slow rgba pixel ops (patchset #1 id:1 of https://codereview.chromium.org/1207003002/)
Reason for revert:
users are still on dx9 angle :(

Original issue's description:
> remove workaround for dx9 angle slow rgba pixel ops
>
> TBR=robertphillips@google.com
>
> Committed: https://skia.googlesource.com/skia/+/1e1adc33ba1acb9a2ad41c0a5a9b6166ee9d7a2a

TBR=robertphillips@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1205183002
2015-06-24 15:04:13 -07:00
bsalomon
1e1adc33ba remove workaround for dx9 angle slow rgba pixel ops
TBR=robertphillips@google.com

Review URL: https://codereview.chromium.org/1207003002
2015-06-24 13:22:50 -07:00
robertphillips
1b8e1b5c49 Refactor GrBufferAllocPools to use resource cache
Committed: https://skia.googlesource.com/skia/+/e935f1a0e2351373c33600b8388492ce1218014a

Review URL: https://codereview.chromium.org/1139753002
2015-06-24 06:54:10 -07:00
bsalomon
74f681dce2 Make SkGpuDevice know its alpha type
Make SkImage_Gpu snapshots opaque if surface is opaque.

BUG=skia:3965

Review URL: https://codereview.chromium.org/1205643002
2015-06-23 14:38:48 -07:00
cdalton
d416a5b10f Implement SkGLContext swapBuffers with fence syncs
Improves the GPU measuring accuracy of nanobench by using fence syncs.
Fence syncs are very widely supported and available on almost every
platform.

NO_MERGE_BUILDS
BUG=skia:

Review URL: https://codereview.chromium.org/1194783003
2015-06-23 13:23:44 -07:00
robertphillips
b607767703 Revert of Refactor GrBufferAllocPools to use resource cache (patchset #15 id:280001 of https://codereview.chromium.org/1139753002/)
Reason for revert:
Will reland after Chromium branch

Original issue's description:
> Refactor GrBufferAllocPools to use resource cache
>
> Committed: https://skia.googlesource.com/skia/+/e935f1a0e2351373c33600b8388492ce1218014a

TBR=bsalomon@google.com,joshualitt@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1204773003
2015-06-23 12:36:12 -07:00
robertphillips
e935f1a0e2 Refactor GrBufferAllocPools to use resource cache
Review URL: https://codereview.chromium.org/1139753002
2015-06-23 08:23:08 -07:00
kkinnunen
591a2ca842 Stop using the NVPR glyph loading functionality
Remove the NVPR glyph loading functionality. A bit risky feature.

Review URL: https://codereview.chromium.org/1176113008
2015-06-23 07:27:41 -07:00
tomhudson
3fef728e16 Fix indirect use of defined() directive
BUG=432391
R=bsalomon,bungeman1

Review URL: https://codereview.chromium.org/876933004
2015-06-23 06:31:32 -07:00
robertphillips
fcf7829b67 remove SkDeviceProperties
There is a lot more clean up to do here but this is probably a big enough bite.

Review URL: https://codereview.chromium.org/1196683003
2015-06-19 11:49:52 -07:00
joshualitt
83bc229703 Work around for nexus 6 TexSubImage issue
BUG=skia:

Committed: https://skia.googlesource.com/skia/+/c69fe20ef35df0776b179cbd5ce4d1bdc0ba4090

Review URL: https://codereview.chromium.org/1173203005
2015-06-18 14:18:03 -07:00
reed
35a5261085 privatize
BUG=skia:
TBR=bsalomon@google.com

Review URL: https://codereview.chromium.org/1189173005
2015-06-18 14:05:07 -07:00
reed
de49988bc2 add callbacks to Images that wrap client-provided content
BUG=skia:

Review URL: https://codereview.chromium.org/1169553003
2015-06-18 13:41:40 -07:00
joshualitt
274980cda1 Revert of Work around for nexus 6 TexSubImage issue (patchset #4 id:60001 of https://codereview.chromium.org/1173203005/)
Reason for revert:
breaks gms

Original issue's description:
> Work around for nexus 6 TexSubImage issue
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/c69fe20ef35df0776b179cbd5ce4d1bdc0ba4090

TBR=bsalomon@google.com,joshualitt@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1190463006
2015-06-18 11:49:18 -07:00
joshualitt
c69fe20ef3 Work around for nexus 6 TexSubImage issue
BUG=skia:

Review URL: https://codereview.chromium.org/1173203005
2015-06-18 11:07:09 -07:00
bsalomon
6dc6f5f4a1 Add support for creating texture backed images where Skia will delete the texture.
Review URL: https://codereview.chromium.org/1187523005
2015-06-18 09:12:17 -07:00
robertphillips
bcd7ab5c0d Add useDFT field to SkDeviceProperties
Review URL: https://codereview.chromium.org/1191943002
2015-06-18 05:27:18 -07:00
robertphillips
2334fb655f Make GrTextContext be owned by the GrDrawContext
This CL makes the GrTextContext be owned (and hidden) by the GrDrawContext. This funnels all the drawText* calls through the GrDrawContext and hides the (dispreferred) GrPipelineBuilder drawText variant.

Some consequences of this are:

GrDrawContext now has to get the text drawing settings (i.e., SkDeviceProperties & useDFT). This means that we need a separate GrDrawContext for each combination of pixel geometry and DFT-use.

All the GrTextContext-derived classes now get a back pointer to the originating GrDrawContext so their method calls no longer take one.

Committed: https://skia.googlesource.com/skia/+/5b16e740fe6ab6d679083d06f07651602265081b

Review URL: https://codereview.chromium.org/1175553002
2015-06-17 05:43:33 -07:00
bsalomon
781d58215f Revert of Make GrTextContext be owned by the GrDrawContext (patchset #7 id:120001 of https://codereview.chromium.org/1175553002/)
Reason for revert:
Breaking Test-Win8-MSVC-ShuttleA-GPU-GTX660-x86_64-Debug ?

https://build.chromium.org/p/client.skia/builders/Test-Win8-MSVC-ShuttleA-GPU-GTX660-x86_64-Debug/builds/436/steps/dm/logs/stdio

Original issue's description:
> Make GrTextContext be owned by the GrDrawContext
>
> This CL makes the GrTextContext be owned (and hidden) by the GrDrawContext. This funnels all the drawText* calls through the GrDrawContext and hides the (dispreferred) GrPipelineBuilder drawText variant.
>
> Some consequences of this are:
>
> GrDrawContext now has to get the text drawing settings (i.e., SkDeviceProperties & useDFT). This means that we need a separate GrDrawContext for each combination of pixel geometry and DFT-use.
>
> All the GrTextContext-derived classes now get a back pointer to the originating GrDrawContext so their method calls no longer take one.
>
> Committed: https://skia.googlesource.com/skia/+/5b16e740fe6ab6d679083d06f07651602265081b

TBR=joshualitt@chromium.org,joshualitt@google.com,jvanverth@google.com,reed@google.com,robertphillips@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1178383003
2015-06-16 15:03:11 -07:00
robertphillips
5b16e740fe Make GrTextContext be owned by the GrDrawContext
This CL makes the GrTextContext be owned (and hidden) by the GrDrawContext. This funnels all the drawText* calls through the GrDrawContext and hides the (dispreferred) GrPipelineBuilder drawText variant.

Some consequences of this are:

GrDrawContext now has to get the text drawing settings (i.e., SkDeviceProperties & useDFT). This means that we need a separate GrDrawContext for each combination of pixel geometry and DFT-use.

All the GrTextContext-derived classes now get a back pointer to the originating GrDrawContext so their method calls no longer take one.

Review URL: https://codereview.chromium.org/1175553002
2015-06-16 12:23:47 -07:00
junov
da5469d7bc Invalidate GrTexture mipmap on content change notification
This fix is necessary to correctly propagate invalidations that
are external to skia. For example, when drawing video or WebGL
into a 2D canvas in Chrome, with mipmaps enabled.

BUG=crbug.com/498356
TEST=GrTextureMipMapInvalidationTest

Review URL: https://codereview.chromium.org/1177843007
2015-06-15 09:48:15 -07:00
cdalton
626e1ffe84 Import functionality for new GL backend
Brings in the following functionality:

  ARB_draw_instanced
  ARB_instanced_arrays
  NV_bindless_texture
  EXT_direct_state_access
  KHR_debug

Also cleans up some of the NVPR extension loading.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/202c4c75fb806f751cf796850bf67fe9793e0643

Review URL: https://codereview.chromium.org/1185573003
2015-06-12 13:56:46 -07:00
djsollen
1fe1858a90 Revert of Import functionality for new GL backend (patchset #2 id:20001 of https://codereview.chromium.org/1185573003/)
Reason for revert:
breaking multiple builds. For example...

https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Ubuntu-GCC-Golo-GPU-GT610-x86_64-Debug-ASAN/builds/667

Original issue's description:
> Import functionality for new GL backend
>
> Brings in the following functionality:
>
>   ARB_draw_instanced
>   ARB_instanced_arrays
>   NV_bindless_texture
>   EXT_direct_state_access
>   KHR_debug
>
> Also cleans up some of the NVPR extension loading.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/202c4c75fb806f751cf796850bf67fe9793e0643

TBR=bsalomon@google.com,cdalton@nvidia.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1184863002
2015-06-12 12:01:15 -07:00
cdalton
202c4c75fb Import functionality for new GL backend
Brings in the following functionality:

  ARB_draw_instanced
  ARB_instanced_arrays
  NV_bindless_texture
  EXT_direct_state_access
  KHR_debug

Also cleans up some of the NVPR extension loading.

BUG=skia:

Review URL: https://codereview.chromium.org/1185573003
2015-06-12 10:31:36 -07:00
cdalton
1dd0542ca3 Review URL: https://codereview.chromium.org/1166513002 2015-06-12 09:01:19 -07:00
vbuzinov
dded69693d Implement support for mixed sampled render targets
Adds a new FBO type kStencil_MSFBOType that is selected whenever
NV_framebuffer_mixed_samples extension is available.  In this new
FBO type a non-msaa color buffer is created with a multisampled
stencil buffer attachment.

Replaces numSamples() with separate numColorSamples and numStencilSamples
methods in RenderTarget.

In mixed samples mode non-MSAA codepaths are used to draw simple shapes,
while NVPR-rendered paths and text are rendered with a multisampled
stencil.

BUG=skia:3177

Review URL: https://codereview.chromium.org/1001503002
2015-06-12 08:59:45 -07:00
cdalton
ee0175f1b0 Move blend enums into GrBlend.h
Moves blend enums from GrXferProcessor.h to GrBlend.h, makes GrBlend.h
public.

BUG=skia:

Review URL: https://codereview.chromium.org/1180713008
2015-06-12 08:21:26 -07:00
cdalton
4cd6713af1 Init GrGLSLCaps fields from inside GrGLCaps
Fixes circular dependencies by allowing the initialization to be done
intertwined.

BUG=skia:

Review URL: https://codereview.chromium.org/1177053002
2015-06-10 19:23:46 -07:00
cdalton
86ae0a9e46 Add mixed samples support to XPs
BUG=skia:

Review URL: https://codereview.chromium.org/1164973002
2015-06-08 15:11:04 -07:00
cdalton
edbb31f7dd Apply coverage in XP base class when using dst reads
Moves the coverage logic into GrGLXferProcessor for XPs that perform
dst reads. XPs that don't use a dst read are still responsible to
handle coverage on their own.

BUG=skia:

Review URL: https://codereview.chromium.org/1170553002
2015-06-08 12:14:44 -07:00
cdalton
1fa4572d1a Update XPF invariant info to not account for conflation
Renames getInvariantOutput to getInvariantBlendedColor on GrXPFactory
and redefines it to not account for coverage conflation. This is the
information that all the callsites actually wanted to know.

BUG=skia:

Review URL: https://codereview.chromium.org/1161273005
2015-06-02 10:43:39 -07:00
joshualitt
e5b74c6856 Set GeometryBufferMapThreshold defaults
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1161543003
2015-06-01 14:17:47 -07:00
bsalomon
c59a1df655 Stretch small textures up to 16 pixels on PowerVR 54x
Review URL: https://codereview.chromium.org/1161183002
2015-06-01 07:13:42 -07:00
joshualitt
29f8679068 Removing GrAutoMalloc
BUG=skia:

Review URL: https://codereview.chromium.org/1161993003
2015-05-29 08:06:48 -07:00
bsalomon
7622863095 Add direct getter for GrCaps to GrContext.
TBR=joshualitt@google.com

Committed: https://skia.googlesource.com/skia/+/9138c46e572085870638b6f7ad7fcdfcdf3cac99

Review URL: https://codereview.chromium.org/1149773005
2015-05-29 08:02:10 -07:00
joshualitt
611cc5f964 delete experimental path renderers
BUG=skia:

Review URL: https://codereview.chromium.org/1160863006
2015-05-29 07:09:09 -07:00
joshualitt
7224c86632 add context override of GeometryBufferMapThreshold
BUG=skia:

Review URL: https://codereview.chromium.org/1159713006
2015-05-29 06:46:47 -07:00
joshualitt
bd245426bb Revert of small CL to experiment with 'disabling' memory mapping (patchset #1 id:1 of https://codereview.chromium.org/1160003004/)
Reason for revert:
experiment complete

Original issue's description:
> small CL to experiment with 'disabling' memory mapping
>
> TBR=bsalomon@google.com
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/2e48e1514396b363ecd19372eab637b11bfb8a82

TBR=robertphillips@google.com,joshualitt@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1159133004
2015-05-28 13:40:20 -07:00
joshualitt
2e48e15143 small CL to experiment with 'disabling' memory mapping
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1160003004
2015-05-28 11:53:49 -07:00
bsalomon
084d1b61bc Revert of Add direct getter for GrCaps to GrContext. (patchset #4 id:60001 of https://codereview.chromium.org/1149773005/)
Reason for revert:
Breaking

Original issue's description:
> Add direct getter for GrCaps to GrContext.
>
> TBR=joshualitt@google.com
>
> Committed: https://skia.googlesource.com/skia/+/9138c46e572085870638b6f7ad7fcdfcdf3cac99

TBR=joshualitt@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1164443002
2015-05-28 08:20:58 -07:00
bsalomon
9138c46e57 Add direct getter for GrCaps to GrContext.
TBR=joshualitt@google.com

Review URL: https://codereview.chromium.org/1149773005
2015-05-28 08:13:16 -07:00
cdalton
6fd158ea47 Implement Porter Duff XP with a blend table
Removes the runtime logic used by PorterDuffXferProcessor to decide
blend coeffs and shader outputs, and instead uses a compile-time
constant table of pre-selected blend formulas. Separates out the dst
read fallback into its own XP.

Introduces a new blend strategy for srcCoeff=0 that can apply coverage
with a reverse subtract blend equation instead of dual source
blending.

Adds new macros in GrBlend.h to analyze blend formulas both runtime.

Removes kSetCoverageDrawing_OptFlag and GrSimplifyBlend as they are no
longer used.

Adds a GM that verifies all xfermodes, including arithmetic, with the
color/coverage invariants used by Porter Duff.

Adds a unit test that verifies each Porter Duff formula with every
color/coverage invariant.

Major changes:

 * Uses a reverse subtract blend equation for coverage when srcCoeff=0
   (clear, dst-out [Sa=1], dst-in, modulate). Platforms that don't
   support dual source blending no longer require a dst copy for
   dst-in and modulate.

 * Sets BlendInfo::fWriteColor to false when the blend does not modify
   the dst. GrGLGpu will now use glColorMask instead of blending for
   these modes (dst, dst-in [Sa=1], modulate ignored for [Sc=1]).

 * Converts all SA blend coeffs to One for opaque inputs, and ISA to
   Zero if there is also no coverage. (We keep ISA around when there
   is coverage because we use it to tweak alpha for coverage.)

 * Abandons solid white optimizations for the sake of simplicity
   (screen was the only mode that previous had solid white opts).

Minor differences:

 * Inconsequential differences in opt flags (e.g. we now return
   kCanTweakAlphaForCoverage_OptFlag even when there is no coverage).

 * Src coeffs when the shader outputs 0.

 * IS2C vs IS2A when the secondary output is scalar.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/9a70920db22b6309c671f8e5d519bb95570e4414

Review URL: https://codereview.chromium.org/1124373002
2015-05-27 15:08:33 -07:00
bsalomon
4ee6bd86c5 Add caps overrides to GMs
Review URL: https://codereview.chromium.org/1158963002
2015-05-27 13:23:23 -07:00
robertphillips
ccb1b57510 Move SkGpuDevice::internalDrawPath to GrBlurUtils::drawPathWithMaskFilter
This CL is ugly but it:

removes the stored SkGpuDevice back pointer from GrTextContext (at the cost of passing more parameters)
moves SkGpuDevice::internalDrawPath to GrDrawContext::drawPathFull

Unfortunately, the GrTextContext-derived classes still need the SkGpuDevice for filterTextFlags calls but I will try removing that in a separate CL.

Review URL: https://codereview.chromium.org/1157773003
2015-05-27 11:02:55 -07:00
robertphillips
4b195e5d8f Unblock DEPS roll by remove SkAutoTUnref from GrDrawContext
BUG=skia:

Review URL: https://codereview.chromium.org/1156103006
2015-05-26 14:37:00 -07:00
robertphillips
ea46150344 Split drawing functionality out of GrContext and into new GrDrawContext
This is mainly a mechanical CL. There were some fiddly bits in GrContext.cpp where it no longer had access to the GrDrawTarget (and had to use the new GrDrawContext).

I've converted GrAARectRenderer & GrOvalRenderer into static classes so I could stop allocating them.

Review URL: https://codereview.chromium.org/1151283004
2015-05-26 11:38:03 -07:00
bsalomon
6a44c6a7d8 Move DstCoordTexture to GrXP, rename and remove the word "copy" from dstcopytexture names.
Committed: https://skia.googlesource.com/skia/+/bb106b5f6ee18f7453b63f3a95f421b60a957f39

Review URL: https://codereview.chromium.org/1132093004
2015-05-26 09:49:05 -07:00
bungeman
c33db93d1b Revert of Implement Porter Duff XP with a blend table (patchset #12 id:220001 of https://codereview.chromium.org/1124373002/)
Reason for revert:
Blocking DEPS roll into Chromium. Crashing virtual/gpu/fast/canvas/canvas-composite-*.html tests with the assert

../../third_party/skia/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp:281: failed assertion "k110_GrGLSLGeneration != gpu->glslGeneration() || fOutputs.empty()"

Original issue's description:
> Implement Porter Duff XP with a blend table
>
> Removes the runtime logic used by PorterDuffXferProcessor to decide
> blend coeffs and shader outputs, and instead uses a compile-time
> constant table of pre-selected blend formulas.
>
> Introduces a new blend strategy for srcCoeff=0 that can apply coverage
> with a reverse subtract blend equation instead of dual source
> blending.
>
> Adds new macros in GrBlend.h to analyze blend formulas both runtime.
>
> Removes kSetCoverageDrawing_OptFlag and GrSimplifyBlend as they are no
> longer used.
>
> Adds a GM that verifies all xfermodes, including arithmetic, with the
> color/coverage invariants used by Porter Duff.
>
> Adds a unit test that verifies each Porter Duff formula with every
> color/coverage invariant.
>
> Major changes:
>
>  * Uses a reverse subtract blend equation for coverage when srcCoeff=0
>    (clear, dst-out [Sa=1], dst-in, modulate). Platforms that don't
>    support dual source blending no longer require a dst copy for
>    dst-in and modulate.
>
>  * Sets BlendInfo::fWriteColor to false when the blend does not modify
>    the dst. GrGLGpu will now use glColorMask instead of blending for
>    these modes (dst, dst-in [Sa=1], modulate ignored for [Sc=1]).
>
>  * Converts all SA blend coeffs to One for opaque inputs, and ISA to
>    Zero if there is also no coverage. (We keep ISA around when there
>    is coverage because we use it to tweak alpha for coverage.)
>
>  * Abandons solid white optimizations for the sake of simplicity
>    (screen was the only mode that previous had solid white opts).
>
> Minor differences:
>
>  * Inconsequential differences in opt flags (e.g. we now return
>    kCanTweakAlphaForCoverage_OptFlag even when there is no coverage).
>
>  * Src coeffs when the shader outputs 0.
>
>  * IS2C vs IS2A when the secondary output is scalar.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/9a70920db22b6309c671f8e5d519bb95570e4414

TBR=egdaniel@google.com,bsalomon@google.com,cdalton@nvidia.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1153993002
2015-05-22 17:55:26 -07:00
bungeman
d23a395d51 Revert of Move DstCoordTexture to GrXP, rename and remove the word "copy" from dstcopytexture names. (patchset #6 id:100001 of https://codereview.chromium.org/1132093004/)
Reason for revert:
This is asserting on GTX660 bots with '!dst'. This may just be catching an existing issue.

https://build.chromium.org/p/client.skia/builders/Test-Ubuntu-GCC-ShuttleA-GPU-GTX660-x86_64-Debug/builds/622/steps/dm/logs/stdio

https://build.chromium.org/p/client.skia/builders/Test-Win7-MSVC-ShuttleA-GPU-HD2000-x86-Debug-ANGLE/builds/209/steps/dm/logs/stdio

https://build.chromium.org/p/client.skia/builders/Test-Win8-MSVC-ShuttleA-GPU-GTX660-x86_64-Debug/builds/318/steps/dm/logs/stdio

Original issue's description:
> Move DstCoordTexture to GrXP, rename and remove the word "copy" from dstcopytexture names.
>
> Committed: https://skia.googlesource.com/skia/+/bb106b5f6ee18f7453b63f3a95f421b60a957f39

TBR=egdaniel@google.com,bsalomon@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1158453004
2015-05-22 15:22:48 -07:00
bsalomon
bb106b5f6e Move DstCoordTexture to GrXP, rename and remove the word "copy" from dstcopytexture names.
Review URL: https://codereview.chromium.org/1132093004
2015-05-22 14:32:10 -07:00
bsalomon
682c269a15 Store context options on caps.
Committed: https://skia.googlesource.com/skia/+/f28cff71db2cbb1ff18a8fbf1e80ca761d1f69bc

Review URL: https://codereview.chromium.org/1158433006
2015-05-22 14:01:46 -07:00
bsalomon
08bf86d1b7 Revert of Store context options on caps. (patchset #3 id:40001 of https://codereview.chromium.org/1158433006/)
Reason for revert:
breaking chromeos build (???)

Original issue's description:
> Store context options on caps.
>
> Committed: https://skia.googlesource.com/skia/+/f28cff71db2cbb1ff18a8fbf1e80ca761d1f69bc

TBR=joshualitt@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1151603005
2015-05-22 12:41:05 -07:00
bsalomon
f28cff71db Store context options on caps.
Review URL: https://codereview.chromium.org/1158433006
2015-05-22 12:25:41 -07:00
cdalton
9a70920db2 Implement Porter Duff XP with a blend table
Removes the runtime logic used by PorterDuffXferProcessor to decide
blend coeffs and shader outputs, and instead uses a compile-time
constant table of pre-selected blend formulas.

Introduces a new blend strategy for srcCoeff=0 that can apply coverage
with a reverse subtract blend equation instead of dual source
blending.

Adds new macros in GrBlend.h to analyze blend formulas both runtime.

Removes kSetCoverageDrawing_OptFlag and GrSimplifyBlend as they are no
longer used.

Adds a GM that verifies all xfermodes, including arithmetic, with the
color/coverage invariants used by Porter Duff.

Adds a unit test that verifies each Porter Duff formula with every
color/coverage invariant.

Major changes:

 * Uses a reverse subtract blend equation for coverage when srcCoeff=0
   (clear, dst-out [Sa=1], dst-in, modulate). Platforms that don't
   support dual source blending no longer require a dst copy for
   dst-in and modulate.

 * Sets BlendInfo::fWriteColor to false when the blend does not modify
   the dst. GrGLGpu will now use glColorMask instead of blending for
   these modes (dst, dst-in [Sa=1], modulate ignored for [Sc=1]).

 * Converts all SA blend coeffs to One for opaque inputs, and ISA to
   Zero if there is also no coverage. (We keep ISA around when there
   is coverage because we use it to tweak alpha for coverage.)

 * Abandons solid white optimizations for the sake of simplicity
   (screen was the only mode that previous had solid white opts).

Minor differences:

 * Inconsequential differences in opt flags (e.g. we now return
   kCanTweakAlphaForCoverage_OptFlag even when there is no coverage).

 * Src coeffs when the shader outputs 0.

 * IS2C vs IS2A when the secondary output is scalar.

BUG=skia:

Review URL: https://codereview.chromium.org/1124373002
2015-05-22 11:36:57 -07:00
bsalomon
424cc26add Remove init from GrGLContextInfo and caps classes
Make Gr*Caps, GrGLContext* noncopyable

Review URL: https://codereview.chromium.org/1153813002
2015-05-22 10:37:30 -07:00
bsalomon
eb1cb5c5b5 rename GrDrawTargetCaps.h to GrCaps.h and move to include
Review URL: https://codereview.chromium.org/1135113005
2015-05-22 08:01:09 -07:00
cdalton
0edea2c8e7 Make mixed samples contingent on auxiliary extensions
Moves the cap for mixed samples into GrShaderCaps and does not enable
it unless we have support for both dual source blending and
multisample disable.

Creates a dedicated cap for multisample disable.

Reconfigures the mixed samples cap to indicate the collective
capability of three different extensions:

  GL_NV_framebuffer_mixed_samples
  GL_NV_sample_mask_override_coverage
  GL_EXT_raster_multisample

Imports tokens and procedures for GL_EXT_raster_multisample.

BUG=skia:

Review URL: https://codereview.chromium.org/1151793002
2015-05-21 08:27:44 -07:00
jvanverth
fb5df43af8 Add RGBA half float texture format.
BUG=skia:3829

Review URL: https://codereview.chromium.org/1148243002
2015-05-21 08:12:27 -07:00
bsalomon
4b91f768b3 rename GrDrawTargetCaps to GrCaps
Review URL: https://codereview.chromium.org/1133123009
2015-05-19 09:29:46 -07:00
kkinnunen
54b8511189 Make GrResourceCache perf less sensitive to key length change
Make GrResourceCache performance less sensitive to key length change.
The memcmp in GrResourceKey is called when SkTDynamicHash jumps the
slots to find the hash by a index. Avoid most of the memcmps by
comparing the hash first.

This is important because small changes in key data length can cause
big performance regressions. The theory is that key length change causes
different hash values. These hash values might trigger memcmps that
originally weren't there, causing the regression.

Adds few specialized benches to grresourcecache_add to test different
key lengths. The tests are run only on release, because on debug the
SkTDynamicHash validation takes too long, and adding many such delays
to development test runs would be unproductive. On release the tests
are quite fast.

Effect of this patch to the added tests on amd64:
grresourcecache_find_10  738us ->  768us        1.04x
 grresourcecache_find_2  472us ->  476us        1.01x
grresourcecache_find_25  841us ->  845us        1x
 grresourcecache_find_4  565us ->  531us        0.94x
grresourcecache_find_54 1.18ms ->  1.1ms        0.93x
 grresourcecache_find_5  834us ->  749us        0.9x
 grresourcecache_find_3  620us ->  542us        0.87x
 grresourcecache_add_25 2.74ms -> 2.24ms        0.82x
 grresourcecache_add_56 3.23ms -> 2.56ms        0.79x
 grresourcecache_add_54 3.34ms -> 2.62ms        0.78x
  grresourcecache_add_5 2.68ms ->  2.1ms        0.78x
 grresourcecache_add_10  2.7ms -> 2.11ms        0.78x
  grresourcecache_add_2 1.85ms -> 1.41ms        0.76x
    grresourcecache_add 1.84ms ->  1.4ms        0.76x
  grresourcecache_add_4 1.99ms -> 1.49ms        0.75x
  grresourcecache_add_3 2.11ms -> 1.55ms        0.73x
 grresourcecache_add_55   39ms -> 13.9ms        0.36x
grresourcecache_find_55 23.2ms -> 6.21ms        0.27x

On arm64 the results are similar.

On arm_v7_neon, the results lack the discontinuity at 55:
    grresourcecache_add 4.06ms -> 4.26ms        1.05x
  grresourcecache_add_2 4.05ms -> 4.23ms        1.05x
   grresourcecache_find 1.28ms ->  1.3ms        1.02x
grresourcecache_find_56 3.35ms -> 3.32ms        0.99x
 grresourcecache_find_2 1.31ms -> 1.29ms        0.99x
grresourcecache_find_54 3.28ms -> 3.24ms        0.99x
  grresourcecache_add_5 6.38ms -> 6.26ms        0.98x
 grresourcecache_add_55 8.44ms -> 8.24ms        0.98x
 grresourcecache_add_25 7.03ms -> 6.86ms        0.98x
grresourcecache_find_25  2.7ms -> 2.59ms        0.96x
 grresourcecache_find_4 1.45ms -> 1.38ms        0.95x
grresourcecache_find_10 2.52ms -> 2.39ms        0.95x
grresourcecache_find_55 3.54ms -> 3.33ms        0.94x
 grresourcecache_find_5  2.5ms -> 2.32ms        0.93x
 grresourcecache_find_3 1.57ms -> 1.43ms        0.91x

The extremely slow case, 55, is postulated to be due to the index jump
collisions running the memcmp. This is not visible on arm_v7_neon probably due
to hash function producing different results for 32 bit architectures.

This change is needed for extending path cache key in Gr
NV_path_rendering codepath. Extending is needed in order to add dashed
paths to the path cache.

Review URL: https://codereview.chromium.org/1132723003
2015-05-18 22:47:33 -07:00
robertphillips
eea2ff7201 Revert of Refactor GrBufferAllocPools to use resource cache (patchset #9 id:160001 of https://codereview.chromium.org/1139753002/)
Reason for revert:
Perf Regression for some bot/skp combinations

Original issue's description:
> Refactor GrBufferAllocPools to use resource cache
>
> Committed: https://skia.googlesource.com/skia/+/c5f1c5414fc8f73cbefadcc1b24ec794056fa203

TBR=bsalomon@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1129863008
2015-05-14 05:24:53 -07:00
robertphillips
c5f1c5414f Refactor GrBufferAllocPools to use resource cache
Review URL: https://codereview.chromium.org/1139753002
2015-05-13 10:55:33 -07:00
joshualitt
6c891107ce GLProgramsTest 3.0
BUG=skia:

Review URL: https://codereview.chromium.org/1139743002
2015-05-13 08:51:50 -07:00
joshualitt
7d022d6cc8 add option to supress prints on context
BUG=skia:

Committed: https://skia.googlesource.com/skia/+/55661337667a8305ebb100e36af23d34c2fb83ba

Review URL: https://codereview.chromium.org/1128903008
2015-05-12 12:03:50 -07:00
joshualitt
ee71044d4b Revert of add option to supress prints on context (patchset #5 id:80001 of https://codereview.chromium.org/1128903008/)
Reason for revert:
breaks windows rollbots

Original issue's description:
> add option to supress prints on context
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/55661337667a8305ebb100e36af23d34c2fb83ba

TBR=bsalomon@google.com,robertphillips@google.com,joshualitt@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1125193006
2015-05-12 08:33:36 -07:00
joshualitt
5566133766 add option to supress prints on context
BUG=skia:

Review URL: https://codereview.chromium.org/1128903008
2015-05-12 07:00:57 -07:00
cdalton
321177052b Add assignment op to enum bitfield ops
BUG=skia:

Review URL: https://codereview.chromium.org/1139513002
2015-05-11 11:21:23 -07:00
bsalomon
f7cc87719e Add function for logging blend info on XP.
Review URL: https://codereview.chromium.org/1132373003
2015-05-11 11:21:14 -07:00
joshualitt
8e5c177c85 convex path renderer unit tests
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1134753002
2015-05-11 08:58:52 -07:00
joshualitt
e590266294 Add unit tests for stroke rects and drawVertices
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1133613004
2015-05-11 08:18:35 -07:00
joshualitt
21279c7ada AADistanceFieldPathRenderer unit tests
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1129083005
2015-05-11 07:21:37 -07:00
egdaniel
c19cdc254c Only discard for XP dstCopies if we have a coverage value.
TBR=bsalomon@google.com

BUG=skia:

Review URL: https://codereview.chromium.org/1125283005
2015-05-10 08:45:18 -07:00
bsalomon
72c7a60ecf remove legacy Gr things
Review URL: https://codereview.chromium.org/1132813002
2015-05-08 07:17:05 -07:00
reed
8b26b99c97 new image from backend desc
BUG=485243

Review URL: https://codereview.chromium.org/1121813002
2015-05-07 15:36:18 -07:00
joshualitt
2fbd4068bd tesselating path renderer unit tests
BUG=skia:

Review URL: https://codereview.chromium.org/1127183006
2015-05-07 13:06:42 -07:00
robertphillips
e40d397259 Isolate GrBufferAllocPools inside GrBatchTarget
This CL refactors the location of the GrBufferAllocPools so they reside entirely inside the GrBatchTarget. This is in preparation for making them use scratch resources.

Review URL: https://codereview.chromium.org/1131553002
2015-05-07 09:51:43 -07:00
joshualitt
0acd0d33fd adding uniqueID to GrContext
BUG=skia:

Review URL: https://codereview.chromium.org/1128873009
2015-05-07 08:23:19 -07:00
cdalton
8917d62ef4 Implement support for KHR_blend_equation_advanced
Uses KHR(or NV)_blend_equation_advanced to implement custom Xfer modes
in hardware.

BUG=skia:

Review URL: https://codereview.chromium.org/1037123003
2015-05-06 13:40:21 -07:00
egdaniel
99bc9fdfb5 Remove canTweakAlphaForCoverage from XP's since batch reads flag.
BUG=skia:

Review URL: https://codereview.chromium.org/1127693002
2015-05-04 12:58:16 -07:00
bsalomon
ed0bcad9c8 Move instanced index buffer creation to flush time
Committed: https://skia.googlesource.com/skia/+/ab622c7b8cc8c39f0a594e4392b9e31b7e1ddb26

Review URL: https://codereview.chromium.org/1116943004
2015-05-04 10:36:43 -07:00
bsalomon
d8ed1b64a6 Revert of Move instanced index buffer creation to flush time (patchset #6 id:100001 of https://codereview.chromium.org/1116943004/)
Reason for revert:
messed up caching, recreating index buffers all the time.

Original issue's description:
> Move instanced index buffer creation to flush time
>
> Committed: https://skia.googlesource.com/skia/+/ab622c7b8cc8c39f0a594e4392b9e31b7e1ddb26

TBR=joshualitt@google.com,robertphillips@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1126613003
2015-05-04 10:09:24 -07:00
bsalomon
ab622c7b8c Move instanced index buffer creation to flush time
Review URL: https://codereview.chromium.org/1116943004
2015-05-04 08:09:30 -07:00
joshualitt
40ded32418 Add hairlines batch unit test
BUG=skia:

Review URL: https://codereview.chromium.org/1119563002
2015-05-02 07:07:17 -07:00
bsalomon
d309e7aa0e This replaces the texture creation/caching functions on GrContext with a GrTextureProvider interface. The goal is to pass this narrowly focused object in places that currently take a GrContext but don't need and shouldn't use its other methods. It also has an extended private interface for interacting with non-texture resource types.
Review URL: https://codereview.chromium.org/1107973004
2015-04-30 14:18:54 -07:00
joshualitt
3e708c53f7 Add batch unit tests for ovals
BUG=skia:

Review URL: https://codereview.chromium.org/1108403005
2015-04-30 13:49:27 -07:00
cdalton
9954bc38c4 Use texture barriers to read directly from the RT
Updates GrXferProcessor to read directly from the RT texture when
texture barriers are supported and it needs to know the dst color.
Also adds the notion of an Xfer barrier and uses it to issue texture
barriers when the XP will read the RT.

BUG=skia:

Review URL: https://codereview.chromium.org/1040303002
2015-04-29 14:17:00 -07:00
joshualitt
fa2008ff6e Add dash lines batch unit test
BUG=skia:

Review URL: https://codereview.chromium.org/1108053004
2015-04-29 11:32:06 -07:00
jvanverth
e9c0fc616d Pull out shader-specific caps into GrShaderCaps and GrGLSLCaps
BUG=skia:

Review URL: https://codereview.chromium.org/1116713002
2015-04-29 11:18:05 -07:00
joshualitt
3f655f34a2 Initial CL to create GrBatchTest infrastructure
BUG=skia:

Review URL: https://codereview.chromium.org/1109153004
2015-04-29 10:01:22 -07:00
bsalomon
a73239a009 Remove GrFlushToGpuDrawTarget and move functionality up to GrDrawTarget.
Review URL: https://codereview.chromium.org/1117433002
2015-04-28 13:35:17 -07:00
joshualitt
4eaf9cef5a create GrTestUtils.h, move some common functions into it
BUG=skia:

Review URL: https://codereview.chromium.org/1117443002
2015-04-28 13:31:18 -07:00
jvanverth
cfc18867d9 Use GLSLCaps for creating processor keys and GLSL-specific programs
Effectively all this does is future-proof any GLSL-specific code, as
GLSLCaps is just a typedef of GLCaps.

BUG=skia:

Review URL: https://codereview.chromium.org/1109863004
2015-04-28 08:48:20 -07:00
joshualitt
8f94bb2b25 remove old text contexts and fontcache
BUG=skia:

Review URL: https://codereview.chromium.org/1104343003
2015-04-28 07:04:11 -07:00
kkinnunen
1899651ffc Extract gpu line dashing to GrDashLinePathRenderer
Move line dashing logic from GrContext::drawPath to
GrDashLinePathRenderer. This makes it possible to let path renderers render arbitrary dashed paths.

End goal is to implement dashing in GrStencilAndCoverPathRenderer.

Review URL: https://codereview.chromium.org/1100073003
2015-04-26 23:18:50 -07:00
cdalton
f4f2b44222 Add onGetBlendInfo to GrXferProcessor
Adds an onGetBlendInfo method for GrXferProcessor subclasses to
override instead of overriding getBlendInfo directly. This gives the
base class a chance to initialize the struct with default values
before passing it on. As the BlendInfo struct grows, this will keep
things simple and less error prone.

BUG=skia:
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1049143002
2015-04-23 09:40:23 -07:00
cdalton
bae6f6c3ec Add tokens and entry points for KHR_blend_equation_advanced
Also adds glBlendEquation, which the extension interacts with, to the
core of GrGLInterface. Validation of this function is temporarily
disabled until Chrome hooks it up.

BUG=skia:

Review URL: https://codereview.chromium.org/1039693004
2015-04-22 10:39:03 -07:00