Commit Graph

2394 Commits

Author SHA1 Message Date
mtklein
e974c6244c Whitelist intentionally racy TRACE_EVENT reads and writes.
Chrome's tracing framework appears to be intentionally racy on its
quick-reject checks, trading some data loss for better performance
when disabled.  People will never notice the data loss, but TSAN does.
Let's assuage TSAN with some annotations.

The 'volatile' val in SK_ANNOTATE_UNPROTECTED_WRITE was making this
not compile, but that volatile doesn't really make sense there: the value we're
writing is not what we care about, it's the destination.

CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu13.10-GCE-NoGPU-x86_64-Release-TSAN-Trybot

No API changes.
TBR=reed

BUG=skia:

Review URL: https://codereview.chromium.org/702883002
2014-11-05 08:03:27 -08:00
tfarina
f6e59b5035 Cleanup: Remove unused InstallNewHandler() function from SkGraphics.
BUG=None
TEST=None
R=bsalomon@google.com

Review URL: https://codereview.chromium.org/701813006
2014-11-05 07:20:51 -08:00
robertphillips
9f2251c73e Crop the fast path dashed lines to the cull rect
Without:

maxrss  loops   min     median  mean    max     stddev  samples         config  bench
  56M   1       13.3ms  13.6ms  13.6ms  14.2ms  2%      Ooooo.....      8888    GM_dashing5_bw
  56M   13      390us   417us   416us   459us   5%      ooooO..o.o      gpu     GM_dashing5_bw
  56M   1       13.4ms  13.9ms  14.1ms  15ms    3%      Oooo..ooOo      8888    GM_dashing5_aa
  56M   13      402us   421us   416us   425us   2%      Ooo.ooOOOO      gpu     GM_dashing5_aa

With:

  40M   1       1.53ms  1.54ms  1.54ms  1.55ms  0%      oo.O...o..      8888    GM_dashing5_bw
  40M   12      407us   412us   415us   445us   3%      ...Oo.....      gpu     GM_dashing5_bw
  40M   1       1.7ms   1.7ms   1.7ms   1.72ms  0%      o.O.......      8888    GM_dashing5_aa
  43M   13      405us   409us   409us   415us   1%      ooo.Ooo..o      gpu     GM_dashing5_aa

The GM images (including the new one) are the same with and without this CL.

BUG=428296

Review URL: https://codereview.chromium.org/699623003
2014-11-04 13:33:50 -08:00
jvanverth
f7007b023d Enable distance field path rendering in Chrome.
- Add stat tracking for df-renderable paths
- Modify GPU rasterization veto to account for df-renderable paths
- Remove #define hiding df paths from Chromium and Android

BUG=skia:2935

Review URL: https://codereview.chromium.org/685113003
2014-11-04 07:59:01 -08:00
fmalita
7c11aadd82 Export (SK_API) SkSurfaceProps
R=reed@google.com

Review URL: https://codereview.chromium.org/693973003
2014-11-03 17:07:36 -08:00
qiankun.miao
fb502f072f Optimize SkRect::sort()
This optimization can reduce comparison and assignments. For
geo_rect_sort benchmark, performance improved to 1.63us from 3.28us.

BUG=skia:

Review URL: https://codereview.chromium.org/695443005
2014-11-03 14:34:31 -08:00
reed
bd1605905b begin clean up for scalar is double option
BUG=skia:

Review URL: https://codereview.chromium.org/694693002
2014-10-31 06:55:41 -07:00
robertphillips
d8aa7b74c8 Upgrade GPUOptimize
This will be a bit hairy to review.

The FillBounds and CollectLayers code has diverged significantly resulting in the rendering path seeing different bounds than the hoisting path. This CL merges the FillBounds changes into CollectLayers. A follow on CL will, hopefully, find a way to layer CollectLayers on top of FillBounds.

The only code in CollectLayers that is different from FillBounds is bracketed by "LAYER HOISTING" comments.

NOTREECHECKS=true

Review URL: https://codereview.chromium.org/685263004
2014-10-30 16:45:02 -07:00
halcanary
902d4d18de Add SkDocument::getStream() method.
Motivation: SkDocument_PDF can be refactored to stream all
PDF objects as SkCanvas calls are made, to save memory!

BUG=skia:3030
BUG=skia:2683

Review URL: https://codereview.chromium.org/691783002
2014-10-30 11:29:00 -07:00
mtklein
e71cd54ed4 SkTaskGroup::batch(fn, args, N)
Porting QuiltTask isn't important in itself; this is mostly an API feeler.

BUG=skia:

Review URL: https://codereview.chromium.org/689673003
2014-10-29 14:17:13 -07:00
reed
89889b6939 MultiPictureDraw is taskgroup aware.
SampleApp is multipicturedraw aware.

