Commit Graph

5868 Commits

Author SHA1 Message Date
Stephen White
ec79c39a77 GrTessellator: fix for zombie edge fuzzer crash.
While splitting one edge, merge_collinear_edges() may in rare cases
merge the other edge of the intersection out of existence.
split_edge() then brings these dead edges partially back to life,
leaving the mesh in an inconsistent state.

The fix is to null out the top and bottom pointers of dead edges to
mark them as dead, and only split living edges.

Bug: skia:7911
Change-Id: I1c0b59581acfcd0b8191f2d129b33f7d0d1a2516
Reviewed-on: https://skia-review.googlesource.com/129181
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2018-05-18 17:42:24 +00:00
Ben Wagner
255ab8d9a5 Make SkStream readers report failure.
This also fixes an issue noticed while making this change where
SkFontDescriptor improperly round trips negative axis values.

Change-Id: Iacc5929a185659dcacc18c802c4908e4f34c6899
Reviewed-on: https://skia-review.googlesource.com/128341
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2018-05-18 15:06:24 +00:00
Khushal
51371a4339 fonts: Handle fallback to using paths for text rendering for remoting.
SkRemoteGlyphCache only sends images for glyphs, even for cases where
the gpu falls back to drawing text as paths. This includes cases in
SkDraw::ShouldDrawTextAsPaths and when the glyph exceeds the max bounds
that can fit on the atlas. Fix this by identifying these cases in the
renderer and sending paths instead.

Note: We still don't handle distance field text correctly.

R=herb@google.com, bsalomon@google.com

Bug: skia:7913
Change-Id: I17d4eccbeaa2e995ae67b61c76cebd27f8280329
Reviewed-on: https://skia-review.googlesource.com/128203
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
2018-05-17 20:50:43 +00:00
Robert Phillips
120784394c Fix srcBounds computation in SkMatrixConvolutionImageFilter
Note that this does change the behavior of the cropRect for the repeated case. The cropRect now only acts as a hard clip on the output.

BUG= skia:7766

Change-Id: I1d66678bc797cd4835701cd20c36e68b22ac880a
Reviewed-on: https://skia-review.googlesource.com/127338
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-05-17 17:06:24 +00:00
Brian Salomon
a33b67c36b Rewrite GrQuad to use separate arrays of x and y values to be Sk4f friendly.
Change-Id: Ie2ad197c5f17849fe6e034b60bc7ec18a00edb24
Reviewed-on: https://skia-review.googlesource.com/128842
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-05-17 15:29:13 +00:00
Cary Clark
c06754b046 mapRect should not fiddle with nonfinite values.
Docs-Preview: https://skia.org/?cl=128682
Bug: skia:7967
Change-Id: Ic43387b7705ee8385b8df2430886484ff856077c
Reviewed-on: https://skia-review.googlesource.com/128682
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-05-17 14:02:43 +00:00
Khushal
b2e71274fe fonts: Fix memory accounting for deserialized glyphs.
When deserializing glyphs in the SkRemoteGlyphCache, we allocate from
the arena for the SkGlyphCache but don't account for it in the total
memory used by the cache. Fix that and avoid exposing the SkArenaAlloc
from SkGlyphCache, since that can result in such brittle use.

R=herb@google.com

Bug: 829622
Change-Id: Iecff9ce6e0ed2c641957535363edec3e3fad178d
Reviewed-on: https://skia-review.googlesource.com/128112
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
2018-05-15 22:58:23 +00:00
Mike Reed
026d20f888 handle huge normalize requests (including non-finite x or y)
Bug: oss-fuzz:8023
Change-Id: I622b6e335d9efbe599fa9047b3a6fcee1664aa4a
Reviewed-on: https://skia-review.googlesource.com/124581
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-05-14 21:14:09 +00:00
Robert Phillips
5140f9a8e4 Minor refactoring to image filters
This pulls the boring parts out of: https://skia-review.googlesource.com/c/skia/+/127338 (Fix srcBounds computation in SkMatrixConvolutionImageFilter)

