Paths are cached as tessellated triangle meshes in vertex buffers on the GPU. Stroked paths are not (yet) cached.
Paths containing no curved segments (linear paths) are reused at all scales. Paths containing curved segments are reused within a scale tolerance threshold.
In order to invalidate the cache when an SkPath is changed or deleted,
this required implementing genID change notification in SkPath. This is
modelled almost exactly on SkPixelRef::GenIDChangeListener.
However, It does not currently implement the check for unique genIDs,
so notifiers will fire when the first instance of an SkPathRef
using a given genID is destroyed.
Another caveat is that you cannot successfully add a change notifier
to an empty path, since it uses the "canonical" empty path which is
never modified or destroyed. For this reason, we prevent adding
listeners to it.
BUG=skia:4121,skia:4122, 497403
DOCS_PREVIEW= https://skia.org/?cl=1114353004
Review URL: https://codereview.chromium.org/1114353004
This reverts commit d12e6ffa5c.
Our Chrome roll canaries are failing with the dreaded
Ninja-says-there's-more-work-to-do message. I will break this up
smaller (if possible) and try again tomorrow.
BUG=skia:4126
Review URL: https://codereview.chromium.org/1258293004 .
include/views/SkOSWindow_Win.h includes it.
To move SkTHash.h to include/private, SkChecksum.h needs to go there too. To move SkChecksum.h to include/private, SkTLogic needs to go there too.
This adds a bunch of -Iinclude/private to tools.gyp I missed in the last CL.
No public API changes.
TBR=reed@google.com
BUG=skia:4126
Review URL: https://codereview.chromium.org/1260613006
Implement support for path rendering in Chromium through
CHROMIUM_path_rendering pseudo extension.
The extension defines a new pseudo-gl function,
BindFragmentInputLocation. This behaves similarly to the
BindUniformLocation pseudo-gl function. The idea is to assign fragment
input location to a fragment input before linking the program.
BUG=chromium:344330
Committed: https://skia.googlesource.com/skia/+/eeef46d181f9f8db388ecea81df699fc1b3c9280
Review URL: https://codereview.chromium.org/1192663002
Reason for revert:
DEPS roll failing
Original issue's description:
> Implement support for CHROMIUM_path_rendering pseudo extension
>
> Implement support for path rendering in Chromium through
> CHROMIUM_path_rendering pseudo extension.
>
> The extension defines a new pseudo-gl function,
> BindFragmentInputLocation. This behaves similarly to the
> BindUniformLocation pseudo-gl function. The idea is to assign fragment
> input location to a fragment input before linking the program.
>
> BUG=chromium:344330
>
> Committed: https://skia.googlesource.com/skia/+/eeef46d181f9f8db388ecea81df699fc1b3c9280TBR=bsalomon@google.com,joshualitt@google.com,kkinnunen@nvidia.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:344330
Review URL: https://codereview.chromium.org/1223673002
Implement support for path rendering in Chromium through
CHROMIUM_path_rendering pseudo extension.
The extension defines a new pseudo-gl function,
BindFragmentInputLocation. This behaves similarly to the
BindUniformLocation pseudo-gl function. The idea is to assign fragment
input location to a fragment input before linking the program.
BUG=chromium:344330
Review URL: https://codereview.chromium.org/1192663002
Some of this is transitive, like SkRecords.h used by SkMiniRecorder.h
used by (public) SkPictureRecorder.h.
BUG=skia:
Review URL: https://codereview.chromium.org/1217293004
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.
Avoid failing interface creation even if nvprmsaaXX config is
requested but the driver is not recent enough. The SAN bots have
old driver, but try to run nvprmsaa16 configs. Instead, print
out a warning.
Committed: https://skia.googlesource.com/skia/+/fb8d6884e0e01d0c2f8596adf5af1efb0d08de7e
Committed: https://skia.googlesource.com/skia/+/e35b5d99d8dfcc6b2be844df28cba47436380809
Review URL: https://codereview.chromium.org/1177243004
Reason for revert:
Breaks the Ubuntu *SAN bots.
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
>
> Committed: https://skia.googlesource.com/skia/+/e35b5d99d8dfcc6b2be844df28cba47436380809TBR=joshualitt@google.com,cdalton@nvidia.com,bsalomon@google.com,kkinnunen@nvidia.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Review URL: https://codereview.chromium.org/1219663005
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
Review URL: https://codereview.chromium.org/1177243004
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
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
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
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/+/5b16e740fe6ab6d679083d06f07651602265081bTBR=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
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
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
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
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
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
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
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
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
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
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/+/9a70920db22b6309c671f8e5d519bb95570e4414TBR=egdaniel@google.com,bsalomon@google.com,cdalton@nvidia.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review URL: https://codereview.chromium.org/1153993002