Commit Graph

3241 Commits

Author SHA1 Message Date
Mike Klein
f436fbc422 slice GMs by native font platform, not by emoji format
Right now the native font platform implies what emoji formats are
supported, and we hope to support more than one per platform.  Let's
get these formats out of the name.

As with most other font-y things, only the NativeFont bots are going to
get back anything interesting now.  The others will see no emoji font
and an empty emoji sample text string.

I'm going to look at a pre-baked testing SkTypeface that serves as an
emoji font for the non-NativeFont bots next.

Change-Id: Ie1374fc0e988bfe20ae21208e2f7e0a66a68fcb1
Reviewed-on: https://skia-review.googlesource.com/71762
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-11-15 16:52:56 +00:00
Mike Klein
cb9fc4160e remove platform_font_name()
It's used rarely and now that we're mostly using portable fonts,
it only serves to confuse.  Sans-serif doesn't seem to work anyway.

Simplify gm/typeface.cpp to just test the default typeface.

Change-Id: I091239ea91af9d9e01d3c76280636a6061b5fb5c
Reviewed-on: https://skia-review.googlesource.com/71261
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-11-14 18:45:04 +00:00
Ben Wagner
339b84e78c Alloc glyph image correctly for SkMask::k3D_Format.
Re-enable the code to test the emboss mask filter, updating it to use
the new emboss mask filter factory.

Add a test to ensure that embossed text is drawn correctly, as before
glyphs did not allocate the proper amount of memory for the k3D_Format
which the emboss mask filter produces.

Fixes SkEmbossMask::Emboss to write the whole of the mul and add planes
to avoid pixel differences and MemorySanitizer errors.

Update the GPU to understand the k3D_Format and use just the alpha
plane, ignoring the mul and add plane which it currently cannot support.

Change-Id: I90edf34a918c06b0c6b24bfc43ce7031419eca41
Reviewed-on: https://skia-review.googlesource.com/70260
Reviewed-on: https://skia-review.googlesource.com/70962
Reviewed-on: https://skia-review.googlesource.com/71282
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-11-14 17:38:34 +00:00
Hal Canary
58822d6994 GMs: add platform_font_manager to some names
Change-Id: I310f39d8a470729d5525fb4f82e6a45b882313f3
Reviewed-on: https://skia-review.googlesource.com/71341
Commit-Queue: Hal Canary <halcanary@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Ben Wagner <bungeman@google.com>
2017-11-14 17:29:34 +00:00
Brian Osman
0387d35f59 Add SkColorSpace_Base::makeColorSpin
This is a utility that creates a version of an existing XYZ color space
that performs our color spin operation. Assigning this to a source remaps
RGB to GBR. Assigning it to a destination does the opposite (RGB to BRG).

Bug: skia:
Change-Id: I3528698220bd32aa01dcd3db225e60f151a4b5bd
Reviewed-on: https://skia-review.googlesource.com/71280
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-11-14 16:33:34 +00:00
Brian Osman
3e31e99bab Revert "Alloc glyph image correctly for SkMask::k3D_Format."
This reverts commit 1662257bda.

Reason for revert: Android still using this API

Original change's description:
> Alloc glyph image correctly for SkMask::k3D_Format.
> 
> Remove the no longer used outside Skia SK_SUPPORT_LEGACY_EMBOSSMASKFILTER
> define, and either delete the code it guards or update it to use the new
> emboss mask filter factory.
> 
> Re-enable the code to test the emboss mask filter.
> 
> Add a test to ensure that embossed text is drawn correctly, as before
> glyphs did not allocate the proper amount of memory for the k3D_Format
> which the emboss mask filter produces.
> 
> Fixes SkEmbossMask::Emboss to write the whole of the mul and add planes
> to avoid pixel differences and MemorySanitizer errors.
> 
> Update the GPU to understand the k3D_Format and use just the alpha
> plane, ignoring the mul and add plane which it currently cannot support.
> 
> Change-Id: Icac1a3f37d6e8c6be3151df570f5e14111e18585
> Reviewed-on: https://skia-review.googlesource.com/70260
> Reviewed-by: Herb Derby <herb@google.com>
> Reviewed-on: https://skia-review.googlesource.com/70962
> Commit-Queue: Ben Wagner <bungeman@google.com>

