Commit Graph

1228 Commits

Author SHA1 Message Date
joshualitt
b235168f55 S4 only has 8 texture units on the GLContext we create
BUG=skia:4373

Review URL: https://codereview.chromium.org/1386643002
2015-10-02 06:49:23 -07:00
mtklein
a1ebeb25e9 Remove const from const int loops.
This drives me nuts, and prevents `while (loops --> 0)`.

BUG=skia:

Review URL: https://codereview.chromium.org/1379923005
2015-10-01 09:43:39 -07:00
joshualitt
8a6697af95 Fix for nexus 5 crashing in GL benches
GLBenches do not expect gl state  to change between onPerCanvasPreDraw and *PostDraw, but we do a clear and sometimes we clear as draw.  This causes us to bind vertex objects / programs / etc.

This change creates two new virtual methods which are called right before and immediately after timing.

BUG=skia:

Review URL: https://codereview.chromium.org/1379853003
2015-09-30 12:11:07 -07:00
scroggo
46c5747256 Merge SkCodec with SkScanlineDecoder
Benefits:
- This mimics other decoding APIs (including the ones SkCodec relies
on, e.g. a png_struct, which can be used to decode an entire image or
one line at a time).

- It allows a client to ask us to do what we can do efficiently - i.e.
start from encoded data and either decode the whole thing or scanlines.

- It removes the duplicate methods which appeared in both SkCodec and
SkScanlineDecoder (some of which, e.g. in SkJpegScanlineDecoder, just
call fCodec->sameMethod()).

- It simplifies moving more checks into the base class (e.g. the
examples in skbug.com/4284).

BUG=skia:4175
BUG=skia:4284

=====================================================================

SkScanlineDecoder.h/.cpp:
Removed.

SkCodec.h/.cpp:
Add methods, enums, and variables which were previously in
SkScanlineDecoder.
Default fCurrScanline to -1, as a sentinel that start has not been
called.

General changes:
Convert SkScanlineDecoders to SkCodecs.

General changes in SkCodec subclasses:
Merge SkScanlineDecoder implementation into SkCodec. Most (all?) owned
an SkCodec, so they now call this-> instead of fCodec->.

SkBmpCodec.h/.cpp:
Replace the unused rowOrder method with an override for
onGetScanlineOrder.
Make getDstRow const, since it is called by onGetY, which is const.

SkCodec_libpng.h/.cpp:
Make SkPngCodec an abstract class, with two subclasses which handle
scanline decoding separately (they share code for decoding the entire
image). Reimplement onReallyHasAlpha so that it can return the most
recent result (e.g. after a scanline decode which only decoded part
of the image) or a better answer (e.g. if the whole image is known to
be opaque).
Compute fNumberPasses early, so we know which subclass to instantiate.
Make SkPngInterlaceScanlineDecoder use the base class' fCurrScanline
rather than a separate variable.

CodexTest.cpp:
Add tests for the state changes in SkCodec (need to call start before
decoding scanlines; calling getPixels means that start will need to
be called again before decoding more scanlines).
Add a test which decodes in stripes, currently only used for an
interlaced PNG.

TODO: Add tests for onReallyHasAlpha.

Review URL: https://codereview.chromium.org/1365313002
2015-09-30 08:57:14 -07:00
herb
62a69c26b3 Move Mutexy things to private.
There is no API change.

TBR=reed@google.com

BUG=skia:

Review URL: https://codereview.chromium.org/1368333004
2015-09-29 11:47:45 -07:00
herb
e6e41a8a19 Move SkAtomics.h to private.
There are no API changes.

TBR=reed@google.com

BUG=skia:

Review URL: https://codereview.chromium.org/1369333004
2015-09-28 11:24:13 -07:00
fmalita
2f5891ea64 Remove SkBitmapSource
To avoid breaking existing SKPs, add a deserialization stub which
unflattens SkBitmapSource records to SkImageSources.

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

Review URL: https://codereview.chromium.org/1363913002
2015-09-25 09:15:55 -07:00
reed
57b767127f use override to make the new xcode happier
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1368673004
2015-09-25 04:49:43 -07:00
joshualitt
8db65a6d0c stop scaling loops and improve warmup bench
BUG=skia:

Review URL: https://codereview.chromium.org/1363663004
2015-09-24 12:42:02 -07:00
joshualitt
7d4b458b9f Add warmup bench to visual bench
BUG=skia:

