Commit Graph

21425 Commits

Author SHA1 Message Date
fmalita
dc6c9bf91c Refactor 4f gradients using trait templates
Some 4f gradient housekeeping.

1) replace <DstPtrType, ColorProfile> specialization tuples with an enum covering all dest types
   (L32, S32, F16, F32)

2) group various template helpers into dest trait classes, specialized for each dest type

(2a - conflate current dst_swizzle and scale_for_dest ops into one load op)

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

Review URL: https://codereview.chromium.org/1816883002
2016-03-21 13:16:52 -07:00
halcanary
66be626f7f SkPDF: Add SkPDFCanvas to intercept some draw calls
Motivation: this simplifies implementation at the device level.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1812063002

Review URL: https://codereview.chromium.org/1812063002
2016-03-21 13:01:34 -07:00
jvanverth
ddf9835e9c Minor fixes to avoid NVPR in Vulkan and provide good GrVkGpu teardown.
BUG=skia:5097
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1818093002

Review URL: https://codereview.chromium.org/1818093002
2016-03-21 11:46:00 -07:00
caryclark
fa4c20e728 exit computeFilters if filter width is zero
The fuzzer associated with this bug triggered an assert
when building the resize filter. I can't tell if there
is a more fundemental bug here or not.

Checking for a zero-sized filter fixes the fuzzer.

R=fmalita@chromium.org
BUG=595856
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1810333002

Review URL: https://codereview.chromium.org/1810333002
2016-03-21 11:25:42 -07:00
benjaminwagner
d9dd581566 Exclude new file in Google3 build.
The new file was added in https://codereview.chromium.org/1817633002

Review URL: https://codereview.chromium.org/1823703002
2016-03-21 10:45:01 -07:00
ethannicholas
f67531f713 unified PNG encoding between SkDrawCommand and skiaserve
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1818043003

Review URL: https://codereview.chromium.org/1818043003
2016-03-21 10:19:39 -07:00
halcanary
bae235eb07 SkPDF: add drop() virtual to release resources early.
Call drop() after calling emitObject() on top-level objects.  In Debug
mode, assert that each object is emited exactly once by asserting that
emitObject is never called after drop().  Same for addResources().

To make sure that top level objects don't get deleted prematurely,
SkPDFObjNumMap takes a reference.

Motivation: save RAM.  Allow even earlier serialization with later
changes.

Also: Switch some SkTDArrays to SkTArrays.

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

Review URL: https://codereview.chromium.org/1790023003
2016-03-21 10:05:23 -07:00
mtklein
f8f90e4a85 SkNx refresh
- rearrange a bit
   - fewer macros
   - hooks for all operators
   - add left and right scalar operator overrides
   - add +=, &=, <<=, etc.
   - add SkNx_split() and SkNx_join()
   - simplify the many rsqrt() and invert() options to just what we actually use

This refactoring pointed out that our float <-> int NEON conversions are not specialized, so I've implemented them.  It seems nice that this is an error rather than silently falling back to serial code.

It's unclear to me if split/join want to be external, static methods, or non-static methods (SkNx_join(), Sk4f::Join(), x.join()).  Time will tell?

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

Review URL: https://codereview.chromium.org/1812233003
2016-03-21 10:04:46 -07:00
mtklein
04cdc4b618 Remove transitional explicit operator bool.
These should no longer be necessary. Android's STL should now
be sane.

TBR=reed
This just removes code.

Review URL: https://codereview.chromium.org/1817153002
2016-03-21 09:35:33 -07:00
bsalomon
3c481001b1 Make the debug interface a GrGLTestInterface subclass.
The debug interface subsumes the GrDebugGL singleton which allows multiple instances.

Fixes a few issues that existed before this CL (pack alignment wasn't tracked or respected, and we weren't initializing a texture id to 0 in one GM). Apparently this is not currently run on the bots.

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

Review URL: https://codereview.chromium.org/1812323002
2016-03-21 09:04:26 -07:00
borenet
423ba24cac Swarming: Ensure depot_tools is in PATH when compiling
Turns out we were "lucky" for our Linux bots which already have depot_tools in PATH. The Mac bot does have depot_tools, but it's not in PATH.  Add it in the script to ensure we can always get to it.

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