TBR=bsalomon@google.com
Change-Id: Iade788fcc96c4c16989d13e7592030a6a1d3f170
Reviewed-on: https://skia-review.googlesource.com/127573
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-05-14 12:01:59 +00:00
Brian Salomon
c7fe0f708c Make GrCaps and GrShaderCaps private.
Moves getCaps() from GrContext to GrContextPriv and removes unused refCaps().

Change-Id: Ic6a8951b656c0d1b2773eae73bff8e88af819866
Reviewed-on: https://skia-review.googlesource.com/127389
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
2018-05-11 14:47:27 +00:00
Brian Osman
a0ca909142 Revert "Remove GrBackendObject and all related functions from Skia."
This reverts commit ccd4cfc23e.

Reason for revert: Fuchsia not building again. (Flutter roll may have been reverted?)

Original change's description:
> Remove GrBackendObject and all related functions from Skia.
> 
> Bug: skia:
> Change-Id: I59434b7477c0bc26fd982bd81eb97ab94bbba073
> Reviewed-on: https://skia-review.googlesource.com/125822
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>

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

Change-Id: Ie2c518b84b0c9513c0c622082de2831088b1ad8d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/127480
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-05-10 22:04:20 +00:00
Mike Klein
27fe397bc0 Revert "strip down SkICC.cpp"
This reverts commit eab50eb9c6
and this tiny bit of e61b969a07:

    https://skia-review.googlesource.com/c/skia/+/127122/3/tests/ICCTest.cpp

Change-Id: I4306e5118a4e5eb88c05078186a28bd443fd76f7
Reviewed-on: https://skia-review.googlesource.com/127305
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2018-05-10 21:44:56 +00:00
Mike Klein
ce4cf72e34 non-linear blending first steps
Code:
  - Add a non-linear blending bit and makeNonlinearBlending()
    to SkColorSpace
  - remove enough F16=linear checks to make it possible to
    create surfaces and encode pngs with nonlinear F16

Testing:
  - add "esrgb" software config to DM, run it
  - add "srgbnl" software config, run it
  - deemphasize importance of "srgb" config on bots
  - update unit tests to reflect relaxed F16 constraints
  - add a new unit test file with _really_ basic tests,
    and a new unit test that's not working yet

Bug: skia:7942

Change-Id: I8ac042bdf9f3d791765393b68fd9256375184d83
Reviewed-on: https://skia-review.googlesource.com/127325
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2018-05-10 18:26:22 +00:00
Mike Klein
c66eaaf2fb rm SkColorSpace_New
We think we can evolve SkColorSpace_XYZ into the One True SkColorSpace.

Change-Id: If93493145d78b388f3a0739cc7ccd6e232380733
Reviewed-on: https://skia-review.googlesource.com/127326
Auto-Submit: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-05-10 16:42:25 +00:00
Greg Daniel
ccd4cfc23e Remove GrBackendObject and all related functions from Skia.
Bug: skia:
Change-Id: I59434b7477c0bc26fd982bd81eb97ab94bbba073
Reviewed-on: https://skia-review.googlesource.com/125822
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-05-10 14:44:55 +00:00
Mike Klein
e61b969a07 SkColorSpace::Make(const skcms_ICCProfile&)
Change-Id: Ib12208d6c148f143fdd0b54538d852b97616a72d
Reviewed-on: https://skia-review.googlesource.com/127122
Commit-Queue: Mike Klein <mtklein@chromium.org>
Auto-Submit: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-05-09 19:36:01 +00:00
Mike Klein
eab50eb9c6 strip down SkICC.cpp
Most of SkICC{.h,.cpp} is unused and gone.

I've renamed the part that's left to SkWriteICCProfile() and tweaked its
API just a little, leaving SkICC:WriteToICC() a wrapper around it.

Most of the tests in ICCTest.cpp are moot and deleted, but a few looked
somewhat valuable so I've kept them with a little modification.

