Commit Graph

19874 Commits

Author SHA1 Message Date
mtklein
067e90e72f another null src, memcpy -> sk_careful_memcpy
https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-ASAN/builds/3798/steps/dm/logs/stdio

BUG=skia:

Review URL: https://codereview.chromium.org/1510903005
2015-12-10 07:42:47 -08:00
joshualitt
53f26aa045 Remove uniform color for GrDistanceFieldGeoProc
BUG=skia:

Review URL: https://codereview.chromium.org/1512533003
2015-12-10 07:29:54 -08:00
caryclark
9ca30a3b9b add path ops presentations to skia.org
TBR=hcm@google.com
NOTRY=true
DOCS_PREVIEW= https://skia.org/?cl=1518453003

Review URL: https://codereview.chromium.org/1518453003
2015-12-10 06:29:44 -08:00
kkinnunen
5219fd9ff7 Make NVPR a GL context option instead of a GL context
Make NVPR a GL context option instead of a GL context.
This may enable NVPR to be run with command buffer
interface.

No functionality change in DM or nanobench. NVPR can
only be run with normal GL APIs.

BUG=skia:2992

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

Committed: https://skia.googlesource.com/skia/+/64492c43c3faee7ab0f69b1c84e0267616f85e52

Review URL: https://codereview.chromium.org/1448883002
2015-12-10 06:28:13 -08:00
kkinnunen
ea40943f8e Use a pseudo-extension CHROMIUM_framebuffer_mixed_samples
Use the pseudo-extension CHROMIUM_framebuffer_mixed_samples when
run with Chromium command buffer. The extension exposes
NV_framebuffer_mixed_samples subset that Skia needs in order to
use NV_path_rendering with mixed samples.

BUG=506765

Review URL: https://codereview.chromium.org/1507373004
2015-12-10 01:21:59 -08:00
kkinnunen
2ca29c0b91 Populate NVPR functions when run with command buffer
Populate the NV_path_rendering functions provided by
CHROMIUM_path_rendering when the tools are being run with
command buffer API.

BUG=skia:2992

Review URL: https://codereview.chromium.org/1510163003
2015-12-09 22:58:34 -08:00
bsalomon
e87256c462 Do elliptical clips in normalized space on devices with a "real" mediump
BUG=chromium:477684

Review URL: https://codereview.chromium.org/1517573002
2015-12-09 17:14:40 -08:00
bsalomon
f1ecd21bf6 Make "alpha only" be a property of GrTextureProducer
Review URL: https://codereview.chromium.org/1507973005
2015-12-09 17:06:02 -08:00
jvanverth
b3685c8646 Use BRGA as internal format on later iOS
BUG=skia:2733

Review URL: https://codereview.chromium.org/1504333007
2015-12-09 16:54:35 -08:00
mtklein
e0021c0b05 another memcpy -> sk_careful_memcpy
https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-ASAN/builds/3791/steps/dm/logs/stdio

This is getting tedious.

TBR=herb@google.com,reed@google.com
No API changes.

BUG=skia:

Review URL: https://codereview.chromium.org/1510223003
2015-12-09 16:20:25 -08:00
caryclark
2028d7ff74 add support for capped hairlines
Extend the ends of hairline and haircurve segments when the paint is set to square or round, and the line or curve is at the start or end of a contour.

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

Review URL: https://codereview.chromium.org/1491843006
2015-12-09 14:04:46 -08:00
scroggo
645f6d9e39 Silence libjpeg warnings in SkImageDecoder
We just did the same for libpng (see crrev.com/1512043002), so we
might as well do this here.

SkImageDecoder is deprecated, and SkCodec already has a way to turn
off its messages.

BUG=skia:1649

Review URL: https://codereview.chromium.org/1505953007
2015-12-09 13:40:34 -08:00
mtklein
cefb459762 Another undefined shift caught by -fsanitize=shift.
left was -16

I didn't see any warning about fTop, but seems simplest to fix that too.

BUG=skia:

Review URL: https://codereview.chromium.org/1505993007
2015-12-09 13:32:58 -08:00
mtklein
8bf5d1754f Another memcpy -> sk_careful_memcpy
https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-ASAN/builds/3787/steps/dm/logs/stdio

dst is null.
TBR=herb@google.com

BUG=skia:

Review URL: https://codereview.chromium.org/1507113007
2015-12-09 13:15:07 -08:00
mtklein
9b439153fc no need for newlines in DM Errors
This should fix some odd formatting problems in the logs, e.g.

    Note tally:
    583x   (skipped: Cannot convert to requested color type.
    )
    4x     (--blacklist _ image decode 4bpp-pixeldata-cropped.bmp)

