GrContext draw functions (drawRect, drawRRect,...) fall back to
GrContext::drawPath for complex cases. Mark the argument SkPath
as volatile, since it is.
Progressions for nvprmsaa:
tabl_androidpolice.skp_1 11.6ms -> 10.3ms 0.89x
desk_twitter.skp_1 9.21ms -> 8.08ms 0.88x
tabl_sahadan.skp_1 8.97ms -> 7.65ms 0.85x
desk_wikipedia.skp_1 5.63ms -> 4.5ms 0.8x
desk_booking.skp_1 11.5ms -> 8.87ms 0.77x
desk_ebay.skp_1 7ms -> 5.37ms 0.77x
Makes rrects and rects go to "simple path" path cache (cached by contents).
No change for msaa, gpu.
BUG=skia:
Review URL: https://codereview.chromium.org/1150993002
Two major things have happened:
1. Android bots split between more machines. This caused lots of
congestion-related failures, leading to...
2. All buildslaves now use a single checkout for all of the builders
that they run. This should give us far fewer problems when we have
to re-download SKPs, toolchains, etc.
TBR=rmistry
BUG=skia:3835,3774
Review URL: https://codereview.chromium.org/1154603002
Moves the cap for mixed samples into GrShaderCaps and does not enable
it unless we have support for both dual source blending and
multisample disable.
Creates a dedicated cap for multisample disable.
Reconfigures the mixed samples cap to indicate the collective
capability of three different extensions:
GL_NV_framebuffer_mixed_samples
GL_NV_sample_mask_override_coverage
GL_EXT_raster_multisample
Imports tokens and procedures for GL_EXT_raster_multisample.
BUG=skia:
Review URL: https://codereview.chromium.org/1151793002
Constructing the gm tests and benches causes many calls to font loads.
This is visible as profiling samples in fontconfig and freetype on Linux
for all profiling runs of nanobench. This complicates analysis of
test-cases that are suspected of being slow due to font-related issues.
Move the font loading to GM::onOnceBeforeDraw and Benchmark::onPreDraw.
This way the code is not executed if the testcase does not match the
nanobench --match filter. This way the samples in font-related code are
more easy to identify as legitimate occurances caused by the testcase.
This should not cause differences in timings, because:
* Benchmark::preDraw / onPreDraw is defined to be run outside the timer
* GM::runAsBench is not enabled for any of the modified testcases. Also
nanobench untimed warmup round should run the onOnceBeforeDraw.
(and there are other GM::runAsBench gms already doing loading in
onOnceBeforeDraw).
Changes the behavior:
In TextBench:
Before, the test would report two different gms with the same name if
the color emoji font was not loaded successfully.
After, the test always reports all tests as individual names.
Generally:
The errors from loading fonts now print inbetween each testcase, as
opposed to printing during construction phase. Sample output:
( 143/145 MB 1872) 14.7ms 8888 gm quadclosepathResource /fonts/Funkster.ttf not a valid font.
( 160/160 MB 1831) 575µs 8888 gm surfacenewResource /fonts/Funkster.ttf not a valid font.
( 163/165 MB 1816) 12.5ms 8888 gm linepathResource /fonts/Funkster.ttf not a valid font.
( 263/411 MB 1493) 118ms 8888 gm typefacestyles_kerningResource /fonts/Funkster.ttf not a valid font.
( 374/411 MB 1231) 7.16ms 565 gm getpostextpathResource /fonts/Funkster.ttf not a valid font.
( 323/411 MB 1179) 4.92ms 565 gm stringartResource /fonts/Funkster.ttf not a valid font.
( 347/493 MB 917) 191ms 565 gm patch_gridResource /fonts/Funkster.ttf not a valid font.
( 375/493 MB 857) 23.9ms gpu gm clipdrawdrawCannot render path (0)
( 393/493 MB 706) 2.91ms unit test ParsePath------ png error IEND: CRC error
( 394/493 MB 584) 166ms gpu gm hairmodesResource /fonts/Funkster.ttf not a valid font.
Resource /fonts/Funkster.ttf not a valid font.
Resource /fonts/Funkster.ttf not a valid font.
...
Review URL: https://codereview.chromium.org/1144023002
Specifying vertex attributes and the view matrix as mediump causes bad artifacts on Mali T6XX.
Covered by the bigmatrix GM in msaa4 mode.
BUG:skia=3545,3771
Review URL: https://codereview.chromium.org/1145273002
This requires we "first" add a has-picture bool to SkPictureShader serialized format.
BUG=chromium:486947, billions and billions of others.
Review URL: https://codereview.chromium.org/1151663002
This re-enables adoption tracking for SkPictures in Blink,
which should be green now that crrev.com/1136123011 has landed.
BUG=skia:3847
Review URL: https://codereview.chromium.org/1145153002
In my confusion yesterday I accidentally left this as a non-singleton.
The issue in Blink was not related to this being a singleton,
and it should be safe to make it one.
This means recording an empty picture properly costs zero mallocs.
BUG=skia:
Review URL: https://codereview.chromium.org/1147053002
Prior to the introduction of find.py, GMs were liked in the order they
were listed in the gypi file, which was generally alphabetically. This
made it fairly easy to predict where slides would show up in SampleApp
and the order was consistent. This simply sorts the list of files in
find.py to restore the expectation that files should be listed in the
build in alphabetical order.
Review URL: https://codereview.chromium.org/1144973003
If one of the inputs to a SkMergeImageFilter was clipped away or
otherwise caused the filterImage(...) invocation for it to return
false, the entire effect would be "failed" and return false --
regardless of if it had produced a result or not.
Instead of returning false directly if filterImage(...) for a source
returned false, consider all the inputs, and then only return false if
all of them do.
BUG=chromium:489046
Review URL: https://codereview.chromium.org/1133523006
Add a newline to the font load debug message. Helps reading nanobench
results. Otherwise the message "Resource /fonts/Funkster.ttf not a valid
font." causes first result be hard to read or missing.
Review URL: https://codereview.chromium.org/1142183002
A stroked conic computes the outset quad's control point by
computing the intersection of the quad's endpoints. If the
the denominator used to compute the scale factor for the
control point is small, check to see if the numerator is also
small so that the division stays bounded.
Also clean up error returns and internal function calls to
simplify the code.
Additionally, remove comic max curvature (unimplemented) and call
extrema functions instead to handle cases where the conic is degenerate
or is a line.
R=reed@google.com, fmalita@chromium.org
BUG=skia:3843
Review URL: https://codereview.chromium.org/1144883003
What is going on here is that, after the mapPoints in fillAANestedRects, devInside was upside down so the isEmpty check was always firing. I don't see why we need to avoid having devInside sorted.
BUG=488103
Review URL: https://codereview.chromium.org/1135753004
Improve caching of dashed paths in GrStencilAndCoverPathRenderer.
Look up the (NVPR specific) GrGLPath based on GrStrokeInfo and
the original path.
Use unique keys for all GrPaths.
Dash the path with Skia dash stroker and use that path geometry for
NVPR path.
NVPR internal dashing stroke is not used, because the dashing
implementation of NVPR does not match Skia implementation.
Review URL: https://codereview.chromium.org/1116123003
Make GrResourceCache performance less sensitive to key length change.
The memcmp in GrResourceKey is called when SkTDynamicHash jumps the
slots to find the hash by a index. Avoid most of the memcmps by
comparing the hash first.
This is important because small changes in key data length can cause
big performance regressions. The theory is that key length change causes
different hash values. These hash values might trigger memcmps that
originally weren't there, causing the regression.
Adds few specialized benches to grresourcecache_add to test different
key lengths. The tests are run only on release, because on debug the
SkTDynamicHash validation takes too long, and adding many such delays
to development test runs would be unproductive. On release the tests
are quite fast.
Effect of this patch to the added tests on amd64:
grresourcecache_find_10 738us -> 768us 1.04x
grresourcecache_find_2 472us -> 476us 1.01x
grresourcecache_find_25 841us -> 845us 1x
grresourcecache_find_4 565us -> 531us 0.94x
grresourcecache_find_54 1.18ms -> 1.1ms 0.93x
grresourcecache_find_5 834us -> 749us 0.9x
grresourcecache_find_3 620us -> 542us 0.87x
grresourcecache_add_25 2.74ms -> 2.24ms 0.82x
grresourcecache_add_56 3.23ms -> 2.56ms 0.79x
grresourcecache_add_54 3.34ms -> 2.62ms 0.78x
grresourcecache_add_5 2.68ms -> 2.1ms 0.78x
grresourcecache_add_10 2.7ms -> 2.11ms 0.78x
grresourcecache_add_2 1.85ms -> 1.41ms 0.76x
grresourcecache_add 1.84ms -> 1.4ms 0.76x
grresourcecache_add_4 1.99ms -> 1.49ms 0.75x
grresourcecache_add_3 2.11ms -> 1.55ms 0.73x
grresourcecache_add_55 39ms -> 13.9ms 0.36x
grresourcecache_find_55 23.2ms -> 6.21ms 0.27x
On arm64 the results are similar.
On arm_v7_neon, the results lack the discontinuity at 55:
grresourcecache_add 4.06ms -> 4.26ms 1.05x
grresourcecache_add_2 4.05ms -> 4.23ms 1.05x
grresourcecache_find 1.28ms -> 1.3ms 1.02x
grresourcecache_find_56 3.35ms -> 3.32ms 0.99x
grresourcecache_find_2 1.31ms -> 1.29ms 0.99x
grresourcecache_find_54 3.28ms -> 3.24ms 0.99x
grresourcecache_add_5 6.38ms -> 6.26ms 0.98x
grresourcecache_add_55 8.44ms -> 8.24ms 0.98x
grresourcecache_add_25 7.03ms -> 6.86ms 0.98x
grresourcecache_find_25 2.7ms -> 2.59ms 0.96x
grresourcecache_find_4 1.45ms -> 1.38ms 0.95x
grresourcecache_find_10 2.52ms -> 2.39ms 0.95x
grresourcecache_find_55 3.54ms -> 3.33ms 0.94x
grresourcecache_find_5 2.5ms -> 2.32ms 0.93x
grresourcecache_find_3 1.57ms -> 1.43ms 0.91x
The extremely slow case, 55, is postulated to be due to the index jump
collisions running the memcmp. This is not visible on arm_v7_neon probably due
to hash function producing different results for 32 bit architectures.
This change is needed for extending path cache key in Gr
NV_path_rendering codepath. Extending is needed in order to add dashed
paths to the path cache.
Review URL: https://codereview.chromium.org/1132723003
Set the "path stroke error bound" path parameter to 0.02 for all paths.
This means that the stroked path area will be within 98% of the stroke
width in path space.
This should fix many cases where NVPR stroked paths were visibly different to
Skia stroked paths. One such path is in dashcubics gm.
This increases the amount of subdivisions the path object creation will
make for paths that need it. This in turn will increase gpu object space
requirements sligthly. Both of these effects should be unnoticeable.
GL_NV_path_rendering.txt:
"""
Every path object has a stroke approximation bound parameter
(PATH_STROKE_BOUND_NV) that is a floating-point value /sab/ clamped
between 0.0 and 1.0 and set and queried with the PATH_STROKE_BOUND_NV
path parameter. Exact determination of samples swept an orthogonal
centered line segment along cubic Bezier segments and rational
quadratic Bezier curves (so non-circular partial elliptical arcs) is
intractable for real-time rendering so an approximation is required;
/sab/ intuitively bounds the approximation error as a percentage of
the path object's stroke width. Specifically, this path parameter
requests the implementation to stencil any samples within /sweep/
object space units of the exact sweep of the path's cubic Bezier
segments or partial elliptical arcs to be sampled by the stroke where
sweep = ((1-sab)*sw)/2
where /sw/ is the path object's stroke width. The initial value
of /sab/ when a path is created is 0.2. In practical terms, this
initial value means the stencil sample positions coverage within 80%
(100%-20%) of the stroke width of cubic and rational quadratic stroke
segments should be sampled.
"""
BUG=skia:2049
Review URL: https://codereview.chromium.org/1124423007
Make the code more readable by inheriting GrStrokeInfo from SkStrokeRec.
This should avoid the long .getStrokeRec() and .getStrokeRecPtr(). These
were a bit cumbersome especially in cases where an alias variable was
created for these, and then the reader had to keep track to which
StrokeInfo member the StrokeRec alias was pointing.
Removes SkStrokeRec::SkStrokeRec(const SkStrokeRec&). It was memcpying.
Try to play it safe wrt compiler using the possible padding of
superclass for subclass members. Instead, let the compiler generate
the copy constructor. Assignment operator was already
compiler-generated, so at least in that way this is consistent.
Renames GrStrokeInfo::applyDash to applyDashToPath for consistency
with superclass applyToPath.
Review URL: https://codereview.chromium.org/1128113008