Commit Graph

25875 Commits

Author SHA1 Message Date
Mike Klein
ef6bbbd063 monobench: don't sort the Bench vector while iterating through it...
We sort to display Bench results in an ascending order, but we're doing this while iterating through the bench vector.  This is probably undefined, and really screws up the sample distribution in practice.  Slow benches run more often.

Instead, copy the results of the benches to a new Result vector to sort and display.  Each bench now gets its fair share of samples.

Change-Id: I4ead0d9d69af271c9971eedb35604a4b3bca0784
Reviewed-on: https://skia-review.googlesource.com/6623
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-01-05 20:00:26 +00:00
Mike Klein
7c6bc4616c monobench: shuffle benchmark order between samples
I had the thought that going through each bench in the same order is a bias we can avoid, however slight.

Change-Id: I2ef1a6f57c4d121883250d65ea2e98ebe834925d
Reviewed-on: https://skia-review.googlesource.com/6622
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-01-05 19:42:09 +00:00
Brian Salomon
f09492bb42 Rename batch->op in GrAuditTrail json and skiaserver's url handlers
Requires Infra change https://skia-review.googlesource.com/c/6397/

Change-Id: Ic04ea07a0450a99b291f1bc06d4a501d86f65f51
Reviewed-on: https://skia-review.googlesource.com/6398
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-01-05 19:30:27 +00:00
Mike Klein
7d92103f9e GN: add skia_android_serial and push_$foo targets when it's set
E.g.
    $ ninja -C out push_dm

By default (ninja -C out) everything is built and pushed if skia_android_serial
is set.  Dependencies are tracked, so incremental builds push only executables
that have changed.

Change-Id: I586d81791f5f877b173cf61ed68fa9aab96234d2
Reviewed-on: https://skia-review.googlesource.com/6616
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-01-05 19:04:30 +00:00
Mike Klein
90798529a0 clamp to 1.0f in sk_linear_to_srgb_needs_round()
It's awkward today that it can go a little over 1.0f.
This is already slow, so a clamp won't slow it signficantly.

Change-Id: I9f882804e3ee949d72b7a05ad2cbac51731f6311
Reviewed-on: https://skia-review.googlesource.com/6617
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-01-05 18:56:22 +00:00
Jim Van Verth
d63c10225c Minor fixes for the Linux viewer
BUG=skia:6091

Change-Id: Ia954c16610634e34f10bfe4273efc6677ca9563e
Reviewed-on: https://skia-review.googlesource.com/6618
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-01-05 18:51:47 +00:00
Cary Clark
d4631986e6 ignore max curvature at end point
When a stroked cubic folds back on itself, the
stroker draws a round join.
If the max curvature is at
the endpoint, skip the join.

R=reed@google.com
BUG=skia:6083

Change-Id: I45e429432fcec311fa1115058515639370fe9a16
Reviewed-on: https://skia-review.googlesource.com/6606
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
2017-01-05 18:44:25 +00:00
Brian Osman
efcc41805b Explicitly fail read/writePixels in invalid color space scenarios
It's not well defined what to do when moving from a nullptr color space to
a tagged destination (drawing, reading, writing, etc...). In these
scenarios, at least, we can choose to disallow the operation (rather than
produce an unexpected or inconsistent result).

BUG=skia:

Change-Id: I033b23c6f2bb00664efc8fdab1b3f52053d77695
Reviewed-on: https://skia-review.googlesource.com/6600
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
2017-01-05 18:07:55 +00:00
Florin Malita
08d57e6ae6 Remove SK_SUPPORT_LEGACY_EVAL_CUBIC-guarded code
To land after http://crrev.com/2610923004.

R=caryclark@google.com

Change-Id: I0a748801be06530f98009e977e816c90f1ef5934
Reviewed-on: https://skia-review.googlesource.com/6611
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2017-01-05 17:38:45 +00:00
Brian Salomon
4d5e65d19a Use nullptr to indicate C locale when using xlocale
BUG=chromium:666228