Review URL: https://codereview.chromium.org/1358373003
2015-09-24 08:08:23 -07:00
msarett
7f69144aaa Add nanobench tests for BitmapRegionDecoder
SkBitmapRegionDecoderInterface provides an interface
for multiple implementations of Android's
BitmapRegionDecoder.

We already have correctness tests in DM that will enable us
to compare the quality of our various BRD implementations.

We also need these performance tests to compare the speed
of our various implementations.

BUG=skia:4357

Review URL: https://codereview.chromium.org/1344993003
2015-09-22 11:56:16 -07:00
mtklein
a16e8bcef1 move mutex construction out of the benchmarks.
BUG=skia:

Review URL: https://codereview.chromium.org/1345853004
2015-09-22 10:38:48 -07:00
herb
0d39d37ddc Delete the typefaces.
BUG=skia:

Review URL: https://codereview.chromium.org/1353203002
2015-09-18 13:52:18 -07:00
herb
1052f51a7d Font cache stress test.
BUG=skia:

Review URL: https://codereview.chromium.org/1348883002
2015-09-18 12:09:43 -07:00
herb
d32087a613 Add shared mutex benchmark.
BUG=skia:

Review URL: https://codereview.chromium.org/1352863004
2015-09-18 10:50:35 -07:00
herb
bcfd511eb1 Benchmark all mutex implementations.
BUG=skia:

Review URL: https://codereview.chromium.org/1342283004
2015-09-18 09:24:18 -07:00
halcanary
435657fd62 Forward declare SkStrokeRec in SkPathEffect
Review URL: https://codereview.chromium.org/1312163008
2015-09-15 12:53:07 -07:00
fmalita
5598b63cd2 Convert unit tests, GMs from SkBitmapSource to SkImagesource
This removes SkBitmapSource clients within Skia.

http://crrev.com/1334173004 does the same for Blink, so we should be
able to remove SkBitmapSource in a follow-up.

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

Review URL: https://codereview.chromium.org/1343123002
2015-09-15 11:26:14 -07:00
reed
74bd953719 discardable pixelrefs are gone, update tests accordingly
BUG=skia:4328

Review URL: https://codereview.chromium.org/1340803002
2015-09-14 08:52:12 -07:00
hendrikw
eddbefb4a5 skia: Add ANGLE with GL backend to nanobench/DM
This will allow us to test this without hacking it in, might be useful
for others too.

Review URL: https://codereview.chromium.org/1338003002
2015-09-11 13:07:29 -07:00
hendrikw
894a2e4362 skia: Initialize value passed to GetShaderiv in GLBench
The command buffer's GetShaderiv and GetProgramiv code checks
that the success value passed in is either -1 or 0.

Review URL: https://codereview.chromium.org/1318143004
2015-09-08 15:18:56 -07:00
mtklein
dde03ff89f Clean up remaining users of SkPMFloat
This switches over SkXfermodes_opts.h and SkColorMatrixFilter to use Sk4f,
and converts the SkPMFloat benches to Sk4f benches.

No pixels should change here, and no code beyond the Sk4f_ benches should change speed.
The benches are faster than the old versions.

BUG=skia:4117

Review URL: https://codereview.chromium.org/1324743002
2015-08-31 15:26:08 -07:00
bsalomon
afcd7cd324 Rename flag from "distance field" to "device independent."
Review URL: https://codereview.chromium.org/1322433006
2015-08-31 12:39:41 -07:00
hendrikw
885bf09255 skia: add ability to load command_buffer_gles2
BUG=skia:

Review URL: https://codereview.chromium.org/1306823003
2015-08-27 10:38:39 -07:00
halcanary
96fcdcc219 Style Change: NULL->nullptr
DOCS_PREVIEW= https://skia.org/?cl=1316233002

Review URL: https://codereview.chromium.org/1316233002
2015-08-27 07:41:16 -07:00
mtklein
9c84b112aa Add white variants to TextBench
Might be worth a look.

BUG=skia:

Review URL: https://codereview.chromium.org/1319503003
2015-08-26 13:41:31 -07:00
halcanary
385fe4d4b6 Style Change: SkNEW->new; SkDELETE->delete
DOCS_PREVIEW= https://skia.org/?cl=1316123003

Review URL: https://codereview.chromium.org/1316123003
2015-08-26 13:07:49 -07:00
bungeman
60e0fee6d4 Remove include of stdlib.h from SkTypes.h.
Unfortunately, immintrin.h (which is also included by SkTypes)
includes xmmintrin.h which includes mm_malloc.h which includes
stdlib.h for malloc even though, from the implementation, it is
difficult to see why.

