platform/upstream/libSkiaSharp.git
8 years agoFix createBuffer in Vulkan
egdaniel [Tue, 19 Apr 2016 19:13:41 +0000 (12:13 -0700)]
Fix createBuffer in Vulkan

TBR=bsalomon@google.com

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

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

8 years agoSwitch SkColorFilterImageFilter over to new onFilterImage interface (again)
robertphillips [Tue, 19 Apr 2016 17:21:02 +0000 (10:21 -0700)]
Switch SkColorFilterImageFilter over to new onFilterImage interface (again)

Back when this was originally reverted I was able to easily repro the perf regression locally. At ToT Skia/Chrome I can no longer repro the perf regression with this CL (in fact there is a modest perf improvement).

I propose landing this and then watching the Chromium perf bots.

BUG=602300,598028
TBR=reed@google.com

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

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

8 years agoAdding support for playback to L32/S32/F16 canvas.
brianosman [Tue, 19 Apr 2016 17:16:53 +0000 (10:16 -0700)]
Adding support for playback to L32/S32/F16 canvas.

Playback of my test GM works correctly on both raster and GPU, in all three modes.

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

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

8 years agoAdd optional data parameter to createBuffer
cdalton [Tue, 19 Apr 2016 17:00:02 +0000 (10:00 -0700)]
Add optional data parameter to createBuffer

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

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

8 years agoMake skpinfo more human friendly
robertphillips [Tue, 19 Apr 2016 16:29:01 +0000 (09:29 -0700)]
Make skpinfo more human friendly
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1901713004

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

8 years agoMove DM png code to picture_utils, for use by other tools.
brianosman [Tue, 19 Apr 2016 16:18:11 +0000 (09:18 -0700)]
Move DM png code to picture_utils, for use by other tools.

Planning to re-use this code in skiaserve in an upcoming change.

TBR=mtklein@google.com

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

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

8 years agofiddle_build_test/gyp: fix mac mesa build (2)
halcanary [Tue, 19 Apr 2016 15:46:50 +0000 (08:46 -0700)]
fiddle_build_test/gyp: fix mac mesa build (2)

TBR=
NOTRY=true

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

8 years agoAdd more diagnostic messages to ReadWriteAlpha test
robertphillips [Tue, 19 Apr 2016 15:32:40 +0000 (08:32 -0700)]
Add more diagnostic messages to ReadWriteAlpha test

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

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

8 years agoRename CodexTest.cpp to CodecTest.cpp
scroggo [Tue, 19 Apr 2016 15:27:39 +0000 (08:27 -0700)]
Rename CodexTest.cpp to CodecTest.cpp

CodexTest confuses me almost every time I try to open it. Renaming it
to what my brain thinks it should be called.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1897973004

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

8 years agofiddle_build_test/gyp: fix mac mesa build
halcanary [Tue, 19 Apr 2016 15:00:01 +0000 (08:00 -0700)]
fiddle_build_test/gyp: fix mac mesa build

TBR=
NOTRY=true

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

8 years agoDelete unused fNamedFactorySet from SkWriteBuffer
msarett [Tue, 19 Apr 2016 14:27:58 +0000 (07:27 -0700)]
Delete unused fNamedFactorySet from SkWriteBuffer

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

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