Change-Id: I951102eba2b79ddaa5eb134834471a4a3ec8aed7
Reviewed-on: https://skia-review.googlesource.com/6603
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-01-05 17:26:43 +00:00
Derek Sollenberger
70120c778a Add tools to support gdb and simpleperf for android executables.
Change-Id: I6e7f41df094ae037538ebd61e40385d7e2e9eb26
Reviewed-on: https://skia-review.googlesource.com/6615
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-01-05 17:16:01 +00:00
Ben Wagner
a9e3266a21 Remove Perf-Android-Clang-NexusPlayer-CPU-Moorefield-x86-Release-Android.
BUG=skia:6095

Change-Id: I037aa94b23f22a4a7976b3acaacf25e21464d0f4
Reviewed-on: https://skia-review.googlesource.com/6614
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
2017-01-05 17:07:04 +00:00
Mike Klein
e6682eb88c GN: add test_app template
This template encapsulates two common features of our test apps:
  - they set testonly, marking them as safe to use testonly libraries
  - they may want instead to be libapp.so on Android.

I plan to follow up to make test_apps push themselves to an Android device when a new argument android_serial is set.

Change-Id: I010d219c14ff6d0cd6a543dd56fd471a67ddb6f1
Reviewed-on: https://skia-review.googlesource.com/6608
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-01-05 16:46:17 +00:00
Matt Sarett
ac1f09d53b Delete SkMakeImageFromPixelRef
There are no callers.

BUG=skia:

Change-Id: Ie743fc61cc0a0ca755d4e3fdab8a5985fa35fbd3
Reviewed-on: https://skia-review.googlesource.com/6598
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-01-05 16:33:21 +00:00
Mike Klein
56770752c2 -Fast bot upgrades
- GCC -> Clang;
  - Add a Perf bot.

This -Fast mode is a stand-in for "how clients should/do really release code".  Today everyone uses Clang, so we should probably switch this bot too.

I also got interested in how it compares in performance to our ordinary Release build, so I've added a Perf bot.

I did try turning on link-time optimization (much slower build, somewhat faster binary), but that failed at the link step.  Going to save that for later.

CQ_INCLUDE_TRYBOTS=skia.primary:Build-Ubuntu-Clang-x86_64-Release-Fast,Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Release-Fast,Perf-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Release-Fast


Change-Id: I58e6109f8a89799d80e769316902549131b619cf
Reviewed-on: https://skia-review.googlesource.com/6595
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-01-05 15:23:52 +00:00
Derek Sollenberger
c65386ae55 Remove DMSrcSinkAndroid.
This code involves Skia having knowledge of HWUI internals and
causes problems with various build systems.  It is also not
currently being used and is therefore expendable.

Change-Id: I7b6a37fa4c9afcefbc6a957b49e7735da872ff14
Reviewed-on: https://skia-review.googlesource.com/6597
Commit-Queue: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2017-01-05 15:20:21 +00:00
Ben Wagner
d4e75e24a7 Omit GPUMemoryTest for GTX1070 Windows Vulkan.
BUG=skia:6092

Change-Id: I820a2da22a1d852091c6a3416e11f90d6f644bc6
Reviewed-on: https://skia-review.googlesource.com/6586
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
2017-01-05 00:00:56 +00:00
Matt Sarett
26a0543579 Merge SkColorSpaceXform_XYZ and SkColorSpaceXform_Pipeline
Use the pipeline implementation to handle F32.

This refactor has been broken away from the following mega-CL.
https://skia-review.googlesource.com/c/6260/

Change-Id: I79d8992f8c4a7e4dbf674a78484057a6b7f4f123
Reviewed-on: https://skia-review.googlesource.com/6585
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-01-04 23:12:58 +00:00
Matt Sarett
d3ed402617 Disable clang -Wsigned-enum-bitfield warnings
Full error text:
error: enums in the Microsoft ABI are signed integers by default;
consider giving the enum Properties an unsigned underlying type
to make this code portable [-Werror,-Wsigned-enum-bitfield]

