platform/upstream/libSkiaSharp.git
7 years agoRevert 248ff023 & 2cb6cb72
Hal Canary [Tue, 22 Nov 2016 21:21:38 +0000 (14:21 -0700)]
Revert 248ff023 & 2cb6cb72

Revert "SkImageEncoder: simplify API"
This reverts commit 248ff02331d7f73ee4b6c5a7eabeae1080c16cd4.
Revert "Fix bug: can't convert nullptr -> bool"
This reverts commit 2cb6cb7218171b357bb5c934f032ba69c7b78401.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5151
NOTRY=true

Change-Id: I5f6414392d6545f74db0b5bb50608d04f053a8ec
Reviewed-on: https://skia-review.googlesource.com/5151
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
7 years ago4444 and gray 8
Mike Klein [Tue, 22 Nov 2016 20:50:12 +0000 (15:50 -0500)]
4444 and gray 8

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5147
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Change-Id: Id08804803b2bbeab4fa88538491e99e53d5c2efe
Reviewed-on: https://skia-review.googlesource.com/5147
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agoMove GrShaderVar to an appending model for layout qualifiers
Brian Salomon [Tue, 22 Nov 2016 20:06:46 +0000 (15:06 -0500)]
Move GrShaderVar to an appending model for layout qualifiers

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5144

Change-Id: I05e88961e50bd679cfe5863f413f3ec65bc9fd95
Reviewed-on: https://skia-review.googlesource.com/5144
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

7 years agoSupport sRGB 565.
Mike Klein [Tue, 22 Nov 2016 19:58:45 +0000 (14:58 -0500)]
Support sRGB 565.

It looks like I'm not going to be able to avoid supporting sRGB G8, I8, 565, 4444, 8888.
(A8 and F16 will always be linear.)  This fixes 565, and lays out the rest of the accum_*.

I did a little reorganization to keep things in ascending bit depth, just for sanity.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5145
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Change-Id: Ib0508e5a4ee1bab2044a76bcabc367841d634cd2
Reviewed-on: https://skia-review.googlesource.com/5145
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agoFix bug: can't convert nullptr -> bool
Hal Canary [Tue, 22 Nov 2016 19:23:28 +0000 (12:23 -0700)]
Fix bug: can't convert nullptr -> bool

Change-Id: Ib37c46d00b6a3e768e6d8399f2a6afb332d36bff
Reviewed-on: https://skia-review.googlesource.com/5141
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
7 years agoHandle nullptr from asTextureRef
brianosman [Tue, 22 Nov 2016 20:03:53 +0000 (12:03 -0800)]
Handle nullptr from asTextureRef

This can fail, if the special image dimensions are larger than the maximum
allowable render target dimensions.

BUG=chromium:666519
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2520043003

Review-Url: https://codereview.chromium.org/2520043003

7 years agoremove SkPixelRef::refEncodedData()
Hal Canary [Tue, 22 Nov 2016 18:57:18 +0000 (11:57 -0700)]
remove SkPixelRef::refEncodedData()

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5001

Change-Id: I15dba4f44c762ab69a23eb8a77adff5f63763e30
Reviewed-on: https://skia-review.googlesource.com/5001
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Reed <reed@google.com>
7 years agoFuzzDrawFunctions from twsmith
Kevin Lubick [Tue, 22 Nov 2016 18:57:18 +0000 (13:57 -0500)]
FuzzDrawFunctions from twsmith

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4979

Change-Id: Ib5cc6ea036538b611d6959c679a276050e145f57
Reviewed-on: https://skia-review.googlesource.com/4979
Reviewed-by: Mike Klein <mtklein@chromium.org>
7 years agoaccum_565 and accum_f16
Mike Klein [Tue, 22 Nov 2016 18:22:48 +0000 (13:22 -0500)]
accum_565 and accum_f16

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5125
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Change-Id: I2e338ae14db0068d9a09e16a0678dd2ee9f97efd
Reviewed-on: https://skia-review.googlesource.com/5125
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
7 years agoFixed fuzzer issue with lut16Type A2B ICC profiles
raftias [Tue, 22 Nov 2016 18:21:22 +0000 (13:21 -0500)]
Fixed fuzzer issue with lut16Type A2B ICC profiles

There was no check for if a profile had gamma table with 0 elements.
Now it verifies that the table has 2-4096 entries as the ICC specs say.

BUG=667695

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5124

Change-Id: I36de202e398654ce8dd88e765455b4c4577724d2
Reviewed-on: https://skia-review.googlesource.com/5124
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Robert Aftias <raftias@google.com>

7 years agoFix NoGPU bot
Matt Sarett [Tue, 22 Nov 2016 18:36:23 +0000 (13:36 -0500)]
Fix NoGPU bot

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5126

Change-Id: I34299845b6d20f219722da6a3135070369010555
Reviewed-on: https://skia-review.googlesource.com/5126
Reviewed-by: Matt Sarett <msarett@google.com>
7 years agoAdd SkOverdrawCanvas to detect overdraw
Matt Sarett [Tue, 22 Nov 2016 16:31:41 +0000 (11:31 -0500)]
Add SkOverdrawCanvas to detect overdraw

This is the first part of a multi-part change to detect and
display gpu overdraw on Android.

BUG:32370375

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4907

Change-Id: Ibba9d7343f2fd57397fa1168a5a5b1ef6ef91287
Reviewed-on: https://skia-review.googlesource.com/4907
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Matt Sarett <msarett@google.com>

7 years agoSkImageEncoder: simplify API
Hal Canary [Tue, 22 Nov 2016 16:03:03 +0000 (09:03 -0700)]
SkImageEncoder: simplify API

  - Hide SkImageEncoder class in private header.
  - SkImageEncoder::Type becomes SkEncodedImageFormat
  - SkEncodedFormat becomes SkEncodedImageFormat
  - SkImageEncoder static functions replaced with
    single function EncodeImage()
  - utility wrappers for EncodeImage() are in
    sk_tool_utils.h

TODO: remove link-time registration mechanism.
TODO: clean up clients use of API and flip the flag.
TODO: implement EncodeImage() in chromeium/skia/ext

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4909

Change-Id: Ib48b31fdc05cf23cda7f56ebfd67c841c149ce70
Reviewed-on: https://skia-review.googlesource.com/4909
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>

7 years agobilerp
Mike Klein [Mon, 21 Nov 2016 21:19:34 +0000 (16:19 -0500)]
bilerp

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5107

