Commit Graph

2444 Commits

Author SHA1 Message Date
djsollen
4c5cd7d527 Consolidate SK_CRASH and sk_throw into SK_ABORT
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1610823002

Review URL: https://codereview.chromium.org/1610823002
2016-01-22 06:04:55 -08:00
bungeman
f6c7107d03 Expose API for gx font variation axes.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1590223003

Review URL: https://codereview.chromium.org/1590223003
2016-01-21 14:17:47 -08:00
senorblanco
00502373c8 Fix bounds computations for SkDisplacementMapEffect with negative scale.
BUG=skia:4835
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1616663003

Review URL: https://codereview.chromium.org/1616663003
2016-01-21 09:55:47 -08:00
caryclark
1a7eb26664 resolution dependent path measure
When a dash is drawn through a canvas with a scaled up
matrix, path measure needs the pixel resolution through
the matrix to construct the dash with sufficient
resolution.

Pass the resolution through to path measure.

Replicate chrome bug in skia GM.

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

Review URL: https://codereview.chromium.org/1608353002
2016-01-21 07:07:02 -08:00
bsalomon
dfe3e50522 Make colorimagefilter GM not crash when resource path not specified
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1619723002
BUG=skia:

Review URL: https://codereview.chromium.org/1619723002
2016-01-21 06:44:09 -08:00
caryclark
2b39ffc9d2 add arc circle gap gm
The circle and arc don't line up because
the circle uses conics and arc uses
quadratics.

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

Review URL: https://codereview.chromium.org/1606263002
2016-01-20 07:46:05 -08:00
bsalomon
e179a9167f Texturing support for RECTANGLE textures.
Uses textureSize() to unnormalize texture coords when reading from a RECTANGLE texture. Because of this we also require a later GLSL version to use rectangle textures (1.40).

Note that this causes a issue with the bicubic effect. The texture coords seem to have poor precision and the result is ugly. textureSize() is intended as a workaround until effects can be updated to handle unnormalized coords themselves.

Updates places where we were looking for OpenGL version 3.2 for rectangle support. It was actually added in 3.1.

BUG=skia:3868

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

Review URL: https://codereview.chromium.org/1594483003
2016-01-20 06:18:10 -08:00
senorblanco
1ea67a31c5 Fix SkAlphaThresholdFilter bounds handling.
SkAlphaThresholdFilter was always allocating a mask texture
of the same size as the source texture. In addition to
potentially wasting VRAM, this could cause the mask to be
offset from the source texture, if the resulting bounds
were a different size than the source texture.

The fix is to allocate a mask texture only as large as the
bounds, and to offset it to the bounds origin on draw.

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

Review URL: https://codereview.chromium.org/1609573002
2016-01-19 08:50:18 -08:00
caryclark
b6474dd1a5 fix circular dashing
Path measure cannot use the same code approach for quadratics
and cubics. Subdividing cubics repeatedly does not result in
subdivided t values, e.g. a quarter circle cubic divided in
half twice does not have a t value equivalent to 1/4.

Instead, always compute the cubic segment from a pair of
t values.

When finding the length of the cubic through recursive measures,
it is enough to carry the point at a given t to the next
subdivision.

(Chrome suppression has landed already.)

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

Review URL: https://codereview.chromium.org/1602153002
2016-01-19 08:07:50 -08:00
reed
67b09bf6b7 use pixmaps in mipmap api
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1598803002

Review URL: https://codereview.chromium.org/1598803002
2016-01-16 18:50:35 -08:00
reed
32e0b4a34a use triangle filter for odd dimensions in mip-levels
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1592473002

Review URL: https://codereview.chromium.org/1592473002
2016-01-15 13:17:08 -08:00
reed
01dc44ae66 add GM to show miplevels for all colortypes
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1594613002

TBR=

Review URL: https://codereview.chromium.org/1594613002
2016-01-15 10:51:08 -08:00
reed
a40be09c44 expand gm to exercise miplevels and various scalers
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1574233003

TBR=

Review URL: https://codereview.chromium.org/1574233003
2016-01-14 09:11:51 -08:00
senorblanco
06d54ad09a Fix SkXfermodeImageFilter GPU fast path for differing sizes.
The GPU fast path was not doing the correct thing for input bitmaps of
differing sizes. This change brings the fast path in line with the
slow path: use the union of foreground and background bounds as bounds,
offset the draw context by the bounds translation, and translate the
foreground and background independently by their respective offsets.

Finally, we add a texture domain for the background fragment
processor, since we may access texels outside its domain.

Note: this adds two new test cases to the xfermodeimagefilter GM, so
those will need to be rebaselined.

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

Review URL: https://codereview.chromium.org/1588633002
2016-01-13 13:48:54 -08:00
joshualitt
c2eff2ac77 micro fix for rrects bug using GrDrawContext
TBR=bsalomon@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1582933002

Review URL: https://codereview.chromium.org/1582933002
2016-01-13 11:23:27 -08:00
joshualitt
04194f32f4 Remove two varieties of drawNonAARect from GrDrawTarget
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1584703003

Review URL: https://codereview.chromium.org/1584703003
2016-01-13 10:08:27 -08:00
joshualitt
f5883a6d75 Hide drawBatch on GrDrawTarget from test Methods
TBR=bsalomon@google.com
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1574383002

Review URL: https://codereview.chromium.org/1574383002
2016-01-13 07:47:38 -08:00
senorblanco
a9fbd1676c Fix SkTileImageFilter when srcRect is a superset of bitmap bounds.
If the input bitmap passed to SkTileImageFilter does not fill the
srcRect, we were tiling this incorrectly (see the first sample
from tileimage filter -- it draws from a srcRect of 12,12 50x50
to a dstRect of 0,0 50x50. There should be no tiling at all
in this case!)

In order to fix this, we need to pad the bitmap out to srcRect,
and tile with that. In order to tile correctly in the GPU case,
we need to request a tileable texture.

NOTE: this will change the results of the tileimagefilter GM (correctness,
and added src / dest rects).

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

Review URL: https://codereview.chromium.org/1570133003
2016-01-11 14:09:09 -08:00
reed
0daf5dd7fc move declaration of CreateLightingFilter into SkColorMatrixFilter
BUG=skia:4791
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1574023002

Review URL: https://codereview.chromium.org/1574023002
2016-01-11 12:34:04 -08:00
reed
22471ed134 remove SkImage::applyFilter() -- unused, can always re-add later
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1573653002

Review URL: https://codereview.chromium.org/1573653002
2016-01-08 17:21:47 -08:00
ajuma
77b6ba3b6e Implement an SkPaint-based image filter
This implements SkPaintImageFilter, and is intended to replace
SkRectShaderImageFilter. By allowing a paint and not just a
shader as input, this allows consumers to control dithering.

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

Review URL: https://codereview.chromium.org/1556553002
2016-01-08 14:58:35 -08:00
herb
b10fe4941b Remove work from constructors to facilitate debugging.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1562093002

Review URL: https://codereview.chromium.org/1562093002
2016-01-08 13:48:43 -08:00
reed
57fa241d6f don't leak test filters and shaders
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1568173002

TBR=

Review URL: https://codereview.chromium.org/1568173002
2016-01-07 17:56:33 -08:00
reed
3061af4a5f add SkShader::newWithColorFilter
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1556693003

Review URL: https://codereview.chromium.org/1562193002
2016-01-07 15:47:29 -08:00
reed
bfd5f171e6 Revert[2] of "add backdrop option to SaveLayerRec"
Reverted because of picture/serialization failure

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

TBR=mtklein