BUG=skia:

Change-Id: I1491dd94c894e383fed401880fc04562140f7a66
Reviewed-on: https://skia-review.googlesource.com/6594
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-01-04 22:46:38 +00:00
Mike Reed
68dd8d0e08 add writePixels to SkBitmap
BUG=skia:

Change-Id: I6f4db9ddc0364d9785e0f1794d86b73e66845ea9
Reviewed-on: https://skia-review.googlesource.com/6593
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2017-01-04 22:05:27 +00:00
Stephen White
bf6137e08b Modify GrTessellator to use a VertexList where possible.
Prefer VertexList to a bare Vertex*. Also fix some 100-col issues.

This should have no user-visible impact.

Change-Id: I8fa260d5417c9832256529c232f532e69238fca0
Reviewed-on: https://skia-review.googlesource.com/6502
Commit-Queue: Stephan White <senorblanco@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-01-04 21:30:03 +00:00
Mike Klein
464e6a1b5a Retry trim another instruction off SkRasterPipeline overhead
This time, with manual program memory management instead of std::vector<void*>.

Using STL types from SkOpts_hsw.cpp is not safe.  Things like std::vector<void*>
are inlined but not anonymous, so they're deduped by the linker arbitrarily.  This
is bad when we pick the version compiled with AVX instructions on a machine that
doesn't support AVX...

std::vector<Stage> was safe before because Stage itself was anonymous.  While not anonymous, std::vector<Stage> is unique to the compilation unit, because you can only refer to the anonymous Stage in the compilation unit.

CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_chromium_asan_rel_ng;skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD


Change-Id: I015e27583b6b6ff06b5e9f63e3f40ee6b27d6dbd
Reviewed-on: https://skia-review.googlesource.com/6550
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-01-04 20:58:21 +00:00
Brian Osman
07792b218e Add context markup to integer texture test
Trying to get better information about what's failing (and make this
easier in the future).

BUG=skia:6086

Change-Id: Iedb1269abb4527170b919bd90bce625a7f78f05a
Reviewed-on: https://skia-review.googlesource.com/6584
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-01-04 19:42:50 +00:00
Derek Sollenberger
dc71e152ef Update Android Apps to work with GN.
This also includes the removal of an old example whose instructions
are not compatible with GN.

BUG=skia:6009

Change-Id: I2807829ca12c19292ae0f5a7ea250ed453f9a182
Reviewed-on: https://skia-review.googlesource.com/5620
Commit-Queue: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-01-04 19:38:34 +00:00
Brian Salomon
bfd5183b9e Removes tracking of whether color is ignored by XP.
Removes the feedback to GrDrawOp via GrPipelineOptimizations.

Change-Id: I3cb17cad41779af292a92385fcd5ac23ae5a1ffd
Reviewed-on: https://skia-review.googlesource.com/6561
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-01-04 19:23:05 +00:00
Brian Osman
0bd783f951 Clamp premul colors correctly after a gamut change
Textures that we sample on the GPU are always premul, so we should
actually clamp to alpha.

Colors that are xformed on the CPU are always unpremul, so clamping to
[0,1] is correct. Add a comment explaining that.

BUG=skia:

Change-Id: I180f2d410f24afc78bd03ab8636a83fb443d68e2
Reviewed-on: https://skia-review.googlesource.com/6581
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-01-04 18:28:26 +00:00
Matt Sarett
e151bdb357 Fix color space matrix hashing to avoid hashing the typemask
BUG=skia:

Change-Id: I8d4594fcf0eeebf598871bfe9203ed52460c98ce
Reviewed-on: https://skia-review.googlesource.com/6558
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-01-04 16:45:05 +00:00
Brian Salomon
8c852be264 Removing tracking of whether GP/FP coverage calculations are used by XP.
Remove readsCoverage from GrPipelineOptimizations