Change-Id: Ia1bb4c772af679885e17dac53d213c315ad0828c
Reviewed-on: https://skia-review.googlesource.com/127022
Auto-Submit: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
2018-05-09 19:19:31 +00:00
Hal Canary
46cc3dabaf Revert "Revert "SkAdvancedTypefaceMetrics: factor out GlyphToUnicode""
This reverts commit 97c1108607.

Change-Id: Ic3c6addc64ced39766bbee3e10b4d88faf61ba2f
Reviewed-on: https://skia-review.googlesource.com/127021
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-05-09 18:00:35 +00:00
Greg Daniel
97c1108607 Revert "SkAdvancedTypefaceMetrics: factor out GlyphToUnicode"
This reverts commit 1c2bcd8b14.

Reason for revert: breaking chrome roll

Original change's description:
> SkAdvancedTypefaceMetrics: factor out GlyphToUnicode
> 
> Change-Id: Iedce8c1ea2c405d5ab64ccac353970d5cd2b9d63
> Reviewed-on: https://skia-review.googlesource.com/126507
> Commit-Queue: Hal Canary <halcanary@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

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

Change-Id: Ib1ff8484ffd09cdb88d461ac00745aa32c191124
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/127000
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-05-09 15:36:06 +00:00
Hal Canary
1c2bcd8b14 SkAdvancedTypefaceMetrics: factor out GlyphToUnicode
Change-Id: Iedce8c1ea2c405d5ab64ccac353970d5cd2b9d63
Reviewed-on: https://skia-review.googlesource.com/126507
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-05-09 14:24:45 +00:00
Leon Scroggins III
8a8a144952 Treat SkFILEStream's fOriginalOffset as the start
Bug: b/78866720

::rewind() rewinds to fOriginalOffset
::seek(position) seeks to position + fOriginalOffset
::move(offset) will not move < fOriginalOffset
::getPosition() returns position relative to fOriginalOffset
::getLength() returns full size minus fOriginalOffset
::duplicate() and ::fork() pass on fOriginalOffset

Android may create an SkFILEStream using a file descriptor whose offset
is at the beginning of the data that Android cares about. Treat all
positions in SkFILEStream as relative to that original offset.

This allows AnimatedImageDrawable to read directly from the
SkFILEStream, rather than using an SkFrontBufferedStream and forcing
SkGifCodec to cache data for later use.

This fixes a TODO that was introduced in
https://skia-review.googlesource.com/c/skia/+/9498 and takes it a step
further. In that CL, bungeman@ and I discussed the change and decided to
"leave this alone for now to avoid changing behavior". Doing a code
search today, the only two callers want the new behavior.

Change-Id: I9211394d5b730adf528fac0df0af7a664b1295be
Reviewed-on: https://skia-review.googlesource.com/126511
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
2018-05-08 20:41:04 +00:00
Mike Klein
ad67c66a58 track bounds of top-level control ops
We don't need an explicit save-restore block to determine the bounds of
top-level control operations... the implicit save-restore that all
picutres have should logically work the same way.

The commented test failed before this and passes now.

Bug: skia:7735
Change-Id: Ibd31a3a9b0b48042ab3869a6bb57bc8d8bb78c09
Reviewed-on: https://skia-review.googlesource.com/126460
Commit-Queue: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-05-07 16:14:09 +00:00
Mike Klein
738b80d8a5 Don't use getDeviceClipBounds() to bound pic ops.
The values returned by SkCanvas::getDeviceClipBounds() are in the right
space, but have extra constraints on them that are not desirable for
bounding the logical bounds of draw operations:

  - they are integral
  - they are non-negative

We've been intersecting the bounds of each operation with these bounds,
which means we're mixing these bogus constraints into the bounds of each
recorded operation.  This percolates up to the SkPicutre cull rect too.

The most egregious way to see the problem is to record a draw op
entirely in negative space... it'll come back with empty logical bounds
rather than its correct (negative-space) bounds.  I've added a test
for this, and another test I also think should be passing but left
making it so as a follow up.

I've had to disable a couple tests asserting clips affect the bounds. :/

