Commit Graph

5274 Commits

Author SHA1 Message Date
Jim Van Verth
809cbedd4b Revert "guard old apis for querying byte-size of a bitmap/imageinfo/pixmap"
This reverts commit 88757dacd4.

Reason for revert: Still seems to be failing Chromium "telemetry_perf_unittests (with patch) on Android" on android_n5x_swarming_rel.

Original change's description:
> guard old apis for querying byte-size of a bitmap/imageinfo/pixmap
> 
> Now with legacy behavior for allocpixels
> 
> This was reverted, so the current CL is a "fix" on top of ...
> https://skia-review.googlesource.com/c/skia/+/50980
> 
> Related update to Chrome (in preparation for this change)
> https://chromium-review.googlesource.com/c/chromium/src/+/685719
> 
> Bug: skia:
> Change-Id: I4b370ee7e95083ab27421f008132219c9c7b86e9
> Reviewed-on: https://skia-review.googlesource.com/51341
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>

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

Change-Id: I827a0ca1d1e3909e648fde3342cdb8601d34da8d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/52381
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2017-09-27 23:15:07 +00:00
Chris Blume
0b5e7d16c2 Treat invalid indices as transparent in gifs
Other browsers (including old Chrome) treat invalid palette indices as
transparent for gifs. And there are gifs in the wild which rely on this.

As an example, if the palette only has 64 entries (0-63) then index 64
is treated as transparent.

BUG=skia:7069

Change-Id: I15e8919a953387506c9ac5945c3ae6a2b90189ab
Reviewed-on: https://skia-review.googlesource.com/51100
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Chris Blume <cblume@google.com>
2017-09-27 21:03:41 +00:00
Leon Scroggins III
e56774602c Fix truncated webp images
Bug: b/65290323

If a webp file is truncated such that no rows can be decoded,
WebPIDecGetRGB does not initialize its "last_y" parameter. We use
rowsDecoded (passed as last_y) to determine which remaining rows to
fill.