TBR=djsollen@google.com,bungeman@google.com,herb@google.com

Change-Id: Id6625bae8d3bd70ce7aa3045348c04fdd146c637
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/71183
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-11-14 16:16:45 +00:00
Mike Klein
8073e79e5b remove fontmgr_iter_factory GM
This explicit use of direct write isn't necessary when the NativeFont
bots will do it for us.

Change-Id: I39427992d3fa3f602e97c72c5d41dc1b057eb46b
Reviewed-on: https://skia-review.googlesource.com/71040
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2017-11-14 14:39:12 +00:00
Ben Wagner
1662257bda Alloc glyph image correctly for SkMask::k3D_Format.
Remove the no longer used outside Skia SK_SUPPORT_LEGACY_EMBOSSMASKFILTER
define, and either delete the code it guards or update it to use the new
emboss mask filter factory.

Re-enable the code to test the emboss mask filter.

Add a test to ensure that embossed text is drawn correctly, as before
glyphs did not allocate the proper amount of memory for the k3D_Format
which the emboss mask filter produces.

Fixes SkEmbossMask::Emboss to write the whole of the mul and add planes
to avoid pixel differences and MemorySanitizer errors.

Update the GPU to understand the k3D_Format and use just the alpha
plane, ignoring the mul and add plane which it currently cannot support.

Change-Id: Icac1a3f37d6e8c6be3151df570f5e14111e18585
Reviewed-on: https://skia-review.googlesource.com/70260
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-on: https://skia-review.googlesource.com/70962
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-11-14 14:10:22 +00:00
Ben Wagner
3ae1a307f6 Revert "Alloc glyph image correctly for SkMask::k3D_Format."
This reverts commit 6b26deb8d6.

Reason for revert: GPU bots failing

Original change's description:
> Alloc glyph image correctly for SkMask::k3D_Format.
> 
> This removes the no longer used outside Skia
> SK_SUPPORT_LEGACY_EMBOSSMASKFILTER define, and either deletes the code
> it guards or updates it to use the new emboss mask filter factory. This
> re-enables the code to test the emboss mask filter. Also added is a test
> to ensure that embossed text is drawn correctly, as before this glyphs
> did not allocate the proper amount of memory for the k3D_Format which
> this mask filter produces. This also fixes SkEmbossMask::Emboss to write
> the whole of the mul and add planes to avoid pixel differences and
> MemorySanitizer errors.
> 
> Change-Id: Ib492c72a19d6a27d140e3cd48179a3ca9ce313f5
> Reviewed-on: https://skia-review.googlesource.com/70260
> Commit-Queue: Ben Wagner <bungeman@google.com>
> Reviewed-by: Herb Derby <herb@google.com>

TBR=djsollen@google.com,bungeman@google.com,herb@google.com,reed@google.com

Change-Id: I8a9db6c00e0cb84bdd4833474a9ffffa6ecc606c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/70920
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-11-13 20:43:06 +00:00
Ben Wagner
6b26deb8d6 Alloc glyph image correctly for SkMask::k3D_Format.
This removes the no longer used outside Skia
SK_SUPPORT_LEGACY_EMBOSSMASKFILTER define, and either deletes the code
it guards or updates it to use the new emboss mask filter factory. This
re-enables the code to test the emboss mask filter. Also added is a test
to ensure that embossed text is drawn correctly, as before this glyphs
did not allocate the proper amount of memory for the k3D_Format which
this mask filter produces. This also fixes SkEmbossMask::Emboss to write
the whole of the mul and add planes to avoid pixel differences and
MemorySanitizer errors.

Change-Id: Ib492c72a19d6a27d140e3cd48179a3ca9ce313f5
Reviewed-on: https://skia-review.googlesource.com/70260
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2017-11-13 20:26:21 +00:00
Mike Klein
b251b72d3d add platform_font_manager()
This string replaces {major_}platform_os_name() and
platform_extra_config() for the font-focused GMs using them.

The GDI bots will report "GDI", the NativeFont bots their OS,
and other bots "".

