Commit Graph

1000 Commits

Author SHA1 Message Date
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