~~~>

    Note tally:
    583x   (skipped: Cannot convert to requested color type.)
    4x     (--blacklist _ image decode 4bpp-pixeldata-cropped.bmp)

BUG=skia:

Review URL: https://codereview.chromium.org/1508223006
2015-12-09 13:02:26 -08:00
benjaminwagner
5582b2be31 Fix compile error with GOOGLE3 define.
BUG=skia:

Review URL: https://codereview.chromium.org/1509023004
2015-12-09 12:51:20 -08:00
bsalomon
2bbd0c6161 Rewrite drawBitmap/ImageNine on top of GrTextureProducer
Review URL: https://codereview.chromium.org/1504723004
2015-12-09 12:50:56 -08:00
mtklein
632199ec6e Make skia_sanitizer work on Macs too.
This is of course limited by what the compiler suppports.
-fsanitize=address seems to work OK.

BUG=skia:

Review URL: https://codereview.chromium.org/1512853005
2015-12-09 12:39:01 -08:00
scroggo
dc877a7734 Remove no-op code in SkAlphaRuns::add
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
2015-12-09 12:33:21 -08:00
herb
39cbd2b30c Fix problem with flag unknown to clang. This negates an earlier -Werror causing warnings to be errors.
BUG=skia:

Review URL: https://codereview.chromium.org/1515653002
2015-12-09 12:27:31 -08:00
msarett
7596683275 Silence libpng warnings in SkImageDecoder
BUG=skia:

Review URL: https://codereview.chromium.org/1512043002
2015-12-09 12:12:56 -08:00
caryclark
3127c99986 ubsan shift fixes
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
2015-12-09 12:02:30 -08:00
halcanary
e36ec87176 SkBitmap::installPixels(const SkPixmap&);
Review URL: https://codereview.chromium.org/1505333002
2015-12-09 11:36:59 -08:00
bsalomon
cd07491443 Prevent overflow in length() in GLCircularRRectEffect
BUG=chromium:477684

Review URL: https://codereview.chromium.org/1517483002
2015-12-09 10:33:52 -08:00
halcanary
b260d130ca SkBitmap::getColor repsects swizzle
Review URL: https://codereview.chromium.org/1510253002
2015-12-09 10:21:59 -08:00
bsalomon
4a4f14ba3f Split big rrect aa effect up into separate images
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
2015-12-09 10:17:35 -08:00
senorblanco
db64af3b17 Fix filter primitive bounds computations.
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
2015-12-09 10:11:43 -08:00
mtklein
02046c50b2 fix a couple flaky nonnull attribute ubsan warnings
Errors this should fix:
  https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-ASAN/builds/3779/steps/dm/logs/stdio
  https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-ASAN/builds/3779/steps/nanobench/logs/stdio

CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-ASAN-Trybot

TBR=reed@google.com
No API changes.

BUG=skia:

Review URL: https://codereview.chromium.org/1504313005
2015-12-09 10:02:14 -08:00
joshualitt
f9e658b1d6 Fix bug with GrAtlasTextContext color regen
BUG=skia:

Review URL: https://codereview.chromium.org/1513723002
2015-12-09 09:26:44 -08:00
mtklein
bc4e003d39 DM: tally notes at the end rather than showing them as they finish.
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
2015-12-09 08:37:35 -08:00
robertphillips
96afa5295d Boost GrGLConicEffect's variables to all high precision
BUG=555779

Committed: https://skia.googlesource.com/skia/+/624c59a1c7af38eb83e803f345a6f3e225475a08

Review URL: https://codereview.chromium.org/1513483002
2015-12-09 07:54:24 -08:00
mtklein
7918b99506 try stifling integer overflow error
first time we've done this, let's see if it works!

BUG=skia:4667

Looks ok now.  Red ASAN bot is different errors.

Review URL: https://codereview.chromium.org/1507063007
2015-12-09 07:24:10 -08:00
fmalita
3e2f5624b4 Cap filtering to kMedium_SkFilterQuality when downsampling
R=reed@google.com

Review URL: https://codereview.chromium.org/1510673002
2015-12-09 07:18:16 -08:00
robertphillips
07073642eb Revert of Boost GrGLConicEffect's variables to all high precision (patchset #1 id:1 of https://codereview.chromium.org/1513483002/ )
Reason for revert:
Broke build

Original issue's description:
> Boost GrGLConicEffect's variables to all high precision
>
> BUG=555779
>
> Committed: https://skia.googlesource.com/skia/+/624c59a1c7af38eb83e803f345a6f3e225475a08

