Commit Graph

3681 Commits

Author SHA1 Message Date
dvonbeck
5b794fad18 API change to allow for NormalSource selection at the user level.
This CL's base is the CL for CPU handling: https://codereview.chromium.org/2050773002/

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

Review-Url: https://codereview.chromium.org/2063793002
2016-07-06 13:58:36 -07:00
csmartdalton
0d28e574ac Fix caching of sample locations
The original caching logic for sample locations wishfully assumed that
the GPU would always use the same sample pattern for render targets
that had the same number of samples. It turns out we can't rely on
that. This change improves the caching logic to handle mismatched
simple patterns with the same count, and adds a unit test that
emulates different sample patterns observed on real hardware.

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

Committed: https://skia.googlesource.com/skia/+/09d49a3bfe2d1e652a648ce1ea0962b38d10d166
Review-Url: https://codereview.chromium.org/2111423002
2016-07-06 09:59:43 -07:00
reed
41c27e15ec Experiment: add flag for finish-recording to return null
BUG=skia:5495
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2106843004

Review-Url: https://codereview.chromium.org/2106843004
2016-07-06 09:29:17 -07:00
fmalita
03912f141f Document SkSurface::MakeRaster's memory initialization
So clients don't go clearing w/ SK_ColorTRANSPARENT unnecessarily.

R=reed@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2066903003

Review-Url: https://codereview.chromium.org/2066903003
2016-07-06 06:22:06 -07:00
reed
2dcb615c6f make setScaleTranslate public
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2122093002

TBR=