8 years agoRevert of Add SkEncodedInfo to report properties of encoded image data (patchset...
robertphillips [Tue, 19 Apr 2016 11:41:12 +0000 (04:41 -0700)]
Revert of Add SkEncodedInfo to report properties of encoded image data (patchset #6 id:200001 of https://codereview.chromium.org/1820073002/ )

Reason for revert:
Lots of bots failing

Original issue's description:
> Add SkEncodedInfo to report properties of encoded image data
>
> All this does is build an SkEncodedInfo for each codec, and
> then convert it to an SkImageInfo.
>
> In future steps I intend to:
> (1) Use SkEncodedInfo in place of SrcConfig in SkSwizzler.
> (2) Support more conversions in SkSwizzler (non-native
> BGRA/RGBA, 16-bit components, float, fixed point)
> (3) Investigate optimizing conversions from encoded data
> to linear color spaces.
>
> BUG=skia:4133
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1820073002
>
> Committed: https://skia.googlesource.com/skia/+/f682d9ad70d690a343bc15e26ef321d86770be41

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

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

8 years agoAdd SkEncodedInfo to report properties of encoded image data
msarett [Mon, 18 Apr 2016 23:20:00 +0000 (16:20 -0700)]
Add SkEncodedInfo to report properties of encoded image data

All this does is build an SkEncodedInfo for each codec, and
then convert it to an SkImageInfo.

In future steps I intend to:
(1) Use SkEncodedInfo in place of SrcConfig in SkSwizzler.
(2) Support more conversions in SkSwizzler (non-native
BGRA/RGBA, 16-bit components, float, fixed point)
(3) Investigate optimizing conversions from encoded data
to linear color spaces.

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

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

8 years agoMake SkImageFilter::Cache purging methods pure virtual
robertphillips [Mon, 18 Apr 2016 21:49:57 +0000 (14:49 -0700)]
Make SkImageFilter::Cache purging methods pure virtual

This is intended to see if the Windows 10 bots ignoring of the purge methods is a compiler bug.

TBR=reed@google.com

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

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

8 years agoUse libjpeg-turbo for YUV->RGB conversion in jpeg encoder
msarett [Mon, 18 Apr 2016 21:21:55 +0000 (14:21 -0700)]
Use libjpeg-turbo for YUV->RGB conversion in jpeg encoder

This remove the previous codepath, which performed a less
accurate conversion to YUV.

It actually faster to use the more accurate conversion, now
that we have updated to libjpeg-turbo.

z620 Performance Speed-Up:
mandrill.jpg (512x512): 1.13x
color_wheel.jpg (128x128): 1.12x

This should fix:
https://buganizer.corp.google.com/u/0/issues/28161384
https://buganizer.corp.google.com/u/0/issues/21891795

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

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

8 years agoPass through the profile info when creating a high-quality scaled offscreen.
herb [Mon, 18 Apr 2016 21:06:21 +0000 (14:06 -0700)]
Pass through the profile info when creating a high-quality scaled offscreen.

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

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

8 years agoUpdate to ToT shaderc
egdaniel [Mon, 18 Apr 2016 20:42:02 +0000 (13:42 -0700)]
Update to ToT shaderc

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

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

8 years agoCleanup android build files and tools
djsollen [Mon, 18 Apr 2016 19:57:35 +0000 (12:57 -0700)]
Cleanup android build files and tools
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1898793004

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

8 years agofiddle_build_test depends on skia_mesa
halcanary [Mon, 18 Apr 2016 19:42:05 +0000 (12:42 -0700)]
fiddle_build_test depends on skia_mesa

Builds on Build-Ubuntu-GCC-x86_64-Release-Mesa-Trybot

Shouldn't break anything else.

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

8 years agoAdd bench for image encodes
msarett [Mon, 18 Apr 2016 19:37:46 +0000 (12:37 -0700)]
Add bench for image encodes

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

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

8 years agofiddle_build_test: remove from most to fix build
halcanary [Mon, 18 Apr 2016 19:18:30 +0000 (12:18 -0700)]
fiddle_build_test: remove from most to fix build

TBR=jcgregorio@google.com
NOTRY=true

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

8 years agoexperimental/fiddle -> tools/fiddle
halcanary [Mon, 18 Apr 2016 18:50:07 +0000 (11:50 -0700)]
experimental/fiddle -> tools/fiddle

also, test building fiddle_main.cpp & draw.cpp
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1895143002

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

8 years agoUpdate android toolchain variable to point to root dir and not the bin
djsollen [Mon, 18 Apr 2016 18:01:02 +0000 (11:01 -0700)]
Update android toolchain variable to point to root dir and not the bin
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1900773002

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

8 years agoRemove deprecated paths from image filter infrastructure.
senorblanco [Mon, 18 Apr 2016 17:32:02 +0000 (10:32 -0700)]
Remove deprecated paths from image filter infrastructure.

Now that there are no filterImageGPUDeprecated() implementations,
we can being to rip out the deprecated infrastructure.

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

Committed: https://skia.googlesource.com/skia/+/6fb3cd7209849e665635ac17ef4eef4ad63e7f61

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

8 years agoSkia Filter Quality and Scaling Metrics
ericrk [Mon, 18 Apr 2016 16:14:00 +0000 (09:14 -0700)]
Skia Filter Quality and Scaling Metrics

Adds histogram metrics to log the filter quality and scale factor of
each image draw. To make the data easier to consume, this is broken
down into a number of individual histograms:
- Filter quality across all draw calls
- Scale amount across all draw calls
- Scale amount per filter quality (4 histograms total)

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

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

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

8 years agoexperimental/fiddle: update to new SkImage API
halcanary [Mon, 18 Apr 2016 15:17:56 +0000 (08:17 -0700)]
experimental/fiddle: update to new SkImage API

required by https://crrev.com/1897453002

NOTRY=true
TBR=jcgregorio@google.com

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

8 years agoModernize and trim down SkOnce.
mtklein [Mon, 18 Apr 2016 15:09:11 +0000 (08:09 -0700)]
Modernize and trim down SkOnce.

The API and implementation are very much simplified.
You may not want to bother reading the diff.

As is our trend, SkOnce now uses <atomic> directly.

Member initialization means we don't need SK_DECLARE_STATIC_ONCE.
SkSpinlock already works this same way.

All uses of the old API taking an external bool* and Lock* were pessimal,
so I have not carried this sort of API forward.  It's simpler, faster,
and more space-efficient to always use this single SkOnce class interface.

SkOnce weighs 2 bytes: a done bool and an SkSpinlock, also a bool internally.
This API refactoring opens up the opportunity to fuse those into a single
three-state byte if we'd like.

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

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

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

8 years agoSplit AlphaThresholdEffect out into its own file
robertphillips [Mon, 18 Apr 2016 14:20:05 +0000 (07:20 -0700)]
Split AlphaThresholdEffect out into its own file

Mainly mechanical although I did:
   convert Create method to sk_sp Make version
   rm extra '\t's and '\n's in emitCode

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

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

8 years agoWalk through files in parse_llvm_coverage.py instead of using 'git ls-files'
rmistry [Mon, 18 Apr 2016 11:18:56 +0000 (04:18 -0700)]
Walk through files in parse_llvm_coverage.py instead of using 'git ls-files'

The script will be executed on a swarming bot where we do not want to isolate .git directories.

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

NOTREECHECKS=true

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

8 years agoDo not do compile steps for Coverage
rmistry [Mon, 18 Apr 2016 11:14:17 +0000 (04:14 -0700)]
Do not do compile steps for Coverage

Coverage needs to do compilation in its test step. The primary reason is: the path to the out directory is compiled into the binary, which is why the compile and test steps need to be combined.

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

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

8 years agoAdd new coverage_skia.isolate
rmistry [Mon, 18 Apr 2016 11:13:48 +0000 (04:13 -0700)]
Add new coverage_skia.isolate

Coverage is different from the other recipes because it needs both skia_repo and test artifacts. The primary reason is: the path to the out directory is compiled into the binary, which is why the compile and test steps need to be combined.

The isolate file will be used from the updated coverage recipe in https://codereview.chromium.org/1862713002/

BUG=skia:5159
NOTREECHECKS=true

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

8 years agoRevert of Remove deprecated paths from image filter infrastructure. (patchset #2...
robertphillips [Sun, 17 Apr 2016 21:31:22 +0000 (14:31 -0700)]
Revert of Remove deprecated paths from image filter infrastructure. (patchset #2 id:20001 of https://codereview.chromium.org/1888243003/ )

Reason for revert:
Surprisingly (appallingly?), Chrome calls canFilterImageGPU

Original issue's description:
> Remove deprecated paths from image filter infrastructure.
>
> Now that there are no filterImageGPUDeprecated() implementations,
> we can being to rip out the deprecated infrastructure.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1888243003
>
> Committed: https://skia.googlesource.com/skia/+/6fb3cd7209849e665635ac17ef4eef4ad63e7f61

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

8 years agoOutline SkImageFilter Make methods
robertphillips [Sun, 17 Apr 2016 21:27:05 +0000 (14:27 -0700)]
Outline SkImageFilter Make methods

Mainly mechanical CL.

TBR=reed@google.com

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

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

8 years agoRemove deprecated paths from image filter infrastructure.
senorblanco [Sun, 17 Apr 2016 21:02:04 +0000 (14:02 -0700)]
Remove deprecated paths from image filter infrastructure.

Now that there are no filterImageGPUDeprecated() implementations,
we can being to rip out the deprecated infrastructure.

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

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

8 years agoRevert of move static arrays into impl, to avoid multiple copies (patchset #3 id...
reed [Sat, 16 Apr 2016 19:24:09 +0000 (12:24 -0700)]
Revert of move static arrays into impl, to avoid multiple copies (patchset #3 id:40001 of https://codereview.chromium.org/1889793007/ )

Reason for revert:
FAILED: if [ ! -e lib/libgfx.so -o ! -e lib/libgfx.so.TOC ]; then /b/build/slave/linux_chromeos/build/src/build/goma/client/gomacc ../../third_party/llvm-build/Release+Asserts/bin/clang++ -shared -Wl,-z,now -Wl,-z,relro -Wl,--fatal-warnings -Wl,-z,defs -pthread -Wl,-z,noexecstack -fPIC -fuse-ld=gold -B/b/build/slave/linux_chromeos/build/src/third_party/binutils/Linux_x64/Release/bin -Wl,--disable-new-dtags -m64 -Wl,--icf=all -o lib/libgfx.so -Wl,-soname=libgfx.so @lib/libgfx.so.rsp && { readelf -d lib/libgfx.so | grep SONAME ; nm -gD -f p lib/libgfx.so | cut -f1-2 -d' '; } > lib/libgfx.so.TOC; else /b/build/slave/linux_chromeos/build/src/build/goma/client/gomacc ../../third_party/llvm-build/Release+Asserts/bin/clang++ -shared -Wl,-z,now -Wl,-z,relro -Wl,--fatal-warnings -Wl,-z,defs -pthread -Wl,-z,noexecstack -fPIC -fuse-ld=gold -B/b/build/slave/linux_chromeos/build/src/third_party/binutils/Linux_x64/Release/bin -Wl,--disable-new-dtags -m64 -Wl,--icf=all -o lib/libgfx.so -Wl,-soname=libgfx.so @lib/libgfx.so.rsp && { readelf -d lib/libgfx.so | grep SONAME ; nm -gD -f p lib/libgfx.so | cut -f1-2 -d' '; } > lib/libgfx.so.tmp && if ! cmp -s lib/libgfx.so.tmp lib/libgfx.so.TOC; then mv lib/libgfx.so.tmp lib/libgfx.so.TOC ; fi; fi
obj/ui/gfx/gfx.blit.o:../../ui/gfx/blit.cc:function SkColorTypeBytesPerPixel(SkColorType): error: undefined reference to 'gPrivate_SkColorTypeBytesPerPixel'
obj/ui/gfx/gfx.canvas.o:../../ui/gfx/canvas.cc:function SkColorTypeBytesPerPixel(SkColorType): error: undefined reference to 'gPrivate_SkColorTypeBytesPerPixel'
obj/ui/gfx/gfx.canvas_skia.o:../../ui/gfx/canvas_skia.cc:function SkColorTypeBytesPerPixel(SkColorType): error: undefined reference to 'gPrivate_SkColorTypeBytesPerPixel'
obj/ui/gfx/codec/gfx.jpeg_codec.o:../../ui/gfx/codec/jpeg_codec.cc:function SkColorTypeBytesPerPixel(SkColorType): error: undefined reference to 'gPrivate_SkColorTypeBytesPerPixel'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.

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

TBR=fmalita@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=skia:

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

8 years agoObserve gTreatSkColorAsSRGB for 4f gradients.
fmalita [Fri, 15 Apr 2016 20:03:07 +0000 (13:03 -0700)]
Observe gTreatSkColorAsSRGB for 4f gradients.

Use SkColor4f::FromColor() in the color packer to convert srgb->linear
when needed.

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

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

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