Review URL: https://codereview.chromium.org/1823653002
2016-03-21 09:02:51 -07:00
jbroman
17a652017a Make SkComposeImageFilter::onFilterImage filter the bounds given to the inner filter.
Previously, the bounds requested by the caller would be passed to both the
inner and outer filter, but since the outer filter may move pixels, this is not
necessarily sufficient to supply the pixels required by the outer filter to fill
the bounds.

Unit test included.

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

Review URL: https://codereview.chromium.org/1813373002
2016-03-21 08:38:58 -07:00
reed
b95f55510b add SK_SUPPORT_LEGACY_PATHEFFECT_PTR for google3 roll fix
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1817113002

TBR=mtklein
NOTRY=True

Review URL: https://codereview.chromium.org/1817113002
2016-03-21 08:30:19 -07:00
jbroman
127fe3e24b Correct comment to refer to SkImageFilter::kReverse_MapDirection.
kBackward_MapDirection does not exist; might as well have the comment exactly
match the valid enumerator.

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

Review URL: https://codereview.chromium.org/1820883002
2016-03-21 08:28:48 -07:00
msarett
0e6274f540 Parse icc profiles and exif orientation from jpeg markers
New resources should be fine to add since they are already
checked into chromium.

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

Review URL: https://codereview.chromium.org/1813273002
2016-03-21 08:04:40 -07:00
bungeman
85c9447d4d Add note about Chromium's use of old libstdc++ to docs.
Chromium must still build against libstdc++4.6.4, which presents limits
on at least type traits and perhaps performance.

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

Review URL: https://codereview.chromium.org/1820873002
2016-03-21 07:46:28 -07:00
jcgregorio
7b2707d538 nanobench: Reduce the total number of statistics being captured.
BUG=skia:5092
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1819863002

Review URL: https://codereview.chromium.org/1819863002
2016-03-21 07:42:59 -07:00
caryclark
fe7ada7f0d Make FreeType usable on Windows.
Add missing functionality so that pdfium can use FreeType
from Windows.

Add an empty custom font manager so pdfium can use FreeType
without any local fonts.

R=bungeman@google.com

Review URL: https://codereview.chromium.org/1817633002
2016-03-21 06:55:52 -07:00
brianosman
a635936588 sRGB support in Ganesh. Several pieces:
sRGB support now also requires GL_EXT_texture_sRGB_decode, which allows
us to disable sRGB -> Linear conversion when reading textures. This gives
us an easy way to support "legacy" L32 mode. We disable decoding based on
the pixel config of the render target. Textures can override that behavior
(specifically for format-conversion draws where we want that behavior).

Added sBGRA pixel config, which is not-really-a-format. It's just sRGBA
internally, and the external format is BGR order, so TexImage calls will
swizzle correctly. This lets us interact with sRGB raster surfaces on BGR
platforms.

Devices without sRGB support behave like they always have: conversion from
color type and profile type ignores sRGB and always returns linear pixel
configs.

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

Review URL: https://codereview.chromium.org/1789663002
2016-03-21 06:55:37 -07:00
marco.diiga
f8ee67edb8 Fix for unaligned automatic variable address in SSE routines. This used to work on linux but crashed on windows when rendering antialiased glyphs. I tracked the problem down to an alignment issue.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1817813002

Review URL: https://codereview.chromium.org/1817813002
2016-03-21 06:04:43 -07:00
halcanary
2c9c469cc9 SkPDF: metadata first
Motivation: while experimenting with serializing images immediately, I would like to keep serializing metadata first.

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

Review URL: https://codereview.chromium.org/1780463008
2016-03-20 07:07:11 -07:00
update-skps
ee0fa00427 Update SKP version
Automatic commit by the RecreateSKPs bot.

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

Review URL: https://codereview.chromium.org/1817833002
2016-03-20 01:28:13 -07:00
bungeman
4ab57e0097 Don't convert DWORD to int.
DWORD is unsigned, and might not be an int. vs2015u2 complains.

BUG=skia:4553

TBR=mtklein
This is pretty trivial and makes the vs2015 bot compile.

Review URL: https://codereview.chromium.org/1818713002
2016-03-19 15:51:05 -07:00
bungeman
68c14d9b32 Templatize SkToXXX.
Makes the checked cast in debug more correct, avoiding new
warnings in vs2015.

BUG=skia:4553