Remove kNone from GrDefaultGeoProc::Coverage

Remove kIgnoreCoverage from GrXferProcessor::OptFlags

Remove GrPipeline::fIgnoresCoverage

Change-Id: I8f0c9337ee98b9c77af1e9a8a184519ce63822d4
Reviewed-on: https://skia-review.googlesource.com/6552
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2017-01-04 16:37:18 +00:00
Matt Sarett
1e854246e6 Improve detection of color space transfer fns
BUG=skia:

Change-Id: I744af0efd4d48a8932b834092ed2dbad13008c1d
Reviewed-on: https://skia-review.googlesource.com/6556
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-01-04 16:26:58 +00:00
Mike Klein
e2b66a769b auto-generate _d stages
Stage foo_d should always be the same logic as stage foo swapping r and dr, g
and dg, b and db, a and da.  This means we can infer their definitions.

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD

Change-Id: Ia0a3abb29a201c647d9ec1860211abfbc19b56ae
Reviewed-on: https://skia-review.googlesource.com/6555
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-01-04 15:59:59 +00:00
Ethan Nicholas
2be687af58 fix skslc crash when ternary parameter types don't match
BUG=skia:5968

Change-Id: I541c7925ac83e830bd53015961312810042046c5
Reviewed-on: https://skia-review.googlesource.com/6545
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-01-04 15:25:42 +00:00
Matt Sarett
5dfb4e45ef Use shared toSRGBD50 matrix in SkPngCodec
BUG=skia:

Change-Id: I1d2629ef954d8ac7211cfbb4707125ed175af63c
Reviewed-on: https://skia-review.googlesource.com/6553
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>
2017-01-04 15:23:16 +00:00
Ben Wagner
3546ff10c2 Stage SkFontMgr factories to return smart pointers.
All the SkFontMgr factories currently return bare pointers and sometimes
even document the ownership rules. Since such factories can be
implemented by external ports, the ownership rules should be explicit in
order to prevent simple reference counting issues.

Change-Id: I25b598ce0954cd473a3fb1f8adc0cb86331583ca
Reviewed-on: https://skia-review.googlesource.com/6533
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-01-04 14:51:09 +00:00
Mike Klein
8bc9f7b328 Remove SkImageShader -> SkColorShader optimization.
It's turned out to be surprisingly subtle to make the optimization colorspace
correct (it's not today, but with this CL the affected images become colorspace
correct).

Before implementing a colorspace correct color shader, let's check we really need this.

Update: I should say, it's hard to do this optimization and make the resulting color shader be both colorspace correct and "legacy correct".  SkColorShader and SkColor4fShader are both colorspace correct.  It's just challenging to create one shader that's correct for both modes from an image.

Change-Id: I6593b6348175a10d7cbaaf3b531d7a7e2bf2f578
Reviewed-on: https://skia-review.googlesource.com/6548
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-01-04 13:59:01 +00:00
Fredrik Söderquist
b60e8645ec Scale the result of TightBounds when path was inverse-scaled
When the path was "large" (as defined by ScaleFactor(...)), the computed
bounds would not be adjusted to the correct space. Make sure to scale
the result in those cases.

BUG=chromium:678162

Change-Id: Ia2eb94050c4620286e9abb69976dbc0202ecc307
Reviewed-on: https://skia-review.googlesource.com/6501
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
2017-01-04 13:47:24 +00:00
Cary Clark
6711638436 fix fuzz
R=kjlubick@google.com
BUG=skia:6084

Change-Id: I5978805c8d9048e399d83a13173c6a776cabe8ac
Reviewed-on: https://skia-review.googlesource.com/6544
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
2017-01-04 13:21:09 +00:00
Mike Klein
9ea894b4d0 Revert "trim another instruction off SkRasterPipeline overhead"
This reverts commit e61c40707e.