Review URL: https://codereview.chromium.org/1567063002
2016-01-07 11:28:08 -08:00
reed
0575cb2def Revert of add backdrop option to SaveLayerRec (patchset #14 id:260001 of https://codereview.chromium.org/1523053003/ )
Reason for revert:
serialized != direct, will investigate

Original issue's description:
> add backdrop option to SaveLayerRec
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1523053003
>
> Committed: https://skia.googlesource.com/skia/+/247415969a9a5ed6c83cc09395472416c4b7de7f

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

Review URL: https://codereview.chromium.org/1565203002
2016-01-07 08:15:10 -08:00
reed
247415969a add backdrop option to SaveLayerRec
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1523053003

Review URL: https://codereview.chromium.org/1523053003
2016-01-07 07:44:35 -08:00
djsollen
19aa2b0867 Fix crash when ETC1 codec is not supported.
BUG=skia:4216
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1567893002

Review URL: https://codereview.chromium.org/1567893002
2016-01-07 07:22:47 -08:00
caryclark
6df611574a handle halfway case in scan converter
Scan edges that start at exactly -0.5 aren't trimmed by
clipping or by rounding, triggering a debug assert.

One way to fix this is to round the top and left
down instead of up.

Also, move the path initialization of gm/composeshader.cpp
to make debugging other path problems easier.

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

Review URL: https://codereview.chromium.org/1544873002
2016-01-04 14:17:47 -08:00
reed
f880e45e92 change factory to method, to parallel pattern in imagefilters. no functionality change.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1553743002

TBR=

Review URL: https://codereview.chromium.org/1553743002
2015-12-30 13:39:41 -08:00
mtklein
636270245f initialize offscreen in StrokeZeroGM
Valgrind's complaining that we're drawing uninitialized source pixels
from that offscreen via drawBitmap():
https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Valgrind/builds/736/steps/dm/logs/stdio

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

Review URL: https://codereview.chromium.org/1546363002
2015-12-28 11:15:46 -08:00
reed
48eb08a790 remove unused SkAutoROCanvasPixels
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1550583002

TBR=

Review URL: https://codereview.chromium.org/1550583002
2015-12-25 12:56:03 -08:00
caryclark
c53b82ec0e revised strokerect gm
In service of the bug below, revise the gm to show what zero
widths draw, and what they should draw (by including rects
with fractionally tiny widths).

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

Review URL: https://codereview.chromium.org/1548643002
2015-12-22 07:50:16 -08:00
caryclark
40b7d3b48b fix hair fuzz
If the end and control points of a quad, conic, or cubic are the same,
adjust all of them when stretching the curve to account for a square
or round end cap. If all of the points are the same, move all but the
last.

Enlarge the clip check to account for the cap.

The clip bug was detected by ASAN.

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

Review URL: https://codereview.chromium.org/1547483003
2015-12-22 06:13:33 -08:00
reed
b39f39f5cc remove unused SkCullPoints
need to remove file references from chrome before landing this
https://codereview.chromium.org/1547603002#

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

TBR=scroggo

Review URL: https://codereview.chromium.org/1541933004
2015-12-21 18:37:16 -08:00
reed
5e1ddb1086 Reland of change all factories to return their base-class (patchset #1 id:1 of https://codereview.chromium.org/1540203002/ )
Reason for revert:
chrome changes have landed

Original issue's description:
> Revert of change all factories to return their base-class (patchset #1 id:1 of https://codereview.chromium.org/1535353002/ )
>
> Reason for revert:
> need to update some chrome/blink call-sites
>
> Original issue's description:
> > change all factories to return their base-class
> >
> > will watch DEPS roll to see if there are chrome sites needing updates
> >
> > BUG=skia:
> > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1535353002
> >
> > TBR=
> >
> > Committed: https://skia.googlesource.com/skia/+/d63f60a36327e9580861205ebb35cade8c49bd34
>
> TBR=
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/2d6ba6690f8951e152d8e793191b14afd52f5506

TBR=
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1533373002
2015-12-21 08:52:45 -08:00
caryclark
fb56218292 fix stroked text underline / strikethrough
Pass 1 to DrawRect for underline and strikethrough since it will
scale by the text size later.

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

Review URL: https://codereview.chromium.org/1535793004
2015-12-21 08:35:51 -08:00
reed
2d6ba6690f Revert of change all factories to return their base-class (patchset #1 id:1 of https://codereview.chromium.org/1535353002/ )
Reason for revert:
need to update some chrome/blink call-sites

Original issue's description:
> change all factories to return their base-class
>
> will watch DEPS roll to see if there are chrome sites needing updates
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1535353002
>
> TBR=
>
> Committed: https://skia.googlesource.com/skia/+/d63f60a36327e9580861205ebb35cade8c49bd34

TBR=
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1540203002
2015-12-20 20:08:43 -08:00
reed
d63f60a363 change all factories to return their base-class
will watch DEPS roll to see if there are chrome sites needing updates

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

TBR=

Review URL: https://codereview.chromium.org/1535353002
2015-12-20 19:38:20 -08:00
caryclark
f97aa74fea fix large dashed paths
Paths with lots of points exceed the 32767 point index.
Make the index larger, add a test, and allow the
t value to use the extra bits.

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

Review URL: https://codereview.chromium.org/1534223002
2015-12-18 07:03:13 -08:00
robertphillips
e80eb928ba Add default ctor to SkMask
The minimal fix here seems to be handling BoxBlur's return value in SkBlurMaskFilter.cpp::GrRRectBlurEffect::Create. We seem to do enough special handling of the fImage field though that always initialializing it may not be a bad idea.

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

Review URL: https://codereview.chromium.org/1539553002
2015-12-17 11:33:12 -08:00
ethannicholas
3819d2d767 Added concave paths to aaxfermodes GM
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1534823004

Review URL: https://codereview.chromium.org/1534823004
2015-12-17 10:58:28 -08:00
senorblanco
c834ab178e Fix gaussian blur for small sigma.
I broke this in https://skia.googlesource.com/skia/+/c57e0ded7d535523cfc6bf07c78e5f3479bb8c42.
That change added support for cropping during blur, but
did not do the correct thing for the small-sigma 2D matrix convolution
optimization when blurring from small-to-large textures.

The fix is pass the correct dstRect and srcOffset to convolve_gaussian_2d.
I also changed convolve_gaussian_1d() and convolve_gaussian_2d() to take
the original (non-negated) srcOffset, and to negate them when constructing
the local matrix.

Test: added a new (blur 0.3 0.3) column to imagefilterscropexpand, so that
GM will have to be rebaselined.

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

Review URL: https://codereview.chromium.org/1529313003
2015-12-17 08:10:17 -08:00
caryclark
1f17ab5992 This brings hairlines into agreement with thick strokes.
Add more testing and a pixel magnification to GM.

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

Review URL: https://codereview.chromium.org/1527083002
2015-12-16 08:53:41 -08:00
reed
da420b976e Reland of move drawSprite from canvas (patchset #1 id:1 of https://codereview.chromium.org/1529803004/ )
Reason for revert:
guard has landed in chrome

Original issue's description:
> Revert of remove drawSprite from canvas (patchset #4 id:60001 of https://codereview.chromium.org/1534443003/ )
>
> Reason for revert:
> need to remove an override in chrome
>
> Original issue's description:
> > remove drawSprite from canvas
> >
> > BUG=skia:
> >
> > Committed: https://skia.googlesource.com/skia/+/4657ce2324ea197507c4ba728d81138f56da13b1
>
> TBR=fmalita@chromium.org,robertphillips@google.com,senorblanco@chromium.org,mtklein@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/32704674f64cb6a14356dfebe060cd3484c06cc7

TBR=fmalita@chromium.org,robertphillips@google.com,senorblanco@chromium.org,mtklein@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1530203002
2015-12-16 08:38:16 -08:00
reed
32704674f6 Revert of remove drawSprite from canvas (patchset #4 id:60001 of https://codereview.chromium.org/1534443003/ )
Reason for revert:
need to remove an override in chrome

Original issue's description:
> remove drawSprite from canvas
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/4657ce2324ea197507c4ba728d81138f56da13b1

TBR=fmalita@chromium.org,robertphillips@google.com,senorblanco@chromium.org,mtklein@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1529803004
2015-12-16 08:27:10 -08:00
reed
4657ce2324 remove drawSprite from canvas
BUG=skia:

Review URL: https://codereview.chromium.org/1534443003
2015-12-16 07:52:47 -08:00
fmalita
aed4d32de9 SkBitmapProcState rounding bias
Epsilon bias to keep bitmap sample rounding consistent with geometry
rounding.

Also update the GM to draw an outer border + drop uninteresting
scales in favor of negative scale variants.

BUG=skia:4680,skia:4649
R=reed@google.com,caryclark@google.com,mtklein@google.com

Review URL: https://codereview.chromium.org/1527633002
2015-12-15 06:48:48 -08:00
fmalita
cad54b5366 New GM: image_scale_aligned
To verify alignment for various image scaling modes.

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

Review URL: https://codereview.chromium.org/1514923002
2015-12-11 11:03:27 -08:00
reed
70ee31b2fa try adding flag to allow lcd text even in a layer
BUG=skia:

Review URL: https://codereview.chromium.org/1513513002
2015-12-10 13:44:45 -08:00
scroggo
96f16e835e Use DEF_GM everywhere
BUG=skia:1902

Review URL: https://codereview.chromium.org/1518893002
2015-12-10 13:31:59 -08:00
robertphillips
4e56772432 Address precision issue in circle blur effect
BUG=560651

Review URL: https://codereview.chromium.org/1504333003
2015-12-10 13:29:14 -08:00
xidachen
467ddc0b24 SkBlurImageFilter returns input when sigma = 0
In the current implementation, a blur filter is always created even in the
case when sigma.fX == 0 && sigma.fY == 0. This CL makes the blur filter
return input in this case.

BUG=568393

Review URL: https://codereview.chromium.org/1518643002
2015-12-10 12:08:44 -08:00
scroggo
565901db95 Switch SkAutoMalloc to SkAutoTMalloc to avoid cast
Make SkAutoTMalloc's interface look more like SkAutoMalloc:
- add free(), which does what you expect
- make reset() return a pointer fPtr

No public API changes (SkAutoTMalloc is in include/private)

BUG=skia:2148

Review URL: https://codereview.chromium.org/1516833003
2015-12-10 10:44:13 -08:00
halcanary
e36ec87176 SkBitmap::installPixels(const SkPixmap&);
Review URL: https://codereview.chromium.org/1505333002
2015-12-09 11:36:59 -08:00
bsalomon
4a4f14ba3f Split big rrect aa effect up into separate images
Needed to enlarge radii to surface bugs without exceeding max texture size on low end devices.

BUG=chromium:477684

Review URL: https://codereview.chromium.org/1508003008
2015-12-09 10:17:35 -08:00
caryclark
57eecc154e Zero length lines may have caps, but do not need joins.
Check to see if the point is preceeded or followed
by a line with a computable tangent before adding the join.

R=reed@google.com
BUG=566075

Review URL: https://codereview.chromium.org/1504043002
2015-12-08 04:29:45 -08:00
senorblanco
d18b1b5adc Add SkTileImageFilter sample to filterfastbounds GM.
NOTE: will affect pixel results for filterfastbounds GM.

BUG=skia:3194

Review URL: https://codereview.chromium.org/1500373004
2015-12-07 10:36:30 -08:00
reed
f65fb65814 add gm to exercise large sigmas
BUG=skia:4437
TBR=

Review URL: https://codereview.chromium.org/1503143002
2015-12-07 09:28:34 -08:00
senorblanco
a544eda5dd Matrix convolution bounds fix; affectsTransparentBlack fixes.
Because the convolution kernel is (currently) applied in device space,
there's no way to know which object-space pixels will be touched. So
return false from canComputeFastBounds().

The results from the matrixconvolution GM were actually wrong, since
they were showing edge differences on the clip boundaries, where they
should really only show on crop boundaries. I added a crop to the GM
to keep the results the same (which are useful to test the different
convolution tile modes).

While I was at it, SkImageFilter::affectsTransparentBlack() was
inapplicable on most things except color filters, and its use on
leaf nodes was confusing. So I removed it, and made
SkImageFilter::canComputeFastBounds() virtual instead.

BUG=skia:4630

Review URL: https://codereview.chromium.org/1500923004
2015-12-07 07:48:34 -08:00
senorblanco
50c044b9ad Revert of Matrix convolution bounds fix; affectsTransparentBlack fixes. (patchset #4 id:60001 of https://codereview.chromium.org/1500923004/ )
Reason for revert:
Introduced memory leak; pixel changes in Chrome.

Original issue's description:
> Matrix convolution bounds fix; affectsTransparentBlack fixes.
>
> Because the convolution kernel is (currently) applied in device space,
> there's no way to know which object-space pixels will be touched. So
> return false from canComputeFastBounds().
>
> The results from the matrixconvolution GM were actually wrong, since
> they were showing edge differences on the clip boundaries, where they
> should really only show on crop boundaries. I added a crop to the GM
> to keep the results the same (which are useful to test the different
> convolution tile modes).
>
> While I was at it, SkImageFilter::affectsTransparentBlack() was
> inapplicable on most things except color filters, and its use on
> leaf nodes was confusing. So I removed it, and made
> SkImageFilter::canComputeFastBounds() virtual instead.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/8705ec80518ef551994b82ca5ccaeb0241d6adec

TBR=reed@google.com,reed@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1497083005
2015-12-05 05:59:41 -08:00
senorblanco
8705ec8051 Matrix convolution bounds fix; affectsTransparentBlack fixes.
Because the convolution kernel is (currently) applied in device space,
there's no way to know which object-space pixels will be touched. So
return false from canComputeFastBounds().

The results from the matrixconvolution GM were actually wrong, since
they were showing edge differences on the clip boundaries, where they
should really only show on crop boundaries. I added a crop to the GM
to keep the results the same (which are useful to test the different
convolution tile modes).

While I was at it, SkImageFilter::affectsTransparentBlack() was
inapplicable on most things except color filters, and its use on
leaf nodes was confusing. So I removed it, and made
SkImageFilter::canComputeFastBounds() virtual instead.

BUG=skia:

Review URL: https://codereview.chromium.org/1500923004
2015-12-04 13:57:31 -08:00
reed
95f53fbc5d clarify diff manually, showing black where they differ
BUG=skia:
TBR=robertphilips@google.com

Review URL: https://codereview.chromium.org/1498243002
2015-12-04 12:44:24 -08:00
caryclark
c326257a61 add hairline with caps gm
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1502613002
2015-12-04 11:08:42 -08:00
reed
7850eb2f35 API to support native scaling by image-generator
BUG=skia:

Review URL: https://codereview.chromium.org/1396323007
2015-12-02 14:19:47 -08:00
reed
0711bdbcca drawSprite and drawImage+clip should draw the same w/ an imagefilter applied. This gm exercises that invariant.
BUG=skia:

Review URL: https://codereview.chromium.org/1498523002
2015-12-02 12:58:39 -08:00
caryclark
b775e91e87 add more conservative check for wayward divide
When the parallel stroke to the curve can't be computed from
the intersection of the tangent lines, as straight line connects
the two points instead. Allow the intersection to succeed unless
the ratio isn't finite or the contribution of (1 - ratio) isn't
significant.

R=reed@google.com,fmalita@chromium.org
BUG=skia:4603

Review URL: https://codereview.chromium.org/1484873003
2015-11-30 13:47:11 -08:00
joshualitt
144c3c8b7f Make onPrepareDraws const
BUG=skia:

Review URL: https://codereview.chromium.org/1483103003
2015-11-30 12:30:13 -08:00
reed
6868c3fccf optimize the disable-caching case for SkImage::readPixels
If the client wants no caching, and we haven't already cached it, pass the
caller's dst-buffer directly down to the generator, avoiding the (previous)
extra memcpy.

BUG=skia:4594

Review URL: https://codereview.chromium.org/1473373002
2015-11-24 11:44:47 -08:00
egdaniel
c4b72720e7 Don't create a GXPFactory when blend is SrcOver
BUG=skia:

Review URL: https://codereview.chromium.org/1471053002
2015-11-23 13:20:42 -08:00
reed
095530389d scaling API on SkPixmap
BUG=skia:4481

Review URL: https://codereview.chromium.org/1463373002
2015-11-23 12:32:16 -08:00
reed
de3aac8cea use pinned value during lerp for vertical gradients
slight formatting clean up on associated gm

BUG=skia:

Review URL: https://codereview.chromium.org/1471543002
2015-11-22 13:00:04 -08:00
fmalita
8b78bd6d5b Tiny linear gradient GM
A GM to expose issues with vertical linear gradients when points
and/or positions are too close.

R=reed@google.com

Review URL: https://codereview.chromium.org/1464693002
2015-11-20 13:58:24 -08:00
fmalita
e55c312929 Parametric contour start GM
A GM to capture the newly added SkPath API.

BUG=chromium:315277
R=caryclark@google.com,reed@google.com

Review URL: https://codereview.chromium.org/1457503002
2015-11-19 09:47:12 -08:00
jvanverth
76f160c61f Shift up bottom path in smallpaths GM.
This stops it from being cut off in the image.

Review URL: https://codereview.chromium.org/1462903002
2015-11-19 07:46:07 -08:00
bsalomon
f045d600fc Make block size a template parameter of SkTLList
Review URL: https://codereview.chromium.org/1457123002
2015-11-18 19:01:12 -08:00
jvanverth
8450cc3d3d Add small paths GM
Used to testing caching and quality of distance field paths.

Review URL: https://codereview.chromium.org/1456823003
2015-11-18 13:40:15 -08:00
joshualitt
33a5fce612 Initial implementation of GPU no filter NinePatch
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1454933002
2015-11-18 13:28:51 -08:00
egdaniel
4ca2e60343 Add ShaderBuilders to EmitArgs and remove gettings from ProgBuilder.
BUG=skia:

Review URL: https://codereview.chromium.org/1457543003
2015-11-18 08:01:26 -08:00
stephana
9c08b9d3f0 Revert of Parametric contour start GM (patchset #1 id:1 of https://codereview.chromium.org/1457503002/ )
Reason for revert:
Breaks unit test across various platforms:

../../../src/gpu/batches/GrStencilAndCoverPathRenderer.cpp:75: failed assertion "path->isEqualTo(skPath, stroke)"

Original issue's description:
> Parametric contour start GM
>
> A GM to capture the newly added SkPath API.
>
> BUG=chromium:315277
> R=caryclark@google.com,reed@google.com
>
> Committed: https://skia.googlesource.com/skia/+/56847a65648af4d06da9c26c55242949a1bf31ab

TBR=caryclark@google.com,reed@google.com,fmalita@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:315277

Review URL: https://codereview.chromium.org/1456973002
2015-11-18 06:21:35 -08:00
fmalita
56847a6564 Parametric contour start GM
A GM to capture the newly added SkPath API.

BUG=chromium:315277
R=caryclark@google.com,reed@google.com

Review URL: https://codereview.chromium.org/1457503002
2015-11-17 13:15:42 -08:00
robertphillips
504ce5dc77 Optionally pass rendertarget to getTestTarget
This shouldn't really make any difference but allocating and holding on to a GrRenderTarget for each test target generates image differences for Mali GPUs. This CL allows an existing render target to be used for the test target.

TBR=bsalomon@google.com

Review URL: https://codereview.chromium.org/1447113002
2015-11-16 11:02:05 -08:00
halcanary
05b48e2a24 SkPDF: fix large-number bug
Example:
        https://fiddle.skia.org/c/db95a3f6c928017635c4f4ddf25f2a7b

BUG=skia:257

Review URL: https://codereview.chromium.org/1438503002
2015-11-16 10:51:21 -08:00
egdaniel
57d3b039c6 Rename some processor functions from GL to GLSL
TBR=bsalomon@google.com

BUG=skia:

Review URL: https://codereview.chromium.org/1443743002
2015-11-13 11:57:27 -08:00
egdaniel
64c4728c70 Make all GrFragmentProcessors GL independent.
TBR=bsalomon@google.com

BUG=skia:

Review URL: https://codereview.chromium.org/1434313002
2015-11-13 06:54:19 -08:00
reed
6b90df6b1c augment gradients_many to exercise flipped gradients and clampping
BUG=skia:
TBR=
NOTREECHECKS=True

Review URL: https://codereview.chromium.org/1442833004
2015-11-13 06:23:54 -08:00
egdaniel
2d721d33aa Move all ShaderBuilder files to GLSL
BUG=skia:

Review URL: https://codereview.chromium.org/1438003003
2015-11-11 13:06:05 -08:00
robertphillips
a13e202563 Move GrBatchFlushState from GrDrawTarget to GrDrawingManager
This CL:
  moves the flushState
  disables immediate mode (it was proving difficult to implement)
  also moves the program unit test to the drawing manager

BUG=skia:4094
TBR=bsalomon@google.com

Review URL: https://codereview.chromium.org/1437843002
2015-11-11 12:01:09 -08:00
bsalomon
091f60c2a0 Use a struct for client GL texture handles
Review URL: https://codereview.chromium.org/1429863009
2015-11-10 11:54:57 -08:00
bsalomon
5c1262d7f7 Rewrite bleed GM bmp/img generators and change oversized texture case
Makes it so that the oversized-texture/bmp case doesn't run on the CPU and makes it so that the subrect rendered is adjacent to the texture pad area on the bottom/right edges.

Review URL: https://codereview.chromium.org/1424473006
2015-11-09 10:06:06 -08:00
halcanary
6950de6c41 Comments Style: s/skbug.com/bug.skia.org/
DOCS_PREVIEW= https://skia.org/?cl=1432503003

Review URL: https://codereview.chromium.org/1432503003
2015-11-07 05:29:00 -08:00
halcanary
aa4ba90792 SkPDF: images support 32-but-not-N32 colortype
BUG=550559

Review URL: https://codereview.chromium.org/1407063005
2015-11-06 07:27:23 -08:00
bsalomon
f57ef1c05f Add outer blur to bleed GM family
Review URL: https://codereview.chromium.org/1429863007
2015-11-04 04:36:12 -08:00
bsalomon
df85a72547 change alpha bmp generator in bleed to make more discernable results
TBR=robertphillips@google.com

Review URL: https://codereview.chromium.org/1408063011
2015-11-04 04:23:45 -08:00
bsalomon
9c58654fa2 Add bleed GM variants for bmp backed by an oversized texture
Review URL: https://codereview.chromium.org/1426253002
2015-11-02 12:33:21 -08:00
bsalomon
8c07b7ab53 Allow max tile size to be overridden separately from max texture size.
This allows internal Gr texture creation code to succeed for extraneous textures while running the bleed GM. This means we can turn on the shader variants.

Review URL: https://codereview.chromium.org/1418473004
2015-11-02 11:36:52 -08:00
egdaniel
574a4c153d Move shader compiling to ProgramBuilder and various ShaderBuilder cleanups.
An additional positive of this CL is that GrGLShaderBuilder is now GL independent besides GrGLProgramBuilder

BUG=skia:

Review URL: https://codereview.chromium.org/1431433003
2015-11-02 06:22:44 -08:00
egdaniel
7dc4bd06fc Remove GrGLProcessor and create GrGLSLTextureSampler class.
Part ??? of separating glsl and gl

BUG=skia:

Review URL: https://codereview.chromium.org/1425013003
2015-10-29 07:57:02 -07:00
egdaniel
018fb62d12 Create GLSL base class for ProgramDataManager
BUG=skia:

Review URL: https://codereview.chromium.org/1428543003
2015-10-28 07:26:40 -07:00
caryclark
950305ec77 fix for teeny strokes
Pass the scale before evaluating degenerate line segments.

This does not change other GMs.

R=reed@google.com
BUG=478337

Review URL: https://codereview.chromium.org/1418133007
2015-10-26 08:17:04 -07:00
bsalomon
9003d1e738 Add more cases to bleed GM and more variants
Review URL: https://codereview.chromium.org/1423793002
2015-10-23 11:13:01 -07:00
caryclark
0bccd8749b Revert of Update feSpotLight to match spec (patchset #2 id:20001 of https://codereview.chromium.org/1403403003/ )
Reason for revert:
re-land once layout test have been disabled (so they can be rebased)

Original issue's description:
> Update feSpotLight to match spec
>
> This change updates feSpotLight to match the spec via two changes:
>
> 1) specularExponent is ignored if the spotlight has no coneAngle (GPU
>    bug only). This change updates the GPU path so that it matches the
>    CPU path and the spec in this regard.
>
> 2) specularExponent is clamped to the 1-128 range. The spec does not
>    specify a clamp for the specularExponent attribute of feSpotLight.
>    Note that the spec *does* specify this clamp for the
>    specularExponent attribute of feSpecularLighting. It looks like we
>    incorrectly applied this to both specularExponent attributes.
>
>    This change (along with a parallel change in Blink) allows us to pass
>    the SVG filter effects conformance test here:
>    http://www.w3.org/Graphics/SVG/Test/20110816/harness/htmlObject/filters-light-01-f.html
>
>    Additionally, this brings our behavior in line with Safari and Edge’s
>    behavior on this filter.
>
> Two new cases were added to gm/lighting.cpp to catch these issues:
> - The existing spotlight case exercised the path where our specular
>   exponent was between 1-128 and had a limiting cone angle.
> - The first new spotlight case exercises the path where our specular
>   exponent is between 1-128 and we do not have a limiting cone angle.
> - The second new spotlight case exercises the path where the specular
>   exponent is not within the 1-128 range, to ensure that we don’t
>   incorrectly clip to this range.
>
> BUG=472849
>
> Committed: https://skia.googlesource.com/skia/+/c84ccb070258db2803a9e8f532bfe7239a737063

TBR=senorblanco@google.com,senorblanco@chromium.org,bsalomon@google.com,ericrk@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=472849

Review URL: https://codereview.chromium.org/1417463006
2015-10-20 10:04:03 -07:00
ericrk
c84ccb0702 Update feSpotLight to match spec
This change updates feSpotLight to match the spec via two changes:

1) specularExponent is ignored if the spotlight has no coneAngle (GPU
   bug only). This change updates the GPU path so that it matches the
   CPU path and the spec in this regard.

2) specularExponent is clamped to the 1-128 range. The spec does not
   specify a clamp for the specularExponent attribute of feSpotLight.
   Note that the spec *does* specify this clamp for the
   specularExponent attribute of feSpecularLighting. It looks like we
   incorrectly applied this to both specularExponent attributes.

   This change (along with a parallel change in Blink) allows us to pass
   the SVG filter effects conformance test here:
   http://www.w3.org/Graphics/SVG/Test/20110816/harness/htmlObject/filters-light-01-f.html

   Additionally, this brings our behavior in line with Safari and Edge’s
   behavior on this filter.

Two new cases were added to gm/lighting.cpp to catch these issues:
- The existing spotlight case exercised the path where our specular
  exponent was between 1-128 and had a limiting cone angle.
- The first new spotlight case exercises the path where our specular
  exponent is between 1-128 and we do not have a limiting cone angle.
- The second new spotlight case exercises the path where the specular
  exponent is not within the 1-128 range, to ensure that we don’t
  incorrectly clip to this range.

BUG=472849

Review URL: https://codereview.chromium.org/1403403003
2015-10-19 14:44:56 -07:00
ericrk
af96fce879 The SkArithmeticMode_gpu GL filters support clamping to valid
premultiplied colors, however the flag for whether or not to do this,
which is present in their parent filters, is dropped when creating the
GL implementations. This change adds logic to forward the value from
the parent filter to the GL implementation.

This makes GPU behavior match software and fixes a WebKit
LayoutTest. See referenced bug.

BUG=473186

Review URL: https://codereview.chromium.org/1410553002
2015-10-19 14:41:11 -07:00
reed
59dc0d22f5 change SkImage_Gpu to handle all filters (w/ and w/o gpu support
The result is that the set of "generic" imagefilters (e.g. SkColorFilterImageFilter) that use drawing commands to return their results will now stay in the same domain as their src (i.e. gpu-src --> gpu-dst).

ApplyFilterGM exercises this, and now asserts this same-domain invariant.

BUG=skia:4467

Review URL: https://codereview.chromium.org/1401053003
2015-10-19 08:24:21 -07:00
senorblanco
b9519f86bb Image Filters: refactor all CPU input processing into a filterInput helper function.
No change in behaviour; this is a straight refactoring.

BUG=skia:3194

Review URL: https://codereview.chromium.org/1404743005
2015-10-15 12:15:13 -07:00
bsalomon
5f5527fb46 Remove params from Cacherator_GrTextureMaker
Review URL: https://codereview.chromium.org/1403313003
2015-10-15 12:14:55 -07:00
robertphillips
2e1e51f049 GrDrawContext now holds GrRenderTarget pointer
Review URL: https://codereview.chromium.org/1404823005
2015-10-15 08:01:49 -07:00
reed
94dd7a52d3 change back to method for localmatrix imagefilter
This method is different from MatrixFilter, in that MatrixFilter does not require a pre-existing
filter, but LocalM does. Also change the comment to be more general, as there is no promise that
we return a different subclass, and certainly not a specific subclass.

This pattern of obj->newWithModifiers() also more closely matches the pattern in SkImage (newSubset).

BUG=skia:

Review URL: https://codereview.chromium.org/1402133002
2015-10-14 07:49:35 -07:00
senorblanco
20311d4843 Implement SkLocalMatrixImageFilter.
At draw time, this filter simply concatenates the given matrix to the
CTM, and recurses on its input. The matrix is thus applied to any
upstream filter parameters and crop rects.

BUG=skia:

Review URL: https://codereview.chromium.org/1392833005
2015-10-14 04:53:31 -07:00
reed
c837d8f372 adjust size of new apply-filter gm
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1395303003
2015-10-12 14:38:34 -07:00
halcanary
66a82f3872 SkPDF: fall back on paths for unembeddable fonts.
Add GM, SkPDFFont::CanEmbedTypeface

BUG=skia:3866

Review URL: https://codereview.chromium.org/1401763002
2015-10-12 13:05:04 -07:00
reed
88d064d0e4 add applyFilter() to SkImage
Result:
- clients can get a filtered version of an image without having to setup a temp drawing environment
- for some cases, the process is more efficient even than (deprecated) drawSprite, since there is no need to draw/copy the result

Impl:
- made Proxy virtual so we don't need to have an existing device to use it

This, in conjunction with LocalMatrixImageFilter, should allow us to simplify and optimize ApplyImageFilter() in cc/output/gl_renderer.cc

BUG=skia:

Review URL: https://codereview.chromium.org/1390913005
2015-10-12 11:30:02 -07:00
fmalita
063675ba37 Remove SK_SUPPORT_LEGACY_GRADIENT_DITHERING from Skia proper
Migrating the flag to embedder defines (Chromium already guarded).

Also augment gradient-focused GMs to generate both dithered/undithered
results.

BUG=skia:4436
R=reed@google.com,robertphillips@google.com

Review URL: https://codereview.chromium.org/1400813006
2015-10-12 10:41:48 -07:00
bsalomon
afa95e270c Remove image usage type enum. Use GrTextureParams instead.
BUG=skia:

Review URL: https://codereview.chromium.org/1404433002
2015-10-12 10:39:46 -07:00
bsalomon
0ba8c2401e Insert clip fragment processor outside GrCMM
Review URL: https://codereview.chromium.org/1393553002
2015-10-07 09:20:28 -07:00
reed
5ea95df02d Revert "Revert of factories should return baseclass, allowing the impl to specialize (patchset #4 id:60001 of https://codereview.chromium.org/1390523005/ )"
This reverts commit 95376a0dde.

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1389083002
2015-10-06 14:05:32 -07:00
schenney
95376a0dde Revert of factories should return baseclass, allowing the impl to specialize (patchset #4 id:60001 of https://codereview.chromium.org/1390523005/ )
Reason for revert:
Breaks Chrome with this link error: ../../third_party/skia/include/effects/SkMorphologyImageFilter.h:75: error: undefined reference to 'SkMorphologyImageFilter::SkMorphologyImageFilter(int, int, SkImageFilter*, SkImageFilter::CropRect const*)'
../../third_party/skia/include/effects/SkMorphologyImageFilter.h:104: error: undefined reference to 'SkMorphologyImageFilter::SkMorphologyImageFilter(int, int, SkImageFilter*, SkImageFilter::CropRect const*)'

Presumably due to code in third_party/WebKit/Source/platform/graphics/filters/FEMorphology.cpp that contains:
#include "SkMorphologyImageFilter.h"

...

    if (m_type == FEMORPHOLOGY_OPERATOR_DILATE)
        return adoptRef(SkDilateImageFilter::Create(radiusX, radiusY, input.get(), &rect));
    return adoptRef(SkErodeImageFilter::Create(radiusX, radiusY, input.get(), &rect));

Original issue's description:
> factories should return baseclass, allowing the impl to specialize
>
> waiting on https://codereview.chromium.org/1386163002/# to land
>
> BUG=skia:4424
>
> Committed: https://skia.googlesource.com/skia/+/80a6dcaa1b757826ed7414f64b035d512d9ccbf8

TBR=senorblanco@google.com,robertphillips@google.com,reed@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:4424

Review URL: https://codereview.chromium.org/1389063002
2015-10-06 12:59:55 -07:00
reed
80a6dcaa1b factories should return baseclass, allowing the impl to specialize
waiting on https://codereview.chromium.org/1386163002/# to land

BUG=skia:4424

Review URL: https://codereview.chromium.org/1390523005
2015-10-06 11:12:23 -07:00
halcanary
8b2bc252fa SkPDF: when drawing stroked path, draw using SVG rules for zero-length segments
The "zeroPath" and emptystroke GMs capture this issue.

This CL changes the following PDF GMs: emptystroke dashing4
lineclosepath dashing3 zeroPath linepath
complexclip3_complex complexclip3_simple roundrects
degeneratesegments filltypes strokerect pathfill
inverse_paths desk_chalkboard.skp

After this change, all PDF GMs look better (closer to 8888).
The dashing4, emptystroke, and zeroPath GMs still need a lot
of work to make them look right.

BUG=538726

Review URL: https://codereview.chromium.org/1374383004
2015-10-06 09:41:47 -07:00
bsalomon
4a33952961 Bye bye processor data manager.
Review URL: https://codereview.chromium.org/1388113002
2015-10-06 08:40:51 -07:00
egdaniel
c00389e45a Fix gpu dashing for case where all intervals are 0.
BUG=skia:4409

Review URL: https://codereview.chromium.org/1381803005
2015-10-05 08:11:49 -07:00
halcanary
7a14b310d6 SkPDF: Implement drawImage*() properly
drawImage calls now properly embeds the original jpeg.

NOTE: drawBitmap*() calls no longer embed JPEG files when
possible (this is in advance of eliminating bitmaps backed
by encoded data).  Chromium has already moved from
drawBitmap to drawImage.

Comparisons:

control:
    total PDF drawImage/drawBitmap calls: 8010
    total PDF jpeg images: 0
    total PDF regular images: 3581

experiament:
    total PDF drawImage/drawBitmap calls: 8014
    total PDF jpeg images: 271
    total PDF regular images: 3311
    total PDF regular images: 3582 (271 + 3311)

When comparing rendered output there were perceptual
differences in the following four GMs: colorcube, emboss,
colormatrix, and tablecolorfilter.  All of these differences
were improvements (that is, closer to the 8888 rendering)
due fixing a bug with colorfilters and forgetting to call
notifyPixelsChanged.

No SKPs had perceptual differences.

Total PDF size dropped from 133964 kB to 126276 kB, a 5.7%
improvement (mostly due to restoring use of JPG images in
SKPs).

BUG=skia:4370

Review URL: https://codereview.chromium.org/1372783003
2015-10-01 07:28:13 -07:00
robertphillips
05302f8f24 Handle inverted rects in SkRRect creation methods
An alternative way of addressing this is to alter SkCanvas::drawRoundRect to just reject isEmpty (i.e., un-sorted or truly empty) input rects.

BUG=skia:3786

Review URL: https://codereview.chromium.org/1373293002
2015-09-29 11:24:07 -07:00
bsalomon
f1b7a1d828 Make skpaint->grpaint flow work for composing draws (verts and atlas)
One side effect is that the SkShader's (or implicit shader's) fragment processor is responsible for the transition from an unpremul paint color to a premul color.

Review URL: https://codereview.chromium.org/1348583002
2015-09-28 06:26:29 -07:00
fmalita
2f5891ea64 Remove SkBitmapSource
To avoid breaking existing SKPs, add a deserialization stub which
unflattens SkBitmapSource records to SkImageSources.

R=reed@google.com,mtklein@google.com,robertphillips@google.com

Review URL: https://codereview.chromium.org/1363913002
2015-09-25 09:15:55 -07:00
reed
d114645d93 SkInstallDiscardablePixelRef is deprecated, enforce that
No functionality change, just a renaming.

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1372593002
2015-09-25 06:56:57 -07:00
halcanary
287d22d999 SkPDF Implement colorfilters on bitmaps
BUG=484583

Review URL: https://codereview.chromium.org/1367993002
2015-09-24 10:20:06 -07:00
robertphillips
24eb7a8ed0 Make drawbitmaprect GM use Ganesh-backed bitmaps and images
This is left over from trying to repro Android not serializing Ganesh-backed bitmaps

Review URL: https://codereview.chromium.org/1353313002
2015-09-24 08:47:49 -07:00
reed
7b6945bc4e remove unused (by the outside) SkImage::newSurface, and simplify newImage -> newSubset
BUG=skia:

Review URL: https://codereview.chromium.org/1364443002
2015-09-24 00:50:58 -07:00
halcanary
5cd406f0f6 GM for http://skbug.com/4374
BUG=skia:4374

Review URL: https://codereview.chromium.org/1367623002
2015-09-23 12:46:25 -07:00
bsalomon
aca31fea8c Stop supporting HW dither
Review URL: https://codereview.chromium.org/1359833004
2015-09-22 11:38:46 -07:00
bsalomon
87ba62e67c Replace GrExtractAlphaFragmentProcessor with DstIn compose processor
Review URL: https://codereview.chromium.org/1347943003
2015-09-22 06:42:00 -07:00
joshualitt
496d29f6b2 add new gm to test overlapping lcd text
BUG=skia:

Review URL: https://codereview.chromium.org/1358563002
2015-09-18 12:03:13 -07:00
joshualitt
33e91f1673 Make Ben happy
TBR=
BUG=skia:

Review URL: https://codereview.chromium.org/1351193004
2015-09-18 11:28:59 -07:00
fmalita
3b0d532df7 Purge cached resources on SkImage destruction.
BUG=532981
R=reed@google.com,mtklein@google.com

Review URL: https://codereview.chromium.org/1352883004
2015-09-18 08:07:31 -07:00
wangxianzhu
ef6c50a80f Merge sub-device annotations in SkPDFDevice::drawDevice()
Previously annotations added between saveLayer/restore were lost.

Merge annotations in SkPDFDevice::drawDevice(). Also modified code to
apply correct transformation and clipping on annotations added between
saveLayer/restore:
- Apply the initial transform only when adding the annotations into the
  doc, otherwise we need to unapply sub-device's initial transform
  before merging the annotations into parent-device.
- Apply only device-local clipping. fClipStack is in global coordinates,
  which is not suitable to clip rects in sub-devices.

BUG=skia:4080
BUG=503515

Review URL: https://codereview.chromium.org/1257533004
2015-09-17 20:38:02 -07:00
reed
1b55a963a2 Reland of add a ClassID function to GrBatch (patchset #1 id:1 of https://codereview.chromium.org/1353043002/ )
Reason for revert:
DEPS roll seems to have landed w/o this revert, so revert it again

Original issue's description:
> Revert of add a ClassID function to GrBatch (patchset #5 id:80001 of https://codereview.chromium.org/1352813003/ )
>
> Reason for revert:
> Speculative revert to unblock DEPS roll
>
> Original issue's description:
> > add a ClassID function to GrBatch
> >
> > BUG=skia:
> >
> > Committed: https://skia.googlesource.com/skia/+/4078d529e9e199eea13456db7bf3a63a104ab5b9
> >
> > Committed: https://skia.googlesource.com/skia/+/eb44d53cf96a7eaf103a98d76079ce1f5495e343
>
> TBR=robertphillips@google.com,bsalomon@google.com,joshualitt@google.com,joshualitt@chromium.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/48e3a45ade15c52c0c1a10cb00907dd444897745

TBR=robertphillips@google.com,bsalomon@google.com,joshualitt@google.com,joshualitt@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1344373005
2015-09-17 20:16:13 -07:00
reed
48e3a45ade Revert of add a ClassID function to GrBatch (patchset #5 id:80001 of https://codereview.chromium.org/1352813003/ )
Reason for revert:
Speculative revert to unblock DEPS roll

Original issue's description:
> add a ClassID function to GrBatch
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/4078d529e9e199eea13456db7bf3a63a104ab5b9
>
> Committed: https://skia.googlesource.com/skia/+/eb44d53cf96a7eaf103a98d76079ce1f5495e343

TBR=robertphillips@google.com,bsalomon@google.com,joshualitt@google.com,joshualitt@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1353043002
2015-09-17 17:35:11 -07:00
joshualitt
eb44d53cf9 add a ClassID function to GrBatch
BUG=skia:

Committed: https://skia.googlesource.com/skia/+/4078d529e9e199eea13456db7bf3a63a104ab5b9

Review URL: https://codereview.chromium.org/1352813003
2015-09-17 11:50:57 -07:00
joshualitt
a7008403dc Revert of add a ClassID function to GrBatch (patchset #5 id:80001 of https://codereview.chromium.org/1352813003/ )
Reason for revert:
breaks mac bot

Original issue's description:
> add a ClassID function to GrBatch
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/4078d529e9e199eea13456db7bf3a63a104ab5b9

TBR=robertphillips@google.com,bsalomon@google.com,joshualitt@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1345393003
2015-09-17 11:43:02 -07:00
joshualitt
4078d529e9 add a ClassID function to GrBatch
BUG=skia:

Review URL: https://codereview.chromium.org/1352813003
2015-09-17 11:21:17 -07:00
egdaniel
27b6335c71 On gpu, use max(r,g,b) for coverage alpha in LCD and update lcd blend gm.
BUG=skia:

Review URL: https://codereview.chromium.org/1339213004
2015-09-15 13:13:50 -07:00
fmalita
5598b63cd2 Convert unit tests, GMs from SkBitmapSource to SkImagesource
This removes SkBitmapSource clients within Skia.

http://crrev.com/1334173004 does the same for Blink, so we should be
able to remove SkBitmapSource in a follow-up.

R=reed@google.com,robertphillips@google.com,mtklein@google.com

Review URL: https://codereview.chromium.org/1343123002
2015-09-15 11:26:14 -07:00
robertphillips
30c4cae7d3 Add special case circle blur for Ganesh
This makes the blurcircles bench go from ~33us to ~8us on Windows desktop.

It will require layout test suppressions

Review URL: https://codereview.chromium.org/1311583005
2015-09-15 10:20:55 -07:00
egdaniel
723b0501e2 Add support for blending of LCD for all blend modes.
BUG=skia:

Review URL: https://codereview.chromium.org/1313623002
2015-09-15 09:31:40 -07:00
fmalita
cd56f812e0 SkImageSource
Blink is migrating away from SkBitmaps, so we need an SkImage-based
SkImageFilter source.  This is pretty much a 1-1 equivalent of
SkBitmapSource.

To avoid duplication, relocate the SkImage deserialization logic
from SkPictureData to SkReadBuffer.

R=reed@google.com,robertphillips@google.com,senorblanco@chromium.org

Review URL: https://codereview.chromium.org/1343703005
2015-09-14 13:31:18 -07:00
reed
74bd953719 discardable pixelrefs are gone, update tests accordingly
BUG=skia:4328

Review URL: https://codereview.chromium.org/1340803002
2015-09-14 08:52:12 -07:00
reed
c4a83e2652 support colortables in cacherator
BUG=skia:
TBR=scroggo

Review URL: https://codereview.chromium.org/1339753002
2015-09-11 11:47:27 -07:00
reed
25507d9a94 fix leaked picture
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1329143006
2015-09-09 13:42:14 -07:00
caryclark
6651a3238d Reland of more zero-length changes for svg compatibility (patchset #1 id:1 of https://codereview.chromium.org/1334543002/ )
Reason for revert:
DEPS should be fixed now

Original issue's description:
> Revert of more zero-length changes for svg compatibility (patchset #6 id:100001 of https://codereview.chromium.org/1330623003/ )
>
> Reason for revert:
> breaks DEPS
>
> Original issue's description:
> > more zero-length changes for svg compatibility
> >
> > If a path contains a moveTo followed by a line or curve,
> > even if the line or curve has no length, SVG expects
> > the end caps to draw if the cap style is round or square.
> >
> > Fredrik Söderquist attached a patch to the chrome bug
> > (slightly modified here) that fixes layout test failures
> > resulting from deleting special-case code in SVG
> > dealing with zero-length path segments.
> >
> > R=reed@google.com,fs@opera.com
> > BUG=22974
> >
> > Committed: https://skia.googlesource.com/skia/+/62fb1ba1786863e545c89839b5706ad5151cec15
>
> TBR=fs@opera.com,reed@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=22974
>
> Committed: https://skia.googlesource.com/skia/+/5ca4fa3846067a47e88d35ace895df3ebe3ec2a5

TBR=fs@opera.com,reed@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=22974

Review URL: https://codereview.chromium.org/1314833004
2015-09-09 13:20:49 -07:00
reed
7628967820 add picture-image variant
BUG=skia:

Review URL: https://codereview.chromium.org/1329283002
2015-09-09 11:29:09 -07:00
reed
4228c1fa2c switch over to using images
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1313543004
2015-09-09 10:45:36 -07:00
caryclark
5ca4fa3846 Revert of more zero-length changes for svg compatibility (patchset #6 id:100001 of https://codereview.chromium.org/1330623003/ )
Reason for revert:
breaks DEPS

Original issue's description:
> more zero-length changes for svg compatibility
>
> If a path contains a moveTo followed by a line or curve,
> even if the line or curve has no length, SVG expects
> the end caps to draw if the cap style is round or square.
>
> Fredrik Söderquist attached a patch to the chrome bug
> (slightly modified here) that fixes layout test failures
> resulting from deleting special-case code in SVG
> dealing with zero-length path segments.
>
> R=reed@google.com,fs@opera.com
> BUG=22974
>
> Committed: https://skia.googlesource.com/skia/+/62fb1ba1786863e545c89839b5706ad5151cec15

TBR=fs@opera.com,reed@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=22974

Review URL: https://codereview.chromium.org/1334543002
2015-09-09 09:34:22 -07:00
halcanary
2a24338c77 GM: replace boilerplate with macros
I have verified locally that nothing draws differently.

Motivation:
*   SK_SIMPLE_GM makes it easier to write a GM.
*   Reducing 1100 lines of code makes maintenance easier.
*   Simple GMs are easy to convert to Fiddles.

Review URL: https://codereview.chromium.org/1333553002
2015-09-09 08:16:41 -07:00
caryclark
62fb1ba178 more zero-length changes for svg compatibility
If a path contains a moveTo followed by a line or curve,
even if the line or curve has no length, SVG expects
the end caps to draw if the cap style is round or square.

Fredrik Söderquist attached a patch to the chrome bug
(slightly modified here) that fixes layout test failures
resulting from deleting special-case code in SVG
dealing with zero-length path segments.

R=reed@google.com,fs@opera.com
BUG=22974

Review URL: https://codereview.chromium.org/1330623003
2015-09-09 07:04:33 -07:00
msarett
9260296349 Bot fix
https://codereview.chromium.org/1311503008
https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Coverage/builds/1083/steps/build%20dm/logs/stdio

BUG=skia:

Review URL: https://codereview.chromium.org/1331463004
2015-09-04 13:12:55 -07:00
reed
58e524c98c draw 3 moveTos followed by various others [moves, lines, closes]
BUG=skia:

Review URL: https://codereview.chromium.org/1311503008
2015-09-04 10:03:26 -07:00
caryclark
c8b350df07 update gm test size to include new elements
TBR=
BUG=skia:562

Review URL: https://codereview.chromium.org/1305983006
2015-09-04 06:19:48 -07:00
caryclark
500ab7562c change for issue 562
Add a current version of the patch described in issue 562.

Of interest: the reference row, which is described in the
bug as looking correct draws differently with Ganesh.

TBR=senorblanco
BUG=skia:562

Review URL: https://codereview.chromium.org/1324023006
2015-09-04 05:20:32 -07:00
robertphillips
943a462fef Minor code cleanup (left over from prior CL)
This was requested in https://codereview.chromium.org/1309543012/ (Add new GM to directly exercise perspective bitmap drawing)

Review URL: https://codereview.chromium.org/1320673011
2015-09-03 13:32:33 -07:00
wangyix
d705958375 Will try composing a linear gradient with a color bitmap as well as an alpha8 bitmap to make sure the paint's color is being used/ignored in the right places.
BUG=skia:4182

Review URL: https://codereview.chromium.org/1311043008
2015-09-03 08:32:22 -07:00
robertphillips
fac9ceb5de Add new GM to directly exercise perspective bitmap drawing
BUG=skia:3326

Review URL: https://codereview.chromium.org/1309543012
2015-09-03 08:32:08 -07:00
robertphillips
c9a3706f1e Limit lifetime of GrDrawContext objects
GrDrawContext's are about to become real allocated objects. This CL sets up the machinery so they won't leak.

Review URL: https://codereview.chromium.org/1321353002
2015-09-01 08:34:28 -07:00
bsalomon
afcd7cd324 Rename flag from "distance field" to "device independent."
Review URL: https://codereview.chromium.org/1322433006
2015-08-31 12:39:41 -07:00
senorblanco
2aec4e9466 Add a GM for image filters applied to stroked primitives.
BUG=skia:3194

Review URL: https://codereview.chromium.org/1323573004
2015-08-31 10:28:49 -07:00
bsalomon
c21b09eec9 Change SkShader;asFragmentProcessor signature to no longer take skpaint\grcolor*
Committed: https://skia.googlesource.com/skia/+/ecfdc251be71f3d634e76afdd6375bf55fc061aa

Review URL: https://codereview.chromium.org/1316513002
2015-08-28 18:46:56 -07:00
rmistry
a511e6ad10 Revert of Change SkShader;asFragmentProcessor signature to no longer take skpaint\grcolor* (patchset #8 id:140001 of https://codereview.chromium.org/1316513002/ )
Reason for revert:
Primary suspect in failing DEPS rolls:
* https://codereview.chromium.org/1315753006
* https://codereview.chromium.org/1308323006
* https://codereview.chromium.org/1320903004

Primary suspect because the failing win bots did not fail in https://codereview.chromium.org/1315753005

Original issue's description:
> Change SkShader;asFragmentProcessor signature to no longer take skpaint\grcolor*
>
> Committed: https://skia.googlesource.com/skia/+/ecfdc251be71f3d634e76afdd6375bf55fc061aa

TBR=joshualitt@google.com,wangyix@google.com,robertphillips@google.com,bsalomon@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1313573005
2015-08-28 17:16:50 -07:00
bsalomon
ecfdc251be Change SkShader;asFragmentProcessor signature to no longer take skpaint\grcolor*
Review URL: https://codereview.chromium.org/1316513002
2015-08-28 14:33:47 -07:00
halcanary
96fcdcc219 Style Change: NULL->nullptr
DOCS_PREVIEW= https://skia.org/?cl=1316233002

Review URL: https://codereview.chromium.org/1316233002
2015-08-27 07:41:16 -07:00
bsalomon
ac856c97ac Remove GrStagedProcessor, remove the word Stage as it applies to FPs
Committed: https://skia.googlesource.com/skia/+/24243446cdf7b7e4e132c2a0c387c7723777e0c7

Review URL: https://codereview.chromium.org/1307223004
2015-08-27 06:30:17 -07:00
senorblanco
7b7ecfc046 Fix clipped lighting image filters.
The CPU path for lighting image filters was not adjusting the filter
matrix to accommodate srcOffset, resulting in incorrectly-positioned
lights.  (The GPU path was doing this correctly.)

This change adds a new test case to the imagefiltersclipped GM,
so it will need new baselines.

BUG=skia:

Review URL: https://codereview.chromium.org/1310053004
2015-08-26 14:26:40 -07:00
halcanary
385fe4d4b6 Style Change: SkNEW->new; SkDELETE->delete
DOCS_PREVIEW= https://skia.org/?cl=1316123003

Review URL: https://codereview.chromium.org/1316123003
2015-08-26 13:07:49 -07:00
joshualitt
e46cf96ef5 Write a gm to verify append large glyph as path works
BUG=chromium:522846

Review URL: https://codereview.chromium.org/1316443006
2015-08-26 11:19:56 -07:00
caryclark
5cb00a9573 zero-length cap fix
Re-land; layout tests are suppressed and gm differences are understood.
A merge conflict prevented a automatic reland.

If the endcap is not butt, draw the endcaps even when the line
has zero length.

If the dash length is zero, generate a zero length line segment.

Treat a move followed by a close as a move followed by a zero-length
line.

TBR=reed@google.com
BUG=422974

Review URL: https://codereview.chromium.org/1314213002
2015-08-26 09:04:55 -07:00
rmistry
4bf69f7bbc Revert of Remove GrStagedProcessor, remove the word Stage as it applies to FPs (patchset #6 id:90001 of https://codereview.chromium.org/1307223004/ )
Reason for revert:
Causes bot failures:

https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Mac10.9-Clang-MacMini6.2-GPU-HD4000-x86_64-Debug/builds/1639

https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Ubuntu-GCC-ShuttleA-GPU-GTX660-x86_64-Debug/builds/1702

https://uberchromegw.corp.google.com/i/client.skia.android/builders/Test-Android-GCC-NexusPlayer-GPU-PowerVR-x86-Debug/builds/1223

Original issue's description:
> Remove GrStagedProcessor, remove the word Stage as it applies to FPs
>
> Committed: https://skia.googlesource.com/skia/+/24243446cdf7b7e4e132c2a0c387c7723777e0c7

TBR=joshualitt@google.com,egdaniel@google.com,bsalomon@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1306803003
2015-08-26 06:48:27 -07:00
bsalomon
24243446cd Remove GrStagedProcessor, remove the word Stage as it applies to FPs
Review URL: https://codereview.chromium.org/1307223004
2015-08-26 05:39:18 -07:00
caryclark
45398dff71 Reland of ix zero-length tangent (patchset #1 id:1 of https://codereview.chromium.org/1312243002/ )
Reason for revert:
Layout suppression has landed, and verified that Skia gm test changes are correct.

Original issue's description:
> Revert of fix zero-length tangent (patchset #2 id:20001 of https://codereview.chromium.org/1311273002/ )
>
> Reason for revert:
> causes layout test to draw differently -- new drawing is more correct. Reverting until layout test ignore is landed.
>
> Original issue's description:
> > fix zero-length tangent
> >
> > If the end point and the control point are the same, computing
> > the tangent will result in (0, 0). In this case, use the prior
> > control point instead.
> >
> > R=reed@google.com
> >
> > BUG=skia:4191
> >
> > Committed: https://skia.googlesource.com/skia/+/7544124fb8ee744f68f549a353f8a9163cd7432d
>
> TBR=reed@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:4191
>
> Committed: https://skia.googlesource.com/skia/+/91298b47c547b2ab4697038c04685af957bd1416

TBR=reed@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:4191

Review URL: https://codereview.chromium.org/1320473002
2015-08-25 13:19:06 -07:00
caryclark
91298b47c5 Revert of fix zero-length tangent (patchset #2 id:20001 of https://codereview.chromium.org/1311273002/ )
Reason for revert:
causes layout test to draw differently -- new drawing is more correct. Reverting until layout test ignore is landed.

Original issue's description:
> fix zero-length tangent
>
> If the end point and the control point are the same, computing
> the tangent will result in (0, 0). In this case, use the prior
> control point instead.
>
> R=reed@google.com
>
> BUG=skia:4191
>
> Committed: https://skia.googlesource.com/skia/+/7544124fb8ee744f68f549a353f8a9163cd7432d

TBR=reed@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:4191

Review URL: https://codereview.chromium.org/1312243002
2015-08-25 10:02:46 -07:00
caryclark
7544124fb8 fix zero-length tangent
If the end point and the control point are the same, computing
the tangent will result in (0, 0). In this case, use the prior
control point instead.

R=reed@google.com

BUG=skia:4191

Review URL: https://codereview.chromium.org/1311273002
2015-08-25 08:03:01 -07:00
caryclark
21b998b181 Revert of experiment with zero-length round capped line segments (patchset #4 id:60001 of https://codereview.chromium.org/1309753002/ )
Reason for revert:
More GMs changed than I expected. Will probably affect layout tests as well; reverting until I can verify that the changes are correct.

Original issue's description:
> experiment with zero-length round capped line segments
>
> If the endcap is not butt, draw the endcaps even when the line
> has zero length.
>
> If the dash length is zero, generate a zero length line segment.
>
> Treat a move followed by a close as a move followed by a zero-length
> line.
>
> R=reed@google.com,schenney@google.com
> BUG=422974
>
> Committed: https://skia.googlesource.com/skia/+/dd3c165828fffb369d0f4b13b48381169a0249a9

TBR=reed@google.com,schenney@google.com,schenney@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=422974

Review URL: https://codereview.chromium.org/1304163008
2015-08-21 13:47:06 -07:00
caryclark
dd3c165828 experiment with zero-length round capped line segments
If the endcap is not butt, draw the endcaps even when the line
has zero length.

If the dash length is zero, generate a zero length line segment.

Treat a move followed by a close as a move followed by a zero-length
line.

R=reed@google.com,schenney@google.com
BUG=422974

Review URL: https://codereview.chromium.org/1309753002
2015-08-21 13:27:37 -07:00
joshualitt
d2b23e0ee6 Standardize BW to NonAA
TBR=bsalomon@google.com, robertphillips@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1310533004
2015-08-21 10:53:34 -07:00
joshualitt
b6b513b805 Create separate entry points for the various flavors of drawRect
BUG=skia:

Review URL: https://codereview.chromium.org/1308503002
2015-08-21 10:25:18 -07:00
halcanary
2f0a728e5a GMs: change some GMs to use SkImage over SkBitmap
Also, add GetResourceAsImage() to Resources.h

Motivation:  test drawImage() as much as we test drawBitmap()

Review URL: https://codereview.chromium.org/1306133003
2015-08-21 07:47:23 -07:00
reed
499ababa52 add gm for image->newShader
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1302943004
2015-08-20 12:30:20 -07:00
senorblanco
0abdf766d3 Reland of Implement canComputeFastBounds() for image filters. (patchset #1 id:1 of https://codereview.chromium.org/1300403003/ )
Reason for revert:
The Mac compile issue was fixed here: fdd331a42a

Original issue's description:
> Revert of Implement canComputeFastBounds() for image filters. (patchset #8 id:130001 of https://codereview.chromium.org/1296943002/ )
>
> Reason for revert:
> This causes a syntax error.
>
> http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_compile_dbg_ng/builds/87819/steps/compile%20%28with%20patch%29/logs/stdio
>
> Original issue's description:
> > Implement canComputeFastBounds() for image filters.
> >
> > Image filters have never implemented this check, which means that
> > filters which affect transparent black falsely claim they can compute
> > their bounds.
> >
> > Implemented an affectsTransparentBlack() virtual for image
> > filters, and a similar helper function for color filters.
> >
> > This will affect the following GMs: imagefiltersscaled
> > (lighting, perlin noise now filter to clip),
> > colorfilterimagefilter (new test case), imagefiltersclipped
> > (perlin noise now filters to clip).
> >
> > Note: I de-inlined SkPaint::canComputeFastBounds() to avoid adding
> > a dependency from SkPaint.h to SkImageFilter.h.h. Skia benches show
> > no impact from this change, but will watch the perf bots carefully.
> >
> > BUG=4212
> >
> > Committed: https://skia.googlesource.com/skia/+/915881fe743f9a789037695f543bc6ea189cd0cb
>
> TBR=reed@google.com,senorblanco@chromium.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=4212
>
> Committed: https://skia.googlesource.com/skia/+/12d8472d31ea5edb636d7d5214db253570115c40

TBR=reed@google.com,herb@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=4212

Review URL: https://codereview.chromium.org/1301823005
2015-08-20 11:10:41 -07:00
caryclark
02833bf055 fix override
TBR=herb@google.com

Review URL: https://codereview.chromium.org/1301763006
2015-08-20 10:53:13 -07:00
caryclark
05424f77fa fix cubic clip in y
Follow on to https://codereview.chromium.org/1299243002/

Clip using a geometric solution if the algebraic solution
fails in Y as well as in X.

If the root finder discovers real roots that are sufficiently
far apart, the root in the range of 0..1 can contain so much
error that it is computed to be slightly smaller than 0 or
larger than 1.

In this case, binary search the mono curve for the actual
answer.

R=reed@google.com

Review URL: https://codereview.chromium.org/1303873003
2015-08-20 10:35:43 -07:00
herb
12d8472d31 Revert of Implement canComputeFastBounds() for image filters. (patchset #8 id:130001 of https://codereview.chromium.org/1296943002/ )
Reason for revert:
This causes a syntax error.

http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_compile_dbg_ng/builds/87819/steps/compile%20%28with%20patch%29/logs/stdio

Original issue's description:
> Implement canComputeFastBounds() for image filters.
>
> Image filters have never implemented this check, which means that
> filters which affect transparent black falsely claim they can compute
> their bounds.
>
> Implemented an affectsTransparentBlack() virtual for image
> filters, and a similar helper function for color filters.
>
> This will affect the following GMs: imagefiltersscaled
> (lighting, perlin noise now filter to clip),
> colorfilterimagefilter (new test case), imagefiltersclipped
> (perlin noise now filters to clip).
>
> Note: I de-inlined SkPaint::canComputeFastBounds() to avoid adding
> a dependency from SkPaint.h to SkImageFilter.h.h. Skia benches show
> no impact from this change, but will watch the perf bots carefully.
>
> BUG=4212
>
> Committed: https://skia.googlesource.com/skia/+/915881fe743f9a789037695f543bc6ea189cd0cb

TBR=reed@google.com,senorblanco@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=4212

Review URL: https://codereview.chromium.org/1300403003
2015-08-20 09:28:45 -07:00
caryclark
7d173403f4 subdivide path when side-clipping fails
Please review concept; I'm OK not to check this in.

If the root finder fails, subdivide the curve and try again.
This is complicated by the reversed nature of the curves;
maybe it can be simpler, but how to do that escapes me.

R=reed@google.com
BUG=514246

Review URL: https://codereview.chromium.org/1299243002
2015-08-20 08:23:52 -07:00
bungeman
99fe822606 Use static_assert instead of SK_COMPILE_ASSERT.
Now that static_assert is allowed, there is no need to use a non-
standard compile time assertion

Review URL: https://codereview.chromium.org/1306443004
2015-08-20 07:57:52 -07:00
senorblanco
915881fe74 Implement canComputeFastBounds() for image filters.
Image filters have never implemented this check, which means that
filters which affect transparent black falsely claim they can compute
their bounds.

Implemented an affectsTransparentBlack() virtual for image
filters, and a similar helper function for color filters.

This will affect the following GMs: imagefiltersscaled
(lighting, perlin noise now filter to clip),
colorfilterimagefilter (new test case), imagefiltersclipped
(perlin noise now filters to clip).

Note: I de-inlined SkPaint::canComputeFastBounds() to avoid adding
a dependency from SkPaint.h to SkImageFilter.h.h. Skia benches show
no impact from this change, but will watch the perf bots carefully.

BUG=4212

Review URL: https://codereview.chromium.org/1296943002
2015-08-20 07:42:11 -07:00
robertphillips
2f0dbc761a Update SkLightingShader to support rotation
This also:
makes the SkLightingShader handle normal maps where the rects aren't aligned between the diffuse and normal maps.

adds a light aggregating class (Lights) to SkLightingShader (along with a Builder nested class).

Split out of https://codereview.chromium.org/1261433009/ (Add SkCanvas::drawLitAtlas call)

Committed: https://skia.googlesource.com/skia/+/45b59ed6e4e231814dbdb9f707b3d2a7ee50de84

Review URL: https://codereview.chromium.org/1291783003
2015-08-20 05:15:07 -07:00
robertphillips
f7d602a458 Revert "Update SkLightingShader to support rotation"
This reverts commit 45b59ed6e4.

TBR=herb@google.com

Review URL: https://codereview.chromium.org/1304673002
2015-08-19 13:11:23 -07:00
ethannicholas
fea7763140 Fix transformed stroke width in GrAALinearizingConvexPathRenderer.
BUG=520476

Review URL: https://codereview.chromium.org/1302503003
2015-08-19 12:09:12 -07:00
robertphillips
45b59ed6e4 Update SkLightingShader to support rotation
This also:
makes the SkLightingShader handle normal maps where the rects aren't aligned between the diffuse and normal maps.

adds a light aggregating class (Lights) to SkLightingShader (along with a Builder nested class).

Split out of https://codereview.chromium.org/1261433009/ (Add SkCanvas::drawLitAtlas call)

Review URL: https://codereview.chromium.org/1291783003
2015-08-19 10:35:14 -07:00
reed
a32cc950fb widen gm to show entire image, add place-holder for no context
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1294113003
2015-08-19 06:07:29 -07:00
wangyix
b1daa86732 When getGLInstance is called on a frag proc, the resulting GrGLFragmentProcessor will be the root of a tree of GrGLFragmentProcessors that mirrors the GrFragmentProcessor's tree. This allows setData() to be called recursively (removing the responsibility from compose shader) and allows gl instances direct access to their children gl instances so they can emit their code.
BUG=skia:4182

Review URL: https://codereview.chromium.org/1287023009
2015-08-18 11:29:32 -07:00
reed
935d6cfaa7 Add subsets to SkImageGenerator and SkImageCacherator
... to support subsets in SkImage!

BUG=skia:

Review URL: https://codereview.chromium.org/1301633002
2015-08-18 11:16:09 -07:00
robertphillips
ea4529d09a Move normal map creation methods to sk_tools
Split off of https://codereview.chromium.org/1261433009/ (Add SkCanvas::drawLitAtlas call)

Review URL: https://codereview.chromium.org/1298763002
2015-08-17 15:04:47 -07:00
bsalomon
7539856c1b Make GrVertexBatch objects hold their own draws during GrDrawTarget flush
NO_MERGE_BUILDS

Review URL: https://codereview.chromium.org/1286043004
2015-08-17 12:55:38 -07:00
mtklein
9a106ba2dd A bit of misc cleanup.
- Update comments about skia_shared_lib
 - Remove dead code (system_preferences)
 - Remove non-building code (techtalk1)
 - Turn gm/annotated_text back on.

BUG=skia:

Review URL: https://codereview.chromium.org/1286133004
2015-08-14 10:03:45 -07:00
joshualitt
2ba70995f8 Add GM to test drawing atlas case
BUG=skia:

Review URL: https://codereview.chromium.org/1294513002
2015-08-14 06:30:50 -07:00
bsalomon
16b991390b Split GrDrawBatch and GrVertexBatch into their own files
TBR=joshualitt@google.com

Review URL: https://codereview.chromium.org/1296483002
2015-08-13 14:55:50 -07:00
reed
8f4fe37b1c some catchup CL revisions
BUG=skia:

Review URL: https://codereview.chromium.org/1295593002
2015-08-13 14:06:46 -07:00
bsalomon
abd30f54b7 Introduce GrBatch subclasses GrDrawBatch and GrVertexBatch to prepare for non-drawing batches
Review URL: https://codereview.chromium.org/1293583002
2015-08-13 13:34:48 -07:00
reed
8f34372f7e Extend SkImageGenerator to support natively generated GrTextures. As part of this, added uniqueID() to the generator, and made it be in the same namespace is bitmaps, pixelrefs, images.
To do this, create SkImageCacherator, which wraps a generator and provides an
interface to get a cached answer for either the raster or texture output of
the generator.

BUG=skia:

Review URL: https://codereview.chromium.org/1291803002
2015-08-13 13:32:39 -07:00
reed
d5b75638f7 add SkImage::NewFromPicture and a GM to test it
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1288403002
2015-08-13 09:37:45 -07:00
joshualitt
2771b5617c GrDrawVertices to batches
BUG=skia:

Review URL: https://codereview.chromium.org/1276333004
2015-08-07 12:46:26 -07:00
bsalomon
ebc1c10fe1 Fix warnings on VS2015 x86_64 build
TBR=bungeman@google.com

Review URL: https://codereview.chromium.org/1276133002
2015-08-06 17:33:16 -07:00
reed
e47829b6b1 flag to use const& instead of const* for src-rect
BUG=skia:

Review URL: https://codereview.chromium.org/1272713005
2015-08-06 10:02:53 -07:00
bsalomon
fb1141ae1d Don't pass pipeline to GrBatch::generateGeometry()
R=joshualitt@google.com

Review URL: https://codereview.chromium.org/1275083002
2015-08-06 08:52:49 -07:00
bungeman
d3ebb48320 IWYU: 'core' target, files starting A-C.
TBR=reed@google.com
Verbal lgtm, does not change API.

Committed: https://skia.googlesource.com/skia/+/7403d87db8e43d4c2b5b25ac22a0ebc22bd09d69

Review URL: https://codereview.chromium.org/1265033002
2015-08-05 13:57:49 -07:00
reed
fb8c1fcab1 Revert of IWYU: 'core' target, files starting A-C. (patchset #5 id:80001 of https://codereview.chromium.org/1265033002/ )
Reason for revert:
revert to unblock DEPS roll

../../chrome/browser/chromeos/display/overscan_calibrator.cc:43:10: error: variable has incomplete type 'SkPath'
  SkPath base_path;

Original issue's description:
> IWYU: 'core' target, files starting A-C.
>
> TBR=reed@google.com
> Verbal lgtm, does not change API.
>
> Committed: https://skia.googlesource.com/skia/+/7403d87db8e43d4c2b5b25ac22a0ebc22bd09d69

TBR=reed@google.com,mtklein@google.com,bungeman@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1273613002
2015-08-04 18:44:57 -07:00
bungeman
7403d87db8 IWYU: 'core' target, files starting A-C.
TBR=reed@google.com
Verbal lgtm, does not change API.

Review URL: https://codereview.chromium.org/1265033002
2015-08-04 14:56:53 -07:00
fmalita
1dedc3d2c0 SkPictureImageGenerator
R=reed@google.com

Review URL: https://codereview.chromium.org/1240093004
2015-08-04 13:53:14 -07:00
wangyix
4b3050b410 Added registerChild; transforms, textures, glKey automatically handled.
BUG=skia:

Review URL: https://codereview.chromium.org/1266633003
2015-08-04 07:59:37 -07:00
bsalomon
c41f4d6055 Fix elliptical rrect clip shaders for large radii on devices with mediump
BUG=chromium:426217

Review URL: https://codereview.chromium.org/1256353004
2015-08-03 14:23:03 -07:00
joshualitt
df0c557850 Use new API everywhere for GrDefaultGeoProcFactory
BUG=skia:

Committed: https://skia.googlesource.com/skia/+/801823b3d825d96baadeb9077c5ed1a8ada05cf2

Review URL: https://codereview.chromium.org/1261083003
2015-08-03 11:35:29 -07:00
joshualitt
e494a58de3 Revert of Use new API everywhere for GrDefaultGeoProcFactory (patchset #5 id:80001 of https://codereview.chromium.org/1261083003/)
Reason for revert:
breaking things

Original issue's description:
> Use new API everywhere for GrDefaultGeoProcFactory
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/801823b3d825d96baadeb9077c5ed1a8ada05cf2

TBR=robertphillips@google.com,bsalomon@google.com,joshualitt@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1264283004
2015-08-03 09:32:36 -07:00
joshualitt
801823b3d8 Use new API everywhere for GrDefaultGeoProcFactory
BUG=skia:

Review URL: https://codereview.chromium.org/1261083003
2015-08-03 09:03:33 -07:00
joshualitt
d45fb5a3a5 Add BW masks to random scaler context
TBR=bsalomon@google.com
BUG=skia:

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

Review URL: https://codereview.chromium.org/1270793003
2015-08-01 10:33:40 -07:00
joshualitt
2a6f747cdd Revert of Add BW masks to random scaler context (patchset #1 id:1 of https://codereview.chromium.org/1270793003/)
Reason for revert:
breaks mac

Original issue's description:
> Add BW masks to random scaler context
>
> TBR=bsalomon@google.com
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/a4a530614e9ba856aac3f16c29683e6a2a9153d9

TBR=joshualitt@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1264843003
2015-08-01 10:17:53 -07:00
joshualitt
a4a530614e Add BW masks to random scaler context
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1270793003
2015-08-01 09:36:02 -07:00
joshualitt
44c4851c91 adding gm to use random scaler context
BUG=skia:

Committed: https://skia.googlesource.com/skia/+/853336c532504b3436d7dcbf252419f00c79066d

Review URL: https://codereview.chromium.org/1268853008
2015-08-01 07:33:42 -07:00
halcanary
80a1c54740 C API: remove dead code, simplify boilerplate
Review URL: https://codereview.chromium.org/1261953006
2015-07-31 15:16:23 -07:00
joshualitt
d164a710c7 Revert of adding gm to use random scaler context (patchset #4 id:60001 of https://codereview.chromium.org/1268853008/)
Reason for revert:
breaking bots

Original issue's description:
> adding gm to use random scaler context
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/853336c532504b3436d7dcbf252419f00c79066d

TBR=bsalomon@google.com,joshualitt@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1259033004
2015-07-31 15:10:31 -07:00
joshualitt
853336c532 adding gm to use random scaler context
BUG=skia:

Review URL: https://codereview.chromium.org/1268853008
2015-07-31 14:46:46 -07:00
robertphillips
a9652ac09e Address some SkLightingShader TODOs
This CL:
  switches the light colors to be 3 scalars (SkColor3f)
  adds some dox

Review URL: https://codereview.chromium.org/1265983003
2015-07-31 05:17:24 -07:00
caryclark
159fa572c4 linear gradient with stops discretized gm
TBR=reed@google.com
BUG=skia:517

Review URL: https://codereview.chromium.org/1259983009
2015-07-30 12:35:48 -07:00
caryclark
1864bfae63 add radial gradient hard stop test
TBR=reed@google.com
BUG=skia:4140

Review URL: https://codereview.chromium.org/1269723002
2015-07-30 06:41:39 -07:00
robertphillips
640898f588 Update SkLightingShader to take a localMatrix
W/o this we can't draw lit objects anywhere but the origin.

Review URL: https://codereview.chromium.org/1253223003
2015-07-30 05:09:17 -07:00
robertphillips
5f865b9cf1 Move LightingShader to effects
Additionally this CL:

forces the light colors to be opaque
forces the light direction to be normalized
adds a raster implementation
adds a gm

Review URL: https://codereview.chromium.org/1245883003
2015-07-29 12:28:04 -07:00
caryclark
f1f8bd5851 fix dstreadshuffle text portable gm
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1259093004
2015-07-29 06:58:40 -07:00
caryclark
125960152d make tests portable by using 565 compatible colors
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1262703002
2015-07-29 05:27:47 -07:00
caryclark
efa1ece07e gm missed portable text in textblobshader
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1263593004
2015-07-28 11:55:50 -07:00
caryclark
66fb63ffec gm fix missed portable gm text in samplerstress
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1261093002
2015-07-28 11:22:48 -07:00
caryclark
f597c42c50 make pixelsnap textblob* etc gm portable
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1263553002
2015-07-28 10:37:53 -07:00
joshualitt
20dac88565 mixed text blobs really draws LCD
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1261483002
2015-07-24 13:16:24 -07:00
caryclark
1818acb6a4 rename portable_typeface_always to portable_typeface
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1257773002
2015-07-24 12:09:25 -07:00
caryclark
37213558e6 make fontscalar gammatext lcdtext typeface verttext2 gm portable
Pass generic font names to tool util function to generate
platform specific fonts and gm test output by unique name.

R=bungeman@google.com

Review URL: https://codereview.chromium.org/1256903002
2015-07-24 11:08:01 -07:00
robertphillips
29ccdf86ab Fix Ganesh drawAtlas bug with quad colors
Ganesh was not expanding the quad colors to vertex colors before calling drawVertices.

The new GM would've caught this bug and reveals Ganesh's limitations re the various xfer modes used with drawAtlas (i.e., w/o AA Ganesh only supports kModulate, w/ AA Ganesh only supports the coefficient-based xfer modes).

Review URL: https://codereview.chromium.org/1254943002
2015-07-24 10:20:45 -07:00
caryclark
ba9757abc2 make dftext gm not overlap itself
TBR=jvanverth@google.com

Review URL: https://codereview.chromium.org/1253643004
2015-07-23 14:07:58 -07:00
caryclark
1b31402bab make fontcache textblob gm portable
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1245123006
2015-07-23 13:48:31 -07:00
caryclark
a0170f10aa make dftext the same on Linux and Android
Use the same font sizes on both platforms so that the gm images
are easier to compare one to the other.

TBR=jvanverth@google.com

Review URL: https://codereview.chromium.org/1253573006
2015-07-23 12:38:59 -07:00
caryclark
3b0f98ee17 fix typeface leak
TBR=bungeman@google.com

Review URL: https://codereview.chromium.org/1239303003
2015-07-23 11:52:01 -07:00
wangyix
7c157a9888 Added GrGLFragmentProcessor::EmitArgs struct for use with emitCode()
BUG=skia:

Review URL: https://codereview.chromium.org/1251173002
2015-07-22 15:08:53 -07:00
caryclark
e59524dff5 make mixedtextblobs gm portable
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1250753004
2015-07-21 13:11:26 -07:00
caryclark
c3dcb67f07 make color emoji gm portable
R=bungeman@google.com

Review URL: https://codereview.chromium.org/1248703004
2015-07-21 12:27:36 -07:00