BUG=skia:

Review URL: https://codereview.chromium.org/684923002
2014-10-29 12:36:45 -07:00
bungeman
a5cf665997 Issue acquire barrier in SkRefCnt::unique().
When unique() returns true, it must also issue an acquire barrier.
Note that this change may adversly impact SkPath performance,
but editing SkPaths is already a performance issue.

BUG=chromium:258499

No API changes.
TBR=reed@google.com

Review URL: https://codereview.chromium.org/687293002
2014-10-29 12:31:33 -07:00
junov
ed53742e92 Add SK_API to global scope operators of SkMatrix
Review URL: https://codereview.chromium.org/678153002
2014-10-28 07:14:58 -07:00
halcanary
f622a6c8fd Add SkIRect bounds() convenience method to SkImageInfo and SkBitmap.
Review URL: https://codereview.chromium.org/646213003
2014-10-24 12:54:53 -07:00
jvanverth
b3eb687f8a Set temporary paths volatile so we don't cache them.
Any path that is generated frame-to-frame should not be rendered by using the
DistanceFieldPathRenderer, because generating the initial distance field,
uploading it and rendering it takes longer than the SoftwarePathRenderer.

BUG=skia:2935

Review URL: https://codereview.chromium.org/677463002
2014-10-24 07:12:51 -07:00
sugoi
234f036b3e Adding an option to render only the shadow in SkDropShadowImageFilter
This is basically how blink uses the filter. Currently, I can't use it for "ShadowOnly" mode with the filter at all, but instead of copying the code and risking to have the codepaths diverge, I'm simply going to add the option here.

BUG=skia:

Review URL: https://codereview.chromium.org/646213004
2014-10-23 13:59:52 -07:00
djsollen
e3aee8fb7b Remove android specific genID from SkPaint.
Review URL: https://codereview.chromium.org/677453002
2014-10-23 10:23:07 -07:00
reed
a0c814cffb Add SkTypeface::getBounds()
mirrored from https://codereview.chromium.org/666303002/

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/676523002
2014-10-22 13:20:58 -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
reed
727b8c1d1c explicitly size fType in SkRRect, to ensure the are no uninitialized bytes
(so it can be used as a key in a cache)

BUG=skia:

Review URL: https://codereview.chromium.org/670183002
2014-10-22 11:23:56 -07:00
reed
39393e3ac3 add round/ceil/etc. for SkMScalar
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/645793006
2014-10-21 12:33:21 -07:00
senorblanco
b0e89dcc1d Fix image filters for PDF backend.
Currently, the PDF backend does not support image filters (since PDF
does not have that functionality), so it simply removes them. This is
causing Chrome print preview to render incorrectly (see bug). The fix
here is to fall back to a raster device for image filters, as we used
to do in Blink. The resulting bitmap will be drawn to the destination
device as a normal main-memory-backed bitmap.