Change-Id: I8f7bb1ffea3cc91601c98b4ccff7a3a234ac77d3
Reviewed-on: https://skia-review.googlesource.com/70500
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-11-13 17:00:51 +00:00
Ethan Nicholas
1706f84208 switched GrClipEdge to an enum class
Bug: skia:
Change-Id: Idf41580314a32739c70721530fc3ca48e566b044
Reviewed-on: https://skia-review.googlesource.com/70023
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-11-10 17:42:27 +00:00
Mike Klein
10d66cc3f8 move Sk{Test,Random}ScalerContext to tools
There's no need for Skia users to link this test code.

Change-Id: I9d6ef2a053d0cf5cb916aa254389ca819c48bae1
Reviewed-on: https://skia-review.googlesource.com/69922
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-11-10 17:02:20 +00:00
Mike Reed
77e487dfc0 Revert "Revert "Remove MakeForLocalSpace since picture image is sufficient""
This reverts commit fc45998242.

Reason for revert: google3 updated (I think)

Original change's description:
> Revert "Remove MakeForLocalSpace since picture image is sufficient"
> 
> This reverts commit 0d8766c84c.
> 
> Reason for revert: broke google3
> 
> Original change's description:
> > Remove MakeForLocalSpace since picture image is sufficient
> > 
> > Bug: skia:
> > Change-Id: If38e702c418e93141311490edf447d1f09ed4434
> > Reviewed-on: https://skia-review.googlesource.com/68640
> > Commit-Queue: Mike Reed <reed@google.com>
> > Reviewed-by: Florin Malita <fmalita@chromium.org>
> 
> TBR=robertphillips@google.com,fmalita@chromium.org,reed@google.com
> 
> Change-Id: I3dec3d2c704e02b4db5977c27cc3e6d9f1c68ed5
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/69500
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=robertphillips@google.com,fmalita@chromium.org,reed@google.com

Change-Id: I5751fa637d280f361dea0f248a43c1f7e9bd8bdc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/69661
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-11-09 21:50:27 +00:00
Ethan Nicholas
0f3c73220a renamed GrPrimitiveEdgeType / GrProcessorEdgeType to GrClipEdgeType
Bug: skia:
Change-Id: I4a9af0b9b2cfa47875b2ba098098183e8dca29a7
Reviewed-on: https://skia-review.googlesource.com/69601
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-11-09 20:59:27 +00:00
Mike Reed
fc45998242 Revert "Remove MakeForLocalSpace since picture image is sufficient"
This reverts commit 0d8766c84c.

Reason for revert: broke google3

Original change's description:
> Remove MakeForLocalSpace since picture image is sufficient
> 
> Bug: skia:
> Change-Id: If38e702c418e93141311490edf447d1f09ed4434
> Reviewed-on: https://skia-review.googlesource.com/68640
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>

TBR=robertphillips@google.com,fmalita@chromium.org,reed@google.com

Change-Id: I3dec3d2c704e02b4db5977c27cc3e6d9f1c68ed5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/69500
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-11-09 18:44:17 +00:00
Mike Reed
0d8766c84c Remove MakeForLocalSpace since picture image is sufficient
Bug: skia:
Change-Id: If38e702c418e93141311490edf447d1f09ed4434
Reviewed-on: https://skia-review.googlesource.com/68640
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2017-11-09 16:49:44 +00:00
Cary Clark
df429f3bea move parts of SkPoint to SkPointPriv
Move specialized SkPoint methods to SkPointPriv.
Use constexpr and inline initialization where possible.

R=reed@google.com,bsalomon@google.com
Bug: skia: 6898
Change-Id: I01ec5186f010f2dc80c068c70d9cc352f3221338
Reviewed-on: https://skia-review.googlesource.com/68700
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Ravi Mistry <rmistry@google.com>
2017-11-08 18:25:17 +00:00
Ben Wagner
1e26ba9e96 Glyphs without paths don't draw with paths.
If a glyph doesn't have a path, don't try to draw it from the
non-existent path.

Bug: skia:4904

