platform/upstream/libSkiaSharp.git
8 years agoRevert of SkNx miplevel building (patchset #3 id:40001 of https://codereview.chromium...
mtklein [Wed, 20 Jan 2016 16:33:59 +0000 (08:33 -0800)]
Revert of SkNx miplevel building (patchset #3 id:40001 of https://codereview.chromium.org/1606013003/ )

Reason for revert:
Paranoid revert to see if it helps skia:4823

Original issue's description:
> SkNx miplevel building
>
> All sizes approximately twice as fast.
>
> Before:
>     micros    bench
>    1649.35   mipmap_build_512x512 nonrendering
>    1824.42   mipmap_build_511x512 nonrendering
>    2100.66 ? mipmap_build_512x511 nonrendering
>    2375.94   mipmap_build_511x511 nonrendering
>
> After:
>     micros    bench
>     730.32 ! mipmap_build_512x512 nonrendering
>     922.12   mipmap_build_511x512 nonrendering
>     999.07   mipmap_build_512x511 nonrendering
>    1342.93 ! mipmap_build_511x511 nonrendering
>
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1606013003
> CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot
>
> Committed: https://skia.googlesource.com/skia/+/3bd5aba2a0e165997f683cf3aa306661e71464f6

TBR=reed@google.com,mtklein@chromium.org
# 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/1607323002

8 years agoremove fragile assert
reed [Wed, 20 Jan 2016 16:12:02 +0000 (08:12 -0800)]
remove fragile assert

The assert basically wants the following to always be true (but it aint)

floor(int + 0.5 + float) == floor(0.5 + float) + int

... where int + 0.5 happens first, and then we add the float.

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

Review URL: https://codereview.chromium.org/1609873003

8 years agoAdd ability to wire up sharelist in glcontext creation
joshualitt [Wed, 20 Jan 2016 16:07:01 +0000 (08:07 -0800)]
Add ability to wire up sharelist in glcontext creation

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

Review URL: https://codereview.chromium.org/1604993005

8 years agoMake GrGLProgramBuilder a local stack variable in CreateProgram
egdaniel [Wed, 20 Jan 2016 15:53:51 +0000 (07:53 -0800)]
Make GrGLProgramBuilder a local stack variable in CreateProgram

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

Review URL: https://codereview.chromium.org/1604313002

8 years agoadd arc circle gap gm
caryclark [Wed, 20 Jan 2016 15:46:05 +0000 (07:46 -0800)]
add arc circle gap gm

The circle and arc don't line up because
the circle uses conics and arc uses
quadratics.

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

Review URL: https://codereview.chromium.org/1606263002

8 years agoA few more small changes to make GrAtlasTextBlob nearly self contained
joshualitt [Wed, 20 Jan 2016 14:48:47 +0000 (06:48 -0800)]
A few more small changes to make GrAtlasTextBlob nearly self contained

Note: There is still a bit of friendliness, but its going to require
some creativity to deal with.

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

Review URL: https://codereview.chromium.org/1606943002

8 years agoMove distance field text positioning into GrTextUtils
joshualitt [Wed, 20 Jan 2016 14:36:09 +0000 (06:36 -0800)]
Move distance field text positioning into GrTextUtils

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

Review URL: https://codereview.chromium.org/1521633002

8 years agoTexturing support for RECTANGLE textures.
bsalomon [Wed, 20 Jan 2016 14:18:10 +0000 (06:18 -0800)]
Texturing support for RECTANGLE textures.

Uses textureSize() to unnormalize texture coords when reading from a RECTANGLE texture. Because of this we also require a later GLSL version to use rectangle textures (1.40).

Note that this causes a issue with the bicubic effect. The texture coords seem to have poor precision and the result is ugly. textureSize() is intended as a workaround until effects can be updated to handle unnormalized coords themselves.

Updates places where we were looking for OpenGL version 3.2 for rectangle support. It was actually added in 3.1.

BUG=skia:3868

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

Review URL: https://codereview.chromium.org/1594483003

8 years agoRevert of sdf: use linear edge distance approximation for all gradient directions...
mtklein [Wed, 20 Jan 2016 00:26:55 +0000 (16:26 -0800)]
Revert of sdf: use linear edge distance approximation for all gradient directions (patchset #1 id:1 of https://codereview.chromium.org/1545893003/ )

Reason for revert:
breaks roll?

https://build.chromium.org/p/tryserver.blink/builders/linux_blink_rel/builds/81753

Original issue's description:
> sdf: use linear edge distance approximation for all gradient directions
>
> Image diff tools tell me there are diffs, but I sure can't see them.
> This drops edge_distance() off the chart as far as CPU cost goes.
>
> BUG=skia:4729
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1545893003
>
> Committed: https://skia.googlesource.com/skia/+/8a87bb4d5c23da83ef406ef87b470afa4217d7a4

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

Review URL: https://codereview.chromium.org/1603953005

8 years agoFix patch check-in instructions for non-committers
hcm [Tue, 19 Jan 2016 21:57:27 +0000 (13:57 -0800)]
Fix patch check-in instructions for non-committers

BUG=skia:4681
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1606003003
NOTRY=true
DOCS_PREVIEW= https://skia.org/?cl=1606003003

Review URL: https://codereview.chromium.org/1606003003

8 years agodon't preround in bitmap scaling setup
reed [Tue, 19 Jan 2016 21:33:32 +0000 (13:33 -0800)]
don't preround in bitmap scaling setup

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

Review URL: https://codereview.chromium.org/1607853003

8 years agoAdd SSSE3 Optimizations for premul and swap
msarett [Tue, 19 Jan 2016 21:17:58 +0000 (13:17 -0800)]
Add SSSE3 Optimizations for premul and swap

Improves deocde performance for RGBA pngs.

Swizzler Time on z620 (clang):
SwapPremul 0.24x
Premul     0.24x
Swap       0.37x
Decode Time on z620 (clang):
Premul   ZeroInit Decodes 0.88x
Unpremul ZeroInit Decodes 0.94x
Premul   Regular  Decodes 0.91x
Unpremul Regular  Decodes 0.98x

Swizzler Time in Dell Venue 8 (gcc):
SwapPremul 0.14x
Premul     0.14x
Swap       0.08x
Decode Time on Dell Venus 8 (gcc):
Premul   ZeroInit Decodes 0.79x
Premul   Regular  Decodes 0.77x

Note:
ZeroInit means memory is zero initialized, and we do not write to
memory for large sections of zero pixels (memory use opt for Android).

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

Review URL: https://codereview.chromium.org/1601883002

8 years agoValgrind is not a fan of uninitialized Src pixels.
mtklein [Tue, 19 Jan 2016 20:42:49 +0000 (12:42 -0800)]
Valgrind is not a fan of uninitialized Src pixels.

E.g. search for ==31875== in this log:

https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Valgrind/builds/774/steps/nanobench/logs/stdio

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

Review URL: https://codereview.chromium.org/1601093003

8 years agosdf: use linear edge distance approximation for all gradient directions
mtklein [Tue, 19 Jan 2016 20:35:24 +0000 (12:35 -0800)]
sdf: use linear edge distance approximation for all gradient directions

Image diff tools tell me there are diffs, but I sure can't see them.
This drops edge_distance() off the chart as far as CPU cost goes.

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

Review URL: https://codereview.chromium.org/1545893003

8 years agoSkNx miplevel building
mtklein [Tue, 19 Jan 2016 20:20:01 +0000 (12:20 -0800)]
SkNx miplevel building

All sizes approximately twice as fast.

Before:
    micros    bench
   1649.35   mipmap_build_512x512 nonrendering
   1824.42   mipmap_build_511x512 nonrendering
   2100.66 ? mipmap_build_512x511 nonrendering
   2375.94   mipmap_build_511x511 nonrendering

After:
    micros    bench
    730.32 ! mipmap_build_512x512 nonrendering
    922.12   mipmap_build_511x512 nonrendering
    999.07   mipmap_build_512x511 nonrendering
   1342.93 ! mipmap_build_511x511 nonrendering

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

Review URL: https://codereview.chromium.org/1606013003

8 years agoClean up unused or overly complex modes in SkSwizzler
msarett [Tue, 19 Jan 2016 18:40:12 +0000 (10:40 -0800)]
Clean up unused or overly complex modes in SkSwizzler

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

Review URL: https://codereview.chromium.org/1582083005

8 years agoexclude new function from legacy code path
caryclark [Tue, 19 Jan 2016 17:57:16 +0000 (09:57 -0800)]
exclude new function from legacy code path

hopefully fixes the broken roll

TBR=dogben@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1605023002

Review URL: https://codereview.chromium.org/1605023002

8 years agoRevert of Update libwebp to version 0.5.0 (patchset #2 id:20001 of https://codereview...
benjaminwagner [Tue, 19 Jan 2016 17:50:17 +0000 (09:50 -0800)]
Revert of Update libwebp to version 0.5.0 (patchset #2 id:20001 of https://codereview.chromium.org/1601253003/ )

Reason for revert:
Seems to be causing bots to fail:
https://build.chromium.org/p/client.skia.compile/builders/Build-Ubuntu-GCC-Arm7-Release-Android_NoNeon/builds/4032
https://build.chromium.org/p/client.skia.android/builders/Perf-Android-GCC-Nexus5-CPU-NEON-Arm7-Release/builds/3239
https://build.chromium.org/p/client.skia.android/builders/Perf-Android-GCC-Nexus5-GPU-Adreno330-Arm7-Release/builds/1887
https://build.chromium.org/p/client.skia.fyi/builders/Perf-Android-GCC-Nexus5-GPU-Adreno330-Arm7-Release-Appurify/builds/2075
https://build.chromium.org/p/client.skia.android/builders/Test-Android-GCC-Nexus5-CPU-NEON-Arm7-Debug/builds/2136
https://build.chromium.org/p/client.skia.android/builders/Test-Android-GCC-Nexus5-CPU-NEON-Arm7-Release/builds/3850
https://build.chromium.org/p/client.skia.android/builders/Test-Android-GCC-Nexus5-GPU-Adreno330-Arm7-Debug/builds/2078
https://build.chromium.org/p/client.skia.android/builders/Test-Android-GCC-Nexus5-GPU-Adreno330-Arm7-Release/builds/2000
https://build.chromium.org/p/client.skia.compile/builders/Build-Ubuntu-GCC-Arm7-Debug-Android_NoNeon/builds/4098

Original issue's description:
> Update libwebp to version 0.5.0
>
> This is the version used by Android.
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1601253003
>
> Committed: https://skia.googlesource.com/skia/+/fe35455210294c3d9de9d0d9534743acfade523d

TBR=msarett@google.com,scroggo@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1601083004

8 years agoUpdate libwebp to version 0.5.0
scroggo [Tue, 19 Jan 2016 16:54:18 +0000 (08:54 -0800)]
Update libwebp to version 0.5.0

This is the version used by Android.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1601253003

Review URL: https://codereview.chromium.org/1601253003

8 years agoFix SkAlphaThresholdFilter bounds handling.
senorblanco [Tue, 19 Jan 2016 16:50:18 +0000 (08:50 -0800)]
Fix SkAlphaThresholdFilter bounds handling.

SkAlphaThresholdFilter was always allocating a mask texture
of the same size as the source texture. In addition to
potentially wasting VRAM, this could cause the mask to be
offset from the source texture, if the resulting bounds
were a different size than the source texture.

The fix is to allocate a mask texture only as large as the
bounds, and to offset it to the bounds origin on draw.

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

Review URL: https://codereview.chromium.org/1609573002

8 years agofix circular dashing
caryclark [Tue, 19 Jan 2016 16:07:49 +0000 (08:07 -0800)]
fix circular dashing

Path measure cannot use the same code approach for quadratics
and cubics. Subdividing cubics repeatedly does not result in
subdivided t values, e.g. a quarter circle cubic divided in
half twice does not have a t value equivalent to 1/4.

Instead, always compute the cubic segment from a pair of
t values.

When finding the length of the cubic through recursive measures,
it is enough to carry the point at a given t to the next
subdivision.

(Chrome suppression has landed already.)

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

Review URL: https://codereview.chromium.org/1602153002

8 years agoSkStream/Priv cleanups
scroggo [Tue, 19 Jan 2016 15:53:39 +0000 (07:53 -0800)]
SkStream/Priv cleanups

Replace all callers of SkCopyStreamToStorage with SkCopyStreamToData,
which is simpler and does the same thing.

Remove SkStreamRewindableFromSkStream, which is unused.

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

Review URL: https://codereview.chromium.org/1604963002

8 years agoThis CL moves a bit more logic into GrAtlasTextBlob
joshualitt [Tue, 19 Jan 2016 14:59:29 +0000 (06:59 -0800)]
This CL moves a bit more logic into GrAtlasTextBlob

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

Review URL: https://codereview.chromium.org/1516943004

8 years agoSampleApp: Remove SkWindow::setColorType
kkinnunen [Mon, 18 Jan 2016 09:18:34 +0000 (01:18 -0800)]
SampleApp: Remove SkWindow::setColorType

Remove SkWindow::setColorType, it is used wrong and inconsistently.

The color type is actually property of window backbuffer, used when the
window is painted with software. This is as opposed to a generic window
property that would affect all operation.

Similar to MSAA sample count for window GPU backbuffer, the bitmap
backbuffer color type should be a parameter of "attach" or "create
window" functions, should this property ever be added back.

The apps use the call wrong, setting the type as kRGBA_8888
or kBGRRA_8888 without no apparent rationale. These color types
are incorrect, as the raster surface can not work with these.

Reorganize the SkWindow::resize, since no change in SkWindow backbuffer size does not neccessarily mean that SkView would not need the call.

Do not show the sw backbuffer color type in SampleApp title, as
it does not really provide any information. On small screens,
kBGRA_8888_ColorType fills up the whole title.

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

Review URL: https://codereview.chromium.org/1595503002

8 years agoSampleApp: remove SkWindow::onPDFSaved, it does not work
kkinnunen [Mon, 18 Jan 2016 08:47:14 +0000 (00:47 -0800)]
SampleApp: remove SkWindow::onPDFSaved, it does not work

Remove SkWindow::onPDFSaved, it does not work and it is not used anymore.

Also, it is very SampleApp -specific feature implemented in SkWindow class.
SkWindow class is probably intended to be more app-agnosting than
what this method implies.

Presumably the idea of the callback was to inform the user of
SampleApp that the PDF was saved to a certain location.

For Android SampleApp, show a hardcoded toast that the PDF was saved to
/sdcard.

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

Review URL: https://codereview.chromium.org/1547923002

8 years agoremove SK_SUPPORT_LEGACY_MIPLEVEL_BUILDER code
reed [Sun, 17 Jan 2016 22:16:12 +0000 (14:16 -0800)]
remove SK_SUPPORT_LEGACY_MIPLEVEL_BUILDER code

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

TBR=

Review URL: https://codereview.chromium.org/1599133002

8 years agoUpdate SKP version
update-skps [Sun, 17 Jan 2016 08:54:04 +0000 (00:54 -0800)]
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=1593713008

Review URL: https://codereview.chromium.org/1593713008

8 years agouse pixmaps in mipmap api
reed [Sun, 17 Jan 2016 02:50:35 +0000 (18:50 -0800)]
use pixmaps in mipmap api

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

Review URL: https://codereview.chromium.org/1598803002

8 years agoremove SkDebugUtils.h -- unused
reed [Sat, 16 Jan 2016 20:44:12 +0000 (12:44 -0800)]
remove SkDebugUtils.h -- unused

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

Review URL: https://codereview.chromium.org/1585553002

8 years agospeedup mip builders
reed [Sat, 16 Jan 2016 17:23:48 +0000 (09:23 -0800)]
speedup mip builders

1. push the inner-loop into the procs
2. for the 3x3 and 3x2 cases, skip the redundant horizontal read/expand

Some before/after timings (unfortunately there's a lot of variance) -- on MacBook Air

Before

   9/9   MB 1 1.45ms 1.65ms 1.92ms 2.93ms 31% ▂█▂▁▁▁▂█▆▂ nonrendering mipmap_build_512x512
   9/9   MB 1 1.85ms 2.33ms 2.47ms 3.69ms 28% ▃██▄▃▂▁▂▁▁ nonrendering mipmap_build_511x512
   9/9   MB 1 2.15ms 2.21ms 2.37ms 3.28ms 15% █▂▂▁▁▁▁▅▁▁ nonrendering mipmap_build_512x511
   9/9   MB 1 2.74ms 3.9ms 4.03ms 5.89ms 25% ▄▂▃▄█▂▁▂▇▅ nonrendering mipmap_build_511x511

After

  10/10  MB 1 1.08ms 1.09ms 1.1ms 1.18ms 3% ▁▁▁▁▁▁▁█▃▁ nonrendering mipmap_build_512x512
  10/10  MB 1 1.22ms 1.44ms 1.66ms 2.83ms 30% ▂▂▄▁▁▃█▅▂▁ nonrendering mipmap_build_511x512
  10/10  MB 1 1.45ms 1.91ms 2.04ms 3.75ms 36% ▁▁▁▃▅█▃▂▂▂ nonrendering mipmap_build_512x511
  10/10  MB 1 1.7ms 1.7ms 1.81ms 2.41ms 13% █▁▁▁▁▁▁▁▁▄ nonrendering mipmap_build_511x511

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

Review URL: https://codereview.chromium.org/1593073002

8 years agoupdate mipbuilder bench to exercise all 4 procs
reed [Sat, 16 Jan 2016 02:47:38 +0000 (18:47 -0800)]
update mipbuilder bench to exercise all 4 procs

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

TBR=

Review URL: https://codereview.chromium.org/1594533005

8 years agouse triangle filter for odd dimensions in mip-levels
reed [Fri, 15 Jan 2016 21:17:08 +0000 (13:17 -0800)]
use triangle filter for odd dimensions in mip-levels

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

Review URL: https://codereview.chromium.org/1592473002

8 years agoadd SkNx::abs(), for now only implemented for Sk4f
mtklein [Fri, 15 Jan 2016 20:16:40 +0000 (12:16 -0800)]
add SkNx::abs(), for now only implemented for Sk4f

There's no reason we couldn't implement this for all ints and floats;
just don't want to land unused code.

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

Review URL: https://codereview.chromium.org/1590843003

8 years agoModify kilobench to run each sample in its own process
joshualitt [Fri, 15 Jan 2016 20:07:39 +0000 (12:07 -0800)]
Modify kilobench to run each sample in its own process

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

Review URL: https://codereview.chromium.org/1594553003

8 years agoDifferentiate maxColorSamples and maxStencilSamples in GrCaps
egdaniel [Fri, 15 Jan 2016 19:36:18 +0000 (11:36 -0800)]
Differentiate maxColorSamples and maxStencilSamples in GrCaps

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

Review URL: https://codereview.chromium.org/1592803002

8 years agoAdd NEON swap opts and use opts in SkSwizzler
msarett [Fri, 15 Jan 2016 19:02:36 +0000 (11:02 -0800)]
Add NEON swap opts and use opts in SkSwizzler

All RGBA, RGBX, BGRA, BGRX routines in SkSwizzler now use fast
options (with the exception of conversions to 565).

Swizzle Time for swap_rb
0.94x Nexus 9
0.81x Nexus 6P

Unpremul Decode Time for RGBA PNGs***
ZeroInit 0.93x Nexus 9
Regular  0.94x Nexus 9
ZeroInit 0.97x Nexus 6P
ZeroInit 0.95x Nexus 6P

***Two Notes:
The improvements here are actually due to taking advantage of
memcpy() (no need to swap, the bytes are already in the proper
order).
ZeroInit skips writing zeros to zero initialized memory.  This
is a memory use opt in Android.

BMP decodes should also benefit from these improvements.

I am relying on Gold to help test all possible cases.

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

Review URL: https://codereview.chromium.org/1581933006

8 years agoadd GM to show miplevels for all colortypes
reed [Fri, 15 Jan 2016 18:51:08 +0000 (10:51 -0800)]
add GM to show miplevels for all colortypes

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

TBR=

Review URL: https://codereview.chromium.org/1594613002

8 years agoNow Kilobench times, exact same timing mechanism as nanobench
joshualitt [Fri, 15 Jan 2016 18:00:08 +0000 (10:00 -0800)]
Now Kilobench times, exact same timing mechanism as nanobench

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

Review URL: https://codereview.chromium.org/1581153006

8 years agoFix GL texture target program key
bsalomon [Fri, 15 Jan 2016 16:25:26 +0000 (08:25 -0800)]
Fix GL texture target program key
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1593643002

Review URL: https://codereview.chromium.org/1593643002

8 years agoIf we pass no bytes, use the fuzz binary itself.
mtklein [Fri, 15 Jan 2016 15:56:20 +0000 (07:56 -0800)]
If we pass no bytes, use the fuzz binary itself.

This is mostly for convenient local testing.

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

Review URL: https://codereview.chromium.org/1587043009

8 years agotest pow2 and non mipbuilders
reed [Fri, 15 Jan 2016 15:41:07 +0000 (07:41 -0800)]
test pow2 and non mipbuilders

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

TBR=

Review URL: https://codereview.chromium.org/1589503006

8 years agoFix compile error in Google3 build.
benjaminwagner [Fri, 15 Jan 2016 14:21:18 +0000 (06:21 -0800)]
Fix compile error in Google3 build.

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

Review URL: https://codereview.chromium.org/1593623002

8 years agoRestore creature comforts to fuzz binary
mtklein [Fri, 15 Jan 2016 14:19:53 +0000 (06:19 -0800)]
Restore creature comforts to fuzz binary

The hack to remove these niceties didn't seem to make a difference in my
fuzz/s, so we might as well keep them.

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

Review URL: https://codereview.chromium.org/1589493006

8 years agofuzz: signalBug() / signalBoring()
mtklein [Fri, 15 Jan 2016 13:46:54 +0000 (05:46 -0800)]
fuzz: signalBug() / signalBoring()

Instead of a single ASSERT macro, this switches to two new methods:
   - signalBug():    tell afl-fuzz there's a bug caused by its inputs (by crashing)
   - signalBoring(): tell afl-fuzz these inputs are not worth testing (by exiting gracefully)

I'm not seeing any effect on fuzz/s when I just always log verbosely.

signalBug() now triggers SIGSEGV rather than SIGABRT.  This should make it work with catchsegv more easily.

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

Review URL: https://codereview.chromium.org/1585353002

8 years agoAdd optimize_coding setting for JPEG encoding.
benjaminwagner [Fri, 15 Jan 2016 02:13:32 +0000 (18:13 -0800)]
Add optimize_coding setting for JPEG encoding.

Produces smaller encoded output at the expense of encoding time. No visual differences.

sample image 1 (RGB gradients):
default (80): 2.5x slower, 34% smaller
quality 0: 1.7x slower, 52% smaller
quality 20: 2.1x slower, 55% smaller
quality 40: 2.3x slower, 37% smaller
quality 60: 2.5x slower, 36% smaller
quality 100: 3.9x slower, 22% smaller

sample image 2 (photo):
default (80): 2x slower, 8% smaller
quality 0: 1.5x slower, 49% smaller
quality 20: 1.7x slower, 22% smaller
quality 40: 1.9x slower, 15% smaller
quality 60: 1.9x slower, 11% smaller
quality 100: 2x slower, 9% smaller

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

Review URL: https://codereview.chromium.org/1589593002

8 years agoRevert of these _procs_arm are not used when we have NEON (patchset #1 id:1 of https...
mtklein [Thu, 14 Jan 2016 21:49:17 +0000 (13:49 -0800)]
Revert of these _procs_arm are not used when we have NEON (patchset #1 id:1 of https://codereview.chromium.org/1587983004/ )

Reason for revert:
Breaks Chrome roll:

https://build.chromium.org/p/tryserver.chromium.android/builders/android_chromium_gn_compile_rel/builds/8391/steps/compile%20%28with%20patch%29/logs/stdio

Original issue's description:
> these _procs_arm are not used when we have NEON
>
> BUG=skia:4798
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1587983004
> CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot
>
> Committed: https://skia.googlesource.com/skia/+/349dcc99b69f27ab834232796371e678625078e0

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

Review URL: https://codereview.chromium.org/1589633005

8 years agoCreate an SkCodecImageGenerator
msarett [Thu, 14 Jan 2016 21:12:26 +0000 (13:12 -0800)]
Create an SkCodecImageGenerator

BUG=skia:

patch from issue 1396323007 at patchset 120001 (http://crrev.com/1396323007#ps120001)
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1487683004

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

Review URL: https://codereview.chromium.org/1487683004

8 years agofix SkGpuDevice::drawBitmapRect to always update clips
lsalzman [Thu, 14 Jan 2016 21:06:41 +0000 (13:06 -0800)]
fix SkGpuDevice::drawBitmapRect to always update clips

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

Review URL: https://codereview.chromium.org/1584073007

8 years agoUpdate tests to produce more sensible output for Android framework builds.
djsollen [Thu, 14 Jan 2016 20:23:54 +0000 (12:23 -0800)]
Update tests to produce more sensible output for Android framework builds.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1590023002

Review URL: https://codereview.chromium.org/1590023002

8 years agoRevert of Create an SkCodecImageGenerator (patchset #10 id:260001 of https://coderevi...
msarett [Thu, 14 Jan 2016 20:20:45 +0000 (12:20 -0800)]
Revert of Create an SkCodecImageGenerator (patchset #10 id:260001 of https://codereview.chromium.org/1487683004/ )

Reason for revert:
Core doesn't know about Codec.

Original issue's description:
> Create an SkCodecImageGenerator
>
> BUG=skia:
>
> patch from issue 1396323007 at patchset 120001 (http://crrev.com/1396323007#ps120001)
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1487683004
>
> Committed: https://skia.googlesource.com/skia/+/e1102ce1d3d0895e840e756e155ec56b5a1a7540

TBR=reed@google.com,scroggo@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/1582373003

8 years agoVisualBench: Make the Android SDL app start without cmdline arguments
kkinnunen [Thu, 14 Jan 2016 19:54:13 +0000 (11:54 -0800)]
VisualBench: Make the Android SDL app start without cmdline arguments

Make the Android SDL VisualBench start even if it is started without
command-line arguments.

Also makes it start when started by pressing the icon.

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

Review URL: https://codereview.chromium.org/1573913008

8 years agosketch SkValue API
mtklein [Thu, 14 Jan 2016 19:43:13 +0000 (11:43 -0800)]
sketch SkValue API

I think we may be trying to take too many steps at once.
Let's try starting from an API and evolving from there?

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

Review URL: https://codereview.chromium.org/1589953003

8 years agoCreate an SkCodecImageGenerator
msarett [Thu, 14 Jan 2016 19:32:43 +0000 (11:32 -0800)]
Create an SkCodecImageGenerator

BUG=skia:

patch from issue 1396323007 at patchset 120001 (http://crrev.com/1396323007#ps120001)
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1487683004

Review URL: https://codereview.chromium.org/1487683004

8 years agothese _procs_arm are not used when we have NEON
mtklein [Thu, 14 Jan 2016 19:16:47 +0000 (11:16 -0800)]
these _procs_arm are not used when we have NEON

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

Review URL: https://codereview.chromium.org/1587983004

8 years agoAdd skeleton for kilobench experiments
joshualitt [Thu, 14 Jan 2016 19:05:22 +0000 (11:05 -0800)]
Add skeleton for kilobench experiments

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

Review URL: https://codereview.chromium.org/1582903002

8 years agoVirtualize Frames in GrAuditTrail
joshualitt [Thu, 14 Jan 2016 18:58:07 +0000 (10:58 -0800)]
Virtualize Frames in GrAuditTrail

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

Review URL: https://codereview.chromium.org/1581943004

8 years agoremove unused SkBitmapFilter::Allocate
reed [Thu, 14 Jan 2016 18:40:29 +0000 (10:40 -0800)]
remove unused SkBitmapFilter::Allocate

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

TBR=

Review URL: https://codereview.chromium.org/1589683004

8 years agoadd explicit bench for raw bitmapscaler
reed [Thu, 14 Jan 2016 18:10:56 +0000 (10:10 -0800)]
add explicit bench for raw bitmapscaler

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

patch from issue 1586803003 at patchset 20001 (http://crrev.com/1586803003#ps20001)

TBR=

Review URL: https://codereview.chromium.org/1588113002

8 years agoAdd Audittrail for path renderers
joshualitt [Thu, 14 Jan 2016 17:58:36 +0000 (09:58 -0800)]
Add Audittrail for path renderers

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

Review URL: https://codereview.chromium.org/1588683002

8 years agoBeginning of support for texture rectangles.
bsalomon [Thu, 14 Jan 2016 17:24:09 +0000 (09:24 -0800)]
Beginning of support for texture rectangles.

Adds support for importing a RECTANGLE texture into Skia via GrTexureProvider::wrapBackendTexture().

Tests read/writing pixels, copySurface, and clear.

Does not add support for texturing from a RECTANGLE texture as the coords will be incorrectly normalized.

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

Review URL: https://codereview.chromium.org/1583863002

8 years agoVisualBench: Use first succeeding EGL API
kkinnunen [Thu, 14 Jan 2016 17:12:01 +0000 (09:12 -0800)]
VisualBench: Use first succeeding EGL API

Fix initialization of the app window by
using the first EGL context that succeeds, not the last one.

Fixes the window creation in some cases on devices that support
OpenGL and OpenGL ES.

Also check EGL call results.

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

Review URL: https://codereview.chromium.org/1582313002

8 years agoexpand gm to exercise miplevels and various scalers
reed [Thu, 14 Jan 2016 17:11:51 +0000 (09:11 -0800)]
expand gm to exercise miplevels and various scalers

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

TBR=

Review URL: https://codereview.chromium.org/1574233003

8 years agoRevert of Make A8 readback work in more cases and improve testing. (patchset #5 id...
bsalomon [Thu, 14 Jan 2016 15:19:47 +0000 (07:19 -0800)]
Revert of Make A8 readback work in more cases and improve testing. (patchset #5 id:70001 of https://codereview.chromium.org/1584563002/ )

Reason for revert:
Breaking video tests in Chrome.

Original issue's description:
> Make A8 readback work in more cases and improve testing.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1584563002
>
> Committed: https://skia.googlesource.com/skia/+/b76afedf11c7fe933954d030048c3222860249e1

TBR=egdaniel@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/1581203005

8 years agoSampleApp: Make android_install_app and android_launch_app work consistently
kkinnunen [Thu, 14 Jan 2016 14:07:40 +0000 (06:07 -0800)]
SampleApp: Make android_install_app and android_launch_app work consistently

Make android_install_app work more consistently:
* App can be "SampleApp" or "VisualBench"

Make android_launch_app work more consistently:
* Parameters to SampleApp are passed correctly
* SampleApp is actually launched

The parameters to "am" need to be quoted, since the command
is run on the device shell.

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

Review URL: https://codereview.chromium.org/1589883002

8 years agoRefactor to use GrWrapTextureInBitmap more
robertphillips [Thu, 14 Jan 2016 14:03:29 +0000 (06:03 -0800)]
Refactor to use GrWrapTextureInBitmap more

Too many wrap_texture methods!

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

Review URL: https://codereview.chromium.org/1584933002

8 years agoSampleApp: Cleanup SkOSWindow_SDL
kkinnunen [Thu, 14 Jan 2016 13:37:51 +0000 (05:37 -0800)]
SampleApp: Cleanup SkOSWindow_SDL

Implements:
 * Event loop event waiting (no busy loop)
 ** Skia timers
 * Proper window sizing and resizing
 * MSAA on X11 (previously it did not use MSAA at all)
 * Changes requested colorspace from 565 to 8888
   to match non-SDL variants
 * Context creation clearing (color and stencil mask)
 * Opens the window in 640x480 by default on desktop.

Removes dead code.

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

Review URL: https://codereview.chromium.org/1578173002

8 years agosome fuzz hacking
mtklein [Thu, 14 Jan 2016 12:59:42 +0000 (04:59 -0800)]
some fuzz hacking

Try to start faster:
 - remove flags dependency
 - print nothing
 - strip unused symbols from the binary on Mac (smaller binary)
 - only create one fuzz object
 - only run one DEF_FUZZ
I am not sure if any of these things mattered, but I thought you may like to look.

Good stuff:
 - make nextU() / nextF() work
 - drop nextURange() / nextFRange() for now
 - add nextB() for a single byte

As you may have guessed, I have figured out how to use afl-fuzz on my laptop.

Syntax to run becomes:
  $ afl-fuzz ... out/Release/fuzz <DEF_FUZZ name> @@

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

Review URL: https://codereview.chromium.org/1581203003

8 years agoSimplify path allocation, clean up resources correctly
kkinnunen [Thu, 14 Jan 2016 07:36:45 +0000 (23:36 -0800)]
Simplify path allocation, clean up resources correctly

Simplify path id allocation in NVPR backend. Instead of using
an AVL tree of path id ranges for the first 65535 ids, use just
a simple stategy of overallocation and "bump index".

Fixes the bug where previously overallocated ids were not deleted.

The advantage is that the implementation is simple and all allocations
go through overallocation, not just the first 65535 of the 1-range
allocations.

Removes the logic where paths were cleared with setting path data to
null instead of deleting the whole path. Now deleted paths are just
deleted normally. These operations should have equivalent performance on
command buffer. Deleting the path should enable the driver to do more
maintainance.

Removes the GLNameAllocator, as it was only used for paths. In order for
it to be used for other IDs, it probably would need to be re-written to
support cleanup and arbitrary ranges. Also, the interface would probably
need to be changed to not requiring the block to be allocated before it
could be managed by the structure.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1150243003

Review URL: https://codereview.chromium.org/1150243003

8 years agoMake android scripts not warn about ADB in newer SDKs
kkinnunen [Thu, 14 Jan 2016 06:53:55 +0000 (22:53 -0800)]
Make android scripts not warn about ADB in newer SDKs

The older SDK says:
$ adb version
Android Debug Bridge version 1.0.32

The newer SDK says:
$ adb version
Android Debug Bridge version 1.0.32
Revision eac51f2bb6a8-android

Removes the shebang as the file is not intended to be
run, and the copyright would render it useless.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1583793002

Review URL: https://codereview.chromium.org/1583793002

8 years agoOptimized premultiplying swizzles for NEON
msarett [Wed, 13 Jan 2016 22:31:59 +0000 (14:31 -0800)]
Optimized premultiplying swizzles for NEON

Improves decode performance for RGBA encoded PNGs.

Swizzle Time on Nexus 9 (with clang):
SwapPremul 0.44x
Premul     0.44x
Decode Time On Nexus 9 (with clang):
ZeroInit Decodes 0.85x
Regular  Decodes 0.86x

Swizzle Time on Nexus 6P (with clang)
SwapPremul 0.14x
Premul     0.14x
Decode Time On Nexus 6P (with clang):
ZeroInit Decodes 0.93x
Regular  Decodes 0.95x

Notes:
ZeroInit means memory is zero initialized, and we do not write to
memory for large sections of zero pixels (memory use opt for Android).

A profile on Nexus 9 shows that the premultiplication step of PNG
decoding is now ~5% of decode time (down from ~20%).

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

Review URL: https://codereview.chromium.org/1577703006

8 years agoFix SkXfermodeImageFilter GPU fast path for differing sizes.
senorblanco [Wed, 13 Jan 2016 21:48:54 +0000 (13:48 -0800)]
Fix SkXfermodeImageFilter GPU fast path for differing sizes.

The GPU fast path was not doing the correct thing for input bitmaps of
differing sizes. This change brings the fast path in line with the
slow path: use the union of foreground and background bounds as bounds,
offset the draw context by the bounds translation, and translate the
foreground and background independently by their respective offsets.

Finally, we add a texture domain for the background fragment
processor, since we may access texels outside its domain.

Note: this adds two new test cases to the xfermodeimagefilter GM, so
those will need to be rebaselined.

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

Review URL: https://codereview.chromium.org/1588633002

8 years agoFix fuzzer-found deserialization bugs
ajuma [Wed, 13 Jan 2016 21:46:31 +0000 (13:46 -0800)]
Fix fuzzer-found deserialization bugs

This fixes deserialization bugs found by fuzzing SkPaintImageFilter.

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

Review URL: https://codereview.chromium.org/1589533002

8 years agoAllow Resize to be called w/ a preallocated pixmap
reed [Wed, 13 Jan 2016 21:36:31 +0000 (13:36 -0800)]
Allow Resize to be called w/ a preallocated pixmap

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

Review URL: https://codereview.chromium.org/1588653002

8 years agoRemove remaining users of draw*Rect calls
joshualitt [Wed, 13 Jan 2016 21:35:35 +0000 (13:35 -0800)]
Remove remaining users of draw*Rect calls

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

Review URL: https://codereview.chromium.org/1579223003

8 years agoAdd new fuzz binary.
mtklein [Wed, 13 Jan 2016 20:57:57 +0000 (12:57 -0800)]
Add new fuzz binary.

This is designed to have short startup time, for maximum fuzzing throughput.

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

Review URL: https://codereview.chromium.org/1589563002

8 years agoMove some program building utils from GL to GLSL
egdaniel [Wed, 13 Jan 2016 20:19:30 +0000 (12:19 -0800)]
Move some program building utils from GL to GLSL

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

Review URL: https://codereview.chromium.org/1535603006

8 years agoMake A8 readback work in more cases and improve testing.
bsalomon [Wed, 13 Jan 2016 20:19:15 +0000 (12:19 -0800)]
Make A8 readback work in more cases and improve testing.

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

Review URL: https://codereview.chromium.org/1584563002

8 years agomicro fix for rrects bug using GrDrawContext
joshualitt [Wed, 13 Jan 2016 19:23:26 +0000 (11:23 -0800)]
micro fix for rrects bug using GrDrawContext

TBR=bsalomon@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1582933002

Review URL: https://codereview.chromium.org/1582933002

8 years agoRemove size check from SkCodec
msarett [Wed, 13 Jan 2016 18:54:20 +0000 (10:54 -0800)]
Remove size check from SkCodec

This check is useless because it is vulnerable to integer overflow.

Also, I don't think this is the right way to solve the problem
of "too large" images.  For example, many image specs allow images
larger than this, so we should too.

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

Review URL: https://codereview.chromium.org/1580113002

8 years agoReland of Move BUILD.public to public.bzl. (patchset #1 id:1 of https://codereview...
benjaminwagner [Wed, 13 Jan 2016 18:45:19 +0000 (10:45 -0800)]
Reland of Move BUILD.public to public.bzl. (patchset #1 id:1 of https://codereview.chromium.org/1580923002/ )

Reason for revert:
Internal cl/111468120 is now ready to go.

Original issue's description:
> 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:
>
> Committed: https://skia.googlesource.com/skia/+/330043c073de2ee63faa1caa3cb4170da68a79f2

TBR=mtklein@google.com,iroth@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/1584563004

8 years agoremove CreateLightingFilter from SkColorFilter
reed [Wed, 13 Jan 2016 18:43:09 +0000 (10:43 -0800)]
remove CreateLightingFilter from SkColorFilter

All callers have converted over to SkColorMatrixFilter

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

Review URL: https://codereview.chromium.org/1583923002

8 years agoRemove two varieties of drawNonAARect from GrDrawTarget
joshualitt [Wed, 13 Jan 2016 18:08:27 +0000 (10:08 -0800)]
Remove two varieties of drawNonAARect from GrDrawTarget

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

Review URL: https://codereview.chromium.org/1584703003

8 years agoAdd CodecZeroInit test to DMSrcSink
msarett [Wed, 13 Jan 2016 17:31:39 +0000 (09:31 -0800)]
Add CodecZeroInit test to DMSrcSink

This should not cause any diffs on Gold.

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

Review URL: https://codereview.chromium.org/1577853004

8 years agoremove unused SkGlobalInitialization_none.cpp
reed [Wed, 13 Jan 2016 17:05:27 +0000 (09:05 -0800)]
remove unused SkGlobalInitialization_none.cpp

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

NOTRY=True
TBR=

Review URL: https://codereview.chromium.org/1583873002

8 years agoreorg global initialization, separating core from optional
reed [Wed, 13 Jan 2016 16:47:54 +0000 (08:47 -0800)]
reorg global initialization, separating core from optional

Chrome will be changed to just inherit our files, with no need to have their own copy. see https://codereview.chromium.org/1581533007/

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

Review URL: https://codereview.chromium.org/1580873002

8 years agoHide drawBatch on GrDrawTarget from test Methods
joshualitt [Wed, 13 Jan 2016 15:47:38 +0000 (07:47 -0800)]
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

8 years agoGrAuditTrail hooks in GrContext + GrDrawContext
joshualitt [Wed, 13 Jan 2016 14:45:40 +0000 (06:45 -0800)]
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

8 years agoRevert of Move BUILD.public to public.bzl. (patchset #1 id:1 of https://codereview...
iroth [Tue, 12 Jan 2016 22:22:24 +0000 (14:22 -0800)]
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

8 years agoDelete SkRectShaderImageFilter
ajuma [Tue, 12 Jan 2016 22:17:30 +0000 (14:17 -0800)]
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

8 years agoSwizzle shader output and blend when using GL_RED to implement kAlpha_8_GrPixelConfig
bsalomon [Tue, 12 Jan 2016 21:29:26 +0000 (13:29 -0800)]
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

8 years agoConvert GrAuditTrail to use scoped frames
joshualitt [Tue, 12 Jan 2016 20:59:28 +0000 (12:59 -0800)]
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

8 years agoSkPaintFilterCanvas cleanup
fmalita [Tue, 12 Jan 2016 20:14:10 +0000 (12:14 -0800)]
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

8 years agoRemove #ifdef SK_DISABLE_TILE_IMAGE_FILTER_OPTIMIZATION.
senorblanco [Tue, 12 Jan 2016 20:12:56 +0000 (12:12 -0800)]
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

8 years agoMove BUILD.public to public.bzl.
iroth [Tue, 12 Jan 2016 20:00:49 +0000 (12:00 -0800)]
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

8 years agoSkTime: Stop using POSIX entensions to time.h for timezone
halcanary [Tue, 12 Jan 2016 19:55:29 +0000 (11:55 -0800)]
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

8 years agoHide formats in GrGLCaps and use specific getters for different GL functions.
bsalomon [Tue, 12 Jan 2016 19:13:47 +0000 (11:13 -0800)]
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

8 years agoRefactor resize filter to go faster
caryclark [Tue, 12 Jan 2016 18:44:02 +0000 (10:44 -0800)]
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

8 years agoOptimize SkTileImageFilter in an offset filter when possible.
senorblanco [Tue, 12 Jan 2016 15:49:15 +0000 (07:49 -0800)]
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

8 years agoclamp fixed divide to 32 bits
caryclark [Tue, 12 Jan 2016 15:21:19 +0000 (07:21 -0800)]
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

8 years agoSkTCopyOnFirstWrite-based SkPaintFilterCanvas API
fmalita [Tue, 12 Jan 2016 15:21:11 +0000 (07:21 -0800)]
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