Fortunately, arm_neon.h does not seem to be involved in such
shenanigans, so building for Android will keep things sane.

TBR=reed@google.com
Doesn't change Skia API, just moves an include.

Review URL: https://codereview.chromium.org/1313203003
2015-08-26 05:15:46 -07:00
borenet
877a52ae61 VisualBenchTest: Write JSON output
BUG=skia:4093

Review URL: https://codereview.chromium.org/1302103002
2015-08-20 09:12:39 -07:00
bungeman
99fe822606 Use static_assert instead of SK_COMPILE_ASSERT.
Now that static_assert is allowed, there is no need to use a non-
standard compile time assertion

Review URL: https://codereview.chromium.org/1306443004
2015-08-20 07:57:52 -07:00
reed
216b643fc7 private iterator to visit all resource cache entries
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1271033002
2015-08-19 12:25:41 -07:00
mtklein
c6ad06acef unsigned -> int for counts and indices in picture-related code
also, (C)

BUG=skia:

Review URL: https://codereview.chromium.org/1300163002
2015-08-19 09:51:01 -07:00
reed
451af5062e remove SkDeferredCanvas
Waiting a day or so to see if the blink-removal of SkDeferredCanvas sticks

BUG=skia:

Review URL: https://codereview.chromium.org/1269093002
2015-08-19 08:18:04 -07:00
reed
e47829b6b1 flag to use const& instead of const* for src-rect
BUG=skia:

Review URL: https://codereview.chromium.org/1272713005
2015-08-06 10:02:53 -07:00
bungeman
d3ebb48320 IWYU: 'core' target, files starting A-C.
TBR=reed@google.com
Verbal lgtm, does not change API.

Committed: https://skia.googlesource.com/skia/+/7403d87db8e43d4c2b5b25ac22a0ebc22bd09d69