Review-Url: https://codereview.chromium.org/2122093002
2016-07-05 20:10:42 -07:00
rmistry
42e6798696 Revert of Fix caching of sample locations (patchset #3 id:40001 of https://codereview.chromium.org/2111423002/ )
Reason for revert:
Seems to be causing Chromium roll failures:
* https://codereview.chromium.org/2120373003
* https://codereview.chromium.org/2117193002
* https://codereview.chromium.org/2124653002

Original issue's description:
> Fix caching of sample locations
>
> The original caching logic for sample locations wishfully assumed that
> the GPU would always use the same sample pattern for render targets
> that had the same number of samples. It turns out we can't rely on
> that. This change improves the caching logic to handle mismatched
> simple patterns with the same count, and adds a unit test that
> emulates different sample patterns observed on real hardware.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2111423002
>
> Committed: https://skia.googlesource.com/skia/+/09d49a3bfe2d1e652a648ce1ea0962b38d10d166

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

Review-Url: https://codereview.chromium.org/2120403002
2016-07-04 17:45:06 -07:00
csmartdalton
09d49a3bfe Fix caching of sample locations
The original caching logic for sample locations wishfully assumed that
the GPU would always use the same sample pattern for render targets
that had the same number of samples. It turns out we can't rely on
that. This change improves the caching logic to handle mismatched
simple patterns with the same count, and adds a unit test that
emulates different sample patterns observed on real hardware.

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

Review-Url: https://codereview.chromium.org/2111423002
2016-07-04 15:55:17 -07:00
ethannicholas
b3058bdb10 initial checkin of SkSL compiler
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1984363002
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/1984363002
2016-07-01 08:22:01 -07:00
egdaniel
37535c9ece Add discard support to Vulkan
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2104353002

Review-Url: https://codereview.chromium.org/2104353002
2016-06-30 08:23:30 -07:00
reed
47df89ebfd speed up maprect for scale+trans case
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2111703002

Review-Url: https://codereview.chromium.org/2111703002
2016-06-30 06:38:54 -07:00
caryclark
aa7ceb62b5 fix another pathops fuzz bug
Tunnel out the error case when the numerics
create uncalculable angles.

R=mmoroz@chromium.org
TBR=reed@google.com
BUG=624351
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2103863005

Review-Url: https://codereview.chromium.org/2103863005
2016-06-29 10:46:08 -07:00
caryclark
343382e3ac fix fuzz test that exceeds numeric limit
The extreme values here exceed an internal test that expects
computed numbers to be less than MAX_FLT. Use MAX_DBL instead.

R=mmoroz@chromium.org
TBR=reed@google.com
BUG=624346
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2103903004

Review-Url: https://codereview.chromium.org/2103903004
2016-06-29 08:18:38 -07:00
bsalomon
0a0f67ecec Make lines a special case in GrShape
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2108523002

Committed: https://skia.googlesource.com/skia/+/c62318c748a1907649bd75382c4f4fd10533f2b3
Review-Url: https://codereview.chromium.org/2108523002
2016-06-28 11:56:42 -07:00
bsalomon
635df95a9a Revert of Make lines a special case in GrShape (patchset #5 id:120001 of https://codereview.chromium.org/2108523002/ )
Reason for revert:
Assertion failures

Original issue's description:
> Make lines a special case in GrShape
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2108523002
>
> Committed: https://skia.googlesource.com/skia/+/c62318c748a1907649bd75382c4f4fd10533f2b3

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

Review-Url: https://codereview.chromium.org/2109613003
2016-06-28 11:18:47 -07:00
bsalomon
c62318c748 Make lines a special case in GrShape
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2108523002

Review-Url: https://codereview.chromium.org/2108523002
2016-06-28 10:41:35 -07:00
caryclark
3f0753d3ec fix fuzz bugs
Detect more places where the pathops numerics cause numbers
to become nearly identical and subsequently fail. These tests
have extreme inputs and cannot succeed.

Also remove the expectSuccess parameter from PathOpsDebug
and check instead in the test framework.

R=mbarbella@chromium.org
TBR=reed@google.com
BUG=623072,623022
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2103513002

Review-Url: https://codereview.chromium.org/2103513002
2016-06-28 09:23:57 -07:00
egdaniel
ab527a5bbf Enable many more tests for Vulkan
BUG=skia:5461
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2103133002

Review-Url: https://codereview.chromium.org/2103133002
2016-06-28 08:07:26 -07:00
egdaniel
88e8aef391 Fix Vulkan readPixels
Fixed bug with setting up tempReadTexture from previous CL.

Also, previously we were not correctly handling the rowBytes during the read.

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

Review-Url: https://codereview.chromium.org/2102633003
2016-06-27 14:34:55 -07:00
egdaniel
4583ec51d9 Add support for draws in vulkan read and write pixels
GL has a lot more optimizations checks here to make sure we do the most
effecient and correct draw here, but for now as long as the features
are support we just do basic draws for both reads and writes when we
need certain conversions.

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

Review-Url: https://codereview.chromium.org/2105433002
2016-06-27 12:57:00 -07:00
egdaniel
b05df0ff26 Fix check for maxVertexAttributes in GrVkPipeline
BUG=skia:5461
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2098933002

Review-Url: https://codereview.chromium.org/2098933002
2016-06-27 07:15:20 -07:00
reed
a84d6606f5 remove experimental treat-skcolor-as-srgb flag
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2097003003

Review-Url: https://codereview.chromium.org/2097003003
2016-06-24 18:14:07 -07:00
bsalomon
8acedde597 Use GrShape in GrPathRenderer.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2081383006

Review-Url: https://codereview.chromium.org/2081383006
2016-06-24 10:42:16 -07:00
egdaniel
0a3a7f7303 Have gpu createTestingOlyBackendTexture know if it is a render target or not
In Vulkan we need to know at create time of a texture whether or not we will
use it as a render target.

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

Review-Url: https://codereview.chromium.org/2093943002
2016-06-24 09:22:31 -07:00
brianosman
e074d1fa6a Change SkColor4f to RGBA channel order
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2093763003

Review-Url: https://codereview.chromium.org/2093763003
2016-06-24 06:31:47 -07:00
egdaniel
3fe0aabac1 Fix vulkan warning in RecordReplaceDrawTest
Vulkan debug layers complain that when we call readPixels on the texture
we are copying unitialized data from the image to a buffer.

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

Review-Url: https://codereview.chromium.org/2091823005
2016-06-23 15:06:29 -07:00
halcanary
ee41b7556d SkPDF: alloc less memory for strings
before:
        micros   	bench
        250.98  	WritePDFText	nonrendering
    after:
        micros   	bench
        107.10  	WritePDFText	nonrendering

Also, be slightly more space-efficient in encoding strings.

Also, add a bench.

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

Review-Url: https://codereview.chromium.org/2099463002
2016-06-23 14:08:11 -07:00
robertphillips
28a838e532 Move GrPipelineBuilder out of gms & reduce use of GrPipelineBuilder.h
Just another step in reining in the GrPLB

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

Review-Url: https://codereview.chromium.org/2086293006
2016-06-23 14:07:00 -07:00
bsalomon
425c27fab9 Add some more getters to GrShape.
These will be used to deploy GrShape in GrPathRenderer subclasses.

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

Review-Url: https://codereview.chromium.org/2070643002
2016-06-23 13:18:45 -07:00
csmartdalton
d0e402f999 Make container classes in SkTemplates.h more consistent
Ensures that ".get()" always returns null when a container is empty.
Also ensures consistent assert behavior for array counts.

There are still differences in that the malloc variants take a size_t
and the arrays take an int, and that SkAutoSTMalloc defaults to the
stack-allocated buffer wheras the other containers default to null.

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

Review-Url: https://codereview.chromium.org/2084213003
2016-06-23 12:55:14 -07:00
msarett
4d602144a9 Revert of Potential fix for flaky TSAN (patchset #1 id:1 of https://codereview.chromium.org/2084243003/ )
Reason for revert:
I believe I've fixed SkMatrix44::I() to be thread safe, let's test it by reverting this CL.

Original issue's description:
> Potential fix for flaky TSAN
>
> TBR=mtklein@google.com
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2084243003
>
> Committed: https://skia.googlesource.com/skia/+/949999d0bbc247906995358a90c4e436e9152de2

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

Review-Url: https://codereview.chromium.org/2091573004
2016-06-23 12:48:44 -07:00
msarett
c1a3e24918 SkMatrix44 clarifications and clean-ups
Fixed row/col major bug and added comments to the
header.

Made SkMatrix::I() thread safe using constexpr.

Added a test set3x3RowMajorf().

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

Review-Url: https://codereview.chromium.org/2098583002
2016-06-23 12:42:29 -07:00
bsalomon
ac5fcea9c3 Fix Rob's nits from https://codereview.chromium.org/2085913003
TBR=robertphillips@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2087393003

Review-Url: https://codereview.chromium.org/2087393003
2016-06-23 12:23:07 -07:00
bsalomon
a4817afe50 Canonicalize path fill types for stroked paths in GrShape.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2085913003

Review-Url: https://codereview.chromium.org/2085913003
2016-06-23 11:48:26 -07:00
egdaniel
9cb6340a62 Start using GrGpuCommandBuffer in GrDrawTarget.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2052263003

Review-Url: https://codereview.chromium.org/2078483002
2016-06-23 08:37:06 -07:00
msarett
949999d0bb Potential fix for flaky TSAN
TBR=mtklein@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2084243003

Review-Url: https://codereview.chromium.org/2084243003
2016-06-22 15:29:00 -07:00
msarett
b39067696a Use a table-based implementation of SkDefaultXform
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2084673002
CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Review-Url: https://codereview.chromium.org/2084673002
2016-06-22 14:07:48 -07:00
msarett
111a42d9ce Enable flattening and unflattening of SkColorSpace
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2085653003

Review-Url: https://codereview.chromium.org/2085653003
2016-06-22 08:18:54 -07:00
brianosman
6efeda4838 Revert of Store mipmap levels in deferred texture image (patchset #15 id:280001 of https://codereview.chromium.org/2034933003/ )
Reason for revert:
Crashes on a few different bots (including ASAN). Examples:

https://build.chromium.org/p/client.skia.android/builders/Test-Android-GCC-Nexus7-GPU-Tegra3-Arm7-Release/builds/6324
https://build.chromium.org/p/client.skia/builders/Test-iOS-Clang-iPad4-GPU-SGX554-Arm7-Debug/builds/5400
https://build.chromium.org/p/client.skia/builders/Test-Ubuntu-GCC-Golo-GPU-GT610-x86_64-Debug-ASAN/builds/3539

Original issue's description:
> Store mipmap levels in deferred texture image
>
> When creating the deferred texture image, detect if using medium / high
> quality. If so, generate and store mipmaps in the deferred texture
> image.
>
> When creating a texture from that be sure to read it back out.
>
> BUG=578304
> R=bsalomon@google.com
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2034933003
>
> Committed: https://skia.googlesource.com/skia/+/b3105190a6e02d37f1d7f07a3a8bdd368ec7f157

TBR=bsalomon@google.com,ericrk@chromium.org,cblume@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=578304

Review-Url: https://codereview.chromium.org/2083393002
2016-06-22 07:10:06 -07:00
cblume
b3105190a6 Store mipmap levels in deferred texture image
When creating the deferred texture image, detect if using medium / high
quality. If so, generate and store mipmaps in the deferred texture
image.

When creating a texture from that be sure to read it back out.

BUG=578304
R=bsalomon@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2034933003

Review-Url: https://codereview.chromium.org/2034933003
2016-06-21 13:43:13 -07:00
reed
dabe5d3780 update callers to not use SkColorProfileType
Requires https://codereview.chromium.org/2087833002/ to land first.

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

Review-Url: https://codereview.chromium.org/2086583002
2016-06-21 10:28:14 -07:00
bsalomon
93f66bc3af Apply canonicalizations to path GrShapes.
The following canonicalizations of path-backed GrShapes are added:

*convex shapes are stored with even/odd (or inv even/odd) fill.

*filled paths are closed.

*dashed paths ignore inverseness of the fill

This will improve the results of queries about the geometry that will be added in a future change.

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

Review-Url: https://codereview.chromium.org/2067283003
2016-06-21 08:35:49 -07:00
bsalomon
1b28c1adc1 Some simplifications of GrShape reductions/canonicalizations
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2064113004

Review-Url: https://codereview.chromium.org/2064113004
2016-06-20 12:28:17 -07:00
mtklein
875e13ca09 Simplify mask/clip intersection, making sure to explicitly check for an empty mask.
Previously we were only asserting the mask wasn't empty, which isn't necessarily true when we're given pathological float coordinates like +Inf or NaN.

A local run of nanobench --match text_ was not able to show this is faster or slower.

This patch fixed this first Chrome bug on my desktop, and the second is probably a dupe.
BUG=chromium:619378,chromium:613912

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

Review-Url: https://codereview.chromium.org/2073873002
2016-06-19 05:28:33 -07:00
jvanverth
6dc3af4499 Check for some potential subheap allocation failures.
Need to make sure we can allocate areas larger than our specified
subheap sizes, and deal with potential fragmentation in the main
system heap.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2072763002

Review-Url: https://codereview.chromium.org/2072763002
2016-06-16 14:05:09 -07:00
brianosman
b6095ae05b Add missing include
TBR=egdaniel@google.com

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

Review-Url: https://codereview.chromium.org/2070953002
2016-06-16 13:32:51 -07:00
brianosman
b109b8c5ec Lots of progress on switching to SkColorSpace rather than SkColorProfileType
Fixed a bunch of code in Ganesh, as well as usage of SkColorProfileType in most of our tools (DM, SampleApp, Viewer, nanobench, skiaserve, HelloWorld).

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

Committed: https://skia.googlesource.com/skia/+/6a61a875467646f8dbc37cfecf49e12d1f475170
Review-Url: https://codereview.chromium.org/2069173002
2016-06-16 13:03:24 -07:00
dvonbeck
8811e40850 Refactoring of GPU NormalMap handling out into its own class.
The purpose of this change is to refactor the handling of normal maps out of SkLightingShader, laying the groundwork to eventually allow for multiple normal sources.

What this CL includes:

- Created a new 'NormalMapFP', out of the existing normal map reading behavior in LightingFP.

- Encapsulates this new fragment processor on a new class NormalMapSource.

- Created a NormalSource abstraction that will interface with SkLightingShader.

- Adapted SkLightingShader to use the normals from its NormalSource field ON THE GPU SIDE. No changes done to the CPU side yet.

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

Committed: https://skia.googlesource.com/skia/+/87b0dd00cf9409c5fc990f5d0bb7c0df837f08da
Committed: https://skia.googlesource.com/skia/+/a7d1e2a57aef2aa4913d4380646d60bbab761318
Review-Url: https://codereview.chromium.org/2043393002
2016-06-16 12:39:25 -07:00
brianosman
ab8241880d Revert of Lots of progress switching to SkColorSpace rather than SkColorProfileType (patchset #10 id:180001 of https://codereview.chromium.org/2069173002/ )
Reason for revert:
Mac crashes in GrUploadPixmapToTexture

Original issue's description:
> Lots of progress on switching to SkColorSpace rather than SkColorProfileType
>
> Fixed a bunch of code in Ganesh, as well as usage of SkColorProfileType in most of our tools (DM, SampleApp, Viewer, nanobench, skiaserve, HelloWorld).
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2069173002
>
> Committed: https://skia.googlesource.com/skia/+/6a61a875467646f8dbc37cfecf49e12d1f475170

TBR=reed@google.com,herb@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:

Review-Url: https://codereview.chromium.org/2072813002
2016-06-16 11:41:44 -07:00
brianosman
6a61a87546 Lots of progress on switching to SkColorSpace rather than SkColorProfileType
Fixed a bunch of code in Ganesh, as well as usage of SkColorProfileType in most of our tools (DM, SampleApp, Viewer, nanobench, skiaserve, HelloWorld).

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

Review-Url: https://codereview.chromium.org/2069173002
2016-06-16 11:10:04 -07:00
msarett
dea0340cad Implement fast, correct gamma conversion for color xforms
201295.jpg on HP z620
(300x280, most common form of sRGB profile)

QCMS Xform                    0.495 ms
Skia Old Xform                0.235 ms
Skia NEW Xform                0.423 ms

Vs Old Code                   0.56x
Vs QCMS                       1.17x

So to summarize, we are now much slower than before,
but still a bit faster than QCMS.  And now we are also
far more accurate than QCMS :).

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

Review-Url: https://codereview.chromium.org/2060823003
2016-06-16 10:50:55 -07:00