platform/upstream/libSkiaSharp.git
8 years agoAdd ability to default incoming image data as sRGB by default.
herb [Fri, 15 Apr 2016 19:57:42 +0000 (12:57 -0700)]
Add ability to default incoming image data as sRGB by default.

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

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

8 years agoSwitch SkXfermodeImagerFilter over to new onFilterImage interface
robertphillips [Fri, 15 Apr 2016 19:47:42 +0000 (12:47 -0700)]
Switch SkXfermodeImagerFilter over to new onFilterImage interface

TBR=reed@google.com

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

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

8 years agoRevert of SkPDF: PDF/A runtime switch (patchset #1 id:100001 of https://codereview...
halcanary [Fri, 15 Apr 2016 19:30:21 +0000 (12:30 -0700)]
Revert of SkPDF: PDF/A runtime switch (patchset #1 id:100001 of https://codereview.chromium.org/1891873002/ )

Reason for revert:
breaking something.

Original issue's description:
> SkPDF: PDF/A runtime switch
>
> TODO: remove gyp variable and modify API  in SkDocument.h
>
> BUG=skia:3110
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1891873002
>
> Committed: https://skia.googlesource.com/skia/+/570f18b43417d73c3fbd113cc0b4258e08b14c82

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

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

8 years agoSkPDF: PDF/A runtime switch
halcanary [Fri, 15 Apr 2016 18:59:31 +0000 (11:59 -0700)]
SkPDF: PDF/A runtime switch

TODO: remove gyp variable and modify API  in SkDocument.h

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

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

8 years agoFix skiaserve crash when displaying batch bounds
brianosman [Fri, 15 Apr 2016 18:00:51 +0000 (11:00 -0700)]
Fix skiaserve crash when displaying batch bounds

In my test case, the first actual batch would combine with the clear
issued before auditing had been enabled. After the successful combine,
we would try to inform the audit manager, but it didn't know about the
batch, triggering an assert (and subsequent crash). Fix is ijust to
ensure that no prior batches are pending when we turn on auditing.

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

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

8 years agoexernalize imagefactory guard
reed [Fri, 15 Apr 2016 17:56:51 +0000 (10:56 -0700)]
exernalize imagefactory guard

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

TBR=
CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac-Clang-x86_64-Release-CMake-Trybot

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

8 years agoWIP: runtime switch for how to interpret SkColor -vs- srgb
reed [Fri, 15 Apr 2016 17:48:01 +0000 (10:48 -0700)]
WIP: runtime switch for how to interpret SkColor -vs- srgb

Still very conflicted about the "right" way to proceed with this, but thought I'd experiment with a runtime flag, so we can practice seeing SKPs in various stages of "srgb correctness".

Other aspects to either fix, or at least provide runtime switches for:

- untagged images
- gradients
- colorshader
- drawVertices

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

TBR=

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

8 years agomove static arrays into impl, to avoid multiple copies
reed [Fri, 15 Apr 2016 17:03:03 +0000 (10:03 -0700)]
move static arrays into impl, to avoid multiple copies

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

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

8 years agoMove SkImageFilter over to storing sk_sps
robertphillips [Fri, 15 Apr 2016 16:58:37 +0000 (09:58 -0700)]
Move SkImageFilter over to storing sk_sps

This CL also removes the old bare-pointer style ctor.

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

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

8 years agoRevert of Move CPU feature detection to its own file. (patchset #7 id:120001 of https...
mtklein [Fri, 15 Apr 2016 15:40:22 +0000 (08:40 -0700)]
Revert of Move CPU feature detection to its own file. (patchset #7 id:120001 of https://codereview.chromium.org/1890483002/ )

Reason for revert:
many unexpected GM diffs across GPU+CPU configs on Windows (hopefully just text masks on GPU?).   seems like we pick a different srcover variant in some places.

Original issue's description:
> Move CPU feature detection to its own file.
>
>    - Moves CPU feature detection to its own file.
>    - Cleans up some redundant feature detection scattered around core/ and opts/.
>    - Can now detect a few new CPU features:
>        * F16C     -> Intel f16<->f32 instructions, added between AVX and AVX2
>        * FMA      -> Intel FMA instructions, added at the same time as AVX2
>        * VFP_FP16 -> ARM f16<->f32 instructions, quite common
>        * NEON_FMA -> ARM FMA instructions, also quite common
>        * SSE and SSE3... why not?
>
> This new internal API makes it very cheap to do fine-grained runtime CPU
> feature detection.  Redundant calls to SkCpu::Supports() should be eliminated
> and it's hoistable out of loops.  It compiles away entirely when we have the
> appropriate instructions available at compile time.
>
> This means we can call it to guard even a little snippet of 1 or 2 instructions
> right where needed and let inlining hoist the check (if any at all) up to
> somewhere that doesn't hurt performance.  I've explained how I made this work
> in the private section of the new header.
>
> Once this lands and bakes a bit, I'll start following up with CLs to use it more
> and to add a bunch of those little 1-2 instruction snippets we've been wanting,
> e.g. cvtps2ph, cvtph2ps, ptest, pmulld, pmovzxbd, blendvps, pshufb, roundps
> (for floor) on x86, and vcvt.f32.f16, vcvt.f16.f32 on ARM.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1890483002
> CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot
>
> Committed: https://skia.googlesource.com/skia/+/872ea29357439f05b1f6995dd300fc054733e607

TBR=fmalita@chromium.org,herb@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:

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

8 years agoRevert of skcpu: sse4.1 floor, f16c f16<->f32 (patchset #11 id:200001 of https:/...
mtklein [Fri, 15 Apr 2016 15:37:22 +0000 (08:37 -0700)]
Revert of skcpu: sse4.1 floor, f16c f16<->f32 (patchset #11 id:200001 of https://codereview.chromium.org/1891513002/ )

Reason for revert:
this depends on a CL I want to revert

Original issue's description:
> skcpu: sse4.1 floor, f16c f16<->f32
>
>   -  floor with roundps is about 4.5x faster when available
>   -  f16 srcover_n is similar to but a little faster than the version in https://codereview.chromium.org/1884683002.  This new one fuses the dst load/stores into the f16<->f32 conversions:
>
> +0x180     movups              (%r15), %xmm1
> +0x184     vcvtph2ps           (%rbx), %xmm2
> +0x189     movaps              %xmm1, %xmm3
> +0x18c     shufps              $255, %xmm3, %xmm3
> +0x190     movaps              %xmm0, %xmm4
> +0x193     subps               %xmm3, %xmm4
> +0x196     mulps               %xmm2, %xmm4
> +0x199     addps               %xmm1, %xmm4
> +0x19c     vcvtps2ph           $0, %xmm4, (%rbx)
> +0x1a2     addq                $16, %r15
> +0x1a6     addq                $8, %rbx
> +0x1aa     decl                %r14d
> +0x1ad     jne                 +0x180
>
> If we decide to land this it'd be a good idea to convert most or all users of SkFloatToHalf_01 and SkHalfToFloat_01 over to the pointer-based versions.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1891513002
> CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot
>
> Committed: https://skia.googlesource.com/skia/+/cbe3c1af987d622ea67ef560d855b41bb14a0ce9
>
> Committed: https://skia.googlesource.com/skia/+/3faf74b8364491ca806f523fbb1d8a97be592663

TBR=fmalita@chromium.org,herb@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:

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

8 years agoAdd option to specify font fallback when creating the skia font manager
kulshin [Fri, 15 Apr 2016 15:20:46 +0000 (08:20 -0700)]
Add option to specify font fallback when creating the skia font manager

This originally existed as https://codereview.chromium.org/1740533003/,
but then got reverted for causing perf problems at startup. This change
avoids that by allowing callers to specify their own font fallback, and
only uses the system fallback if a fallback is needed and none was
provided.

This is part 1 of a three part change.
1: https://codereview.chromium.org/1878843002/
   Adds support for specifying a font fallback in skia
2: https://codereview.chromium.org/1846433005/
   Implements the fallback proxy in Chromium
3: https://codereview.chromium.org/1883483002/
   Adds code to blink to call skia's fallback API

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

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

8 years agoFix ANGLE in SampleApp
brianosman [Fri, 15 Apr 2016 15:13:57 +0000 (08:13 -0700)]
Fix ANGLE in SampleApp

Typo in DLL name meant that we were never running with ANGLE.

Fixing that exposed problem with attachANGLE -> we weren't filling out
attachment info after the first call, resulting in invalid surface
descriptions on windowSizeChanged events.

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

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

8 years agoRemove asFragmentProcessor gpu-specific ImageFilter code path
robertphillips [Fri, 15 Apr 2016 15:07:27 +0000 (08:07 -0700)]
Remove asFragmentProcessor gpu-specific ImageFilter code path

No image filter should be using this code path now.

TBR=reed@google.com

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

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

8 years agoUpdate TileImageFilter to sk_sp
robertphillips [Fri, 15 Apr 2016 14:57:40 +0000 (07:57 -0700)]
Update TileImageFilter to sk_sp

TBR=reed@google.com

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

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

8 years agoUpdate DisplacementMapEffect to sk_sp
robertphillips [Fri, 15 Apr 2016 14:17:36 +0000 (07:17 -0700)]
Update DisplacementMapEffect to sk_sp

TBR=reed@google.com

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

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

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

8 years agospriteblitter for memcpy case (for all configs)
reed [Fri, 15 Apr 2016 13:59:38 +0000 (06:59 -0700)]
spriteblitter for memcpy case (for all configs)

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

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

8 years agoskcpu: sse4.1 floor, f16c f16<->f32
mtklein [Fri, 15 Apr 2016 13:18:37 +0000 (06:18 -0700)]
skcpu: sse4.1 floor, f16c f16<->f32

  -  floor with roundps is about 4.5x faster when available
  -  f16 srcover_n is similar to but a little faster than the version in https://codereview.chromium.org/1884683002.  This new one fuses the dst load/stores into the f16<->f32 conversions:

+0x180     movups              (%r15), %xmm1
+0x184     vcvtph2ps           (%rbx), %xmm2
+0x189     movaps              %xmm1, %xmm3
+0x18c     shufps              $255, %xmm3, %xmm3
+0x190     movaps              %xmm0, %xmm4
+0x193     subps               %xmm3, %xmm4
+0x196     mulps               %xmm2, %xmm4
+0x199     addps               %xmm1, %xmm4
+0x19c     vcvtps2ph           $0, %xmm4, (%rbx)
+0x1a2     addq                $16, %r15
+0x1a6     addq                $8, %rbx
+0x1aa     decl                %r14d
+0x1ad     jne                 +0x180

If we decide to land this it'd be a good idea to convert most or all users of SkFloatToHalf_01 and SkHalfToFloat_01 over to the pointer-based versions.

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

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

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

8 years agoRevert of Update DisplacementMapEffect to sk_sp (patchset #3 id:40001 of https:/...
robertphillips [Fri, 15 Apr 2016 12:09:32 +0000 (05:09 -0700)]
Revert of Update DisplacementMapEffect to sk_sp (patchset #3 id:40001 of https://codereview.chromium.org/1877783003/ )

Reason for revert:
unexpected image diffs in imagefilterscropexpand GM

Original issue's description:
> Update DisplacementMapEffect to sk_sp
>
> TBR=reed@google.com
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1877783003
>
> Committed: https://skia.googlesource.com/skia/+/a53011ef44705a091a8e24f7ea289a3f9ad759f2

TBR=fmalita@chromium.org,reed@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/1884253004

8 years agoSwitch SkLightingImageFilter over to new onFilterImage interface
robertphillips [Fri, 15 Apr 2016 12:06:11 +0000 (05:06 -0700)]
Switch SkLightingImageFilter over to new onFilterImage interface

TBR=reed@google.com

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

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

8 years agoUpdate DisplacementMapEffect to sk_sp
robertphillips [Fri, 15 Apr 2016 11:37:07 +0000 (04:37 -0700)]
Update DisplacementMapEffect to sk_sp

TBR=reed@google.com

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

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

8 years agoRevert of skcpu: sse4.1 floor, f16c f16<->f32 (patchset #10 id:180001 of https:/...
mtklein [Thu, 14 Apr 2016 23:23:15 +0000 (16:23 -0700)]
Revert of skcpu: sse4.1 floor, f16c f16<->f32 (patchset #10 id:180001 of https://codereview.chromium.org/1891513002/ )

Reason for revert:
Need to change around my #if guards so that clang-cl is treated like GCC and Clang, rather than MSVC.

Original issue's description:
> skcpu: sse4.1 floor, f16c f16<->f32
>
>   -  floor with roundps is about 4.5x faster when available
>   -  f16 srcover_n is similar to but a little faster than the version in https://codereview.chromium.org/1884683002.  This new one fuses the dst load/stores into the f16<->f32 conversions:
>
> +0x180     movups              (%r15), %xmm1
> +0x184     vcvtph2ps           (%rbx), %xmm2
> +0x189     movaps              %xmm1, %xmm3
> +0x18c     shufps              $255, %xmm3, %xmm3
> +0x190     movaps              %xmm0, %xmm4
> +0x193     subps               %xmm3, %xmm4
> +0x196     mulps               %xmm2, %xmm4
> +0x199     addps               %xmm1, %xmm4
> +0x19c     vcvtps2ph           $0, %xmm4, (%rbx)
> +0x1a2     addq                $16, %r15
> +0x1a6     addq                $8, %rbx
> +0x1aa     decl                %r14d
> +0x1ad     jne                 +0x180
>
> If we decide to land this it'd be a good idea to convert most or all users of SkFloatToHalf_01 and SkHalfToFloat_01 over to the pointer-based versions.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1891513002
> CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot
>
> Committed: https://skia.googlesource.com/skia/+/cbe3c1af987d622ea67ef560d855b41bb14a0ce9

TBR=fmalita@chromium.org,herb@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:

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

8 years agoRevert of Fixes for SkRWBuffer (patchset #5 id:80001 of https://codereview.chromium...
bungeman [Thu, 14 Apr 2016 21:57:01 +0000 (14:57 -0700)]
Revert of Fixes for SkRWBuffer (patchset #5 id:80001 of https://codereview.chromium.org/1871953002/ )

Reason for revert:
Making MSAN and TSAN rather unhappy.

https://build.chromium.org/p/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-MSAN/builds/1586

https://build.chromium.org/p/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-TSAN/builds/5922

Original issue's description:
> Fixes for SkRWBuffer
>
> Do not call SkBufferHead::validate in SkROBuffer's destructor, which
> may be called in a separate thread from SkRWBuffer::append. validate()
> reads SkBufferBlock::fUsed, and append() writes to it, resulting in
> a data race.
>
> Update some comments to be more clear about how it is safe to use
> these classes across threads.
>
> Test the readers in separate threads.
>
> In addition, make sure it is safe to create a reader even when no
> data has been appended. Add tests for this case.
>
> Mark a parameter to SkBufferHead::validate() as const, reflecting
> its use.
>
> BUG=chromium:601578
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1871953002
>
> Committed: https://skia.googlesource.com/skia/+/d06920a29fe11c68bde2b93948ec99f277bb8459

TBR=mtklein@google.com,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=chromium:601578

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

8 years agoGraduate matrix map-point procs out of SkOpts.
mtklein [Thu, 14 Apr 2016 21:07:02 +0000 (14:07 -0700)]
Graduate matrix map-point procs out of SkOpts.

These are implemented generically with Sk4s and don't benefit
from anything fancier than vanilla SSE/NEON.

This means there's no need to hide this code away in another
file or behind a function pointer... it's readable and we have
compile-time support for all the instructions it needs.

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

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

8 years agoMake sure the color profile propagetes through the system.
herb [Thu, 14 Apr 2016 20:58:05 +0000 (13:58 -0700)]
Make sure the color profile propagetes through the system.

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

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

8 years agoadd index in getPixels for F16
reed [Thu, 14 Apr 2016 20:34:45 +0000 (13:34 -0700)]
add index in getPixels for F16

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

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

8 years agoSeveral fixes for fp 16 rendering:
brianosman [Thu, 14 Apr 2016 19:39:00 +0000 (12:39 -0700)]
Several fixes for fp 16 rendering:

With the GPU backend, allow F16 render targets to be created (along with
any other renderable format). We were previously just falling back to 8888.

In SampleApp, if the window configuration is F16, don't render directly
to the primary surface (which is actually sRGB 8888). Intead, make an
off-screen F16 surface, then blit it back to the framebuffer when we're done.

In DM, clamp values outside of [0,1]. These were wrapping, producing very
incorrect images. (Many filters can trigger out-of-range values due to
ringing).

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

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

8 years agoskcpu: sse4.1 floor, f16c f16<->f32
mtklein [Thu, 14 Apr 2016 19:27:38 +0000 (12:27 -0700)]
skcpu: sse4.1 floor, f16c f16<->f32

  -  floor with roundps is about 4.5x faster when available
  -  f16 srcover_n is similar to but a little faster than the version in https://codereview.chromium.org/1884683002.  This new one fuses the dst load/stores into the f16<->f32 conversions:

+0x180     movups              (%r15), %xmm1
+0x184     vcvtph2ps           (%rbx), %xmm2
+0x189     movaps              %xmm1, %xmm3
+0x18c     shufps              $255, %xmm3, %xmm3
+0x190     movaps              %xmm0, %xmm4
+0x193     subps               %xmm3, %xmm4
+0x196     mulps               %xmm2, %xmm4
+0x199     addps               %xmm1, %xmm4
+0x19c     vcvtps2ph           $0, %xmm4, (%rbx)
+0x1a2     addq                $16, %r15
+0x1a6     addq                $8, %rbx
+0x1aa     decl                %r14d
+0x1ad     jne                 +0x180

If we decide to land this it'd be a good idea to convert most or all users of SkFloatToHalf_01 and SkHalfToFloat_01 over to the pointer-based versions.

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

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

8 years agoFixes for SkRWBuffer
scroggo [Thu, 14 Apr 2016 18:40:48 +0000 (11:40 -0700)]
Fixes for SkRWBuffer

Do not call SkBufferHead::validate in SkROBuffer's destructor, which
may be called in a separate thread from SkRWBuffer::append. validate()
reads SkBufferBlock::fUsed, and append() writes to it, resulting in
a data race.

Update some comments to be more clear about how it is safe to use
these classes across threads.

Test the readers in separate threads.

In addition, make sure it is safe to create a reader even when no
data has been appended. Add tests for this case.

Mark a parameter to SkBufferHead::validate() as const, reflecting
its use.

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

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

8 years agoAdd F16 source to the linear pipelin.
herb [Thu, 14 Apr 2016 18:16:44 +0000 (11:16 -0700)]
Add F16 source to the linear pipelin.

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

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

8 years agoExplain Rietveld patching better on site.
bungeman [Thu, 14 Apr 2016 17:25:01 +0000 (10:25 -0700)]
Explain Rietveld patching better on site.

State which values should be updated and how to determine them.

NOTRY=true
DOCS_PREVIEW= https://skia.org/?cl=1883213002

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

8 years agoPut SkEmptyTypeface in anonymous namespace.
bungeman [Thu, 14 Apr 2016 16:44:34 +0000 (09:44 -0700)]
Put SkEmptyTypeface in anonymous namespace.

We ended up with two SkEmptyTypefaces it differnt places. Avoid this odr
violation by sticking these in anonymous namespaces.

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

8 years agomojo -> nojo
mtklein [Thu, 14 Apr 2016 16:42:34 +0000 (09:42 -0700)]
mojo -> nojo

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

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

8 years agoAdd doc instructions for multi-repo Chromium trybots.
bungeman [Thu, 14 Apr 2016 16:23:41 +0000 (09:23 -0700)]
Add doc instructions for multi-repo Chromium trybots.

NOTRY=true
DOCS_PREVIEW= https://skia.org/?cl=1865153003

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

8 years agoMove CPU feature detection to its own file.
mtklein [Thu, 14 Apr 2016 16:03:35 +0000 (09:03 -0700)]
Move CPU feature detection to its own file.

   - Moves CPU feature detection to its own file.
   - Cleans up some redundant feature detection scattered around core/ and opts/.
   - Can now detect a few new CPU features:
       * F16C     -> Intel f16<->f32 instructions, added between AVX and AVX2
       * FMA      -> Intel FMA instructions, added at the same time as AVX2
       * VFP_FP16 -> ARM f16<->f32 instructions, quite common
       * NEON_FMA -> ARM FMA instructions, also quite common
       * SSE and SSE3... why not?

This new internal API makes it very cheap to do fine-grained runtime CPU
feature detection.  Redundant calls to SkCpu::Supports() should be eliminated
and it's hoistable out of loops.  It compiles away entirely when we have the
appropriate instructions available at compile time.

This means we can call it to guard even a little snippet of 1 or 2 instructions
right where needed and let inlining hoist the check (if any at all) up to
somewhere that doesn't hurt performance.  I've explained how I made this work
in the private section of the new header.

Once this lands and bakes a bit, I'll start following up with CLs to use it more
and to add a bunch of those little 1-2 instruction snippets we've been wanting,
e.g. cvtps2ph, cvtph2ps, ptest, pmulld, pmovzxbd, blendvps, pshufb, roundps
(for floor) on x86, and vcvt.f32.f16, vcvt.f16.f32 on ARM.

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

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

8 years agoremove U16 support, just support F16
reed [Thu, 14 Apr 2016 16:02:14 +0000 (09:02 -0700)]
remove U16 support, just support F16

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

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

8 years agoRemove requestedStyle from SkTypefaceCache.
bungeman [Thu, 14 Apr 2016 15:04:45 +0000 (08:04 -0700)]
Remove requestedStyle from SkTypefaceCache.

The typeface cache contains typefaces which can be compared against to
determine if an already known typeface will work instead of creating a
new typeface id. This is primarily for sharing scaler contexts. How that
typeface was requested is not relevant to this comparison, so don't cache
it. Request caching must be handled separately.

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

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

8 years agoSwitch SkMagnifierImageFilter over to new onFilterImage interface
robertphillips [Thu, 14 Apr 2016 14:54:04 +0000 (07:54 -0700)]
Switch SkMagnifierImageFilter over to new onFilterImage interface

Additionally, this CL:

adds crop handling to the CPU path (the GPU path handled it but with a bug)

adds a cropRect (to better justify the applyCropRect)

adds a GM to exercise the cropRect

Note: I believe the handling of cropRects and clipping is deeply flawed but, at least, the two paths are consistently flawed now.

TBR=reed@google.com

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

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

8 years agoSince PIEX can now return an uncompressed RGB thumbnail, check the type of the image...
yujieqin [Thu, 14 Apr 2016 14:04:00 +0000 (07:04 -0700)]
Since PIEX can now return an uncompressed RGB thumbnail, check the type of the image before treating it as a JPEG.

Highlights of new PIEX:
* PIEX can now return JPEG compressed image or uncompressed RGB image
* Add IsOfType() and GEtNumberofBytesForIsOfType() to image_type_recognition_lite
* Add GetDngInformation() and GetOrientation() to piex
* Remove deprecated data entries from piex_types

BUG=b/27214608, b/28119810
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1883783002

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

8 years agoSimplify gamma-correctness for text rendering.
brianosman [Thu, 14 Apr 2016 13:02:59 +0000 (06:02 -0700)]
Simplify gamma-correctness for text rendering.

Just use the DC flag, independent of the destination pixel config or the
special output override flag (which is only to be used internally be
special effects that will never hit this code path.)

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

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

8 years agoFor GOOGLE3, add deref method to SkRefCnt.
benjaminwagner [Thu, 14 Apr 2016 00:51:57 +0000 (17:51 -0700)]
For GOOGLE3, add deref method to SkRefCnt.

This makes it easier to integrate with Blink code using RefPtr/PassRefPtr without pulling in Chrome's SkUserConfig.h.

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

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

8 years agoFix legacy NewRenderTarget factory
bsalomon [Wed, 13 Apr 2016 22:10:20 +0000 (15:10 -0700)]
Fix legacy NewRenderTarget factory

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

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

8 years agoOnly eglTerminate command buffer displays when no displays are in use
bsalomon [Wed, 13 Apr 2016 22:03:59 +0000 (15:03 -0700)]
Only eglTerminate command buffer displays when no displays are in use

This is a workaround for crbug.com/603223

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

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

8 years agoRemove GrTextureStorageAllocator. This was added from Chromium but never used and...
bsalomon [Wed, 13 Apr 2016 21:29:25 +0000 (14:29 -0700)]
Remove GrTextureStorageAllocator. This was added from Chromium but never used and not expected to be used.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1886613003

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

8 years agoTweak distance field path renderer behavior in gamma-correct mode to match
brianosman [Wed, 13 Apr 2016 20:56:21 +0000 (13:56 -0700)]
Tweak distance field path renderer behavior in gamma-correct mode to match
recent changes to text rendering.

Uses linear coverage falloff. Produces results that are perceptually more
similar to L32 (raster and gpu). Smoothstep + sRGB was too soft.

Plumb the gamma-correctness via DrawPathArgs, which also paves the way for
other path rendering implementations to easily make decisions about rendering
technique based on that flag.

Fix a few typos and formatting issues from my most recent change.

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

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

8 years agoRespect FC_MATRIX and FC_EMBOLDEN as extra font parameters.
bungeman [Wed, 13 Apr 2016 20:50:20 +0000 (13:50 -0700)]
Respect FC_MATRIX and FC_EMBOLDEN as extra font parameters.

A font consists of a set of data and a set of parameters to that data.
For example a ttc font consists of the full font data parameterized by
the index. In addition to the index, FontConfig allows specifying a
matrix and embolden flag. In the future there may also be additional
parameters of this sort, for example which color palette to use.

This does not provide a way to serialize these parameters.
Adding this here provides a nice place to experiment with doing so.

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

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

8 years agoRename lots of things from 'sRGB' to 'GammaCorrect', where appropriate
brianosman [Wed, 13 Apr 2016 20:10:14 +0000 (13:10 -0700)]
Rename lots of things from 'sRGB' to 'GammaCorrect', where appropriate

Trying to be much more explicit about where we really mean sRGB as a format,
and where we mean gamma-correct, as in: "not legacy behavior". Most of the
changes to rendering behavior are dependent on the latter, so let's be precise.

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

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

8 years agoAdd GM to prevent mis-drawing of LCD text in SkPictureImageFilters
robertphillips [Wed, 13 Apr 2016 17:55:07 +0000 (10:55 -0700)]
Add GM to prevent mis-drawing of LCD text in SkPictureImageFilters

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

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

8 years agoFix ChromeOS Swarming bot compile
borenet [Wed, 13 Apr 2016 16:37:25 +0000 (09:37 -0700)]
Fix ChromeOS Swarming bot compile

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

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

8 years agoAllow a small tolerance in GrAtlasTextBatch bounds test.
bsalomon [Wed, 13 Apr 2016 15:14:22 +0000 (08:14 -0700)]
Allow a small tolerance in GrAtlasTextBatch bounds test.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1882833002

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

8 years agoMake build_shaderc.py blow away output dir and allow build_type arg to contain either...
bsalomon [Wed, 13 Apr 2016 15:02:42 +0000 (08:02 -0700)]
Make build_shaderc.py blow away output dir and allow build_type arg to contain either Debug or Release

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

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

8 years agoMake SkSpecialSurfaces always use kUnknown for their pixel geometry
robertphillips [Wed, 13 Apr 2016 14:18:41 +0000 (07:18 -0700)]
Make SkSpecialSurfaces always use kUnknown for their pixel geometry

This now matches how the SkDevices were being created by the device proxy and prevents LCD text from being inadvertently applied.

BUG=602555

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

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

8 years agoFix CommandBuffer bot's DM config
borenet [Wed, 13 Apr 2016 13:00:42 +0000 (06:00 -0700)]
Fix CommandBuffer bot's DM config

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

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

8 years agoRemove SK_VERY_LEGACY_CREATE_TYPEFACE.
bungeman [Wed, 13 Apr 2016 12:23:35 +0000 (05:23 -0700)]
Remove SK_VERY_LEGACY_CREATE_TYPEFACE.

The flag and code it guards are no longer used.

TBR=reed
This just removes dead code.

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

8 years agoSwitch SkMatrixConvolutionImageFilter over to new onFilterImage interface
robertphillips [Wed, 13 Apr 2016 11:54:36 +0000 (04:54 -0700)]
Switch SkMatrixConvolutionImageFilter over to new onFilterImage interface

TBR=reed@google.com

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

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

8 years agoremove SK_SUPPORT_NEW_ONCREATESCALERCONTEXT, no longer needed in chdrome
reed [Tue, 12 Apr 2016 23:57:55 +0000 (16:57 -0700)]
remove SK_SUPPORT_NEW_ONCREATESCALERCONTEXT, no longer needed in chdrome

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

TBR=

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

8 years agodistinguish distinct matrixconvolution benchmarks
mtklein [Tue, 12 Apr 2016 22:52:52 +0000 (15:52 -0700)]
distinguish distinct matrixconvolution benchmarks

Today they all show as "matrixconvolution", and we probably only log one.

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

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

8 years agoBlitter for repeat RGBA8888->RGBA8888.
herb [Tue, 12 Apr 2016 21:07:59 +0000 (14:07 -0700)]
Blitter for repeat RGBA8888->RGBA8888.

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

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

8 years agoAdd missing F16 case to reverse pixel config conversion
brianosman [Tue, 12 Apr 2016 20:49:53 +0000 (13:49 -0700)]
Add missing F16 case to reverse pixel config conversion

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

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

8 years agoBegin switch to SkFontStyle for legacy calls.
bungeman [Tue, 12 Apr 2016 20:45:06 +0000 (13:45 -0700)]
Begin switch to SkFontStyle for legacy calls.

This adds SK_VERY_LEGACY_CREATE_TYPEFACE which, when defined, provides
only the old interface.

Ideally, everyone would switch directly to SkFontMgr and use one of the
newer calls, but there is currently no path for current users to get
there. This updates all the internals to use SkFontStyle, after
switching these over the higher level APIs can be switched.

The Chromium follow on patch can be seen at https://crrev.com/1877673002

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

TBR=reed
This doesn't really change API, just modernizes it.

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

8 years agosRGB support for distance field text.
brianosman [Tue, 12 Apr 2016 19:48:21 +0000 (12:48 -0700)]
sRGB support for distance field text.

Add a second distance field adjust table that only applies contrast,
not fake-gamma correction. Store a flag in the batch at creation time,
using the same logic we apply elsewhere (render target format, plus
paint flags).

That gets us close, but not as good as bitmap text. The final step is
to use a linear step function (rather than smoothstep) to map distance
to coverage, when we have sRGB output. Smoothstep's nonlinear response
is actually doing some fake-gamma, so it ends up over-correcting when
the output is already gamma-correct.

Results are now very close between L32 (old table, smoothstep) and S32
(contrast-only table, linstep).

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

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

8 years agoRemove SimpleOffsetFilter
robertphillips [Tue, 12 Apr 2016 19:41:00 +0000 (12:41 -0700)]
Remove SimpleOffsetFilter

SimpleOffsetFilter & SkOffsetImageFilter seem equivalent nowadays.

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

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

8 years agoRevert AlphaThresholdFilter to its old behavior wrt premul
robertphillips [Tue, 12 Apr 2016 19:39:26 +0000 (12:39 -0700)]
Revert AlphaThresholdFilter to its old behavior wrt premul

TBR=borenet@google.com

This fixes the "serialize-8888 gm  imagealphathreshold_surface" failure related to:
https://codereview.chromium.org/1879643003/ (Switch AlphaThresholdFilter over to new onFilterImage interface)

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

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

8 years agoMake fuzz builds set SK_FUZZ_LOGGING
kjlubick [Tue, 12 Apr 2016 19:02:59 +0000 (12:02 -0700)]
Make fuzz builds set SK_FUZZ_LOGGING

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

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

8 years agoSwitch AlphaThresholdFilter over to new onFilterImage interface
robertphillips [Tue, 12 Apr 2016 18:02:25 +0000 (11:02 -0700)]
Switch AlphaThresholdFilter over to new onFilterImage interface

This CL also alters the raster path in two ways:
  it now respects the sRGB/linear distinction of its input
  it now respects the clip

TBR=reed@google.com

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

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

8 years agof16 and pm4f are always the same swizzle, so remove adaptor
reed [Tue, 12 Apr 2016 17:32:56 +0000 (10:32 -0700)]
f16 and pm4f are always the same swizzle, so remove adaptor

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

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

8 years agoMake more unit tests run on Vulkan
bsalomon [Tue, 12 Apr 2016 16:59:58 +0000 (09:59 -0700)]
Make more unit tests run on Vulkan
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1885623002

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

8 years agoGYP_DEFINES and DM flags for Vulkan bot
borenet [Tue, 12 Apr 2016 15:13:56 +0000 (08:13 -0700)]
GYP_DEFINES and DM flags for Vulkan bot

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

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

8 years agoFix Vk build breakage due to new GrSLType
bsalomon [Tue, 12 Apr 2016 14:46:21 +0000 (07:46 -0700)]
Fix Vk build breakage due to new GrSLType

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

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

8 years agoMake is_ktx safer
scroggo [Tue, 12 Apr 2016 14:41:22 +0000 (07:41 -0700)]
Make is_ktx safer

Rather than assuming the data passed to ktx at least
KTX_FILE_IDENTIFIER_SIZE, pass the length of the data to is_ktx and
compare it.

Splitting off from crrev.com/1862133002, which no longer depends on
is_ktx.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1882593002

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

8 years agoImplement initCopySurfaceDstDesc for Vulkan
egdaniel [Tue, 12 Apr 2016 14:31:49 +0000 (07:31 -0700)]
Implement initCopySurfaceDstDesc for Vulkan

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

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

8 years agoRevert "Revert of Pass effects directly to fontcache (patchset #8 id:140001 of https...
reed [Tue, 12 Apr 2016 13:47:05 +0000 (06:47 -0700)]
Revert "Revert of Pass effects directly to fontcache (patchset #8 id:140001 of https://codereview.chromium.org/1863013003/ )"

add SK_SUPPORT_NEW_ONCREATESCALERCONTEXT for chrome

this has now landed https://codereview.chromium.org/1878913002/
TBR=

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

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

8 years agoiOS: Tweak xcodebuild location
borenet [Tue, 12 Apr 2016 13:21:47 +0000 (06:21 -0700)]
iOS: Tweak xcodebuild location

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

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

8 years agoSkWStream::writeText inlined.
halcanary [Tue, 12 Apr 2016 02:41:48 +0000 (19:41 -0700)]
SkWStream::writeText inlined.

Motivation: This function is used throughout SkPDF.

Note that the compiler can usually inline the result of strlen() for literal strings.

Before:
    out/Release/nanobench -m WStreamWriteText -q
        Timer overhead: 24.2ns
        ! -> high variance, ? -> moderate variance
            micros    bench
              6.10   WStreamWriteText nonrendering

After:
    out/Release/nanobench -m WStreamWriteText -q
        Timer overhead: 23.9ns
        ! -> high variance, ? -> moderate variance
            micros    bench
              2.51   WStreamWriteText nonrendering

PDF runtime change: -0.8% ±0.04%.

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

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

8 years agoImplement texel buffers
cdalton [Mon, 11 Apr 2016 21:47:28 +0000 (14:47 -0700)]
Implement texel buffers

Adds a mechanism for processors to add buffer accesses and implements
them in the GL backend.

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

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

8 years agoConvert some unit tests from running on GL contexts to running on all contexts
bsalomon [Mon, 11 Apr 2016 21:40:50 +0000 (14:40 -0700)]
Convert some unit tests from running on GL contexts to running on all contexts
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1873313002

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

8 years agoVulkan config in dm
bsalomon [Mon, 11 Apr 2016 21:21:33 +0000 (14:21 -0700)]
Vulkan config in dm

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

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

8 years agoSeparate private headers for condition inclusion in BUILD file.
iroth [Mon, 11 Apr 2016 20:45:51 +0000 (13:45 -0700)]
Separate private headers for condition inclusion in BUILD file.

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

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

8 years agoWait for all device work to finish before destroy VkDevice
egdaniel [Mon, 11 Apr 2016 20:41:51 +0000 (13:41 -0700)]
Wait for all device work to finish before destroy VkDevice

Currently before destroying the GrVkGpu, we do wait on all queue work to finish before destroying objects there.
Since we only have one queue, the vkDeviceWaitIdle added here is probably not necessary, but the spec does suggest
having it just to make sure all work is fully done on the device.

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

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

8 years agoSwitch SkTileImageFilter over to new onFilterImage interface
robertphillips [Mon, 11 Apr 2016 20:26:14 +0000 (13:26 -0700)]
Switch SkTileImageFilter over to new onFilterImage interface

This relies on: https://codereview.chromium.org/1816223002 (Update SkSpecialImage to be able to create tight SkImages and SkSurfaces)

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

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

8 years agonullptr -> "sans-serif" fixes bold in gm/colorwheel
mtklein [Mon, 11 Apr 2016 20:20:11 +0000 (13:20 -0700)]
nullptr -> "sans-serif" fixes bold in gm/colorwheel

This was an odd case where 8888 drew wrong and serialize-8888 was correct.

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

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

8 years agoAdd GLSL support for texelFetch
cdalton [Mon, 11 Apr 2016 20:02:05 +0000 (13:02 -0700)]
Add GLSL support for texelFetch

Adds a cap and builder methods for texelFetch. This is required for
texel buffers. Also moves the texel buffer cap into the general shader
caps, and adds glTexBufferRange to the GL interface.

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

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

8 years agoRename EmitArgs::fSamplers to fTexSamplers
cdalton [Mon, 11 Apr 2016 19:18:09 +0000 (12:18 -0700)]
Rename EmitArgs::fSamplers to fTexSamplers

Renames fSamplers to fTexSamplers in GrProcessor EmitArgs, and renames
GrGLSLTextureSampler to GrGLSLSampler. This will allow us to add a
second array of buffer samplers.

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

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

8 years agoInfer sampler precision from pixel config
cdalton [Mon, 11 Apr 2016 19:03:08 +0000 (12:03 -0700)]
Infer sampler precision from pixel config

Adds a "samplerPrecision" method to GrGLSLCaps and updates
GrGLSLProgramBuilder to infer a sampler's precision based on its
config and visibility.

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

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

8 years agoEnsure all image filter tests have "ImageFilter" somewhere in the name.
senorblanco [Mon, 11 Apr 2016 18:58:39 +0000 (11:58 -0700)]
Ensure all image filter tests have "ImageFilter" somewhere in the name.

This is for convenience, so that running
out/Release/dm --match ImageFilter runs them all.

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

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

8 years agoAdd appendPrecisionModifier method to GrGLSLShaderBuilder
cdalton [Mon, 11 Apr 2016 18:30:50 +0000 (11:30 -0700)]
Add appendPrecisionModifier method to GrGLSLShaderBuilder

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

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

8 years agoSwitch SkPictureImageFilter over to new onFilterImage interface
robertphillips [Mon, 11 Apr 2016 18:08:52 +0000 (11:08 -0700)]
Switch SkPictureImageFilter over to new onFilterImage interface

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

TBR=bsalomon@google.com

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

8 years agoRevert of Pass effects directly to fontcache (patchset #8 id:140001 of https://codere...
borenet [Mon, 11 Apr 2016 17:25:28 +0000 (10:25 -0700)]
Revert of Pass effects directly to fontcache (patchset #8 id:140001 of https://codereview.chromium.org/1863013003/ )

Reason for revert:
Seems to have broken the DEPS roll.

Original issue's description:
> Pass effects directly to fontcache
>
> BUG=skia:5176
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1863013003
>
> Committed: https://skia.googlesource.com/skia/+/c79172857c3f69cc46837e1beeae0c1ead377bb2

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

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

8 years agoForce upload to VRAM in filterImage
robertphillips [Mon, 11 Apr 2016 17:20:24 +0000 (10:20 -0700)]
Force upload to VRAM in filterImage

This forces the conversion of image filter result to VRAM (if it is required) prior to the filtered result being put into the ImageFilter cache.

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

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

8 years agoFixes for CommandBuffer bot
borenet [Mon, 11 Apr 2016 17:16:01 +0000 (10:16 -0700)]
Fixes for CommandBuffer bot

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

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

8 years agoFix to zoom on Vulkan Viewer
egdaniel [Mon, 11 Apr 2016 15:30:40 +0000 (08:30 -0700)]
Fix to zoom on Vulkan Viewer

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

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

8 years agoPass effects directly to fontcache
reed [Mon, 11 Apr 2016 14:51:07 +0000 (07:51 -0700)]
Pass effects directly to fontcache

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

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

8 years agoadjust gm bounds for better content fit
reed [Mon, 11 Apr 2016 14:46:38 +0000 (07:46 -0700)]
adjust gm bounds for better content fit

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

TBR=djsollen

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

8 years agoSwitch SkDisplacementImageFilter over to new onFilterImage interface
robertphillips [Mon, 11 Apr 2016 14:23:34 +0000 (07:23 -0700)]
Switch SkDisplacementImageFilter over to new onFilterImage interface

TBR=reed@google.com

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

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

8 years agoFix roll bot's win gn build
robertphillips [Sun, 10 Apr 2016 21:04:19 +0000 (14:04 -0700)]
Fix roll bot's win gn build

TBR=borenet@google.com,bsalomon@google.com

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

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

8 years agoarithmetic mode with Sk4f
mtklein [Sun, 10 Apr 2016 13:23:28 +0000 (06:23 -0700)]
arithmetic mode with Sk4f

After reading the SSE version, I figured I'd show off the new hotness a little.  This'll get us SSE, NEON and portable implementations all in one easy to read package.

Since we've been talking about it, it's worth noting the several ways this implementation is still not constant time:
  - short circuits on 0x00 and 0xff coverage;
  - floating point multiplication with untrusted k1-k4; if someone figures out a clever way to sometimes create denorm floats and sometimes not, there's a gigantic performance difference.

I would hazard the pin is constant time now though.

I've also fixed the lerp to lerp between dst and r instead of src and r.  That can't have been right.

curr/maxrss loops min median mean max stddev samples    config bench
   9/9   MB 1 25.5ms 25.5ms 25.5ms 25.5ms 0% ▃▁▁▃▂▇▅▆▇█ 8888 Xfermode_arithmetic_enforce_pm_aa
   9/9   MB 1 24.1ms 24.2ms 24.2ms 24.3ms 0% ▄▃▁▄█▆▆█▃█ 8888 Xfermode_arithmetic_aa
   9/9   MB 1 102ms 102ms 102ms 103ms 0% ▁▅▂▆▂█▂█▁▂ 8888 Xfermode_arithmetic_enforce_pm
   9/9   MB 1 94.8ms 95.4ms 95.2ms 95.8ms 0% ▅▅▁▁▁▁▄▇█▇ 8888 Xfermode_arithmetic

~~~~>

curr/maxrss loops min median mean max stddev samples    config bench
   9/9   MB 1 9.71ms 9.74ms 9.73ms 9.78ms 0% █▅▄▄▁▂▂▂▄▄ 8888 Xfermode_arithmetic_enforce_pm_aa
   9/9   MB 1 9.5ms 9.57ms 9.58ms 9.7ms 1% ▂▁█▅▂▂▆▃▄▄ 8888 Xfermode_arithmetic_aa
   9/9   MB 1 21.8ms 21.8ms 21.8ms 21.9ms 0% █▂▂▂▂▂▂▁▄▂ 8888 Xfermode_arithmetic_enforce_pm
   9/9   MB 1 16.5ms 16.6ms 16.6ms 16.6ms 0% ▃█▁▁▄▄▁▁▆▅ 8888 Xfermode_arithmetic

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

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

8 years agoUpdate SKP version
update-skps [Sun, 10 Apr 2016 07:30:13 +0000 (00:30 -0700)]
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=1873033002

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

8 years agoremove unused BML (binary xml) code
reed [Sat, 9 Apr 2016 18:09:49 +0000 (11:09 -0700)]
remove unused BML (binary xml) code

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

TBR=

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

8 years agoUpdate LightingImageFilter to sk_sp
robertphillips [Fri, 8 Apr 2016 23:28:09 +0000 (16:28 -0700)]
Update LightingImageFilter to sk_sp

TBR=reed@google.com

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

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

8 years agoAdd AVX/AVX2 support for runtime check
Melnikov.Sergey.V [Fri, 8 Apr 2016 22:31:45 +0000 (15:31 -0700)]
Add AVX/AVX2 support for runtime check

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

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