A possible follow-up might go back to using the clips to tighten the
bounds of the ops, just so long as we take the original user bounds and
map them with the CTM through to device space ourselves, rather than
relying on the recording canvas' clip stack.  I think this means we'd
need to maintain our own stack of device-space float SkRect clip bounds
while calculating these op bounds.

Bug: skia:7735
Change-Id: I6bf15f6b2a9ba4329a4eeae7f9d57aa8729ec1bb
Reviewed-on: https://skia-review.googlesource.com/126002
Commit-Queue: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-05-04 18:56:13 +00:00
Ben Wagner
da926dbd69 Remove fCacheKeys from SkImageFilter.
No public API changes.

Bug: skia:7666, skia:7887
Change-Id: I8ac4ec37dd3d0fcc050bc977db41439a8e18895f
Reviewed-on: https://skia-review.googlesource.com/125500
Commit-Queue: Ben Wagner <benjaminwagner@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Auto-Submit: Ben Wagner <benjaminwagner@google.com>
2018-05-04 14:33:32 +00:00
Yuqian Li
737b9a9d48 Remove legacy guard flags
Bug: skia:
Change-Id: I3b526f2caec6766faea72cdc89550f50e17c71d2
Reviewed-on: https://skia-review.googlesource.com/125746
Reviewed-by: Cary Clark <caryclark@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Yuqian Li <liyuqian@google.com>
2018-05-03 18:48:32 +00:00
Khushal
b2e3934569 fonts: Cleanup header guard and stray printfs.
R=herb@google.com

Change-Id: I9d2865438f61f8e246f3a5e3548c0befbf402bc1
Reviewed-on: https://skia-review.googlesource.com/125643
Auto-Submit: Khusal Sagar <khushalsagar@chromium.org>
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
2018-05-03 14:19:11 +00:00
Greg Daniel
b73a9f8b96 Add internal grsurface flag to track if using gl rectangle or external texture.
Bug: skia:
Change-Id: I84963833bbc3ae957c919a19f6e78fce2c9de7ef
Reviewed-on: https://skia-review.googlesource.com/125294
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-05-02 21:34:58 +00:00
Khushal
38a0843688 fonts: Reland push font remoting.
This relands the following changes:
1) https://skia-review.googlesource.com/c/skia/+/120283
2) https://skia-review.googlesource.com/c/skia/+/125029
3) https://skia-review.googlesource.com/c/skia/+/125140

The original changes had to be reverted due to a memory leak in
SkBaseDevice from SkTextBlobCacheDiffCanvas. This has been addressed by
https://skia-review.googlesource.com/c/skia/+/125160

TBR=herb@google.com

Bug: skia:7515, 831354
Change-Id: I73f4fcb1c397f31bf01553ff48c71ed2d6dd0770
Reviewed-on: https://skia-review.googlesource.com/125326
Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
Reviewed-by: Khusal Sagar <khushalsagar@chromium.org>
2018-05-02 18:39:31 +00:00
Herb Derby
fcac00f2f1 Reland "Remove devKerning"
This is a reland of c86c5c0144

Original change's description:
> Remove devKerning
> 
> Dev kerning is not supported by any scalers. This is
> mostly removed. The remaining fields fRsbDelta and
> fLsbDelta are kept to keep Android compiling.
> 
> Change-Id: If1a9ee9bb599d4e1bdf4b3751ac0c65246350809
> Reviewed-on: https://skia-review.googlesource.com/124921
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Herb Derby <herb@google.com>

Change-Id: Ibf5fac5f1442c7e62392d5146ad460da27b10d5c
Reviewed-on: https://skia-review.googlesource.com/125300
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-05-02 15:15:08 +00:00
Herb Derby
efe39bcfb8 Take sk_sp<SkDevice> instead of SkDevice*
Change-Id: I0b296bf5b80adc19758a3dc99160be9d2ed05680
Reviewed-on: https://skia-review.googlesource.com/125160
Commit-Queue: Herb Derby <herb@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Auto-Submit: Herb Derby <herb@google.com>
2018-05-02 14:46:17 +00:00
Mike Klein
8a232023e1 Revert "fonts: Set up remote glyph caching to push fonts."
This reverts commit 101d56359a.

