Commit Graph

19281 Commits

Author SHA1 Message Date
caryclark
0bccd8749b Revert of Update feSpotLight to match spec (patchset #2 id:20001 of https://codereview.chromium.org/1403403003/ )
Reason for revert:
re-land once layout test have been disabled (so they can be rebased)

Original issue's description:
> Update feSpotLight to match spec
>
> This change updates feSpotLight to match the spec via two changes:
>
> 1) specularExponent is ignored if the spotlight has no coneAngle (GPU
>    bug only). This change updates the GPU path so that it matches the
>    CPU path and the spec in this regard.
>
> 2) specularExponent is clamped to the 1-128 range. The spec does not
>    specify a clamp for the specularExponent attribute of feSpotLight.
>    Note that the spec *does* specify this clamp for the
>    specularExponent attribute of feSpecularLighting. It looks like we
>    incorrectly applied this to both specularExponent attributes.
>
>    This change (along with a parallel change in Blink) allows us to pass
>    the SVG filter effects conformance test here:
>    http://www.w3.org/Graphics/SVG/Test/20110816/harness/htmlObject/filters-light-01-f.html
>
>    Additionally, this brings our behavior in line with Safari and Edge’s
>    behavior on this filter.
>
> Two new cases were added to gm/lighting.cpp to catch these issues:
> - The existing spotlight case exercised the path where our specular
>   exponent was between 1-128 and had a limiting cone angle.
> - The first new spotlight case exercises the path where our specular
>   exponent is between 1-128 and we do not have a limiting cone angle.
> - The second new spotlight case exercises the path where the specular
>   exponent is not within the 1-128 range, to ensure that we don’t
>   incorrectly clip to this range.
>
> BUG=472849
>
> Committed: https://skia.googlesource.com/skia/+/c84ccb070258db2803a9e8f532bfe7239a737063

TBR=senorblanco@google.com,senorblanco@chromium.org,bsalomon@google.com,ericrk@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=472849

Review URL: https://codereview.chromium.org/1417463006
2015-10-20 10:04:03 -07:00
reed
13ccbf8a68 use (temp) gpu-imagefilter-cache for applyFilter
BUG=skia:

Review URL: https://codereview.chromium.org/1414653003
2015-10-20 09:56:52 -07:00
robertphillips
3dc6ae55ca Move GrDrawingManager methods to their own .cpp file
Small cleanup

Review URL: https://codereview.chromium.org/1407393004
2015-10-20 09:54:32 -07:00
mtklein
c4d934f339 SkRemote: add xfermodes
Note this changes the default ID for each type from a valid non-null value to a nullptr.
All the ()++ are now ++(), so we always work with non-null IDs when we define things.

Some of this is prematurely generalized with an eye for supporting other effects and ref-counted things.

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

BUG=skia:

Review URL: https://codereview.chromium.org/1412223002
2015-10-20 08:26:54 -07:00
bsalomon
045802dbb7 Rewrite GrTextureMaker to disentangle bitmap case from base class and give GPU object a say in what copying needs to be done.
Committed: https://skia.googlesource.com/skia/+/fcffaf22d697f06f903c3193308f9dc54a959f79

Committed: https://skia.googlesource.com/skia/+/1a197ea31e0aac7ea312e9a6c0d9f5df626b0350

Review URL: https://codereview.chromium.org/1409163002
2015-10-20 07:58:01 -07:00
robertphillips
4beb5c117b Add debugging helper to GrDrawTarget
This CL relies on https://codereview.chromium.org/1414773002/ (Add the machinery to GrDrawTarget to enable topological sorting)

BUG=skia:4094

Review URL: https://codereview.chromium.org/1416753002
2015-10-20 07:50:00 -07:00
mtklein
4dfdbb19ba nanobench: Add some Valgrind failure paranoia.
Trying to figure out

http://build.chromium.org/p/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Valgrind/builds/586/steps/nanobench/logs/stdio

BUG=skia:4482

