Commit Graph

1288 Commits

Author SHA1 Message Date
xidachen
467ddc0b24 SkBlurImageFilter returns input when sigma = 0
In the current implementation, a blur filter is always created even in the
case when sigma.fX == 0 && sigma.fY == 0. This CL makes the blur filter
return input in this case.

BUG=568393

Review URL: https://codereview.chromium.org/1518643002
2015-12-10 12:08:44 -08:00
scroggo
565901db95 Switch SkAutoMalloc to SkAutoTMalloc to avoid cast
Make SkAutoTMalloc's interface look more like SkAutoMalloc:
- add free(), which does what you expect
- make reset() return a pointer fPtr

No public API changes (SkAutoTMalloc is in include/private)

BUG=skia:2148

Review URL: https://codereview.chromium.org/1516833003
2015-12-10 10:44:13 -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
halcanary
e36ec87176 SkBitmap::installPixels(const SkPixmap&);
Review URL: https://codereview.chromium.org/1505333002
2015-12-09 11:36:59 -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
mtklein
1f6a1bd969 spin off remaining integer overflow fixes
- 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
2015-12-08 10:53:01 -08:00
kkinnunen
64492c43c3 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

Review URL: https://codereview.chromium.org/1448883002
2015-12-08 01:24:40 -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
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
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
8fd844f38e reset shader compilations for stats
BUG=skia:

Review URL: https://codereview.chromium.org/1491823003
2015-12-02 13:36:47 -08:00
joshualitt
e45c81c8f3 Began logging more gpu stats from nanobench
BUG=skia:

Review URL: https://codereview.chromium.org/1489033004
2015-12-02 09:05:38 -08:00
scroggo
9323dc6a72 Revert of Fix Android framework build (patchset #1 id:1 of https://codereview.chromium.org/1491563003/ )
Reason for revert:
eeebdb538d was reverted, so this one needs to be reverted, too

Original issue's description:
> Fix Android framework build
>
> eeebdb538d did not update a Config that
> only builds if SK_BUILD_FOR_ANDROID_FRAMEWORK. This appears to be the
> necessary parameter that is missing.
>
> BUG=skia:2992
>
> Committed: https://skia.googlesource.com/skia/+/cb6cb21cd9d27054810d2c80ef534dcddd615d4b

TBR=bsalomon@google.com,tomhudson@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:2992

Review URL: https://codereview.chromium.org/1487033002
2015-12-01 08:08:18 -08:00
bsalomon
a0a024e323 Revert of Make NVPR a GL context option instead of a GL context (patchset #2 id:20001 of https://codereview.chromium.org/1448883002/ )
Reason for revert:
BUG=skia:4609

skbug.com/4609

Seems like GrContextFactory needs to fail when the NVPR option is requested but the driver version isn't sufficiently high.

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

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

Review URL: https://codereview.chromium.org/1486153002
2015-12-01 07:58:44 -08:00
scroggo
cb6cb21cd9 Fix Android framework build
eeebdb538d did not update a Config that
only builds if SK_BUILD_FOR_ANDROID_FRAMEWORK. This appears to be the
necessary parameter that is missing.

BUG=skia:2992

Review URL: https://codereview.chromium.org/1491563003
2015-12-01 07:53:37 -08:00
mtklein
9db43ac4ee Add Sk4f::ToBytes(uint8_t[16], Sk4f, Sk4f, Sk4f, Sk4f)
This is a big speedup for float -> byte.  E.g. gradient_linear_clamp_3color:
 x86-64 147µs -> 103µs  (Broadwell MBP)
 arm64 2.03ms -> 648µs  (Galaxy S6)
 armv7 1.12ms -> 489µs  (Galaxy S6, same device!)

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

Review URL: https://codereview.chromium.org/1483953002
2015-12-01 07:10:21 -08:00
kkinnunen
eeebdb538d 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

Review URL: https://codereview.chromium.org/1448883002
2015-12-01 05:10:48 -08:00
hendrikw
4870e6d4c9 skia: Holding onto the image in the benchmark causes issues
Skia'a nanobench can hold onto an image, that causes the lifetime
of GrGLGpu to extend past that of the GL interface.

Kill reference to surface and image before killing the interface

Review URL: https://codereview.chromium.org/1472433002
2015-11-24 05:50:23 -08:00
kkinnunen
5931922997 Remove GrContextFactory::getGLContext
Remove GrContextFactory::getGLContext, it is problematic:

It has the bug of not checking for the context type.

It also is error-prone, since the GL context is not made
current, but it is callers may assume it is current.

It is also not used very much.

Clients can use GrContextFactory::getContextInfo.

BUG=skia:

Review URL: https://codereview.chromium.org/1455093003
2015-11-22 23:23:53 -08:00
mtklein
56da025020 Switch uses of SkChecksum::Compute to Murmur3.
SkChecksum::Compute is a very, very poorly distributed hash function.
This replaces all remaining uses with Murmur3.

The only interesting stuff is in src/gpu.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/1d024a3c909ae5cefa5e8b339e2b52dc73ee85ac

Committed: https://skia.googlesource.com/skia/+/540e95483d285b555e9b1a73d18c16e7d7c0deba

Review URL: https://codereview.chromium.org/1436973003
2015-11-16 11:16:23 -08:00
mtklein
3c2d32b8e2 Revert of Switch uses of SkChecksum::Compute to Murmur3. (patchset #2 id:20001 of https://codereview.chromium.org/1436973003/ )
Reason for revert:
gotta put back *compute = 0.

Original issue's description:
> Switch uses of SkChecksum::Compute to Murmur3.
>
> SkChecksum::Compute is a very, very poorly distributed hash function.
> This replaces all remaining uses with Murmur3.
>
> The only interesting stuff is in src/gpu.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/1d024a3c909ae5cefa5e8b339e2b52dc73ee85ac
>
> Committed: https://skia.googlesource.com/skia/+/540e95483d285b555e9b1a73d18c16e7d7c0deba

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

Review URL: https://codereview.chromium.org/1448023005
2015-11-16 11:01:18 -08:00
mtklein
540e95483d Switch uses of SkChecksum::Compute to Murmur3.
SkChecksum::Compute is a very, very poorly distributed hash function.
This replaces all remaining uses with Murmur3.

The only interesting stuff is in src/gpu.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/1d024a3c909ae5cefa5e8b339e2b52dc73ee85ac

Review URL: https://codereview.chromium.org/1436973003
2015-11-16 09:08:21 -08:00
msarett
4b0778ec49 Remove dependency on src/android from dm and nanobench
BUG=skia:

Review URL: https://codereview.chromium.org/1443033002
2015-11-13 09:59:11 -08:00
mtklein
0274efbd3d Revert of Switch uses of SkChecksum::Compute to Murmur3. (patchset #2 id:20001 of https://codereview.chromium.org/1436973003/ )
Reason for revert:
I would not have expected this to change any images.

Looks like it's changed both MSAA and non-MSAA GMs:
https://gold.skia.org/search2?blame=1d024a3c909ae5cefa5e8b339e2b52dc73ee85ac&unt=true&head=true&query=source_type%3Dgm

Original issue's description:
> Switch uses of SkChecksum::Compute to Murmur3.
>
> SkChecksum::Compute is a very, very poorly distributed hash function.
> This replaces all remaining uses with Murmur3.
>
> The only interesting stuff is in src/gpu.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/1d024a3c909ae5cefa5e8b339e2b52dc73ee85ac

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

Review URL: https://codereview.chromium.org/1445523003
2015-11-13 07:07:47 -08:00
mtklein
1d024a3c90 Switch uses of SkChecksum::Compute to Murmur3.
SkChecksum::Compute is a very, very poorly distributed hash function.
This replaces all remaining uses with Murmur3.

The only interesting stuff is in src/gpu.

BUG=skia:

Review URL: https://codereview.chromium.org/1436973003
2015-11-12 15:44:09 -08:00
msarett
84a8065275 Reorganize BRD code in new tools directory
Rename SkCodecTools.h to SkBitmapRegionDecoderPriv.h

Move BRD code to its own directory in tools.  This
allows us to not need to expose the entire tools
directory in Android.

BUG=skia:

Review URL: https://codereview.chromium.org/1417393004
2015-11-10 15:49:46 -08:00
msarett
0459c9425f Delete dead subset benches from nanobench
This approach to subset decoding is no longer supported.
We have replaced it with an implementation that does not
depend on forked libraries.
https://codereview.chromium.org/1406153015/

BUG=skia:

Review URL: https://codereview.chromium.org/1430493005
2015-11-10 14:52:13 -08:00
halcanary
6950de6c41 Comments Style: s/skbug.com/bug.skia.org/
DOCS_PREVIEW= https://skia.org/?cl=1432503003

Review URL: https://codereview.chromium.org/1432503003
2015-11-07 05:29:00 -08:00
msarett
5cb4885b4c Rename SkBitmapRegionDecoder and Create function
We no longer need to worry about namespace
conflicts SkBitmapRegionDecoder in Android (which
we are replacing).

Additionally, the static Create() function does not
need to repeat the name BitmapRegionDecoder.

BUG=skia:

Review URL: https://codereview.chromium.org/1415243007
2015-11-06 08:56:32 -08:00
scroggo
501b7344f1 Combine native sampling with sampling
In SkSampledCodec, allow the native codec to do its scaling first, then
sample on top of that. Since the only codec which can do native scaling
is JPEG, and we know what it can do, hard-code for JPEG. Check to see
if the sampleSize is something JPEG supports, or a multiple of
something it supports. If so, use JPEG directly or combine them.

BUG=skia:4320

Review URL: https://codereview.chromium.org/1417583009
2015-11-03 07:55:12 -08:00
senorblanco
a8bd38e178 Add cropped-then-expanded test cases to blur_image_filter tests.
These are benches similar to the imagefilterscropexpand GM: an
input filter is cropped to a smaller size, then the blur is re-expanded
out to a larger size.

BUG=skbug:4502

Review URL: https://codereview.chromium.org/1412373004
2015-10-30 13:17:20 -07:00
mtklein
bbba16878f nanobench: fix and simplify --samplingTime
Recent changes to WallTimer broke --samplingTime.  In particular, this idiom became nonsensical:
   WallTimer timer;
   timer.start();
   do {
     ...
     timer.end();
   } while(timer.fWall < ...);

WallTimer started making private use of fWall between when start() and end() were called, so the second time around the loop we end up with nonsense.

If that makes no sense, don't worry.  The code here using now_ms() is just as fast, just as precise, and clearer.

I took the opportunity to simplify --samplingTime <complicated string parsing> to --ms <int>, and to simplify the code that depends on it.

BUG=skia:

Review URL: https://codereview.chromium.org/1419103004
2015-10-28 11:36:30 -07:00
msarett
35e5d1b449 Refactor SkBitmapRegionDecoderInterface for Android
The result SkBitmap, the pixel allocator, and the alpha
preference need to be communicated from the client to
the region decoder.

BUG=skia:

Review URL: https://codereview.chromium.org/1418093006
2015-10-27 12:50:25 -07:00
cdalton
e6d2024c68 Flush GrContext between benchmark draw loops
This change updates a small subset of benchmarks to flush the GrContext
between draw loops (specifically SKP benchmarks, SampleApp, and the
warmup in visualbench). This helps improve timing accuracy by not
allowing the gpu to batch across draw boundaries in the affected
benchmarks.

BUG=skia:

Review URL: https://codereview.chromium.org/1427533002
2015-10-26 13:45:29 -07:00
egdaniel
cb7ba1eafc Make appending default precision be controled by GLSL
BUG=skia:

Review URL: https://codereview.chromium.org/1403373012
2015-10-26 08:38:26 -07:00
tomhudson
3c8ceb7350 Simplify linkages to Android framework internals
We've migrated SkHwuiRenderer into the Android Framework as
android::uirenderer::TestWindowContext in response to an internal
bug; we now delete that class and change our build references here.

R=djsollen@google.com

Review URL: https://codereview.chromium.org/1407053009
2015-10-26 07:21:32 -07:00
senorblanco
7b87ee7a1c Image filters: simplify filterInputGPU().
Remove a call to canFilterImageGPU() / filterImageGPU() from
filterInputGPU(). There's no reason to do this, since
the subsequent filterImage() call will do it for us anyway.
And this call actually defeats caching (as demonstrated by
the attached bench).

BUG=skia:

Review URL: https://codereview.chromium.org/1411013004
2015-10-26 06:55:47 -07:00
egdaniel
472d44e8f8 Add version string and force highp NDS transfrom to GLSLCaps
This also include the use of any() in the shaders.

BUG=skia:

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

Review URL: https://codereview.chromium.org/1417993004
2015-10-22 08:20:00 -07:00
msarett
26ad17b8f8 Implementation of SkBitmapRegionDecoder using SkAndroidCodec
Includes testing in DM and nanobench

BUG=skia:

Review URL: https://codereview.chromium.org/1402863002
2015-10-22 07:29:19 -07:00
egdaniel
899ba37db3 Revert of Add version string and force highp NDS transfrom to GLSLCaps (patchset #3 id:40001 of https://codereview.chromium.org/1417993004/ )
Reason for revert:
breaking bots

Original issue's description:
> Add version string and force highp NDS transfrom to GLSLCaps
>
> This also include the use of any() in the shaders.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/cef4bce8e260b49bf3417eadbac806cf7d39cdc8

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

Review URL: https://codereview.chromium.org/1420033002
2015-10-22 07:08:37 -07:00
egdaniel
cef4bce8e2 Add version string and force highp NDS transfrom to GLSLCaps
This also include the use of any() in the shaders.

BUG=skia:

Review URL: https://codereview.chromium.org/1417993004
2015-10-22 06:54:15 -07:00
egdaniel
0d3f061262 Move GrGLShaderVar to GrGLSL
BUG=skia:

Review URL: https://codereview.chromium.org/1417123002
2015-10-21 10:45:48 -07:00
egdaniel
f529439fea Move shader precision modifier check onto GLSLCaps
BUG=skia:

Review URL: https://codereview.chromium.org/1414373002
2015-10-21 07:14:17 -07:00
msarett
74deb981d5 Valgrind experiment
I don't really expect this to fix the errors, but I think
it's worth it to try shaking up the valgrind bot overnight.
There's some strange behavior with regard to color type on
the valgrind bot that I can't reproduce and that we aren't
seeing on any of the other bots.

TBR=mtklein,scroggo

BUG=skia:

Review URL: https://codereview.chromium.org/1418723002
2015-10-20 16:45:56 -07:00
mtklein
4dfdbb19ba nanobench: Add some Valgrind failure paranoia.
Trying to figure out

http://build.chromium.org/p/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Valgrind/builds/586/steps/nanobench/logs/stdio

BUG=skia:4482

Review URL: https://codereview.chromium.org/1418633002
2015-10-20 07:45:29 -07:00
robertphillips
423f6461e9 Add SkTTopoSort
BUG=skia:4094

Review URL: https://codereview.chromium.org/1414503003
2015-10-19 12:15:55 -07:00
bsalomon
2f8ac3538d Misc: Don't run etc1 bench with invalid image and fix VS2015 build warning
Review URL: https://codereview.chromium.org/1409993003
2015-10-19 08:29:16 -07:00
scroggo
860e8a6719 Renable image benchmarking
- Remove --images '' to renable image benchmarking
- Add a flag to disable testing JPEG's buildTileIndex, since it also leaks memory
- Do not run images on GPU
- Do not run large interlaced images on 32 bit bots
- When buildTileIndex is not being used in the subset benches, do not use it for BRD

BUG=skia:3418
BUG=skia:4469
BUG=skia:4471
BUG=skia:4360

Review URL: https://codereview.chromium.org/1396113002
2015-10-15 07:51:28 -07:00
scroggo
fd2b067b9e Remove unnecessary allocation in nanobench
Review URL: https://codereview.chromium.org/1408593002
2015-10-14 09:00:36 -07:00
scroggo
2da1a854b0 Stop benching PNG buildTileIndex by default
It leaks memory and kills the bots. Supply an option to run it for
local comparison.

BUG=skia:4360
BUG=skia:3418

Review URL: https://codereview.chromium.org/1396613007
2015-10-13 13:33:33 -07:00