Reason for revert: 5 of 5

Original change's description:
> fonts: Set up remote glyph caching to push fonts.
> 
> Currently the SkStrikeClient is designed to pull fonts from the server
> on demand, and to pre-fetch a batched request by analyzing the ops using
> a SkTextBlobCacheDiffCanvas. This change modifies the design to support
> a push based model, where the server pushes fonts required by the client
> and sets up the requisite SkGlyphCaches on the client prior to
> rasterizing the ops.
> 
> This model still relies on the SkTextBlobCacheDiffCanvas for analyzing
> the glyphs required for rasterizing an op. The glyph caches required for
> raster are locked and missing glyphs to be sent to the client are tracked
> by the SkStrikeServer. The embedder can serialize this font data at any
> point, but must ensure that this data is deserialized by the
> SkStrikeClient at the remote end, before rasterizing any ops analyzed
> prior to serialization. Any refs on the caches are released once the
> font data is serialized by the server.
> 
> The locking of glyph caches relies on the embedder providing discardable
> handles. These handles can be created on the server and serialized to be
> sent to the client, and map to an instance of SkGlyphCache. This allows
> the server to control the lifetime of the caches on the client.
> 
> Bug: skia:7515
> Change-Id: Id39f346b47b60899778404bbd0429ee811d0e53b
> Reviewed-on: https://skia-review.googlesource.com/120283
> Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
> Reviewed-by: Herb Derby <herb@google.com>

TBR=mtklein@google.com,herb@google.com,khushalsagar@chromium.org

Change-Id: If72caf968ddcbf70b8b9d71782a2339a118ed202
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7515
Reviewed-on: https://skia-review.googlesource.com/125264
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-05-02 13:55:08 +00:00
Mike Klein
c76e26a6bb Revert "Remove devKerning"
This reverts commit c86c5c0144.

Reason for revert: 4 of 5

Original change's description:
> Remove devKerning
> 
> Dev kerning is not supported by any scalers. This is
> mostly removed. The remaining fields fRsbDelta and
> fLsbDelta are kept to keep Android compiling.
> 
> Change-Id: If1a9ee9bb599d4e1bdf4b3751ac0c65246350809
> Reviewed-on: https://skia-review.googlesource.com/124921
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Herb Derby <herb@google.com>

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

Change-Id: If865f702868192a1b72cd811baa996dd1282bbce
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/125263
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-05-02 13:54:54 +00:00
Mike Klein
192b18a261 Revert "fonts: Bandaid fix for desc mismatch in SkRemoteGlyphCache."
This reverts commit ef4142a9bc.

Reason for revert: 2 of 5

Original change's description:
> fonts: Bandaid fix for desc mismatch in SkRemoteGlyphCache.
> 
> Since the typeface proxies on the client don't perform the same
> filtering done on the server during SkDescriptor generation, it causes
> the desc mismatches during raster. Disable this filtering on the server
> until this is resolved.
> 
> Bug: 831354
> Change-Id: I5683372fb497a4874dede5aec9c734cd1392872c
> Reviewed-on: https://skia-review.googlesource.com/125140
> Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
> Reviewed-by: Herb Derby <herb@google.com>

TBR=herb@google.com,khushalsagar@chromium.org

Change-Id: I8e732f57aa49323c186e3c4ea6120ff1caf8e25b
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 831354
Reviewed-on: https://skia-review.googlesource.com/125261
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-05-02 13:53:18 +00:00
Khushal
ef4142a9bc fonts: Bandaid fix for desc mismatch in SkRemoteGlyphCache.
Since the typeface proxies on the client don't perform the same
filtering done on the server during SkDescriptor generation, it causes
the desc mismatches during raster. Disable this filtering on the server
until this is resolved.