Review URL: https://codereview.chromium.org/1418633002
2015-10-20 07:45:29 -07:00
robertphillips
6a18665a7e Add the machinery to GrDrawTarget to enable topological sorting
This relies on https://codereview.chromium.org/1414503003/ (Add SkTTopoSort) landing first.

BUG=skia:4094

Review URL: https://codereview.chromium.org/1414773002
2015-10-20 07:37:58 -07:00
ericrk
c84ccb0702 Update feSpotLight to match spec
This change updates feSpotLight to match the spec via two changes:

1) specularExponent is ignored if the spotlight has no coneAngle (GPU
   bug only). This change updates the GPU path so that it matches the
   CPU path and the spec in this regard.

2) specularExponent is clamped to the 1-128 range. The spec does not
   specify a clamp for the specularExponent attribute of feSpotLight.
   Note that the spec *does* specify this clamp for the
   specularExponent attribute of feSpecularLighting. It looks like we
   incorrectly applied this to both specularExponent attributes.

   This change (along with a parallel change in Blink) allows us to pass
   the SVG filter effects conformance test here:
   http://www.w3.org/Graphics/SVG/Test/20110816/harness/htmlObject/filters-light-01-f.html

   Additionally, this brings our behavior in line with Safari and Edge’s
   behavior on this filter.

Two new cases were added to gm/lighting.cpp to catch these issues:
- The existing spotlight case exercised the path where our specular
  exponent was between 1-128 and had a limiting cone angle.
- The first new spotlight case exercises the path where our specular
  exponent is between 1-128 and we do not have a limiting cone angle.
- The second new spotlight case exercises the path where the specular
  exponent is not within the 1-128 range, to ensure that we don’t
  incorrectly clip to this range.

BUG=472849

Review URL: https://codereview.chromium.org/1403403003
2015-10-19 14:44:56 -07:00
ericrk
af96fce879 The SkArithmeticMode_gpu GL filters support clamping to valid
premultiplied colors, however the flag for whether or not to do this,
which is present in their parent filters, is dropped when creating the
GL implementations. This change adds logic to forward the value from
the parent filter to the GL implementation.

This makes GPU behavior match software and fixes a WebKit
LayoutTest. See referenced bug.

BUG=473186

Review URL: https://codereview.chromium.org/1410553002
2015-10-19 14:41:11 -07:00
mtklein
deb8146fac SkRemote: fix Misc hash function.
Misc only has data in the first 10 bytes of its 12 byte layout.
We need to stop hashing at 10 bytes.

C.f. http://build.chromium.org/p/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Valgrind/builds/581

BUG=skia:

Review URL: https://codereview.chromium.org/1409273006
2015-10-19 14:39:45 -07:00
benjaminwagner
7d974f5e4f Modifications to get 'blaze build -c opt //third_party/skia/HEAD/...' to work.
BUG=skia:

Review URL: https://codereview.chromium.org/1413973002
2015-10-19 13:55:55 -07:00
robertphillips
423f6461e9 Add SkTTopoSort
BUG=skia:4094

Review URL: https://codereview.chromium.org/1414503003
2015-10-19 12:15:55 -07:00
Brian Salomon
bc0bcc08b3 Revert recent CLs around GrTextureMaker/GrTextureParamsAdjuster
Review URL: https://codereview.chromium.org/1411353002 .
2015-10-19 15:12:32 -04:00
Brian Salomon
386f2d3204 Upload stretched bmp rather than original after doing CPU stretch for min texture size
BUG=skia:

Review URL: https://codereview.chromium.org/1411323002 .
2015-10-19 14:22:51 -04:00
mtklein
1df5fab385 SkRemote: DrawPaint is an inverse empty path.
Drawing with SkRect::MakeLargest() isn't actually working.