Committed: https://skia.googlesource.com/skia/+/0be9e806af72b3e029e691eef5c891c90d3fd320

Review URL: https://codereview.chromium.org/1814153003
2016-03-19 15:06:56 -07:00
fmalita
ba73ad0f3a Fix uninitialized fCurrProgramID in GrGLCreateNullInterface
TBR=bsalomon@google.com,robertphillips@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1817793002

Review URL: https://codereview.chromium.org/1817793002
2016-03-19 13:07:14 -07:00
herb
5c473bee8e Document BitmapStateAutoMapper.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1815373002

Review URL: https://codereview.chromium.org/1815373002
2016-03-19 08:46:24 -07:00
reed
e22bab9954 disable SK_SUPPORT_LEGACY_PATHEFFECT_PTR for skia builds
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1820593002

TBR=

Review URL: https://codereview.chromium.org/1820593002
2016-03-18 19:18:18 -07:00
msarett
d15750c0c7 Remove uses of SkImageDecoder from samplecode
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1812323003

Review URL: https://codereview.chromium.org/1812323003
2016-03-18 15:48:49 -07:00
msarett
07ec54d8e6 Replace uses of SkImageDecoder in src/animator
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1818563002

Review URL: https://codereview.chromium.org/1818563002
2016-03-18 15:41:00 -07:00
egdaniel
c2dc1b29ba Add DescriptorPool and set manager to GrVkProgram
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1765923002

Review URL: https://codereview.chromium.org/1765923002
2016-03-18 13:18:23 -07:00
bsalomon
56cb377c75 Fix ANGLE build
TBR=
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1814233003

Review URL: https://codereview.chromium.org/1814233003
2016-03-18 13:10:33 -07:00
egdaniel
470d77a1d7 Use dynamic state from vulkan pipelines
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1813913002

Review URL: https://codereview.chromium.org/1813913002
2016-03-18 12:50:27 -07:00
reed
58fc94e55f allow more options for shader blitprocs
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1810383004

Review URL: https://codereview.chromium.org/1810383004
2016-03-18 12:42:26 -07:00
jvanverth
d2497f35ce Enable extension support and debug layer.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1785813002
TBR=bsalomon@google.com

Review URL: https://codereview.chromium.org/1785813002
2016-03-18 12:39:05 -07:00
msarett
e820dfebbc Remove uses of SkImageDecoder from gms
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1791583002

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

Review URL: https://codereview.chromium.org/1791583002
2016-03-18 12:13:47 -07:00
bsalomon
b5a94e3e24 Store null GL context's state in interface object
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1814113002

Review URL: https://codereview.chromium.org/1814113002
2016-03-18 12:07:24 -07:00
jvanverth
fd359caf0c Implement Vulkan GrBackendObject for textures.
BUG=skia:5043
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1808263002