Change-Id: I8d7a061146b54c2f4a975280a6fb6ae3043ea82b
Reviewed-on: https://skia-review.googlesource.com/68216
Reviewed-by: Heather Miller <hcm@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2017-11-08 15:01:16 +00:00
Chris Dalton
bbfd5161ed Don't use analytic clip FPs when drawing to stencil
It doesn't make sense to multiply by coverage when drawing to stencil.
This could theoretically work with FPs that discard and/or modify
the sample mask, but for the time being an analytic FP means one that
calculates a coverage value.

Bug: skia:7190
Change-Id: I44140a5823f8683ec08244bdf9d369f51fa05dd9
Reviewed-on: https://skia-review.googlesource.com/68362
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-11-07 21:30:44 +00:00
Chris Dalton
428e568fd8 Revert "Don't use analytic clip FPs when drawing to stencil"
This reverts commit 4c92d4aa3e.

Reason for revert: Chromecast bot failure

Original change's description:
> Don't use analytic clip FPs when drawing to stencil
> 
> It doesn't make sense to multiply by coverage when drawing to stencil.
> This could theoretically work with FPs that discard and/or modify
> the sample mask, but for the time being an analytic FP means one that
> calculates a coverage value.
> 
> Bug: skia:7190
> Change-Id: Ic40cf6c19c377cba80bad458993582f5cc07022a
> Reviewed-on: https://skia-review.googlesource.com/67423
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

TBR=bsalomon@google.com,robertphillips@google.com,csmartdalton@google.com

Change-Id: Ie5bd4852c201e47daee0920f5644141bee2d8a46
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7190
Reviewed-on: https://skia-review.googlesource.com/68400
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-11-07 18:24:15 +00:00
Chris Dalton
4c92d4aa3e Don't use analytic clip FPs when drawing to stencil
It doesn't make sense to multiply by coverage when drawing to stencil.
This could theoretically work with FPs that discard and/or modify
the sample mask, but for the time being an analytic FP means one that
calculates a coverage value.

Bug: skia:7190
Change-Id: Ic40cf6c19c377cba80bad458993582f5cc07022a
Reviewed-on: https://skia-review.googlesource.com/67423
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2017-11-07 17:28:34 +00:00
Yuqian Li
fbe0793526 Correct edges_too_close
If the next edge has 0 fDX, we should add a SLACK = 1 so two edges
with fX less than 1 pixel apart should be considered close, and
noRealBlitter should be true to force the use of AdditiveBlitter and
the cumulation of alpha.  The changed GM will show bleed through if
SLACK is 0.

The artifact without the fix can be seen at:
https://fiddle.skia.org/c/f6912f1af6c14e054f5b5935a93380ea

Bug: skia:
Change-Id: I15f9c3aef25a0357cd11d447e7bf0b4fbac0ce67
Reviewed-on: https://skia-review.googlesource.com/67804
Commit-Queue: Yuqian Li <liyuqian@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
2017-11-07 16:40:08 +00:00
Brian Osman
63bc48d093 Add MakeCrossContextFromPixmap
This operates just like MakeCrossContextFromEncoded, but starting from
raster data. This version is defensive (always uses copies if a raster
image needs to be made).

Bug: skia:
Change-Id: Ibc2b9a235c89a41fbbfd022d943f15ac212d0677
Reviewed-on: https://skia-review.googlesource.com/68205
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-11-07 15:59:38 +00:00
Cary Clark
74f623d161 make point array methods private
Moved method are not used by chromium, google3,
or android.

SkPoint::setRectIFan isn't used or tested at all.

SkPoint::setRectFan and SkPoint::setRectTriStrip
are only used internally.

These routines pretend that a SkPoint is part
of an array of points. Since that's kind of an
odd contract to make public, and because they
aren't used outside of Skia, relegate them to
a priv file.

R=bsalomon@google.com,reed@google.com
Bug: skia: 6898
Change-Id: I5ec2eb47799f6fd4b2994da962b1fa69ce659931
Reviewed-on: https://skia-review.googlesource.com/68121
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
2017-11-07 13:10:38 +00:00
Brian Salomon
9f545bc18a Modify fontcache GM to actually spill atlas.
Adds an option to GrDrawOpAtlas to disable multitexturing.

Adds option to GrContextOptions to disable multitexturing for glyph atlases.


