Commit Graph

19800 Commits

Author SHA1 Message Date
scroggo
d61c384342 Allow SkStream::peek() to partially succeed
If the stream can peek less than requested, peek that amount. Return
the number of bytes peeked.

This simplifies crrev.com/1472123002. For a stream that is smaller than
14 bytes, it can successfully peek, meaning the client will not need to
fall back to read() + rewind(), which may fail if the stream can peek
but not rewind.

This CL revives code from patch set 3 of crrev.com/1044953002, where I
initially introduced peek() (including tests).

Add a test for SkFrontBufferedStream that verifies that peeking does
not make rewind() fail (i.e. by reading past the internal buffer).

BUG=skia:3257

Review URL: https://codereview.chromium.org/1490923005
2015-12-07 11:37:13 -08:00
joshualitt
3660d53451 Start objectifying GrAtlasTextBlob
BUG=skia:

Review URL: https://codereview.chromium.org/1503193002
2015-12-07 11:32:50 -08:00
thakis
573ce20f42 clang/win: Let SK_TRACEHR not produce -Wunused-value warnings in release builds.
Fixes warnings like:
..\..\third_party\skia\include\utils\win\SkHRESULT.h(51,23) :  note: expanded from macro 'HRNM'
                      ^~~~~~~~~~~~~~~~~~~~~~~~~
..\..\third_party\skia\include\utils\win\SkHRESULT.h(26,20) :  note: expanded from macro 'HR_GENERAL'
        SK_TRACEHR(_hr, _msg);\
                   ^~~
..\..\third_party\skia\include\utils\win\SkHRESULT.h(20,31) :  note: expanded from macro 'SK_TRACEHR'
                              ^~~

BUG=chromium:505318
TBR=reed
This is a trivial implementation change.

Review URL: https://codereview.chromium.org/1503463004
2015-12-07 10:41:36 -08:00
tomhudson
d5c4265b49 Fix up signed-integer-overflow warnings
When checking whether a matrix was a pure scale, we subtracted
0x3f800000 from the diagonals; if the diagonal value was already
very negative, we'd underflow. Replace subtraction with XOR.

When dealing with repeating tiled bitmaps, when the bitmap was
very large, we'd multiply an offset by 65535, possibly causing
underflow. Throw in a cast to long (casting to unsigned also
silences the warning and wouldn't involve extension, but I can't
convince myself that it's correct).

BUG=skia:4635
R=mtklein@google.com

Review URL: https://codereview.chromium.org/1504933002
2015-12-07 10:38:05 -08:00
senorblanco
d18b1b5adc Add SkTileImageFilter sample to filterfastbounds GM.
NOTE: will affect pixel results for filterfastbounds GM.

BUG=skia:3194

Review URL: https://codereview.chromium.org/1500373004
2015-12-07 10:36:30 -08:00
joel.liang
8e03b8af75 Always use high precision on NDS transform
To fix the Chrome fillRect issue on Galaxy S6.
We should use high precision for position related calculation.

BUG=chromium:552999

Review URL: https://codereview.chromium.org/1500393002
2015-12-07 10:33:00 -08:00
halcanary
0745653a67 SkAlphaThresholdFilter.h allow flattening
Motivation:  allows this:

    #include "SkAlphaThresholdFilter.h"
    void init() {
      SkAlphaThresholdFilter::InitializeFlattenables();
    }

BUG=skia:4613

Review URL: https://codereview.chromium.org/1500373003
2015-12-07 10:29:54 -08:00
robertphillips
1d265ca85f Pin result in SkATan2_255
BUG=555544

Review URL: https://codereview.chromium.org/1506913002
2015-12-07 09:54:02 -08:00
reed
f65fb65814 add gm to exercise large sigmas
BUG=skia:4437
TBR=

Review URL: https://codereview.chromium.org/1503143002
2015-12-07 09:28:34 -08:00
mtklein
9d344069c5 better NEON div255
We were doing (x+127)/255 = ((x+128) + (x+128)>>8)>>8 in three instructions:
    1) x += 128
    2) shift x right 8 bits
    3) add x and x>>8 together, then shift right more 8 bits