Reason for revert: this and the ODR caused operations on ContiguousContainerBase::elements_, another std::vector<void*> in Chrome, to start using AVX2 instructions.  Boy this is annoying...

Change-Id: I2c4837ad70fdef8096db904022b0703b88c6fd6c
Reviewed-on: https://skia-review.googlesource.com/6549
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-01-04 00:32:29 +00:00
Ben Wagner
e6b274e402 Specify "/utf-8" with Visual C++.
This sets the source and executable character set to utf-8. This avoids
issues with local code pages and avoids adding an unwanted BOM.

Change-Id: If854c0001c2363f3262d20e28dce30c1e733536a
Reviewed-on: https://skia-review.googlesource.com/6547
Commit-Queue: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-01-03 22:45:03 +00:00
Stephen White
2f4686fa25 Quality and performance fixes for AA tessellating path renderer.
Use quads rather than triangles for the edge geometry. This allows
us to perform a simpler edge categorization (see below). It also
improves performance by reducing the number of edges processed during
the simplify and tessellate steps.

Label AA edges as three types: inner, outer, and connector. This
results in correct alpha values for intersected edges, even when
the top or bottom vertex has been merged with a vertex on edges
of different types.

Changed the "collinear edges" sample from the concavepaths GM for a
"fast-foward" shape, which more clearly shows the problem being fixed
here. (The collinearity from the "collinear edges" was actually being
removed earlier up the stack, causing the path to become convex and
not exercise the concave path renderers anyway.)

NOTE: this will cause changes in the "concavepaths" GM results, and
minor pixel diffs in a number of other tests.

Change-Id: I6c2b0cdb35cda42b01cf1100621271fef5be35b0
Reviewed-on: https://skia-review.googlesource.com/6430
Reviewed-by: Stephan White <senorblanco@chromium.org>
Commit-Queue: Stephan White <senorblanco@chromium.org>
2017-01-03 22:01:19 +00:00
Stephan White
021f927e4c Revert "Quality and performance fixes for AA tessellating path renderer."
This reverts commit d4b2155248.

Reason for revert: accidentally added some unwanted changes

Original change's description:
> Quality and performance fixes for AA tessellating path renderer.
> 
> Use quads rather than triangles for the edge geometry. This allows
> us to perform a simpler edge categorization (see below). It also
> improves performance by reducing the number of edges processed during
> the simplify and tessellate steps.
> 
> Label AA edges as three types: inner, outer, and connector. This
> results in correct alpha values for intersected edges, even when
> the top or bottom vertex has been merged with a vertex on edges
> of different types.
> 
> Changed the "collinear edges" sample from the concavepaths GM for a
> "fast-foward" shape, which more clearly shows the problem being fixed
> here. (The collinearity from the "collinear edges" was actually being
> removed earlier up the stack, causing the path to become convex and
> not exercise the concave path renderers anyway.)
> 
> NOTE: this will cause changes in the "concavepaths" GM results, and
> minor pixel diffs in a number of other tests.
> 
> BUG=660893
> 
> Change-Id: Ide49374d6d173404c7223f7316dd439df1435787
> Reviewed-on: https://skia-review.googlesource.com/6427
> Commit-Queue: Stephan White <senorblanco@chromium.org>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> 

TBR=bsalomon@google.com,senorblanco@chromium.org,reviews@skia.org
BUG=660893
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I06a36e397645bfc42442a5a9e7c27328f6048ab9
Reviewed-on: https://skia-review.googlesource.com/6428
Commit-Queue: Stephan White <senorblanco@chromium.org>
Reviewed-by: Stephan White <senorblanco@chromium.org>
2017-01-03 21:06:30 +00:00
Stephen White
d4b2155248 Quality and performance fixes for AA tessellating path renderer.
Use quads rather than triangles for the edge geometry. This allows
us to perform a simpler edge categorization (see below). It also
improves performance by reducing the number of edges processed during
the simplify and tessellate steps.

