Commit Graph

1053 Commits

Author SHA1 Message Date
bsalomon
69ed47f42d Make GrGpuResource::gpuMemorySize non-virtual w/ onGpuMemorySize virtual impl
BUG=skia:2889

Review URL: https://codereview.chromium.org/702413003
2014-11-12 11:13:39 -08:00
mtklein
bf5dd4170f Add benchmark to compare different BBH query patterns.
On my laptop:
maxrss	loops	min	median	mean	max	stddev	samples   	config	bench
  37M	1	14ms	14.2ms	14.6ms	18.2ms	9%	▁█▁▁▁▁▂▂▂▁	gpu	tiled_playback_tilegrid_tiled
  40M	1	17ms	17.2ms	17.2ms	17.6ms	1%	▆▃▁█▄▇▂▁▁▁	gpu	tiled_playback_tilegrid_random
  40M	1	14.6ms	14.9ms	15.8ms	19.1ms	11%	▂▁▁▁▁▁▁█▅█	gpu	tiled_playback_rtree_tiled
  43M	1	16.5ms	16.7ms	16.8ms	17.4ms	1%	▂▃▅█▃▂▁▃▃▂	gpu	tiled_playback_rtree_random
  43M	1	15.9ms	16.1ms	16.5ms	18.7ms	6%	▁▁█▇▁▁▁▂▁▁	gpu	tiled_playback_none_tiled
  44M	1	17.9ms	17.9ms	18ms	18.1ms	1%	▂▁▅▁▇▃▁▂█▇	gpu	tiled_playback_none_random

TileGrid and RTree perform pretty much the same, both beating no BBH.

BUG=skia:3085

Review URL: https://codereview.chromium.org/699313006
2014-11-11 10:39:27 -08:00
kkinnunen
839425177c Avoid warning in nanobench related to loop count with nvprmsaa4
The tests path_hairline_{small,big}_AA_conic were calling the test
function with NVPR. This caused a warning in nanobench.