Bug: 831354
Change-Id: I5683372fb497a4874dede5aec9c734cd1392872c
Reviewed-on: https://skia-review.googlesource.com/125140
Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
2018-05-01 22:55:37 +00:00
Herb Derby
c86c5c0144 Remove devKerning
Dev kerning is not supported by any scalers. This is
mostly removed. The remaining fields fRsbDelta and
fLsbDelta are kept to keep Android compiling.

Change-Id: If1a9ee9bb599d4e1bdf4b3751ac0c65246350809
Reviewed-on: https://skia-review.googlesource.com/124921
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-05-01 21:12:15 +00:00
Brian Salomon
3fc6a185ca Fix index overflow check for rewriting fans as triangles.
Not only could the old test cause int overflow, it was just wrong.

Bug: skia:8085
Change-Id: Id6b81f4aa1b115f0dbfd2266aee8fab5d5d30aee
Reviewed-on: https://skia-review.googlesource.com/124779
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-05-01 19:58:45 +00:00
Khushal
101d56359a fonts: Set up remote glyph caching to push fonts.
Currently the SkStrikeClient is designed to pull fonts from the server
on demand, and to pre-fetch a batched request by analyzing the ops using
a SkTextBlobCacheDiffCanvas. This change modifies the design to support
a push based model, where the server pushes fonts required by the client
and sets up the requisite SkGlyphCaches on the client prior to
rasterizing the ops.

This model still relies on the SkTextBlobCacheDiffCanvas for analyzing
the glyphs required for rasterizing an op. The glyph caches required for
raster are locked and missing glyphs to be sent to the client are tracked
by the SkStrikeServer. The embedder can serialize this font data at any
point, but must ensure that this data is deserialized by the
SkStrikeClient at the remote end, before rasterizing any ops analyzed
prior to serialization. Any refs on the caches are released once the
font data is serialized by the server.

The locking of glyph caches relies on the embedder providing discardable
handles. These handles can be created on the server and serialized to be
sent to the client, and map to an instance of SkGlyphCache. This allows
the server to control the lifetime of the caches on the client.

Bug: skia:7515
Change-Id: Id39f346b47b60899778404bbd0429ee811d0e53b
Reviewed-on: https://skia-review.googlesource.com/120283
Commit-Queue: Khusal Sagar <khushalsagar@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
2018-05-01 18:15:15 +00:00
Brian Osman
0ab0f1c120 Convert skcms to only export functions (not data)
This simplifies shared library builds on Windows (no need to
conditionally change declspec to dllimport).

Once this lands, we can make the same change (plus update
internal references):
    https://skia-review.googlesource.com/c/skcms/+/124982

Change-Id: I0d4fa9031258f77d370e6e6e018afaf543c29d85
Reviewed-on: https://skia-review.googlesource.com/124983
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2018-05-01 17:42:35 +00:00
Brian Osman
12e4e84f73 Add test to ensure that skcms' sRGB turns into Skia's sRGB color space
Change-Id: Ib69926218895f9c3df8d02906188f5e54d134fad
Reviewed-on: https://skia-review.googlesource.com/124265
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2018-04-30 13:24:00 +00:00
Brian Salomon
cccafe8cfd Rewrite SkVertices specified with triangle fans as indexed triangles
Change-Id: Ifaacc426bc657b324f6a885a8ef70b347b048226
Reviewed-on: https://skia-review.googlesource.com/124349
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
2018-04-28 20:32:15 +00:00
Brian Salomon
e4949406eb Revert "Reland "Revert "Add arcs as a specialized geometry to GrShape."""
This reverts commit 580aee2fa4.

Bug: skia:7794
Change-Id: I9c2b923859c826dff58c22c529dc4e2ab4d0f186
Reviewed-on: https://skia-review.googlesource.com/124042
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-04-26 19:50:23 +00:00
Brian Salomon
580aee2fa4 Reland "Revert "Add arcs as a specialized geometry to GrShape.""
This reverts commit 8a98bc9674.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Revert "Revert "Add arcs as a specialized geometry to GrShape.""
> 
> This reverts commit af88ec3712.
> 
> Bug: skia:7794
> Change-Id: I2d0e1d7b4e025481241d823b09f5de5d0f1a13eb
> Reviewed-on: https://skia-review.googlesource.com/123627
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

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