Now do it as two instructions:
    1) shift (x+128) right 8 bits
    2) add x and (x+128)>>8 and 128 all together, then shift right 8 more bits

On ARM this will be a 5-10% speedup for SrcATop, DstATop, Xor, Multiply, Difference, HardLight, Darken, and Lighten xfermodes.  When we have a mask (e.g. text), *all* xfermodes except Plus will get a similar boost.

This should mean now that (a*b).div255() is the same speed as a.approxMulDiv255(b) on both x86 and ARM, and of course it's perfect instead of approximate.  So we should eliminate approxMulDiv255(), but I'll leave it to another CL, as it'll need Blink rebaselines.

This CL should not change GMs or Blink.
https://gold.skia.org/search2?issue=1502843002&unt=true&query=source_type%3Dgm&master=false

BUG=skia:
CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot;client.skia.android:Test-Android-GCC-Nexus9-CPU-Denver-Arm64-Debug-Trybot,Test-Android-GCC-Nexus5-CPU-NEON-Arm7-Release-Trybot

Review URL: https://codereview.chromium.org/1502843002
2015-12-07 08:21:11 -08:00
senorblanco
a544eda5dd Matrix convolution bounds fix; affectsTransparentBlack fixes.
Because the convolution kernel is (currently) applied in device space,
there's no way to know which object-space pixels will be touched. So
return false from canComputeFastBounds().

The results from the matrixconvolution GM were actually wrong, since
they were showing edge differences on the clip boundaries, where they
should really only show on crop boundaries. I added a crop to the GM
to keep the results the same (which are useful to test the different
convolution tile modes).

While I was at it, SkImageFilter::affectsTransparentBlack() was
inapplicable on most things except color filters, and its use on
leaf nodes was confusing. So I removed it, and made
SkImageFilter::canComputeFastBounds() virtual instead.

BUG=skia:4630

Review URL: https://codereview.chromium.org/1500923004
2015-12-07 07:48:34 -08:00
jvanverth
d7a2c1f5fd Add transfer buffer to GLCaps
Adds a check for PBO/transfer buffer support to GrGLCaps,
and uses that to pick the correct buffer type.

BUG=skia:4604

Review URL: https://codereview.chromium.org/1503593002
2015-12-07 07:36:44 -08:00
update-skps
776d49b41b Update SKP version
Automatic commit by the RecreateSKPs bot.

TBR=
NO_MERGE_BUILDS

Review URL: https://codereview.chromium.org/1502893002
2015-12-06 00:27:08 -08:00
reed
262a71b7f9 detect when we can filter bitmaps/images directly, w/o a tmp layer
visual bench run on Mac Pro

curr/maxrss	loops	min	median	mean	max	stddev	samples   	config	bench
 100/100 MB	16	412µs	413µs	413µs	414µs	0%	▄▁▇▄▄▄▄█▄▃▅	gpu	warmupbench
 101/102 MB	32	547µs	548µs	611µs	1.24ms	34%	█▁▁▁▁▁▁▁▁▁▁	gpu	image-filter-sprite-draw-image
 102/103 MB	32	547µs	548µs	721µs	1.23ms	41%	█▁▇▁▁█▁▁▁▁▁	gpu	image-filter-sprite-draw-bitmap
 103/103 MB	64	546µs	546µs	546µs	547µs	0%	▆▄▂▁▇█▅▇▅▇▃	gpu	image-filter-sprite-draw-sprite

Should have no effect on Chrome while SK_SUPPORT_LEGACY_LAYER_BITMAP_IMAGEFILTERS is defined (which it is in chrome)

BUG=skia:1073