This appears to work correctly, and even be correct.
(It's a case explicitly handled by SkCanvas::onDrawPath).

BUG=skia:

Review URL: https://codereview.chromium.org/1411303002
2015-10-19 10:41:15 -07:00
bsalomon
2fc11d39d1 Move definitions of GrGL basic types (e.g. GrGLenum) to their own header.
Review URL: https://codereview.chromium.org/1410333003
2015-10-19 09:03:23 -07:00
Brian Salomon
9f8904d2fd Add override to Bitmap_GrTextureParamsAdjuster::refOriginalTexture
TBR=caryclark@google.com

Review URL: https://codereview.chromium.org/1417553002 .
2015-10-19 11:53:40 -04:00
ethannicholas
a8e5fbdf30 Fix for GM:bigblurs not actually blurring some of the rectangles on Nexus 10.
BUG=skia:2860

Review URL: https://codereview.chromium.org/1395693011
2015-10-19 08:38:16 -07:00
bsalomon
2f8ac3538d Misc: Don't run etc1 bench with invalid image and fix VS2015 build warning
Review URL: https://codereview.chromium.org/1409993003
2015-10-19 08:29:16 -07:00
reed
59dc0d22f5 change SkImage_Gpu to handle all filters (w/ and w/o gpu support
The result is that the set of "generic" imagefilters (e.g. SkColorFilterImageFilter) that use drawing commands to return their results will now stay in the same domain as their src (i.e. gpu-src --> gpu-dst).

ApplyFilterGM exercises this, and now asserts this same-domain invariant.

BUG=skia:4467

Review URL: https://codereview.chromium.org/1401053003
2015-10-19 08:24:21 -07:00
bsalomon
1a197ea31e Rewrite GrTextureMaker to disentangle bitmap case from base class and give GPU object a say in what copying needs to be done.
Committed: https://skia.googlesource.com/skia/+/fcffaf22d697f06f903c3193308f9dc54a959f79

Review URL: https://codereview.chromium.org/1409163002
2015-10-19 08:24:09 -07:00
egdaniel
cdf79dbf2f Remove unused member variables in GrGLProgram
BUG=skia:

Review URL: https://codereview.chromium.org/1416523003
2015-10-19 07:23:02 -07:00
robertphillips
9c4909b50f Add imgblur tool to assist BlurMaskFilter debugging
imgblur is intended to establish a ground truth for debugging mask blur issues. It performs a brute force (non-separable) Gaussian blur of the provided image.

The blur code itself is in sk_tools_utils so it can be more easily used programmatically in other places (e.g., blur unit tests).

Review URL: https://codereview.chromium.org/1384203002
2015-10-19 06:39:17 -07:00
hendrikw
b3f1636ec8 skia: Make the validate match interface for *_draw_instanced
For whatever reason, on the Mac, the command buffer is reporting
ARB_draw_instanced as a valid extension. This is probably a bug in the
command buffer and I'll look into this later.

In Skia, we don't check for ARB_draw_instanced in GLES2 when building
the interface, but during the validate, we do, so we ended up failing
the validation.

Looking a bit further at the specs, ARB_draw_instanced is GL only,
whereas EXT_draw_instanced is both GL and GLES.  I've updated the code
to reflect this.

See:
https://cvs.khronos.org/svn/repos/ogl/trunk/doc/registry/public/specs/ARB/draw_instanced.txt
https://www.opengl.org/registry/specs/EXT/draw_instanced.txt

Everything above also applies to ARB/EXT_instanced_arrays

https://www.khronos.org/registry/gles/extensions/EXT/EXT_instanced_arrays.txt
https://www.opengl.org/registry/specs/ARB/instanced_arrays.txt

Review URL: https://codereview.chromium.org/1409053003
2015-10-19 06:13:55 -07:00
halcanary
44d85d1748 SkRemote: impl drawRRect
Review URL: https://codereview.chromium.org/1412013002
2015-10-18 05:12:58 -07:00
update-skps
fd70adea97 Update SKP version
Automatic commit by the RecreateSKPs bot.

TBR=
NO_MERGE_BUILDS

Review URL: https://codereview.chromium.org/1410283002
2015-10-18 00:23:36 -07:00
halcanary
f271069830 SkRemote: simple impl of onDraw*Text*
Review URL: https://codereview.chromium.org/1409273004
2015-10-17 15:46:29 -07:00
halcanary
5bce23c33a SkRemote: impl onDrawDRRect
Review URL: https://codereview.chromium.org/1410223002
2015-10-17 15:18:35 -07:00
mtklein
ff8b3f0f65 Test SkRemote on GCE bots.
This will get us gathering GM images.
I will set up ignores on gold.skia.org so no one's bothered.

BUG=skia:

Review URL: https://codereview.chromium.org/1414563002
2015-10-17 09:25:21 -07:00
robertphillips
77a2e52c7d Remove DrawingMgr shims from GrContext
BUG=skia:4094

Review URL: https://codereview.chromium.org/1413673002
2015-10-17 07:43:27 -07:00
halcanary
1ed348aea3 SkRemote: impl drawPaint()
Review URL: https://codereview.chromium.org/1409253003
2015-10-17 06:11:52 -07:00
mtklein
56f152b53f LookupScope does not need to be in SkRemote.h
It's only used by Cache and Client.
This moves it to SkRemote.cpp, where they live.

BUG=skia:

Review URL: https://codereview.chromium.org/1409273002
2015-10-16 15:33:18 -07:00
scroggo
82e341ff87 Suppression for valgrind bug
TBR=msarett@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

BUG=skia:4478

Review URL: https://codereview.chromium.org/1410953002
2015-10-16 14:42:47 -07:00
egdaniel
91957941ce Revert of Rewrite GrTextureMaker to disentangle bitmap case from base class and give GPU object a say in what… (patchset #4 id:60001 of https://codereview.chromium.org/1409163002/ )
Reason for revert:
breaking nanobench

Original issue's description:
> Rewrite GrTextureMaker to disentangle bitmap case from base class and give GPU object a say in what copying needs to be done.
>
> Committed: https://skia.googlesource.com/skia/+/fcffaf22d697f06f903c3193308f9dc54a959f79

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

Review URL: https://codereview.chromium.org/1409923003
2015-10-16 13:59:14 -07:00
bsalomon
fcffaf22d6 Rewrite GrTextureMaker to disentangle bitmap case from base class and give GPU object a say in what copying needs to be done.
Review URL: https://codereview.chromium.org/1409163002
2015-10-16 13:35:10 -07:00
bsalomon
466c2c48b9 Move some code around to make another diff cleaner
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1403293004
2015-10-16 12:01:18 -07:00
stephana
5b8faf7c7c Add docs on how to install iOS test tools
BUG=skia:
NOTRY=true
DOCS_PREVIEW= https://skia.org/?cl=1413653002

Review URL: https://codereview.chromium.org/1413653002
2015-10-16 11:47:37 -07:00
senorblanco
9a70b6ef59 Image filters: refactor input GPU processing into filterInputGPU().
(analog of CPU version here: https://codereview.chromium.org/1404743005/)

No change in behaviour; this is a straight refactoring.

BUG=skia:3194

Review URL: https://codereview.chromium.org/1393283008
2015-10-16 11:35:14 -07:00
msarett
80803ff615 Fix SkSwizzler bug
Now, that we are subsetting, fX0 is not necessarily less than
fSrcWidth (since fSrcWidth is really the subset width).

Ex: We may want a 10 pixel subset starting twenty pixels from the
left edge.  In that case, fX0=20 and fSrcWidth=10.

Let's rename the width as fSubsetWidth to avoid confusion
and remove the check.

BUG=skia:

Review URL: https://codereview.chromium.org/1407603003
2015-10-16 10:54:12 -07:00
mtklein
2e2ea38bb7 SkRemote
BUG=skia:

Review URL: https://codereview.chromium.org/1391023005
2015-10-16 10:29:41 -07:00
robertphillips
a106c62753 Loosen requirement that there be only one GrDrawTarget
BUG=skia:4094

Review URL: https://codereview.chromium.org/1406173003
2015-10-16 09:07:06 -07:00
caryclark
26ad22ab61 Enabling clip stack flattening exercises path ops.
Iterating through the 903K skps that represent the
imagable 1M top web pages triggers a number of
bugs, some of which are addressed here.

Some web pages trigger intersecting cubic
representations of arc with their conic
counterparts. This exposed a flaw in coincident
detection that caused an infinite loop. The loop
alternatively extended the coincident section and,
determining the that the bounds of the curve pairs
did not overlap, deleted the extension.

Track the number of times the coincident detection
is called, and if it exceeds an empirically found
limit, assume that the curves are coincident and
force it to be so.

The loop count limit can be determined by enabling
DEBUG_T_SECT_LOOP_COUNT and running all tests. The
largest count is reported on completion.

Another class of bugs was caused by concident
detection duplicating nearly identical points that
had been merged earlier. To track these bugs, the
'handle coincidence' code was duplicated as a
const debug variety that reported if one of a
dozen or so irregularities are present; then it is
easier to see when a block of code that fixes one
irregularity regresses another.

Creating the debug const code version exposed some
non-debug code that could be const, and some that
was experimental and could be removed. Set
DEBUG_COINCIDENCE to track coincidence health and
handling.

For running on Chrome, DEBUG_VERIFY checks the
result of pathops against the same operation
using SkRegion to verify that the results are
nearly the same.

When visualizing the pathops work using
tools/pathops_visualizer.htm, set
DEBUG_DUMP_ALIGNMENT to see the curves after
they've been aligned for coincidence.

Other bugs fixed include detecting when a
section of a pair of curves have devolved into
lines and are coincident.

TBR=reed@google.com

Review URL: https://codereview.chromium.org/1394503003
2015-10-16 09:03:38 -07:00
bsalomon
1a1d0b8d07 Remove check for whole image in the cache in SkGpuDevice::shouldTileImage
This was never that well justified.

Review URL: https://codereview.chromium.org/1405383002
2015-10-16 07:49:42 -07:00
fmalita
fa694ad067 Remove SkDEPRECATED_InstallDiscardablePixelRef from SkPictureShader
Use an SkImage generator/shader instead.

R=reed@google.com

Review URL: https://codereview.chromium.org/1405103003
2015-10-16 07:39:33 -07:00
jvanverth
338047e21f Clean up iOS build files
Review URL: https://codereview.chromium.org/1409663002
2015-10-15 13:20:35 -07:00
msarett
c2d0bc5c20 Supply separate flags for onBuildTileIndex
This is a follow up to:
https://codereview.chromium.org/1401283003/

Supply separate flags for onBuildTileIndex

Since png and jpeg's implementations of onBuildTileIndex rely on
modifications to their underlying libraries, rather than whether we are
running on Android, use separate flags that can be disabled
independently.

This will allow us to easily turn off the feature. It also is a step
towards building and running on other platforms for testing (e.g.
valgrind/ASAN to find memory leaks etc).

BUG=skia:

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

Review URL: https://codereview.chromium.org/1402783008
2015-10-15 13:18:06 -07:00
mtklein
c8d1dd48c0 SkTHash: hash from fnptr to functor type
Passing &SkGoodHash to SkTHashMap and SkTHashSet doesn't guarantee that it's actually instantiated.  Using a functor does.

BUG=skia:

Review URL: https://codereview.chromium.org/1405053002
2015-10-15 12:23:02 -07:00
senorblanco
b9519f86bb Image Filters: refactor all CPU input processing into a filterInput helper function.
No change in behaviour; this is a straight refactoring.

BUG=skia:3194

Review URL: https://codereview.chromium.org/1404743005
2015-10-15 12:15:13 -07:00
bsalomon
5f5527fb46 Remove params from Cacherator_GrTextureMaker
Review URL: https://codereview.chromium.org/1403313003
2015-10-15 12:14:55 -07:00