Commit Graph

2390 Commits

Author SHA1 Message Date
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
caryclark
ae3714f27a make varied_text* gm portable
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1244063002
2015-07-21 09:15:53 -07:00
jvanverth
02781977e0 Run noise shader separately in imagefiltersclipped
BUG=skia:4079

Review URL: https://codereview.chromium.org/1245983002
2015-07-21 08:38:06 -07:00
caryclark
4ec1ac6a2d make xfermode* portable
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1243103002
2015-07-21 07:42:45 -07:00
rileya
134003902d Add Rec709 YUV color space support to GrYUVtoRGBEffect.
This change is motivated by a recent switch in how chromium handles
<video> color spaces, making rec709 more commonly used. This will
allow video -> canvas copies to take the fast GPU path when we're using
709, just as we do with 601 and jpeg.

Chromium-side change: https://codereview.chromium.org/1236313002

Review URL: https://codereview.chromium.org/1241723005
2015-07-20 15:00:03 -07:00
caryclark
6531c3619f Generate platform specific fontmgr gm.
The gm output on different font platforms is so different
that comparing images in Gold has little value. Separate the
images by appending platform information to the gm name to
group somewhat similar images together.

Note that this does not attempt to make sure that all images
generated by Gold are nearly pixel identical; it only reduces
the number of nonsensical comparisons.

R=bungeman@google.com

Review URL: https://codereview.chromium.org/1245643002
2015-07-20 13:38:56 -07:00
caryclark
85693c15c8 make stroketext textblob* texteffects tileimagefilter gm portable
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1244833002
2015-07-20 10:48:01 -07:00
wangxianzhu
d76665da1c Reland "SkPDF: Annotations are clipped by canvas clip stack."
Original patch was created by halcanary@google.com, and was reverted
because it triggered crbug.com/503541.

This patch fixes a bug in the original patch about clip path
transformation.

> Also, remove some SkPDFDevice functions.
> Will fix this GM: http://crrev.com/1159273003
> BUG=skia:3872
> Review URL: https://codereview.chromium.org/1148263005

BUG=skia:3872
BUG=503514

