Commit Graph

20211 Commits

Author SHA1 Message Date
joshualitt
f5883a6d75 Hide drawBatch on GrDrawTarget from test Methods
TBR=bsalomon@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1574383002

Review URL: https://codereview.chromium.org/1574383002
2016-01-13 07:47:38 -08:00
joshualitt
bc90735170 GrAuditTrail hooks in GrContext + GrDrawContext
TBR=bsalomon@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1580023002

Review URL: https://codereview.chromium.org/1580023002
2016-01-13 06:45:40 -08:00
iroth
330043c073 Revert of Move BUILD.public to public.bzl. (patchset #1 id:1 of https://codereview.chromium.org/1577353002/ )
Reason for revert:
Corresponding google-private changes not ready.

Original issue's description:
> Move BUILD.public to public.bzl.
>
> This allows building with bazel (see http://bazel.io).
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1577353002
>
> Committed: https://skia.googlesource.com/skia/+/eeebfff54877b24151570c4f02b2299e3f9ef967

TBR=benjaminwagner@google.com,mtklein@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1580923002
2016-01-12 14:22:24 -08:00
ajuma
1554ec0689 Delete SkRectShaderImageFilter
This is no longer used (as of http://crrev.com/368929).

BUG=skia:4780
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1575233004

Review URL: https://codereview.chromium.org/1575233004
2016-01-12 14:17:30 -08:00
bsalomon
7f9b2e4a45 Swizzle shader output and blend when using GL_RED to implement kAlpha_8_GrPixelConfig
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1584473002

Review URL: https://codereview.chromium.org/1584473002
2016-01-12 13:29:26 -08:00
joshualitt
87a721b246 Convert GrAuditTrail to use scoped frames
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1579193002

Review URL: https://codereview.chromium.org/1579193002
2016-01-12 12:59:28 -08:00
fmalita
61a237e319 SkPaintFilterCanvas cleanup
All external clients have been updated, we can now remove the
transitional kludges.

BUG=skia:4782
R=reed@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1574303003

Review URL: https://codereview.chromium.org/1574303003
2016-01-12 12:14:10 -08:00
senorblanco
8d30dae5a0 Remove #ifdef SK_DISABLE_TILE_IMAGE_FILTER_OPTIMIZATION.
No longer enabled in Chrome.

BUG=569950
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1580843002

Review URL: https://codereview.chromium.org/1580843002
2016-01-12 12:12:56 -08:00
iroth
eeebfff548 Move BUILD.public to public.bzl.
This allows building with bazel (see http://bazel.io).

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1577353002

Review URL: https://codereview.chromium.org/1577353002
2016-01-12 12:00:49 -08:00
halcanary
2b12376849 SkTime: Stop using POSIX entensions to time.h for timezone
SkTime::GetDateTime() isn't used anywhere in production, so
change it to return current UTC time, rather than local time.

Also, move code into SkTime out of ports.

A later CL will remove empty files.

BUG=skia:4736
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1562943002

[mtklein]
Only deleting unused API.
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1562943002
2016-01-12 11:55:29 -08:00
bsalomon
76148af6df Hide formats in GrGLCaps and use specific getters for different GL functions.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1580003002

Review URL: https://codereview.chromium.org/1580003002
2016-01-12 11:13:47 -08:00
caryclark
368342ccb5 Refactor resize filter to go faster
Part of this CL improves the speed by using dynamic arrays
more effectively.

Part uses SIMD and more concise float expressions for speed.

Some unused code was deleted.

The latter changes are guarded by:

  SK_SUPPORT_LEGACY_BITMAP_FILTER

until this lands and the corresponding layout changes in
chrome can be relanded.

With the legacy flag defined, no Skia or Chrome test results
change. Without the flag defined in Skia, only 0.01% - 0.02%
of the pixels change, and then by (1,1,1) in 8888.

codereview.chromium.org/1583533002 adds the guard to Chrome.

R=reed@google.com
BUG=skia:2261
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1563183003

Review URL: https://codereview.chromium.org/1563183003
2016-01-12 10:44:02 -08:00
senorblanco
05dcb4c7a9 Optimize SkTileImageFilter in an offset filter when possible.
If the srcRect and dstRect have the same size, tiling will have the
same effect as an offset filter cropped to the intersection of
srcRect and dstRect. So do that instead.

BUG=569950
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1578983002

Review URL: https://codereview.chromium.org/1578983002
2016-01-12 07:49:15 -08:00
caryclark
c63a0f8fe5 clamp fixed divide to 32 bits
In SkEdge::setLine, the numerator is a 26.6 fixed number.
SkFixedDiv shifts it up by an additional 16 bits. If the
y interval is small, the result overflows 32 bits.

The code pins in 64 bit space before down-casting the result.

R=reed@google.com
BUG=skia:4708
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1583453002

Review URL: https://codereview.chromium.org/1583453002
2016-01-12 07:21:19 -08:00
fmalita
32cdc32522 SkTCopyOnFirstWrite-based SkPaintFilterCanvas API
I find this version preferable because

1) it consolidates the in/out paint args without compromising
efficiency or flexibility

2) relieves overriders from having to set the SkTLazy explicitly

BUG=skia:4782
R=mtklein@google.com,reed@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1576183002

Review URL: https://codereview.chromium.org/1576183002
2016-01-12 07:21:11 -08:00
msarett
a51e7782b2 Use SkOpts routines in SkSwizzler
This is a bit tricky because we don't intend to support sampling
in SkOpts.  The swizzler will fallback to a default routine in
the event that sampling is requested.

BUG=skia:4767
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1563393002

Review URL: https://codereview.chromium.org/1563393002
2016-01-12 06:51:11 -08:00
joshualitt
086cee12de Add batch names and bounds to json debug information
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1577093003

Review URL: https://codereview.chromium.org/1577093003
2016-01-12 06:45:24 -08:00
benjaminwagner
1ad0415b03 Revert of For Google3, enable SK_SUPPORT_LEGACY_SAVEFLAGS; required by legacy webkit_headless. (patchset #2 id:20001 of https://codereview.chromium.org/1568633002/ )
Reason for revert:
Removed legacy saveflags in internal cl/111889802.

Original issue's description:
> For Google3, enable SK_SUPPORT_LEGACY_SAVEFLAGS; required by legacy webkit_headless.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1568633002
>
> Committed: https://skia.googlesource.com/skia/+/85c8d06540942531fe3440fafa2a2825f128251a

TBR=mtklein@google.com,reed@google.com
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=skia:

Review URL: https://codereview.chromium.org/1578033003
2016-01-11 15:01:38 -08:00
senorblanco
a9fbd1676c Fix SkTileImageFilter when srcRect is a superset of bitmap bounds.
If the input bitmap passed to SkTileImageFilter does not fill the
srcRect, we were tiling this incorrectly (see the first sample
from tileimage filter -- it draws from a srcRect of 12,12 50x50
to a dstRect of 0,0 50x50. There should be no tiling at all
in this case!)

In order to fix this, we need to pad the bitmap out to srcRect,
and tile with that. In order to tile correctly in the GPU case,
we need to request a tileable texture.

NOTE: this will change the results of the tileimagefilter GM (correctness,
and added src / dest rects).

BUG=skia:4774
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1570133003

Review URL: https://codereview.chromium.org/1570133003
2016-01-11 14:09:09 -08:00
fmalita
bad23dc9ed SkPaintFilterCanvas skip-draw support
At the time SkPaintFilterCanvas was introduced as a SkDrawFilter replacement,
no clients were relying on the draw veto logic.  Now Chromium does.

To facilitate migrating off SkDrawFilter, let's augment SkPaintFilterCanvas
with skip-draw semantics.

A side effect of the CL is that now we call the filter virtual even for null
paints.

BUG=skia:4782
R=reed@google.com,robertphillips@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1577933002

Review URL: https://codereview.chromium.org/1577933002
2016-01-11 13:58:30 -08:00
joshualitt
ce894007eb Guard SkGpuDevice
TBR=bsalomon@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1567093002

Review URL: https://codereview.chromium.org/1567093002
2016-01-11 13:29:31 -08:00
mtklein
8604ca2d84 SkSwizzler: Factor skipping zeros out into a helper function.
I figure something like this lets us not worry about it in the new opts.

This skips only leading zeros per-scanline, not all zeros, but my bet is that
leading zeros are all that matters: it's got to be rare that a scanline is both
larger than 1024 pixels and has runs of 1024 transparent pixels in the middle.
I bet the big bang for the buck comes from skipping full scanlines (or even
multiple adjacent scanlines).

BUG=skia:4767
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1566653007

Review URL: https://codereview.chromium.org/1566653007
2016-01-11 13:13:55 -08:00
reed
c7141eb8fb remove external header for SkModeColorFilter
BUG=skia:4791
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1577073002

Review URL: https://codereview.chromium.org/1577073002
2016-01-11 13:09:00 -08:00
reed
0daf5dd7fc move declaration of CreateLightingFilter into SkColorMatrixFilter
BUG=skia:4791
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1574023002

Review URL: https://codereview.chromium.org/1574023002
2016-01-11 12:34:04 -08:00
Brian Salomon
639475e375 Fix BitmapCopy_Texture test on iOS
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1573273002

Review URL: https://codereview.chromium.org/1573273002 .
2016-01-11 15:15:46 -05:00
djsollen
950e626fb4 Update our version of jsoncpp to fix a memory alignment bug in the library.
This upgrades the library to 1.0.0 instead of the most recent release, since more recent releases require exceptions to be enabled.

BUG=skia:4775
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1575973003

Review URL: https://codereview.chromium.org/1575973003
2016-01-11 11:36:33 -08:00
mtklein
e5cf2c6d94 Have nanobench report bench median sample time too.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1577963002

Review URL: https://codereview.chromium.org/1577963002
2016-01-11 11:28:26 -08:00
bsalomon
9d22fd6e7b Make SkBitmap::CopyTo respect requested dst color type when bitmap is texture backed.
BUG=chromium:550559
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1576983002

Review URL: https://codereview.chromium.org/1576983002
2016-01-11 11:14:17 -08:00
reed
b4b42ed671 restore lost optimization when the shader can report const_in_y
accidentally lost we I landed https://codereview.chromium.org/1556003003

BUG=575905
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1576083002

Review URL: https://codereview.chromium.org/1576083002
2016-01-11 11:02:27 -08:00
reed
4e23cdaa6b remove imagefilter::sizeconstraint
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1571033002

Review URL: https://codereview.chromium.org/1571033002
2016-01-11 10:56:59 -08:00
joshualitt
5651ee6376 Change to wire up opnames in SkGpuDevice
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1565113004

Review URL: https://codereview.chromium.org/1565113004
2016-01-11 10:39:11 -08:00
benjaminwagner
cc16c598d7 Remove Google3 scripts.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1573223002

Review URL: https://codereview.chromium.org/1573223002
2016-01-11 10:35:46 -08:00
bsalomon
65859ec6ac Fix uninit texture key with odd number of textures
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1575993003

Review URL: https://codereview.chromium.org/1575993003
2016-01-11 09:17:52 -08:00
mtklein
6f0ff91c65 apply --match to image file names too, like we do for .skps
This should make skipping an image much cheaper.

Before:
   $ time out/Release/nanobench --images resources/ --match sdkjlfasjlfds
        4.65 real         4.41 user         0.19 sys
   $ time out/Release/nanobench --images resources/ --match sdkjlfasjlfds
        0.05 real         0.03 user         0.01 sys

The effect should be much more dramatic when there are more images to skip (e.g. on the bots).
This cuts about 6 minutes off the Debug CQ trybot.

BUG=skia:4768
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1577873002

Review URL: https://codereview.chromium.org/1577873002
2016-01-11 09:04:21 -08:00
joshualitt
4897ff20fc Move atomicinc in GrTracing to behind branch
TBR=bsalomon@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1571603003

Review URL: https://codereview.chromium.org/1571603003
2016-01-11 08:30:48 -08:00
joshualitt
6d0872d9bd Reland of Add guards to GrTextureProvider (patchset #1 id:1 of https://codereview.chromium.org/1565313003/ )
Reason for revert:
should be fixed

Original issue's description:
> Revert of Add guards to GrTextureProvider (patchset #5 id:80001 of https://codereview.chromium.org/1567983002/ )
>
> Reason for revert:
> breaking asan bot
>
> Original issue's description:
> > Add guards to GrTextureProvider
> >
> > TBR=bsalomon@google.com
> > BUG=skia:
> > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1567983002
> >
> > Committed: https://skia.googlesource.com/skia/+/b30dd1db1d914b85a691b4724713ba1b0f16cd6c
>
> TBR=robertphillips@google.com,joshualitt@chromium.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/9a9515e081c54efdd5a0b0
f662c013cbeef6d63f

TBR=bsalomon@google.com
TBR=robertphillips@google.com,joshualitt@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=skia:

Review URL: https://codereview.chromium.org/1575093002
2016-01-11 08:27:48 -08:00
herb
7cf12ddb8c Fix radii calculation code to handle large radii.
BUG=472147
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1569403002

Review URL: https://codereview.chromium.org/1569403002
2016-01-11 08:08:56 -08:00
jcgregorio
8bae7c537a docs: Fix link to 'How to submit a patch'.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1579593002
NOTRY=true
DOCS_PREVIEW= https://skia.org/?cl=1579593002

Review URL: https://codereview.chromium.org/1579593002
2016-01-11 07:42:33 -08:00
msarett
a4970dc973 Delete reallyHasAlpha() from SkCodec
TBR=reed
BUG=skia:3582
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1557403002

Review URL: https://codereview.chromium.org/1557403002
2016-01-11 07:23:23 -08:00
scroggo
b512aaa5c8 Make SkROBuffer::Iter::size() work when exhausted
According to the documentation, this method will return 0 when the Iter
is exhausted. Prior to this CL, it crashes instead.

Prevent a crash with a null fHead, and add a test to verify the
behavior.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1574603002

Review URL: https://codereview.chromium.org/1574603002
2016-01-11 06:38:00 -08:00
mtklein
0b558cb42c blacklist cpu cacherator tests in replay modes
CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-SK_USE_DISCARDABLE_SCALEDIMAGECACHE-Trybot,Test-Win8-MSVC-ShuttleB-CPU-AVX2-x86-Debug-Trybot

BUG=skia:4703
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1570323004

Review URL: https://codereview.chromium.org/1570323004
2016-01-11 06:30:47 -08:00
mtklein
3d00db39c6 Might as well inline these premultiplies.
We're paying quite a bit of function-call overhead per pixel.

On one test image we spend 3.5% of our total time in swizzle_rgba_to_n32_premul() and 8.8% of our total time in SkPreMultiplyARGB().  That turns into just 8.8% of our total time in swizzle_rgba_to_n32_premul() after inlining.

That's about a 30% speedup.

This will make SIMD procs look worse, so it's nice to land this first.

BUG=skia:4767
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1571923002

Review URL: https://codereview.chromium.org/1571923002
2016-01-11 06:16:26 -08:00
update-skps
4645e4687d Update SKP version
Automatic commit by the RecreateSKPs bot.

TBR=
NO_MERGE_BUILDS
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1576773002

Review URL: https://codereview.chromium.org/1576773002
2016-01-10 00:35:26 -08:00
reed
22471ed134 remove SkImage::applyFilter() -- unused, can always re-add later
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1573653002

Review URL: https://codereview.chromium.org/1573653002
2016-01-08 17:21:47 -08:00
ajuma
77b6ba3b6e Implement an SkPaint-based image filter
This implements SkPaintImageFilter, and is intended to replace
SkRectShaderImageFilter. By allowing a paint and not just a
shader as input, this allows consumers to control dithering.

BUG=skia:4780
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1556553002

Review URL: https://codereview.chromium.org/1556553002
2016-01-08 14:58:35 -08:00
mtklein
c146aa6fd4 Add --zero_init to simulate zero-initialized memory in CodecBench
BUG=skia:4767
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1572673004

Review URL: https://codereview.chromium.org/1572673004
2016-01-08 14:20:36 -08:00
ethannicholas
1bcbc8f8c0 Fixed an assertion error in GrAAConvexTessellator. While adding a new point, it would check that the new point was not a duplicate of the previous point. It would then drop the previous point if it was in the middle of a straight line, and proceed to add the new point.
Unfortunately, floating point precision issues mean that sometimes, after dropping the previous point, we'd end up with the newly-added point as a duplicate of the new previous point, tripping an assertion failure.

BUG=skia:4732
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1557903002

Review URL: https://codereview.chromium.org/1557903002
2016-01-08 14:09:18 -08:00
herb
b10fe4941b Remove work from constructors to facilitate debugging.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1562093002

Review URL: https://codereview.chromium.org/1562093002
2016-01-08 13:48:43 -08:00
bsalomon
cdee009886 Add a class representing texture swizzle.
Store config swizzle GrGLCaps and shader swizzles in GrGLSLCaps.

Remove GrTextureAccess's swizzle and update users of it to swizzle in their shader code.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1567733005

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

Review URL: https://codereview.chromium.org/1567733005
2016-01-08 13:20:12 -08:00
mtklein
d9c0037211 Clean up order of arguments to d,s[,aa].
This gets rid of those unsightly lambdas,
and makes the file more consistent both with itself and with Sk4px.

BUG=skia:4765
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1569373002
CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Review URL: https://codereview.chromium.org/1569373002
2016-01-08 12:12:43 -08:00