Check the return value of WebPIDecGetRGB. If it fails (returns null),
or rowsDecoded is <= 0 (matching Chromium's check), return
kInvalidInput, since there is nothing to draw.

Note that this is a change in behavior for Android. Previously we
would decode an empty webp to just a transparent/black rectangle,
whereas now we simply fail. I think this is a change for the better.

Add a test which truncates a file to have 0 rows available and attempts
to decode it. msan verifies that we no longer depend on the
uninitialized value.

Stop attempting to test decoding subsets from an incomplete webp (in
CodecTest.cpp). Unless we have decoded the portion covered by the
subset, this will fail.

Remove test images inc0.webp (from both dm/ and colorspace/) and
inc1.webp. These just decode to transparent rectangles. Replace them
with inc2.webp and inc3.webp, which decode part of the image and then
have to fill with transparent.

Change-Id: I64d40be91c574b45963f9a43d8dd8f4929dd2939
Reviewed-on: https://skia-review.googlesource.com/50303
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: James Zern <jzern@google.com>
2017-09-27 20:51:02 +00:00
Brian Osman
28c434b807 Handle instantiation of proxies with pending invalidation messages
Bug: skia:
Change-Id: Id6808734df2335c521d4a563122ceeca906b7601
Reviewed-on: https://skia-review.googlesource.com/52002
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-09-27 17:38:38 +00:00
Mike Reed
88757dacd4 guard old apis for querying byte-size of a bitmap/imageinfo/pixmap
Now with legacy behavior for allocpixels

This was reverted, so the current CL is a "fix" on top of ...
https://skia-review.googlesource.com/c/skia/+/50980

Related update to Chrome (in preparation for this change)
https://chromium-review.googlesource.com/c/chromium/src/+/685719

Bug: skia:
Change-Id: I4b370ee7e95083ab27421f008132219c9c7b86e9
Reviewed-on: https://skia-review.googlesource.com/51341
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2017-09-27 14:36:07 +00:00
Ethan Nicholas
fa7ee2447e changed vertex attribute precisions to be actual types
Bug: skia:
Change-Id: Ic5555d9f1be7f24655bdea9f2a3677bfb128ef70
Reviewed-on: https://skia-review.googlesource.com/50221
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-09-27 14:04:17 +00:00
Greg Daniel
f46633f8af Revert "guard old apis for querying byte-size of a bitmap/imageinfo/pixmap"
This reverts commit 98a6216b18.

Reason for revert: breaking the chrome roll. Looks like they may be writing data to create an image across all the row bytes and thus writing to unalloced data on the last row. Link to example failing bot:
 https://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/539960

Original change's description:
> guard old apis for querying byte-size of a bitmap/imageinfo/pixmap
> 
> Previously we had size_t and uint64_t variations.
> 
> The new (simpler) API always..
> - returns size_t, or 0 if the calculation overflowed
> - returns the trimmed size (does not include rowBytes padding for the last row)
> 
> Bug: skia:
> Change-Id: I05173e877918327c7b207d2f7f1ab0db36892e2e
> Reviewed-on: https://skia-review.googlesource.com/50980
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Reviewed-by: Leon Scroggins <scroggo@google.com>

TBR=mtklein@google.com,herb@google.com,scroggo@google.com,fmalita@chromium.org,reed@google.com

Change-Id: I726f6ab1b36b14979ba6f37105e0a469b3f0dbc0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/51262
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-09-26 20:08:07 +00:00
Ethan Nicholas
bed683addb switched gl_Position and gl_PointSize to sk_*
Bug: skia:
Change-Id: Ie7508991aa975c1400bac23ae49d81041a313968
Reviewed-on: https://skia-review.googlesource.com/51320
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-09-26 19:17:46 +00:00
Brian Osman
e9242ca695 Invalidate textures cached by SW path renderer when paths go away
Bug: skia:
Change-Id: Icfc2f1bd57c0cf7be54469b6d86cbd436b59155d
Reviewed-on: https://skia-review.googlesource.com/51201
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-09-26 19:07:46 +00:00
Greg Daniel
e2d76d5ffe Remove fIsMipMapped from GrSurfaceDesc
Part 3 of 3 for relanding of https://skia-review.googlesource.com/c/skia/+/42083

Bug: skia:
Change-Id: I98c5406015213df5d11a0101df8722da6845157e
Reviewed-on: https://skia-review.googlesource.com/44464
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-09-26 18:17:37 +00:00
Greg Daniel
cd87140111 Add ability to remove unique key from proxy and underlying surface.
Bug: skia:
Change-Id: I66b891ce9ca35906fdbddb36f565b35b25825112
Reviewed-on: https://skia-review.googlesource.com/51240
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-09-26 17:11:21 +00:00
Mike Reed
98a6216b18 guard old apis for querying byte-size of a bitmap/imageinfo/pixmap
Previously we had size_t and uint64_t variations.

The new (simpler) API always..
- returns size_t, or 0 if the calculation overflowed
- returns the trimmed size (does not include rowBytes padding for the last row)

Bug: skia:
Change-Id: I05173e877918327c7b207d2f7f1ab0db36892e2e
Reviewed-on: https://skia-review.googlesource.com/50980
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2017-09-26 17:07:16 +00:00
Greg Daniel
90f28ec3da Add some asserts and explict setting of fIsMipMapped
Part 2 of 3 for relanding of https://skia-review.googlesource.com/c/skia/+/42083

Bug: skia:
Change-Id: Iddc2571d88486531c76ab47432c2a51f2ac79043
Reviewed-on: https://skia-review.googlesource.com/44463
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-09-26 15:17:07 +00:00
Mike Reed
592273965a Revert "Revert "migrate to sk_sp for SkFontMgr API""
This reverts commit f40ae1a4b5.

Bug: skia:
Change-Id: I752606de92ea405d6e50219c98030409b00a2841
Reviewed-on: https://skia-review.googlesource.com/51160
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-09-26 14:05:18 +00:00
Brian Osman
f6f7cf6098 Invalidate path VBs when paths are destroyed
For this to work, we need access to the "original" path,
before any style was applied. To that end, add an original
path to GrShape (and unit tests of that functionality).

Then add a version of addGenIDChangeListener to GrShape,
that propagates to the original path, and use that in
tessellating path renderer.

Includes unit tests of caching behavior in the PR, all
of which failed without this change.

Bug: skia:
Change-Id: I98bb505f521e8ff07184f5c3fbd3c5fd1a22d3d5
Reviewed-on: https://skia-review.googlesource.com/50300
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-09-26 12:52:36 +00:00
Mike Reed
f40ae1a4b5 Revert "migrate to sk_sp for SkFontMgr API"
This reverts commit 4bf296be28.

Reason for revert: need guard for flutter

Original change's description:
> migrate to sk_sp for SkFontMgr API
> 
> Bug: skia:
> Change-Id: I1bf2a13537f67938cdc9956080065d10ea0bd1d8
> Reviewed-on: https://skia-review.googlesource.com/48740
> Commit-Queue: Ben Wagner <bungeman@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

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

Change-Id: Ib0b2d00fcbcdb6131444f94d1046df6dae24f551
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/50940
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-09-25 20:00:41 +00:00
Mike Reed
4bf296be28 migrate to sk_sp for SkFontMgr API
Bug: skia:
Change-Id: I1bf2a13537f67938cdc9956080065d10ea0bd1d8
Reviewed-on: https://skia-review.googlesource.com/48740
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2017-09-25 19:45:09 +00:00
Xianzhu Wang
b449666fa2 Reland "Fix SkImageSource::filterBounds()" again
This relands commit cb4d587666
which was reverted by commit b6d2be1330
because the original CL broke some blink layout tests, and the first
reland was reverted by commit because it broke filterfastbounds gm.

This reland let SkImageSource::onFilterNodeBounds() return the dst rect
with ctm applied when mapping forward or otherwise the default value.

Original description:

> Previously SkImageSource::filterBounds() uses the default
> SkImageFilter::onFilterNodeBounds() which returns the input rect.
>
> Now override onFilterNodeBounds() in SkImageSource to return src
> or dst rect (with transform applied).

Change-Id: I4548981142b9a96beda8339d394cf9943c9f4c0f
Reviewed-on: https://skia-review.googlesource.com/50420
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2017-09-25 19:05:20 +00:00
Mike Klein
f3b4e16c36 Fold clamp_{x,y} into the gathers.
All three image tile modes go through exclusive_clamp() and then a
gather today, so we can move the work of exclusive_clamp() into eac
gather_ stage, eliminating the need for clamp_{x,y} stages.

Luckily, we've got a convenient place to bottleneck this, ptr_and_ix(),
which works out the pointer and vector of indices to load for gathers.

This deletes SkRasterPipeline_repeat_tiling unit test, which now
no longer exactly makes sense.  It tests that repeat_x does that
clamp, but that's now done automatically outside that stage.

Change-Id: I24637ef60921bec7aa00082984c0c6a49dd86ca9
Reviewed-on: https://skia-review.googlesource.com/50260
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2017-09-22 22:06:08 +00:00
Ethan Nicholas
8aa4569c13 switched SkSL's temporary 'highfloat' type back to 'float'
Bug: skia:
Change-Id: If0debae7318b6b5b4a7cb85d458996a09931127e
Reviewed-on: https://skia-review.googlesource.com/48760
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-09-22 13:54:38 +00:00
Robert Phillips
c0192e346c Remove pre-attachment of stencil buffers
Change-Id: I4ef555a2b36cf3a0ec74e0ecf7e8ab4f8779df3e
Reviewed-on: https://skia-review.googlesource.com/49740
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-09-21 16:42:41 +00:00
Robert Phillips
ae7d3f3992 Add native caching of uniquely keyed GrTextureProxies (take 2)
TBR=bsalomon@google.com

Change-Id: I590dcdc85fb60706c7eb06277694791dc04c9141
Reviewed-on: https://skia-review.googlesource.com/49543
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-09-21 13:52:10 +00:00
Jim Van Verth
311cc6b39a Another attempt to fix TSAN
Change-Id: I1d6aebcd679a406a13911f4b91f72f4198fc8dc1
Reviewed-on: https://skia-review.googlesource.com/49461
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2017-09-20 22:30:19 +00:00
Robert Phillips
76d640d14e Revert "Add native caching of uniquely keyed GrTextureProxies"
This reverts commit d4f100dad9.

Reason for revert: ASAN

Original change's description:
> Add native caching of uniquely keyed GrTextureProxies
> 
> Change-Id: I303fe025b7856b8d681a2d35b416c015bd468e1d
> Reviewed-on: https://skia-review.googlesource.com/48300
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

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

Change-Id: I7bbf549d4855ce6d985867c3880eef80080bd3d1
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/49442
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-09-20 20:50:50 +00:00
Mike Reed
0ca21466da remove dead code for STREAM_API
Bug: skia:
Change-Id: I5c5a65710af443c60a3d13fb309ce31309be7f74
Reviewed-on: https://skia-review.googlesource.com/49460
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-09-20 20:43:50 +00:00
Robert Phillips
d4f100dad9 Add native caching of uniquely keyed GrTextureProxies
Change-Id: I303fe025b7856b8d681a2d35b416c015bd468e1d
Reviewed-on: https://skia-review.googlesource.com/48300
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2017-09-20 20:21:50 +00:00
Jim Van Verth
32bbf377e6 Fix TSAN issue with atlas expansion.
Removes SkString-related malloc from DM crash handler, and adds null check in ProxyRefTest.

Bug: skia:3550
Change-Id: I143c532b5d231a426b1a96b854e1effd6379b673
Reviewed-on: https://skia-review.googlesource.com/48440
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2017-09-20 17:46:59 +00:00
Brian Salomon
fb6a789191 Extra safety for SkRRect.
This moves closer to ensuring that all SkRRects are valid. It also checks for validity of deserialized SkRRects and sets the SkRRect to empty if the serialized data is invalid rather than asserting.

It is still possible to use mutators to create invalid SkRRects (e.g. outset() by large number, translate() so that type changes due to fp precision).


Bug: skia:
Change-Id: Ice5f73a020e99739ef4b3ce362181d3dbb35701c
Reviewed-on: https://skia-review.googlesource.com/49220
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-09-20 15:24:43 +00:00
Brian Osman
9a725dd948 Use shader based blending to clamp kPlus mode w/F16
Bug: skia:6173
Change-Id: I21042d484d9a7b3eee04aa3301d9793d00ad6908
Reviewed-on: https://skia-review.googlesource.com/48183
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-09-20 14:28:03 +00:00
Florin Malita
2ad0908b67 Revert "Reland "Fix SkImageSource::filterBounds()""
This reverts commit bf12c07970.

Reason for revert: broke the filterfastbounds GM (2nd column, 5th & 7th rows)

Original change's description:
> Reland "Fix SkImageSource::filterBounds()"
> 
> This relands commit cb4d587666
> which was reverted by commit b6d2be1330
> because the original CL broke some blink layout tests.
> 
> This reland let SkImageSource::filterBounds() return the dst rect with
> ctm applied regardless of direction.
> 
> Original description:
> 
> > Previously SkImageSource::filterBounds() uses the default
> > SkImageFilter::onFilterNodeBounds() which returns the input rect.
> >
> > Now override onFilterNodeBounds() in SkImageSource to return src
> > or dst rect (with transform applied).
> 
> Change-Id: I915b7889ff59829ddbc4479cd66d75a0bb581e54
> Reviewed-on: https://skia-review.googlesource.com/47501
> Commit-Queue: Stephen White <senorblanco@chromium.org>
> Reviewed-by: Stephen White <senorblanco@chromium.org>

TBR=senorblanco@chromium.org,reed@google.com,wangxianzhu@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: I698433de66cf3de145b9319e09cb9ec9e30d2fa9
Reviewed-on: https://skia-review.googlesource.com/48160
Reviewed-by: Florin Malita <fmalita@chromium.org>
2017-09-18 20:52:21 +00:00
Yuqian Li
c5e4e7437a skipRect should only work for lines (not quads or cubics)
The added unit test shows that we'll trigger SkASSERT failure if we
forgot to check that the edges are lines (instead of quads or cubics).
Similar to skia:7015, this bug is not triggered in our production
because we don't use DAA for convex paths by default. The skipRect is
an optimization just for convex paths.

Bug: skia:7051
Change-Id: Id87ce2d452ede0db9a48425541f473af19ee0572
Reviewed-on: https://skia-review.googlesource.com/48045
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>
2017-09-18 19:44:24 +00:00
Ethan Nicholas
f7b8820dc8 re-land of new SkSL precisions
Bug: skia:
Change-Id: Ic1deb3db2cbda6ca45f93dee99832971a36a2119
Reviewed-on: https://skia-review.googlesource.com/47841
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2017-09-18 18:32:13 +00:00
Brian Osman
205a126760 Revert "Revert "Don't ignore degenerates when deciding if a path is convex""
This reverts commit f953523224.

Reason for revert: Re-landing now that gold has settled.

Original change's description:
> Revert "Don't ignore degenerates when deciding if a path is convex"
> 
> This reverts commit 53cd6c4331.
> 
> Reason for revert: Temporary to limit gold cross-talk with other CLs.
> 
> Original change's description:
> > Don't ignore degenerates when deciding if a path is convex
> > 
> > This ensures that a path with a second contour will always be marked
> > concave. GrDefaultPathRenderer was incorrectly drawing paths of this type
> > (thinking that it could fill them with simple triangulation).
> > 
> > Bug: skia:7020 skia:1460
> > Change-Id: I62bfd72e4c61da427687acf53c552357b57707aa
> > Reviewed-on: https://skia-review.googlesource.com/47082
> > Reviewed-by: Cary Clark <caryclark@google.com>
> > Commit-Queue: Brian Osman <brianosman@google.com>
> 
> TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,reed@google.com
> 
> Change-Id: Id7d121633faeb8a43dbd334409408ba51db43d68
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:7020 skia:1460
> Reviewed-on: https://skia-review.googlesource.com/47343
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,reed@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: skia:7020 skia:1460
Change-Id: I45ff90a54b66ce9ea068f246d066cc24b310c966
Reviewed-on: https://skia-review.googlesource.com/47820
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-09-18 14:59:49 +00:00
Ethan Nicholas
27185a9b97 Revert "Revert "Revert "Switched highp float to highfloat and mediump float to half."""
This reverts commit 05d5a13fea.

Reason for revert: looks like it broke filterfastbounds

Original change's description:
> Revert "Revert "Switched highp float to highfloat and mediump float to half.""
> 
> This reverts commit 1d816b92bb.
> 
> Bug: skia:
> Change-Id: I388b5e5e9bf619db48297a80c9a80c039f26c9f1
> Reviewed-on: https://skia-review.googlesource.com/46464
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>

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

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: skia:
Change-Id: Iddf6aef2ab084aa73da7ceebdfc303a1d2b80cde
Reviewed-on: https://skia-review.googlesource.com/47441
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-09-18 03:01:47 +00:00
Ethan Nicholas
56fbbd6580 Revert "Minor fixes to SkSL precisions"
This reverts commit 9752c3c307.

Reason for revert: prerequisite to reverting 05d5a13fea

Original change's description:
> Minor fixes to SkSL precisions
> 
> No-Presubmit: true
> No-Tree-Checks: true
> Bug: skia:
> Change-Id: Ife95d3ba457f79c00bf4fdd54af898a3a50402aa
> Reviewed-on: https://skia-review.googlesource.com/47241
> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>

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

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: skia:
Change-Id: Ib1ef28bc94263154e54c01fd172d83ee48a797a8
Reviewed-on: https://skia-review.googlesource.com/47720
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-09-18 02:24:07 +00:00
Xianzhu Wang
bf12c07970 Reland "Fix SkImageSource::filterBounds()"
This relands commit cb4d587666
which was reverted by commit b6d2be1330
because the original CL broke some blink layout tests.

This reland let SkImageSource::filterBounds() return the dst rect with
ctm applied regardless of direction.

Original description:

> Previously SkImageSource::filterBounds() uses the default
> SkImageFilter::onFilterNodeBounds() which returns the input rect.
>
> Now override onFilterNodeBounds() in SkImageSource to return src
> or dst rect (with transform applied).

Change-Id: I915b7889ff59829ddbc4479cd66d75a0bb581e54
Reviewed-on: https://skia-review.googlesource.com/47501
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Stephen White <senorblanco@chromium.org>
2017-09-16 18:55:53 +00:00
Mike Klein
f757ae6aa7 Retry, Bump stored lowp uniform color to 16-bit storage.
This makes loading into 16-bit channels more natural in _lowp.cpp.
Update a unit test to stop using out-of-range "colors".

Change-Id: I494687aac87948b60a40de447aa1527cf7167b2d
Cq-Include-Trybots: skia.primary:Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-UBSAN_float_cast_overflow
Reviewed-on: https://skia-review.googlesource.com/47580
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2017-09-16 02:25:23 +00:00
Mike Reed
98c5d92ee6 Revert "Revert "use unique_ptr for stream api""
This reverts commit 7031b247c9.

Bug: skia:
Change-Id: I24c34bbee703f02994be8e206bcb9c10b5427d84
Reviewed-on: https://skia-review.googlesource.com/47541
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-09-16 02:04:23 +00:00
Mike Klein
7e4e99386f Implement some easy _lowp stages.
- load_565 allows 565-src sprite blits
  - scale_565 / lerp_565 allow subpixel text
  - luminance_to_alpha is a color filter, and lets us write grey 8

And update CachedDecodingPixelRefTest with a yet more robust color.

Change-Id: I8af499c43f0f28093744d9c2993af553e36c9526
Reviewed-on: https://skia-review.googlesource.com/47021
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
2017-09-16 01:07:34 +00:00
Ethan Nicholas
9752c3c307 Minor fixes to SkSL precisions
No-Presubmit: true
No-Tree-Checks: true
Bug: skia:
Change-Id: Ife95d3ba457f79c00bf4fdd54af898a3a50402aa
Reviewed-on: https://skia-review.googlesource.com/47241
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-09-15 21:22:54 +00:00
Mike Reed
7031b247c9 Revert "use unique_ptr for stream api"
This reverts commit 49f1f34438.

Reason for revert: broke win-chrome

../../third_party/skia/src/ports/SkFontMgr_win_dw.cpp(89): error C2228: left of '.release' must have class/struct/union
../../third_party/skia/src/ports/SkFontMgr_win_dw.cpp(89): note: type is 'SkStreamAsset *'
../../third_party/skia/src/ports/SkFontMgr_win_dw.cpp(89): note: did you intend to use '->' instead?


Original change's description:
> use unique_ptr for stream api
> 
> Bug: skia:6888
> Change-Id: I3459b4913982a7cae1c0061697c82cc65ad9a2d8
> Reviewed-on: https://skia-review.googlesource.com/26740
> Reviewed-by: Mike Klein <mtklein@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=mtklein@chromium.org,mtklein@google.com,bungeman@google.com,reed@google.com

Change-Id: Ic1e4af557317abd06b7f6b7f5056645df7e469f0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:6888
Reviewed-on: https://skia-review.googlesource.com/47440
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-09-15 21:04:07 +00:00
Brian Osman
f953523224 Revert "Don't ignore degenerates when deciding if a path is convex"
This reverts commit 53cd6c4331.

Reason for revert: Temporary to limit gold cross-talk with other CLs.

Original change's description:
> Don't ignore degenerates when deciding if a path is convex
> 
> This ensures that a path with a second contour will always be marked
> concave. GrDefaultPathRenderer was incorrectly drawing paths of this type
> (thinking that it could fill them with simple triangulation).
> 
> Bug: skia:7020 skia:1460
> Change-Id: I62bfd72e4c61da427687acf53c552357b57707aa
> Reviewed-on: https://skia-review.googlesource.com/47082
> Reviewed-by: Cary Clark <caryclark@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,reed@google.com

Change-Id: Id7d121633faeb8a43dbd334409408ba51db43d68
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7020 skia:1460
Reviewed-on: https://skia-review.googlesource.com/47343
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-09-15 20:30:47 +00:00
Mike Reed
b6d2be1330 Revert "Fix SkImageSource::filterBounds()"
This reverts commit cb4d587666.

Reason for revert: speculative fix for broken layout tests

https://storage.googleapis.com/chromium-layout-test-archives/linux_chromium_rel_ng/547101/layout-test-results/results.html

+fast/css/transformed-mask.html		images diff	image	pass
+svg/W3C-SVG-1.1-SE/filters-image-03-f.svg		images diff	image	pass
+svg/W3C-SVG-1.1-SE/filters-image-05-f.svg		images diff	image	pass
+svg/W3C-SVG-1.1/filters-displace-01-f.svg		images diff	image	pass
+svg/filters/feImage-preserveAspectRatio-all.svg		images diff	image	pass
+svg/filters/feImage-preserveAspectratio.svg		images diff	image	pass

Original change's description:
> Fix SkImageSource::filterBounds()
> 
> Previously SkImageSource::filterBounds() uses the default
> SkImageFilter::onFilterNodeBounds() which returns the input rect.
> 
> Now override onFilterNodeBounds() in SkImageSource to return src
> or dst rect (with transform applied).
> 
> Change-Id: I6681e1ba97affb09ef1ca5bc03b3d0f66c10f149
> Reviewed-on: https://skia-review.googlesource.com/46741
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Mike Reed <reed@google.com>

TBR=senorblanco@chromium.org,reed@google.com,wangxianzhu@chromium.org

Change-Id: Ib335f8e2ccbadc2335d23bc5f122fc5de53a8740
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/47342
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2017-09-15 20:30:36 +00:00
Brian Osman
53cd6c4331 Don't ignore degenerates when deciding if a path is convex
This ensures that a path with a second contour will always be marked
concave. GrDefaultPathRenderer was incorrectly drawing paths of this type
(thinking that it could fill them with simple triangulation).

Bug: skia:7020 skia:1460
Change-Id: I62bfd72e4c61da427687acf53c552357b57707aa
Reviewed-on: https://skia-review.googlesource.com/47082
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2017-09-15 19:13:24 +00:00
Ethan Nicholas
05d5a13fea Revert "Revert "Switched highp float to highfloat and mediump float to half.""
This reverts commit 1d816b92bb.

Bug: skia:
Change-Id: I388b5e5e9bf619db48297a80c9a80c039f26c9f1
Reviewed-on: https://skia-review.googlesource.com/46464
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
2017-09-15 18:50:54 +00:00
Mike Reed
49f1f34438 use unique_ptr for stream api
Bug: skia:6888
Change-Id: I3459b4913982a7cae1c0061697c82cc65ad9a2d8
Reviewed-on: https://skia-review.googlesource.com/26740
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2017-09-15 18:46:45 +00:00
Xianzhu Wang
cb4d587666 Fix SkImageSource::filterBounds()
Previously SkImageSource::filterBounds() uses the default
SkImageFilter::onFilterNodeBounds() which returns the input rect.

Now override onFilterNodeBounds() in SkImageSource to return src
or dst rect (with transform applied).

Change-Id: I6681e1ba97affb09ef1ca5bc03b3d0f66c10f149
Reviewed-on: https://skia-review.googlesource.com/46741
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2017-09-15 17:15:54 +00:00
Cary Clark
a4083c97d4 make most of SkColorPriv.h private
created new file src/core/SkColorData.h for
internal consumption. Note that many of the
functions there are unused as well.

Bug: skia: 6898
R: reed@google.com
Change-Id: I25bfd5a9c21f53558c4ca65a77eb5d322d897c6d
Reviewed-on: https://skia-review.googlesource.com/46848
Commit-Queue: Cary Clark <caryclark@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2017-09-15 16:31:35 +00:00
Yuqian Li
f13beef285 Add a utility function to save path test code size
Bug: skia:
Change-Id: Ie3ec5a57bacaabac544a2b01ab33fd665203031b
Reviewed-on: https://skia-review.googlesource.com/46841
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Yuqian Li <liyuqian@google.com>
2017-09-15 14:09:33 +00:00
Robert Phillips
f1748f5a92 Change visitProxies signature
There is a perf regression (mainly on the Nexus5) for the https://skia-review.googlesource.com/c/skia/+/46200 (Add method to iterate over a GrOp's GrSurfaceProxies)

This is one candidate.

Change-Id: I995d3a88bad2a914f24b49512abbf01aeaf579c8
Reviewed-on: https://skia-review.googlesource.com/46586
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2017-09-14 20:39:42 +00:00