Change-Id: If413ab7061538fa0e75628d252be4fd14215b6ba
Reviewed-on: https://skia-review.googlesource.com/67802
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-11-06 16:06:09 +00:00
Cary Clark
60aaeb2b55 create imagepriv and name params
Named all parameters and made the names consistent
for documentation.

Moved SK_IMAGEFILTER_UNFLATTEN_COMMON to private file.

TBR=reed@google.com
Bug: skia:6898
Change-Id: I1343d2b16d4217088fa3bc9c40f1f4177fa32740
Reviewed-on: https://skia-review.googlesource.com/66521
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
2017-11-03 13:56:30 +00:00
Mike Klein
e95a62faa0 add some lowp gradient stages
I was originally going to add these to help test a lowp dither, but
after looking at diffs I don't think lowp dither is a good idea.

Non-dithered lowp gradients look fine to me so far.

I'd have done conics, but they scare me.

Change-Id: I8f5e75aec726983186214845ca38cfa0d54496b3
Reviewed-on: https://skia-review.googlesource.com/66460
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2017-11-03 12:31:59 +00:00
Jim Van Verth
6a40abc8c7 Revert "Implement window rectangles in vulkan"
This reverts commit 94c0468b2b.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Implement window rectangles in vulkan
> 
> Bug: skia:
> Change-Id: I32c079b90a5503c797dfc073a093f940cd8c550a
> Reviewed-on: https://skia-review.googlesource.com/65423
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,csmartdalton@google.com

Change-Id: I5a90cb57fb5d4bcf8c7e76a5f71a7f16edbaf6be
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/67060
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2017-11-02 16:56:19 +00:00
Chris Dalton
94c0468b2b Implement window rectangles in vulkan
Bug: skia:
Change-Id: I32c079b90a5503c797dfc073a093f940cd8c550a
Reviewed-on: https://skia-review.googlesource.com/65423
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-11-02 15:27:21 +00:00
Mike Klein
2afe7873d8 add a GM to demo dither
Change-Id: Idbed35f2c5a1420b66b68725761a7ceea8cdd3ba
Reviewed-on: https://skia-review.googlesource.com/66461
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-11-02 13:59:51 +00:00
Robert Phillips
f0a30d71ad Make matrix flip GM easier to triage
TBR=bsalomon@google.com
Change-Id: Ie6a4d82d330ac9371df21820a13c65c0ee67faef
Reviewed-on: https://skia-review.googlesource.com/66157
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-11-01 19:35:20 +00:00
Robert Phillips
206bda5b79 Update the texture flip GM to include subsets & scales
Bug: skia:7075
Change-Id: Idfb7d4d5f348d07ba9b3793d576b469127e5198c
Reviewed-on: https://skia-review.googlesource.com/65841
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-11-01 15:34:50 +00:00
Robert Phillips
a097173bb1 Add a GM to test out odd matrix draws (take 2)
TBR=bsalomon@google.com
Bug: skia:7075
Change-Id: I87efa058916fe0305b57eb4dd14b479e8a8d2c6d
Reviewed-on: https://skia-review.googlesource.com/65507
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-10-31 16:58:05 +00:00
Robert Phillips
9d15b07dc4 Revert "Add a GM to test out odd matrix draws"
This reverts commit 761f44853f.

Reason for revert: preabandonContext failures

Original change's description:
> Add a GM to test out odd matrix draws
> 
> Bug: skia:7075
> Change-Id: I90c15bf019161abc5dab78e0af20ef15ff1395d9
> Reviewed-on: https://skia-review.googlesource.com/64761
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,robertphillips@google.com

Change-Id: I9ecb2e2dcd74685e2c707c04bb52279e1d5cc55c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7075
Reviewed-on: https://skia-review.googlesource.com/65740
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-10-31 16:13:55 +00:00
Robert Phillips
761f44853f Add a GM to test out odd matrix draws
Bug: skia:7075
Change-Id: I90c15bf019161abc5dab78e0af20ef15ff1395d9
Reviewed-on: https://skia-review.googlesource.com/64761
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-10-31 14:51:14 +00:00
Greg Daniel
65c7f662ba Add mip support to GrAHardwareBufferImageGenerator
Bug: skia:
Change-Id: I482d8f9937c86ed441016afef2d8f924282dd17a
Reviewed-on: https://skia-review.googlesource.com/63861
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-10-30 19:18:03 +00:00
Brian Salomon
f3569f0f6d Add GrColorSpaceInfo and use in place of GrRenderTargetContext in paint conversion.
This moves us closer to making GrAtlasTextContext and related classes usable without a GrRenderTargetContext.

