platform/upstream/libSkiaSharp.git
8 years agoSkBitmapProcState rounding bias
fmalita [Tue, 15 Dec 2015 14:48:48 +0000 (06:48 -0800)]
SkBitmapProcState rounding bias

Epsilon bias to keep bitmap sample rounding consistent with geometry
rounding.

Also update the GM to draw an outer border + drop uninteresting
scales in favor of negative scale variants.

BUG=skia:4680,skia:4649
R=reed@google.com,caryclark@google.com,mtklein@google.com

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

8 years agoAdd link to Gold trybot runs in every uploaded Skia CL
rmistry [Tue, 15 Dec 2015 14:23:33 +0000 (06:23 -0800)]
Add link to Gold trybot runs in every uploaded Skia CL

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

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

8 years agoadb_wait_for_device: More fixes
borenet [Tue, 15 Dec 2015 12:25:39 +0000 (04:25 -0800)]
adb_wait_for_device: More fixes

BUG=skia:4690

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

8 years agoFix valgrind suppressions for libjpeg-turbo warning
msarett [Mon, 14 Dec 2015 22:14:06 +0000 (14:14 -0800)]
Fix valgrind suppressions for libjpeg-turbo warning

BUG=skia:

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

8 years agoUpdate sync_google3.sh to match autoroller.py.
benjaminwagner [Mon, 14 Dec 2015 20:41:10 +0000 (12:41 -0800)]
Update sync_google3.sh to match autoroller.py.

BUG=skia:

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

8 years agoAdd option to control maximum GrBatch lookback
bsalomon [Mon, 14 Dec 2015 20:13:09 +0000 (12:13 -0800)]
Add option to control maximum GrBatch lookback

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

8 years agoSwitch fragment coordinate to 'highp' to fix various broken GMs.
ethannicholas [Mon, 14 Dec 2015 19:37:55 +0000 (11:37 -0800)]
Switch fragment coordinate to 'highp' to fix various broken GMs.

BUG=skia:4693

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

8 years agoUnify some SkNx code
mtklein [Mon, 14 Dec 2015 19:25:18 +0000 (11:25 -0800)]
Unify some SkNx code

 - one base case and one N=1 case instead of two each (or three with doubles)
 - use SkNx_cast instead of FromBytes/toBytes
 - 4-at-a-time Sk4f::ToBytes becomes a special standalone Sk4f_ToBytes

If I did everything right, this'll be perf- and pixel- neutral.

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

BUG=skia:
CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

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

8 years agoRevert of SkTime updates (patchset #2 id:20001 of https://codereview.chromium.org...
mtklein [Mon, 14 Dec 2015 18:54:24 +0000 (10:54 -0800)]
Revert of SkTime updates (patchset #2 id:20001 of https://codereview.chromium.org/1521293002/ )

Reason for revert:
linux Canary builder has no std::steady_clock.  Weird...

Original issue's description:
> SkTime updates
>
> 1) Use steady_clock instead of high_resolution_clock. If we don't have a
> guarantee of monotonicity, it's pretty much useless for timing things.
>
> 2) Implement Mac/iOS with <chrono> too.  This was waiting on C++11 library support.
>
> Both high_resolution_clock and steady_clock are (still) busted on MSVC 2013,
> so no change there.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/6a20871e5aeaa7e61f3348694bf436af16f824b9

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

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

8 years agoSkBitmap move
halcanary [Mon, 14 Dec 2015 18:19:17 +0000 (10:19 -0800)]
SkBitmap move

Running `Release/dm --gpu 0`, the number of times we call
SkBitmap::operator=(const SkBitmap&)
(which refs the pixelref) is reduced from ~214929 to ~214626.

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

8 years agoadb_wait_for_device: Add battery fallback, support no battery
borenet [Mon, 14 Dec 2015 18:07:36 +0000 (10:07 -0800)]
adb_wait_for_device: Add battery fallback, support no battery

BUG=skia:4690
TBR=rmistry

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

8 years agoDocumentation: HarfBuzz link
halcanary [Mon, 14 Dec 2015 18:03:31 +0000 (10:03 -0800)]
Documentation: HarfBuzz link

NOTRY=true
TBR=caryclark@google.com

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

8 years agoDocumentation: text shaping
halcanary [Mon, 14 Dec 2015 17:50:15 +0000 (09:50 -0800)]
Documentation: text shaping

NOTRY=true
DOCS_PREVIEW= https://skia.org/user/tips?cl=1523023002#kerning

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

8 years agopath ops: check for deleted ends
caryclark [Mon, 14 Dec 2015 16:43:21 +0000 (08:43 -0800)]
path ops: check for deleted ends

TBR=fmalita@chromium.org
BUG=569540

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

8 years agoSkTime updates
mtklein [Mon, 14 Dec 2015 16:39:13 +0000 (08:39 -0800)]
SkTime updates