Note: this change invalidates the PDF results of all GMs containing
image filters (since they'll actually be rendered).

BUG=422144

Review URL: https://codereview.chromium.org/644323006
2014-10-20 14:03:13 -07:00
bungeman
a4c4a2d8cd Replace SkTypeface::Style with SkFontStyle.
Committed: https://skia.googlesource.com/skia/+/43b8b36b20ae00e2d78421c4cda1f3f922983a20

Review URL: https://codereview.chromium.org/488143002
2014-10-20 13:33:19 -07:00
mtklein
802ad83dca Revert of Replace SkTypeface::Style with SkFontStyle. (patchset #9 id:160001 of https://codereview.chromium.org/488143002/)
Reason for revert:
CrOS GM failures:

[*] 2 ExpectationsMismatch: fontmgr_iter_565.png fontmgr_iter_8888.png

Original issue's description:
> Replace SkTypeface::Style with SkFontStyle.
>
> Committed: https://skia.googlesource.com/skia/+/43b8b36b20ae00e2d78421c4cda1f3f922983a20

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

Review URL: https://codereview.chromium.org/667023002
2014-10-20 12:54:31 -07:00
bungeman
43b8b36b20 Replace SkTypeface::Style with SkFontStyle.
Review URL: https://codereview.chromium.org/488143002
2014-10-20 12:33:59 -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
sugoi
b227e37eae JPEG YUV Decoding
Enabling JPEG YUV Decoding in Skia

BUG=skia:3005, skia:1674, skia:3029

Committed: https://skia.googlesource.com/skia/+/8e6c3b93a39e19111662a760ede97df55e51d39f

Review URL: https://codereview.chromium.org/399683007
2014-10-16 13:10:57 -07:00
jvanverth
aab626c367 Revert of Change drawText() to generate positions and send to drawPosText() (patchset #4 id:60001 of https://codereview.chromium.org/653133004/)
Reason for revert:
A large number of GMs on Ubuntu12 are failing. The text layout on GPU is visibly different than that for 8888.

Original issue's description:
> Change drawText() to generate positions and send to drawPosText()
>
> The idea here is to have a central place that does layout for drawText(), and
> then always feed text through drawPosText(). This both makes all of the
> GrTextContexts consistent in drawText() output, and does a better job of
> stressing drawPosText().
>
> Because of the effect of matrices on hinting and approximation error, the
> generated text is not 100% identical to that produced by the raster pipeline.
>
> BUG=skia:2778
>
> Committed: https://skia.googlesource.com/skia/+/7851a56895c9c076f73a835a7dd51d3c6180c16f

TBR=cdalton.nvidia@gmail.com,bungeman@google.com,reed@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:2778

Review URL: https://codereview.chromium.org/659993003
2014-10-16 08:04:39 -07:00
jvanverth
7851a56895 Change drawText() to generate positions and send to drawPosText()
The idea here is to have a central place that does layout for drawText(), and
then always feed text through drawPosText(). This both makes all of the
GrTextContexts consistent in drawText() output, and does a better job of
stressing drawPosText().

Because of the effect of matrices on hinting and approximation error, the
generated text is not 100% identical to that produced by the raster pipeline.

BUG=skia:2778

Review URL: https://codereview.chromium.org/653133004
2014-10-16 06:20:35 -07:00
bungeman
8dfdfff98d Don't use 'defined' in macro expansion.
A careful reading of the preprocessor specification indicates that
any use of the 'defined' operator outside the form of 'defined X' or
'defined ( X )' directly in the constant expression of a '#if' or
'#elif' may cause undefined behavior.

In particular, msvc is very unpredictable. The 'defined X' and
'defined ( X )' forms behave differently when created from marco
expansion, with 'defined ( X )' generally evaluating to '0L'. The
'defined X' form generally behaves more the way one would expect,
but still has a number of quirks which should simply be considered
undefined behavior.

BUG=chromium:419245

Review URL: https://codereview.chromium.org/657183002
2014-10-15 13:53:55 -07:00
rmistry
3ac569b37a Revert of JPEG YUV Decoding (patchset #5 id:180001 of https://codereview.chromium.org/399683007/)
Reason for revert:
Caused many test bots to go red:
http://build.chromium.org/p/client.skia/builders/Test-ChromeOS-Alex-GMA3150-x86-Release/builds/22/steps/dm/logs/stdio
http://build.chromium.org/p/client.skia/builders/Test-ChromeOS-Link-HD4000-x86_64-Debug/builds/168/steps/dm/logs/stdio
http://build.chromium.org/p/client.skia/builders/Test-Ubuntu12-ShuttleA-GTX660-x86-Release/builds/38/steps/dm/logs/stdio

Original issue's description:
> JPEG YUV Decoding
>
> Enabling JPEG YUV Decoding in Skia
>
> BUG=skia:3005, skia:1674
>
> Committed: https://skia.googlesource.com/skia/+/8e6c3b93a39e19111662a760ede97df55e51d39f

TBR=reed@google.com,scroggo@google.com,sugoi@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=skia:3005, skia:1674

Review URL: https://codereview.chromium.org/656163002
2014-10-15 13:15:58 -07:00
sugoi
8e6c3b93a3 JPEG YUV Decoding
Enabling JPEG YUV Decoding in Skia

BUG=skia:3005, skia:1674

Review URL: https://codereview.chromium.org/399683007
2014-10-15 11:04:18 -07:00
reed
157f36d358 add tests for large cordinates bounds when building aaclip
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/658753002
2014-10-15 07:05:09 -07:00
mtklein
148ec59001 Require SK_DECLARE_STATIC_LAZY_PTR is used in global scope.
Function- or method- local scope isn't threadsafe; the pointer is generally
zero-initialized on first use in function scope (i.e. lazily... we have to go
deeper), but for globals we can be pretty sure the linker will do that for us.

BUG=skia:

No public API changes.
TBR=reed@google.com

Review URL: https://codereview.chromium.org/651723003
2014-10-13 13:17:56 -07:00
tfarina
a5414c4a8e Turn SkCanvasStateUtils into a class with static functions.
That simplifies the way to declare it a friend, as needed in SkCanvas.

BUG=skia:2914
TEST=make most
R=reed@google.com

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

Review URL: https://codereview.chromium.org/646863002
2014-10-10 05:50:15 -07:00
mtklein
092dab9822 Use BBH reserve hook to preallocate space for tiles.
Before getting too far into changing how SkTileGrid stores its tiles, I figured I'd
better see how much I can tweak out the existing format.  Cleverly, that way
any improvements I make by changing the format will look that much less
impressive.

This CL looks like it will be a 5-15% win in time spent recording, with no effect
on playback.

This CL also shrinks the tiles to fit exactly when we're done inserting,
using newly added SkTDArray::shrinkToFit().  It's quite cheap to run (maybe
taking back 1-2% from those 5-15% wins), and means we'll lug around about 15%
fewer bytes in the tile grids.  Note though this strategy temporarily uses up to
30% more memory while building the tile grid.  For our largest SKPs, that's
maybe 75-100K extra.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/52455cbc02d7f480d988ae7cdacc11ad69078c2c

CQ_EXTRA_TRYBOTS=tryserver.skia:Canary-Chrome-Ubuntu13.10-Ninja-x86_64-ToT-Trybot

Review URL: https://codereview.chromium.org/639823005
2014-10-09 18:22:41 -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
mtklein
7062a262e2 Revert of Use BBH reserve hook to preallocate space for tiles. (patchset #2 id:80001 of https://codereview.chromium.org/639823005/)
Reason for revert:
failed assertion "fXTiles * fYTiles != 0"

Original issue's description:
> Use BBH reserve hook to preallocate space for tiles.
>
> Before getting too far into changing how SkTileGrid stores its tiles, I figured I'd
> better see how much I can tweak out the existing format.  Cleverly, that way
> any improvements I make by changing the format will look that much less
> impressive.
>
> This CL looks like it will be a 5-15% win in time spent recording, with no effect
> on playback.
>
> This CL also shrinks the tiles to fit exactly when we're done inserting,
> using newly added SkTDArray::shrinkToFit().  It's quite cheap to run (maybe
> taking back 1-2% from those 5-15% wins), and means we'll lug around about 15%
> fewer bytes in the tile grids.  Note though this strategy temporarily uses up to
> 30% more memory while building the tile grid.  For our largest SKPs, that's
> maybe 75-100K extra.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/52455cbc02d7f480d988ae7cdacc11ad69078c2c

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

Review URL: https://codereview.chromium.org/642933002
2014-10-09 13:55:20 -07:00
mtklein
52455cbc02 Use BBH reserve hook to preallocate space for tiles.
Before getting too far into changing how SkTileGrid stores its tiles, I figured I'd
better see how much I can tweak out the existing format.  Cleverly, that way
any improvements I make by changing the format will look that much less
impressive.

This CL looks like it will be a 5-15% win in time spent recording, with no effect
on playback.

This CL also shrinks the tiles to fit exactly when we're done inserting,
using newly added SkTDArray::shrinkToFit().  It's quite cheap to run (maybe
taking back 1-2% from those 5-15% wins), and means we'll lug around about 15%
fewer bytes in the tile grids.  Note though this strategy temporarily uses up to
30% more memory while building the tile grid.  For our largest SKPs, that's
maybe 75-100K extra.

BUG=skia:

Review URL: https://codereview.chromium.org/639823005
2014-10-09 12:36:48 -07:00
reed
3d7d410ce5 remove dead code from SK_SUPPORT_LEGACY_IMAGECACHE_NAME
TBR=

Review URL: https://codereview.chromium.org/638903002
2014-10-08 06:23:29 -07:00
mtklein
fb1fe4f518 Add SkPaint::getHash().
BUG=skia:

Review URL: https://codereview.chromium.org/637583002
2014-10-07 09:26:10 -07:00
reed
9e96aa07db remove unused TextBufferDirection enum
BUG=skia:

Review URL: https://codereview.chromium.org/621403002
2014-10-03 12:44:37 -07:00
reed
2cc22b8f2f make SkMatrix::dump always available
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/624783002
2014-10-02 17:52:03 -07:00
reed
d1f0ebd0e2 specialize setConcat for scale+translate
This reverts commit 2a382f5199.

BUG=skia:

Review URL: https://codereview.chromium.org/626583002
2014-10-02 12:58:43 -07:00
robertphillips
2a382f5199 Revert of specialize setConcat for scale+translate (patchset #1 id:1 of https://codereview.chromium.org/620433002/)
Reason for revert:
Experimental to see if this revert "fixes" nanobench on the main console.

Original issue's description:
> specialize setConcat for scale+translate, helps drawText perf
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/e8db3ef2a2161084fa8eb1fd1d54c35bfff52d6c

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

Review URL: https://codereview.chromium.org/620973003
2014-10-02 04:42:55 -07:00
derekf
29dda80c01 Add support for EGL on linux
Allow setting skia_egl=1 to build skia against EGL instead of GLX on unix

Review URL: https://codereview.chromium.org/604853003
2014-10-01 10:52:52 -07:00