The here removed hunk comes from commit referring to skia:2042 ("Enable
NVPR by default"). This is a workaround for a bug. The bug is fixed by
the commit referring to skia:2078 ("Logan bot fails NVPR assertion in
bench").

The proper fix is indeed make sure that path renderer chain ends up
trying software path renderer, if the path contains conics and is a
hairline.

The removed hunk refers also to skia:2033 ("Figure out what is happening
with conic path segments in NVPR"). The above solution is correct also in case
NVPR would support conics, as NVPR would not still support hairlines.

BUG=skia:2078

Review URL: https://codereview.chromium.org/685213005
2014-11-11 06:57:07 -08:00
bsalomon
8b79d23f82 Use GrResourceCache2 to service content key lookups
BUG=skia:2889

Review URL: https://codereview.chromium.org/707493002
2014-11-10 10:19:06 -08:00
jvanverth
4736e1434a Get gpudft support working in dm, gm, nanobench and bench_pictures
Adds a new config to test distance field text.
Clean up some flags and #defines to read "distance field text",
not "distance field fonts" to be consistent with Chromium

NOTREECHECKS=true

Committed: https://skia.googlesource.com/skia/+/06ba179838ba4fe187cf290750aeeb4a02a2960b

Review URL: https://codereview.chromium.org/699453005
2014-11-07 07:12:46 -08:00
jvanverth
aa30ab3079 Revert of Get gpudft support working in dm, gm, nanobench and bench_pictures (patchset #2 id:20001 of https://codereview.chromium.org/699453005/)
Reason for revert:
Not compiling in ANGLE build

Original issue's description:
> Get gpudft support working in dm, gm, nanobench and bench_pictures
>
> Adds a new config to test distance field text.
> Clean up some flags and #defines to read "distance field text",
> not "distance field fonts" to be consistent with Chromium
>
> NOTREECHECKS=true
>
> Committed: https://skia.googlesource.com/skia/+/06ba179838ba4fe187cf290750aeeb4a02a2960b

TBR=bsalomon@google.com,mtklein@google.com,reed@google.com
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/707723005
2014-11-06 13:52:45 -08:00
jvanverth
06ba179838 Get gpudft support working in dm, gm, nanobench and bench_pictures
Adds a new config to test distance field text.
Clean up some flags and #defines to read "distance field text",
not "distance field fonts" to be consistent with Chromium

NOTREECHECKS=true

Review URL: https://codereview.chromium.org/699453005
2014-11-06 13:38:52 -08:00
mtklein
527930fdbb Detect loops overflow for gpu benches.
NOTREECHECKS=true

BUG=skia:

Review URL: https://codereview.chromium.org/709473002
2014-11-06 08:04:35 -08:00
mtklein
a30b2ee0da PictureRecordBench's benchmarks are no longer relevant with SkRecord.
BUG=skia:

Review URL: https://codereview.chromium.org/698163004
2014-11-04 11:14:48 -08:00
mtklein
6838d854a8 Try out SkTree in nanobench.
Looks like a fairly large recording speed win with no playback cost.

BUG=skia:

Review URL: https://codereview.chromium.org/653023003
2014-10-29 14:15:10 -07:00
bsalomon
f2703d83da rename GrTextureDesc->GrSurfaceDesc, GrTextureFlags->GrSurfaceFlags
Review URL: https://codereview.chromium.org/682223002
2014-10-28 14:33:06 -07:00
mtklein
4477c3c0e6 Cut down SkBBH API more.
- The expected case is now a single bulk-load insert() call instead of N;
  - reserve() and flushDeferredInserts() can fold into insert() now;
  - SkBBH subclasses may take ownership of the bounds

This appears to be a performance no-op on both my Mac and N5.  I guess
even the simplest indirect branch predictor ("same as last time") can predict
the repeated virtual calls to SkBBH::insert() perfectly.

BUG=skia:

Review URL: https://codereview.chromium.org/670213002
2014-10-27 10:27:10 -07:00
bsalomon
06cddec857 Print GPU cache stats in nanobench/dm with veryVerbose
Review URL: https://codereview.chromium.org/680553002
2014-10-24 10:40:50 -07:00
mtklein
14e4d392d4 Revert "Revert of create shaderproc for nofilter-opaque-dx (patchset #7 id:120001 of https://codereview.chromium.org/664783004/)"
This reverts commit 430b795cc8 and adds suppressions.

BUG=skia:

Review URL: https://codereview.chromium.org/673023002
2014-10-23 14:35:01 -07:00
mtklein
430b795cc8 Revert of create shaderproc for nofilter-opaque-dx (patchset #7 id:120001 of https://codereview.chromium.org/664783004/)
Reason for revert:
Many GMs fixed.  Needs rebaseline, perhaps layout test rebaselines.

Original issue's description:
> create shaderproc for nofilter-opaque-dx
>
>
> speedup nofilter
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/a40a276bcee2246439dcf816273c1307f5c3c69f

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

Review URL: https://codereview.chromium.org/656913005
2014-10-23 12:44:40 -07:00
reed
a40a276bce create shaderproc for nofilter-opaque-dx
speedup nofilter

BUG=skia:

Review URL: https://codereview.chromium.org/664783004
2014-10-23 12:22:40 -07:00
scroggo
2a1208017d Qualify the return value of SkImageDecoder::decode
Add a new enum to differentiate between a complete decode and a
partial decode (with the third value being failure). Return this
value from SkImageDecoder::onDecode (in all subclasses, plus
SkImageDecoder_empty) and ::decode.

For convenience, if the enum is treated as a boolean, success and
partial success are both considered true.

Note that the static helper functions (DecodeFile etc) still return
true and false (for one thing, this allows us to continue to use
SkImageDecoder::DecodeMemory as an SkPicture::InstallPixelRefProc in
SkPicture::CreateFromStream).

Also correctly report failure in SkASTCImageDecoder::onDecode when
SkTextureCompressor::DecompressBufferFromFormat fails.

BUG=skia:3037
BUG:b/17419670

Review URL: https://codereview.chromium.org/647023006
2014-10-22 12:07:00 -07:00
fmalita
171e5b73a8 SkResourceCache::Key namespace support.
Add a unique-per-subclass namespace tag to make Keys from different
domains comparable.

Also drop the SkPictureShader cache and convert to using the global
resource cache instead.

R=reed@google.com,mtklein@google.com,robertphillips@google.com

Review URL: https://codereview.chromium.org/668223002
2014-10-22 11:20:40 -07:00
mtklein
c7f7f467df Draw SKPs in 256x256 tiles in nanobench.
(This CL will certainly trigger performance regression alerts.  Tiled drawing is slower than non-tiled drawing.)

BUG=skia:

Review URL: https://codereview.chromium.org/669983002
2014-10-21 12:29:25 -07:00
mtklein
dba3e64ab9 Revert of Start to vectorize SkTileGrid. (patchset #48 id:1670001 of https://codereview.chromium.org/634543004/)
Reason for revert:
breaks chrome GPU debug bots

Original issue's description:
> Start to vectorize SkTileGrid.
>
> This adds Sk4x.h to help.
>
> BUG=skia:3041
>
> Committed: https://skia.googlesource.com/skia/+/90c7992bfc6330f070f7704d63372a0ec8410170
>
> CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu12-ShuttleA-GTX660-x86-Debug-Trybot
>
> Committed: https://skia.googlesource.com/skia/+/958e9628d5f9a81aeafa78572cb4afc4b19a455a

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

Review URL: https://codereview.chromium.org/637863005
2014-10-20 10:43:55 -07:00
mtklein
958e9628d5 Start to vectorize SkTileGrid.
This adds Sk4x.h to help.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/90c7992bfc6330f070f7704d63372a0ec8410170

CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu12-ShuttleA-GTX660-x86-Debug-Trybot

Review URL: https://codereview.chromium.org/634543004
2014-10-20 07:12:34 -07:00
mtklein
2348199907 Revert of Start to vectorize SkTileGrid. (patchset #45 id:1430002 of https://codereview.chromium.org/634543004/)
Reason for revert:
Many GCC bots missing __builtin_shuffle, e.g. Test-Ubuntu12-ShuttleA-GTX660-x86-Debug-Trybot.

Original issue's description:
> Start to vectorize SkTileGrid.
>
> This adds Sk4x.h to help.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/90c7992bfc6330f070f7704d63372a0ec8410170

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

Review URL: https://codereview.chromium.org/663663002
2014-10-16 15:27:47 -07:00
mtklein
90c7992bfc Start to vectorize SkTileGrid.
This adds Sk4x.h to help.

BUG=skia:

Review URL: https://codereview.chromium.org/634543004
2014-10-16 15:21:43 -07:00
mtklein
e070c2bf54 nanobench: flush after recording every Nth data point.
Got to keep our precious data in event of a crash.

With --flushEvery 10 I'm not seeing this cost any wall time.

BUG=skia:

Review URL: https://codereview.chromium.org/653083003
2014-10-14 08:40:43 -07:00
reed
5324978a88 detect --loops is < 0 and interpret that as running forever (mostly)
BUG=skia:

Review URL: https://codereview.chromium.org/643143002
2014-10-10 09:09:52 -07:00
reed
40636a5303 faster SkRect::sort
BUG=skia:

Review URL: https://codereview.chromium.org/646863002
2014-10-10 05:50:15 -07:00
reed
1119c87065 cleanup and optimize rect intersect routines
BUG=skia:

Review URL: https://codereview.chromium.org/640723004
2014-10-09 14:29:01 -07:00
sugoi
12b1831ea4 Attempt at fixing color cube bench
The original bench was hitting the cache since it was using the same color filter for all loops. By creating a new color filter within the loop, at least this part of it is solved. I'm not 100% sure this is the right way, but at least the numbers are a bit more reasonable and are affected by the output resolution.

BUG=skia:

Review URL: https://codereview.chromium.org/648483002
2014-10-09 11:35:09 -07:00
bsalomon
1e2530babb Use presence of a content key as non-scratch indicator
BUG=skia:2889

Committed: https://skia.googlesource.com/skia/+/9eefe0851eeaa8ded05b4774ebcb38ed201d5dbf

Review URL: https://codereview.chromium.org/639873002
2014-10-09 09:57:18 -07:00
caryclark
feff7d2d77 Draw more accurate thick-stroked Beziers (disabled)
Draw thick-stroked Beziers by computing the outset quadratic, measuring the error, and subdividing until the error is within a predetermined limit.

To try this CL out, change src/core/SkStroke.h:18 to

  #define QUAD_STROKE_APPROXIMATION 1

or from the command line: CPPFLAGS="-D QUAD_STROKE_APPROXIMATION=1" ./gyp_skia

Here's what's in this CL:

bench/BezierBench.cpp : a microbench for examining where the time is going
gm/beziers.cpp        : random Beziers with various thicknesses
gm/smallarc.cpp       : a distillation of bug skia:2769
samplecode/SampleRotateCircles.cpp : controls added for error, limit, width
src/core/SkStroke.cpp : the new stroke implementation (disabled)
tests/StrokerTest.cpp : a stroke torture test that checks normal and extreme values

The new stroke algorithm has a tweakable parameter:

  stroker.setError(1);  (SkStrokeRec.cpp:112)

The stroke error is the allowable gap between the midpoint of the stroke quadratic and the center Bezier. As the projection from the quadratic approaches the endpoints, the error is decreased proportionally so that it is always inside the quadratic curve.

An overview of how this works:
- For a given T range of a Bezier, compute the perpendiculars and find the points outset and inset for some radius.
- Construct tangents for the quadratic stroke.
- If the tangent don't intersect between them (may happen with cubics), subdivide.
- If the quadratic stroke end points are close (again, may happen with cubics), draw a line between them.
- Compute the quadratic formed by the intersecting tangents.
- If the midpoint of the quadratic is close to the midpoint of the Bezier perpendicular, return the quadratic.
- If the end of the stroke at the Bezier midpoint doesn't intersect the quad's bounds, subdivide.
- Find where the Bezier midpoint ray intersects the quadratic.
- If the intersection is too close to the quad's endpoints, subdivide.
- If the error is large proportional to the intersection's distance to the quad's endpoints, subdivide.

BUG=skia:723,skia:2769

Review URL: https://codereview.chromium.org/558163005
2014-10-09 05:36:04 -07:00
sugoi
ce686270f5 Adding 3D lut color filter
Included in this cl is support for 3D textures.

BUG=skia:

Review URL: https://codereview.chromium.org/580863004
2014-10-09 05:27:23 -07:00
kkinnunen
9e61bb7815 Make the Sk GL context class an abstract base class
Make the Sk GL context class, SkGLNativeContext, an abstract base class. Before,
it depended on ifdefs to implement the platform dependent polymorphism.  Move
the logic to subclasses of the various platform implementations.

This a step to enable Skia embedders to compile dm and bench_pictures. The
concrete goal is to support running these test apps with Chromium command buffer.

With this change, Chromium can implement its own version of SkGLNativeContext
that uses command buffer, and host the implementation in its own repository.

Implements the above by renaming the SkGLContextHelper to SkGLContext and
removing the unneeded SkGLNativeContext. Also removes
SkGLNativeContext::AutoRestoreContext functionality, it appeared to be unused:
no use in Skia code, and no tests.

BUG=skia:2992

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

Review URL: https://codereview.chromium.org/630843002
2014-10-09 05:24:15 -07:00
bsalomon
bcf0a52d4f GrResourceCache2 manages scratch texture.
BUG=skia:2889

Review URL: https://codereview.chromium.org/608883003
2014-10-08 08:40:09 -07:00
bsalomon
10805961ce Revert of Make the Sk GL context class an abstract base class (patchset #4 id:60001 of https://codereview.chromium.org/630843002/)
Reason for revert:
nanobech failing on Android

Original issue's description:
> Make the Sk GL context class an abstract base class
>
> Make the Sk GL context class, SkGLNativeContext, an abstract base class. Before,
> it depended on ifdefs to implement the platform dependent polymorphism.  Move
> the logic to subclasses of the various platform implementations.
>
> This a step to enable Skia embedders to compile dm and bench_pictures. The
> concrete goal is to support running these test apps with Chromium command buffer.
>
> With this change, Chromium can implement its own version of SkGLNativeContext
> that uses command buffer, and host the implementation in its own repository.
>
> Implements the above by renaming the SkGLContextHelper to SkGLContext and
> removing the unneeded SkGLNativeContext. Also removes
> SkGLNativeContext::AutoRestoreContext functionality, it appeared to be unused:
> no use in Skia code, and no tests.
>
> BUG=skia:2992
>
> Committed: https://skia.googlesource.com/skia/+/a90ed4e83897b45d6331ee4c54e1edd4054de9a8

TBR=kkinnunen@nvidia.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:2992

Review URL: https://codereview.chromium.org/639793002
2014-10-08 04:45:10 -07:00
kkinnunen
a90ed4e838 Make the Sk GL context class an abstract base class
Make the Sk GL context class, SkGLNativeContext, an abstract base class. Before,
it depended on ifdefs to implement the platform dependent polymorphism.  Move
the logic to subclasses of the various platform implementations.

This a step to enable Skia embedders to compile dm and bench_pictures. The
concrete goal is to support running these test apps with Chromium command buffer.

With this change, Chromium can implement its own version of SkGLNativeContext
that uses command buffer, and host the implementation in its own repository.

Implements the above by renaming the SkGLContextHelper to SkGLContext and
removing the unneeded SkGLNativeContext. Also removes
SkGLNativeContext::AutoRestoreContext functionality, it appeared to be unused:
no use in Skia code, and no tests.

BUG=skia:2992

Review URL: https://codereview.chromium.org/630843002
2014-10-08 04:14:24 -07:00
mtklein
38c05871c6 Save/Restore around bench runs.
BUG=skia:

Review URL: https://codereview.chromium.org/619353002
2014-10-02 13:03:58 -07:00
reed
337c2dd420 check for newSurface failure
BUG=skia:

Review URL: https://codereview.chromium.org/622063003
2014-10-02 12:58:49 -07:00
mtklein
8f8c25eabb Demote getCount, getDepth, and clear to RTree-only methods.
We use them only to test RTree.

BUG=skia:

Review URL: https://codereview.chromium.org/622773003
2014-10-02 09:53:04 -07:00
mtklein
6bd41969a0 BBHs: void* data -> unsigned data
Now that the old backend's not using BBHs, we can specialize them for
SkRecord's needs.  The only thing we really want to store is op index, which
should always be small enough to fit into an unsigned (unsigned also helps keep
it straight from other ints floating around).

This means we'll need half (32-bit) or a quarter (64-bit) the bytes in SkTileGrid,
because we don't have to store an extra int for ordering.

BUG=skia:2834

Review URL: https://codereview.chromium.org/617393004
2014-10-02 07:41:56 -07:00
mtklein
8e12656096 Remove DEPRECATED_beginRecording().
This removes:
  1) ability to record old pictures with SkPictureRecorder;
  2) a couple tests specific to the old backend.

The functionality of DEPRECATED_beginRecording() now lives in
(private) SkPicture::Backport(), which is the only place we
need it now.

BUG=skia:
TBR=reed@google.com

Review URL: https://codereview.chromium.org/618303002
2014-10-01 09:29:35 -07:00
bsalomon
afbf2d6273 Make "priv" classes for GrTexure and GrSurface.
R=robertphillips@google.com, egdaniel@google.com, joshualitt@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/596053002
2014-09-30 12:18:44 -07:00
robertphillips
b06e5a2f55 Revert of Make "priv" classes for GrTexure and GrSurface. (patchset #9 id:260001 of https://codereview.chromium.org/596053002/)
Reason for revert:
Breaking the Chrome builds with:

 lib/libcc.so: error: undefined reference to 'GrAutoScratchTexture::detach()'

(http://108.170.220.120:10117/builders/Canary-Chrome-Ubuntu13.10-Ninja-x86_64-DRT/builds/2990/steps/Retry_BuildContentShell_1/logs/stdio)

Original issue's description:
> Make "priv" classes for GrTexure and GrSurface.

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

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/618733002
2014-09-30 06:58:20 -07:00
bsalomon
c0eb9b9818 Make "priv" classes for GrTexure and GrSurface.
R=robertphillips@google.com, egdaniel@google.com, joshualitt@google.com, joshualitt@chromium.org

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/596053002
2014-09-29 14:20:11 -07:00
reed
c5e15a1afa remove alphatype from colortable
the owning bitmap is (already) responsible for knowing the alphatype

BUG=skia:
R=djsollen@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/611093002
2014-09-29 12:10:27 -07:00
mtklein
dc5bbab138 Have nanobench --verbose mode always just print integer nanoseconds.
Don't know that anyone but me is using this.  Speak up now!

BUG=skia:

NOTREECHECKS=true
R=mtklein@google.com, tfarina@chromium.org

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/599913002
2014-09-24 06:34:09 -07:00
mtklein
53d2562006 nanobench: print max RSS in debug mode too.
BUG=skia:2949
R=mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/581083002
2014-09-18 07:39:42 -07:00
mtklein
963504bd0a Revert of nanobench: lazily decode bitmaps from SKPs (patchset #1 id:1 of https://codereview.chromium.org/572933006/)
Reason for revert:
skia:2944

Original issue's description:
> nanobench: lazily decode bitmaps from SKPs
>
> This makes it considerably cheaper to run SKP recording benchmarks, without
> affecting their measurements and without really affecting SKP playback
> benchmarks at all.
>
> On my machine, running out/Release/nanobench --match skp --config nondrendering
> drops in run time from 6.7s to 2.5s, and the peak RAM usage drops from 129M to 50M.
>
> I'm strongly considering making this lazy decoding the default.
>
> BUG=skia:2944
>
> Committed: https://skia.googlesource.com/skia/+/d664c21a38de98d8db210c46f7a8c4187f1534da

R=robertphillips@google.com, mtklein@chromium.org
TBR=mtklein@chromium.org, robertphillips@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:2944

Author: mtklein@google.com

Review URL: https://codereview.chromium.org/554583004
2014-09-17 06:58:39 -07:00
mtklein
d664c21a38 nanobench: lazily decode bitmaps from SKPs
This makes it considerably cheaper to run SKP recording benchmarks, without
affecting their measurements and without really affecting SKP playback
benchmarks at all.

On my machine, running out/Release/nanobench --match skp --config nondrendering
drops in run time from 6.7s to 2.5s, and the peak RAM usage drops from 129M to 50M.

I'm strongly considering making this lazy decoding the default.

BUG=skia:
R=robertphillips@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/572933006
2014-09-16 13:36:12 -07:00
mtklein
e1daac9b26 Tag recording picture nesting bench as nonrendering.
Doesn't hurt as is, but we're running it several times unneccesarily.

(I couldn't compile without removing an unused constant in that other GM...)

BUG=skia:
R=fmalita@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/570303002
2014-09-16 10:12:42 -07:00
fmalita
df886ea06f Fix leak in PictureNestingBench
R=mtklein@google.com
TBR=mtklein@google.com

Author: fmalita@chromium.org

Review URL: https://codereview.chromium.org/569313004
2014-09-15 18:20:11 -07:00
fmalita
44162675ca Nested picture nanobench
Measure picture overhead for recording & playback using a Sierpinski fractal (http://skfiddle.com/c/a2b6e60d775543b7c29a5d45d0371c02) with various picture nesting levels.

R=mtklein@google.com, reed@google.com

Author: fmalita@chromium.org

Review URL: https://codereview.chromium.org/566393002
2014-09-15 16:46:16 -07:00
reed
c90e0149ec Change SkResourceCache to take a Visitor inside its find().
This reverts commit 595aa05efc.

BUG=skia:
R=mtklein@google.com, danakj@chromium.org

Author: reed@google.com

Review URL: https://codereview.chromium.org/569353002
2014-09-15 11:39:45 -07:00
reed
595aa05efc Revert of Change SkResourceCache to take a Visitor inside its find(). (patchset #2 id:20001 of https://codereview.chromium.org/567393002/)
Reason for revert:
crashes on android bots, haven't diagnosed yet

Original issue's description:
> Change SkResourceCache to take a Visitor inside its find().
>
> This simplifies the API/contract, in that there are not any exposed
> lock/unlock scopes.
>
>
> patch from issue 572573002
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/dee6a8e67db39fcbde2b3bb09be1d088ebb9db8a

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

Author: reed@google.com

Review URL: https://codereview.chromium.org/569303002
2014-09-15 10:15:18 -07:00
reed
dee6a8e67d Change SkResourceCache to take a Visitor inside its find().
This simplifies the API/contract, in that there are not any exposed
lock/unlock scopes.

patch from issue 572573002

BUG=skia:
R=mtklein@google.com, danakj@chromium.org

Author: reed@google.com

Review URL: https://codereview.chromium.org/567393002
2014-09-15 06:44:47 -07:00
mtklein
fd731ce804 Measure picture recording speed in nanobench.
Today we measure SkPicture playback speed, but not the time it takes to record
the SkPicture.  This fixes that by reading SKPs from disk and re-recording them.

On the console, recording shows up first as the nonrendering skp benches,
followed later by the usual playback benches:

maxrss  loops   min median  mean    max stddev  samples     config  bench
51M  2   165µs   168µs   169µs   178µs   3%  ▆▄▃█▂▄▁▂▁▁  nonrendering    tabl_slashdot.skp
57M  1   9.72ms  9.77ms  9.79ms  9.97ms  1%  █▂▂▅▃▂▁▄▂▁  nonrendering    desk_pokemonwiki.skp
57M  32  2.92µs  2.96µs  3.03µs  3.46µs  6%  ▅▁▁▁▁▁▁█▂▁  nonrendering    desk_yahoosports.skp
...
147M 1   3.86ms  3.87ms  3.97ms  4.81ms  7%  █▁▁▁▁▁▁▁▁▁  8888    tabl_slashdot.skp_1
147M 1   4.54ms  4.56ms  4.55ms  4.56ms  0%  █▅▇▅█▅▂▁▅▁  565     tabl_slashdot.skp_1
147M 2   3.08ms  3.24ms  4.17ms  8.18ms  50% █▁▁█▁▁▁▁▁▁  gpu     tabl_slashdot.skp_1
147M 1   1.61ms  1.62ms  1.69ms  2.33ms  13% █▁▁▁▁▁▁▁▁▁  8888    desk_pokemonwiki.skp_1
147M 1   1.44ms  1.44ms  1.45ms  1.47ms  1%  ▅▂█▂▂▅▁▁▂▁  565     desk_pokemonwiki.skp_1
...

On skiaperf.com, they'll also be separated out from playback benches by bench_type.

BUG=skia:
R=reed@google.com, mtklein@google.com, jcgregorio@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/559153002
2014-09-10 12:19:30 -07:00
mtklein
962890568d Distinguish common and unique names for skiaperf.com.
Turns out we tack on the size post-facto in ResultsWriter::bench(), so the only
place we need getUniqueName() to differ from getName() is SKPBench.

BUG=skia:
R=jcgregorio@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/552303004
2014-09-10 12:05:59 -07:00
qiankun.miao
8247ec313d Fix format of nanobench result
Column of samples is too wide. This makes config is not align with the
'config' title. Pad 'samples' tilte with some whitespaces to fix this
issue.

BUG=skia:
R=mtklein@google.com

Author: qiankun.miao@intel.com

Review URL: https://codereview.chromium.org/549153005
2014-09-09 19:24:36 -07:00
mtklein
ea65bfa8de Update DM JSON format.
Ex. dm --match patch -w bad --key arch x86 gpu nvidia model z620 --properties git_hash abcd build_number 20 ->

{
   "build_number" : "20",
   "git_hash" : "abcd",
   "key" : {
      "arch" : "x86",
      "gpu" : "nvidia",
      "model" : "z620"
   },
   "results" : [
      {
         "key" : {
            "config" : "565",
            "name" : "ninepatch-stretch"
         },
         "md5" : "f78cfafcbabaf815f3dfcf61fb59acc7",
         "options" : {
            "source_type" : "GM"
         }
      },
      {
         "key" : {
            "config" : "8888",
            "name" : "ninepatch-stretch"
         },
         "md5" : "3e8a42f35a1e76f00caa191e6310d789",
         "options" : {
            "source_type" : "GM"
         }
      },
...

This breaks -r, but that's okay.  Going to follow up this CL with one that removes that entirely.

BUG=skia:
R=stephana@google.com, jcgregorio@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/551873003
2014-09-09 07:59:46 -07:00
bsalomon
49f085dddf "NULL !=" = NULL
R=reed@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/544233002
2014-09-05 13:34:00 -07:00
robertphillips
c5ba71d2e5 Change SkPicture::draw to playback
R=reed@google.com

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/540963002
2014-09-04 08:42:50 -07:00
reed
e5ea500d47 Hide fields in SkImageInfo
R=rmistry@google.com
TBR=bsalomon

Author: reed@google.com

Review URL: https://codereview.chromium.org/536003002
2014-09-03 11:54:58 -07:00
robertphillips
a8d7f0b13c Try out scalar picture sizes
This paves the way for removing the 'fTile' parameter from SkPictureShader (although that should be a different CL). If we like this we could also move to providing an entire cull SkRect.

R=reed@google.com, mtklein@google.com, fmalita@google.com, fmalita@chromium.org

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/513983002
2014-08-29 08:03:56 -07:00
reed
011f39aeb2 rename ScaledImageCache to ResourceCache
BUG=skia:
R=bsalomon@google.com, mtklein@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/511283002
2014-08-28 13:35:23 -07:00
mtklein
533eb782ed Convert BBH APIs to use SkRect.
Still TODO: convert internals of SkTileGrid.cpp and SkRTree.cpp to work in floats too.

NOTREECHECKS=true

BUG=skia:1021
R=robertphillips@google.com, reed@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/511613002
2014-08-27 10:39:42 -07:00
mtklein
4473be874f Clean up some benches that answer questions we're no longer asking.
NOTREECHECKS=true

BUG=skia:
R=reed@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/512503002
2014-08-27 06:34:16 -07:00
mtklein
2a65a238b0 Remove SkQuadTree.
We're not testing it to the same degree we do RTree and TileGrid.  Any changes
we'll make to BBH APIs become 33% easier without it.  If find we want it again,
we can always resurrect it.

BUG=skia:1021,skia:2834
R=robertphillips@google.com, mtklein@google.com
TBR=reed

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/500373005
2014-08-26 14:07:04 -07:00
bsalomon
169612621f Make GrGpuResources register with GrResourceCache2 after fully constructed.
Committed: https://skia.googlesource.com/skia/+/d68b3e491bb765beb7ca5e4ac8e0c80dedf5a83b

R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/504313002
2014-08-26 14:01:07 -07:00
bsalomon
a2b0af82f0 Revert of Make GrGpuResources register with GrResourceCache2 after fully constructed. (patchset #3 of https://codereview.chromium.org/504313002/)
Reason for revert:
Breaking the bots

Original issue's description:
> Make GrGpuResources register with GrResourceCache2 after fully constructed.
>
> Committed: https://skia.googlesource.com/skia/+/d68b3e491bb765beb7ca5e4ac8e0c80dedf5a83b

R=robertphillips@google.com
TBR=robertphillips@google.com
NOTREECHECKS=true
NOTRY=true

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/488463004
2014-08-26 13:11:11 -07:00
bsalomon
d68b3e491b Make GrGpuResources register with GrResourceCache2 after fully constructed.
R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/504313002
2014-08-26 12:51:20 -07:00
reed
680fb9e8f1 retool image cache to be generic cache, allowing the client to subclass "Rec", so they can provide a custom Key and arbitrary Value.
Follow-on CLs

- rename ScaledimageCache to something like GeneralCache
- explore if we can use call-backs or some mechanism to completely hide "lock/unlock", by forcing all clients to support "copying" their value out of the cache as the result of a Find.

R=mtklein@google.com, senorblanco@google.com, bsalomon@google.com, qiankun.miao@intel.com, senorblanco@chromium.org

Author: reed@google.com

Review URL: https://codereview.chromium.org/507483002
2014-08-26 09:08:04 -07:00
djsollen
5387c83f81 Revert of Benchmark designed to exercise fractional image scale/translation (patchset #2 of https://codereview.chromium.org/491793003/)
Reason for revert:
fires asserts on Linux Debug builds

http://108.170.220.120:10115/builders/Test-Ubuntu12-ShuttleA-GTX660-x86_64-Debug/builds/1910

Original issue's description:
> Benchmark designed to exercise fractional image scale/translation
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/5fc226641a0926dddbf70ba784f344881f4c05b9

R=reed@google.com, humper@google.com
TBR=humper@google.com, reed@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Author: djsollen@google.com

Review URL: https://codereview.chromium.org/470063007
2014-08-25 12:03:11 -07:00
humper
5fc226641a Benchmark designed to exercise fractional image scale/translation
BUG=skia:
R=reed@google.com

Author: humper@google.com

Review URL: https://codereview.chromium.org/491793003
2014-08-25 11:17:48 -07:00
reed
233c295980 fix numerical overflows in 565 blends
BUG=skia:2797
R=mtklein@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/474983007
2014-08-22 07:27:14 -07:00
tfarina
efafe9484f Cleanup: Remove BenchTool xcode project file.
BUG=None
TEST=None
R=mtklein@google.com

Author: tfarina@chromium.org

Review URL: https://codereview.chromium.org/491263003
2014-08-22 05:42:44 -07:00
mtklein
2084050a33 Add --bbh (default true) to nanobench.
Chrome's using a bounding box, so it's a good idea for our
bots to do so too.

When set, we'll create an SkTileGrid to match the
parameters of --clip, and so should always hit its fast
path.

This will impose a small overhead (querying the BBH) on all
SKPs, but make large SKPs render more quickly.  E.g. on
GPU desk_pokemonwiki should show about a 30% improvement,
tabl_mozilla about 40%, and one very long page from my
personal suite, askmefast.com, gets 5x faster.

(The performance changes are not the point of the CL, but
something we should be aware of.)

BUG=
R=bsalomon@google.com, mtklein@google.com, robertphillips@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/497493003
2014-08-21 15:51:22 -07:00
reed
04617139f7 expose generalized imagecache key
BUG=skia:
R=mtklein@google.com, halcanary@google.com, qiankun.miao@intel.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/483493003
2014-08-21 09:46:49 -07:00
mtklein
1915b62637 Add --properties for things like gitHash that describe the current nanobench run.
--key describes the type of run (describes the line on the chart), --properties
describes the run itself (describes the dot on the chart).

We'll pass --properties gitHash <git hash> build_number <build number>  --key
... to nanobench from the bots.

And... delete a whole lot of dead code.

Example: nanobench --properties gitHash foo build_number 1234 --key bar baz

{
   "build_number" : "1234",
   "gitHash" : "foo",
   "key" : {
      "bar" : "baz"
   },
   "results" : {
....

Friends with https://codereview.chromium.org/491943002
BUG=skia:
R=jcgregorio@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/488213002
2014-08-20 11:45:00 -07:00
mtklein
753b870c62 Define NDEBUG instead of SK_DEBUG/SK_RELEASE.
This makes our builds more like Chrome's, and will make our builds fail
if we accidentally use if SK_DEBUG instead of ifdef SK_DEBUG.

BUG=skia:
R=mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/481513004
2014-08-20 07:38:46 -07:00
mtklein
afb4379dbc Print max RSS in GM and nanobench too.
Everyone used MB, so update the API to just return that.

BUG=skia:
R=halcanary@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/483323002
2014-08-19 15:55:55 -07:00
mtklein
94e51567dd Add --options to nanobench, similar to --key but for non-identifying options.
Friends with https://codereview.chromium.org/487233003/

Example of out/Release/nanobench --options build_number 12374 --match patch_grid_texs_small

{
   "gitHash":"unknown-revision",
   "options":{
      "build_number":"12374",
      "system":"UNIX"
   },
   "results":{
      "patch_grid_texs_small_640_480":{
         "565":{
            "max_ms":0.268116,
            "mean_ms":0.2318529,
            "median_ms":0.235337,
            "min_ms":0.219158,
            "options":{
               "source_type":"bench"
            },
            "stddev_ms":0.01491263917658814
         },
         "8888":{
            "max_ms":0.231881,
            "mean_ms":0.2214668,
            "median_ms":0.219356,
            "min_ms":0.218887,
            "options":{
               "source_type":"bench"
            },
            "stddev_ms":0.004595541070791701
         },
         "gpu":{
            "max_ms":0.1398304782608696,
            "mean_ms":0.128833402173913,
            "median_ms":0.1316798695652174,
            "min_ms":0.1111915434782609,
            "options":{
               "GL_RENDERER":"Quadro 600/PCIe/SSE2",
               "GL_SHADING_LANGUAGE_VERSION":"4.40 NVIDIA via Cg compiler",
               "GL_VENDOR":"NVIDIA Corporation",
               "GL_VERSION":"4.4.0 NVIDIA 331.79",
               "source_type":"bench"
            },
            "stddev_ms":0.008923738937837156
         }
      }
   }
}

BUG=skia:
R=jcgregorio@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/490683002
2014-08-19 12:41:56 -07:00
dandov
7e5598a004 Added bench for grid of patches.
It is on top of my previous cl to fix the mem leaks of the regular patch bench.

NOTREECHECKS=true
BUG=skia:
R=egdaniel@google.com, bsalomon@google.com

Author: dandov@google.com

Review URL: https://codereview.chromium.org/470543004
2014-08-15 13:30:47 -07:00
bsalomon
87c35adbda Remove aarects benchmark. Redundant with rotated_rects* bench and *much* slower.
NOTREECHECKS=true
R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/469373003
2014-08-14 13:03:58 -07:00
bsalomon
a7f79b47fa remove internal repeat count from gradient benches
NOTREECHECKS=true
R=mtklein@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/476923002
2014-08-14 12:24:46 -07:00
krajcevski
12b3544028 Add runtime flag to turn compressed alpha masks on
R=bsalomon@google.com, robertphillips@google.com, mtklein@google.com

Author: krajcevski@google.com

Review URL: https://codereview.chromium.org/468293002
2014-08-13 12:06:26 -07:00
krajcevski
69a5560ea5 Add entry point for passing options to the GrContextFactory
R=bsalomon@google.com, mtklein@google.com, robertphillips@google.com

Author: krajcevski@google.com

Review URL: https://codereview.chromium.org/465073002
2014-08-13 10:46:31 -07:00
mtklein
e556be7084 Don't leak the shader in PatchBench.
BUG=skia:
R=dandov@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/465083003
2014-08-13 10:41:16 -07:00
dandov
b3c9d1c33c SkCanvas::drawPatch param SkPoint[12]
drawPatch now receives as parameter const SkPoint cubics[12]

Adjusted derived classes and serialization.

Ajusted GM's and benches that take into account combinations of optional
parameters, the scale of the patch and 4 different types of patches.

Planning on adding the extra functionality of SkPatch in another CL.

BUG=skia:
R=egdaniel@google.com, reed@google.com

Author: dandov@google.com

Review URL: https://codereview.chromium.org/463493002
2014-08-12 08:34:29 -07:00
joshualitt
5acfea789d 2D kernel initial wiring for Guassian
BUG=skia:
R=senorblanco@chromium.org, bsalomon@chromium.org, bsalomon@google.com

Author: joshualitt@chromium.org

Review URL: https://codereview.chromium.org/418223009
2014-08-11 13:55:34 -07:00
Mike Klein
e530eb370c Restore bench_util.py
BUG=skia:2819

Review URL: https://codereview.chromium.org/450253003
2014-08-08 17:28:53 -04:00
bsalomon
6563562cb6 Make the rotated rects bench allow more alpha/color variations and an arbitrary xfermode::mode.
R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/448253002
2014-08-08 07:43:29 -07:00
mtklein
b511042bb0 Fix iOS build by centralizing --writePath.
CQ_EXTRA_TRYBOTS=tryserver.skia:Build-Mac10.7-Clang-Arm7-Debug-iOS-Trybot

BUG=skia:
R=mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/452633002
2014-08-07 15:20:02 -07:00
bsalomon
6eb03cc06d Add option to dump images from nanobench.
Add option to set the repeat count to any number, replacs the --runOnce flag.

R=mtklein@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/450743002
2014-08-07 14:28:50 -07:00
bsalomon
3b4d077fba Add angle config to nanobench and make angle a default config for dm and nanobench.
NOTREECHECKS=true
R=mtklein@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/441333003
2014-08-06 10:52:34 -07:00
mtklein
be21e3432e Bye bye bench.
NOTREECHECKS=true

BUG=skia:
R=djsollen@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/442343004
2014-08-06 08:39:38 -07:00
mtklein
2069e22003 Fix calibration loop failure condition.
With the old logic, if the last attempt succeeded, we'd say we failed.

We also print two lines for loop calibration failures.  Quiet that down.

BUG=skia:
R=djsollen@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/431503004
2014-08-04 13:57:39 -07:00
mtklein
6e33e232df Skip all .skps in 565.
More SKPs are failing with a 565 target on other platforms:

http://108.170.220.120:10117/builders/Test-Win7-ShuttleA-HD2000-x86-Debug/builds/2938/steps/RunNanobench/logs/stdio

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/431983006
2014-08-01 08:23:39 -07:00
mtklein
92007583e4 SKPs-as-benches in nanobench
This is meant to replace bench_pictures.

CQ_EXTRA_TRYBOTS=tryserver.skia:Build-Mac10.7-Clang-Arm7-Release-iOS-Trybot

BUG=skia:
R=bsalomon@google.com, jcgregorio@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/425393004
2014-08-01 07:46:53 -07:00
mtklein
e714e75c72 nanobench: support GMs-as-benches
BUG=skia:
R=jcgregorio@google.com, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/438683002
2014-07-31 12:13:48 -07:00
bsalomon
3342ed55e1 Add rotated rects benchmarks
R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/425263003
2014-07-30 08:58:20 -07:00
tfarina
a8e2e1504b Cleanup: Rename SkOSPath functions.
Mostly for brevity and matches better with Python:

Python           | Old C++                 | New C++
os.path.join     | SkOSPath::SkPathJoin    | SkOSPath::Join
os.path.basename | SkOSPath::SkBasename    | SkOSPath::Basename

BUG=None
TEST=make all
R=mtklein@google.com, bsalomon@google.com

Author: tfarina@chromium.org

Review URL: https://codereview.chromium.org/428443002
2014-07-28 19:26:58 -07:00