1) Use steady_clock instead of high_resolution_clock. If we don't have a
guarantee of monotonicity, it's pretty much useless for timing things.

2) Implement Mac/iOS with <chrono> too.  This was waiting on C++11 library support.

Both high_resolution_clock and steady_clock are (still) busted on MSVC 2013,
so no change there.

BUG=skia:

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

8 years agoIf a point is on a path edge, it's in the path, at least for all cases where the...
caryclark [Mon, 14 Dec 2015 16:38:09 +0000 (08:38 -0800)]
If a point is on a path edge, it's in the path, at least for all cases where the path edge is not canceled with another edge through coincidence.

Add test cases for edges and conics, and make sure it all works.

R=reed@google.com
BUG=skia:4669,4265

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

8 years agoadb_wait_for_device: If we can't get the battery level, just exit
borenet [Mon, 14 Dec 2015 14:48:43 +0000 (06:48 -0800)]
adb_wait_for_device: If we can't get the battery level, just exit

BUG=skia:4606
TBR=rmistry
NOTREECHECKS=true

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

8 years agoRevert of Add config options to run different GPU APIs to dm and nanobench (patchset...
reed [Mon, 14 Dec 2015 13:58:25 +0000 (05:58 -0800)]
Revert of Add config options to run different GPU APIs to dm and nanobench (patchset #12 id:220001 of https://codereview.chromium.org/1490113005/ )

Reason for revert:
speculative revert to see if it unblocks the DEPS roll

https://codereview.chromium.org/1529443002

Original issue's description:
> Add config options to run different GPU APIs to dm and nanobench
>
> Add extended config specification form that can be used to run different
> gpu backend with different APIs.
>
> The configs can be specified with the form:
> gpu(api=string,dit=bool,nvpr=bool,samples=int)
>
> This replaces and removes the --gpuAPI flag.
>
> All existing configs should still work.
>
> Adds following documentation:
>
> out/Debug/dm --help config
>
> Flags:
>     --config: type: string default: 565 8888 gpu nonrendering
>         Options: 565 8888 debug gpu gpudebug gpudft gpunull msaa16 msaa4
>         nonrendering null nullgpu nvprmsaa16 nvprmsaa4 pdf pdf_poppler skp svg
>         xps or use extended form 'backend(option=value,...)'.
>
>         Extended form: 'backend(option=value,...)'
>
>         Possible backends and options:
>
>         gpu(api=string,dit=bool,nvpr=bool,samples=int) GPU backend
>          api type: string default: native.
>              Select graphics API to use with gpu backend.
>              Options:
>          native Use platform default OpenGL or OpenGL ES backend.
>          gl     Use OpenGL.
>          gles   Use OpenGL ES.
>          debug  Use debug OpenGL.
>          null   Use null OpenGL.
>          dit type: bool default: false.
>              Use device independent text.
>          nvpr type: bool default: false.
>              Use NV_path_rendering OpenGL and OpenGL ES extension.
>          samples type: int default: 0.
>              Use multisampling with N samples.
>
>         Predefined configs:
>
>          gpu       = gpu()
>          msaa4     = gpu(samples=4)
>          msaa16    = gpu(samples=16)
>          nvprmsaa4 = gpu(nvpr=true,samples=4)
>          nvprmsaa16 = gpu(nvpr=true,samples=16)
>          gpudft     = gpu(dit=true)
>          gpudebug   = gpu(api=debug)
>          gpunull    = gpu(api=null)
>          debug      = gpu(api=debug)
>          nullgpu    = gpu(api=null)
>
> BUG=skia:2992
>
> Committed: https://skia.googlesource.com/skia/+/e13ca329fca4c28cf4e078561f591ab27b743d23

TBR=bsalomon@google.com,scroggo@google.com,joshualitt@google.com,kkinnunen@nvidia.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:2992

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

8 years agoAdd minimum battery level to adb_wait_for_device
borenet [Mon, 14 Dec 2015 13:56:45 +0000 (05:56 -0800)]
Add minimum battery level to adb_wait_for_device

This should prevent the Android bots running out of battery at the
expense of extra time spent waiting at the end of the build.

BUG=skia:4606

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

8 years agoAdd config options to run different GPU APIs to dm and nanobench
kkinnunen [Mon, 14 Dec 2015 12:49:17 +0000 (04:49 -0800)]
Add config options to run different GPU APIs to dm and nanobench

Add extended config specification form that can be used to run different
gpu backend with different APIs.

The configs can be specified with the form:
gpu(api=string,dit=bool,nvpr=bool,samples=int)

This replaces and removes the --gpuAPI flag.

All existing configs should still work.

Adds following documentation:

out/Debug/dm --help config

Flags:
    --config: type: string default: 565 8888 gpu nonrendering
        Options: 565 8888 debug gpu gpudebug gpudft gpunull msaa16 msaa4
        nonrendering null nullgpu nvprmsaa16 nvprmsaa4 pdf pdf_poppler skp svg
        xps or use extended form 'backend(option=value,...)'.

        Extended form: 'backend(option=value,...)'

        Possible backends and options:

        gpu(api=string,dit=bool,nvpr=bool,samples=int) GPU backend
         api type: string default: native.
             Select graphics API to use with gpu backend.
             Options:
         native Use platform default OpenGL or OpenGL ES backend.
         gl     Use OpenGL.
         gles   Use OpenGL ES.
         debug  Use debug OpenGL.
         null   Use null OpenGL.
         dit type: bool default: false.
             Use device independent text.
         nvpr type: bool default: false.
             Use NV_path_rendering OpenGL and OpenGL ES extension.
         samples type: int default: 0.
             Use multisampling with N samples.

        Predefined configs:

         gpu       = gpu()
         msaa4     = gpu(samples=4)
         msaa16    = gpu(samples=16)
         nvprmsaa4 = gpu(nvpr=true,samples=4)
         nvprmsaa16 = gpu(nvpr=true,samples=16)
         gpudft     = gpu(dit=true)
         gpudebug   = gpu(api=debug)
         gpunull    = gpu(api=null)
         debug      = gpu(api=debug)
         nullgpu    = gpu(api=null)

BUG=skia:2992

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

8 years agoTry to fix intermittent GrAutoLocaleSetter crashes on Windows
kkinnunen [Mon, 14 Dec 2015 07:12:31 +0000 (23:12 -0800)]
Try to fix intermittent GrAutoLocaleSetter crashes on Windows

Try to fix intermittent GrAutoLocaleSetter crashes on Windows.
The string returned by setlocale() is only valid up to
next setlocale(), so it can not be fed to setlocale().

Also, libraries such as ANGLE might call setlocale when
inside a callstack containing GrAutoLocaleSetter. This
would render the old locale pointer invalid.

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

8 years agoUpdate SKP version
update-skps [Sun, 13 Dec 2015 08:31:51 +0000 (00:31 -0800)]
Update SKP version

Automatic commit by the RecreateSKPs bot.

TBR=
NO_MERGE_BUILDS

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

8 years agoIn SkPixmap.cpp, change SkAlphaMul to SkMulDiv255.
benjaminwagner [Fri, 11 Dec 2015 22:08:58 +0000 (14:08 -0800)]
In SkPixmap.cpp, change SkAlphaMul to SkMulDiv255.

Add a test that we get the same color back after calling SkBitmap::eraseColor, modulo rounding.

Also update some incorrect docs.

BUG=skia:4297

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

8 years agoarchive skpx... currently dead code
mtklein [Fri, 11 Dec 2015 20:04:47 +0000 (12:04 -0800)]
archive skpx... currently dead code

BUG=skia:
CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

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

8 years agoChange google3 sync scripts to sync latest rather than LKGR.
benjaminwagner [Fri, 11 Dec 2015 19:26:44 +0000 (11:26 -0800)]
Change google3 sync scripts to sync latest rather than LKGR.

This matches the behavior of the autoroller and is generally more useful.

BUG=skia:

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

8 years agoA change to cleanup some organization around df text
joshualitt [Fri, 11 Dec 2015 19:05:43 +0000 (11:05 -0800)]
A change to cleanup some organization around df text

BUG=skia:

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

8 years agoNew GM: image_scale_aligned
fmalita [Fri, 11 Dec 2015 19:03:27 +0000 (11:03 -0800)]
New GM: image_scale_aligned

To verify alignment for various image scaling modes.

BUG=skia:4649
R=reed@google.com

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

8 years agoChange computeOutputColorType() to mimic old behavior
msarett [Fri, 11 Dec 2015 18:37:39 +0000 (10:37 -0800)]
Change computeOutputColorType() to mimic old behavior

This will prevent behavior changes in BitmapFactory when
switching from SkImageDecoder to SkAndroidCodec.

We will only choose kGray8 if it is explicitly requested (and
also supported).

Additionally, we will always decode GIFS and WBMPS to
kIndex8.

BUG=skia:

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

8 years agoAdd test for previously unflattenables
scroggo [Fri, 11 Dec 2015 18:29:02 +0000 (10:29 -0800)]
Add test for previously unflattenables

BUG=skia:4613

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

8 years agoFix a crash in SkParsePath::FromSVGString
scroggo [Fri, 11 Dec 2015 17:49:57 +0000 (09:49 -0800)]
Fix a crash in SkParsePath::FromSVGString

BUG=skia:3491

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

8 years agoremove explicit 'f' in glbench shader
joshualitt [Fri, 11 Dec 2015 16:31:17 +0000 (08:31 -0800)]
remove explicit 'f' in glbench shader

TBR=bsalomon@google.com
BUG=skia:

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

8 years agoIn BUILD.public, enable SK_SUPPORT_LEGACY_HAIR_IGNORES_CAPS.
benjaminwagner [Fri, 11 Dec 2015 15:54:24 +0000 (07:54 -0800)]
In BUILD.public, enable SK_SUPPORT_LEGACY_HAIR_IGNORES_CAPS.

Somehow https://codereview.chromium.org/1491843006 causes fills to change in one test.

BUG=skia:

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

8 years agoMake BitmapRegionDecoder succeed on invalid requests
msarett [Fri, 11 Dec 2015 15:38:50 +0000 (07:38 -0800)]
Make BitmapRegionDecoder succeed on invalid requests

If the client requests a color type or alpha type that is
not supported, we should decode to the default/appropriate
color and alpha types to match existing behavior in Android.

BUG=skia:

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

8 years agoMove all text stuff to its own folder
joshualitt [Fri, 11 Dec 2015 14:11:21 +0000 (06:11 -0800)]
Move all text stuff to its own folder

BUG=skia:

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

8 years agomake internaldrawBmpText part of GrTextUtils
joshualitt [Fri, 11 Dec 2015 14:08:59 +0000 (06:08 -0800)]
make internaldrawBmpText part of GrTextUtils

BUG=skia:

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

8 years agoAdd check for highp support in Conic effect
robertphillips [Fri, 11 Dec 2015 12:59:36 +0000 (04:59 -0800)]
Add check for highp support in Conic effect

This CL may not really be necessary since it seems that the Android Ones we have fall back to mediump when highp isn't supported.

FYI, for bits-of-precision/precision we have:

                        Low Med High Precision-Used
A1 (Cherry One - Mali 400) 10 10 0  Med        - conic looks bad
N5 (Adreno 330)            10 10 23 High       - conic looks bad!!!
N6 (Adreno 420)            10 10 23 High       - conic looks good
N7v2 (Adreno 320)          10 10 23 High       - conic looks bad!!!
N9 (K1)                    23 23 23 High       - looks good
N10 (Mail-604)             10 10 23 High       - looks good

I suspect derivative computation is broken on the Adreno 300s.

BUG=555779,skia:4668
TBR=bsalomon@google.com

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

8 years agoInitialize glGen* call id args to zero
kkinnunen [Fri, 11 Dec 2015 08:05:33 +0000 (00:05 -0800)]
Initialize glGen* call id args to zero

Initialize glGenTexture, glGenBuffer call id buffer items to zero before
calls. Otherwise it's not easy to check if the call succeeded or not.

Assert the rule in debug gl context.

Make TesselatingPathRendererTests use debug gl context. It exercises
some of the GenBuffers call sites.

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

8 years agoRun debug gl context for DEF_GPU_TEST_FOR_ALL_CONTEXTS
kkinnunen [Fri, 11 Dec 2015 07:19:29 +0000 (23:19 -0800)]
Run debug gl context for DEF_GPU_TEST_FOR_ALL_CONTEXTS

Run debug gl context for tests defined with
DEF_GPU_TEST_FOR_ALL_CONTEXTS.

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

8 years agoRevert of DM: fix `--config $VIA-pdf` to not crash (patchset #3 id:40001 of https...
msarett [Thu, 10 Dec 2015 23:14:27 +0000 (15:14 -0800)]
Revert of DM: fix `--config $VIA-pdf` to not crash (patchset #3 id:40001 of https://codereview.chromium.org/1513323002/ )

Reason for revert:
I believe that this is breaking master-skia in Android.

Original issue's description:
> DM: fix `--config $VIA-pdf` to not crash
>
> Committed: https://skia.googlesource.com/skia/+/6bce4177cb72faac9c10d01d57e17168ae7ecadf

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

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

8 years agoRemove flag needed by outdated libpng
msarett [Thu, 10 Dec 2015 22:45:03 +0000 (14:45 -0800)]
Remove flag needed by outdated libpng

BUG=skia:

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

8 years agoyet another memcpy -> sk_careful_memcpy
mtklein [Thu, 10 Dec 2015 22:34:23 +0000 (14:34 -0800)]
yet another memcpy -> sk_careful_memcpy

will fix
https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-ASAN/builds/3834

No API changes.
TBR=reed@google.com

BUG=skia:

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

8 years agoAdd a warmup flag to visualbench
cdalton [Thu, 10 Dec 2015 22:20:06 +0000 (14:20 -0800)]
Add a warmup flag to visualbench

Adds a flag to control whether we use a warmup bench.

BUG=skia:

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

8 years agoFix UB function problems for AA merger.
herb [Thu, 10 Dec 2015 22:17:41 +0000 (14:17 -0800)]
Fix UB function problems for AA merger.

BUG=skia:4634

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

8 years agoFix 'debugging on Android' android_gdb_app script.
aam [Thu, 10 Dec 2015 22:14:56 +0000 (14:14 -0800)]
Fix 'debugging on Android' android_gdb_app script.

1) com.skia -> com.skia.sample_app
2) pass arguments to android_gdb_app to android_setup.sh so you can build gdbserver binaries for your actual device(rather than default arm64). This allows you to run it like this for example:

  ./platform_tools/android/bin/android_gdb_app -d nexus_6

BUG=skia:
DOCS_PREVIEW= https://skia.org/?cl=1509853006

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

8 years agoChange SkTaskGroup to use std::function. Ripple all the changes.
herb [Thu, 10 Dec 2015 22:12:33 +0000 (14:12 -0800)]
Change SkTaskGroup to use std::function. Ripple all the changes.

BUG=skia:4634

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

8 years agoUse size_t for strlen() return value
scroggo [Thu, 10 Dec 2015 21:46:04 +0000 (13:46 -0800)]
Use size_t for strlen() return value

BUG=skia:2810

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

8 years agotry adding flag to allow lcd text even in a layer
reed [Thu, 10 Dec 2015 21:44:45 +0000 (13:44 -0800)]
try adding flag to allow lcd text even in a layer

BUG=skia:

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

8 years agoUse DEF_GM everywhere
scroggo [Thu, 10 Dec 2015 21:31:59 +0000 (13:31 -0800)]
Use DEF_GM everywhere

BUG=skia:1902

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

8 years agoAddress precision issue in circle blur effect
robertphillips [Thu, 10 Dec 2015 21:29:14 +0000 (13:29 -0800)]
Address precision issue in circle blur effect

BUG=560651

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

8 years agoCreate GrTextUtils
joshualitt [Thu, 10 Dec 2015 21:20:58 +0000 (13:20 -0800)]
Create GrTextUtils

BUG=skia:

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

8 years agoAdd reallyHasAlpha() to SkAndroidCodec
msarett [Thu, 10 Dec 2015 21:09:24 +0000 (13:09 -0800)]
Add reallyHasAlpha() to SkAndroidCodec

This also modified the default implementation
of onReallyHasAlpha() in SkCodec.

BUG=skia:

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

8 years agoDM: fix `--config $VIA-pdf` to not crash
halcanary [Thu, 10 Dec 2015 20:46:42 +0000 (12:46 -0800)]
DM: fix `--config $VIA-pdf` to not crash

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

8 years agodefault SkPixelSerializer
halcanary [Thu, 10 Dec 2015 20:40:23 +0000 (12:40 -0800)]
default SkPixelSerializer

Add SkImageEncoder::EncodeData(const SkPixmap&, ...) function.

Add SkImageEncoder::CreatePixelSerializer() to return a
PixelSerializer that calls into SkImageEncoder::EncodeData.

SkImage::encode() make use of SkImageEncoder::CreatePixelSerializer.

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

Committed: https://skia.googlesource.com/skia/+/808ce2886d732b1055f89c8fb0f1b11b47fcb0ce

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

8 years agoAdd buildbot spec for Android One bots
borenet [Thu, 10 Dec 2015 20:09:14 +0000 (12:09 -0800)]
Add buildbot spec for Android One bots

BUG=skia:

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

8 years agoSkBlurImageFilter returns input when sigma = 0
xidachen [Thu, 10 Dec 2015 20:08:44 +0000 (12:08 -0800)]
SkBlurImageFilter returns input when sigma = 0

In the current implementation, a blur filter is always created even in the
case when sigma.fX == 0 && sigma.fY == 0. This CL makes the blur filter
return input in this case.

BUG=568393

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

8 years agoRemove unused CallStacker
scroggo [Thu, 10 Dec 2015 19:28:01 +0000 (11:28 -0800)]
Remove unused CallStacker

Found this while looking for uses of strlen (skbug.com/2810). This code
was written by a former member of the team and is not used.

BUG=skia:2810

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

8 years agoMove flush logic into GrAtlasTextBlob
joshualitt [Thu, 10 Dec 2015 19:22:08 +0000 (11:22 -0800)]
Move flush logic into GrAtlasTextBlob

TBR=bsalomon@google.com
BUG=skia:

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

8 years agoSwitch SkAutoMalloc to SkAutoTMalloc to avoid cast
scroggo [Thu, 10 Dec 2015 18:44:13 +0000 (10:44 -0800)]
Switch SkAutoMalloc to SkAutoTMalloc to avoid cast

Make SkAutoTMalloc's interface look more like SkAutoMalloc:
- add free(), which does what you expect
- make reset() return a pointer fPtr

No public API changes (SkAutoTMalloc is in include/private)

BUG=skia:2148

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

8 years agoSkPixelSerializer: remove deprecated virtual
halcanary [Thu, 10 Dec 2015 17:30:57 +0000 (09:30 -0800)]
SkPixelSerializer: remove deprecated virtual

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

8 years agoMove DistanceAdjustTable to its own file
joshualitt [Thu, 10 Dec 2015 17:10:10 +0000 (09:10 -0800)]
Move DistanceAdjustTable to its own file

BUG=skia:

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

8 years agoAdd Apple renderer strings to PowerVR detection
jvanverth [Thu, 10 Dec 2015 17:06:24 +0000 (09:06 -0800)]
Add Apple renderer strings to PowerVR detection

BUG=skia:4148

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

8 years agoSkDocument::setDCTEncoder() for old versions of webkit
halcanary [Thu, 10 Dec 2015 16:59:43 +0000 (08:59 -0800)]
SkDocument::setDCTEncoder() for old versions of webkit

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

8 years agoMove appending of large glyphs into GrAtlasTextBlob
joshualitt [Thu, 10 Dec 2015 16:54:41 +0000 (08:54 -0800)]
Move appending of large glyphs into GrAtlasTextBlob

BUG=skia:

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

8 years agoSilence another PNG print statement
scroggo [Thu, 10 Dec 2015 16:54:36 +0000 (08:54 -0800)]
Silence another PNG print statement

It can still be turned on by using setting
c_suppressPNGImageDecoderWarnings to true.

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

8 years agotry again on md formatting
caryclark [Thu, 10 Dec 2015 16:03:58 +0000 (08:03 -0800)]
try again on md formatting

TBR=hcm@google.com
NOTRY=true
DOCS_PREVIEW= https://skia.org/?cl=1520533002

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

8 years agoexperiment/fiddle
halcanary [Thu, 10 Dec 2015 15:52:45 +0000 (07:52 -0800)]
experiment/fiddle

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

8 years agoMove 'mustRegenerate' function into GrAtlasTextBlob
joshualitt [Thu, 10 Dec 2015 15:44:50 +0000 (07:44 -0800)]
Move 'mustRegenerate' function into GrAtlasTextBlob

BUG=skia:

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

8 years agoanother null src, memcpy -> sk_careful_memcpy
mtklein [Thu, 10 Dec 2015 15:42:47 +0000 (07:42 -0800)]
another null src, memcpy -> sk_careful_memcpy

https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-ASAN/builds/3798/steps/dm/logs/stdio

BUG=skia:

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

8 years agoRemove uniform color for GrDistanceFieldGeoProc
joshualitt [Thu, 10 Dec 2015 15:29:54 +0000 (07:29 -0800)]
Remove uniform color for GrDistanceFieldGeoProc

BUG=skia:

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

8 years agoadd path ops presentations to skia.org
caryclark [Thu, 10 Dec 2015 14:29:44 +0000 (06:29 -0800)]
add path ops presentations to skia.org

TBR=hcm@google.com
NOTRY=true
DOCS_PREVIEW= https://skia.org/?cl=1518453003

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

8 years agoMake NVPR a GL context option instead of a GL context
kkinnunen [Thu, 10 Dec 2015 14:28:13 +0000 (06:28 -0800)]
Make NVPR a GL context option instead of a GL context

Make NVPR a GL context option instead of a GL context.
This may enable NVPR to be run with command buffer
interface.

No functionality change in DM or nanobench. NVPR can
only be run with normal GL APIs.

BUG=skia:2992

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

Committed: https://skia.googlesource.com/skia/+/64492c43c3faee7ab0f69b1c84e0267616f85e52

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

8 years agoUse a pseudo-extension CHROMIUM_framebuffer_mixed_samples
kkinnunen [Thu, 10 Dec 2015 09:21:59 +0000 (01:21 -0800)]
Use a pseudo-extension CHROMIUM_framebuffer_mixed_samples

Use the pseudo-extension CHROMIUM_framebuffer_mixed_samples when
run with Chromium command buffer. The extension exposes
NV_framebuffer_mixed_samples subset that Skia needs in order to
use NV_path_rendering with mixed samples.

BUG=506765

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

8 years agoPopulate NVPR functions when run with command buffer
kkinnunen [Thu, 10 Dec 2015 06:58:34 +0000 (22:58 -0800)]
Populate NVPR functions when run with command buffer

Populate the NV_path_rendering functions provided by
CHROMIUM_path_rendering when the tools are being run with
command buffer API.

BUG=skia:2992

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

8 years agoDo elliptical clips in normalized space on devices with a "real" mediump
bsalomon [Thu, 10 Dec 2015 01:14:40 +0000 (17:14 -0800)]
Do elliptical clips in normalized space on devices with a "real" mediump

BUG=chromium:477684

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

8 years agoMake "alpha only" be a property of GrTextureProducer
bsalomon [Thu, 10 Dec 2015 01:06:02 +0000 (17:06 -0800)]
Make "alpha only" be a property of GrTextureProducer

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

8 years agoUse BRGA as internal format on later iOS
jvanverth [Thu, 10 Dec 2015 00:54:35 +0000 (16:54 -0800)]
Use BRGA as internal format on later iOS

BUG=skia:2733

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

8 years agoanother memcpy -> sk_careful_memcpy
mtklein [Thu, 10 Dec 2015 00:20:25 +0000 (16:20 -0800)]
another memcpy -> sk_careful_memcpy

https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-ASAN/builds/3791/steps/dm/logs/stdio

This is getting tedious.

TBR=herb@google.com,reed@google.com
No API changes.

BUG=skia:

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

8 years agoadd support for capped hairlines
caryclark [Wed, 9 Dec 2015 22:04:46 +0000 (14:04 -0800)]
add support for  capped hairlines

Extend the ends of hairline and haircurve segments when the paint is set to square or round, and the line or curve is at the start or end of a contour.

R=reed@google.com
BUG=skia:4599

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

8 years agoSilence libjpeg warnings in SkImageDecoder
scroggo [Wed, 9 Dec 2015 21:40:34 +0000 (13:40 -0800)]
Silence libjpeg warnings in SkImageDecoder

We just did the same for libpng (see crrev.com/1512043002), so we
might as well do this here.

SkImageDecoder is deprecated, and SkCodec already has a way to turn
off its messages.

BUG=skia:1649

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

8 years agoAnother undefined shift caught by -fsanitize=shift.
mtklein [Wed, 9 Dec 2015 21:32:58 +0000 (13:32 -0800)]
Another undefined shift caught by -fsanitize=shift.

left was -16

I didn't see any warning about fTop, but seems simplest to fix that too.

BUG=skia:

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

8 years agoAnother memcpy -> sk_careful_memcpy
mtklein [Wed, 9 Dec 2015 21:15:07 +0000 (13:15 -0800)]
Another memcpy -> sk_careful_memcpy

https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-ASAN/builds/3787/steps/dm/logs/stdio

dst is null.
TBR=herb@google.com

BUG=skia:

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

8 years agono need for newlines in DM Errors
mtklein [Wed, 9 Dec 2015 21:02:26 +0000 (13:02 -0800)]
no need for newlines in DM Errors

This should fix some odd formatting problems in the logs, e.g.

    Note tally:
    583x   (skipped: Cannot convert to requested color type.
    )
    4x     (--blacklist _ image decode 4bpp-pixeldata-cropped.bmp)

~~~>

    Note tally:
    583x   (skipped: Cannot convert to requested color type.)
    4x     (--blacklist _ image decode 4bpp-pixeldata-cropped.bmp)

BUG=skia:

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

8 years agoFix compile error with GOOGLE3 define.
benjaminwagner [Wed, 9 Dec 2015 20:51:20 +0000 (12:51 -0800)]
Fix compile error with GOOGLE3 define.

BUG=skia:

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

8 years agoRewrite drawBitmap/ImageNine on top of GrTextureProducer
bsalomon [Wed, 9 Dec 2015 20:50:56 +0000 (12:50 -0800)]
Rewrite drawBitmap/ImageNine on top of GrTextureProducer

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

8 years agoMake skia_sanitizer work on Macs too.
mtklein [Wed, 9 Dec 2015 20:39:01 +0000 (12:39 -0800)]
Make skia_sanitizer work on Macs too.

This is of course limited by what the compiler suppports.
-fsanitize=address seems to work OK.

BUG=skia:

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

8 years agoRemove no-op code in SkAlphaRuns::add
scroggo [Wed, 9 Dec 2015 20:33:21 +0000 (12:33 -0800)]
Remove no-op code in SkAlphaRuns::add

The old code says

        runs += x + 1;
        alpha += x + 1;
        x = 0;
        lastAlpha += x; // we don't want the +1

The last line does nothing. Remove this unnecessary line.

BUG=skia:401

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

8 years agoFix problem with flag unknown to clang. This negates an earlier -Werror causing warni...
herb [Wed, 9 Dec 2015 20:27:31 +0000 (12:27 -0800)]
Fix problem with flag unknown to clang. This negates an earlier -Werror causing warnings to be errors.

BUG=skia:

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

8 years agoSilence libpng warnings in SkImageDecoder
msarett [Wed, 9 Dec 2015 20:12:56 +0000 (12:12 -0800)]
Silence libpng warnings in SkImageDecoder

BUG=skia:

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

8 years agoubsan shift fixes
caryclark [Wed, 9 Dec 2015 20:02:30 +0000 (12:02 -0800)]
ubsan shift fixes

Use an inline function that does a normal shift. When built for the sanitizer, add casts so that the shift is unsigned.

Also make a few fixes to do unsigned shifts or avoid the shift altogether; and add an argument spec to some macros.

R=reed@google.com,mtklein@google.com
BUG=skia:4633

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

8 years agoSkBitmap::installPixels(const SkPixmap&);
halcanary [Wed, 9 Dec 2015 19:36:59 +0000 (11:36 -0800)]
SkBitmap::installPixels(const SkPixmap&);

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

8 years agoPrevent overflow in length() in GLCircularRRectEffect
bsalomon [Wed, 9 Dec 2015 18:33:51 +0000 (10:33 -0800)]
Prevent overflow in length() in GLCircularRRectEffect

BUG=chromium:477684

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

8 years agoSkBitmap::getColor repsects swizzle
halcanary [Wed, 9 Dec 2015 18:21:59 +0000 (10:21 -0800)]
SkBitmap::getColor repsects swizzle

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

8 years agoSplit big rrect aa effect up into separate images
bsalomon [Wed, 9 Dec 2015 18:17:35 +0000 (10:17 -0800)]
Split big rrect aa effect up into separate images

Needed to enlarge radii to surface bugs without exceeding max texture size on low end devices.

BUG=chromium:477684

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

8 years agoFix filter primitive bounds computations.
senorblanco [Wed, 9 Dec 2015 18:11:43 +0000 (10:11 -0800)]
Fix filter primitive bounds computations.

Make each filter responsible for expanding its destination
bounds. Previously, we were using a union of all
intermediate bounds sizes via join() calls in many image
filters' computeFastBounds(), due to the fact that those
filters could only produce bitmaps the same size as their
inputs. Now, we compute optimal bounds for each filter as
follows:

1) Pass the (unmodified) clip bounds to the root node
of the DAG in the first recursive call to onFilterImage()
as the Context's fClipBounds.

2) Reverse-map the clip: when recursing up the DAG in
filterInput[GPU](), apply filter-specific expansion to the
clip by calling calling onFilterNodeBounds(... kReverse).
This allows upstream nodes to have a clip that respects the
current node's requirements. This is done via helper
function mapContext().