Review URL: https://codereview.chromium.org/1491293002
2015-12-05 13:07:27 -08:00
senorblanco
50c044b9ad Revert of Matrix convolution bounds fix; affectsTransparentBlack fixes. (patchset #4 id:60001 of https://codereview.chromium.org/1500923004/ )
Reason for revert:
Introduced memory leak; pixel changes in Chrome.

Original issue's description:
> Matrix convolution bounds fix; affectsTransparentBlack fixes.
>
> Because the convolution kernel is (currently) applied in device space,
> there's no way to know which object-space pixels will be touched. So
> return false from canComputeFastBounds().
>
> The results from the matrixconvolution GM were actually wrong, since
> they were showing edge differences on the clip boundaries, where they
> should really only show on crop boundaries. I added a crop to the GM
> to keep the results the same (which are useful to test the different
> convolution tile modes).
>
> While I was at it, SkImageFilter::affectsTransparentBlack() was
> inapplicable on most things except color filters, and its use on
> leaf nodes was confusing. So I removed it, and made
> SkImageFilter::canComputeFastBounds() virtual instead.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/8705ec80518ef551994b82ca5ccaeb0241d6adec

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

Review URL: https://codereview.chromium.org/1497083005
2015-12-05 05:59:41 -08:00
reed
22a517f71a report back colorfilters in lua
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1498293002
2015-12-04 20:45:59 -08:00
senorblanco
8705ec8051 Matrix convolution bounds fix; affectsTransparentBlack fixes.
Because the convolution kernel is (currently) applied in device space,
there's no way to know which object-space pixels will be touched. So
return false from canComputeFastBounds().

The results from the matrixconvolution GM were actually wrong, since
they were showing edge differences on the clip boundaries, where they
should really only show on crop boundaries. I added a crop to the GM
to keep the results the same (which are useful to test the different
convolution tile modes).

While I was at it, SkImageFilter::affectsTransparentBlack() was
inapplicable on most things except color filters, and its use on
leaf nodes was confusing. So I removed it, and made
SkImageFilter::canComputeFastBounds() virtual instead.

BUG=skia:

Review URL: https://codereview.chromium.org/1500923004
2015-12-04 13:57:31 -08:00
reed
95f53fbc5d clarify diff manually, showing black where they differ
BUG=skia:
TBR=robertphilips@google.com

Review URL: https://codereview.chromium.org/1498243002
2015-12-04 12:44:24 -08:00
reed
5123eb760f use RawIter in hairpath (simplifies)
no impact on nanobench

BUG=skia:

Review URL: https://codereview.chromium.org/1497283002
2015-12-04 11:59:05 -08:00
caryclark
c326257a61 add hairline with caps gm
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1502613002
2015-12-04 11:08:42 -08:00
borenet
258ade521b Add iOS compile bot to the CQ
BUG=skia:4252

Review URL: https://codereview.chromium.org/1501453005
2015-12-04 10:19:21 -08:00
joshualitt
6ebd423941 Create a skeleton VisualDebugModule
BUG=skia:

Review URL: https://codereview.chromium.org/1498043002
2015-12-04 09:02:34 -08:00
joshualitt
91d0620586 fix mozilla bug
TBR=bsalomon@google.com
BUG=skia:4621

Review URL: https://codereview.chromium.org/1500023002
2015-12-04 08:51:11 -08:00
benjaminwagner
886e5e41db Fix overflow caught by ASAN.
BUG=skia:

Review URL: https://codereview.chromium.org/1498923002
2015-12-04 08:48:26 -08:00
msarett
be8216a922 Make SkAndroidCodec support ico
BUG=skia:

Review URL: https://codereview.chromium.org/1472933002
2015-12-04 08:00:50 -08:00
bsalomon
ea75053c96 Speculative fix for win8 bot crash in ~GrAutoLocaleSetter
Review URL: https://codereview.chromium.org/1493913008
2015-12-04 07:27:36 -08:00
scroggo
97ff7f5662 Revert of Make SkAndroidCodec support ico (patchset #7 id:130002 of https://codereview.chromium.org/1472933002/ )
Reason for revert:
Crashing: https://uberchromegw.corp.google.com/i/client.skia.android/builders/Test-Android-GCC-NexusPlayer-CPU-SSE4-x86-Release/builds/1499/steps/dm/logs/stdio

Also, related ASAN failures:
https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-ASAN/builds/3676/steps/dm/logs/stdio

Original issue's description:
> Make SkAndroidCodec support ico
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/1603e9310f62cf0dd543cdb09dea06aa78373f13

TBR=djsollen@google.com,msarett@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1498903004
2015-12-04 07:09:57 -08:00
borenet
41cbf3f807 Add android_skp_capture.py, JSON file for geniewidget
The script runs through the directory of JSON files, capturing SKPs from
the apps specified by the JSON files.

BUG=skia:

Review URL: https://codereview.chromium.org/1483063006
2015-12-04 06:59:31 -08:00
robertphillips
433625e67c Reduce calls sites where both the GrDrawContext & GrRenderTarget are both passed
TBR=bsalomon@google.com

Review URL: https://codereview.chromium.org/1494083003
2015-12-04 06:58:16 -08:00
mtklein
66cfcffd5d simplify nanobench --quiet / -q output
This tries to cut things down to the very minimum you might want to know:

$ out/Release/nanobench --match nytimes --config 8888 gpu -q
Timer overhead: 29.6ns
! -> high variance, ? -> moderate variance
    micros       bench
   2479.05 !    desk_nytimes.skp_1_mpd    8888
   1313.92      desk_nytimes.skp_1_mpd    gpu
   3617.65      desk_nytimes.skp_1    8888
   1158.34      desk_nytimes.skp_1    gpu
   1368.99 !    keymobi_nytimes_com_.skp_1_mpd    8888
    393.40      keymobi_nytimes_com_.skp_1_mpd    gpu
   1179.68 !    keymobi_nytimes_com_.skp_1    8888
    342.74      keymobi_nytimes_com_.skp_1    gpu

All times are printed in microseconds, and high variance runs are marked.

BUG=skia:

Review URL: https://codereview.chromium.org/1493313003
2015-12-04 06:35:30 -08:00
msarett
1603e9310f Make SkAndroidCodec support ico
BUG=skia:

Review URL: https://codereview.chromium.org/1472933002
2015-12-04 05:43:09 -08:00
kkinnunen
bbf2ce4b06 Load ANGLE EGL library correctly on Linux
Assign dynamically loaded ANGLE EGL library to correct variable.

BUG=skia:

Review URL: https://codereview.chromium.org/1494963002
2015-12-03 23:11:40 -08:00
kkinnunen
a18a8bca24 Skip dm GPU configs when context creation fails
Skip dm GPU configs when context creation fails instead of stopping
the whole dm run.

Review URL: https://codereview.chromium.org/1497713002
2015-12-03 23:04:50 -08:00
bsalomon
6dea83f244 Add option to draw wireframe batch bounds
Committed: https://skia.googlesource.com/skia/+/26489ef21ff5df33b8cb5943fddfd4604e203960

Review URL: https://codereview.chromium.org/1494473005
2015-12-03 12:58:06 -08:00
reed
6f2753deee add bench for sprite-like drawing w/ imagefilters
visualbench run on Mac Pro

curr/maxrss	loops	min	median	mean	max	stddev	samples   	config	bench
  96/96  MB	16	412µs	413µs	413µs	414µs	0%	▄▁█▅▅▅▅▆▅▃▅	gpu	warmupbench
  98/98  MB	4	1.86ms	1.86ms	1.86ms	1.86ms	0%	▁▂▇█▆▅▇▄▃▃▃	gpu	image-filter-sprite-draw-image
 100/100 MB	4	1.86ms	1.86ms	1.86ms	1.86ms	0%	▆▇▅▄▁▆▅█▅▄▅	gpu	image-filter-sprite-draw-bitmap
 100/100 MB	32	547µs	548µs	590µs	1.01ms	24%	█▁▁▁▁▁▁▁▁▁▁	gpu	image-filter-sprite-draw-sprite

BUG=skia:

Review URL: https://codereview.chromium.org/1497843003
2015-12-03 12:56:59 -08:00
msarett
cb0d5c940a Add currScanline() getter to SkCodec API
This is more correct than using nextScanline() for the
SkGifCodec scanline decoder (since we will get a strange
result in the interlaced case) and is necessary if we want
to add scanline decoding to SkIcoCodec.

This does not actually fix bugs or change behavior.

BUG=skia:

Review URL: https://codereview.chromium.org/1489163002
2015-12-03 12:23:43 -08:00
erikchen
2b1516fe35 Update documentation for SkFontMgr methods.
The appropriate way to get the default system font is to pass |nullptr| as the
familyName. This was not clear from the interface, which may be why ui/gfx/ has
the wrong behavior.

BUG=chromium:564266

Review URL: https://codereview.chromium.org/1494253002
2015-12-03 12:12:13 -08:00
scroggo
e2725f5840 Revert of Add option to draw wireframe batch bounds (patchset #6 id:100001 of https://codereview.chromium.org/1494473005/ )
Reason for revert:
Looks to be responsible for breaking builds e.g. https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Mac10.9-Clang-MacMini6.2-GPU-HD4000-x86_64-Debug/builds/3030/steps/dm/logs/stdio

Original issue's description:
> Add option to draw wireframe batch bounds
>
> Committed: https://skia.googlesource.com/skia/+/26489ef21ff5df33b8cb5943fddfd4604e203960

TBR=joshualitt@google.com,bsalomon@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1492633007
2015-12-03 10:30:34 -08:00
scroggo
4f11b1be55 Stop disabling fixed test
skbug.com/1282 has been fixed, so there is no need to skip these
images

BUG=skia:1282

Review URL: https://codereview.chromium.org/1391143007
2015-12-03 09:49:02 -08:00
msarett
54ed1edda5 Match libjpeg-turbo name change in Android
BUG=skia:

Review URL: https://codereview.chromium.org/1464423003
2015-12-03 09:48:54 -08:00
bsalomon
26489ef21f Add option to draw wireframe batch bounds
Review URL: https://codereview.chromium.org/1494473005
2015-12-03 09:36:49 -08:00
kjlubick
222b30d3a8 Make building with clang documentation a bit easier to find
BUG=skia:
NOTRY=true
DOCS_PREVIEW= https://skia.org/?cl=1495913002

Review URL: https://codereview.chromium.org/1495913002
2015-12-03 09:20:55 -08:00
egdaniel
7ea439b220 Create GLSLUniformHandler class for gpu backend
BUG=skia:

Review URL: https://codereview.chromium.org/1490283004
2015-12-03 09:20:44 -08:00
jvanverth
73063dc517 Add transfer buffer support.
BUG=skia:4604

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

Review URL: https://codereview.chromium.org/1490473003
2015-12-03 09:15:47 -08:00
fmalita
c2e0ac4fce Don't use the Sk4f gradient impl without SIMD
Also remove the SK_SUPPORT_LEGACY_LINEAR_GRADIENT_TABLE guard since it is no
longer used in Chromium.

BUG=chromium:563492
R=reed@google.com,mtklein@google.com
CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Review URL: https://codereview.chromium.org/1489233005
2015-12-03 09:15:26 -08:00
egdaniel
53c5d5fb79 Revert of Add transfer buffer support. (patchset #9 id:160001 of https://codereview.chromium.org/1490473003/ )
Reason for revert:
speculative revert for deps roll failures

Original issue's description:
> Add transfer buffer support.
>
> BUG=skia:4604
>
> Committed: https://skia.googlesource.com/skia/+/fa498fe12239988578465d0dee69f0d5645bb361

TBR=bsalomon@google.com,jvanverth@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:4604

Review URL: https://codereview.chromium.org/1496843003
2015-12-03 06:32:22 -08:00
benjaminwagner
404816ee3f Fix ODR violation.
src/ports/SkFontMgr_fontconfig.cpp and src/fonts/SkFontMgr_fontconfig.cpp both define SkFontMgr_fontconfig.

BUG=skia:
TBR=bungeman

Review URL: https://codereview.chromium.org/1491943004
2015-12-03 05:04:03 -08:00
reed
7850eb2f35 API to support native scaling by image-generator
BUG=skia:

Review URL: https://codereview.chromium.org/1396323007
2015-12-02 14:19:47 -08:00
joshualitt
dc5685ac37 Wire up resource cache stats dumping in nanobench
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1495543003
2015-12-02 14:08:25 -08:00
joshualitt
7384d07855 Wire up new define in buildbot_spec
BUG=skia:

Review URL: https://codereview.chromium.org/1492133002
2015-12-02 14:04:46 -08:00