Review URL: https://codereview.chromium.org/1265033002
2015-08-05 13:57:49 -07:00
reed
fb8c1fcab1 Revert of IWYU: 'core' target, files starting A-C. (patchset #5 id:80001 of https://codereview.chromium.org/1265033002/ )
Reason for revert:
revert to unblock DEPS roll

../../chrome/browser/chromeos/display/overscan_calibrator.cc:43:10: error: variable has incomplete type 'SkPath'
  SkPath base_path;

Original issue's description:
> IWYU: 'core' target, files starting A-C.
>
> TBR=reed@google.com
> Verbal lgtm, does not change API.
>
> Committed: https://skia.googlesource.com/skia/+/7403d87db8e43d4c2b5b25ac22a0ebc22bd09d69

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

Review URL: https://codereview.chromium.org/1273613002
2015-08-04 18:44:57 -07:00
bungeman
7403d87db8 IWYU: 'core' target, files starting A-C.
TBR=reed@google.com
Verbal lgtm, does not change API.

Review URL: https://codereview.chromium.org/1265033002
2015-08-04 14:56:53 -07:00
scroggo
1c005e4a38 Create a scanline decoder without creating a codec
Prior to this CL, if a client wanted to decode scanlines, they had to
create an SkCodec in order to get an SkScanlineDecoder. This introduces
complications if input data is not easily shared between the two
objects.

Instead, add methods to SkScanlineDecoder for creating a new one from
input data, and remove the creation functions from SkCodec.

Update DM and tests.

Review URL: https://codereview.chromium.org/1267583002
2015-08-04 09:24:45 -07:00
reed
dea6e1c737 update image bench to test gpu and cpu images against raster surface
BUG=513695
TBR=

Review URL: https://codereview.chromium.org/1261043003
2015-08-04 08:42:40 -07:00
reed
799a3646f9 add bench for gpu-image -> cpu-surface
BUG=513695
TBR=

Review URL: https://codereview.chromium.org/1261663004
2015-08-03 14:18:04 -07:00
mtklein
58fd2c8af4 Remove sk_memcpy32
It's only implemented on x86, where the exisiting benchmark says memcpy() is
faster for all cases:

Timer overhead: 24ns
curr/maxrss    loops    min    median    mean    max    stddev    samples       config    bench
  10/10  MB    1    35.9µs    36.2µs    36.2µs    36.6µs    1%    ▁▂▄▅▅▃█▄▄▅    nonrendering    sk_memcpy32_100000
  10/10  MB    13    2.27µs    2.28µs    2.28µs    2.29µs    0%    █▄▃▅▃▁▃▅▁▄    nonrendering    sk_memcpy32_10000
  11/11  MB    677    91.6ns    95.9ns    94.5ns    99.4ns    3%    ▅▅▅▅▅█▁▁▁▁    nonrendering    sk_memcpy32_1000
  11/11  MB    1171    20ns    20.9ns    21.3ns    23.4ns    6%    ▁▁▇▃▃▃█▇▃▃    nonrendering    sk_memcpy32_100
  11/11  MB    1952    14ns    14ns    14.3ns    15.2ns    3%    ▁▁██▁▁▁▁▁▁    nonrendering    sk_memcpy32_10
  11/11  MB    5    33.6µs    33.7µs    34.1µs    35.2µs    2%    ▆▇█▁▁▁▁▁▁▁    nonrendering    memcpy32_memcpy_100000
  11/11  MB    18    2.12µs    2.22µs    2.24µs    2.39µs    5%    ▂█▄▇█▄▇▁▁▁    nonrendering    memcpy32_memcpy_10000
  11/11  MB    1112    87.3ns    87.3ns    89.1ns    93.7ns    3%    ▄██▄▁▁▁▁▁▁    nonrendering    memcpy32_memcpy_1000
  11/11  MB    2124    12.8ns    13.3ns    13.5ns    14.8ns    6%    ▁▁▁█▃▃█▇▃▃    nonrendering    memcpy32_memcpy_100
  11/11  MB    3077    9ns    9.41ns    9.52ns    10.2ns    4%    ▃█▁█▃▃▃▃▃▃    nonrendering    memcpy32_memcpy_10

(Why?  One fewer thing to port to SkOpts.)

BUG=skia:4117

Review URL: https://codereview.chromium.org/1256763003
2015-07-27 11:08:28 -07:00
caryclark
1818acb6a4 rename portable_typeface_always to portable_typeface
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1257773002
2015-07-24 12:09:25 -07:00
reed
84984efeb6 Revert[2] of guard to remove DrawBitmapRectFlags
This reverts commit 91110195a2.

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1240753003
2015-07-17 07:09:43 -07:00
scroggo
91110195a2 Revert of guard to remove DrawBitmapRectFlags (patchset #1 id:1 of https://codereview.chromium.org/1235393003/)
Reason for revert:
breaking android framework build

Original issue's description:
> guard to remove DrawBitmapRectFlags
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/6fb0b6779e40ce05c20cf279f0ecff31fa3cd60d

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

Review URL: https://codereview.chromium.org/1230823007
2015-07-17 05:57:34 -07:00
joshualitt
31b21f6719 Small fix for visualbench
BUG=skia:

Review URL: https://codereview.chromium.org/1237563005
2015-07-16 13:40:51 -07:00
reed
6fb0b6779e guard to remove DrawBitmapRectFlags
BUG=skia:

Review URL: https://codereview.chromium.org/1235393003
2015-07-16 06:10:02 -07:00
wangyix
891f0f35db Added GLVec4ScalarBench that doesn't use VAOs
BUG=skia:

Review URL: https://codereview.chromium.org/1235153008
2015-07-15 12:26:07 -07:00
scroggo
004aebd42c Revert of Added a GLBench for testing performance of vec4 vs scalar for coverage in generated shaders. (patchset #6 id:90001 of https://codereview.chromium.org/1225383002/)
Reason for revert:
Still failing on Windows. e.g. https://uberchromegw.corp.google.com/i/client.skia/builders/Perf-Win8-MSVC-ShuttleB-GPU-HD4600-x86_64-Release-ANGLE/builds/231/steps/nanobench/logs/stdio

skbug.com/4053

Original issue's description:
> Added a glBench for testing performance of vec4 vs scalar coverage in generated shaders.
>
> Added bench for timing vec4 vs scalar type for coverage in shaders
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/6104ced165f17eb2f765ace354d5895c0bc890c5
>
> Committed: https://skia.googlesource.com/skia/+/c734e69e8cf94bacaf68d3d8ee3310d1ad1fe8b8

TBR=joshualitt@google.com,tomhudson@google.com,wangyix@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1239503003
2015-07-15 06:36:42 -07:00
joshualitt
5ca41c1647 Remove GrRedBlackTree
BUG=skia:

Review URL: https://codereview.chromium.org/1226203013
2015-07-14 11:07:53 -07:00
robertphillips
3d32d768cd Add new SkPoint3 class
The existing Light filter and the upcoming Lighting Shader both need a Point3 class

Review URL: https://codereview.chromium.org/1229693009
2015-07-13 13:16:44 -07:00