Change-Id: Ife52d69a3f925e23da88043acb4d8dc9f672a025
Reviewed-on: https://skia-review.googlesource.com/63304
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-10-24 20:43:02 +00:00
Brian Osman
a4aa1332a4 Remove color space xform from alpha threshold FP
This does math on the sampled color. In order to do that math in the
destination color space, I split the behavior up - the threshold FP
now operates on the input color, and we construct a series with a
simple texture effect (possibly wrapped in a color xform), then the
threshold.

I also added a GM that verifies this behavior. All other GMs using
this effect were operating on a layer source, which is always
created in the destination color space. The new GM explicitly makes
a DAG with an image source, so the alpha threshold filter needs to
handle any color space mismatch.

Bug: skia:
Change-Id: I1ed08c99f4eed17f68176bf751677a3ae1614fe3
Reviewed-on: https://skia-review.googlesource.com/61942
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-10-19 20:07:44 +00:00
Brian Osman
2240be96d9 Remove color space xform from GrTextureDomain & GrSimpleTextureEffect
Bug: skia:
Change-Id: I31435d334da28cce9bbc654c4b98746b03078897
Reviewed-on: https://skia-review.googlesource.com/61460
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-10-18 18:46:25 +00:00
Cary Clark
e4442cb0b5 convert mapHomogeneousPoints to SkPoint3
SkMatrix::mapHomogeneousPoints takes an array of SkScalar,
but expects essentially SkPoint3, so make it so.


R: robertphillips@google.com, reed@google.com
Bug: skia:6898
Change-Id: Ibaf8b05c08b7df16c67d6a77d914667ace9a70da
Reviewed-on: https://skia-review.googlesource.com/58380
Commit-Queue: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-10-18 16:09:46 +00:00
Brian Salomon
57caa660c0 Revert "Revert "Make GPU backend triangulate rects such that they are rendered as tri strips rather than tri fans.""
This reverts commit 62563deb6b.

Reason for revert: change that affected similar set of GMs reverted, relanding now that this is more easily triagable.

Original change's description:
> Revert "Make GPU backend triangulate rects such that they are rendered as tri strips rather than tri fans."
> 
> This reverts commit fa2d604a7d.
> 
> Reason for revert: <INSERT REASONING HERE>
> 
> Original change's description:
> > Make GPU backend triangulate rects such that they are rendered as tri strips rather than tri fans.
> > 
> > Right now when we turn rects into quads we use a vertex order compatible with a tri fan rather than a tri strip.
> > 
> > I wanted it to be the case that the same code could be used to generate a non-indexed mesh for a single rect or indexed using the quad index buffer when batching. Triangle fanning is not available in all APIS (e.g. is emulated in ANGLE and not supported in Metal) so it seems better to use a triangle strip over a fan in the single rect case.
> > 
> > 
> > Change-Id: I31eebd794e7328f4b39e3ec3377bf2ec556360ca
> > Reviewed-on: https://skia-review.googlesource.com/60081
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> 
> TBR=bsalomon@google.com,robertphillips@google.com
> 
> Change-Id: I7c4c23aa418da09c9708b28cce64ab58e282dd3a
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/60683
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,robertphillips@google.com

Change-Id: Iefcd16676a7617d32e89fc84206cd4e88e9a06e1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/61160
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-10-18 12:21:17 +00:00
Ben Wagner
1a1d2411e8 Remove redundant parentheses.
Recent clang versions produce output like

../../samplecode/SampleAll.cpp:306:27:
error: redundant parentheses surrounding declarator
[-Werror,-Wredundant-parens]

Remove these to clean up the code a bit.