Label AA edges as three types: inner, outer, and connector. This
results in correct alpha values for intersected edges, even when
the top or bottom vertex has been merged with a vertex on edges
of different types.

Changed the "collinear edges" sample from the concavepaths GM for a
"fast-foward" shape, which more clearly shows the problem being fixed
here. (The collinearity from the "collinear edges" was actually being
removed earlier up the stack, causing the path to become convex and
not exercise the concave path renderers anyway.)

NOTE: this will cause changes in the "concavepaths" GM results, and
minor pixel diffs in a number of other tests.

BUG=660893

Change-Id: Ide49374d6d173404c7223f7316dd439df1435787
Reviewed-on: https://skia-review.googlesource.com/6427
Commit-Queue: Stephan White <senorblanco@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-01-03 21:01:58 +00:00
Ethan Nicholas
9a5610e35d fixed a divide-by-zero bug in skslc
BUG=skia:5960

Change-Id: I8ace6efefd14b11c3bc2448a1ab4e3353a29075f
Reviewed-on: https://skia-review.googlesource.com/6539
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-01-03 20:55:20 +00:00
Ethan Nicholas
87f340e52a switched GrVkPipelineStateCache over to use SkLRUCache
BUG=skia:

Change-Id: I04301313132df170a16995b4830b13ffbddbed3b
Reviewed-on: https://skia-review.googlesource.com/6469
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-01-03 20:14:02 +00:00
Herb Derby
428dfe01fc Fix: when pos is not finite, text pointer not advanced.
This fixes a problem introduced by change https://skia-review.googlesource.com/6404.

BUG=skia:6076

Change-Id: Iabf05c40284700dc32431f92df5ba5fcdb6cac1d
Reviewed-on: https://skia-review.googlesource.com/6534
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2017-01-03 19:51:03 +00:00
Mike Reed
e3374d6893 validate deserialized path verbs
BUG=676755

Change-Id: Ie9bd70d3a130c53737756587f73c9dce4a6bcb6d
Reviewed-on: https://skia-review.googlesource.com/6529
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
2017-01-03 19:31:26 +00:00
Leon Scroggins III
b0b625b796 GIF: Better check for frame dependency
If a frame does not have a valid transparent index and it covers the
prior frame, it does not really depend on that frame. Instead, it
depends on the frame that the prior frame depends on.

Determine this once we have parsed the local color map (if any), so a
transparent index out of range of the color map is not considered
valid.

Share code that determines whether a frame has a transparent pixel.

Add a test that we compute the dependencies correctly. randPixelsAnim.gif
has 13 frames. After the first, the frames cover all combinations of

- Whether the prior frame was keep, restoreBG or restoreToPrevious
- Whether the new frame covers the prior frame
- Whether the new frame has a transparent pixel

(It only does so when using a global color table. It may make sense to
expand the test to also cover using local color tables.)

The test caught a bug where we incorrectly reused an existing
SkColorTable for a different frame. Fix that bug by keeping track of
the transparent index associated with the current SkColorTable.

Change-Id: I3cf6be7f612990fa7a00d9e74d116d31bd227526
Reviewed-on: https://skia-review.googlesource.com/6402
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2017-01-03 19:07:41 +00:00
Ethan Nicholas
e337b18560 Force classic locale when parsing floats in skslc.
atof is locale dependent, which can lead to bugs when a decimal separator is something other than a dot.

BUG=skia:

Change-Id: I6f161d686ddea86ce9968e46b632bc79a99ef656
Reviewed-on: https://skia-review.googlesource.com/6532
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-01-03 18:58:45 +00:00
Ethan Nicholas
613a697ed1 fix for Vulkan SPIR-V crash on some systems
BUG=skia:

Change-Id: I56113409901fcee7f6523e11b3f5721822830159
Reviewed-on: https://skia-review.googlesource.com/6490
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-01-03 18:19:57 +00:00
Mike Klein
e61c40707e trim another instruction off SkRasterPipeline overhead
The overhead of a stage today is 3 x86 instructions, typically looking something like this:
   - movq (%rdi), %rax  // Load the next stage function pointer.
   - addq $0x10, %rdi   // Step our progress ahead 16 bytes to that next stage.
   - jmpq *%rax         // Transfer control to that stage.

But if we make sure the pointer's in esi/rsi, we can use lodsd/lodsq to do those first two steps in one instruction:
   - lodsq (%rsi), %rax    (≈ movq (%rdi), %rax; addq $0x8, %rsi).
   - jmpq *%rax

This CL rearranges things so that we can take advantage of this and generally trim off an instruction of overhead.  Instead of a vector of {Fn, ctx} pairs, we'll flatten it down into a single interlaced program vector of void*, basically just ommitting any null context pointers.  We pass the pointer to program as the second argument to Fn, putting it in rsi.  These two changes together make getting the next Fn to call or the current context the same cheap lodsq instruction, encapsulated as load_and_increment().

Here's how the simple "modulate" blend stage changes:

    vmulps  %ymm4, %ymm0, %ymm0
    vmulps  %ymm5, %ymm1, %ymm1
    vmulps  %ymm6, %ymm2, %ymm2
    vmulps  %ymm7, %ymm3, %ymm3
    movq    (%rdi), %rax
    addq    $0x10, %rdi
    jmpq    *%rax

    ~~~~~~~~>

    vmulps  %ymm4, %ymm0, %ymm0
    vmulps  %ymm5, %ymm1, %ymm1
    vmulps  %ymm6, %ymm2, %ymm2
    vmulps  %ymm7, %ymm3, %ymm3
    lodsq   (%rsi), %rax
    jmpq    *%rax

This does make getting the current context a one-time, destructive operation. It's switched from referring to ctx as a void* directly to using ctx() as a thunk that returns a void*.  No stage so far has ever referred to ctx twice, and it all appears to inline, so this seems harmless.  "matrix_2x3" is a good example of what stages that use context pointers end up looking like:

    lodsq   (%rsi), %rax
    vbroadcastss    (%rax), %ymm9
    vbroadcastss    0x8(%rax), %ymm10
    vbroadcastss    0x10(%rax), %ymm8
    vfmadd231ps     %ymm10, %ymm1, %ymm8
    vfmadd231ps     %ymm9, %ymm0, %ymm8
    vbroadcastss    0x4(%rax), %ymm10
    vbroadcastss    0xc(%rax), %ymm11
    vbroadcastss    0x14(%rax), %ymm9
    vfmadd231ps     %ymm11, %ymm1, %ymm9
    vfmadd231ps     %ymm10, %ymm0, %ymm9
    lodsq   (%rsi), %rax
    vmovaps %ymm8, %ymm0
    vmovaps %ymm9, %ymm1
    jmpq    *%rax

We can't do this with MSVC, as there's no intrinsic for it I can find, and they disallow inline assembly, and rsi is not used to pass arguments to functions there anyway.  ARM doesn't need it... it does this in two instructions naturally anyway.  We could do this for 32-bit x86 but I'd just rather focus on x86-64.

It's unclear to me that this makes things any faster, but doesn't appear to make things any slower, and makes I think both the code and disassembly simpler.

CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD

Change-Id: Ia7b543a6718c75a33095371924003c5402b3445a
Reviewed-on: https://skia-review.googlesource.com/6271
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-01-03 18:13:21 +00:00
Brian Salomon
7551898f8e Make C API compatible with -Wstrict-prototypes
Change-Id: I265605e769a12a319d672c491c9ba2d89c02de7e
Reviewed-on: https://skia-review.googlesource.com/6477
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-01-03 17:38:35 +00:00