3) Forward-map the source bitmap: just prior to applying
the crop rect in applyCropRect(), we determine the filter's
preferred bounds by mapping the source bitmap bounds
forwards via onFilterNodeBounds(..., kForward).

NOTE: GMs affected by this change:
fast_slow_blurimagefilter: fast and slow paths now produce the same result
spritebitmap: drawSprite() and drawBitmap() paths now produce the same result
filterfastbounds: fast bounds are optimized; all drop-shadow results now appear
apply-filter: snug and not-snug cases give same results
dropshadowimagefilter: drawSprite() results now show shadows
draw-with-filter: no artifacts on erode edges; blur edges no longer clipped
displacement, imagefiltersbase, imagefiltersclipped, imagefilterscropexpand, imagefiltersscaled, matriximagefilter,
resizeimagefilter, localmatriximagefilter, testimagefilters: fixed incorrect clipping
imagefilterstransformed, morphology: no artifacts on erode edges

BUG=skia:1062,skia:3194,skia:3939,skia:4337,skia:4526

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

8 years agofix a couple flaky nonnull attribute ubsan warnings
mtklein [Wed, 9 Dec 2015 18:02:14 +0000 (10:02 -0800)]
fix a couple flaky nonnull attribute ubsan warnings

Errors this should fix:
  https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-ASAN/builds/3779/steps/dm/logs/stdio
  https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-ASAN/builds/3779/steps/nanobench/logs/stdio

CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-ASAN-Trybot

TBR=reed@google.com
No API changes.

BUG=skia:

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

8 years agoFix bug with GrAtlasTextContext color regen
joshualitt [Wed, 9 Dec 2015 17:26:44 +0000 (09:26 -0800)]
Fix bug with GrAtlasTextContext color regen

BUG=skia:

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

8 years agoDM: tally notes at the end rather than showing them as they finish.
mtklein [Wed, 9 Dec 2015 16:37:35 +0000 (08:37 -0800)]
DM: tally notes at the end rather than showing them as they finish.

This should make the (veto) and (skipped: ) both less verbose and easier to grok.

Looks like this'll bring the log files down from ~50M to ~1.5M.

BUG=skia:

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

8 years agoBoost GrGLConicEffect's variables to all high precision
robertphillips [Wed, 9 Dec 2015 15:54:24 +0000 (07:54 -0800)]
Boost GrGLConicEffect's variables to all high precision

BUG=555779

Committed: https://skia.googlesource.com/skia/+/624c59a1c7af38eb83e803f345a6f3e225475a08

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

8 years agotry stifling integer overflow error
mtklein [Wed, 9 Dec 2015 15:24:10 +0000 (07:24 -0800)]
try stifling integer overflow error

first time we've done this, let's see if it works!

BUG=skia:4667

Looks ok now.  Red ASAN bot is different errors.

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

8 years agoCap filtering to kMedium_SkFilterQuality when downsampling
fmalita [Wed, 9 Dec 2015 15:18:16 +0000 (07:18 -0800)]
Cap filtering to kMedium_SkFilterQuality when downsampling

R=reed@google.com

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