Change-Id: I5c30105501cbdb57896d9ec35737494eabd5998b
Reviewed-on: https://skia-review.googlesource.com/5107
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agoadded support for push_constant layout
ethannicholas [Tue, 22 Nov 2016 16:39:36 +0000 (08:39 -0800)]
added support for push_constant layout

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2187433003

Committed: https://skia.googlesource.com/skia/+/fa5f65ac61fd525029aa9dab161ffe4896c10f6d
Review-Url: https://codereview.chromium.org/2187433003

7 years agoAdd support for input attachments in SkSL spirv
Greg Daniel [Tue, 22 Nov 2016 14:44:03 +0000 (09:44 -0500)]
Add support for input attachments in SkSL spirv

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5115

Change-Id: I3e03a465a10c9aff62491d0f6e71105d1b650dab
Reviewed-on: https://skia-review.googlesource.com/5115
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>

7 years agodon't memtion SkXfermode in public
Mike Reed [Fri, 18 Nov 2016 22:19:54 +0000 (17:19 -0500)]
don't memtion SkXfermode in public

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5070

Change-Id: Ia9527bfd0f13146669df5e71098af903e14bae3a
Reviewed-on: https://skia-review.googlesource.com/5070
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>

7 years agoremoved appendPrecisionModifier
Ethan Nicholas [Tue, 22 Nov 2016 14:31:35 +0000 (09:31 -0500)]
removed appendPrecisionModifier

skslc always provides support for precision modifiers (ignoring them if
unsupported on the target platform), so the Skia appendPrecisionModifier
function was redundant.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5117

Change-Id: I4bcbd47ef8d1f4f1b055086d4c9050254584b48c
Reviewed-on: https://skia-review.googlesource.com/5117
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>

7 years agosksl programs can now directly query GLSL caps
Ethan Nicholas [Mon, 21 Nov 2016 20:59:48 +0000 (15:59 -0500)]
sksl programs can now directly query GLSL caps

This adds support for querying "sk_Caps.<cap>" directly from within an SkSL program.
Combined with the existing support for collapsing 'if' statements with constant tests,
this means we can query caps using ordinary 'if' statements and the tests will
collapse out at compile time.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4795

Change-Id: I24d716a7fe6abf1489760bf08189164264269076
Reviewed-on: https://skia-review.googlesource.com/4795
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
7 years agoRoll recipe DEPS
Ravi Mistry [Mon, 21 Nov 2016 21:06:19 +0000 (16:06 -0500)]
Roll recipe DEPS

Looks like slave_build and cwd changed to start_dir in https://bugs.chromium.org/p/chromium/issues/detail?id=662586

BUG=skia:5979

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5104

Change-Id: I46d080b9089ea9b4adc2ed45fc81fdc192bdb2b2
Reviewed-on: https://skia-review.googlesource.com/5104
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>

7 years agoAvoid runtime initialization of FLT_EPSILON_SQRT
Bruce Dawson [Fri, 18 Nov 2016 20:08:45 +0000 (15:08 -0500)]
Avoid runtime initialization of FLT_EPSILON_SQRT

FLT_EPSILON_SQRT is initialized with a call to sqrt which, in release
builds on Windows, results in an initializer call (on official release
builds this is optimized away). On Windows release (all flavors)
builds this also triggers duplicate instantiations of the variable
(always a risk with non-integral const variables defined in header
files) with 32 copies ending up in both chrome.dll and chrome_child.dll.

This change avoids the run-time initializer and as a side effect it
also avoids most or all of the duplication. Section size savings in a
Windows 32-bit release official build are:

chrome.dll
     .text:   -64 bytes change
    .rdata:   -16 bytes change
     .data:  -256 bytes change
    .reloc:  -116 bytes change
Total change:  -452 bytes

chrome_child.dll
     .text:   160 bytes change
    .rdata:  -144 bytes change
     .data:  -256 bytes change
    .reloc:   -60 bytes change
Total change:  -300 bytes

A more complete fix would include using extern const to declare these
constants in the header file but define them once in a .cc file, but
it's not clear that this is necessary.

The size savings on non-official builds are greater. The increase in
the .text segment is odd, but harmless since those bytes are shared.

BUG=630755

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5061

Change-Id: I53d0cdc38e022039646df491d824a1aaf11def80
Reviewed-on: https://skia-review.googlesource.com/5061
Reviewed-by: Cary Clark <caryclark@google.com>
Reviewed-by: Bruce Dawson <brucedawson@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>

7 years agoAdd shadowrrect geometry processor
Jim Van Verth [Thu, 17 Nov 2016 20:27:09 +0000 (15:27 -0500)]
Add shadowrrect geometry processor

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4233

Change-Id: I637099709cfe30f7d3c1883e23840a47a7a25c10
Reviewed-on: https://skia-review.googlesource.com/4233
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
7 years agoImplemented parsing of lut8/lut16Type A2B ICC tags
raftias [Mon, 21 Nov 2016 19:22:53 +0000 (14:22 -0500)]
Implemented parsing of lut8/lut16Type A2B ICC tags

SkColorSpace::NewICC() can now successfully parse lut8Type/lut16Type
A2B0 tags instead of just A2B0Type ones. It will store the resulting
information in a SkColorSpace_A2B which allows color-correct decoding
of some images which previously were not supported.

BUG=138556
BUG=574209

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4770

Change-Id: I83b565af3f39f12a4bc37e0e7968f7d41e553291
Reviewed-on: https://skia-review.googlesource.com/4770
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Robert Aftias <raftias@google.com>

7 years agoRearrange NN sampling to more naturally support bilerp.
Mike Klein [Mon, 21 Nov 2016 20:09:45 +0000 (15:09 -0500)]
Rearrange NN sampling to more naturally support bilerp.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5105

Change-Id: Ic692b5faf2d33fee31b119ff8d3653118b25b7c2
Reviewed-on: https://skia-review.googlesource.com/5105
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agoFix include of GrGLSLCaps in SkGradientShader
Greg Daniel [Mon, 21 Nov 2016 19:43:55 +0000 (14:43 -0500)]
Fix include of GrGLSLCaps in SkGradientShader

NOTRY=True

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5103

Change-Id: Iff3cfa3f5e4266d85f5113de3113fdcd858ed054
Reviewed-on: https://skia-review.googlesource.com/5103
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
7 years agoRevive geometry shaders
csmartdalton [Mon, 21 Nov 2016 18:55:00 +0000 (11:55 -0700)]
Revive geometry shaders

Fixes the bit rot that has set in for geometry shaders. They're to a
point now that we can use them again for GL experiments. Since SkSL
does not support geometry shaders yet, we pass the shader string
directly to the GL compiler for now.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5080