Change-Id: Ib099201f23f83cd712487c238b6a508290e667a7
Reviewed-on: https://skia-review.googlesource.com/60822
Commit-Queue: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2017-10-17 22:02:41 +00:00
Brian Salomon
62563deb6b Revert "Make GPU backend triangulate rects such that they are rendered as tri strips rather than tri fans."
This reverts commit fa2d604a7d.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Make GPU backend triangulate rects such that they are rendered as tri strips rather than tri fans.
> 
> Right now when we turn rects into quads we use a vertex order compatible with a tri fan rather than a tri strip.
> 
> I wanted it to be the case that the same code could be used to generate a non-indexed mesh for a single rect or indexed using the quad index buffer when batching. Triangle fanning is not available in all APIS (e.g. is emulated in ANGLE and not supported in Metal) so it seems better to use a triangle strip over a fan in the single rect case.
> 
> 
> Change-Id: I31eebd794e7328f4b39e3ec3377bf2ec556360ca
> Reviewed-on: https://skia-review.googlesource.com/60081
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

TBR=bsalomon@google.com,robertphillips@google.com

Change-Id: I7c4c23aa418da09c9708b28cce64ab58e282dd3a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/60683
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-10-17 19:14:15 +00:00
Mike Reed
4379869461 Revert[4] "apply codec origin in generator"
This reverts commit dd340146f1.

Reason for revert: ios gn file fixed

Original change's description:
> Revert "Revert "Revert "apply codec origin in generator"""
> 
> This reverts commit 82269abfec.
> 
> Reason for revert: ios build needs include path for SkCodec.h
> 
> Original change's description:
> > Revert "Revert "apply codec origin in generator""
> > 
> > This reverts commit 363dd988a5.
> > 
> > Reason for revert: pdfium fix landed
> > 
> > Original change's description:
> > > Revert "apply codec origin in generator"
> > > 
> > > This reverts commit fa15877f48.
> > > 
> > > Reason for revert: Appears to break PDFium.
> > > 
> > > Original change's description:
> > > > apply codec origin in generator
> > > > 
> > > > Bug: skia:
> > > > Change-Id: I383dacb49b1e3c88467ccdbf3288764bb1bbf01a
> > > > Reviewed-on: https://skia-review.googlesource.com/58600
> > > > Reviewed-by: Leon Scroggins <scroggo@google.com>
> > > > Commit-Queue: Mike Reed <reed@google.com>
> > > 
> > > TBR=scroggo@google.com,reed@google.com
> > > 
> > > Change-Id: Id97137d6ec39ca638c941928bae6510814b1c499
> > > No-Presubmit: true
> > > No-Tree-Checks: true
> > > No-Try: true
> > > Bug: skia:
> > > Reviewed-on: https://skia-review.googlesource.com/60041
> > > Reviewed-by: Ben Wagner <benjaminwagner@google.com>
> > > Commit-Queue: Ben Wagner <benjaminwagner@google.com>
> > 
> > TBR=benjaminwagner@google.com,scroggo@google.com,reed@google.com
> > 
> > Change-Id: I1b54a6e6e6cbda07f346ffbbc4977f9db705abcd
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: skia:
> > Reviewed-on: https://skia-review.googlesource.com/60320
> > Reviewed-by: Mike Reed <reed@google.com>
> > Commit-Queue: Mike Reed <reed@google.com>
> 
> TBR=benjaminwagner@google.com,scroggo@google.com,reed@google.com
> 
> Change-Id: I4c2d310521d1a678b407d30b9fe3c261c49d67bc
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/60560
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=benjaminwagner@google.com,scroggo@google.com,reed@google.com

Change-Id: I5c1e53aff3ad174b0d4a806c35b7cdcd194479d7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/60563
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-10-17 18:04:43 +00:00
Brian Salomon
fa2d604a7d Make GPU backend triangulate rects such that they are rendered as tri strips rather than tri fans.
Right now when we turn rects into quads we use a vertex order compatible with a tri fan rather than a tri strip.

I wanted it to be the case that the same code could be used to generate a non-indexed mesh for a single rect or indexed using the quad index buffer when batching. Triangle fanning is not available in all APIS (e.g. is emulated in ANGLE and not supported in Metal) so it seems better to use a triangle strip over a fan in the single rect case.


