The old code says
runs += x + 1;
alpha += x + 1;
x = 0;
lastAlpha += x; // we don't want the +1
The last line does nothing. Remove this unnecessary line.
BUG=skia:401
Review URL: https://codereview.chromium.org/1506253002
Use an inline function that does a normal shift. When built for the sanitizer, add casts so that the shift is unsigned.
Also make a few fixes to do unsigned shifts or avoid the shift altogether; and add an argument spec to some macros.
R=reed@google.com,mtklein@google.com
BUG=skia:4633
Review URL: https://codereview.chromium.org/1503423003
Needed to enlarge radii to surface bugs without exceeding max texture size on low end devices.
BUG=chromium:477684
Review URL: https://codereview.chromium.org/1508003008
Make each filter responsible for expanding its destination
bounds. Previously, we were using a union of all
intermediate bounds sizes via join() calls in many image
filters' computeFastBounds(), due to the fact that those
filters could only produce bitmaps the same size as their
inputs. Now, we compute optimal bounds for each filter as
follows:
1) Pass the (unmodified) clip bounds to the root node
of the DAG in the first recursive call to onFilterImage()
as the Context's fClipBounds.
2) Reverse-map the clip: when recursing up the DAG in
filterInput[GPU](), apply filter-specific expansion to the
clip by calling calling onFilterNodeBounds(... kReverse).
This allows upstream nodes to have a clip that respects the
current node's requirements. This is done via helper
function mapContext().
3) Forward-map the source bitmap: just prior to applying
the crop rect in applyCropRect(), we determine the filter's
preferred bounds by mapping the source bitmap bounds
forwards via onFilterNodeBounds(..., kForward).
NOTE: GMs affected by this change:
fast_slow_blurimagefilter: fast and slow paths now produce the same result
spritebitmap: drawSprite() and drawBitmap() paths now produce the same result
filterfastbounds: fast bounds are optimized; all drop-shadow results now appear
apply-filter: snug and not-snug cases give same results
dropshadowimagefilter: drawSprite() results now show shadows
draw-with-filter: no artifacts on erode edges; blur edges no longer clipped
displacement, imagefiltersbase, imagefiltersclipped, imagefilterscropexpand, imagefiltersscaled, matriximagefilter,
resizeimagefilter, localmatriximagefilter, testimagefilters: fixed incorrect clipping
imagefilterstransformed, morphology: no artifacts on erode edges
BUG=skia:1062,skia:3194,skia:3939,skia:4337,skia:4526
Review URL: https://codereview.chromium.org/1308703007
This should make the (veto) and (skipped: ) both less verbose and easier to grok.
Looks like this'll bring the log files down from ~50M to ~1.5M.
BUG=skia:
Review URL: https://codereview.chromium.org/1516563002
Use correct config variable in command buffer gl context.
Before, the fConfig was errorneously used to initialize the
local variable. eglChooseConfig would update the local variable
and the fConfig member variable would never be updated.
Also add error checks to all initialization function calls.
BUG=skia:
Review URL: https://codereview.chromium.org/1505233002
- Update SkCodec's dox to point out that some of the data must be
read twice in order to decode
- Add an accessor that reports how much is needed for reading twice
- Make SkCodec default to use peek()
If an input stream supports peek()ing, peek() instead of reading.
This way the stream need not implement rewind()
- Make SkCodec use read() + rewind() as a backup
So that streams without peek() implemented can still function
properly (assuming they can rewind).
- read everything we may need to determine the format once
In SkCodec::NewFromStream, peek()/read() 14 bytes, which is enough
to read all of the types we support. Pass the buffer to each subtype,
which will have enough info to determine whether it is the right
type. This simplifies the code and results in less reading and
rewinding.
- NOTE: SkWbmpCodec needs the following number of bytes for the header
+ 1 (type)
+ 1 (reserved)
+ 3 (width - bytes needed to support up to 0xFFFF)
+ 3 (height - bytes needed to support up to 0xFFFF)
= 8
- in SkWebpCodec, support using read + rewind as a backup if peek does
not work.
A change in Android will add peek() to JavaInputStreamAdapter.
BUG=skia:3257
Review URL: https://codereview.chromium.org/1472123002
Will no longer be needed once ag/817367 lands - Android will be
inheriting directly from SkPngChunkReader, so no need for the
intermediate.
BUG=skia:4574
Review URL: https://codereview.chromium.org/1470913004
We think this might be more flexible. It allows, e.g, function-level blacklisting,
and here an easy one-stop-shop blacklist for all of third_party/externals.
BUG=skia:
CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-ASAN-Trybot
NOTREECHECKS=true
Review URL: https://codereview.chromium.org/1509733003
It's undefined behavior to pass null as src or dst to memcpy, even if len is 0.
This currently triggers -fsanitize=attribute-nonnull warnings, but also can
lead to very unexpected code generation with GCC.
sk_careful_memcpy() checks len first before calling memcpy(),
which prevents that weird undefined situation.
This allows me to mark all sanitizers as no-recover, i.e. make-the-bots-red fatal.
CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-ASAN-Trybot
BUG=skia:4641
NOTREECHECKS=true
Review URL: https://codereview.chromium.org/1510683002
- Carmack rsqrt uses an int where it wants a uint32_t.
- turn off all santizers (including signed-integer-overflow) in third_party/externals/sftntly.
CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-ASAN-Trybot
BUG=skia:4635
Review URL: https://codereview.chromium.org/1511643002
Batches together path range draws whose view matrices differ by a
simple translation by pre-translating the individual path transforms
during the copy.
BUG=skia:
Review URL: https://codereview.chromium.org/1507203002
Add SkImageEncoder::EncodeData(const SkPixmap&, ...) function.
Add SkImageEncoder::CreatePixelSerializer() to return a
PixelSerializer that calls into SkImageEncoder::EncodeData.
SkImage::encode() make use of SkImageEncoder::CreatePixelSerializer.
Review URL: https://codereview.chromium.org/1507123002
Replaces drawPathsFromRange with a more general drawPathBatch method.
While this still isn't perfect, it's a step in the right direction that
removes the need for path range draws to fit in a public API.
BUG=skia:
Review URL: https://codereview.chromium.org/1506823004
In the repro case the conic in question has a replicated control point at the end. These points end up being slightly different by the time they get to convert_noninflect_cubic_to_quads so the initial checks for a zero vector don't fire. The following checks, in the constrainWithinTangents path, do fire however leading to a premature termination of conversion to quads.
BUG=skia:4611
Review URL: https://codereview.chromium.org/1504983003
When using NVPR, sometimes paths must be stroked by Skia and then drawn
with fill using NVPR. In these cases, use the fill type and bounds of
the stroked path, not the original path.
Fixes degeneratesegments for nvprmsaa backends.
BUG=skia:4608
Review URL: https://codereview.chromium.org/1504753003