Review URL: https://codereview.chromium.org/1808263002
2016-03-18 11:57:24 -07:00
bungeman
89edf7a95e Revert of Templatize SkToXXX. (patchset #2 id:20001 of https://codereview.chromium.org/1814153003/ )
Reason for revert:
Chrome does not yet have std::underlying_type.

Original issue's description:
> Templatize SkToXXX.
>
> Makes the checked cast in debug more correct, avoiding new
> warnings in vs2015.
>
> BUG=skia:4553
>
> Committed: https://skia.googlesource.com/skia/+/0be9e806af72b3e029e691eef5c891c90d3fd320

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

Review URL: https://codereview.chromium.org/1820433002
2016-03-18 11:53:17 -07:00
ericrk
8bea8905e4 Propogate SkBudgeted for NewFromDeferredTextureImageData
The budgeted flag was not propogated from
NewFromDeferredTextureImageData to MakeTextureFromPixmap, resulting in
the created textures always being budgeted, even when SkBudgeted::kNo
was passed in.

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

Review URL: https://codereview.chromium.org/1809663002
2016-03-18 11:52:20 -07:00
borenet
98ed14ea05 Remove --verbose from DM on Swarming bots
TBR=mtklein
BUG=skia:4763
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1817563002

Review URL: https://codereview.chromium.org/1817563002
2016-03-18 11:27:43 -07:00
reed
a439334b6e Reland of "switch patheffects over to sk_sp (patchset #5 id:80001 of https://codereview.chromium.org/1813553005/ )"
This reverts commit f28ad89427.

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

TBR=

Review URL: https://codereview.chromium.org/1813123003
2016-03-18 11:22:57 -07:00
bungeman
0be9e806af Templatize SkToXXX.
Makes the checked cast in debug more correct, avoiding new
warnings in vs2015.

BUG=skia:4553

Review URL: https://codereview.chromium.org/1814153003
2016-03-18 11:17:56 -07:00
fmalita
3e33e6f576 Fix pessimizing move in SamplePictFile
../../samplecode/SamplePictFile.cpp:194:20: error: moving a local object in a return statement prevents copy elision [-Werror,-Wpessimizing-move]
            return std::move(pic);
                               ^

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

Review URL: https://codereview.chromium.org/1809943005
2016-03-18 11:07:50 -07:00
mtklein
dbd94e2bb2 custom ssse3 srcover_n_srgb_bw, about 1.8x speedup
This is a little demo of the sorts of speedups we can get from working in planar format, or even just a mini-planar of 4 pixels at a time like I'm doing here.

I chose this blit by running
  $ out/Release/nanobench --config srgb --match skp
and looking for the hottest sRGB-related method.
After this CL, src_1 and src_n become hotter than srcover_n.  They can probably get a similar treatment.

We transpose three times in this function:
   - dst after reading, as part of the zero-extension and conversion to float
   - src after reading, _MM_TRANSPOSE4_PS (which expands to 8 cheap instructions)
   - result before writing, the last _mm_shuffle_epi8
If we changed our buffer format to a mini-planar format like rrrr gggg bbbb aaaa, we could eliminate the src transpose and get another small speedup, to right around 2x.

This code leans pretty heavily on SSSE3, so if we want it to speed up Windows+Linux Chrome, it'll eventually want to go behind a function pointer.

This also appears to fix what looks like overflow in a few GMs, most noticeably in hairmodes.  This is something we'd better look into...

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

Review URL: https://codereview.chromium.org/1813263002
2016-03-18 11:07:46 -07:00
fmalita
a928b288b3 4f linear gradient shader blitters
Add F16 specializations to support writing to half-float dests.

Add color profile template arg across the board to support writing
to sRGB dests.

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

Review URL: https://codereview.chromium.org/1808963005
2016-03-18 10:28:23 -07:00
reed
f28ad89427 Revert of switch patheffects over to sk_sp (patchset #5 id:80001 of https://codereview.chromium.org/1813553005/ )
Reason for revert:
some build breaks, possibly related to paint having to know what a patheffect is

Original issue's description:
> switch patheffects over to sk_sp
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1813553005
>
> Committed: https://skia.googlesource.com/skia/+/9fbee18f691a0afed1e38a851048ce06063505ed

TBR=caryclark@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/1817543002
2016-03-18 10:17:27 -07:00
reed
9fbee18f69 switch patheffects over to sk_sp
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1813553005

Review URL: https://codereview.chromium.org/1813553005
2016-03-18 10:00:32 -07:00
borenet
1195260e22 Make Win runtime DLLs writeable before overwriting
This should fix the VS2015 bot which is failing because we can't
overwrite read-only DLL files.

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

Review URL: https://codereview.chromium.org/1813233002
2016-03-18 08:33:38 -07:00
robertphillips
83c17fa56b Add SkSpecialImage::makeTextureImage entry point
This is calved off of: https://codereview.chromium.org/1785643003 (Switch SkBlurImageFilter over to new onFilterImage interface)

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

Committed: https://skia.googlesource.com/skia/+/05849018c85403a34b88819db1c4bcf713b70a2b

Review URL: https://codereview.chromium.org/1813813002
2016-03-18 08:14:27 -07:00
mtklein
2b1b40e11a Clean up SSSE3 and SSE4 stubs.
We added these stubs to work around OpenBSD's old compiler, which had
support for SSE2 but not SSSE3 or SSE4.

We now already have other unstubbed files that require SSSE3 and SSE4 compiler
support.  All the compilers we support have SSSE3 and SSE4 support, and all the
way up to at least AVX2.

(Requiring C++11 has had some nice ripple effects...)

And, <immintrin.h> is already auto-included for these files, so no need for smmintrin or tmmintrin.

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

Review URL: https://codereview.chromium.org/1810183003
2016-03-18 08:10:31 -07:00