Commit Graph

17272 Commits

Author SHA1 Message Date
mtklein
61221e7f87 Convert Color32 code to perfect blend.
Before we commit to blend_256_round_alt, let's make sure blend_perfect is
really slower in practice (i.e. regresses on perf.skia.org).

blend_perfect is really the most desirable algorithm if we can afford it.  Not
only is it correct, but it's easy to think about and break into correct pieces:
for instance, its div255() doesn't require any coordination with the multiply.

This looks like a 30% hit according to microbenches.  That said, microbenches
said my previous change would be a 20-25% perf improvement, but it didn't end
up showing a significant effect at a high level.

As for correctness, I see a bunch of off-by-1 compared to blend_256_round_alt
(exactly what we'd expect), and one off-by-3 in a GM that looks like it has a
bunch of overdraw.

BUG=skia:

Review URL: https://codereview.chromium.org/1098913002
2015-04-20 10:52:26 -07:00
reed
4912437891 adjust GM to have a final opaque bg, to make it easier to triage
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1085333003
2015-04-20 09:10:31 -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
reed
5c476fb277 apply xfermode after imagefilter when we create a tmp layer
BUG=skia:3741

Review URL: https://codereview.chromium.org/1091173003
2015-04-20 08:04:21 -07:00
reed
7e4186acce add GM to test imagefilters + xfermodes
draws incorrectly as is, but will be fixed by https://codereview.chromium.org/1091173003

BUG=skia:3741

Review URL: https://codereview.chromium.org/1088773004
2015-04-20 07:27:15 -07:00
scroggo
29ccd898d1 Update our libjpeg to the version used by Chromium.
We had previously not updated since 2013. This includes the fix
for http://seclists.org/fulldisclosure/2013/Nov/83

BUG=skia:3744

Review URL: https://codereview.chromium.org/1097943002
2015-04-20 06:58:49 -07:00
senorblanco
6d88bdb6f1 Fix point count computation in tessellating path renderer.
The conic, quadratic and cubic computations were using tolerance^2
instead of tolerance when computing maximum point count, causing paths
to be undertessellated when magnifying and overtessellated when minifying.

(Funny story: this bug went unnoticed back when we were tessellating
paths in screen space, when tolerance and its square were both 1.)

BUG=skia:3731

Review URL: https://codereview.chromium.org/1095773003
2015-04-20 05:41:48 -07:00
reed
a8ec4805db remove dead code from SK_SUPPORT_LEGACY_BLITANTIH2V2
no image changes expected in skia or chrome/blink

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1050953003
2015-04-20 05:18:01 -07:00
skia.buildbots
d13444acf2 Update SKP version
Automatic commit by the RecreateSKPs bot.

TBR=

Review URL: https://codereview.chromium.org/1095953002
2015-04-19 01:15:08 -07:00
mtklein
f3f9440372 Revert of Allow NEON on iOS. (patchset #3 id:40001 of https://codereview.chromium.org/1091823002/)
Reason for revert:
need to coordinate this with chrome gyps/gn

Original issue's description:
> Allow NEON on iOS.
>
> I have nanobench building and running (Color32_arm_neon) on my iPad.
>
> No public API changes.
> TBR=reed@google.com
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/e5043b7ea5170a639367b67c986568907576be4b

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

Review URL: https://codereview.chromium.org/1094843005
2015-04-17 14:02:40 -07:00
bungeman
e85a754a4c Respect declared font style on Android.
Previously the normal/italic style bit was obtained from scanning the
font file. With the new format the style may be stated explicitly, and
this explicit value in the configuration file should override any
information obtained from the font data itself.

This change allows the font element's style attribute to override the
font's style, but retains the default 'auto' setting for backwards
compatibility. Repecting the style bit may become more important with
variation fonts, because it will be up to the configuration writer to
determine what values of the 'slnt' variation should be considered
'normal' or 'italic'.

DOCS_PREVIEW= https://skia.org/?cl=1092093002

Committed: https://skia.googlesource.com/skia/+/673e902c9b9982a167f54f1cc175d8d9cab8bcaf

Review URL: https://codereview.chromium.org/1092093002
2015-04-17 13:51:08 -07:00
jcgregorio
21d3ed52e5 Revert of Respect declared font style on Android. (patchset #6 id:100001 of https://codereview.chromium.org/1092093002/)
Reason for revert:
Failed on the compile bots.

Original issue's description:
> Respect declared font style on Android.
>
> Previously the normal/italic style bit was obtained from scanning the
> font file. With the new format the style may be stated explicitly, and
> this explicit value in the configuration file should override any
> information obtained from the font data itself.
>
> This change allows the font element's style attribute to override the
> font's style, but retains the default 'auto' setting for backwards
> compatibility. Repecting the style bit may become more important with
> variation fonts, because it will be up to the configuration writer to
> determine what values of the 'slnt' variation should be considered
> 'normal' or 'italic'.
>
> DOCS_PREVIEW= https://skia.org/?cl=1092093002
>
> Committed: https://skia.googlesource.com/skia/+/673e902c9b9982a167f54f1cc175d8d9cab8bcaf

TBR=mtklein@google.com,tomhudson@google.com,scroggo@google.com,bungeman@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1082173004
2015-04-17 13:30:35 -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
bungeman
673e902c9b Respect declared font style on Android.
Previously the normal/italic style bit was obtained from scanning the
font file. With the new format the style may be stated explicitly, and
this explicit value in the configuration file should override any
information obtained from the font data itself.

This change allows the font element's style attribute to override the
font's style, but retains the default 'auto' setting for backwards
compatibility. Repecting the style bit may become more important with
variation fonts, because it will be up to the configuration writer to
determine what values of the 'slnt' variation should be considered
'normal' or 'italic'.

DOCS_PREVIEW= https://skia.org/?cl=1092093002

Review URL: https://codereview.chromium.org/1092093002
2015-04-17 13:25:03 -07:00
enne
54b666b144 Trace contention for lockPixels mutex
Review URL: https://codereview.chromium.org/1090103002
2015-04-17 12:42:49 -07:00
mtklein
afe2ffb8ba Rework SSE and NEON Color32 algorithms to be more correct and faster.
This algorithm changes the blend math, guarded by SK_LEGACY_COLOR32_MATH.  The new math is more correct: it's never off by more than 1, and correct in all the interesting 0x00 and 0xFF edge cases, where the old math was never off by more than 2, and not always correct on the edges.

If you look at tests/BlendTest.cpp, the old code was using the `blend_256_plus1_trunc` algorithm, while the new code uses `blend_256_round_alt`.  Neither uses `blend_perfect`, which is about ~35% slower than `blend_256_round_alt`.

This will require an unfathomable number of rebaselines, first to Skia, then to Blink when I remove the guard.

I plan to follow up with some integer SIMD abstractions that can unify these two implementations into a single algorithm.  This was originally what I was working on here, but the correctness gains seem to be quite compelling.  The only places these two algorithms really differ greatly now is the kernel function, and even there they can really both be expressed abstractly as:
  - multiply 8-bits and 8-bits producing 16-bits
  - add 16-bits to 16-bits, returning the top 8 bits.
All the constants are the same, except SSE is a little faster to keep 8 16-bit inverse alphas, NEON's a little faster to keep 8 8-bit inverse alphas.  I may need to take this small speed win back to unify the two.

We should expect a ~25% speedup on Intel (mostly from unrolling to 8 pixels) and a ~20% speedup on ARM (mostly from using vaddhn to add `color`, round, and narrow back down to 8-bit all into one instruction.

(I am probably missing several more related bugs here.)
BUG=skia:3738,skia:420,chromium:111470

Review URL: https://codereview.chromium.org/1092433002
2015-04-17 11:00:55 -07:00
bungeman
9d911d5a93 Remove filename from SkFontDescriptor.
No one actually uses it, so remove it. Keep the string id for backward
compatibility.

TBR=reed@google.com
This doesn't change any public API.

Review URL: https://codereview.chromium.org/1057413005
2015-04-17 11:00:06 -07:00
joshualitt
fec19e1751 Small change to allow DistanceField and BMP text to coexist in a blob
BUG=skia:

Review URL: https://codereview.chromium.org/1096753002
2015-04-17 10:32:32 -07:00
bungeman
f4fddfc300 Correct SkFixedToDouble.
SkFixedToDouble uses the decimal floating point string representation
of 1/(2^16) to provide a constant value. This value is exactly
representable by a double but the decimal constant currently used
does not map to this value.

This change modifies this constant to more decimal digits so that
the actual double value desired is created.

Review URL: https://codereview.chromium.org/1097473002
2015-04-17 10:05:43 -07:00
joshualitt
9bd2daff8e Initial CL to add distance field support to GrAtlasTextContext
BUG=skia:

Review URL: https://codereview.chromium.org/1082843002
2015-04-17 09:30:07 -07:00
joshualitt
523ed6c0c1 adding new gm to rotate, translate, and scale textblobs
this is to test distance field caching and regen of texture blobs on scale.

BUG=skia:

Review URL: https://codereview.chromium.org/1097563002
2015-04-17 09:01:05 -07:00
mtklein
e5043b7ea5 Allow NEON on iOS.
I have nanobench building and running (Color32_arm_neon) on my iPad.

No public API changes.
TBR=reed@google.com

BUG=skia:

Review URL: https://codereview.chromium.org/1091823002
2015-04-17 06:36:53 -07:00
mtklein
4afe21e864 add a GM to demo the blend bug
BUG=skia:3739

Review URL: https://codereview.chromium.org/1094863003
2015-04-17 06:32:13 -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
bungeman
d803cdad72 Add PS 'all' weight name to scanFont.
Multiple Master fonts often list their weight as 'all'. However, they
usually default to normal weight. State explicitly that we know about
this weight string.

Review URL: https://codereview.chromium.org/1092793002
2015-04-16 14:22:46 -07:00
mtklein
ea6075e3ea Default iOS builds to our code signing identity.
It's super tedious to keep setting it every time I rerun ./gyp_skia.
Doesn't look like it'll bother the bots.

BUG=skia:

Review URL: https://codereview.chromium.org/1053493005
2015-04-16 13:29:59 -07:00
tfarina
1df3325345 contrib: Simplify the command to create a feature branch.
You can create a work branch off origin/master by simply running:

$ git checkout -b my-feature origin/master

BUG=None
R=borenet@google.com
NOTRY=true
DOCS_PREVIEW= https://skia.org/?cl=1057513004

Review URL: https://codereview.chromium.org/1057513004
2015-04-16 13:28:06 -07:00
mtklein
a863e41d7f This section is moot: we divert ios to opts_none above.
(We never set arm_version = 7 for iOS...)

CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Mac10.7-Clang-Arm7-Debug-iOS-Trybot

BUG=skia:

Review URL: https://codereview.chromium.org/1092753002
2015-04-16 12:45:38 -07:00
bungeman
fd0ecf46ce Add SkTPin.
Currently there exist SkScalarPin and SkPin32, and in a future change
another version is desired. This change introduces SkTPin and changes
SkScalarPin and SkPin32 to use it.

Review URL: https://codereview.chromium.org/1090003002
2015-04-16 12:18:28 -07:00
senorblanco
5b9f42c4d1 Improve tessellating path rasterizer performance on dashed paths.
With dashed paths, we get a lot of geometry on the same sort line.
Since the vertices are sorted, it makes more sense to insert edges
from the end (in sort order) than the beginning. This requires
maintaining both the head and tail of the active edge list.

This gives a ~20% perf improvement on tabl_digg.skp.

BUG=skia:3733

Review URL: https://codereview.chromium.org/1089903002
2015-04-16 11:47:18 -07:00
joshualitt
26ffc00bfa add textblob cache freeall
BUG=skia:

Review URL: https://codereview.chromium.org/1088683004
2015-04-16 11:24:04 -07:00
egdaniel
8dc7c3a839 Rename GrStencilBuffer to GrStencilAttachment
BUG=skia:

Review URL: https://codereview.chromium.org/1083133002
2015-04-16 11:22:42 -07:00
zoran.jovanovic
9c798207b7 SkScaledBitmapSampler: fix memory overwritten
Memory will be overwritten while downsampling some
interlaced gif images, most commonly with odd sizes,
when index of destination row stores in the current
line computed from GifInterlaceIter meets:

 X is an integer in [0..height-1]
   and
 (X < height)
 && ((X - sampleSize/2) % sampleSize == 0)
 && ((X - sampleSize/2)/sampleSize >= height/sampleSize)

Signed-off-by: Lu Tong <lu.x.tong@sonymobile.com>

BUG=skia:

Review URL: https://codereview.chromium.org/1085253002
2015-04-16 11:03:16 -07:00
cdalton
72badbd99e Add ReverseIter to GrTRecorder
BUG=skia:

Review URL: https://codereview.chromium.org/1035083004
2015-04-16 10:42:49 -07:00
jcgregorio
bdb0bf5f88 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:

Review URL: https://codereview.chromium.org/1060703003
2015-04-16 09:47:36 -07:00
mtklein
6ef68ab2cd Don't serialize anything for SkEmptyShader.
BUG=skia:3735

Review URL: https://codereview.chromium.org/1097433002
2015-04-16 07:59:12 -07:00
Brian Salomon
6318016469 widen output png size of bmp_filter_quality_repeat
BUG=skia:

Review URL: https://codereview.chromium.org/1097443002
2015-04-16 10:46:18 -04:00
bsalomon
8cf1d95487 Add GM that tests bmp filter qualities with repeat mode
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1086203002
2015-04-16 06:54:28 -07:00
reed
aab35d91b8 remove unused (by clients) SkPathUtils
BUG=skia:

Review URL: https://codereview.chromium.org/1088383003
2015-04-16 06:16:38 -07:00
mtklein
f7aaadb570 Zero jpeg_decompress_struct before calling jpeg_calc_output_dimensions().
https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Valgrind/builds/38/steps/dm/logs/stdio

(Must have been https://codereview.chromium.org/1076923002 ?)

BUG=skia:

Review URL: https://codereview.chromium.org/1094603002
2015-04-16 06:09:27 -07:00
reed
0b71278679 remove older version of cubic->coeff
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1084623004
2015-04-15 19:57:54 -07:00
reed
6983f66d8b Speeup hairline curves (quads and cubics) (patchset #7 id:120001 of https://codereview.chromium.org/1078413003/)"
ah ha! Check for the define *after* we pull in SkUserConfig.h (indirectly)

This reverts commit 639a82855b.

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1084283003
2015-04-15 18:23:03 -07:00
reed
a12225bd32 Revert of make blitAntiH2 virtual, to prep for larger change (patchset #1 id:1 of https://codereview.chromium.org/1048323005/)
Reason for revert:
end of test

Original issue's description:
> make blitAntiH2 virtual, to prep for larger change
>
> testing...
>
> BUG=skia:
> TBR=
>
> Committed: https://skia.googlesource.com/skia/+/33afdaa5213cf118b3ca290bb343253c8593756d

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

Review URL: https://codereview.chromium.org/1086293002
2015-04-15 18:05:47 -07:00
reed
33afdaa521 make blitAntiH2 virtual, to prep for larger change
testing...

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1048323005
2015-04-15 17:34:27 -07:00
reed
639a82855b Revert of Speeup hairline curves (quads and cubics) (patchset #7 id:120001 of https://codereview.chromium.org/1078413003/)
Reason for revert:
Crazy failings in chrome tests
http://build.chromium.org/p/client.skia/builders/Linux%20Tests/builds/1862

Original issue's description:
> Speeup hairline curves (quads and cubics)
>
> /skia/trunk> cat ../old.txt
> maxrss	loops	min	median	mean	max	stddev	samples   	config	bench
>    9M	1	4.28ms	4.32ms	4.36ms	4.67ms	3%	▄▁▁▃▂▂▁▁▂█	8888	path_hairline_small_AA_cubic
>    9M	1	743µs	767µs	770µs	825µs	4%	▃▃▇▃▁▁▅▁█▁	8888	path_hairline_small_AA_conic
>    9M	1	533µs	606µs	598µs	680µs	9%	▁▂▂█▆▇▇▄▂▂	8888	path_hairline_small_AA_quad
>    9M	1	451µs	452µs	456µs	495µs	3%	▁▁▁▁█▁▁▁▁▁	8888	path_hairline_small_AA_line
>
> /skia/trunk> cat ../new.txt
> maxrss	loops	min	median	mean	max	stddev	samples   	config	bench
>    9M	1	827µs	827µs	831µs	869µs	2%	▁▁▁▁▁▁▁█▁▁	8888	path_hairline_small_AA_cubic
>    9M	1	515µs	517µs	517µs	518µs	0%	▇█▆▅▃▃▁▁▁▅	8888	path_hairline_small_AA_conic
>    9M	1	310µs	311µs	315µs	332µs	2%	▂▁█▆▁▁▁▁▁▁	8888	path_hairline_small_AA_quad
>    9M	1	254µs	254µs	258µs	276µs	3%	▁▁▁▁▁▁▁█▇▂	8888	path_hairline_small_AA_line
>
> Edited revert of https://codereview.chromium.org/1085013003
>
> TBR=
>
> Expectations:
> - no effect on chrome, as it is guarded
> - lots of tiny rebaselines for skia

TBR=
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1092483003
2015-04-15 14:38:09 -07:00
bsalomon
bed83a66f5 Don't draw if SkShader::asNewFragmentProcessor fails.
BUG=chromium:473156

Review URL: https://codereview.chromium.org/1089063002
2015-04-15 14:18:34 -07:00
jvanverth
bc0273524b Fix LCD text and add path fix for Mali.
dFdy(st.y) produces negative values, so we need to take
abs() to get the right inverse scale.

BUG=skia:3528

Review URL: https://codereview.chromium.org/1086183002
2015-04-15 13:41:31 -07:00
reed
a0246165ea Speeup hairline curves (quads and cubics)
/skia/trunk> cat ../old.txt
maxrss	loops	min	median	mean	max	stddev	samples   	config	bench
   9M	1	4.28ms	4.32ms	4.36ms	4.67ms	3%	▄▁▁▃▂▂▁▁▂█	8888	path_hairline_small_AA_cubic
   9M	1	743µs	767µs	770µs	825µs	4%	▃▃▇▃▁▁▅▁█▁	8888	path_hairline_small_AA_conic
   9M	1	533µs	606µs	598µs	680µs	9%	▁▂▂█▆▇▇▄▂▂	8888	path_hairline_small_AA_quad
   9M	1	451µs	452µs	456µs	495µs	3%	▁▁▁▁█▁▁▁▁▁	8888	path_hairline_small_AA_line

/skia/trunk> cat ../new.txt
maxrss	loops	min	median	mean	max	stddev	samples   	config	bench
   9M	1	827µs	827µs	831µs	869µs	2%	▁▁▁▁▁▁▁█▁▁	8888	path_hairline_small_AA_cubic
   9M	1	515µs	517µs	517µs	518µs	0%	▇█▆▅▃▃▁▁▁▅	8888	path_hairline_small_AA_conic
   9M	1	310µs	311µs	315µs	332µs	2%	▂▁█▆▁▁▁▁▁▁	8888	path_hairline_small_AA_quad
   9M	1	254µs	254µs	258µs	276µs	3%	▁▁▁▁▁▁▁█▇▂	8888	path_hairline_small_AA_line

Edited revert of https://codereview.chromium.org/1085013003

TBR=

Review URL: https://codereview.chromium.org/1078413003
2015-04-15 13:13:48 -07:00
halcanary
00b7e5eb97 SkPDF/Device/ImageFilter: Fix ImageFilter fallback code
Broken in https://chromium.googlesource.com/skia/+/76033be

I have confirmed that this fixes 470083.

BUG=470083

Review URL: https://codereview.chromium.org/1080923004
2015-04-15 13:05:18 -07:00
jvanverth
221360a514 Real fix for the Mali bug.
The dFdy(st.y) computation seems to be better than the dFdx(st.x) computation
on the Mali, so using that. The end result should be about the same.

BUG=skia:3528

Review URL: https://codereview.chromium.org/1082913006
2015-04-15 12:31:22 -07:00