Review URL: https://codereview.chromium.org/1238503007
2015-07-17 17:23:15 -07:00
caryclark
97a26d04e2 make drawbitmaprect lighting lumafilter matrixconvolution srcmode gm portable
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1240843005
2015-07-17 13:20:48 -07:00
caryclark
dfcb7abc41 make arithmode bigtext colortype* degeneratesegments gm portable
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1235343004
2015-07-17 09:39:16 -07:00
reed
84984efeb6 Revert[2] of guard to remove DrawBitmapRectFlags
This reverts commit 91110195a2.

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1240753003
2015-07-17 07:09:43 -07:00
scroggo
91110195a2 Revert of guard to remove DrawBitmapRectFlags (patchset #1 id:1 of https://codereview.chromium.org/1235393003/)
Reason for revert:
breaking android framework build

Original issue's description:
> guard to remove DrawBitmapRectFlags
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/6fb0b6779e40ce05c20cf279f0ecff31fa3cd60d

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

Review URL: https://codereview.chromium.org/1230823007
2015-07-17 05:57:34 -07:00
caryclark
ef14cb397c make glyph_pos imageblur* largeglyphblur portable
R=reed@google.com,bungeman@google.com

Review URL: https://codereview.chromium.org/1243493003
2015-07-16 14:16:04 -07:00
caryclark
d2ce18520e make imagefilters* imagemagnifier imageresizetiled portable
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1238083004
2015-07-16 12:35:58 -07:00
joshualitt
dbe1e6f0c3 Give GrBatch a pointer to GrPipeline
BUG=skia:

Committed: https://skia.googlesource.com/skia/+/1170a12839218f7a23c93487bf95fd83aae0201f

Review URL: https://codereview.chromium.org/1237283007
2015-07-16 08:12:45 -07:00
jvanverth
3e5f55542c Various GL testing fixes
Check for GL context when printing NVPR error string.
Fix some indenting.

Review URL: https://codereview.chromium.org/1235283004
2015-07-16 07:46:07 -07:00
joshualitt
0df62e3d68 Revert of Give GrBatch a pointer to GrPipeline (patchset #1 id:1 of https://codereview.chromium.org/1237283007/)
Reason for revert:
breaking nanobench

Original issue's description:
> Give GrBatch a pointer to GrPipeline
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/1170a12839218f7a23c93487bf95fd83aae0201f

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

Review URL: https://codereview.chromium.org/1239073002
2015-07-16 07:16:53 -07:00
joshualitt
1170a12839 Give GrBatch a pointer to GrPipeline
BUG=skia:

Review URL: https://codereview.chromium.org/1237283007
2015-07-16 07:06:50 -07:00
caryclark
5f7f428844 increase gm offsetimagefilter stroke width
With a hairline width, offsetimagefilter fails to draw the
rectangle on some platforms. Make the width 2 so that it
shows up everywhere.

TBR=reed@google.com

Review URL: https://codereview.chromium.org/1236133003
2015-07-16 07:06:46 -07:00
mtklein
767d273ea0 Replace buggy_blend_modes GM with an exhaustive test.
The new test is disabled by default, as it's quite slow.
We can run it if we suspect problems by passing -x to DM.

This test would have been failing before the bug fix, and now is passing.

Assuming the Priv on the end means it's not considered public API...
TBR=reed@google.com

BUG=skia:4052

Review URL: https://codereview.chromium.org/1228333003
2015-07-16 07:01:40 -07:00
reed
6fb0b6779e guard to remove DrawBitmapRectFlags
BUG=skia:

Review URL: https://codereview.chromium.org/1235393003
2015-07-16 06:10:02 -07:00
caryclark
18a240d15c make *imagefilter morphology iamge bitmapsource gm portable
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1236403002
2015-07-15 14:23:50 -07:00
caryclark
e148ac5262 make strokefill gm portable
Convert the Mac-specific font text statically into
paths so that they draw the same on all platforms.

Add drawing portable text using the fake bold paint
setting so that the code path is tested everywhere
and but draws the same thing.

R=reed@google.com

Review URL: https://codereview.chromium.org/1234463006
2015-07-15 14:03:13 -07:00
caryclark
5df0575f04 make gradtext quadpaths gm portable
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1234233003
2015-07-15 11:57:00 -07:00
caryclark
3aaa0db1c4 make colorwheelnative displacement dropshadowimagefilter getposttextpath gm portable
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1237233004
2015-07-15 09:29:32 -07:00
caryclark
cae3ca65d2 make path-reverse gm portable
Put font glyph data in test as path
instead of getting data from the Mac
font. THe font may change, and is
not available on most platforms.

Also remove unreachable code.

R=reed@google.com

Review URL: https://codereview.chromium.org/1230703005
2015-07-15 08:58:13 -07:00
caryclark
108b5b2c23 make linepaths gm portable
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1225303010
2015-07-15 06:18:47 -07:00
caryclark
001ceb7e1b remove funkster from dcshader gm
The multicolored font that funster enables
only draws and measures on some platforms.

Removing it from the dcshader gm allows
the layout to be uniform on all devices,
making it easier to compare the output
in gold.

TBR=bsalomon@google.com

Review URL: https://codereview.chromium.org/1231853004
2015-07-15 05:43:38 -07:00
jvanverth
8895792877 Rename backing texture testing routines
Review URL: https://codereview.chromium.org/1230193006
2015-07-14 11:02:52 -07:00
reed
a5517e2b19 add src-rect-constraint to drawImageRect
Follow-on work
- unify around SrcRectConstraint (i.e. drawBitmapRect)
- remove silly drawBitmapRectToRect alias
- clean-up (possibly remove) alias problems around drawBitmapRect + IRect parameter

BUG=skia:

Review URL: https://codereview.chromium.org/1228083004
2015-07-14 10:54:12 -07:00
robertphillips
3d32d768cd Add new SkPoint3 class
The existing Light filter and the upcoming Lighting Shader both need a Point3 class

Review URL: https://codereview.chromium.org/1229693009
2015-07-13 13:16:44 -07:00
caryclark
7aa1899c03 use portable typeface
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1235873004
2015-07-13 12:08:45 -07:00
mtklein
e20633ed26 Add a GM that reproduces layout test failures with my new xfermode code.
Inspired by https://storage.googleapis.com/chromium-layout-test-archives/linux_blink_rel/69169/layout-test-results/results.html

I think the root cause is overflow.

Also, adds tests for Sk16b::operator<().  It wasn't wrong, but it was suspect
(used in all three of these xfermode implementations) and so it's best to have
tests.

BUG=skia:

Review URL: https://codereview.chromium.org/1228393006
2015-07-13 12:06:33 -07:00
caryclark
1e545b6915 make gm text and colors portable
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1236893002
2015-07-13 08:19:58 -07:00
joshualitt
1c735488cb Start to propagate constness of GrPipelineBuilder up the stack
BUG=skia:

Review URL: https://codereview.chromium.org/1229143007
2015-07-13 08:08:25 -07:00
jvanverth
672bb7fc66 Remove GL-specific code from GMs and tests
TBR=bsalomon@google.com

Review URL: https://codereview.chromium.org/1232173002
2015-07-13 07:19:57 -07:00
mtklein
f059900f75 Fix up -Winconsistent-missing-override
(and a couple presubmit fixes)

This allows us to turn back on -Werror for LLVM coverage builds,
and more generally supports building with Clang 3.7.

No public API changes.
TBR=reed@google.com

BUG=skia:

Review URL: https://codereview.chromium.org/1232463006
2015-07-13 06:18:39 -07:00
caryclark
2e096609b2 make convex poly clip portable
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1238483002
2015-07-13 05:39:47 -07:00
joshualitt
7b670db2b4 Remove setFromPaint from GrPipelineBuilder
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1227153003
2015-07-09 13:25:02 -07:00
reed
1c84634454 add runtime option to provide data->imagegenerator factory
BUG=skia:

Review URL: https://codereview.chromium.org/1229933003
2015-07-09 11:47:36 -07:00
joshualitt
5f10b5c1b5 More threading of GrProcessorDataManager
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1230813003
2015-07-09 10:24:36 -07:00
joshualitt
2cdec31c29 YUV to RGB Texture threading GrProcessorDataManager
BUG=skia:

Review URL: https://codereview.chromium.org/1230803002
2015-07-09 07:31:32 -07:00
joshualitt
9cc1775e72 rename GrShaderDataManager -> GrProcessorDataManager
BUG=skia:

Review URL: https://codereview.chromium.org/1228683002
2015-07-09 06:28:14 -07:00
joshualitt
b2456053c7 more threading of GrShaderDataManager
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1215643006
2015-07-08 09:36:59 -07:00
joshualitt
8ca93e7c73 Initial CL to create dummy GrShaderDataManager and thread it through
TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1225673007
2015-07-08 06:51:43 -07:00
reed
a8db72864a add matrix options to drawDrawable
BUG=skia:

Review URL: https://codereview.chromium.org/1224783002
2015-07-07 10:22:31 -07:00
mtklein
d2baa90938 Make sp- via support SkDrawables; add a GM to test it.
BUG=skia:

Review URL: https://codereview.chromium.org/1212363005
2015-07-07 09:43:28 -07:00
reed
5617900063 add SkImage::NewFromBitmap
BUG=skia:

Review URL: https://codereview.chromium.org/1217053003
2015-07-07 06:11:20 -07:00
robertphillips
d312dcade1 Revert of Revert of Revert of Fix SkTileImageFilter clipping/cropRect interaction issue (patchset #1 id:1 of https://codereview.chromium.org/1207353004/)
Reason for revert:
Still want to disable due to pref regression

Original issue's description:
> Revert of Revert of Fix SkTileImageFilter clipping/cropRect interaction issue (patchset #1 id:1 of https://codereview.chromium.org/1219193002/)
>
> Reason for revert:
> Blocking the roll
>
> Original issue's description:
> > Revert of Fix SkTileImageFilter clipping/cropRect interaction issue (patchset #2 id:30001 of https://codereview.chromium.org/1210053003/)
> >
> > Reason for revert:
> > Perf regression: https://code.google.com/p/chromium/issues/detail?id=505564
> >
> > Original issue's description:
> > > Fix SkTileImageFilter clipping/cropRect interaction issue
> > >
> > > BUG=499499
> > >
> > > Committed: https://skia.googlesource.com/skia/+/157bcd0840b578060dbc3365daafffc6837da391
> >
> > TBR=reed@google.com,senorblanco@google.com,senorblanco@chromium.org,robertphillips@google.com
> > NOPRESUBMIT=true
> > NOTREECHECKS=true
> > NOTRY=true
> > BUG=499499
> >
> > Committed: https://skia.googlesource.com/skia/+/ebaf6a69bf604c85185e23aca3fb93308e747ff5
>
> TBR=reed@google.com,senorblanco@google.com,senorblanco@chromium.org,robertphillips@google.com,reed@chromium.org,bsalomon@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=499499
>
> Committed: https://skia.googlesource.com/skia/+/835510085062f055c04d8ea46d82831cfbe51793

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

Review URL: https://codereview.chromium.org/1217303004
2015-07-06 07:59:09 -07:00
jvanverth
8355100850 Revert of Revert of Fix SkTileImageFilter clipping/cropRect interaction issue (patchset #1 id:1 of https://codereview.chromium.org/1219193002/)
Reason for revert:
Blocking the roll

Original issue's description:
> Revert of Fix SkTileImageFilter clipping/cropRect interaction issue (patchset #2 id:30001 of https://codereview.chromium.org/1210053003/)
>
> Reason for revert:
> Perf regression: https://code.google.com/p/chromium/issues/detail?id=505564
>
> Original issue's description:
> > Fix SkTileImageFilter clipping/cropRect interaction issue
> >
> > BUG=499499
> >
> > Committed: https://skia.googlesource.com/skia/+/157bcd0840b578060dbc3365daafffc6837da391
>
> TBR=reed@google.com,senorblanco@google.com,senorblanco@chromium.org,robertphillips@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=499499
>
> Committed: https://skia.googlesource.com/skia/+/ebaf6a69bf604c85185e23aca3fb93308e747ff5

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

Review URL: https://codereview.chromium.org/1207353004
2015-07-03 05:48:53 -07:00
bsalomon
ebaf6a69bf Revert of Fix SkTileImageFilter clipping/cropRect interaction issue (patchset #2 id:30001 of https://codereview.chromium.org/1210053003/)
Reason for revert:
Perf regression: https://code.google.com/p/chromium/issues/detail?id=505564

Original issue's description:
> Fix SkTileImageFilter clipping/cropRect interaction issue
>
> BUG=499499
>
> Committed: https://skia.googlesource.com/skia/+/157bcd0840b578060dbc3365daafffc6837da391

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

Review URL: https://codereview.chromium.org/1219193002
2015-07-01 11:02:50 -07:00
mtklein
2766c00fc0 remove SkInstCnt
It's been outclassed by Valgrind and leak sanitizer,
and it seems to be causing problems for external folks building Skia.

I'm not sure why our own builds seem unaffected.

Latest thread:
https://groups.google.com/forum/#!topic/skia-discuss/oj9FsQwwSF0

BUG=skia:

Review URL: https://codereview.chromium.org/1217573002
2015-06-26 11:45:03 -07:00
mtklein
46043ee50f Kill mixedxfermodes
It's too random to be helpful.

BUG=skia:

Review URL: https://codereview.chromium.org/1215703005
2015-06-26 11:43:30 -07:00
robertphillips
157bcd0840 Fix SkTileImageFilter clipping/cropRect interaction issue
BUG=499499

Review URL: https://codereview.chromium.org/1210053003
2015-06-26 08:07:39 -07:00
reed
f9ad558943 Revert of Revert of Return GrGLContext from GrTestTarget (patchset #1 id:1 of https://codereview.chromium.org/1211123004/)
Reason for revert:
un-referting, did not help DEPS roll

Original issue's description:
> Revert of Return GrGLContext from GrTestTarget (patchset #3 id:40001 of https://codereview.chromium.org/1207393002/)
>
> Reason for revert:
> speculative revert to unblock DEPS roll (layout-tests)
>
> Original issue's description:
> > Return GrGLContext from GrTestTarget
> >
> > BUG=skia:
> >
> > Committed: https://skia.googlesource.com/skia/+/b6d93ea428ca5d13641c35faca7d0380980a3a17
>
> TBR=bsalomon@google.com,joshualitt@google.com,joshualitt@chromium.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/1852ec2b46a2a0efbb3550ff4d8b640f56a810e9

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

Review URL: https://codereview.chromium.org/1215593002
2015-06-25 21:29:25 -07:00
reed
1852ec2b46 Revert of Return GrGLContext from GrTestTarget (patchset #3 id:40001 of https://codereview.chromium.org/1207393002/)
Reason for revert:
speculative revert to unblock DEPS roll (layout-tests)

Original issue's description:
> Return GrGLContext from GrTestTarget
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/b6d93ea428ca5d13641c35faca7d0380980a3a17

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

Review URL: https://codereview.chromium.org/1211123004
2015-06-25 18:59:32 -07:00
joshualitt
b6d93ea428 Return GrGLContext from GrTestTarget
BUG=skia:

Review URL: https://codereview.chromium.org/1207393002
2015-06-25 15:02:22 -07:00
reed
4c21dc5ddf add drawImageNine
this also exposes nine-patch drawing directly to devices, and creates a shared iterator for unrolling a nine-patch into single rect->rect draws.

BUG=skia:

Review URL: https://codereview.chromium.org/1211583003
2015-06-25 12:32:03 -07:00
reed
71c3c760a8 add SkCanvas::drawAtlas
BUG=skia:

Review URL: https://codereview.chromium.org/1181913003
2015-06-24 10:29:18 -07:00
reed
5fbb623099 add more tests
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1201333002
2015-06-23 14:34:58 -07:00
robertphillips
da57105708 Fix memory leak in simple-offsetimagefilter
Review URL: https://codereview.chromium.org/1203613004
2015-06-23 09:28:52 -07:00
reed
b3fe1b87e0 more tests for offsetimagefilter
BUG=skia:

Review URL: https://codereview.chromium.org/1199933011
2015-06-23 08:29:20 -07:00
robertphillips
702edbd4bc Propagate SkSurfaceProps to more call sites
Start moving to a world where everyone provides surface properties.

Most notably this exposes a portion of SkSurfaceProps to the C API.

BUG=skia:3934

Review URL: https://codereview.chromium.org/1195003003
2015-06-23 06:26:08 -07:00
reed
477fdd8aa4 add simple test for offsetimagefilter
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1204723002
2015-06-23 06:01:10 -07:00
reed
871872f3f2 change old picture serialization to really handle images
BUG=skia:3965

Review URL: https://codereview.chromium.org/1199473002
2015-06-22 12:48:26 -07:00
robertphillips
9a53fd7c41 Begin kLegacyFontHost_InitType cleanup
This CL starts the process of pushing kLegacyFontHost_InitType-type SkSurfaceProps up the call stack and out of Skia. It:

 Gets rid of the default SkBaseDevice ctor. This means everyone has to always hand an explicit SkSurfaceProps to it.

 It makes public the SkBitmapDevice creation methods that require SkSurfaceProps.

 Removes (in Skia's code base) all SkBitmapDevice ctor calls w/o SkSurfaceProps.

 Makes the "recording" canvases (e.g., pdf, svg, xps) explicitly not use kLegacyFontHost_InitType.

 Replicates the creating canvas/device's flags on saveLayer devices

BUG=skia:3934

Review URL: https://codereview.chromium.org/1204433002
2015-06-22 09:46:59 -07:00
reed
462a33c7ac clean offsetimagefilter gm
BUG=skia:
TBR=robertphilips

Review URL: https://codereview.chromium.org/1203473002
2015-06-22 09:10:14 -07:00
jvanverth
34d7288b19 Change large glyph check back to > threshold.
Using >= misses some Chromium test cases that are still
being rendered as paths.

BUG=chromium:467569

Review URL: https://codereview.chromium.org/1202433002
2015-06-22 08:08:09 -07:00
jvanverth
4854d13c27 Remove distance field flag from SkPaint
Review URL: https://codereview.chromium.org/1192413005
2015-06-22 06:46:56 -07:00
robertphillips
c3176aa5e5 Fix dst bound reported by SkTileImageFilter
In the example from the bug we had the filter DAG:

color filter (table)
    0: xfermode filter (arith)
        0: tile filter [0,80,34,114] -> [0,80,800,480]
             0: color filter (table)
                 0: bitmap src 34x34 -> [0,80,34,114]
        1: color filter (table)
             0: picture filter [0, 80, 800, 480]

computeFastBounds was coming out of the DAG with a bound of [0,80,34,114] which didn't represent the pixels that would be drawn.

This CL updates SkTileImageFilter to correctly set the bound for the pixels it will hit.

BUG=493783

Committed: https://skia.googlesource.com/skia/+/05be93bbdf09576f7903130e3b106b0a8c7c4b4e

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

Review URL: https://codereview.chromium.org/1152553006
2015-06-16 09:44:56 -07:00
fmalita
109a23d64f Remove the SkCanvas comment API
No longer used in Chromium/Blink.

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

Review URL: https://codereview.chromium.org/1153593003
2015-06-15 13:15:31 -07:00
caryclark
65cdba6ba7 Revert of Revert of make gm background colors 565 compatible (patchset #1 id:1 of https://codereview.chromium.org/1184123002/)
Reason for revert:
underlying problem with portable refs deleted more than once fixed

Original issue's description:
> Revert of make gm background colors 565 compatible (patchset #2 id:20001 of https://codereview.chromium.org/1176243006/)
>
> Reason for revert:
> breaks many bots with refcnt error
>
> Original issue's description:
> > make gm background colors 565 compatible
> >
> > Change a batch of GM tests to convert their background color
> > so that it is representable in 8888 and 565.
> >
> > Enable portable text in those same tests to minimize platform
> > differences.
> >
> > In a couple of bitmap tests, use portable typefaces instead of
> > choosing 'Times' which may or may not be available on the platform.
> >
> > R=borenet@google.com
> >
> > Committed: https://skia.googlesource.com/skia/+/be7f768a357aefb39c42d24b81b24d647bb6ab70
>
> TBR=borenet@google.com
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
>
> Committed: https://skia.googlesource.com/skia/+/0bdb08b1ba8fbd18c4838f86a23f1ef4b3a3bfdf

TBR=borenet@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1182403003
2015-06-15 06:51:08 -07:00
caryclark
0bdb08b1ba Revert of make gm background colors 565 compatible (patchset #2 id:20001 of https://codereview.chromium.org/1176243006/)
Reason for revert:
breaks many bots with refcnt error

Original issue's description:
> make gm background colors 565 compatible
>
> Change a batch of GM tests to convert their background color
> so that it is representable in 8888 and 565.
>
> Enable portable text in those same tests to minimize platform
> differences.
>
> In a couple of bitmap tests, use portable typefaces instead of
> choosing 'Times' which may or may not be available on the platform.
>
> R=borenet@google.com
>
> Committed: https://skia.googlesource.com/skia/+/be7f768a357aefb39c42d24b81b24d647bb6ab70

TBR=borenet@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1184123002
2015-06-15 05:28:00 -07:00
caryclark
be7f768a35 make gm background colors 565 compatible
Change a batch of GM tests to convert their background color
so that it is representable in 8888 and 565.

Enable portable text in those same tests to minimize platform
differences.

In a couple of bitmap tests, use portable typefaces instead of
choosing 'Times' which may or may not be available on the platform.

R=borenet@google.com

Review URL: https://codereview.chromium.org/1176243006
2015-06-15 05:09:59 -07:00
caryclark
82fecd4d53 make drawlooper portable
TBR=djsollen@google.com

Review URL: https://codereview.chromium.org/1187603002
2015-06-12 13:41:02 -07:00
caryclark
6eba305422 remove lcd
TBR=djsollen@google.com

Review URL: https://codereview.chromium.org/1183753002
2015-06-12 12:25:26 -07:00
caryclark
d85093c28f make emptypath portable; add 565 color utility
R=djsollen@google.com

Review URL: https://codereview.chromium.org/1182833004
2015-06-12 11:49:04 -07:00
caryclark
ceb9f3b389 update complexclip to portable
TBR=djsollen@google.com

Review URL: https://codereview.chromium.org/1179713007
2015-06-12 10:00:11 -07:00
caryclark
57856a1f58 convert cubicpaths gm tests to portable
TBR=djsollen

Review URL: https://codereview.chromium.org/1182113002
2015-06-12 08:54:38 -07:00
caryclark
7e85216104 fix portable text in test
TBR=djsollen@google.com

Review URL: https://codereview.chromium.org/1179173003
2015-06-12 08:18:45 -07:00
caryclark
ceadfefb93 next batch of portable typeface changes
TBR=djsollen@google.com

Review URL: https://codereview.chromium.org/1177303005
2015-06-12 05:42:58 -07:00
reed
026beb52a2 SkPath::Direction serves two masters:
- input param to addFoo (e.g. addRect), where only CW or CCW are valid)
- output param from computing functions, that sometimes return kUnknown

This CL's intent is to split these into distinct enums/features:
- Direction (public) loses kUnknown, and is only used for input
- FirstDirection (private) is used for computing the first direction we see when analyzing a contour

BUG=skia:

Review URL: https://codereview.chromium.org/1176953002
2015-06-10 14:23:15 -07:00
caryclark
d3c162200f turn on antialiased text
Aliased text didn't work with msaa16, so make it all
antialiased.

TBR=reed@google.com

Review URL: https://codereview.chromium.org/1169173006
2015-06-10 10:34:08 -07:00
caryclark
83ca628cb6 Today's gm include many differences caused by platform font implementations.
This experiment replaces the label used in the aaxfermodes gm with
aliased text generated from paths common to all platforms.

Since there is no way today to generate all dm output from trybots,
this will be checked in to confirm that this strategy provides simpler
output across devices.

This does not introduce a new public interface; instead, dm uses
a extern backdoor to install the SkTypeface::CreateFromName
handler.

Review URL: https://codereview.chromium.org/1163283002
2015-06-10 09:31:09 -07:00
reed
41e010cb90 Revert[2] SkDraw and all Blitters to use pixmap instead of bitmapi
This reverts commit b3f0ec9f99.

BUG=skia:

Review URL: https://codereview.chromium.org/1168303006
2015-06-09 12:16:53 -07:00
reed
b3f0ec9f99 Revert of change SkDraw and all Blitters to use pixmap instead of bitmap (patchset #6 id:100001 of https://codereview.chromium.org/1148793007/)
Reason for revert:
speculative revert to try to unblock DEPS roll

Original issue's description:
> change SkDraw and all Blitters to use pixmap instead of bitmap
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/c31af44336f5eb4a50e83e76e51962d46c3ed458

TBR=scroggo@google.com,jvanverth@google.com,reed@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1164373003
2015-06-08 19:58:07 -07:00
reed
c31af44336 change SkDraw and all Blitters to use pixmap instead of bitmap
BUG=skia:

Review URL: https://codereview.chromium.org/1148793007
2015-06-08 10:47:13 -07:00
robertphillips
63195181d1 Add bigtileimagefilter GM & improvements to toString
This is all the ancillary code from https://codereview.chromium.org/1152553006/ (Fix dst bound reported by SkTileImageFilter).

TBR=reed@google.com, senorblanco@google.com

Review URL: https://codereview.chromium.org/1169713003
2015-06-08 06:21:14 -07:00
robertphillips
270fe6aad5 Revert of Fix dst bound reported by SkTileImageFilter (patchset #3 id:40001 of https://codereview.chromium.org/1152553006/)
Reason for revert:
Blink

Original issue's description:
> Fix dst bound reported by SkTileImageFilter
>
> In the example from the bug we had the filter DAG:
>
> color filter (table)
>     0: xfermode filter (arith)
>         0: tile filter [0,80,34,114] -> [0,80,800,480]
>              0: color filter (table)
>                  0: bitmap src 34x34 -> [0,80,34,114]
>         1: color filter (table)
>              0: picture filter [0, 80, 800, 480]
>
> computeFastBounds was coming out of the DAG with a bound of [0,80,34,114] which didn't represent the pixels that would be drawn.
>
> This CL updates SkTileImageFilter to correctly set the bound for the pixels it will hit.
>
> BUG=493783
>
> Committed: https://skia.googlesource.com/skia/+/05be93bbdf09576f7903130e3b106b0a8c7c4b4e
>
> Committed: https://skia.googlesource.com/skia/+/0be685755f942baea26c66a87226b569fc17e960

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

Review URL: https://codereview.chromium.org/1156583004
2015-06-04 11:15:27 -07:00
caryclark
99a69eb152 make test hittestpath random calls deterministic
R=bsalomon@google.com

Review URL: https://codereview.chromium.org/1157943006
2015-06-04 09:27:43 -07:00
halcanary
74015ed78e Add GM that tests clipping annotations
TBR=reed@google.com

BUG=skia:3880

Review URL: https://codereview.chromium.org/1159273003
2015-06-04 07:26:54 -07:00
robertphillips
0be685755f Fix dst bound reported by SkTileImageFilter
In the example from the bug we had the filter DAG:

color filter (table)
    0: xfermode filter (arith)
        0: tile filter [0,80,34,114] -> [0,80,800,480]
             0: color filter (table)
                 0: bitmap src 34x34 -> [0,80,34,114]
        1: color filter (table)
             0: picture filter [0, 80, 800, 480]

computeFastBounds was coming out of the DAG with a bound of [0,80,34,114] which didn't represent the pixels that would be drawn.

This CL updates SkTileImageFilter to correctly set the bound for the pixels it will hit.

BUG=493783

Committed: https://skia.googlesource.com/skia/+/05be93bbdf09576f7903130e3b106b0a8c7c4b4e

Review URL: https://codereview.chromium.org/1152553006
2015-06-04 06:53:37 -07:00
robertphillips
a66cc7e1e0 Revert of Fix dst bound reported by SkTileImageFilter (patchset #3 id:40001 of https://codereview.chromium.org/1152553006/)
Reason for revert:
breaking tests

Original issue's description:
> Fix dst bound reported by SkTileImageFilter
>
> In the example from the bug we had the filter DAG:
>
> color filter (table)
>     0: xfermode filter (arith)
>         0: tile filter [0,80,34,114] -> [0,80,800,480]
>              0: color filter (table)
>                  0: bitmap src 34x34 -> [0,80,34,114]
>         1: color filter (table)
>              0: picture filter [0, 80, 800, 480]
>
> computeFastBounds was coming out of the DAG with a bound of [0,80,34,114] which didn't represent the pixels that would be drawn.
>
> This CL updates SkTileImageFilter to correctly set the bound for the pixels it will hit.
>
> BUG=493783
>
> Committed: https://skia.googlesource.com/skia/+/05be93bbdf09576f7903130e3b106b0a8c7c4b4e

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

Review URL: https://codereview.chromium.org/1143083006
2015-06-02 10:57:26 -07:00
robertphillips
05be93bbdf Fix dst bound reported by SkTileImageFilter
In the example from the bug we had the filter DAG:

color filter (table)
    0: xfermode filter (arith)
        0: tile filter [0,80,34,114] -> [0,80,800,480]
             0: color filter (table)
                 0: bitmap src 34x34 -> [0,80,34,114]
        1: color filter (table)
             0: picture filter [0, 80, 800, 480]

computeFastBounds was coming out of the DAG with a bound of [0,80,34,114] which didn't represent the pixels that would be drawn.

This CL updates SkTileImageFilter to correctly set the bound for the pixels it will hit.

BUG=493783

Review URL: https://codereview.chromium.org/1152553006
2015-06-02 10:52:43 -07:00
bsalomon
993a4216a6 SkImage::NewFromYUVTexturesCopy
Review URL: https://codereview.chromium.org/1149553002
2015-05-29 11:37:25 -07:00
cdalton
6fd158ea47 Implement Porter Duff XP with a blend table
Removes the runtime logic used by PorterDuffXferProcessor to decide
blend coeffs and shader outputs, and instead uses a compile-time
constant table of pre-selected blend formulas. Separates out the dst
read fallback into its own XP.

Introduces a new blend strategy for srcCoeff=0 that can apply coverage
with a reverse subtract blend equation instead of dual source
blending.

Adds new macros in GrBlend.h to analyze blend formulas both runtime.

Removes kSetCoverageDrawing_OptFlag and GrSimplifyBlend as they are no
longer used.

Adds a GM that verifies all xfermodes, including arithmetic, with the
color/coverage invariants used by Porter Duff.

Adds a unit test that verifies each Porter Duff formula with every
color/coverage invariant.

Major changes:

 * Uses a reverse subtract blend equation for coverage when srcCoeff=0
   (clear, dst-out [Sa=1], dst-in, modulate). Platforms that don't
   support dual source blending no longer require a dst copy for
   dst-in and modulate.

 * Sets BlendInfo::fWriteColor to false when the blend does not modify
   the dst. GrGLGpu will now use glColorMask instead of blending for
   these modes (dst, dst-in [Sa=1], modulate ignored for [Sc=1]).

 * Converts all SA blend coeffs to One for opaque inputs, and ISA to
   Zero if there is also no coverage. (We keep ISA around when there
   is coverage because we use it to tweak alpha for coverage.)

 * Abandons solid white optimizations for the sake of simplicity
   (screen was the only mode that previous had solid white opts).

Minor differences:

 * Inconsequential differences in opt flags (e.g. we now return
   kCanTweakAlphaForCoverage_OptFlag even when there is no coverage).

 * Src coeffs when the shader outputs 0.

 * IS2C vs IS2A when the secondary output is scalar.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/9a70920db22b6309c671f8e5d519bb95570e4414

Review URL: https://codereview.chromium.org/1124373002
2015-05-27 15:08:33 -07:00
bsalomon
4ee6bd86c5 Add caps overrides to GMs
Review URL: https://codereview.chromium.org/1158963002
2015-05-27 13:23:23 -07:00
joshualitt
7a9c45c01c real fix for textblob use after gpu free
This patch addresses two issues:
1) Textblobs with abandoned strikes were not properly regenerating.
2) Provided by ericrk - GrTextBlobCache removed blobs from |fCache| during freeAll, but left
potentially released blobs in the |fBlobList|. We now remove these from
|fBlobList| as well.
BUG=skia:

Review URL: https://codereview.chromium.org/1160633002
2015-05-26 12:32:23 -07:00
robertphillips
ea46150344 Split drawing functionality out of GrContext and into new GrDrawContext
This is mainly a mechanical CL. There were some fiddly bits in GrContext.cpp where it no longer had access to the GrDrawTarget (and had to use the new GrDrawContext).

I've converted GrAARectRenderer & GrOvalRenderer into static classes so I could stop allocating them.

Review URL: https://codereview.chromium.org/1151283004
2015-05-26 11:38:03 -07:00
bungeman
c33db93d1b Revert of Implement Porter Duff XP with a blend table (patchset #12 id:220001 of https://codereview.chromium.org/1124373002/)
Reason for revert:
Blocking DEPS roll into Chromium. Crashing virtual/gpu/fast/canvas/canvas-composite-*.html tests with the assert

../../third_party/skia/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp:281: failed assertion "k110_GrGLSLGeneration != gpu->glslGeneration() || fOutputs.empty()"

Original issue's description:
> Implement Porter Duff XP with a blend table
>
> Removes the runtime logic used by PorterDuffXferProcessor to decide
> blend coeffs and shader outputs, and instead uses a compile-time
> constant table of pre-selected blend formulas.
>
> Introduces a new blend strategy for srcCoeff=0 that can apply coverage
> with a reverse subtract blend equation instead of dual source
> blending.
>
> Adds new macros in GrBlend.h to analyze blend formulas both runtime.
>
> Removes kSetCoverageDrawing_OptFlag and GrSimplifyBlend as they are no
> longer used.
>
> Adds a GM that verifies all xfermodes, including arithmetic, with the
> color/coverage invariants used by Porter Duff.
>
> Adds a unit test that verifies each Porter Duff formula with every
> color/coverage invariant.
>
> Major changes:
>
>  * Uses a reverse subtract blend equation for coverage when srcCoeff=0
>    (clear, dst-out [Sa=1], dst-in, modulate). Platforms that don't
>    support dual source blending no longer require a dst copy for
>    dst-in and modulate.
>
>  * Sets BlendInfo::fWriteColor to false when the blend does not modify
>    the dst. GrGLGpu will now use glColorMask instead of blending for
>    these modes (dst, dst-in [Sa=1], modulate ignored for [Sc=1]).
>
>  * Converts all SA blend coeffs to One for opaque inputs, and ISA to
>    Zero if there is also no coverage. (We keep ISA around when there
>    is coverage because we use it to tweak alpha for coverage.)
>
>  * Abandons solid white optimizations for the sake of simplicity
>    (screen was the only mode that previous had solid white opts).
>
> Minor differences:
>
>  * Inconsequential differences in opt flags (e.g. we now return
>    kCanTweakAlphaForCoverage_OptFlag even when there is no coverage).
>
>  * Src coeffs when the shader outputs 0.
>
>  * IS2C vs IS2A when the secondary output is scalar.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/9a70920db22b6309c671f8e5d519bb95570e4414

TBR=egdaniel@google.com,bsalomon@google.com,cdalton@nvidia.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1153993002
2015-05-22 17:55:26 -07:00
cdalton
9a70920db2 Implement Porter Duff XP with a blend table
Removes the runtime logic used by PorterDuffXferProcessor to decide
blend coeffs and shader outputs, and instead uses a compile-time
constant table of pre-selected blend formulas.

Introduces a new blend strategy for srcCoeff=0 that can apply coverage
with a reverse subtract blend equation instead of dual source
blending.

Adds new macros in GrBlend.h to analyze blend formulas both runtime.

Removes kSetCoverageDrawing_OptFlag and GrSimplifyBlend as they are no
longer used.

Adds a GM that verifies all xfermodes, including arithmetic, with the
color/coverage invariants used by Porter Duff.

Adds a unit test that verifies each Porter Duff formula with every
color/coverage invariant.

Major changes:

 * Uses a reverse subtract blend equation for coverage when srcCoeff=0
   (clear, dst-out [Sa=1], dst-in, modulate). Platforms that don't
   support dual source blending no longer require a dst copy for
   dst-in and modulate.

 * Sets BlendInfo::fWriteColor to false when the blend does not modify
   the dst. GrGLGpu will now use glColorMask instead of blending for
   these modes (dst, dst-in [Sa=1], modulate ignored for [Sc=1]).

 * Converts all SA blend coeffs to One for opaque inputs, and ISA to
   Zero if there is also no coverage. (We keep ISA around when there
   is coverage because we use it to tweak alpha for coverage.)

 * Abandons solid white optimizations for the sake of simplicity
   (screen was the only mode that previous had solid white opts).

Minor differences:

 * Inconsequential differences in opt flags (e.g. we now return
   kCanTweakAlphaForCoverage_OptFlag even when there is no coverage).

 * Src coeffs when the shader outputs 0.

 * IS2C vs IS2A when the secondary output is scalar.

BUG=skia:

Review URL: https://codereview.chromium.org/1124373002
2015-05-22 11:36:57 -07:00
reed
5a72c42952 remove unused SkBitmap::scrollRect API
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1154623002
2015-05-21 15:46:20 -07:00
mtklein
7005a57c54 Add PlusMergesAA GM
C.f. https://crrev.com/1156453002/

BUG=skia:

Review URL: https://codereview.chromium.org/1149103003
2015-05-21 10:33:09 -07:00
kkinnunen
b4a797f3aa Move font loading in gm tests and benches out of constructors
Constructing the gm tests and benches causes many calls to font loads.
This is visible as profiling samples in fontconfig and freetype on Linux
for all profiling runs of nanobench. This complicates analysis of
test-cases that are suspected of being slow due to font-related issues.

Move the font loading to GM::onOnceBeforeDraw and Benchmark::onPreDraw.
This way the code is not executed if the testcase does not match the
nanobench --match filter. This way the samples in font-related code are
more easy to identify as legitimate occurances caused by the testcase.

This should not cause differences in timings, because:
* Benchmark::preDraw / onPreDraw is defined to be run outside the timer
* GM::runAsBench is not enabled for any of the modified testcases. Also
  nanobench untimed warmup round should run the onOnceBeforeDraw.
  (and there are other GM::runAsBench gms already doing loading in
   onOnceBeforeDraw).

Changes the behavior:
In TextBench:
Before, the test would report two different gms with the same name if
the color emoji font was not loaded successfully.
After, the test always reports all tests as individual names.

Generally:
The errors from loading fonts now print inbetween each testcase, as
opposed to printing during construction phase. Sample output:
( 143/145 MB  1872) 14.7ms	8888 gm  quadclosepathResource /fonts/Funkster.ttf not a valid font.
( 160/160 MB  1831) 575µs	8888 gm  surfacenewResource /fonts/Funkster.ttf not a valid font.
( 163/165 MB  1816) 12.5ms	8888 gm  linepathResource /fonts/Funkster.ttf not a valid font.
( 263/411 MB  1493) 118ms	8888 gm  typefacestyles_kerningResource /fonts/Funkster.ttf not a valid font.
( 374/411 MB  1231) 7.16ms	565 gm  getpostextpathResource /fonts/Funkster.ttf not a valid font.
( 323/411 MB  1179) 4.92ms	565 gm  stringartResource /fonts/Funkster.ttf not a valid font.
( 347/493 MB   917) 191ms	565 gm  patch_gridResource /fonts/Funkster.ttf not a valid font.
( 375/493 MB   857) 23.9ms	gpu gm  clipdrawdrawCannot render path (0)
( 393/493 MB   706) 2.91ms	unit test  ParsePath------ png error IEND: CRC error
( 394/493 MB   584) 166ms	gpu gm  hairmodesResource /fonts/Funkster.ttf not a valid font.
Resource /fonts/Funkster.ttf not a valid font.
Resource /fonts/Funkster.ttf not a valid font.
...

Review URL: https://codereview.chromium.org/1144023002
2015-05-21 06:15:28 -07:00
bungeman
41868fe562 Font variations.
Multiple Master and TrueType fonts support variation axes.
This implements back-end support for axes on platforms which
support it.

Committed: https://skia.googlesource.com/skia/+/05773ed30920c0214d1433c07cf6360a05476c97

Committed: https://skia.googlesource.com/skia/+/3489ee0f4fa34f124f9de090d12bdc2107d52aa9

Review URL: https://codereview.chromium.org/1027373002
2015-05-20 09:21:04 -07:00
caryclark
612f70d5fa handle large conic strokes better
A stroked conic computes the outset quad's control point by
computing the intersection of the quad's endpoints. If the
the denominator used to compute the scale factor for the
control point is small, check to see if the numerator is also
small so that the division stays bounded.

Also clean up error returns and internal function calls to
simplify the code.

Additionally, remove comic max curvature (unimplemented) and call
extrema functions instead to handle cases where the conic is degenerate
or is a line.

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

Review URL: https://codereview.chromium.org/1144883003
2015-05-19 11:05:37 -07:00
joshualitt
b8c241ad09 Preliminary attempt to remove batch tracker
BUG=skia:

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

Review URL: https://codereview.chromium.org/1139723004
2015-05-19 08:23:30 -07:00
joshualitt
d3a560fa80 Revert of Preliminary attempt to remove batch tracker (patchset #3 id:40001 of https://codereview.chromium.org/1139723004/)
Reason for revert:
breaking bots

Original issue's description:
> Preliminary attempt to remove batch tracker
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/cbfe91d82500f4ae8c3ff7bd74b3021a4b89fd84

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

Review URL: https://codereview.chromium.org/1132323003
2015-05-19 07:15:28 -07:00
joshualitt
cbfe91d825 Preliminary attempt to remove batch tracker
BUG=skia:

Review URL: https://codereview.chromium.org/1139723004
2015-05-19 06:49:32 -07:00
robertphillips
2e5b4c52c5 Fix GrAARectRenderer's handling of unsorted nested rects
What is going on here is that, after the mapPoints in fillAANestedRects, devInside was upside down so the isEmpty check was always firing. I don't see why we need to avoid having devInside sorted.

BUG=488103

Review URL: https://codereview.chromium.org/1135753004
2015-05-19 04:35:39 -07:00
reed
2ba21a08d4 add GM to test extractAlpha
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1142123003
2015-05-18 12:57:56 -07:00
robertphillips
465706820d Revert of Font variations. (patchset #26 id:500001 of https://codereview.chromium.org/1027373002/)
Reason for revert:
Appears to be breaking  Linux ARM bots:

FAILED:
/usr/local/google/home/mosaic-role/slave/repo_clients/chromium_tot/chromium/src/../../prebuilt/toolchain/armv7a/bin/armv7a-cros-linux-gnueabi-g++
... -o obj/third_party/skia/src/ports/skia_library.SkFontHost_FreeType.o
../../third_party/skia/src/ports/SkFontHost_FreeType.cpp:37:31: fatal error:
freetype/ftmm.h: No such file or directory
 #include FT_MULTIPLE_MASTERS_H
                               ^
compilation terminated.

Original issue's description:
> Font variations.
>
> Multiple Master and TrueType fonts support variation axes.
> This implements back-end support for axes on platforms which
> support it.
>
> Committed: https://skia.googlesource.com/skia/+/05773ed30920c0214d1433c07cf6360a05476c97
>
> Committed: https://skia.googlesource.com/skia/+/3489ee0f4fa34f124f9de090d12bdc2107d52aa9

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

Review URL: https://codereview.chromium.org/1139123008
2015-05-15 11:30:41 -07:00
bungeman
3489ee0f4f Font variations.
Multiple Master and TrueType fonts support variation axes.
This implements back-end support for axes on platforms which
support it.

Committed: https://skia.googlesource.com/skia/+/05773ed30920c0214d1433c07cf6360a05476c97

Review URL: https://codereview.chromium.org/1027373002
2015-05-14 14:18:03 -07:00
joshualitt
88c23fc6e8 remove color from GrGeometryProcessor
BUG=skia:

Review URL: https://codereview.chromium.org/1140983002
2015-05-13 14:18:07 -07:00
bungeman
5ae1312c9f Revert of Font variations. (patchset #21 id:400001 of https://codereview.chromium.org/1027373002/)
Reason for revert:
Mac failing to build due to CFNumberType in Chromium Canary.

Original issue's description:
> Font variations.
>
> Multiple Master and TrueType fonts support variation axes.
> This implements back-end support for axes on platforms which
> support it.
>
> Committed: https://skia.googlesource.com/skia/+/05773ed30920c0214d1433c07cf6360a05476c97

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

Review URL: https://codereview.chromium.org/1128913008
2015-05-13 12:16:41 -07:00
bungeman
05773ed309 Font variations.
Multiple Master and TrueType fonts support variation axes.
This implements back-end support for axes on platforms which
support it.

Review URL: https://codereview.chromium.org/1027373002
2015-05-13 10:57:10 -07:00
reed
80ea19ca4b Revert of Revert of stop calling SkScalarDiv (patchset #1 id:1 of https://codereview.chromium.org/1138263002/)
Reason for revert:
android patched, blink has rolled

Original issue's description:
> Revert of stop calling SkScalarDiv (patchset #4 id:60001 of https://codereview.chromium.org/1135053002/)
>
> Reason for revert:
> need to wait for Blink roll (and patch android)
>
> Original issue's description:
> > stop calling SkScalarDiv
> >
> > BUG=skia:
> > TBR=
> >
> > Committed: https://skia.googlesource.com/skia/+/67d71c898249a7af3523b16c6a69895a63bfae0a
>
> TBR=
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/2629697933b5cc975e45d2a45c48f803fc6cbcec

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

Review URL: https://codereview.chromium.org/1135693003
2015-05-12 10:37:34 -07:00
reed
2629697933 Revert of stop calling SkScalarDiv (patchset #4 id:60001 of https://codereview.chromium.org/1135053002/)
Reason for revert:
need to wait for Blink roll (and patch android)

Original issue's description:
> stop calling SkScalarDiv
>
> BUG=skia:
> TBR=
>
> Committed: https://skia.googlesource.com/skia/+/67d71c898249a7af3523b16c6a69895a63bfae0a

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

Review URL: https://codereview.chromium.org/1138263002
2015-05-12 10:28:06 -07:00
reed
67d71c8982 stop calling SkScalarDiv
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1135053002
2015-05-12 09:47:22 -07:00
joshualitt
1107e901c9 Fix blur on large glyphs in runs < SkGlyphCache::max
BUG=skia:

Review URL: https://codereview.chromium.org/1135113002
2015-05-11 14:52:12 -07:00
joshualitt
e4cee1f283 fix for cached textblobs look garbled
BUG=skia:

Review URL: https://codereview.chromium.org/1135813007
2015-05-11 13:04:28 -07:00
robertphillips
2a974625c5 Fix convex-lineonly-paths GM so it plays nice with SampleApp
Review URL: https://codereview.chromium.org/1131273002
2015-05-08 07:08:13 -07:00
bsalomon
e64eb570a5 Iterate over instanced draws in GrGpu rather than above GrBatchTarget
Review URL: https://codereview.chromium.org/1127273007
2015-05-07 11:35:55 -07:00
robertphillips
e40d397259 Isolate GrBufferAllocPools inside GrBatchTarget
This CL refactors the location of the GrBufferAllocPools so they reside entirely inside the GrBatchTarget. This is in preparation for making them use scratch resources.

Review URL: https://codereview.chromium.org/1131553002
2015-05-07 09:51:43 -07:00
bsalomon
cb8979d088 Move DrawInfo out from GrDrawTarget and rename to GrVertices.
Review URL: https://codereview.chromium.org/1124733004
2015-05-05 09:51:38 -07:00
bsalomon
b5238a7571 Start on simplifying generateGeometry() overrides
Committed: https://skia.googlesource.com/skia/+/f28381c6866cad92af8ebe5b9d2db074613b1963

Review URL: https://codereview.chromium.org/1122673002
2015-05-05 07:49:49 -07:00
bsalomon
8415abe44c Revert of Start on simplifying generateGeometry() overrides (patchset #10 id:160001 of https://codereview.chromium.org/1122673002/)
Reason for revert:
Breaking bots

Original issue's description:
> Start on simplifying generateGeometry() overrides
>
> Committed: https://skia.googlesource.com/skia/+/f28381c6866cad92af8ebe5b9d2db074613b1963

TBR=joshualitt@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1124633003
2015-05-04 11:41:42 -07:00
bsalomon
f28381c686 Start on simplifying generateGeometry() overrides
Review URL: https://codereview.chromium.org/1122673002
2015-05-04 11:27:45 -07:00
bsalomon
ed0bcad9c8 Move instanced index buffer creation to flush time
Committed: https://skia.googlesource.com/skia/+/ab622c7b8cc8c39f0a594e4392b9e31b7e1ddb26

Review URL: https://codereview.chromium.org/1116943004
2015-05-04 10:36:43 -07:00
bsalomon
d8ed1b64a6 Revert of Move instanced index buffer creation to flush time (patchset #6 id:100001 of https://codereview.chromium.org/1116943004/)
Reason for revert:
messed up caching, recreating index buffers all the time.

Original issue's description:
> Move instanced index buffer creation to flush time
>
> Committed: https://skia.googlesource.com/skia/+/ab622c7b8cc8c39f0a594e4392b9e31b7e1ddb26

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

Review URL: https://codereview.chromium.org/1126613003
2015-05-04 10:09:24 -07:00
reed
71a6cbfc58 remove redundant/deprecated TwoPointRadial gradiet -- use TwoPointConical
This CL derived from https://codereview.chromium.org/1114243005/

BUG=skia:

Review URL: https://codereview.chromium.org/1117423003
2015-05-04 08:32:51 -07:00
bsalomon
ab622c7b8c Move instanced index buffer creation to flush time
Review URL: https://codereview.chromium.org/1116943004
2015-05-04 08:09:30 -07:00
joshualitt
99c7c07e0f Move bounds to GrBatch
BUG=skia:

Review URL: https://codereview.chromium.org/1121463002
2015-05-01 13:43:30 -07:00
bsalomon
d309e7aa0e This replaces the texture creation/caching functions on GrContext with a GrTextureProvider interface. The goal is to pass this narrowly focused object in places that currently take a GrContext but don't need and shouldn't use its other methods. It also has an extended private interface for interacting with non-texture resource types.
Review URL: https://codereview.chromium.org/1107973004
2015-04-30 14:18:54 -07:00
bungeman
3ffa126066 Move resource fonts to common location.
Move resource fonts to resources/fonts, add a destortable font for
testing, and clean up how the tests create fonts from resources.

R=joshualitt@google.com

Review URL: https://codereview.chromium.org/1120823002
2015-04-30 17:12:58 -04:00
egdaniel
29bee0fe65 Make XPFragmentBuilder only Builder with access to DstCopy.
Plus a bunch of renaming.

BUG=skia:

Review URL: https://codereview.chromium.org/1110033004
2015-04-29 11:54:42 -07:00
bungeman
c64239a466 Remove system call in DW for default font.
The last user of the GDI default font in DW is
onMatchFamilyStyleCharacter and it doesn't appear to actually need
to use it. This change removes a system call, making things a bit
faster, as well as eliminating a call blocked in the sandbox.

BUG=chromium:459056

Review URL: https://codereview.chromium.org/1107283003
2015-04-29 08:15:31 -07:00
bsalomon
fcabe429a4 Do circular clipping in normalized space
BUG=skia:426217

Review URL: https://codereview.chromium.org/1110173002
2015-04-28 12:43:01 -07:00
jvanverth
cfc18867d9 Use GLSLCaps for creating processor keys and GLSL-specific programs
Effectively all this does is future-proof any GLSL-specific code, as
GLSLCaps is just a typedef of GLCaps.

BUG=skia:

Review URL: https://codereview.chromium.org/1109863004
2015-04-28 08:48:20 -07:00
robertphillips
db3f8cdb59 Fix memory deletion error in "convex-lineonly-paths" GM
TBR=humper@google.com

Review URL: https://codereview.chromium.org/1110153002
2015-04-28 08:13:51 -07:00
robertphillips
7272935744 Add new GM/bench for line-only convex paths
BUG=472723

Review URL: https://codereview.chromium.org/1112603002
2015-04-28 07:42:04 -07:00
mtklein
1113da72ec Mike's radial gradient CL with better float -> int.
patch from issue 1072303005 at patchset 40001 (http://crrev.com/1072303005#ps40001)

This looks quite launchable.  radial_gradient3, min of 100 samples:
  N5:  985µs -> 946µs
  MBP: 395µs -> 279µs

On my MBP, most of the meat looks like it's now in reading the cache and writing to dst one color at a time.  Is that something we could do in float math rather than with a lookup table?

BUG=skia:

CQ_EXTRA_TRYBOTS=client.skia.compile:Build-Mac10.8-Clang-Arm7-Debug-Android-Trybot,Build-Ubuntu-GCC-Arm7-Release-Android_NoNeon-Trybot

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

Review URL: https://codereview.chromium.org/1109643002
2015-04-27 12:08:01 -07:00
mtklein
8d3e9dff3f Revert of Mike's radial gradient CL with better float -> int. (patchset #7 id:120001 of https://codereview.chromium.org/1109643002/)
Reason for revert:
compile failures.

Original issue's description:
> Mike's radial gradient CL with better float -> int.
>
> patch from issue 1072303005 at patchset 40001 (http://crrev.com/1072303005#ps40001)
>
> This looks quite launchable.  radial_gradient3, min of 100 samples:
>   N5:  985µs -> 946µs
>   MBP: 395µs -> 279µs
>
> On my MBP, most of the meat looks like it's now in reading the cache and writing to dst one color at a time.  Is that something we could do in float math rather than with a lookup table?
>
> BUG=skia:
>
> CQ_EXTRA_TRYBOTS=client.skia.android:Test-Android-GCC-Nexus5-CPU-NEON-Arm7-Debug-Trybot,Test-Android-GCC-Nexus9-CPU-Denver-Arm64-Debug-Trybot
>
> Committed: https://skia.googlesource.com/skia/+/abf6c5cf95e921fae59efb487480e5b5081cf0ec

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

Review URL: https://codereview.chromium.org/1109883003
2015-04-27 11:21:16 -07:00
mtklein
abf6c5cf95 Mike's radial gradient CL with better float -> int.
patch from issue 1072303005 at patchset 40001 (http://crrev.com/1072303005#ps40001)

This looks quite launchable.  radial_gradient3, min of 100 samples:
  N5:  985µs -> 946µs
  MBP: 395µs -> 279µs

On my MBP, most of the meat looks like it's now in reading the cache and writing to dst one color at a time.  Is that something we could do in float math rather than with a lookup table?

BUG=skia:

CQ_EXTRA_TRYBOTS=client.skia.android:Test-Android-GCC-Nexus5-CPU-NEON-Arm7-Debug-Trybot,Test-Android-GCC-Nexus9-CPU-Denver-Arm64-Debug-Trybot

Review URL: https://codereview.chromium.org/1109643002
2015-04-27 11:13:53 -07:00
tfarina
567ff2f614 Cleanup: Remove unnecessary double-semicolons.
The entries were found by the following command line:

$ find . -regex ".*\.[cChH]\(pp\)?" | xargs git grep -e ';;' --and --not
-e 'for *(.*;;'

Which is a combination of http://stackoverflow.com/a/3858879 and
http://gitster.livejournal.com/27674.html

BUG=None
R=mtklein@google.com

Review URL: https://codereview.chromium.org/1088763005
2015-04-27 07:01:45 -07:00
reed
3d9005c028 add GM to show bad banding in raster for radial gradients
BUG=427508
TBR=

Review URL: https://codereview.chromium.org/1061753009
2015-04-23 10:30:27 -07:00
reed
8f76cb905a new GM to test clipping cubics
BUG=skia:3716
TBR=caryclark@google.com

Review URL: https://codereview.chromium.org/1096433009
2015-04-22 17:38:23 -07:00
bsalomon
c6534a28a6 Make pixel_snap GMs incur less platform-specific variation
Review URL: https://codereview.chromium.org/1080393009
2015-04-22 11:34:46 -07:00
bsalomon
87cbcf3f86 Add GM to test non-AA pixel snapping for points, lines, rects.
Review URL: https://codereview.chromium.org/1070213003
2015-04-22 08:51:38 -07:00
reed
4912437891 adjust GM to have a final opaque bg, to make it easier to triage
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1085333003
2015-04-20 09:10:31 -07:00
reed
7e4186acce add GM to test imagefilters + xfermodes
draws incorrectly as is, but will be fixed by https://codereview.chromium.org/1091173003

BUG=skia:3741

Review URL: https://codereview.chromium.org/1088773004
2015-04-20 07:27:15 -07:00
halcanary
a8448bc3df PDF: Correctly embed JPEG images directly into PDF output.
We only embed images with YUV planes.  That should only grab the
subset of color JPEGs supported by PDF.

BUG=skia:3180

Review URL: https://codereview.chromium.org/1025773002
2015-04-17 13:27:24 -07:00
joshualitt
523ed6c0c1 adding new gm to rotate, translate, and scale textblobs
this is to test distance field caching and regen of texture blobs on scale.

BUG=skia:

Review URL: https://codereview.chromium.org/1097563002
2015-04-17 09:01:05 -07:00
mtklein
4afe21e864 add a GM to demo the blend bug
BUG=skia:3739

Review URL: https://codereview.chromium.org/1094863003
2015-04-17 06:32:13 -07:00
mtklein
6ef68ab2cd Don't serialize anything for SkEmptyShader.
BUG=skia:3735

Review URL: https://codereview.chromium.org/1097433002
2015-04-16 07:59:12 -07:00
Brian Salomon
6318016469 widen output png size of bmp_filter_quality_repeat
BUG=skia:

Review URL: https://codereview.chromium.org/1097443002
2015-04-16 10:46:18 -04:00
bsalomon
8cf1d95487 Add GM that tests bmp filter qualities with repeat mode
TBR=reed@google.com

Review URL: https://codereview.chromium.org/1086203002
2015-04-16 06:54:28 -07:00
bsalomon
bed83a66f5 Don't draw if SkShader::asNewFragmentProcessor fails.
BUG=chromium:473156

Review URL: https://codereview.chromium.org/1089063002
2015-04-15 14:18:34 -07:00
joshualitt
ddb714b09a remove randomness in dstreadshuffle
BUG=skia:

Review URL: https://codereview.chromium.org/1085443005
2015-04-15 08:08:28 -07:00
joshualitt
9e36c1a930 Start canonicalizing color for all A8 textblobs
BUG=skia:

Review URL: https://codereview.chromium.org/1076593002
2015-04-14 12:17:27 -07:00
robertphillips
f5ac972207 Add GM to exercise high quality anisotropic scaling
High quality anisotropic is an interesting edge case for the gpu backend. For scales that are both minimizing and maximizing Ganesh falls back to MipMaps which can turn out too blurry.

BUG=472864

Review URL: https://codereview.chromium.org/1058133003
2015-04-14 08:19:01 -07:00
halcanary
86e5ab6338 GM: add fadefilter gm
BUG=470083

Review URL: https://codereview.chromium.org/1081173002
2015-04-14 06:25:19 -07:00
reed
9aeb2a1068 always layout w/ same bounds
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1085453002
2015-04-11 19:29:51 -07:00
reed
ffab15f60e use anon namespace to avoid (silent) collisions between local test classes
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1079813002
2015-04-11 19:29:31 -07:00
joshualitt
d0b5c33fda Adding draw looper gm for textblobs
BUG=skia:

Review URL: https://codereview.chromium.org/1067853002
2015-04-10 06:17:26 -07:00
senorblanco
16b254a200 Change some more GMs to clear to opaque black, not transparent black.
N.B.: this will change results on the bots for all the tests modified.

BUG=skia:3319

Review URL: https://codereview.chromium.org/1077763002
2015-04-09 11:13:24 -07:00
robertphillips
e275fdf812 Add GM to repro crbug.com/472795
This CL also adds a new parameter to SkBitmapSource which gives the user control of the filter quality.

BUG=472795

Review URL: https://codereview.chromium.org/1072603002
2015-04-09 06:47:12 -07:00
senorblanco
aad8b27ec6 Use opaque black not transparent black as imagefilter GM background.
For some reason, GM's are now being composited against white
in some modes, where the alpha used to be ignored (or composited
against black, I'm not sure which). At any rate, it doesn't
make much sense to have alpha in the result anyway, so let's clear to
opaque black instead of transparent black and avoid the problem.

This is a trial balloon for bitmapsource and pictureimagefilter.
If all goes well, I'll make this change more widely.

R=scroggo
BUG=skia:3319

Review URL: https://codereview.chromium.org/1074513002
2015-04-08 12:36:08 -07:00
joshualitt
eef5b3eb12 BUG=skia:
Review URL: https://codereview.chromium.org/1031423002
2015-04-03 08:07:26 -07:00
bsalomon
c9c3e62b4e Add constant color GrFP.
Committed: https://skia.googlesource.com/skia/+/dfbbec436cbcacc3270d4b28357c8393e67d6494

Review URL: https://codereview.chromium.org/978713002
2015-04-02 11:12:09 -07:00
bsalomon
599ea40cec Revert of Add constant color GrFP. (patchset #10 id:180001 of https://codereview.chromium.org/978713002/)
Reason for revert:
Revert while investigating assertions.

Original issue's description:
> Add constant color GrFP.
>
> Committed: https://skia.googlesource.com/skia/+/dfbbec436cbcacc3270d4b28357c8393e67d6494

TBR=egdaniel@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1055023002
2015-04-02 08:33:54 -07:00
reed
c6e13d7342 pass legal premul values to bitmap -- do we still need this GM?
BUG=skia:

Review URL: https://codereview.chromium.org/1052083004
2015-04-02 05:43:09 -07:00
senorblanco
d0d37cace0 Implement approx-match support in image filter saveLayer() offscreen.
Currently, the GPU-side image filter implementation creates
exact-match textures for the offscreen backing stores for
saveLayer().  This is because several filters have GPU
implementations which depend on the texture coordinates
being 0..1.

The fix is three-fold:

1) Store the actual requested size in the SkGpuDevice, so
that when wrapping it in an SkBitmap for passing to
filterImage(), we can give it the original size.
2) Fix the filters (SkMagnifierImageFilter,
SkLightingImageFilter, SkMatrixConvolutionImageFilter,
SkMatrixImageFilter) whose GPU implementation depends on
0..1 texture coordinates.
3) Remove the exception for GPU-side image filters in
SkCanvas::internalSaveLayer().

For the lighting filters, there were two bugs which were
cancelling each other out: the sobel filter matrix was
being computed upside down, but then we'd negate the
resulting normal. This worked fine in the exact-match case,
but in the approx-match case we'd sample garbage along
the edge pixels. Also, we never implemented the edge pixels
according to spec in the GPU case. It requires a
different fragment shader for each edge of the nine-patch,
which meant we couldn't use asFragmentProcessor(), and had
to implement the drawing via a filterImageGPU() override.
In order to avoid polluting the public API, I inserted a
new base class, SkLightingImageFilterInternal above
Sk[Diffuse|Specular]LightingImageFilter to handle the
implementation.

For the SkMatrixConvolutionImageFilter, it seems the
GLSL clamp() function occasionally returns values outside
the clamped range, resulting in access of garbage
texels even in GL_NEAREST. The fix here is to clamp to a
rect inset by half a texel. There was also a bug in
the unpremultiply step when fConvolveAlpha is false.

For SkMatrixImageFilter, the fix was to make the generic
draw path be more careful about when to use texture domain.
If the bitmap already has a texture, use texture domain
if the srcRect is smaller than the entire texture (not
the entire bitmap).

N.B.: this change will cause some minor pixel diffs in the
GPU results of the following GMs (and possibly more):
matriximagefilter, matrixconvolution, imagefiltersscaled,
lighting, imagemagnifier, filterfastbounds,
complexclip_aa_Layer_invert, complexclip_aa_layer,
complexclip_bw_layer_invert, complexclip_bw_layer.

BUG=skia:3532

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

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

Committed: https://skia.googlesource.com/skia/+/46112cf2a7c7307f1c9eebb5f881cbda15aa460c

Review URL: https://codereview.chromium.org/1034733002
2015-04-02 04:54:57 -07:00
rmistry
82973dbf4f Revert of Implement approx-match support in image filter saveLayer() offscreen. (patchset #31 id:590001 of https://codereview.chromium.org/1034733002/)
Reason for revert:
Spoke to Stephen about this. Reverting because failing debug builds:

https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Mac10.9-Clang-MacMini6.2-GPU-HD4000-x86_64-Debug/builds/51
https://uberchromegw.corp.google.com/i/client.skia/builders/Test-Ubuntu-GCC-ShuttleA-GPU-GTX660-x86_64-Debug/builds/54

Original issue's description:
> Implement approx-match support in image filter saveLayer() offscreen.
>
> Currently, the GPU-side image filter implementation creates
> exact-match textures for the offscreen backing stores for
> saveLayer().  This is because several filters have GPU
> implementations which depend on the texture coordinates
> being 0..1.
>
> The fix is three-fold:
>
> 1) Store the actual requested size in the SkGpuDevice, so
> that when wrapping it in an SkBitmap for passing to
> filterImage(), we can give it the original size.
> 2) Fix the filters (SkMagnifierImageFilter,
> SkLightingImageFilter, SkMatrixConvolutionImageFilter,
> SkMatrixImageFilter) whose GPU implementation depends on
> 0..1 texture coordinates.
> 3) Remove the exception for GPU-side image filters in
> SkCanvas::internalSaveLayer().
>
> For the lighting filters, there were two bugs which were
> cancelling each other out: the sobel filter matrix was
> being computed upside down, but then we'd negate the
> resulting normal. This worked fine in the exact-match case,
> but in the approx-match case we'd sample garbage along
> the edge pixels. Also, we never implemented the edge pixels
> according to spec in the GPU case. It requires a
> different fragment shader for each edge of the nine-patch,
> which meant we couldn't use asFragmentProcessor(), and had
> to implement the drawing via a filterImageGPU() override.
> In order to avoid polluting the public API, I inserted a
> new base class, SkLightingImageFilterInternal above
> Sk[Diffuse|Specular]LightingImageFilter to handle the
> implementation.
>
> For the SkMatrixConvolutionImageFilter, it seems the
> GLSL clamp() function occasionally returns values outside
> the clamped range, resulting in access of garbage
> texels even in GL_NEAREST. The fix here is to clamp to a
> rect inset by half a texel. There was also a bug in
> the unpremultiply step when fConvolveAlpha is false.
>
> For SkMatrixImageFilter, the fix was to make the generic
> draw path be more careful about when to use texture domain.
> If the bitmap already has a texture, use texture domain
> if the srcRect is smaller than the entire texture (not
> the entire bitmap).
>
> N.B.: this change will cause some minor pixel diffs in the
> GPU results of the following GMs (and possibly more):
> matriximagefilter, matrixconvolution, imagefiltersscaled,
> lighting, imagemagnifier, filterfastbounds,
> complexclip_aa_Layer_invert, complexclip_aa_layer,
> complexclip_bw_layer_invert, complexclip_bw_layer.
>
> BUG=skia:3532
>
> Committed: https://skia.googlesource.com/skia/+/b97dafefe63ea0a1bbce8e8b209f4920983fb8b9
>
> Committed: https://skia.googlesource.com/skia/+/f5f8518fe0bbd2703e4ffc1b11ad7b4312ff7641
>
> Committed: https://skia.googlesource.com/skia/+/46112cf2a7c7307f1c9eebb5f881cbda15aa460c

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

Review URL: https://codereview.chromium.org/1057693002
2015-04-01 15:53:13 -07:00
bsalomon
dfbbec436c Add constant color GrFP.
Review URL: https://codereview.chromium.org/978713002
2015-04-01 14:54:57 -07:00
senorblanco
46112cf2a7 Implement approx-match support in image filter saveLayer() offscreen.
Currently, the GPU-side image filter implementation creates
exact-match textures for the offscreen backing stores for
saveLayer().  This is because several filters have GPU
implementations which depend on the texture coordinates
being 0..1.

The fix is three-fold:

1) Store the actual requested size in the SkGpuDevice, so
that when wrapping it in an SkBitmap for passing to
filterImage(), we can give it the original size.
2) Fix the filters (SkMagnifierImageFilter,
SkLightingImageFilter, SkMatrixConvolutionImageFilter,
SkMatrixImageFilter) whose GPU implementation depends on
0..1 texture coordinates.
3) Remove the exception for GPU-side image filters in
SkCanvas::internalSaveLayer().

For the lighting filters, there were two bugs which were
cancelling each other out: the sobel filter matrix was
being computed upside down, but then we'd negate the
resulting normal. This worked fine in the exact-match case,
but in the approx-match case we'd sample garbage along
the edge pixels. Also, we never implemented the edge pixels
according to spec in the GPU case. It requires a
different fragment shader for each edge of the nine-patch,
which meant we couldn't use asFragmentProcessor(), and had
to implement the drawing via a filterImageGPU() override.
In order to avoid polluting the public API, I inserted a
new base class, SkLightingImageFilterInternal above
Sk[Diffuse|Specular]LightingImageFilter to handle the
implementation.

For the SkMatrixConvolutionImageFilter, it seems the
GLSL clamp() function occasionally returns values outside
the clamped range, resulting in access of garbage
texels even in GL_NEAREST. The fix here is to clamp to a
rect inset by half a texel. There was also a bug in
the unpremultiply step when fConvolveAlpha is false.

For SkMatrixImageFilter, the fix was to make the generic
draw path be more careful about when to use texture domain.
If the bitmap already has a texture, use texture domain
if the srcRect is smaller than the entire texture (not
the entire bitmap).

N.B.: this change will cause some minor pixel diffs in the
GPU results of the following GMs (and possibly more):
matriximagefilter, matrixconvolution, imagefiltersscaled,
lighting, imagemagnifier, filterfastbounds,
complexclip_aa_Layer_invert, complexclip_aa_layer,
complexclip_bw_layer_invert, complexclip_bw_layer.

BUG=skia:3532

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

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

Review URL: https://codereview.chromium.org/1034733002
2015-04-01 14:17:14 -07:00
rmistry
7c0273f107 Revert of Implement approx-match support in image filter saveLayer() offscreen. (patchset #27 id:510001 of https://codereview.chromium.org/1034733002/)
Reason for revert:
Looks like this change is causing layout test failures which is blocking Skia's DEPS roll into Chromium:
https://codereview.chromium.org/1050563002/
https://codereview.chromium.org/1043133005/
https://codereview.chromium.org/1048273002/

Reverting to see if this fixes the DEPS roll.

Original issue's description:
> Implement approx-match support in image filter saveLayer() offscreen.
>
> Currently, the GPU-side image filter implementation creates
> exact-match textures for the offscreen backing stores for
> saveLayer().  This is because several filters have GPU
> implementations which depend on the texture coordinates
> being 0..1.
>
> The fix is three-fold:
>
> 1) Store the actual requested size in the SkGpuDevice, so
> that when wrapping it in an SkBitmap for passing to
> filterImage(), we can give it the original size.
> 2) Fix the filters (SkMagnifierImageFilter,
> SkLightingImageFilter) whose GPU implementation depends on
> 0..1 texture coordinates.
> 3) Remove the exception for GPU-side image filters in
> SkCanvas::internalSaveLayer().
>
> For the lighting filters, there were two bugs which were
> cancelling each other out: the sobel filter matrix was
> being computed upside down, but then we'd negate the
> resulting normal. This worked fine in the exact-match case,
> but in the approx-match case we'd sample garbage along
> the edge pixels. Also, we never implemented the edge pixels
> according to spec in the GPU case. It requires a
> different fragment shader for each edge of the nine-patch,
> which meant we couldn't use asFragmentProcessor(), and had
> to implement the drawing via a filterImageGPU() override.
> In order to avoid polluting the public API, I inserted a
> new base class, SkLightingImageFilterInternal above
> Sk[Diffuse|Specular]LightingImageFilter to handle the
> implementation.
>
> N.B.: this change will cause some minor pixel diffs in the
> GPU results of the following GMs (and possibly more):
> matriximagefilter, matrixconvolution, imagefiltersscaled,
> lighting, imagemagnifier, filterfastbounds,
> complexclip_aa_Layer_invert, complexclip_aa_layer,
> complexclip_bw_layer_invert, complexclip_bw_layer.
>
> BUG=skia:3532
>
> Committed: https://skia.googlesource.com/skia/+/b97dafefe63ea0a1bbce8e8b209f4920983fb8b9
>
> Committed: https://skia.googlesource.com/skia/+/f5f8518fe0bbd2703e4ffc1b11ad7b4312ff7641

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

Review URL: https://codereview.chromium.org/1057443003
2015-04-01 04:19:45 -07:00
senorblanco
f5f8518fe0 Implement approx-match support in image filter saveLayer() offscreen.
Currently, the GPU-side image filter implementation creates
exact-match textures for the offscreen backing stores for
saveLayer().  This is because several filters have GPU
implementations which depend on the texture coordinates
being 0..1.

The fix is three-fold:

1) Store the actual requested size in the SkGpuDevice, so
that when wrapping it in an SkBitmap for passing to
filterImage(), we can give it the original size.
2) Fix the filters (SkMagnifierImageFilter,
SkLightingImageFilter) whose GPU implementation depends on
0..1 texture coordinates.
3) Remove the exception for GPU-side image filters in
SkCanvas::internalSaveLayer().

For the lighting filters, there were two bugs which were
cancelling each other out: the sobel filter matrix was
being computed upside down, but then we'd negate the
resulting normal. This worked fine in the exact-match case,
but in the approx-match case we'd sample garbage along
the edge pixels. Also, we never implemented the edge pixels
according to spec in the GPU case. It requires a
different fragment shader for each edge of the nine-patch,
which meant we couldn't use asFragmentProcessor(), and had
to implement the drawing via a filterImageGPU() override.
In order to avoid polluting the public API, I inserted a
new base class, SkLightingImageFilterInternal above
Sk[Diffuse|Specular]LightingImageFilter to handle the
implementation.

N.B.: this change will cause some minor pixel diffs in the
GPU results of the following GMs (and possibly more):
matriximagefilter, matrixconvolution, imagefiltersscaled,
lighting, imagemagnifier, filterfastbounds,
complexclip_aa_Layer_invert, complexclip_aa_layer,
complexclip_bw_layer_invert, complexclip_bw_layer.

BUG=skia:3532

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

Review URL: https://codereview.chromium.org/1034733002
2015-03-31 08:35:16 -07:00
cdalton
d3e919123d Fix variable names in xfermodes2 gm test
BUG=skia:

Review URL: https://codereview.chromium.org/1041913002
2015-03-30 07:52:57 -07:00
mtklein
871ad7a13e Use a black background in imagefiltersgraph so 8888 and 565 look similar.
BUG=skia:

Review URL: https://codereview.chromium.org/1041773003
2015-03-27 12:33:46 -07:00
robertphillips
1d24b8dfe9 Add matrix constructing helpers to SkMatrix
Review URL: https://codereview.chromium.org/1034273002
2015-03-26 19:57:08 -07:00
caryclark
54359294a7 cumulative pathops patch
Replace the implicit curve intersection with a geometric curve intersection. The implicit intersection proved mathematically unstable and took a long time to zero in on an answer.

Use pointers instead of indices to refer to parts of curves. Indices required awkward renumbering.

Unify t and point values so that small intervals can be eliminated in one pass.

Break cubics up front to eliminate loops and cusps.

Make the Simplify and Op code more regular and eliminate arbitrary differences.

Add a builder that takes an array of paths and operators.

Delete unused code.

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

Review URL: https://codereview.chromium.org/1037573004
2015-03-26 07:52:43 -07:00
mtklein
36352bf5e3 C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla}
NOPRESUBMIT=true

BUG=skia:
DOCS_PREVIEW= https://skia.org/?cl=1037793002

Review URL: https://codereview.chromium.org/1037793002
2015-03-25 18:17:32 -07:00
reed
b67eb2f9b9 Revert "Revert of impl colormatrix w/ floats (patchset #7 id:120001 of https://codereview.chromium.org/967943002/)"
disabled for the momment -- need to understand arm64 glitches

This reverts commit 374a4c3b74.

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1028403002
2015-03-24 04:13:45 -07:00
reed
374a4c3b74 Revert of impl colormatrix w/ floats (patchset #7 id:120001 of https://codereview.chromium.org/967943002/)
Reason for revert:
Arm64 seems to be having glitches :(

See gm:colormatrix on Arm64/TegraK1/Nexus9

last square should be all white, but it has stripes

Original issue's description:
> impl colormatrix w/ floats
>
> this needs to land first https://codereview.chromium.org/1031713003
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/7971def11be91ed08eae7107b372322d24e67544

TBR=mtklein@google.com,caryclark@google.com,reed@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1030743003
2015-03-23 18:52:57 -07:00
reed
7971def11b impl colormatrix w/ floats
this needs to land first https://codereview.chromium.org/1031713003

BUG=skia:

Review URL: https://codereview.chromium.org/967943002
2015-03-23 14:35:25 -07:00
robertphillips
3e5c2b1041 Preserve texture compression when saving a revised skp from debugger
Without this CL, saving a revised skp out the debugger can greatly expand the memory it requires.

Review URL: https://codereview.chromium.org/1020103005
2015-03-23 05:46:51 -07:00
halcanary
db0dcc7436 PDF: remove last use of SkPDFImage
Add a GM.

BUG=skia:255

Review URL: https://codereview.chromium.org/950633003
2015-03-20 12:31:52 -07:00
reed
1b600d3446 Revert of PDF: remove last use of SkPDFImage (patchset #5 id:120001 of https://codereview.chromium.org/950633003/)
Reason for revert:
static void draw(SkCanvas* canvas,
                 const SkPaint& p,
                 const SkBitmap& src,
                 SkColorType colorType,
                 const char text[]) {
    SkASSERT(src.colorType() == colorType);
    canvas->drawBitmap(src, 0.0f, 0.0f);
    canvas->drawText(text, strlen(text), 0.0f, 12.0f, p);
}

This assert is firing, at least on macs, where all images get decoded into 32bit at the moment.

Original issue's description:
> PDF: remove last use of SkPDFImage
>
> Add a GM.
>
> BUG=skia:255
>
> Committed: https://skia.googlesource.com/skia/+/86ad8d643624a55b02e529100bbe4e2940115fa1

TBR=mtklein@google.com,halcanary@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:255

Review URL: https://codereview.chromium.org/1024113002
2015-03-20 10:03:36 -07:00
halcanary
86ad8d6436 PDF: remove last use of SkPDFImage
Add a GM.

BUG=skia:255

Review URL: https://codereview.chromium.org/950633003
2015-03-20 09:10:56 -07:00
senorblanco
d4bb991df8 Add a new GM to show problems with shear/rotate CTM w/ image filters.
Review URL: https://codereview.chromium.org/1028663002
2015-03-20 08:54:32 -07:00
senorblanco
8c874eee94 Move SkMatrixImageFilter into core, and add a factory fn for it.
BUG=skia:

Review URL: https://codereview.chromium.org/1011273003
2015-03-20 06:38:17 -07:00
reed
8dc0ccb8d3 disable LCD for layers w/ filters
BUG=468311

see also skiabug.com/3567

Review URL: https://codereview.chromium.org/1002603003
2015-03-20 06:32:52 -07:00
senorblanco
24e06d5244 Remove uniqueID from all filter serialization.
(This is essentially a revert of https://codereview.chromium.org/503833002/.)

This was necessary back when SkPaint was flattened even for in-process use. Now that we only flatten SkPaint for cross-process use, there's no need to serialize UniqueIDs.

Note: SkDropShadowImageFilter is being constructed with a croprect and UniqueID (of 0) in Blink. I've made the uniqueID param default to 0 temporarily, until this rolls in and Blink can be changed. (Blink can't be changed first, since unlike the other filters, there's no constructor that takes a cropRect but not a uniqueID.)

BUG=skia:

Review URL: https://codereview.chromium.org/1019493002
2015-03-18 12:11:33 -07:00
reed
0c9b1a8d05 add kGray_8_SkColorType
patch from issue 1014783003 at patchset 60001 (http://crrev.com/1014783003#ps60001)

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1010343002
2015-03-17 17:44:07 -07:00
jvanverth
d68a550ec8 Fix up some issues introduced by https://codereview.chromium.org/1013773002/
Need to check for zero-length gradients when using the new correction.
Make sure we use the old text sizes for color emoji test in dftext GM.

BUG=skia:3540

Review URL: https://codereview.chromium.org/1009973004
2015-03-16 12:58:44 -07:00
jvanverth
354eba5cb6 Fix SDF gradient calculation for non-uniform xforms
Also adds two non-uniform test cases to the dftext GM.

BUG=skia:3540

Review URL: https://codereview.chromium.org/1013773002
2015-03-16 11:32:49 -07:00
reed
93a1215fe0 SkPaint::FilterLevel -> SkFilterQuality
clone (+rebase) of https://codereview.chromium.org/1009183002/

BUG=skia:
TBR=scroggo@google.com

Review URL: https://codereview.chromium.org/1014533004
2015-03-16 10:08:34 -07:00
tomhudson
cdf34cdfb9 We had zero coverage for SkDrawFilter. This new GM draws two rectangles.
If SkDrawFilter is working, they will not match (have different colors
and one will be blurred). If SkDrawFilter is broken, they will match.

R=scroggo@google.com

Review URL: https://codereview.chromium.org/984883003
2015-03-06 06:15:20 -08:00
joshualitt
4b31de8328 handle null vertex or index buffers in batch
BUG=skia:

Review URL: https://codereview.chromium.org/979343002
2015-03-05 14:33:41 -08:00
herb
c1e97b372e Fix uninitialized memory bug in the SkGlyphCache.
The core of the problem is that the system is asked to lookup the metrics for a character with id == 0. This causes a hit in the fCharToGlyphHash matching the sentinel glyph. This happens because fCharToGlpyhHash is initialized with all zeros, therefore, the fID is zero matching the char with id == 0. The fAdvanceX field of the sentinel glyph is in fact not initialized.

The bigger question is now did a zero character get passed to getUnicharMetrics?

The breaking code is basically as follows:
wchar_t glyph = L'S';
paint.measureText(&glyph, 2);

This get mischaracterized as a utf8 string instead of a utf16(?) string. Because of the little endian ordering, this is the character string 'L' '\0'. Since the size of the original string is two bytes (but a single character) the '\0' is treated as its own character and past to getUnicharMetrics.

TEST:
On windows failed using DrMemory. With this change does not fail.

BUG=463204

Review URL: https://codereview.chromium.org/977063002
2015-03-05 11:51:11 -08:00
reed
cff10b21a9 change colorfilter to return an array of frag processors
BUG=skia:

Review URL: https://codereview.chromium.org/973593002
2015-03-03 06:41:45 -08:00
reed
db873d8677 add compose-colorfilter
now with serialization registration

This reverts commit 5bd055c038.

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/970753002
2015-03-01 19:53:47 -08:00
reed
5bd055c038 Revert of add compose-colorfilter (patchset #2 id:20001 of https://codereview.chromium.org/969673002/)
Reason for revert:
need to register subclass for serialization

Original issue's description:
> add compose-colorfilter
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/b675a73c1f3f4a433c4893199a0bd11126dfe130

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

Review URL: https://codereview.chromium.org/971653002
2015-03-01 19:16:38 -08:00
reed
b675a73c1f add compose-colorfilter
BUG=skia:

Review URL: https://codereview.chromium.org/969673002
2015-03-01 18:00:47 -08:00
senorblanco
d6ed19cc75 Tessellating GPU path renderer.
This path renderer converts paths to linear contours, resolves intersections via Bentley-Ottman, implements a trapezoidal decomposition a la Fournier and Montuno to produce triangles, and renders those with a single draw call. It does not currently do antialiasing, so it must be used in conjunction with multisampling.

A fair amount of the code is to handle floating point edge cases in intersections. Rather than perform exact computations (which would require arbitrary precision arithmetic), we reconnect the mesh to reflect the intersection points. For example, intersections can occur above the current vertex, and force edges to be merged into the current vertex, requiring a restart of the intersections. Splitting edges for intersections can also force them to merge with formerly-distinct edges in the same polygon, or to violate the ordering of the active edge list, or the active edge state of split edges.

BUG=skia:

Review URL: https://codereview.chromium.org/855513004
2015-02-26 06:58:17 -08:00
joshualitt
570d2f81a6 I'd really like to land this before the branch so speedy reviews are appreciated.
BUG=skia:

Committed: https://skia.googlesource.com/skia/+/586d5d640b19860dfbbd903a5188da1bbbe87336

Review URL: https://codereview.chromium.org/936943002
2015-02-25 13:19:48 -08:00
joshualitt
2907059d0e Revert of Pass clip to context (patchset #8 id:180001 of https://codereview.chromium.org/936943002/)
Reason for revert:
Strange blur problems on nexus 5

Original issue's description:
> I'd really like to land this before the branch so speedy reviews are appreciated.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/586d5d640b19860dfbbd903a5188da1bbbe87336

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

Review URL: https://codereview.chromium.org/956083002
2015-02-25 13:04:44 -08:00
joshualitt
586d5d640b I'd really like to land this before the branch so speedy reviews are appreciated.
BUG=skia:

Review URL: https://codereview.chromium.org/936943002
2015-02-25 11:21:21 -08:00
caryclark
63c684a8a6 fuzzer fixes
Fix path bugs exposed by the path fuzzer.

Changes to existing gm and samplecode files defer their calls to construct
SkPath objects until the first draw instead of at test initialization.

Add an experimental call to SkPath to validate the internal SkPathRef.

Fix SkPath::addPoly to set the last moveto after adding a close verb.

Fix stroke to handle failures when computing the unit normal.

Add a unit test for the unit normal failure.

R=reed@google.com

Review URL: https://codereview.chromium.org/953383002
2015-02-25 09:04:04 -08:00
egdaniel
5a23a14b1f Fix to check for inf when generating quadratic points
BUG=skia:3453

Review URL: https://codereview.chromium.org/948043003
2015-02-25 06:41:47 -08:00
halcanary
a1cb378a82 GM: showmiplevels handles bitmap memory in a nicer way.
This is helpful for those canvas implementations that want to copy a
bitmap.

Review URL: https://codereview.chromium.org/935943007
2015-02-24 09:25:09 -08:00
joshualitt
44701df5ce Move clip off of draw target
BUG=skia:

Review URL: https://codereview.chromium.org/947443003
2015-02-23 14:44:58 -08:00
caryclark
6df8e3495a break out of cubic stroker loop on degenerate case
The looper can generate more than one quad, but if any one is degenerate,
give up, but not before generating the state for the line join to
produce the correct end.

Before, the early return allowed the inside path to contain multiple
movetos that caused reversePath to assert.

R=reed@google.com

Review URL: https://codereview.chromium.org/948043002
2015-02-23 12:47:03 -08:00
reed
e2b580bbed remove dead code (covered by surfaceprops)
BUG=skia:

Review URL: https://codereview.chromium.org/947593004
2015-02-23 07:37:40 -08:00
caryclark
3760457182 make strokes3 full size
The strokes3 test was limted to 400x800. Allow the captured gm to
go to 1500x1500, and shift it down slightly so it isn't clipped.

Review URL: https://codereview.chromium.org/945363004
2015-02-23 06:51:04 -08:00
reed
c8e4765b8e gm to illustrate mipmap layer choice
BUG=skia:
NOTREECHECKS=True
TBR=

Review URL: https://codereview.chromium.org/942593002
2015-02-19 11:39:46 -08:00
joshualitt
6364807151 gm to test hairlines which fill RenderTarget
BUG=skia:

Review URL: https://codereview.chromium.org/934283002
2015-02-19 10:25:21 -08:00
jvanverth
ce07afb8fa Update fontcache gm to actually stress font atlas
BUG=skia:

Review URL: https://codereview.chromium.org/933313004
2015-02-19 08:28:02 -08:00
bungeman
67b21a7eef Revert of disable gammatext gm for a while, looking for other flakes (patchset #1 id:1 of https://codereview.chromium.org/725303002/)
Reason for revert:
We now have gold!!!

Original issue's description:
> disable gammatext gm for a while, looking for other flakes
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/64c04882701d9ee3bbbf23d8c02c8d96c5a51719

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

Review URL: https://codereview.chromium.org/943673002
2015-02-19 07:45:14 -08:00
joshualitt
25d9c15408 Pass Rendertarget into context.
Adding Jim for text context stuff, and Steven for image blur stuff.

BUG=skia:

Review URL: https://codereview.chromium.org/939623005
2015-02-18 12:29:52 -08:00
halcanary
1b5c604d9d PDF: Add (low-memory) SkPDFBitmap class
Also: Add SkDeflateWStream and associated unit tests.

SkPDFBitmap is a replacement for SkPDFImage.  As of now, it only
supports 8888 bitmaps (the most common case).

SkPDFBitmap takes very little extra memory (aside from refing the
bitmap's pixels), and its emitObject() does not cache any data.

The SkPDFBitmap::Create function will check the canon for duplicates.
This can reduce the size of the output PDF.

Motivation:  this gives another ~40% decrease in PDF memory overhead

TODO: Support other ColorTypes and scrap SkPDFImage.

BUG=skia:3030

Review URL: https://codereview.chromium.org/918813002
2015-02-18 11:29:57 -08:00
caryclark
88c748aeea update sampleapp for stroking experiment
Add RotateCircles3 back as better-named QuadStroker.

Switch pathfill test to call skia before draw instead of in
initializer to avoid triggering debugging breakpoints.

Review URL: https://codereview.chromium.org/912273003
2015-02-18 10:56:00 -08:00
reed
9e779d4951 add gm for path-arcs, and catch degenerate arc in conic-case
BUG=skia:3428

Review URL: https://codereview.chromium.org/931183002
2015-02-17 11:43:14 -08:00
sugoi
4ccce7ea61 YUV scale fix
There was a scaling mistake visible in some JPEG images because the ratio between Y, U and V planes were assumed to be the same ratios as the ratio between texture sizes, which was wrong because texture have a minimum size of 16 and are rounded up to the next POT. Since the ratios between Y and UV planes are generally 1, 2 or 4, rounding up to the next POT would generally preserve this ratio, so that this bug was not very visible, apart from very small jpeg images of 8 or less pixels in either width or height.

BUG=457954

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

Review URL: https://codereview.chromium.org/922273002
2015-02-13 13:57:09 -08:00
jvanverth
0ff748ace6 Revert of YUV scale fix (patchset #2 id:20001 of https://codereview.chromium.org/922273002/)
Reason for revert:
Turning Windows compile bots red.

Original issue's description:
> YUV scale fix
>
> There was a scaling mistake visible in some JPEG images because the ratio between Y, U and V planes were assumed to be the same ratios as the ratio between texture sizes, which was wrong because texture have a minimum size of 16 and are rounded up to the next POT. Since the ratios between Y and UV planes are generally 1, 2 or 4, rounding up to the next POT would generally preserve this ratio, so that this bug was not very visible, apart from very small jpeg images of 8 or less pixels in either width or height.
>
> BUG=457954
>
> Committed: https://skia.googlesource.com/skia/+/e6eddf7dd85add7da41f22f2643bdd573ad1f1cf

TBR=bsalomon@google.com,sugoi@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=457954

Review URL: https://codereview.chromium.org/926123002
2015-02-13 12:02:23 -08:00
sugoi
e6eddf7dd8 YUV scale fix
There was a scaling mistake visible in some JPEG images because the ratio between Y, U and V planes were assumed to be the same ratios as the ratio between texture sizes, which was wrong because texture have a minimum size of 16 and are rounded up to the next POT. Since the ratios between Y and UV planes are generally 1, 2 or 4, rounding up to the next POT would generally preserve this ratio, so that this bug was not very visible, apart from very small jpeg images of 8 or less pixels in either width or height.

BUG=457954

Review URL: https://codereview.chromium.org/922273002
2015-02-13 11:47:11 -08:00
joshualitt
95964c670b GMs now use batch
BUG=skia:

Committed: https://skia.googlesource.com/skia/+/3f284d7758d7f35b59d93a22d126f7cd8423be44

Review URL: https://codereview.chromium.org/865313004
2015-02-11 13:45:51 -08:00
joshualitt
94dff15404 Revert of GMs now use batch (patchset #3 id:40001 of https://codereview.chromium.org/865313004/)
Reason for revert:
missing hairlines on gms

Original issue's description:
> GMs now use batch
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/3f284d7758d7f35b59d93a22d126f7cd8423be44

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

Review URL: https://codereview.chromium.org/913153003
2015-02-11 13:03:16 -08:00
joshualitt
3f284d7758 GMs now use batch
BUG=skia:

Review URL: https://codereview.chromium.org/865313004
2015-02-11 11:34:58 -08:00
reed
8ed666d230 add gm for stroked circles that are zoomed
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/912203002
2015-02-10 17:44:26 -08:00
robertphillips
e85a32d4f8 Clean up clipping code a bit
Review URL: https://codereview.chromium.org/913693002
2015-02-10 08:16:55 -08:00
reed
61adb1b649 more gms for conics
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/869843006
2015-02-09 13:01:05 -08:00
bsalomon
d0423587ac One createTexture function, attempt to recycle scratch in createTexture.
Review URL: https://codereview.chromium.org/864383003
2015-02-06 08:49:24 -08:00
halcanary
797f58a529 GM for http://skbug.com/3398
BUG=skia:3398

Review URL: https://codereview.chromium.org/896093005
2015-02-05 10:26:27 -08:00
reed
76113a9b77 add SkAnimTimer, SPACE = pause/resume, ESP = stop
BUG=skia:

Review URL: https://codereview.chromium.org/894083003
2015-02-02 12:55:02 -08:00
rmistry
465206af18 Add missing SK_OVERRIDE
Tested by running on clang head + ubuntu 14.04:
GYP_DEFINES=”skia_gpu=0 skia_warnings_as_errors=1" tools/xsan_build thread dm BUILDTYPE=Release
out/Release/dm -v

BUG=skia:3386

Review URL: https://codereview.chromium.org/894833002
2015-02-02 12:08:18 -08:00
reed
d9adfe6a22 allow GMs to animate
BUG=skia:

Review URL: https://codereview.chromium.org/888283002
2015-02-01 19:01:04 -08:00
Brian Salomon
0b737c52a7 Remove extraneous newline.
TBR=mtklein@google.com

Review URL: https://codereview.chromium.org/878333004
2015-01-31 14:29:16 -05:00
bsalomon
b62da80cbf Add standard way to indicate GM is GPU-only.
TBR=egdaniel@google.com,mtklein@google.com

Review URL: https://codereview.chromium.org/869393007
2015-01-31 07:51:14 -08:00
reed
19d8f9f173 add new gm for SkPath::addArc()
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/888663002
2015-01-29 10:48:16 -08:00
mtklein
f4ba3219c2 Revert of DM::SKPSrc::size() reports correct size. (patchset #3 id:40001 of https://codereview.chromium.org/863243005/)
Reason for revert:
Still no good on Chrome OS bot:

http://build.chromium.org/p/client.skia/builders/Test-ChromeOS-Alex-GMA3150-x86-Release/builds/628/steps/dm/logs/stdio

Original issue's description:
> DM::SKPSrc::size() reports correct size.
>
> Also, DM::GPUSink and DM::RasterSink crop DM::Src::size() to 2048x2048.
>
> Motivation:
>   Improve PDF testing by printing the entire SKP.
>
> Source: http://crrev.com/863243004
>
> BUG=skia:3365
>
> Committed: https://skia.googlesource.com/skia/+/441b10eac09a1f44983e35da827a6b438a409e63
>
> CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu12-ShuttleA-GTX660-x86-Release-Trybot,Test-ChromeOS-Alex-GMA3150-x86-Release-Trybot
>
> Committed: https://skia.googlesource.com/skia/+/d4dd58e43ca4551531ad6a9f54bfc5632ea45a80

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

Review URL: https://codereview.chromium.org/886543005
2015-01-28 15:32:24 -08:00
mtklein
d4dd58e43c DM::SKPSrc::size() reports correct size.
Also, DM::GPUSink and DM::RasterSink crop DM::Src::size() to 2048x2048.

Motivation:
  Improve PDF testing by printing the entire SKP.

Source: http://crrev.com/863243004

BUG=skia:3365

Committed: https://skia.googlesource.com/skia/+/441b10eac09a1f44983e35da827a6b438a409e63

CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu12-ShuttleA-GTX660-x86-Release-Trybot

Review URL: https://codereview.chromium.org/863243005
2015-01-28 13:59:42 -08:00
joshualitt
5ce33c17af dstread gm
TBR=
BUG=skia:

Review URL: https://codereview.chromium.org/883053002
2015-01-28 11:08:01 -08:00
joshualitt
c2893c5e38 Revert of GrBatchPrototype (patchset #32 id:630001 of https://codereview.chromium.org/845103005/)
Reason for revert:
One last try to fix mac perf regression

Original issue's description:
> GrBatchPrototype
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/d15e4e45374275c045572b304c229237c4a82be4
>
> Committed: https://skia.googlesource.com/skia/+/d5a7db4a867c7e6ccf8451a053d987b470099198

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

Review URL: https://codereview.chromium.org/877393002
2015-01-28 06:54:30 -08:00
joshualitt
d5a7db4a86 GrBatchPrototype
BUG=skia:

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

Review URL: https://codereview.chromium.org/845103005
2015-01-27 15:39:06 -08:00
reed
776c0cd955 fix gm to not rely on SkColor's swizzle == SkPMColor's
BUG=skia:3361

Review URL: https://codereview.chromium.org/873983009
2015-01-27 07:26:51 -08:00
joshualitt
ca0a1799ff Revert of GrBatchPrototype (patchset #30 id:570001 of https://codereview.chromium.org/845103005/)
Reason for revert:
creates large performance regression

Original issue's description:
> GrBatchPrototype
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/d15e4e45374275c045572b304c229237c4a82be4

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

Review URL: https://codereview.chromium.org/862823004
2015-01-27 06:41:33 -08:00
bungeman
6bdc9cd003 Add sbix font to coloremoji gm.
Review URL: https://codereview.chromium.org/797043002
2015-01-26 14:08:52 -08:00
joshualitt
d15e4e4537 GrBatchPrototype
BUG=skia:

Review URL: https://codereview.chromium.org/845103005
2015-01-26 13:30:10 -08:00
halcanary
b0cce2c1d3 s/sk_tools::DrawCheckerboard/sk_tool_utils::draw_checkerboard/
BUG=skia:

Review URL: https://codereview.chromium.org/873333004
2015-01-26 12:49:00 -08:00
cwallez
80a61df691 Fix Morphology effects sourcing outside of the crop rect.
BUG=skia:1766

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

Review URL: https://codereview.chromium.org/781153002
2015-01-26 12:20:14 -08:00
halcanary
878fa0204b Factor out checkerboard function in gm and sampleapp into tools.
Review URL: https://codereview.chromium.org/834303005
2015-01-26 11:24:32 -08:00
cwallez
c12b74dc41 Collapse consecutive SkTableColorFilters
BUG=skia:1366

For the added bench, the collapsing makes the bench take:
- 70% of the time for CPU rendering of 3 consecutive matrix filters
- almost no change in the GPU rendering of the matrix filters
- 50% of the time for CPU and GPU rendering of 3 consecutive table filters

Review URL: https://codereview.chromium.org/776673002
2015-01-26 07:45:53 -08:00
robertphillips
42dbfa8651 Add patheffects to debugger printout
TBR=bsalomon@google.com

Review URL: https://codereview.chromium.org/872043002
2015-01-26 06:08:52 -08:00
robertphillips
b644e9afde Fix Windows build
TBR=jvanverth@google.com
NOTRY=true
NOTREECHECKS=true

Review URL: https://codereview.chromium.org/876643002
2015-01-26 05:39:26 -08:00
kkinnunen
dc0f408a96 Fold alpha to the inner savelayer in savelayer-savelayer-restore patterns
Fold alpha to the inner savelayer in savelayer-savelayer-restore
patterns such as this:

  SaveLayer (non-opaque)
    Save
      ClipRect
      SaveLayer
      Restore
    Restore
  Restore

Current blink generates these for example for SVG content such as this:

<path style="opacity:0.5 filter:url(#blur_filter)"/>

The outer save layer is due to the opacity and the inner one is due to
blur filter being implemented with picture image filter.

Reduces layers in desk_carsvg.skp testcase from 115 to 78.

BUG=skia:3119

Review URL: https://codereview.chromium.org/835973005
2015-01-26 00:14:26 -08:00
mtklein
1eea9fcb24 Revert of Fix Morphology effects sourcing outside of the crop rect. (patchset #6 id:100001 of https://codereview.chromium.org/781153002/)
Reason for revert:
Looks like this is causing memory leaks:
http://build.chromium.org/p/client.skia/builders/Test-Ubuntu13.10-GCE-NoGPU-x86_64-Debug-ASAN/builds/1155/steps/dm/logs/stdio

And causing crashes on Mac 10.6:
http://build.chromium.org/p/client.skia/builders/Test-Mac10.6-MacMini4.1-GeForce320M-x86_64-Debug/builds/1417/steps/dm/logs/stdio

Original issue's description:
> Fix Morphology effects sourcing outside of the crop rect.
>
> BUG=skia:1766
>
> Committed: https://skia.googlesource.com/skia/+/f6be925b5615f07039ce95c3433039694a8d1679

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

Review URL: https://codereview.chromium.org/868973005
2015-01-23 16:09:32 -08:00
cwallez
f6be925b56 Fix Morphology effects sourcing outside of the crop rect.
BUG=skia:1766

Review URL: https://codereview.chromium.org/781153002
2015-01-23 13:35:10 -08:00
mtklein
1c4029296f remove unused GM flags
Depends on https://codereview.chromium.org/873753002/

Thumbs up to CLion for refactoring this for me.

BUG=skia:

Review URL: https://codereview.chromium.org/867963004
2015-01-23 11:07:08 -08:00
mtklein
cf5d9c993d Spin off GM::runAsBench() from flags.
This will let us kill flags.

BUG=skia:

Review URL: https://codereview.chromium.org/873753002
2015-01-23 10:31:45 -08:00
reed
f803da12cf add newImage API
BUG=skia:3277
related bug: skbug.com/3276

Review URL: https://codereview.chromium.org/821083002
2015-01-23 05:58:07 -08:00
egdaniel
8dd688b756 Rename GrOptDrawState to GrPipeline and GrDrawState to GrPipelineBuilder
BUG=skia:

Review URL: https://codereview.chromium.org/858343002
2015-01-22 10:16:09 -08:00
scroggo
a1193e4b0e Make SkStream *not* ref counted.
SkStream is a stateful object, so it does not make sense for it to have
multiple owners. Make SkStream inherit directly from SkNoncopyable.

Update methods which previously called SkStream::ref() (e.g.
SkImageDecoder::buildTileIndex() and SkFrontBufferedStream::Create(),
which required the existing owners to call SkStream::unref()) to take
ownership of their SkStream parameters and delete when done (including
on failure).

Switch all SkAutoTUnref<SkStream>s to SkAutoTDelete<SkStream>s. In some
cases this means heap allocating streams that were previously stack
allocated.

Respect ownership rules of SkTypeface::CreateFromStream() and
SkImageDecoder::buildTileIndex().

Update the comments for exceptional methods which do not affect the
ownership of their SkStream parameters (e.g.
SkPicture::CreateFromStream() and SkTypeface::Deserialize()) to be
explicit about ownership.

Remove test_stream_life, which tested that buildTileIndex() behaved
correctly when SkStream was a ref counted object. The test does not
make sense now that it is not.

In SkPDFStream, remove the SkMemoryStream member. Instead of using it,
create a new SkMemoryStream to pass to fDataStream (which is now an
SkAutoTDelete).

Make other pdf rasterizers behave like SkPDFDocumentToBitmap.

SkPDFDocumentToBitmap delete the SkStream, so do the same in the
following pdf rasterizers:

SkPopplerRasterizePDF
SkNativeRasterizePDF
SkNoRasterizePDF

Requires a change to Android, which currently treats SkStreams as ref
counted objects.

Review URL: https://codereview.chromium.org/849103004
2015-01-21 12:09:53 -08:00
reed
3f43f8ab9c remove dead SkPersp macros
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/864713002
2015-01-20 19:58:36 -08:00
bsalomon
3886046f00 Revert "Revert "delete old things!""
This reverts commit 8b4489b6e6.
Delete gm and other unused files

TBR=mtklien@google.com

Review URL: https://codereview.chromium.org/856103002
2015-01-20 10:23:02 -08:00
reed
a9cb871de8 fix labels on image-surface gm
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/834903003
2015-01-16 14:21:40 -08:00
Brian Salomon
8b4489b6e6 Revert "delete old things!"
This reverts commit 15b125d401.

NOTREECHECKS=true

original change breaks android tree

BUG=skia:

Review URL: https://codereview.chromium.org/848073005
2015-01-16 16:26:32 -05:00
bsalomon
15b125d401 delete old things!
NOTREECHECKS=true

Review URL: https://codereview.chromium.org/855003006
2015-01-16 12:08:54 -08:00
bsalomon
afe3005be3 Require budget decision when creating a RenderTarget SkSurface.
Restructure SkGpuDevice creation:
*SkSurfaceProps are optional.
*Use SkSurfaceProps to communicate DF text rather than a flag.
*Tell SkGpuDevice::Create whether RT comes from cache or not.

Review URL: https://codereview.chromium.org/848903004
2015-01-16 07:32:33 -08:00
reed
c695e95417 add gm to show miplevels (patchset #2 id:20001 of https://codereview.chromium.org/849173004/)"
fixed memory leak

This reverts commit 04f07fcbfd.

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/854163002
2015-01-16 05:01:16 -08:00
mtklein
04f07fcbfd Revert of add gm to show miplevels (patchset #2 id:20001 of https://codereview.chromium.org/849173004/)
Reason for revert:
==31530==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 224 byte(s) in 2 object(s) allocated from:
    #0 0x7febb223f65b in operator new(unsigned long) (/home/default/storage/skia-repo/buildbot/skiabot-linux-xsan-001/build/slave/Test-Ubuntu13_10-GCE-NoGPU-x86_64-Debug-ASAN/build/skia/out/Debug/dm+0x35865b)
    #1 0x7febb3483c56 in SkMipMap::Build(SkBitmap const&, SkDiscardableMemory* (*)(unsigned long)) /home/default/storage/skia-repo/buildbot/skiabot-linux-xsan-001/build/slave/Test-Ubuntu13_10-GCE-NoGPU-x86_64-Debug-ASAN/build/skia/out/Debug/../../src/core/SkMipMap.cpp:181:9
    #2 0x7febb2c37914 in ShowMipLevels::onDraw(SkCanvas*) /home/default/storage/skia-repo/buildbot/skiabot-linux-xsan-001/build/slave/Test-Ubuntu13_10-GCE-NoGPU-x86_64-Debug-ASAN/build/skia/out/Debug/../../gm/downsamplebitmap.cpp:228:24
    #3 0x7febb2295736 in skiagm::GM::drawContent(SkCanvas*) /home/default/storage/skia-repo/buildbot/skiabot-linux-xsan-001/build/slave/Test-Ubuntu13_10-GCE-NoGPU-x86_64-Debug-ASAN/build/skia/out/Debug/../../gm/gm.cpp:32:5
    #4 0x7febb2295019 in skiagm::GM::draw(SkCanvas*) /home/default/storage/skia-repo/buildbot/skiabot-linux-xsan-001/build/slave/Test-Ubuntu13_10-GCE-NoGPU-x86_64-Debug-ASAN/build/skia/out/Debug/../../gm/gm.cpp:24:5
    #5 0x7febb226722f in DM::GMSrc::draw(SkCanvas*) const /home/default/storage/skia-repo/buildbot/skiabot-linux-xsan-001/build/slave/Test-Ubuntu13_10-GCE-NoGPU-x86_64-Debug-ASAN/build/skia/out/Debug/../../dm/DMSrcSink.cpp:22:5
    #6 0x7febb226d929 in DM::RasterSink::draw(DM::Src const&, SkBitmap*, SkWStream*) const /home/default/storage/skia-repo/buildbot/skiabot-linux-xsan-001/build/slave/Test-Ubuntu13_10-GCE-NoGPU-x86_64-Debug-ASAN/build/skia/out/Debug/../../dm/DMSrcSink.cpp:230:12
    #7 0x7febb224e004 in Task::Run(Task*) /home/default/storage/skia-repo/buildbot/skiabot-linux-xsan-001/build/slave/Test-Ubuntu13_10-GCE-NoGPU-x86_64-Debug-ASAN/build/skia/out/Debug/../../dm/DM.cpp:254:25
    #8 0x7febb3805e4c in (anonymous namespace)::ThreadPool::Loop(void*) /home/default/storage/skia-repo/buildbot/skiabot-linux-xsan-001/build/slave/Test-Ubuntu13_10-GCE-NoGPU-x86_64-Debug-ASAN/build/skia/out/Debug/../../src/core/SkTaskGroup.cpp:149:13
    #9 0x7febb460dc7c in thread_start(void*) /home/default/storage/skia-repo/buildbot/skiabot-linux-xsan-001/build/slave/Test-Ubuntu13_10-GCE-NoGPU-x86_64-Debug-ASAN/build/skia/out/Debug/../../src/utils/SkThreadUtils_pthread.cpp:66:9
    #10 0x7febb1251f6d in start_thread /build/buildd/eglibc-2.17/nptl/pthread_create.c:311

Indirect leak of 699528 byte(s) in 2 object(s) allocated from:
    #0 0x7febb22214ab in __interceptor_malloc (/home/default/storage/skia-repo/buildbot/skiabot-linux-xsan-001/build/slave/Test-Ubuntu13_10-GCE-NoGPU-x86_64-Debug-ASAN/build/skia/out/Debug/dm+0x33a4ab)
    #1 0x7febb473e3c6 in sk_malloc_flags(unsigned long, unsigned int) /home/default/storage/skia-repo/buildbot/skiabot-linux-xsan-001/build/slave/Test-Ubuntu13_10-GCE-NoGPU-x86_64-Debug-ASAN/build/skia/out/Debug/../../src/ports/SkMemory_malloc.cpp:54:15
    #2 0x7febb473e19a in sk_malloc_throw(unsigned long) /home/default/storage/skia-repo/buildbot/skiabot-linux-xsan-001/build/slave/Test-Ubuntu13_10-GCE-NoGPU-x86_64-Debug-ASAN/build/skia/out/Debug/../../src/ports/SkMemory_malloc.cpp:40:12
    #3 0x7febb3483c94 in SkMipMap::Build(SkBitmap const&, SkDiscardableMemory* (*)(unsigned long)) /home/default/storage/skia-repo/buildbot/skiabot-linux-xsan-001/build/slave/Test-Ubuntu13_10-GCE-NoGPU-x86_64-Debug-ASAN/build/skia/out/Debug/../../src/core/SkMipMap.cpp:181:18
    #4 0x7febb2c37914 in ShowMipLevels::onDraw(SkCanvas*) /home/default/storage/skia-repo/buildbot/skiabot-linux-xsan-001/build/slave/Test-Ubuntu13_10-GCE-NoGPU-x86_64-Debug-ASAN/build/skia/out/Debug/../../gm/downsamplebitmap.cpp:228:24
    #5 0x7febb2295736 in skiagm::GM::drawContent(SkCanvas*) /home/default/storage/skia-repo/buildbot/skiabot-linux-xsan-001/build/slave/Test-Ubuntu13_10-GCE-NoGPU-x86_64-Debug-ASAN/build/skia/out/Debug/../../gm/gm.cpp:32:5
    #6 0x7febb2295019 in skiagm::GM::draw(SkCanvas*) /home/default/storage/skia-repo/buildbot/skiabot-linux-xsan-001/build/slave/Test-Ubuntu13_10-GCE-NoGPU-x86_64-Debug-ASAN/build/skia/out/Debug/../../gm/gm.cpp:24:5
    #7 0x7febb226722f in DM::GMSrc::draw(SkCanvas*) const /home/default/storage/skia-repo/buildbot/skiabot-linux-xsan-001/build/slave/Test-Ubuntu13_10-GCE-NoGPU-x86_64-Debug-ASAN/build/skia/out/Debug/../../dm/DMSrcSink.cpp:22:5
    #8 0x7febb226d929 in DM::RasterSink::draw(DM::Src const&, SkBitmap*, SkWStream*) const /home/default/storage/skia-repo/buildbot/skiabot-linux-xsan-001/build/slave/Test-Ubuntu13_10-GCE-NoGPU-x86_64-Debug-ASAN/build/skia/out/Debug/../../dm/DMSrcSink.cpp:230:12
    #9 0x7febb224e004 in Task::Run(Task*) /home/default/storage/skia-repo/buildbot/skiabot-linux-xsan-001/build/slave/Test-Ubuntu13_10-GCE-NoGPU-x86_64-Debug-ASAN/build/skia/out/Debug/../../dm/DM.cpp:254:25
    #10 0x7febb3805e4c in (anonymous namespace)::ThreadPool::Loop(void*) /home/default/storage/skia-repo/buildbot/skiabot-linux-xsan-001/build/slave/Test-Ubuntu13_10-GCE-NoGPU-x86_64-Debug-ASAN/build/skia/out/Debug/../../src/core/SkTaskGroup.cpp:149:13
    #11 0x7febb460dc7c in thread_start(void*) /home/default/storage/skia-repo/buildbot/skiabot-linux-xsan-001/build/slave/Test-Ubuntu13_10-GCE-NoGPU-x86_64-Debug-ASAN/build/skia/out/Debug/../../src/utils/SkThreadUtils_pthread.cpp:66:9
    #12 0x7febb1251f6d in start_thread /build/buildd/eglibc-2.17/nptl/pthread_create.c:311

Original issue's description:
> add gm to show miplevels
>
> BUG=skia:
> TBR=
>
> NOTREECHECKS=true
>
> Committed: https://skia.googlesource.com/skia/+/a598f4b773f066a939e0216a116c179b90550727

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

Review URL: https://codereview.chromium.org/854103004
2015-01-15 18:36:07 -08:00
reed
a598f4b773 add gm to show miplevels
BUG=skia:
TBR=

NOTREECHECKS=true

Review URL: https://codereview.chromium.org/849173004
2015-01-15 18:09:15 -08:00
fmalita
b0878797b4 SkPictureShader should handle negative scaling gracefully.
Let's not choke on inverted tiles.

BUG=chromium:447707
R=robertphillips@google.com,reed@google.com

Review URL: https://codereview.chromium.org/852213002
2015-01-15 10:45:56 -08:00
robertphillips
028b98a080 Add repro GM for GPU clipped-AA vs. non-AA drawRect discrepancy
In the clip stack we were manually rounding out non-AA clip rects but leaving the hardening of non-AA drawRects up to the GPU. In some border cases the GPU can truncate rather than round out resulting in visual discrepancies.

BUG=423834

Committed: https://skia.googlesource.com/skia/+/933a03fecb65c83f81cf65d5cf9870c69aa379ff

Review URL: https://codereview.chromium.org/839883003
2015-01-14 09:44:02 -08:00
robertphillips
125ee60ed3 Revert of Fix GPU clipped-AA vs. non-AA drawRect discrepancy (patchset #2 id:20001 of https://codereview.chromium.org/839883003/)
Reason for revert:
This CL introduces rendering conflicts with hairlines (i.e., the hairlines get overwritten). These conflicts are particularly visible on the following GMs (for the Ubuntu and Android gpu configs):

coloremoji & complexclip2_rrect_bw

Original issue's description:
> Fix GPU clipped-AA vs. non-AA drawRect discrepancy
>
> In the clip stack we were manually rounding out non-AA clip rects but leaving the hardening of non-AA drawRects up to the GPU. In some border cases the GPU can truncate rather than round out resulting in visual discrepancies.
>
> BUG=423834
>
> Committed: https://skia.googlesource.com/skia/+/933a03fecb65c83f81cf65d5cf9870c69aa379ff

TBR=bsalomon@google.com,jvanverth@google.com
NOTREECHECKS=true
NOTRY=true
BUG=423834

Review URL: https://codereview.chromium.org/847033002
2015-01-12 18:26:01 -08:00
robertphillips
933a03fecb Fix GPU clipped-AA vs. non-AA drawRect discrepancy
In the clip stack we were manually rounding out non-AA clip rects but leaving the hardening of non-AA drawRects up to the GPU. In some border cases the GPU can truncate rather than round out resulting in visual discrepancies.

BUG=423834

Review URL: https://codereview.chromium.org/839883003
2015-01-12 15:50:38 -08:00
halcanary
f62c63490f SIMPLE_GM generates less code
Review URL: https://codereview.chromium.org/811703005
2015-01-12 15:27:46 -08:00
mtklein
72c9faab45 Fix up all the easy virtual ... SK_OVERRIDE cases.
This fixes every case where virtual and SK_OVERRIDE were on the same line,
which should be the bulk of cases.  We'll have to manually clean up the rest
over time unless I level up in regexes.

for f in (find . -type f); perl -p -i -e 's/virtual (.*)SK_OVERRIDE/\1SK_OVERRIDE/g' $f; end

BUG=skia:

Review URL: https://codereview.chromium.org/806653007
2015-01-09 10:06:40 -08:00
mtklein
703dd2ed18 Remove SkTileGrid (except for TileGridInfo).
TBR=reed@google.com

BUG=skia:3085

Review URL: https://codereview.chromium.org/845623002
2015-01-09 06:41:48 -08:00
halcanary
da9170f320 Modify transparency_check GM to always tile correctly.
Review URL: https://codereview.chromium.org/842013002
2015-01-08 12:11:42 -08:00
reed
5965c8ae4e add ImageGenerator::NewFromData to porting layer
BUG=skia:3275

Review URL: https://codereview.chromium.org/834633006
2015-01-07 18:04:45 -08:00
halcanary
a7976be1dd Add Alpha fade GM.
Review URL: https://codereview.chromium.org/804813009
2015-01-07 13:23:09 -08:00
robertphillips
f4e5995ac7 It is dangerous to ignore SkRect::intersect's return value
Committed: https://skia.googlesource.com/skia/+/152f524fd325b7776b01f84afbfe2fa071648a05

Review URL: https://codereview.chromium.org/833943002
2015-01-07 12:16:10 -08:00
robertphillips
690fc594f1 Revert of It is dangerous to ignore SkRect::intersect's return value (patchset #6 id:100001 of https://codereview.chromium.org/833943002/)
Reason for revert:
Still more Chromium clean up to do

Original issue's description:
> It is dangerous to ignore SkRect::intersect's return value
>
> Committed: https://skia.googlesource.com/skia/+/152f524fd325b7776b01f84afbfe2fa071648a05

TBR=reed@google.com
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/825983005
2015-01-07 09:12:43 -08:00
robertphillips
152f524fd3 It is dangerous to ignore SkRect::intersect's return value
Review URL: https://codereview.chromium.org/833943002
2015-01-07 09:01:13 -08:00
mtklein
36a364a846 Make DCShader serializable.
This allows a test pipeline like dcshader GM -> pipe -> gpu backend.

BUG=skia:

Review URL: https://codereview.chromium.org/816403007
2015-01-07 08:02:28 -08:00
caryclark
ac8d8b8f13 revert buildbot breaker
Hals's change broke a buildbot has shown here

http://build.chromium.org/p/client.skia/builders/Test-Win7-ShuttleA-HD2000-x86-Release/builds/510/steps/gm/logs/stdio

Got unknown flag "--useDocumentInsteadOfDevice". Exiting.

TBR=halcanary

Review URL: https://codereview.chromium.org/832183006
2015-01-07 07:36:52 -08:00
halcanary
66b29a6ad5 Remove SkPDFDocument and SkPDFDevice from the public headers.
Committed: https://skia.googlesource.com/skia/+/8b1f761365df6652ea9304b6572d2dd91917b9aa

Review URL: https://codereview.chromium.org/841533002
2015-01-06 15:13:49 -08:00
reed
efdac514a9 Revert "Remove SkPDFDocument and SkPDFDevice from the public headers."
This reverts commit 8b1f761365.

BUG=skia:
TBR=
NOTRY=True
NOTREECHECKS=True

Review URL: https://codereview.chromium.org/839603002
2015-01-06 09:54:14 -08:00
halcanary
8b1f761365 Remove SkPDFDocument and SkPDFDevice from the public headers.
Review URL: https://codereview.chromium.org/841533002
2015-01-06 09:30:10 -08:00
tfarina
aa458fb20a Cleanup: More override fixes - another round.
BUG=skia:3075
TEST=ninja -C out/Debug
TBR=reed@google.com

Review URL: https://codereview.chromium.org/831113002
2015-01-05 17:18:51 -08:00
reed
40c85e41b8 Revert of Revert of enable conics gm (patchset #1 id:1 of https://codereview.chromium.org/811863006/)
Reason for revert:
maybe this wasn't the cause of the chromeos crash?

Original issue's description:
> Revert of enable conics gm (patchset #3 id:40001 of https://codereview.chromium.org/835593002/)
>
> Reason for revert:
> did I break the build?
>
> Original issue's description:
> > enable conics gm
> >
> > BUG=skia:
> > TBR=
> >
> > Committed: https://skia.googlesource.com/skia/+/03119ba4f815bc2c2774a9349ca8278ab1695072
>
> TBR=egdaniel@google.com
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/ede901c7a2e21a44552b8c1436d9521ce33f4de5

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

Review URL: https://codereview.chromium.org/836773002
2015-01-05 10:01:25 -08:00
halcanary
50b9307e96 Correctly declare skiagm::DCShader to be not flattenable.
Motivation: As part of my testing I serialize all of our GMs to SKP
files.  This was breaking my code.

Review URL: https://codereview.chromium.org/832393002
2015-01-05 08:55:34 -08:00
reed
ede901c7a2 Revert of enable conics gm (patchset #3 id:40001 of https://codereview.chromium.org/835593002/)
Reason for revert:
did I break the build?

Original issue's description:
> enable conics gm
>
> BUG=skia:
> TBR=
>
> Committed: https://skia.googlesource.com/skia/+/03119ba4f815bc2c2774a9349ca8278ab1695072

TBR=egdaniel@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/811863006
2015-01-04 20:52:15 -08:00
reed
03119ba4f8 enable conics gm
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/835593002
2015-01-04 20:24:42 -08:00
reed
d1bd1d75a3 fix conic gm to have fixed wrapping
BUG=skia:
TBR=
NOTRY=True

Review URL: https://codereview.chromium.org/815143003
2014-12-31 20:07:01 -08:00
joshualitt
8059eb9f6e Move ViewMatrix off of drawstate
BUG=skia:

Review URL: https://codereview.chromium.org/815553003
2014-12-29 15:10:07 -08:00
robertphillips
4f662e62cd Update stroke path to use rect returned from isRect (to fix trailing moveTo bug)
This basically recreates what was done in:

https://codereview.chromium.org/16950021/ (add rect-output parameter to isRect, allowing us to return the correct bounds even if a rectagular path has a trailing moveTo) with the addition of GM representation

BUG=skia:247770

Review URL: https://codereview.chromium.org/834503002
2014-12-29 14:06:51 -08:00
joshualitt
d27f73ef27 Remove coordchanges from drawstate
BUG=skia:

Review URL: https://codereview.chromium.org/818233002
2014-12-29 07:43:36 -08:00
bsalomon
b0ae649b7e Add device space skshader GM to test kDevice_GrCoordSet
Review URL: https://codereview.chromium.org/816003002
2014-12-29 07:05:27 -08:00
reed
2906d4a387 disable using codecs until that can work in chrome
BUG=skia:3275
TBR=

Review URL: https://codereview.chromium.org/820343002
2014-12-25 20:41:13 -08:00
reed
b2a5d7e02f add image-from-codec to c api
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/822203002
2014-12-25 14:16:21 -08:00
joshualitt
8fc6c2d82c This CL cleans up the last remaining users of localCoordChange on paint
NOTREECHECKS=True
BUG=skia:

Review URL: https://codereview.chromium.org/817853002
2014-12-22 15:27:05 -08:00
bsalomon
51d1f7e3a4 reenable complexclip3 for gpu
Review URL: https://codereview.chromium.org/814273003
2014-12-22 08:40:49 -08:00
tfarina
752e7eb157 Cleanup: Another round of override fixes.
BUG=skia:3075
TEST=ninja -C out/Debug
TBR=mtklein@google.com

Review URL: https://codereview.chromium.org/815883002
2014-12-20 06:53:43 -08:00
joshualitt
c14e556f8c fix leak
NOTREECHECKS=True
TBR=
BUG=skia:

Review URL: https://codereview.chromium.org/817083002
2014-12-19 14:43:33 -08:00
robertphillips
f3f5bad7de Add toString methods to SkImageFilter-derived classes
This isn't definitive but at least makes something show up in the debugger.

Review URL: https://codereview.chromium.org/789163006
2014-12-19 13:49:15 -08:00
joshualitt
290c09b8bb initial changes to add local matrix to primitive processor
BUG=skia:

Review URL: https://codereview.chromium.org/820523002
2014-12-19 13:45:20 -08:00
bsalomon
a3ca6925fa disable GM that asserts on gpu
BUG=skia:3265

TBR=egdaniel@google.com
NOTRY=true
NOTREECHECKS=true

Review URL: https://codereview.chromium.org/818743002
2014-12-19 09:32:40 -08:00
reed
438b0d754d Enable new gradients + suppress gms for now
This reverts commit 2c770271e6.

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/811753003
2014-12-19 07:40:26 -08:00
joshualitt
341400ea7b I could create new GMs if you prefer.
BUG=skia:

Review URL: https://codereview.chromium.org/812163002
2014-12-18 11:54:14 -08:00
bsalomon
3f490a0c01 Fix complexclip3 test on gpu
BUG=skia:3260
R=egdaniel@google.com

Review URL: https://codereview.chromium.org/813653003
2014-12-18 06:20:52 -08:00
joshualitt
5531d51ce7 remove view matrix from context
BUG=skia:

Review URL: https://codereview.chromium.org/808703006
2014-12-17 15:50:11 -08:00
bsalomon
6ae83cf7f6 add inverted path draw cases to complexclip gm
Review URL: https://codereview.chromium.org/809163002
2014-12-17 14:38:49 -08:00
egdaniel
df795036fd Add new complexclip3 gm.
This GM is used to test the combined clipping of a complex clip (packman shape)
and a simple one (circle). We loop over all combinations of clip ops, aa/bw clip,
and inverse/non-inverse clips.

This GM triggers a current bug in the gpu clipping code which fires an assert. Thus
the skipGPU flag is set until that bug is fixed.

BUG=skia:

Review URL: https://codereview.chromium.org/798793003
2014-12-17 11:22:37 -08:00
robertphillips
ed31343805 Alter GM's --mpd option to write out images
Review URL: https://codereview.chromium.org/811863002
2014-12-16 09:31:42 -08:00
robertphillips
478dd72336 Fix layer hoisting image filter corner cases
This CL fixes 5 bugs related to hoisting image filters:

For image filters the src layer (the one prior to filtering) often needs to be
smaller then the final layer. This requires the saveLayer's optional bounds
to be stored (in SkLayerInfo.h and SkRecordDraw.cpp) and then used in
compute_source_rect and carried around in GrCachedLayer.

The image filters can add an extra offset to the final draw operation.
This is now computed in GrLayerHoister::FilterLayer and  carried around in
GrCachedLayer.

Filtered layers must use exact matches. This is now done in GrLayerCache::lock.

The filter cache requires a valid matrix so it can compute the correct offset.
This is now done in GrLayerHoister::FilterLayer.

Filtered layers need to be drawn with drawSprite while unfiltered (and therefore
hopefully atlased) layers can be drawn with drawBitmap. This is now done in
draw_replacement_bitmap.

Committed: https://skia.googlesource.com/skia/+/702eb9622102599d94ab6798e6227cf29f48c2d3

Review URL: https://codereview.chromium.org/803183003
2014-12-16 08:25:55 -08:00
robertphillips
86f032832f Revert of Fix layer hoisting image filter corner cases (patchset #3 id:40001 of https://codereview.chromium.org/803183003/)
Reason for revert:
Breaking DM

Original issue's description:
> Fix layer hoisting image filter corner cases
>
> This CL fixes 5 bugs related to hoisting image filters:
>
> For image filters the src layer (the one prior to filtering) often needs to be
> smaller then the final layer. This requires the saveLayer's optional bounds
> to be stored (in SkLayerInfo.h and SkRecordDraw.cpp) and then used in
> compute_source_rect and carried around in GrCachedLayer.
>
> The image filters can add an extra offset to the final draw operation.
> This is now computed in GrLayerHoister::FilterLayer and  carried around in
> GrCachedLayer.
>
> Filtered layers must use exact matches. This is now done in GrLayerCache::lock.
>
> The filter cache requires a valid matrix so it can compute the correct offset.
> This is now done in GrLayerHoister::FilterLayer.
>
> Filtered layers need to be drawn with drawSprite while unfiltered (and therefore
> hopefully atlased) layers can be drawn with drawBitmap. This is now done in
> draw_replacement_bitmap.
>
> Committed: https://skia.googlesource.com/skia/+/702eb9622102599d94ab6798e6227cf29f48c2d3

TBR=bsalomon@google.com
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/790643009
2014-12-16 07:41:37 -08:00
robertphillips
702eb96221 Fix layer hoisting image filter corner cases
This CL fixes 5 bugs related to hoisting image filters:

For image filters the src layer (the one prior to filtering) often needs to be
smaller then the final layer. This requires the saveLayer's optional bounds
to be stored (in SkLayerInfo.h and SkRecordDraw.cpp) and then used in
compute_source_rect and carried around in GrCachedLayer.

The image filters can add an extra offset to the final draw operation.
This is now computed in GrLayerHoister::FilterLayer and  carried around in
GrCachedLayer.

Filtered layers must use exact matches. This is now done in GrLayerCache::lock.

The filter cache requires a valid matrix so it can compute the correct offset.
This is now done in GrLayerHoister::FilterLayer.

Filtered layers need to be drawn with drawSprite while unfiltered (and therefore
hopefully atlased) layers can be drawn with drawBitmap. This is now done in
draw_replacement_bitmap.

Review URL: https://codereview.chromium.org/803183003
2014-12-16 07:27:30 -08:00
reed
0393912de7 pass dst-rect through from drawBitmapRect for better precision
BUG=skia:

Review URL: https://codereview.chromium.org/797963002
2014-12-15 13:42:51 -08:00
reed
8893e5f030 add paint::getFontBounds()
BUG=skia:

Review URL: https://codereview.chromium.org/804903006
2014-12-15 13:27:26 -08:00
scroggo
f9d610179d There can be only one (SkRandom)!
Remove SkLCGRandom. We already decided the new one was better, which is
why we wrote the new SkRandom.

Convert GMs that were using SkLCGRandom to use the improved SkRandom.
Motivated by the fact that these GMs draw differently on some runs. We
believe this to be a result of using the old SkLCGRandom.

Add each of the tests that were using SkLCGRandom to ignore-tests.txt,
since we expect they'll draw differently using SkRandom.

Move a trimmed down version of SkLCGRandom into SkDiscretePathEffect.
In order to preserve the old behavior, trim down SkLCGRandom to only
the methods used by SkDiscretePathEffect, and hide it in
SkDiscretePathEffect's cpp file.

BUG=skia:3241

Review URL: https://codereview.chromium.org/805963002
2014-12-15 12:54:51 -08:00
mtklein
9a0d6d6c88 skimage, die die die
DM's running with --images on all the bots now.  They look happy.

BUG=skia:3235

Review URL: https://codereview.chromium.org/804133003
2014-12-15 12:47:52 -08:00
bsalomon
ce1c8869cf Do circle anti-aliasing in normalized space to avoid precision issues with half-floats on Adreno.
Review URL: https://codereview.chromium.org/761593006
2014-12-15 07:11:22 -08:00
bsalomon
fbaace0827 DM warning-free on win64
Review URL: https://codereview.chromium.org/805543002
2014-12-12 16:41:46 -08:00
bsalomon
ef3fcd877a More win64 warning fixes
Review URL: https://codereview.chromium.org/798723002
2014-12-12 08:51:39 -08:00
joshualitt
56995b5cc0 Remove GP from drawstate, revision of invariant output for GP
BUG=skia:

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

Review URL: https://codereview.chromium.org/791743003
2014-12-11 15:44:02 -08:00
robertphillips
8c508b4413 Update GM to permit correctness testing of MPD on the GMs
Review URL: https://codereview.chromium.org/794273003
2014-12-11 13:10:23 -08:00
scroggo
895c43b28b Replace EncodeBitmap with an interface.
Gives more flexibility to the caller to decide whether to use the
encoded data returned by refEncodedData().

Provides an implementation that supports the old version of
SkPicture::serialize().

TODO: Update Chrome, so we can remove SK_LEGACY_ENCODE_BITMAP entirely

BUG=skia:3190

Review URL: https://codereview.chromium.org/784643002
2014-12-11 10:53:58 -08:00
joshualitt
bd528cdb51 fix for chrome bug with sub pixel hairlines
BUG=skia:

Review URL: https://codereview.chromium.org/796573002
2014-12-10 14:23:40 -08:00
joshualitt
8c0f615fdd Revert of Remove GP from drawstate, revision of invariant output for GP (patchset #9 id:160001 of https://codereview.chromium.org/791743003/)
Reason for revert:
breaks mac

Original issue's description:
> Remove GP from drawstate, revision of invariant output for GP
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/c6bc58eded89b0c0a36b8e20e193c200f297a0da

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

Review URL: https://codereview.chromium.org/794843002
2014-12-10 14:12:22 -08:00
joshualitt
c6bc58eded Remove GP from drawstate, revision of invariant output for GP
BUG=skia:

Review URL: https://codereview.chromium.org/791743003
2014-12-10 13:48:57 -08:00
bungeman
5bec916cf6 Remove MULTILINE, ^, and $ from re finding actual_results.json.
MULTILINE, ^, and $ work based on the platform, but the files being
parsed are from other platforms. As a result, the current code for
extracting the actual_results.json version will not find it in
logfiles produced on Windows when run on Mac.

The code for extracting the exact actual_results.json file to use
from a logfile is itself something of a hack, as this information
should be provided ina more structured manner. This proposed
method of finding the exact file is no worse than the old one, and
in cases like above, better.

Review URL: https://codereview.chromium.org/789253002
2014-12-10 12:18:04 -08:00
Florin Malita
c54d8db4d1 Remove SkCanvas::drawBitmapMatrix()
R=mtklein@google.com, reed@google.com, robertphillips@google.com

Review URL: https://codereview.chromium.org/789033002
2014-12-10 12:02:16 -05:00
qiankun.miao
28828d00b2 Add GM for 2-rects blur which cannot break into nine-patch
BUG=skia:

Review URL: https://codereview.chromium.org/791943002
2014-12-10 07:40:36 -08:00
reed
3054be16df Remove canvas::NewRaster, and rename surface::NewRasterPMColor to N32Premul
patch from issue 781403002 at patchset 20001 (http://crrev.com/781403002#ps20001)

BUG=skia:
TBR=
re-landing after chrome fixes have landed

Review URL: https://codereview.chromium.org/784223007
2014-12-10 07:24:28 -08:00
reed
a8918a0650 Revert of remove (dumb) canvas::NewRaster, and rename surface::NewRasterPMColor to N32Premul (patchset #3 id:40001 of https://codereview.chromium.org/790733003/)
Reason for revert:
need to update chrome first

Original issue's description:
> remove (dumb) canvas::NewRaster, and rename surface::NewRasterPMColor to N32Premul
>
> patch from issue 781403002 at patchset 20001 (http://crrev.com/781403002#ps20001)
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/2c1605a1fbaa2e35a27399a34254fb1200ec2ae6

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

Review URL: https://codereview.chromium.org/791763002
2014-12-09 13:55:20 -08:00
joshualitt
2e3b3e369d This cl moves color and coverage off of drawstate. In an effort to keep this CL manageable, I have left the compute invariant input / output in a bit of a strange state(fixing this will be complicated).
In addition, NVPR makes this very complicated, and I haven't quite figured out a good way to handle it, so for now color and coverage DO live on optstate, but I will figure out some way to refactor that in future CLs.

BUG=skia:

Review URL: https://codereview.chromium.org/783763002
2014-12-09 13:31:15 -08:00
junov
f3c78ccf56 Adding an option for pixelated rendering in SkPictureImageFilter
BUG=skia:3209

Review URL: https://codereview.chromium.org/787073003
2014-12-09 13:07:22 -08:00
reed
2c1605a1fb remove (dumb) canvas::NewRaster, and rename surface::NewRasterPMColor to N32Premul
patch from issue 781403002 at patchset 20001 (http://crrev.com/781403002#ps20001)

BUG=skia:

Review URL: https://codereview.chromium.org/790733003
2014-12-09 12:33:38 -08:00
egdaniel
9513143efa Make all blending up to GrOptDrawState be handled by the xp/xp factory.
In this cl the blending information is extracted for the xp and stored in the ODS
which is then used as it currently is. In the follow up cl, an XP backend will be added
and at that point all blending work will take place inside XP's.

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/7c66342a399b529634bed0fabfaa562db2c0dbd4

Review URL: https://codereview.chromium.org/759713002
2014-12-09 11:15:44 -08:00
bsalomon
17168df779 Use texture size to determine precision of texture coord varyings.
Review URL: https://codereview.chromium.org/778783002
2014-12-09 09:00:49 -08:00
scroggo
3030445799 Revert of Replace EncodeBitmap with an interface. (patchset #12 id:210001 of https://codereview.chromium.org/784643002/)
Reason for revert:
Failing serialization tasks in DM:

http://build.chromium.org/p/client.skia/builders/Test-Win8-ShuttleA-GTX660-x86-Debug/builds/352/steps/dm/logs/stdio

Original issue's description:
> Replace EncodeBitmap with an interface.
>
> Gives more flexibility to the caller to decide whether to use the
> encoded data returned by refEncodedData().
>
> Provides an implementation that supports the old version of
> SkPicture::serialize().
>
> TODO: Update Chrome, so we can remove SK_LEGACY_ENCODE_BITMAP entirely
>
> BUG=skia:3190
>
> Committed: https://skia.googlesource.com/skia/+/0c4aba6edb9900c597359dfa49d3ce4a41bc5dd1
>
> Committed: https://skia.googlesource.com/skia/+/02b217f80b01a7dda8493422e5257c36a9ce8464

TBR=reed@google.com,rmistry@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:3190

Review URL: https://codereview.chromium.org/783393004
2014-12-09 08:27:37 -08:00
scroggo
02b217f80b Replace EncodeBitmap with an interface.
Gives more flexibility to the caller to decide whether to use the
encoded data returned by refEncodedData().

Provides an implementation that supports the old version of
SkPicture::serialize().

TODO: Update Chrome, so we can remove SK_LEGACY_ENCODE_BITMAP entirely

BUG=skia:3190

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

Review URL: https://codereview.chromium.org/784643002
2014-12-09 07:44:36 -08:00
robertphillips
c0708cb7bc Revert of Replace EncodeBitmap with an interface. (patchset #11 id:190001 of https://codereview.chromium.org/784643002/)
Reason for revert:
Compilation is failing on some bots

Original issue's description:
> Replace EncodeBitmap with an interface.
>
> Gives more flexibility to the caller to decide whether to use the
> encoded data returned by refEncodedData().
>
> Provides an implementation that supports the old version of
> SkPicture::serialize().
>
> TODO: Update Chrome, so we can remove SK_LEGACY_ENCODE_BITMAP entirely
>
> BUG=skia:3190
>
> Committed: https://skia.googlesource.com/skia/+/0c4aba6edb9900c597359dfa49d3ce4a41bc5dd1

TBR=reed@google.com,scroggo@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:3190

Review URL: https://codereview.chromium.org/787833002
2014-12-09 05:35:07 -08:00
fmalita
6cd1181bc1 Cleanup GM:pictureshadertile
Post review cleanup for https://codereview.chromium.org/733203005/

TBR=robertphillips@google.com

Review URL: https://codereview.chromium.org/784053002
2014-12-09 05:23:20 -08:00
scroggo
0c4aba6edb Replace EncodeBitmap with an interface.
Gives more flexibility to the caller to decide whether to use the
encoded data returned by refEncodedData().

Provides an implementation that supports the old version of
SkPicture::serialize().

TODO: Update Chrome, so we can remove SK_LEGACY_ENCODE_BITMAP entirely

BUG=skia:3190

Review URL: https://codereview.chromium.org/784643002
2014-12-09 05:23:12 -08:00
egdaniel
8d95ffa497 Revert of Make all blending up to GrOptDrawState be handled by the xp/xp factory. (patchset #7 id:140001 of https://codereview.chromium.org/759713002/)
Reason for revert:
break many gm's

Original issue's description:
> Make all blending up to GrOptDrawState be handled by the xp/xp factory.
>
> In this cl the blending information is extracted for the xp and stored in the ODS
> which is then used as it currently is. In the follow up cl, an XP backend will be added
> and at that point all blending work will take place inside XP's.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/7c66342a399b529634bed0fabfaa562db2c0dbd4

TBR=bsalomon@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/766653008
2014-12-08 13:26:43 -08:00
egdaniel
7c66342a39 Make all blending up to GrOptDrawState be handled by the xp/xp factory.
In this cl the blending information is extracted for the xp and stored in the ODS
which is then used as it currently is. In the follow up cl, an XP backend will be added
and at that point all blending work will take place inside XP's.

BUG=skia:

Review URL: https://codereview.chromium.org/759713002
2014-12-08 11:20:40 -08:00
fmalita
a2bd24fd15 Tweak SkPictureShader's tile semantics.
Currently, the tile offset is added when drawing the picture. This might
have made a tiny bit of sense when the picture was always positioned at
origin, but with a picture cull rect offset things looks really strange.

For example, to specify a tile == the picture cull rect we have to pass
in [-cullrect.x, -cullrect.y, cullrect.width, cullrect.height]. Yikes.

(there's also a bug when not passing a tile, as we use a default tile
== cullrect but don't compensate for the above oddity)

This changes the semantics of the tile offset: it is now subtracted when
drawing the picture tile. As a consequence, one can pass in a tile equal
to the cull rect and get the expected behavior (same when not passing
a tile).

This will require a minor Blink change with the roll, as one client
works around the current behavior:
https://codereview.chromium.org/789503003

R=reed@google.com,robertphillips@google.com
BUG=440046

Review URL: https://codereview.chromium.org/733203005
2014-12-08 11:13:27 -08:00
robertphillips
9a264107fb Add new GM (filterfastbounds)
This new GM visualizes the fast bounds computed by various image-filter-based SkPaints. This is lead up to fixing some issues in fast bound computation.

BUG=418417

Review URL: https://codereview.chromium.org/788613003
2014-12-08 09:18:58 -08:00
reed
f4aa9ccd97 remove unnecessary save/clip/restore
BUG=skia:

Review URL: https://codereview.chromium.org/785493003
2014-12-05 07:33:00 -08:00
bungeman
a9bf1aadcd Tolerate unstarted builds in rebaseline server.
Currently server.py --rietveld-issue will crash if there are any
unstarted trybots on the latest patch. Instead of crashing, warn
that the bot hasn't started yet.

Review URL: https://codereview.chromium.org/758793003
2014-12-05 07:14:53 -08:00
joshualitt
2dd1ae016d First step to moving vertex attributes to the geometryProcessor
BUG=skia:

Review URL: https://codereview.chromium.org/761563002
2014-12-03 06:24:10 -08:00