Change-Id: Ie3864e5559c810c682cf5f1709bdab87f033c43b
Reviewed-on: https://skia-review.googlesource.com/5080
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>

7 years agoMerge GrGLSLShaderVar and GrShaderVar
Brian Salomon [Mon, 21 Nov 2016 18:41:08 +0000 (13:41 -0500)]
Merge GrGLSLShaderVar and GrShaderVar

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5087

Change-Id: Ib8943a1da1ea495554feaf5b0992b94fbb9539ab
Reviewed-on: https://skia-review.googlesource.com/5087
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
7 years agoDefer more renderTargetContexts in the GPU image filter paths - take 2
robertphillips [Mon, 21 Nov 2016 19:05:03 +0000 (11:05 -0800)]
Defer more renderTargetContexts in the GPU image filter paths - take 2

This is a reland of https://skia-review.googlesource.com/c/4767/ (Defer more renderTargetContexts in the GPU image filter paths).
The addition of guards on instantiation && accessRenderTarget failure should prevent a reoccurence of this Nexus7 failures.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2514543002

TBR=bsalomon@google.com

Review-Url: https://codereview.chromium.org/2514543002

7 years agoSimplify shader paint alpha modulation.
Mike Klein [Mon, 21 Nov 2016 18:05:23 +0000 (13:05 -0500)]
Simplify shader paint alpha modulation.

We don't need to do any of this funky swap, load, srcin nonsense.  We've got a perfectly good scale_constant_float stage just perfect to be used instead.

While we're at it, we only need to modulate by paint alpha if the paint's not opaque.  x*1== x...

This puts the (x,y) inputs to shaders in (r,g) where they expect them.  It also frees (dr,dg,db,da) for use by the shader.  Might be handy for bilerp.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5100

Change-Id: Ief60c469ecac8300798b67cc68817cc1d127cf17
Reviewed-on: https://skia-review.googlesource.com/5100
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

7 years agoFixed issue with some A2B0 images being too dark
raftias [Mon, 21 Nov 2016 17:59:36 +0000 (12:59 -0500)]
Fixed issue with some A2B0 images being too dark

The issue was with the A2B0 matrix not being scaled by its encoding
factor when it needed to be (for A2B0 matrices only).

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5003

Change-Id: I3f202323e137e1b014e564bd96d87c601c4748ab
Reviewed-on: https://skia-review.googlesource.com/5003
Commit-Queue: Robert Aftias <raftias@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
7 years agoRemove testing code for not fitting in the Footer.
Herb Derby [Mon, 21 Nov 2016 17:51:48 +0000 (12:51 -0500)]
Remove testing code for not fitting in the Footer.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5098

Change-Id: I48df20600de302656869c4b5bd53c1105222b897
Reviewed-on: https://skia-review.googlesource.com/5098
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Herb Derby <herb@google.com>

7 years agoRemove GrGLSLSampler type and subclasses
Brian Salomon [Fri, 18 Nov 2016 16:58:54 +0000 (11:58 -0500)]
Remove GrGLSLSampler type and subclasses

GrGLSLUniformManager and GrGLSLProgramDataManager subclasses handle sampler variation across GPU backends.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5002

Change-Id: I968b006bab978c2fa209d1f7eda710c298d1212f
Reviewed-on: https://skia-review.googlesource.com/5002
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

7 years agoUse ptr diff to encode function and padding.
Herb Derby [Mon, 21 Nov 2016 17:09:27 +0000 (12:09 -0500)]
Use ptr diff to encode function and padding.

This drops allocation overhead from 16 bytes down to 4 bytes.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5066

CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Win8-MSVC-ShuttleB-GPU-HD4600-x86_64-Debug-Trybot;master.client.skia:Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-GN-Trybot

Change-Id: Id4665fd914dfb679996cefaf36fce6ef225fafb5
Reviewed-on: https://skia-review.googlesource.com/5066
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Herb Derby <herb@google.com>

7 years agore-land of switched skslc from std::string to SkString
Ethan Nicholas [Mon, 21 Nov 2016 15:39:35 +0000 (10:39 -0500)]
re-land of switched skslc from std::string to SkString

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5084

Change-Id: Ib21c30afc0d8483392b417e660b7fecfcc30e617
Reviewed-on: https://skia-review.googlesource.com/5084
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>

7 years agoVS script: Handle variation among configurations
Brian Osman [Mon, 21 Nov 2016 15:41:20 +0000 (10:41 -0500)]
VS script: Handle variation among configurations

The script now emits a meta-solution that include all projects across
all configurations. For example, third party libraries may not be in
all configurations, or certain targets are only present in some.

Additionally, the ItemDefinitionGroup (which includes preprocessor
definitions) is included from every configuration's project file, so
syntax highlighting of inactive code works correctly.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5085

Change-Id: I241d83aea3f076365811965161fc941f82c9714c
Reviewed-on: https://skia-review.googlesource.com/5085
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>

7 years agoAdd an extra pixel to the distance field path renderer bounds.
Brian Salomon [Mon, 21 Nov 2016 15:51:09 +0000 (10:51 -0500)]
Add an extra pixel to the distance field path renderer bounds.

BUG=chromium:663701
BUG=skia:5989

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5086

Change-Id: Ie97f46b108f54c711c5928b11a9921be38356f8d
Reviewed-on: https://skia-review.googlesource.com/5086
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

7 years agoAdd missing virtual functions for SkRectClipCheckBlitter
Yuqian Li [Mon, 21 Nov 2016 14:44:59 +0000 (09:44 -0500)]
Add missing virtual functions for SkRectClipCheckBlitter

This CL is related to the issue that we tried to fix in
https://skia-review.googlesource.com/c/5078/

Specifically, SkARGB32_Blitter overrides blitAntiH2 and blitAntiV2 and
they're different from blitAntiRuns. Therefore, if
SkRectClipCheckBlitter does not override those two functions, we're
going to get different results in debug and release build.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5082

Change-Id: I7f9565d494f0a6c45ab5a06fbedb73ef233b9a1f
Reviewed-on: https://skia-review.googlesource.com/5082
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>

7 years agoSupport decoding images to multiple formats, depending on usage
Brian Osman [Fri, 18 Nov 2016 16:28:24 +0000 (11:28 -0500)]
Support decoding images to multiple formats, depending on usage

Our codec generator will now preserve any asked-for color space, and
convert the encoded data to that representation. Cacherator now
allows decoding an image to both legacy (nullptr color space), and
color-correct formats. In color-correct mode, we choose the best
decoded format, based on the original properties, and our backend's
capabilities. Preference is given to the native format, when it's
already texturable (sRGB 8888 or F16 linear). Otherwise, we prefer
linear F16, and fall back to sRGB when that's not an option.

