Commit Graph

2096 Commits

Author SHA1 Message Date
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