Commit Graph

2553 Commits

Author SHA1 Message Date
caryclark
38a017bf44 clean up tests
Confirm that no path ops tests are flaky, and clean up errors around
that. The test framework was incorrectly checking for >= MAX_ERRORS for
failure and <= MAX_ERRORS for success.

TBR=reed@google.com

Review URL: https://codereview.chromium.org/1140563003
2015-05-13 10:13:17 -07:00
joshualitt
6c891107ce GLProgramsTest 3.0
BUG=skia:

Review URL: https://codereview.chromium.org/1139743002
2015-05-13 08:51:50 -07:00
caryclark
bca19f7747 deal more consistently with unsortable edges
Improve line/curve coincident detection and resolution. This fixed the remaining simple failures.

When an edge is unsortable, use the ray intersection to determine the angles' winding.

Deal with degenerate segments.

TBR=reed@google.com
BUG=skia:3588,skia:3762

Review URL: https://codereview.chromium.org/1140813002
2015-05-13 08:23:48 -07:00
kkinnunen
8f827fe44a Fix SkStrokeRec == to report true for all fills
Fix SkStrokeRec == to report true for all fills, regardless
of the stale stroking data the object might contain.

Review URL: https://codereview.chromium.org/1130153002
2015-05-13 00:02:26 -07:00
reed
80ea19ca4b Revert of Revert of stop calling SkScalarDiv (patchset #1 id:1 of https://codereview.chromium.org/1138263002/)
Reason for revert:
android patched, blink has rolled

Original issue's description:
> Revert of stop calling SkScalarDiv (patchset #4 id:60001 of https://codereview.chromium.org/1135053002/)
>
> Reason for revert:
> need to wait for Blink roll (and patch android)
>
> Original issue's description:
> > stop calling SkScalarDiv
> >
> > BUG=skia:
> > TBR=
> >
> > Committed: https://skia.googlesource.com/skia/+/67d71c898249a7af3523b16c6a69895a63bfae0a
>
> TBR=
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/2629697933b5cc975e45d2a45c48f803fc6cbcec

TBR=
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1135693003
2015-05-12 10:37:34 -07:00
reed
2629697933 Revert of stop calling SkScalarDiv (patchset #4 id:60001 of https://codereview.chromium.org/1135053002/)
Reason for revert:
need to wait for Blink roll (and patch android)

Original issue's description:
> stop calling SkScalarDiv
>
> BUG=skia:
> TBR=
>
> Committed: https://skia.googlesource.com/skia/+/67d71c898249a7af3523b16c6a69895a63bfae0a

TBR=
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1138263002
2015-05-12 10:28:06 -07:00
reed
67d71c8982 stop calling SkScalarDiv
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1135053002
2015-05-12 09:47:22 -07:00
caryclark
624637cc8e Path ops formerly found the topmost unprocessed edge and determined its angle sort order to initialize the winding. This never worked correctly with cubics and was flaky with paths consisting mostly of vertical edges.
This replacement shoots axis-aligned rays through all intersecting edges to find the outermost one either horizontally or vertically. The resulting code is smaller and twice as fast.

To support this, most of the horizontal / vertical intersection code was rewritten and standardized, and old code supporting the top-directed winding was deleted.

Contours were pointed to by an SkTDArray. Instead, put them in a linked list, and designate the list head with its own class to ensure that methods that take lists of contours start at the top. This change removed a large percentage of memory allocations used by path ops.

TBR=reed@google.com
BUG=skia:3588

Review URL: https://codereview.chromium.org/1111333002
2015-05-11 07:21:28 -07:00
reed
b7ed856fad Revert of Sketch splitting SkPicture into an interface and SkBigPicture. (patchset #22 id:420001 of https://codereview.chromium.org/1112523006/)
Reason for revert:
speculative revert to fix failures in DEPS roll

Original issue's description:
> Sketch splitting SkPicture into an interface and SkBigPicture.
>
> Adds small pictures for drawRect(), drawTextBlob(), and drawPath().
> These cover about 89% of draw calls from Blink SKPs,
> and about 25% of draw calls from our GMs.
>
> SkPicture handles:
>   - serialization and deserialization
>   - unique IDs
>
> Everything else is left to the subclasses:
>   - playback(), cullRect()
>   - hasBitmap(), hasText(), suitableForGPU(), etc.
>   - LayerInfo / AccelData if applicable.
>
> The time to record a 1-op picture improves a good chunk
> (2 mallocs to 1), and the time to record a 0-op picture
> greatly improves (2 mallocs to none):
>
>     picture_overhead_draw:   450ns -> 350ns
>     picture_overhead_nodraw: 300ns -> 90ns
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/c92c129ff85b05a714bd1bf921c02d5e14651f8b

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

Review URL: https://codereview.chromium.org/1130333002
2015-05-07 17:30:13 -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
mtklein
c92c129ff8 Sketch splitting SkPicture into an interface and SkBigPicture.
Adds small pictures for drawRect(), drawTextBlob(), and drawPath().
These cover about 89% of draw calls from Blink SKPs,
and about 25% of draw calls from our GMs.

SkPicture handles:
  - serialization and deserialization
  - unique IDs

Everything else is left to the subclasses:
  - playback(), cullRect()
  - hasBitmap(), hasText(), suitableForGPU(), etc.
  - LayerInfo / AccelData if applicable.

The time to record a 1-op picture improves a good chunk
(2 mallocs to 1), and the time to record a 0-op picture
greatly improves (2 mallocs to none):

    picture_overhead_draw:   450ns -> 350ns
    picture_overhead_nodraw: 300ns -> 90ns

BUG=skia:

Review URL: https://codereview.chromium.org/1112523006
2015-05-07 13:41:07 -07:00
halcanary
96287f7af7 SkPDF: detect YUV-JPEG without relying on ImageGenerator
JPEG/JFIF References:
*   http://www.w3.org/Graphics/JPEG/itu-t81.pdf
*   http://www.w3.org/Graphics/JPEG/jfif3.pdf

BUG=476721
BUG=446940

Review URL: https://codereview.chromium.org/1133443003
2015-05-07 11:46:59 -07:00
mtklein
0d992db1cf Make SkFunction copyable so it can go in containers.
This totally overhauls the implementation to use ordinary inheritance-based type erasure.  I give up for now getting my manual vtable shenanigans to work with MSVC.  Still those same "expected ; before ), also expected ) before ;" errors.

I added support for uninitialized SkFunctions and operator=(), because it was fairly straightforward with this implementation.

The main downside here is that I've removed the inline implementation.  All SkFunctions involve a heap allocation, even when just wrapping function pointers.

BUG=skia:

Review URL: https://codereview.chromium.org/1056673002
2015-05-06 07:40:26 -07:00
reed
d1290843c3 remove dead code behind BOOL_ONGETINFO
need this to land in chrome first https://codereview.chromium.org/1125573002

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1123473004
2015-05-05 11:36:02 -07:00
reed
71a6cbfc58 remove redundant/deprecated TwoPointRadial gradiet -- use TwoPointConical
This CL derived from https://codereview.chromium.org/1114243005/

BUG=skia:

Review URL: https://codereview.chromium.org/1117423003
2015-05-04 08:32:51 -07:00
halcanary
f7a169e225 SkPDF: clean up uses of deprecated calls in tests
BUG=skia:3585

Review URL: https://codereview.chromium.org/1106163002
2015-05-01 07:35:45 -07:00
halcanary
0b9d4118ba SkTime: return timezone information; format in ISO-8601
Motivation: PDF/A metadata will need the creation date embedded in it.

Also, GetDateTime returns local time in Win32.  This now behaves the
same as on Unix systems.

BUG=skia:3110

Review URL: https://codereview.chromium.org/1109593002
2015-05-01 07:06:23 -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
bungeman
3ffa126066 Move resource fonts to common location.
Move resource fonts to resources/fonts, add a destortable font for
testing, and clean up how the tests create fonts from resources.

R=joshualitt@google.com

Review URL: https://codereview.chromium.org/1120823002
2015-04-30 17:12:58 -04:00
reed
1c2c441fed add heuristic to pour small pictures into recordings, rather than ref'ing
BUG=skia:

Review URL: https://codereview.chromium.org/1118693003
2015-04-30 13:09:25 -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
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
caryclark
aec2510125 minor fixes to cubics code and overall alignment of how bounds and tops are computed for all curve types
All but 17 extended tests work.

A helper function is privately added to SkPath.h to permit a test to modify a given point in a path.

BUG=skia:3588

Review URL: https://codereview.chromium.org/1107353004
2015-04-29 08:28:30 -07:00
msarett
97fdea6c43 Implementing a scanline decoder for jpeg
BUG=skia:3257

Review URL: https://codereview.chromium.org/1092303003
2015-04-29 08:17:15 -07:00
reed
5b6db07fb5 SkRWBuffer for thread-safe 'stream' sharing
WIP
- Can accumulate (write) data in one thread, and share snapshots of it in other threads
  ... e.g. network accumulates image data, and periodically we want to decode/draw it
- If this sort of thing sticks, should we promote SkData to have the same generality as
  SkRBuffer?

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1106113002
2015-04-28 17:50:32 -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
mtklein
d7c014ff03 Split rsqrt into rsqrt{0,1,2}, with increasing cost and precision on ARM
This is a logical no-op.  Everything was using the equivalent of rsqrt1() before, and is now after.

BUG=skia:

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

CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-Arm64-Debug-Android-Trybot

Review URL: https://codereview.chromium.org/1109913002
2015-04-27 14:22:32 -07:00
mtklein
9a22f489e8 Revert of Split rsqrt into rsqrt{0,1,2}, with increasing cost and precision on ARM (patchset #2 id:20001 of https://codereview.chromium.org/1109913002/)
Reason for revert:
arm64 typos

Original issue's description:
> Split rsqrt into rsqrt{0,1,2}, with increasing cost and precision on ARM
>
> This is a logical no-op.  Everything was using the equivalent of rsqrt1() before, and is now after.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/9de16283fdc8cc0d31a84f503578d0ecea4e8297

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

Review URL: https://codereview.chromium.org/1105233003
2015-04-27 13:55:53 -07:00
mtklein
9de16283fd Split rsqrt into rsqrt{0,1,2}, with increasing cost and precision on ARM
This is a logical no-op.  Everything was using the equivalent of rsqrt1() before, and is now after.

BUG=skia:

Review URL: https://codereview.chromium.org/1109913002
2015-04-27 13:51:28 -07:00
mtklein
1113da72ec Mike's radial gradient CL with better float -> int.
patch from issue 1072303005 at patchset 40001 (http://crrev.com/1072303005#ps40001)

This looks quite launchable.  radial_gradient3, min of 100 samples:
  N5:  985µs -> 946µs
  MBP: 395µs -> 279µs

On my MBP, most of the meat looks like it's now in reading the cache and writing to dst one color at a time.  Is that something we could do in float math rather than with a lookup table?

BUG=skia:

CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Mac10.8-Clang-Arm7-Debug-Android-Trybot,Build-Ubuntu-GCC-Arm7-Release-Android_NoNeon-Trybot

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

Review URL: https://codereview.chromium.org/1109643002
2015-04-27 12:08:01 -07:00
mtklein
8d3e9dff3f Revert of Mike's radial gradient CL with better float -> int. (patchset #7 id:120001 of https://codereview.chromium.org/1109643002/)
Reason for revert:
compile failures.

Original issue's description:
> Mike's radial gradient CL with better float -> int.
>
> patch from issue 1072303005 at patchset 40001 (http://crrev.com/1072303005#ps40001)
>
> This looks quite launchable.  radial_gradient3, min of 100 samples:
>   N5:  985µs -> 946µs
>   MBP: 395µs -> 279µs
>
> On my MBP, most of the meat looks like it's now in reading the cache and writing to dst one color at a time.  Is that something we could do in float math rather than with a lookup table?
>
> BUG=skia:
>
> CQ_EXTRA_TRYBOTS=client.skia.android:Test-Android-GCC-Nexus5-CPU-NEON-Arm7-Debug-Trybot,Test-Android-GCC-Nexus9-CPU-Denver-Arm64-Debug-Trybot
>
> Committed: https://skia.googlesource.com/skia/+/abf6c5cf95e921fae59efb487480e5b5081cf0ec

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

Review URL: https://codereview.chromium.org/1109883003
2015-04-27 11:21:16 -07:00
mtklein
abf6c5cf95 Mike's radial gradient CL with better float -> int.
patch from issue 1072303005 at patchset 40001 (http://crrev.com/1072303005#ps40001)

This looks quite launchable.  radial_gradient3, min of 100 samples:
  N5:  985µs -> 946µs
  MBP: 395µs -> 279µs

On my MBP, most of the meat looks like it's now in reading the cache and writing to dst one color at a time.  Is that something we could do in float math rather than with a lookup table?

BUG=skia:

CQ_EXTRA_TRYBOTS=client.skia.android:Test-Android-GCC-Nexus5-CPU-NEON-Arm7-Debug-Trybot,Test-Android-GCC-Nexus9-CPU-Denver-Arm64-Debug-Trybot

Review URL: https://codereview.chromium.org/1109643002
2015-04-27 11:13:53 -07:00
jvanverth
505306374d Remove legacy NVPR support
BUG=skia:

Review URL: https://codereview.chromium.org/1110553003
2015-04-27 10:36:27 -07:00
bsalomon
d79c549467 Make non-AA hairline stroke rects snap to pixels centers so they close.
BUG=skia:3717

Review URL: https://codereview.chromium.org/1101663007
2015-04-27 10:07:04 -07:00
tfarina
567ff2f614 Cleanup: Remove unnecessary double-semicolons.
The entries were found by the following command line:

$ find . -regex ".*\.[cChH]\(pp\)?" | xargs git grep -e ';;' --and --not
-e 'for *(.*;;'

Which is a combination of http://stackoverflow.com/a/3858879 and
http://gitster.livejournal.com/27674.html

BUG=None
R=mtklein@google.com

Review URL: https://codereview.chromium.org/1088763005
2015-04-27 07:01:45 -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
halcanary
130444fdaf SkPDF: Refactor SkPDFObject heiararchy.
Flatten and use a tagged union type

        Δmemory ~= -2.4% ± 0.5%
        Δtime   ~= -1.2% ± 0.2%

BUG=skia:3585

Review URL: https://codereview.chromium.org/1069103003
2015-04-25 06:45:07 -07:00
caryclark
08bc8488fa fix multiple intersection logic
When three or more curves intersect at the same point, ensure that
each curve records the intersections of the others. This fixes a
number of cubic tests.

TBR=reed@google.com
BUG=skia:3588

Review URL: https://codereview.chromium.org/1105943002
2015-04-24 09:08:57 -07:00
caryclark
03b03cad01 working on initial winding for cubics
Path ops works well for all tests except for cubics.
Isolate failures caused by cubics, and do a better job of computing
the initial winding for cubics.

TBR=reed@google.com
BUG=skia:3588

Review URL: https://codereview.chromium.org/1096923003
2015-04-23 09:13:37 -07:00
msarett
4b17fa353e Ensure that we create a NULL codec for images with zero dimensions
BUG=skia:3534
BUG=skia:3257

Review URL: https://codereview.chromium.org/1091043003
2015-04-23 08:53:39 -07:00
mtklein
98b8485a4c O(1) SkPictureUtils::ApproxBytesUsed()
Chrome wants to call this more often, and it's quite slow today.

Seems like this could be clearer if SkPictureUtils::ApproxBytesUsed() were SkPicture::approxBytesUsed().

BUG=chromium:471873

Review URL: https://codereview.chromium.org/1090943004
2015-04-21 15:24:00 -07:00
senorblanco
42a2c1d231 Revert "One more ASAN fix."
This reverts commit 409fd66a5a.

We don't expect to pass this test until the ASAN bots are
correctly configured, and can run GPU tests.

BUG=skia:
TBR=robertphillips@google.com

Review URL: https://codereview.chromium.org/1080393003
2015-04-21 11:13:17 -07:00
senorblanco
409fd66a5a One more ASAN fix.
Don't fail the GL validation check if the GL context fails to create.

TBR=robertphillips@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1096113003
2015-04-21 09:43:08 -07:00
senorblanco
c8e934007a Yet more ASAN fixes.
More nullptr checks for factories I have added.
Other checks more Yoda-like I have made. (Skia style this is.)

BUG=skia:

Review URL: https://codereview.chromium.org/1086393004
2015-04-21 07:20:36 -07:00
senorblanco
84bfd3958f Another speculative ASAN fix.
Add a GrContext nullptr check in SurfaceTest.

TBR=robertphillips@google.com

Review URL: https://codereview.chromium.org/1098993004
2015-04-21 06:59:17 -07:00
mtklein
33d73c39dd SkTHash: remove()
BUG=skia:

Review URL: https://codereview.chromium.org/1057043003
2015-04-21 06:53:56 -07:00
senorblanco
0e95b116fc Speculative fix for ASAN build.
Check for NULL GrContext in TessellatingPathRendererTests.
Also fix an upload nag (no #includes before GPU #ifdef).

TBR=bsalomon@google.com

Review URL: https://codereview.chromium.org/1097943004
2015-04-20 15:00:06 -07:00
caryclark
1049f1246e Now, path ops natively intersect conics, quads, and cubics in any combination. There are still a class of cubic tests that fail and a handful of undiagnosed failures from skps and fuzz tests, but things are much better overall.
Extended tests (150M+) run to completion in release in about 6 minutes; the standard test suite exceeds 100K and finishes in a few seconds on desktops.

TBR=reed
BUG=skia:3588

Review URL: https://codereview.chromium.org/1037953004
2015-04-20 08:31:59 -07:00
halcanary
a8448bc3df PDF: Correctly embed JPEG images directly into PDF output.
We only embed images with YUV planes.  That should only grab the
subset of color JPEGs supported by PDF.

BUG=skia:3180

Review URL: https://codereview.chromium.org/1025773002
2015-04-17 13:27:24 -07:00
reed
ca1a22ee53 Revert of Revert of remove unused (by clients) SkPathUtils (patchset #1 id:1 of https://codereview.chromium.org/1060703003/)
Reason for revert:
fix (removal from gypi/gn files) has landed in chrome.

Original issue's description:
> Revert of remove unused (by clients) SkPathUtils (patchset #1 id:1 of https://codereview.chromium.org/1088383003/)
>
> Reason for revert:
> This change is causing the DEPS roll to fail:
>
>
> http://build.chromium.org/p/tryserver.chromium.linux/builders/android_chromium_gn_compile_rel/builds/78771/steps/gn/logs/stdio
>
> Original issue's description:
> > remove unused (by clients) SkPathUtils
> >
> > BUG=skia:
> >
> > Committed: https://skia.googlesource.com/skia/+/aab35d91b8b80acd1902594bbf542083fdfa4bb7
>
> TBR=scroggo@google.com,reed@chromium.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/bdb0bf5f8858043878d8a4fa8130c6c87bef3fd4

TBR=scroggo@google.com,jcgregorio@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1091963002
2015-04-16 20:10:55 -07:00