Re-land (and fix) of:
https://skia-review.googlesource.com/c/4438/
https://skia-review.googlesource.com/c/4796/

BUG=skia:5907

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4838

Change-Id: I20ff972ffe1c7e6535ddc501e2a8ab8c246e4061
Reviewed-on: https://skia-review.googlesource.com/4838
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
7 years agoDisable RectClipCheckBlitter for cc_unittests
Yuqian Li [Sun, 20 Nov 2016 18:58:06 +0000 (13:58 -0500)]
Disable RectClipCheckBlitter for cc_unittests

With RectClipCheckBlitter, the cc_unittests in Chromium will have
different results for rel and dbg buidls. As far as I know, the scan
converter blits the same alpha but they are somehow translated into
different RGBs. I'll look into it on Monday.

(RectClipCheckBlitter is added in https://skia-review.googlesource.com/c/4629/)

BUG=skia:
TBR=fmalita@chromium.org

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5078

Change-Id: I537d4380a44d0194103a4fcfb2bd2e2bcef41fcb
Reviewed-on: https://skia-review.googlesource.com/5078
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Yuqian Li <liyuqian@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>

7 years agoRevert "switched skslc from std::string to SkString"
Greg Daniel [Sun, 20 Nov 2016 14:53:35 +0000 (14:53 +0000)]
Revert "switched skslc from std::string to SkString"

This reverts commit d8df21a1e08b5b3380261f4b90acfbdc538ef93c.

Reason for revert: Breaking Roll

Original change's description:
> switched skslc from std::string to SkString
>
> BUG=skia:
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4977
>
> Change-Id: I15e24963b09b719a2c07da67745114f5ac66cee8
> Reviewed-on: https://skia-review.googlesource.com/4977
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
>

TBR=bsalomon@google.com,benjaminwagner@google.com,ethannicholas@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I84d5311beb9d5e607b7a4a3c138332f0c8f19648
Reviewed-on: https://skia-review.googlesource.com/5077
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
7 years agoRevert "fixed iOS build failure"
Greg Daniel [Sun, 20 Nov 2016 14:52:57 +0000 (14:52 +0000)]
Revert "fixed iOS build failure"

This reverts commit 83cd50b8afb0769154321ad39866f699c2c28e1e.

Reason for revert: Need to revert previous SkSL CL

Original change's description:
> fixed iOS build failure
>
> BUG=skia:
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4997
>
> Change-Id: I5c3727c5dc0e30ae88e1879e12547bdb11db97ee
> Reviewed-on: https://skia-review.googlesource.com/4997
> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
>

TBR=bsalomon@google.com,ethannicholas@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: Iaafb7abae666556132211e6d49766e629dbec9ba
Reviewed-on: https://skia-review.googlesource.com/5076
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
8 years agoAvoid unnecessary cast on a garbage data.
Ivan Krasin [Sat, 19 Nov 2016 02:28:30 +0000 (18:28 -0800)]
Avoid unnecessary cast on a garbage data.

It's dangerous and rightfully makes Control Flow Integrity check unhappy.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5074

Change-Id: Ie59490a5c671240128a9fcb353108f67f32d2f9e
Reviewed-on: https://skia-review.googlesource.com/5074
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>

8 years agoFix typo in GrGLCaps
elemental [Fri, 18 Nov 2016 22:11:29 +0000 (23:11 +0100)]
Fix typo in GrGLCaps

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5040

Change-Id: I23a9066de8c96378a1bd8596227e487cdd93669f
Reviewed-on: https://skia-review.googlesource.com/5040
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
8 years agoandroid does not need XFERMODE_PUBLIC flag
Mike Reed [Fri, 18 Nov 2016 22:32:43 +0000 (17:32 -0500)]
android does not need XFERMODE_PUBLIC flag

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5071

Change-Id: Ib889e8e41bb0fac6a6dfbbec22fe3930d178e3ba
Reviewed-on: https://skia-review.googlesource.com/5071
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>

8 years agoRevert "Turn off /arch:AVX[2] on Windows builds."
Mike Klein [Fri, 18 Nov 2016 22:11:41 +0000 (22:11 +0000)]
Revert "Turn off /arch:AVX[2] on Windows builds."

This reverts commit c89e2438ae24c862087f8ca1cb076052edbb27ea.

Reason for revert:

I'm going to stub this code out in Chrome instead for now.  Chrome's not going to land something that looks like this, so I'd rather undo it than leave Skia in this odd state.

Original change's description:
> Turn off /arch:AVX[2] on Windows builds.
>
> This canaries a similar change Chrome may need.
>
> BUG=chromium:666707
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5005
>
> Change-Id: Ibf7f9941968d905d865b9be1e63ebbf768870175
> Reviewed-on: https://skia-review.googlesource.com/5005
> Reviewed-by: Mike Klein <mtklein@chromium.org>
> Commit-Queue: Mike Klein <mtklein@chromium.org>
>

TBR=mtklein@chromium.org,brucedawson@chromium.org,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I9562f7877749c61f6ba4d48d6c4b557f09876128
Reviewed-on: https://skia-review.googlesource.com/5069
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
8 years agomirror tiling
Mike Klein [Fri, 18 Nov 2016 20:47:22 +0000 (15:47 -0500)]
mirror tiling

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5064
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Change-Id: I9d48ba73e145701245e5ec4f32c8c360da6baddd
Reviewed-on: https://skia-review.googlesource.com/5064
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

8 years agoMake GrSwizzle::GrSwizzle() constexpr
Brian Salomon [Fri, 18 Nov 2016 20:08:06 +0000 (15:08 -0500)]
Make GrSwizzle::GrSwizzle() constexpr

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5060

Change-Id: I862b895fd92b9b6938627af7b21022564b535e9b
Reviewed-on: https://skia-review.googlesource.com/5060
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Salomon <bsalomon@google.com>

8 years agoRemove unnecessary attribute and varying type modifiers
Brian Salomon [Fri, 18 Nov 2016 20:35:33 +0000 (15:35 -0500)]
Remove unnecessary attribute and varying type modifiers

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5007

Change-Id: Ic9fefe09221d5e367b5aa5dd0084fc7d6631998c
Reviewed-on: https://skia-review.googlesource.com/5007
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
8 years agoBuild fiddle and public_headers_warnings_check only when skia_enable_tools.
Mike Klein [Fri, 18 Nov 2016 14:35:28 +0000 (09:35 -0500)]
Build fiddle and public_headers_warnings_check only when skia_enable_tools.

This leaves libskia as the only thing we build when tools are not enabled (other GN environments like Fuchsia, Flutter, Chrome, or for people using ours and actively disabling tools).

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4993

Change-Id: I5acad66c1b068ef81c1a7e292c3524a0b1497b66
Reviewed-on: https://skia-review.googlesource.com/4993
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

8 years agoVS SLN script: Automatically determine which folder to use/copy
Brian Osman [Fri, 18 Nov 2016 18:38:13 +0000 (13:38 -0500)]
VS SLN script: Automatically determine which folder to use/copy

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5009

Change-Id: Ic7765cf23191af840935f7181579e04d62de23af
Reviewed-on: https://skia-review.googlesource.com/5009
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>

8 years agoTurn off /arch:AVX[2] on Windows builds.
Mike Klein [Fri, 18 Nov 2016 17:55:21 +0000 (12:55 -0500)]
Turn off /arch:AVX[2] on Windows builds.

This canaries a similar change Chrome may need.

BUG=chromium:666707

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5005

Change-Id: Ibf7f9941968d905d865b9be1e63ebbf768870175
Reviewed-on: https://skia-review.googlesource.com/5005
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>

8 years agoupdate G3 build after crrev.com/2500113004
Mike Klein [Fri, 18 Nov 2016 16:39:34 +0000 (11:39 -0500)]
update G3 build after crrev.com/2500113004

crrev.com/2500113004 removed SkBitmapProcState_opts_arm.cpp.
ARM targets now use SkBitmapProcState_opts_none.cpp, so stop filtering it out.

(See the gn/opts.gni change.)

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4996

Change-Id: Ib46ac5d9e908e8043aaec1f462672d9f9710431d
Reviewed-on: https://skia-review.googlesource.com/4996
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
8 years agoMake GrBufferAccess a nested class of GrProcessor
Brian Salomon [Fri, 18 Nov 2016 16:39:15 +0000 (11:39 -0500)]
Make GrBufferAccess a nested class of GrProcessor

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4978

Change-Id: I08c24e9183108f4dd6068216488fd3ac9b5f3ec2
Reviewed-on: https://skia-review.googlesource.com/4978
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

8 years agoAdd test for QuickFDot6Div
Yuqian Li [Fri, 18 Nov 2016 15:18:15 +0000 (10:18 -0500)]
Add test for QuickFDot6Div

This test will catch our (1 << 10) bug (which should be 1 << 9)

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4986

Change-Id: I25b607d1535a647284cee3b304a6f567f389e7f6
Reviewed-on: https://skia-review.googlesource.com/4986
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>

8 years agofixed iOS build failure
Ethan Nicholas [Fri, 18 Nov 2016 16:00:36 +0000 (11:00 -0500)]
fixed iOS build failure

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4997

Change-Id: I5c3727c5dc0e30ae88e1879e12547bdb11db97ee
Reviewed-on: https://skia-review.googlesource.com/4997
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>

8 years agoswitched skslc from std::string to SkString
Ethan Nicholas [Thu, 17 Nov 2016 21:13:37 +0000 (16:13 -0500)]
switched skslc from std::string to SkString

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4977

Change-Id: I15e24963b09b719a2c07da67745114f5ac66cee8
Reviewed-on: https://skia-review.googlesource.com/4977
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>

8 years agoAdd handling for instantiate failure up the call stack
Robert Phillips [Fri, 18 Nov 2016 13:44:13 +0000 (08:44 -0500)]
Add handling for instantiate failure up the call stack

The following two CLs were created via grep:
https://skia-review.googlesource.com/c/4929/ (Guard against instantiate & accessRenderTarget failures)
https://skia-review.googlesource.com/c/4961/ (Remove accessRenderTarget call in SkGpuDevice ctor)

This CL was created by running through all the tests and having instantiate fail so it catches up-stack failures to handle a null return.

BUG=665681,665500,665621

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4991

Change-Id: I6611eec8d36679123eef140538ee2526fb18628f
Reviewed-on: https://skia-review.googlesource.com/4991
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
8 years ago[nobuildbot] Explicitly name all jobs
Eric Boren [Fri, 18 Nov 2016 13:24:21 +0000 (08:24 -0500)]
[nobuildbot] Explicitly name all jobs

This makes it clearer which jobs we're running when looking at
gen_tasks.go.  Doesn't actually change any behavior.

BUG=skia:

Change-Id: Ie4fe639552bd673d3a605e03782a68b5e013cf1d
Reviewed-on: https://skia-review.googlesource.com/4990
Reviewed-by: Ravi Mistry <rmistry@google.com>
Commit-Queue: Eric Boren <borenet@google.com>

8 years ago[nobuildbot] Remaining Android devices
Eric Boren [Thu, 17 Nov 2016 16:33:27 +0000 (11:33 -0500)]
[nobuildbot] Remaining Android devices

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4933

Change-Id: I4e38d25c37e6a336f90e46d2260fcbb4f9899901
Reviewed-on: https://skia-review.googlesource.com/4933
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Eric Boren <borenet@google.com>

8 years agoUse SkFixedAllocator in SkLinearPipeline and remove the embedding of
Herb Derby [Fri, 18 Nov 2016 02:12:36 +0000 (21:12 -0500)]
Use SkFixedAllocator in SkLinearPipeline and remove the embedding of
the entire pipeline.

Adjust SkFixedAlloc to allow nesting of allocation.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4987

Change-Id: Ieeb1b5deaae004b67cee933af9bc19bbfd5a7687
Reviewed-on: https://skia-review.googlesource.com/4987
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
8 years agoPort convolve functions to SkOpts
xiangze.zhang [Fri, 18 Nov 2016 02:39:38 +0000 (18:39 -0800)]
Port convolve functions to SkOpts

This patch moves the C++/SSE2/NEON implementations of convolve functions
into the same place and uses SkOpts framework.
Also some indentation fix.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2500113004
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Review-Url: https://codereview.chromium.org/2500113004

8 years agoMark this file as executable
Adam Barth [Thu, 17 Nov 2016 21:46:49 +0000 (13:46 -0800)]
Mark this file as executable

The executable bit is needed in the Fuchsia build in order to execute this file
during the build.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4985

Change-Id: I4c11d823d052b7c8cef79b2842169581db76e815
Reviewed-on: https://skia-review.googlesource.com/4985
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>

8 years agoperspective matrix
Mike Klein [Thu, 17 Nov 2016 21:27:10 +0000 (16:27 -0500)]
perspective matrix

Nothing too tricky.  The path of least resistance was to keep the matrix row-major when in perspective.  It should make no difference in the end.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4983
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Change-Id: I48bb9de0265e7873c465874cc37076a8111f5ea1
Reviewed-on: https://skia-review.googlesource.com/4983
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

8 years agorepeat tiling
Mike Klein [Thu, 17 Nov 2016 20:42:22 +0000 (15:42 -0500)]
repeat tiling

Does the note in repeat() look right?

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4980
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Change-Id: I347023f312ab4643fc387e486192c3ae3357db8b
Reviewed-on: https://skia-review.googlesource.com/4980
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

8 years agoReplace my confusion with a pointer to the explanation.
Mike Klein [Thu, 17 Nov 2016 20:56:24 +0000 (15:56 -0500)]
Replace my confusion with a pointer to the explanation.

NOTRY=true

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4982

Change-Id: I9f1686519ea1dd5b50dce2e6ecef22741468e9d6
Reviewed-on: https://skia-review.googlesource.com/4982
Reviewed-by: Herb Derby <herb@google.com>
8 years agoIn VS SLN fixup script, don't erase old files
Brian Osman [Thu, 17 Nov 2016 20:50:36 +0000 (15:50 -0500)]
In VS SLN fixup script, don't erase old files

First, this avoids removing .suo files (solution options), which is where
things like debugging command line arguments live. This lets those
settings persist when re-generating.

Second, it lets you run the script while you have the solution open.
(Writing new files works okay, but removing the existing ones was
triggering a sharing violation).

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4981

Change-Id: Ib40494caf152dd638f9eee7635639399e8099421
Reviewed-on: https://skia-review.googlesource.com/4981
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
8 years agoFix the quickSkFDot6Div range check
Yuqian Li [Thu, 17 Nov 2016 19:31:53 +0000 (14:31 -0500)]
Fix the quickSkFDot6Div range check

Our previous (1 << 10) limit is based on 2^32 being our maximum value.
However, that's not the case because we have one more sign bit.
Therefore I should make it (1 << 9).

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4973

Change-Id: I38acb627cdb2514d3e4996aef02480b389cf3588
Reviewed-on: https://skia-review.googlesource.com/4973
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>

8 years agoRename GrTextureParams to GrSamplerParams
Brian Salomon [Thu, 17 Nov 2016 20:17:07 +0000 (15:17 -0500)]
Rename GrTextureParams to GrSamplerParams

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4965

Change-Id: I7d52e81c670e92ca96117284f44b274ce3cc3671
Reviewed-on: https://skia-review.googlesource.com/4965
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

8 years agoStrength reduce bilerp to nearest neighbor when the matrix is integer translate.
Mike Klein [Thu, 17 Nov 2016 19:04:22 +0000 (14:04 -0500)]
Strength reduce bilerp to nearest neighbor when the matrix is integer translate.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4967

Change-Id: I986f5695660d198532f5b0b367868ae904de92a1
Reviewed-on: https://skia-review.googlesource.com/4967
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

8 years agoFix computation of texture size for approximately-fit deferred proxies
Robert Phillips [Thu, 17 Nov 2016 19:43:51 +0000 (14:43 -0500)]
Fix computation of texture size for approximately-fit deferred proxies

For approximate-fit deferred proxies asserts were firing when the instantiated size was larger than the pre-computed exact-fit size.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4972

Change-Id: I879e16b86ab4d9ef9834163c24ccd6507fe4b94a
Reviewed-on: https://skia-review.googlesource.com/4972
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
8 years agoFix double deletion of DescriptorSetLayouts
Jim Van Verth [Thu, 17 Nov 2016 18:30:22 +0000 (13:30 -0500)]
Fix double deletion of DescriptorSetLayouts

When VkPipeline creation fails the PipelineStateBuilder cleans up
afterwards. It was deleting the sampler DescriptorSetLayout when that
is owned by the ResourceProvider.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4964

Change-Id: I876c570349f96f58e0256dc91bc1135c59a2058d
Reviewed-on: https://skia-review.googlesource.com/4964
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>

8 years agoUse SkSmallAllocator for Blender stage.
Herb Derby [Thu, 17 Nov 2016 19:25:30 +0000 (14:25 -0500)]
Use SkSmallAllocator for Blender stage.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4969

Change-Id: I5466e6b906c1f268860011957a5a00361c6bb66a
Reviewed-on: https://skia-review.googlesource.com/4969
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Herb Derby <herb@google.com>

8 years agoInitialize all values we load.
Mike Klein [Thu, 17 Nov 2016 19:28:11 +0000 (14:28 -0500)]
Initialize all values we load.

Let's see if this can convince MSAN that we're safe.

CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot,Perf-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-MSAN-Trybot

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4971

Change-Id: Ie90124068bc412bee94a4f8e87fae32e4d66e709
Reviewed-on: https://skia-review.googlesource.com/4971
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
8 years agoBe careful about types in SkNx_neon.h.
Mike Klein [Thu, 17 Nov 2016 19:33:11 +0000 (14:33 -0500)]
Be careful about types in SkNx_neon.h.

The Google3 Android ARM build is still using GCC, which isn't so loosey-goosey as Clang about bit-casting back and forth between int32x4_t and uint32x4_t.

BUG=skia:

Change-Id: I0d54f6859b8e03be4936c51bbaa1967db4261bd4
Reviewed-on: https://skia-review.googlesource.com/4974
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
8 years agoIn GrProcessor::TextureSampler drop the "get", it's cleaner
Brian Salomon [Thu, 17 Nov 2016 17:48:40 +0000 (12:48 -0500)]
In GrProcessor::TextureSampler drop the "get", it's cleaner

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4962

Change-Id: I55e7f8d1b6e1097fdbe411e9989dd42a03dd5f33
Reviewed-on: https://skia-review.googlesource.com/4962
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

8 years agoAlways use GL_HALF_FLOAT_OES on ANGLE, even with ES3.
Brian Osman [Thu, 17 Nov 2016 18:27:31 +0000 (13:27 -0500)]
Always use GL_HALF_FLOAT_OES on ANGLE, even with ES3.

In the past, ANGLE always used GL_HALF_FLOAT. I filed a bug about that,
and they switched to HALF_FLOAT_OES. However, ES3 has direct support for
HALF_FLOAT, so we expect that as the format for read pixels.

The better solution would be to remember and return the value we get
back from IMPLEMENTATION_COLOR_READ_TYPE, but there are subtleties that
create additional bugs when we do that. In particular:

If trying to read Alpha8 from RGBA, the current sequence is:

1. readPixelsSupported asks for the format to use. getExternalFormat
   switches out the format (assuming we're using GL_RED). This creates
   a format/type pair that fails the ES3.2 rules (16.1.2), so we ask
   the driver for the secondary format, which matches the one that we
   expect (from our config table).
2. Then we *actually* do the readPixels, and here we just call
   getReadPixelsFormat, which does the remapping, but skips the follow
   up checks in readPixelsSupported. So we end up passing a format/type
   pair that our code in readPixelsSupported thinks is illegal (and
   which is neither the pair that our config table stores, *nor* the
   pair returned by the implementation).

A straightforward solution of the original problem is to notice that
we had to ask the implementation (because the values are filled in),
so we should trust those and not the ones in the config table. But then
we miss out on the chance to overwrite the values for the alpha only
from RGBA case. Sigh.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4963

Change-Id: Icb0c151c9f07ffc178ed3a597fa8ab0ed3c6cb94
Reviewed-on: https://skia-review.googlesource.com/4963
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>

8 years agoSupport SkImageShader in SkRasterPipeline blitter
Mike Klein [Thu, 17 Nov 2016 17:39:09 +0000 (12:39 -0500)]
Support SkImageShader in SkRasterPipeline blitter

First of many CLs, I'm sure.

This handles 8888 or sRGB sources with an affine matrix, clamp/clamp tiling, and nearest-neighbor sampling only.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4906
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Change-Id: I99f7508852b3d44b6f52f7a0bee29a793af35c48
Reviewed-on: https://skia-review.googlesource.com/4906
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

8 years agoRemove accessRenderTarget call in SkGpuDevice ctor
Robert Phillips [Thu, 17 Nov 2016 17:45:04 +0000 (12:45 -0500)]
Remove accessRenderTarget call in SkGpuDevice ctor

This is a follow up to https://skia-review.googlesource.com/c/4929/ (Guard against instantiate & accessRenderTarget failures).

Rather than guard this call to accessRenderTarget I would prefer to remove it.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4961

BUG=665681,665500,665621

Change-Id: I2c9ec245491d9059de892b2e6a7d4a4de4accdfd
Reviewed-on: https://skia-review.googlesource.com/4961
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
8 years agoRemove unnecessary TextureSampler comparison in GrTextureDomainEffect.
Brian Salomon [Thu, 17 Nov 2016 17:47:06 +0000 (12:47 -0500)]
Remove unnecessary TextureSampler comparison in GrTextureDomainEffect.

The base class already performs this comparison.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4960

Change-Id: Ic2a46e05f05ba36b291c05e324aa29b4aad15c23
Reviewed-on: https://skia-review.googlesource.com/4960
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

8 years agoUse SkFixedMul instead of SkFixedMul_lowprec
Yuqian Li [Thu, 17 Nov 2016 14:23:26 +0000 (09:23 -0500)]
Use SkFixedMul instead of SkFixedMul_lowprec

It seems that SkFixedMul_lowprec doesn't have too much performance gain (maybe
1%). But its precision loss is siginificant. No serious issues have been found
in convex cases, but things get much trickier for concave shapes. I'm removing
it now to improve the stability and reliability of our algorithm, which may
potentially benefit our Chrome landing. (Even if we do not remove
SkFixedMul_lowprec now, we eventually will remove it when we land concave AAA
code.)

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4926

Change-Id: Iae5739a3780bb77ce6237888eee51a502fea5cf2
Reviewed-on: https://skia-review.googlesource.com/4926
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>

8 years agoGuard against instantiate & accessRenderTarget failures
Robert Phillips [Thu, 17 Nov 2016 15:22:48 +0000 (10:22 -0500)]
Guard against instantiate & accessRenderTarget failures

Chrome's fuzzer have reminded me that, since we are deferring allocation, instantiate and accessRenderTarget can now fail further down the call stack.

This should probably be cherry picked back to M56.

BUG=665681,665500,665621

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4929

Change-Id: I44d81ff29586dfe75ddda30b5ed8ca76354542d6
Reviewed-on: https://skia-review.googlesource.com/4929
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>

8 years agoPlumb filter quality into SkShader::appendStages().
Mike Klein [Thu, 17 Nov 2016 15:47:39 +0000 (10:47 -0500)]
Plumb filter quality into SkShader::appendStages().

We of course need this to know whether or not to bilerp.

TBR=herb@google.com

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4932

Change-Id: I5fe6d93c1d36d0d53f566f722960fcafb0d8bc3c
Reviewed-on: https://skia-review.googlesource.com/4932
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
8 years agoUpdate Skia milestone to 57
hcm@google.com [Thu, 17 Nov 2016 14:31:42 +0000 (09:31 -0500)]
Update Skia milestone to 57

Milestone that we typically update, but note that change from 55->56 was missed, will cherry pick to branch.
This change gets current file caught up to show working milestone after branch.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4927

Change-Id: If10e0db2d4acc908f5da7c4e9d30497deef6a2ff
Reviewed-on: https://skia-review.googlesource.com/4927
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Heather Miller <hcm@google.com>
Commit-Queue: Heather Miller <hcm@google.com>

8 years agoRename GrTextureAccess to GrProcessor::TextureSampler.
Brian Salomon [Thu, 17 Nov 2016 16:38:22 +0000 (11:38 -0500)]
Rename GrTextureAccess to GrProcessor::TextureSampler.

Renames vars and methods that used the work "access" to refer to this type.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4931

Change-Id: Ibcf488fbd445c5119fc13d190544cd98981bdbee
Reviewed-on: https://skia-review.googlesource.com/4931
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
8 years agofix fuzzer crash
Cary Clark [Thu, 17 Nov 2016 13:47:37 +0000 (08:47 -0500)]
fix fuzzer crash

Fail if data is
inconsistent.

R=kjlubick@google.com
BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4923

Change-Id: Ie3f65c80c0d59968b1e3fc8bc91839bedb2e3da3
Reviewed-on: https://skia-review.googlesource.com/4923
Commit-Queue: Cary Clark <caryclark@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
8 years agoCopy over git_utils from common and add GitLocalConfig
Ravi Mistry [Thu, 17 Nov 2016 13:13:51 +0000 (08:13 -0500)]
Copy over git_utils from common and add GitLocalConfig

BUG=skia:5979

# Already ran tryjobs in https://skia-review.googlesource.com/c/4897/11
NOTRY=true
NOTREECHECKS=true
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4897

Change-Id: Iee061101b69b4d1cfb0e640785a19e42c6017ef8
Reviewed-on: https://skia-review.googlesource.com/4897
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
8 years agoDisable the sources assignment filter for platform specific files.
Chinmay Garde [Wed, 16 Nov 2016 23:04:12 +0000 (15:04 -0800)]
Disable the sources assignment filter for platform specific files.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4918

Change-Id: Ie9e0db55eae5ad7cad82db5270a8bb6e80d3b3bb
Reviewed-on: https://skia-review.googlesource.com/4918
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>

8 years ago[nobuildbot] More Android bots
Eric Boren [Wed, 16 Nov 2016 20:55:06 +0000 (15:55 -0500)]
[nobuildbot] More Android bots

- GalaxyS7
- NVIDIA_Shield
- Nexus10
- Nexus7
- Nexus9

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4915

Change-Id: Ie4fb27085fe154ddf15de4774de9932cde28e842
Reviewed-on: https://skia-review.googlesource.com/4915
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Eric Boren <borenet@google.com>

8 years agoDon't build :public_headers_warnings_check on NoGPU builds.
Mike Klein [Wed, 16 Nov 2016 21:00:46 +0000 (16:00 -0500)]
Don't build :public_headers_warnings_check on NoGPU builds.

skia.h includes GPU headers.  No real point in getting fancy here... if there are no unused parameters in all headers, there are no unused parameters in the subset of non-GPU headers.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4916

Change-Id: Iaaea405633aabcc82e40cd4b1a2286aadd5cea17
Reviewed-on: https://skia-review.googlesource.com/4916
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

8 years agoUse SkSmallAllocator for SamplerStage and Accessor.
Herb Derby [Wed, 16 Nov 2016 21:23:24 +0000 (16:23 -0500)]
Use SkSmallAllocator for SamplerStage and Accessor.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4917

Change-Id: Id67d7c1cefa2aadfc706c56dd02d086120f99be3
Reviewed-on: https://skia-review.googlesource.com/4917
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
8 years agoHook into parametric and table raster pipeline stages
Matt Sarett [Wed, 16 Nov 2016 21:07:15 +0000 (16:07 -0500)]
Hook into parametric and table raster pipeline stages

BUG:664864

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4913
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Change-Id: I909152f1abba60803f0ce2f970eec1f8f1816d78
Reviewed-on: https://skia-review.googlesource.com/4913
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
8 years agoTurn off all SkDebugfs in SkScan_AAAPath.cpp
Yuqian Li [Wed, 16 Nov 2016 20:34:59 +0000 (15:34 -0500)]
Turn off all SkDebugfs in SkScan_AAAPath.cpp

TBR=mtklein@google.com

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4912

Change-Id: Ia69f2932936e34bc487c9c468bba176de0b2b0df
Reviewed-on: https://skia-review.googlesource.com/4912
Reviewed-by: Yuqian Li <liyuqian@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>

8 years agoNo SkDebugf for approximate intersection
Yuqian Li [Wed, 16 Nov 2016 20:31:27 +0000 (15:31 -0500)]
No SkDebugf for approximate intersection

TBR=mtklein@google.com

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4911

Change-Id: I23bc298186f93c1a97a15d00b34f65cd72f964e7
Reviewed-on: https://skia-review.googlesource.com/4911
Reviewed-by: Yuqian Li <liyuqian@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Yuqian Li <liyuqian@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

8 years agoremove CANVAS_IS_REFCNT flag from public.bzl
Mike Reed [Wed, 16 Nov 2016 20:54:31 +0000 (15:54 -0500)]
remove CANVAS_IS_REFCNT flag from public.bzl

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4914

Change-Id: I3ea6c2b96dd79da9ebba659726cbab52bda21651
Reviewed-on: https://skia-review.googlesource.com/4914
Reviewed-by: Mike Reed <reed@google.com>
8 years agoExternal SkImageGenerator API
Florin Malita [Wed, 16 Nov 2016 19:45:34 +0000 (14:45 -0500)]
External SkImageGenerator API

Introduce an SkImageGenerator API to support the implementation of
externally-managed image decode and scale caches.

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

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4720

Change-Id: Ibfe37af5471f78f28f88f9d5e80938882be1a344
Reviewed-on: https://skia-review.googlesource.com/4720
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
8 years agoAdd vulkan build to skpbench.
Kevin Lubick [Wed, 16 Nov 2016 19:07:17 +0000 (14:07 -0500)]
Add vulkan build to skpbench.

This also fixes the name of the tasks because skpbench is always GPU.
There was a config for monitoring the gpu clock instead of the cpu clock,
but this was removed because the gpu clock isn't very useful at the moment.
cpu clock is basically wall-time, i.e. an accurate measurement of the
entire test.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4873

Change-Id: If1c7dd3141e24f79555ee7b3756f09618df54cb4
Reviewed-on: https://skia-review.googlesource.com/4873
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
8 years agoRename GrTextureBufferSampler to GrBufferSampler
csmartdalton [Wed, 16 Nov 2016 18:28:16 +0000 (11:28 -0700)]
Rename GrTextureBufferSampler to GrBufferSampler

Just a simple renaming to reinforce the Ganesh notion that a buffer
access is not related to a texture.

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4879

Change-Id: I3f12b6eccff744e246618be0a7abf41c4a1228a1
Reviewed-on: https://skia-review.googlesource.com/4879
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>

8 years agoRevert "Revert "Add support for image load to SkSL""
Brian Salomon [Wed, 16 Nov 2016 17:06:01 +0000 (12:06 -0500)]
Revert "Revert "Add support for image load to SkSL""

This reverts commit cb115bdeed5898ded3fdbe572a14616cff809b7c.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4900

Change-Id: Ibcb381bae83d0cfc1a1226be90792061d401426a
Reviewed-on: https://skia-review.googlesource.com/4900
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>

8 years agoGN: add public headers warnings check.
Mike Klein [Wed, 16 Nov 2016 17:13:44 +0000 (12:13 -0500)]
GN: add public headers warnings check.

We already generate skia.h to include all public headers for Fiddle.
This just includes it with -Wunused-parameter turned on as an error.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4901

Change-Id: Ia55a901c09a3c9c9d6d35a43259431dba3532ed9
Reviewed-on: https://skia-review.googlesource.com/4901
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>

8 years agoRename kTexture2DISampler to kITexture2DSampler.
Brian Salomon [Wed, 16 Nov 2016 17:55:57 +0000 (12:55 -0500)]
Rename kTexture2DISampler to kITexture2DSampler.

Also remove unused kGrSLTypeCount.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4903

Change-Id: I7f934c56515424b2668886dec2f16296a1256e2c
Reviewed-on: https://skia-review.googlesource.com/4903
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>