TBR=egdaniel@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=555779

Review URL: https://codereview.chromium.org/1514553002
2015-12-09 07:09:22 -08:00
borenet
9d66696f6b Revert of Make NVPR a GL context option instead of a GL context (patchset #9 id:160001 of https://codereview.chromium.org/1448883002/ )
Reason for revert:
"Could not create surface" on Linux GTX660 bots

Original issue's description:
> Make NVPR a GL context option instead of a GL context
>
> Make NVPR a GL context option instead of a GL context.
> This may enable NVPR to be run with command buffer
> interface.
>
> No functionality change in DM or nanobench. NVPR can
> only be run with normal GL APIs.
>
> BUG=skia:2992
>
> Committed: https://skia.googlesource.com/skia/+/eeebdb538d476c1bfc8b63a946094ca1b505ecd1
>
> Committed: https://skia.googlesource.com/skia/+/64492c43c3faee7ab0f69b1c84e0267616f85e52

TBR=mtklein@google.com,bsalomon@google.com,jvanverth@google.com,scroggo@google.com,kkinnunen@nvidia.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:2992

Review URL: https://codereview.chromium.org/1513703002
2015-12-09 07:03:51 -08:00
joshualitt
f528e0dc71 A small text cleanup
BUG=skia:

Review URL: https://codereview.chromium.org/1508853005
2015-12-09 06:42:52 -08:00
robertphillips
624c59a1c7 Boost GrGLConicEffect's variables to all high precision
BUG=555779

Review URL: https://codereview.chromium.org/1513483002
2015-12-09 06:28:06 -08:00
bsalomon
9f0337ed4b Attempt to land cache purge again [and regen bot logs if still failing]
TBR=

Review URL: https://codereview.chromium.org/1510103002
2015-12-09 06:27:59 -08:00
halcanary
a2e056773d Revert of default SkPixelSerializer (patchset #2 id:20001 of https://codereview.chromium.org/1507123002/ )
Reason for revert:
I was overconfident.

Original issue's description:
> default SkPixelSerializer
>
> 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.
>
> Committed: https://skia.googlesource.com/skia/+/b0bd1516bff3f5afcbfd615e805867531657811b
>
> Committed: https://skia.googlesource.com/skia/+/808ce2886d732b1055f89c8fb0f1b11b47fcb0ce

TBR=reed@google.com,scroggo@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1511183002
2015-12-09 03:56:02 -08:00
kkinnunen
ef6a1ca531 Use correct config variable in command buffer gl context
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
2015-12-08 23:52:40 -08:00
halcanary
808ce2886d default SkPixelSerializer
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.

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

Review URL: https://codereview.chromium.org/1507123002
2015-12-08 19:02:36 -08:00
fmalita
e77f2daec9 [SkDebugger] Show more text blob details
* run count
 * glyph count (per run)
 * run paint (per run)

R=robertphillips@google.com

Review URL: https://codereview.chromium.org/1507033003
2015-12-08 18:59:18 -08:00
joshualitt
8985aea7b0 Remove spew in GrDefaultPathRenderer
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1509913003
2015-12-08 18:58:48 -08:00
scroggo
db30be2f94 Make SkCodec support peek() and read()
- 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
2015-12-08 18:54:13 -08:00
jvanverth
0671b967eb Move texture drawing utility method to SkGpuDevice
BUG=skia:4542

Review URL: https://codereview.chromium.org/1506203002
2015-12-08 18:53:44 -08:00
herb
55462e5f50 Add RTTI to all sanitizers.
BUG=skia:

Review URL: https://codereview.chromium.org/1510843003
2015-12-08 18:49:04 -08:00
scroggo
f01610effc Remove staging for SkImageDecoder::Peeker
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
2015-12-08 18:48:38 -08:00
mtklein
bb5b77db51 Disable sanitizers with a blacklist.
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
2015-12-08 14:26:17 -08:00
mtklein
cc881dafcb Add sk_careful_memcpy to catch undefined behavior in memcpy.
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
2015-12-08 11:55:17 -08:00
reed
290f00cd75 Revert of default SkPixelSerializer (patchset #1 id:1 of https://codereview.chromium.org/1507123002/ )
Reason for revert:
Breaking DEPS roll (linker error)

Original issue's description:
> default SkPixelSerializer
>
> 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.
>
> Committed: https://skia.googlesource.com/skia/+/b0bd1516bff3f5afcbfd615e805867531657811b

TBR=scroggo@google.com,halcanary@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1505203003
2015-12-08 10:59:13 -08:00