Change-Id: Ib09a533600028b76a69b455c952f3dd12b39bdba
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7794
Reviewed-on: https://skia-review.googlesource.com/123780
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-04-25 21:20:30 +00:00
Brian Salomon
43227522e4 Make SkString::appendf safe for long strings.
Bug: skia:7841
Change-Id: I5bc77f5230b63da74e42d756ab4a1fefcfab9926
Reviewed-on: https://skia-review.googlesource.com/123634
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-04-25 20:58:09 +00:00
Chris Dalton
218c29453f Remove the MSAA path renderer
Bug: skia:
Change-Id: Ib18bede613c8d27fd6326f655dc2d638e35870ff
Reviewed-on: https://skia-review.googlesource.com/123726
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2018-04-25 19:59:59 +00:00
Brian Salomon
8a98bc9674 Revert "Revert "Add arcs as a specialized geometry to GrShape.""
This reverts commit af88ec3712.

Bug: skia:7794
Change-Id: I2d0e1d7b4e025481241d823b09f5de5d0f1a13eb
Reviewed-on: https://skia-review.googlesource.com/123627
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2018-04-25 18:54:07 +00:00
Mike Reed
910ca0fd01 Experiment to track coverage in a layer
Bug: skia:
Change-Id: I5ed334f63e64991944394dc8103092a2c6280546
Reviewed-on: https://skia-review.googlesource.com/122000
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-04-25 17:34:27 +00:00
Ben Wagner
ff134f20ae Compile with latest clang 7.
Changes to warnings in clang introduced by https://reviews.llvm.org/D43322
and https://reviews.llvm.org/D44883 cause warning as error failures when
building Skia. In particular this addresses return-std-move-in-c++11 and
self-assign-overloaded.

Change-Id: I680318098d8af1b64fba464585c7cdfcfcf39d66
Reviewed-on: https://skia-review.googlesource.com/123582
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-04-24 20:58:06 +00:00
Cary Clark
6cdb7d3a4c prepare to remove obsolete macros
SkColorSetARGBMacro and SkColorSetARGBInline
are macros which will be deleted. Replace them
with a standard equivalent.

R=scroggo@google.com
Bug: skia:6898
Change-Id: I16e010776e991c19a375d0686ecd1b1cc4c59a9b
Reviewed-on: https://skia-review.googlesource.com/123501
Auto-Submit: Cary Clark <caryclark@skia.org>
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
2018-04-24 19:19:01 +00:00
Mike Klein
55d330c32d Reland "call skcms_OptimizeForSpeed()"
This is a reland of 3b8feb331a

Original change's description:
> call skcms_OptimizeForSpeed()
> 
> I've guarded src and dst separately, so that we can land,
> rebaseline just the src change, and then later (when it
> does something), rebaseline optimizing dst separately.
> 
> Small threshold tweak to keep a unit test passing.
> 
> Change-Id: I57cc43c54b6065f58fa8f9448ea1d73fc42505f0
> Reviewed-on: https://skia-review.googlesource.com/123181
> Commit-Queue: Mike Klein <mtklein@chromium.org>
> Reviewed-by: Brian Osman <brianosman@google.com>

Change-Id: Ia29b4c941e121486a627ac7221947f4a452211ad
Reviewed-on: https://skia-review.googlesource.com/123480
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-04-24 18:55:36 +00:00
Mike Klein
af88ec3712 Revert "Add arcs as a specialized geometry to GrShape."
This reverts commit 255bcf57ff.

Reason for revert: layout and scuba image diffs

Original change's description:
> Add arcs as a specialized geometry to GrShape.
> 
> BUG: skia:7794
> 
> Change-Id: I484693711f48e55631732a0f4ee97e2848dec89d
> Reviewed-on: https://skia-review.googlesource.com/122900
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

Change-Id: I9293b8fbb535d940bca5fc30a95908416b9eb7a7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/123362
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-04-24 12:18:47 +00:00