Change-Id: I31eebd794e7328f4b39e3ec3377bf2ec556360ca
Reviewed-on: https://skia-review.googlesource.com/60081
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-10-17 17:30:12 +00:00
Mike Reed
dd340146f1 Revert "Revert "Revert "apply codec origin in generator"""
This reverts commit 82269abfec.

Reason for revert: ios build needs include path for SkCodec.h

Original change's description:
> Revert "Revert "apply codec origin in generator""
> 
> This reverts commit 363dd988a5.
> 
> Reason for revert: pdfium fix landed
> 
> Original change's description:
> > Revert "apply codec origin in generator"
> > 
> > This reverts commit fa15877f48.
> > 
> > Reason for revert: Appears to break PDFium.
> > 
> > Original change's description:
> > > apply codec origin in generator
> > > 
> > > Bug: skia:
> > > Change-Id: I383dacb49b1e3c88467ccdbf3288764bb1bbf01a
> > > Reviewed-on: https://skia-review.googlesource.com/58600
> > > Reviewed-by: Leon Scroggins <scroggo@google.com>
> > > Commit-Queue: Mike Reed <reed@google.com>
> > 
> > TBR=scroggo@google.com,reed@google.com
> > 
> > Change-Id: Id97137d6ec39ca638c941928bae6510814b1c499
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Bug: skia:
> > Reviewed-on: https://skia-review.googlesource.com/60041
> > Reviewed-by: Ben Wagner <benjaminwagner@google.com>
> > Commit-Queue: Ben Wagner <benjaminwagner@google.com>
> 
> TBR=benjaminwagner@google.com,scroggo@google.com,reed@google.com
> 
> Change-Id: I1b54a6e6e6cbda07f346ffbbc4977f9db705abcd
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/60320
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=benjaminwagner@google.com,scroggo@google.com,reed@google.com

Change-Id: I4c2d310521d1a678b407d30b9fe3c261c49d67bc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/60560
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-10-17 14:29:43 +00:00
Mike Reed
82269abfec Revert "Revert "apply codec origin in generator""
This reverts commit 363dd988a5.

Reason for revert: pdfium fix landed

Original change's description:
> Revert "apply codec origin in generator"
> 
> This reverts commit fa15877f48.
> 
> Reason for revert: Appears to break PDFium.
> 
> Original change's description:
> > apply codec origin in generator
> > 
> > Bug: skia:
> > Change-Id: I383dacb49b1e3c88467ccdbf3288764bb1bbf01a
> > Reviewed-on: https://skia-review.googlesource.com/58600
> > Reviewed-by: Leon Scroggins <scroggo@google.com>
> > Commit-Queue: Mike Reed <reed@google.com>
> 
> TBR=scroggo@google.com,reed@google.com
> 
> Change-Id: Id97137d6ec39ca638c941928bae6510814b1c499
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:
> Reviewed-on: https://skia-review.googlesource.com/60041
> Reviewed-by: Ben Wagner <benjaminwagner@google.com>
> Commit-Queue: Ben Wagner <benjaminwagner@google.com>

TBR=benjaminwagner@google.com,scroggo@google.com,reed@google.com

Change-Id: I1b54a6e6e6cbda07f346ffbbc4977f9db705abcd
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/60320
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-10-16 18:57:02 +00:00
Ben Wagner
363dd988a5 Revert "apply codec origin in generator"
This reverts commit fa15877f48.

Reason for revert: Appears to break PDFium.

Original change's description:
> apply codec origin in generator
> 
> Bug: skia:
> Change-Id: I383dacb49b1e3c88467ccdbf3288764bb1bbf01a
> Reviewed-on: https://skia-review.googlesource.com/58600
> Reviewed-by: Leon Scroggins <scroggo@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

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

Change-Id: Id97137d6ec39ca638c941928bae6510814b1c499
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/60041
Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
2017-10-16 18:07:42 +00:00
Mike Reed
fa15877f48 apply codec origin in generator
Bug: skia:
Change-Id: I383dacb49b1e3c88467ccdbf3288764bb1bbf01a
Reviewed-on: https://skia-review.googlesource.com/58600
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-10-16 17:33:22 +00:00