Commit Graph

182 Commits

Author SHA1 Message Date
Jim Van Verth
6784ffa78e Add some new PolyUtils tests.
Also:
* clean up PolyUtils checks to be correct and consistent.
* fix some bugs discovered by the unit tests.

Bug: skia:
Change-Id: I1a8e07d13cb44fecc67344154dc1002f3f910f5d
Reviewed-on: https://skia-review.googlesource.com/138592
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2018-07-03 23:10:27 +00:00
Ben Wagner
37a06c063c Reland "Implement onMakeClone(const SkFontArguments& args) in class SkTypeface_fontconfig."
This reverts commit cce82d2b7c.

Reason for revert: Just add suppression.

Original change's description:
> Revert "Implement onMakeClone(const SkFontArguments& args) in class SkTypeface_fontconfig."
>
> This reverts commit 96b1ecc25d.
>
> Reason for revert: Breaking Google3, I think
>
> Original change's description:
> > Implement onMakeClone(const SkFontArguments& args) in class SkTypeface_fontconfig.
> >
> > Create FontMgrFontConfigTest.cpp file to test the above function.
> >
> > Change-Id: I7716355f702af3d6f25574305914f0b82a4147ce
> > Reviewed-on: https://skia-review.googlesource.com/137133
> > Reviewed-by: Ben Wagner <bungeman@google.com>
> > Commit-Queue: Ben Wagner <bungeman@google.com>
>
> TBR=bungeman@google.com,herb@google.com,brucewang@google.com
>
> Change-Id: I665de46d379f1b533358f0be644814aa4bfffb33
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/137240
> Reviewed-by: Kevin Lubick <kjlubick@google.com>
> Commit-Queue: Kevin Lubick <kjlubick@google.com>

TBR=bungeman@google.com,herb@google.com,kjlubick@google.com,brucewang@google.com

Change-Id: I41f0e4505ed0579a77a56212898e9a6caf6f1ed5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/137260
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-06-22 21:12:58 +00:00
Kevin Lubick
cce82d2b7c Revert "Implement onMakeClone(const SkFontArguments& args) in class SkTypeface_fontconfig."
This reverts commit 96b1ecc25d.

Reason for revert: Breaking Google3, I think

Original change's description:
> Implement onMakeClone(const SkFontArguments& args) in class SkTypeface_fontconfig.
> 
> Create FontMgrFontConfigTest.cpp file to test the above function.
> 
> Change-Id: I7716355f702af3d6f25574305914f0b82a4147ce
> Reviewed-on: https://skia-review.googlesource.com/137133
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Ben Wagner <bungeman@google.com>

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

Change-Id: I665de46d379f1b533358f0be644814aa4bfffb33
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/137240
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2018-06-22 21:07:38 +00:00
Bruce Wang
96b1ecc25d Implement onMakeClone(const SkFontArguments& args) in class SkTypeface_fontconfig.
Create FontMgrFontConfigTest.cpp file to test the above function.

Change-Id: I7716355f702af3d6f25574305914f0b82a4147ce
Reviewed-on: https://skia-review.googlesource.com/137133
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-06-22 17:49:27 +00:00
Florin Malita
80452bee11 Fold SkJSON into Skia/utils
It's a tiny, core-ish component -- might as well treat as such to
simplify dependencies.

Change-Id: I6f31ce2d151f9a629d88bfc7f15d64891d5150c0
Reviewed-on: https://skia-review.googlesource.com/135780
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-06-19 18:23:30 +00:00
Brian Osman
f018b7d607 SkColorSpaceXformSteps improvements and tests
Added some helper functions and put the booleans in a nested struct
(this is motivated by upcoming changes). Added a unit test of steps
against skcms, with round-tripping in both combinations.

Change-Id: Iea3d60cd52edb5259b5576b1422ed6f856cde815
Reviewed-on: https://skia-review.googlesource.com/134660
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2018-06-14 11:30:47 +00:00
Mike Klein
692e29ebcd remove unused parts of SkTypes.h
Lots of completely unused bits and bobs removed.

I've decided SK_SUPPORT_UNITTEST and its single use are not
very compelling.

tests/CPlusPlusEleven was the only user of Sk32ToBool(),
and no longer generally needed.

Change-Id: I3ee75560f1e1e1cf5ad89ee7df8d7694b5dffdb3
Reviewed-on: https://skia-review.googlesource.com/133622
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-06-08 23:53:57 +00:00
Herb Derby
41f4f31cd7 Reland "Have draw(Text|PosText|PosTextH) use a single entry on the device"
This reverts commit 74b390d6b1.

Reason for revert: reverting to add patch for valgrind

Original change's description:
> Revert "Have draw(Text|PosText|PosTextH) use a single entry on the device"
> 
> This reverts commit 4225b3220e.
> 
> Reason for revert: made valgrind unhappy.
> 
> Original change's description:
> > Have draw(Text|PosText|PosTextH) use a single entry on the device
> > 
> > Handle the positioning of drawText at the canvas layer. Simplify
> > the code by removing similar implementations.
> > 
> > Change-Id: I8b711783435072f560e29fca1dd934fa2e345ed2
> > Reviewed-on: https://skia-review.googlesource.com/127131
> > Reviewed-by: Ben Wagner <bungeman@google.com>
> > Commit-Queue: Herb Derby <herb@google.com>
> 
> TBR=jvanverth@google.com,bungeman@google.com,herb@google.com
> 
> Change-Id: I65c9d30ae6ecb1f87e8660e56d8f8ce5daab7551
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/132403
> Reviewed-by: Hal Canary <halcanary@google.com>
> Commit-Queue: Hal Canary <halcanary@google.com>

TBR=jvanverth@google.com,halcanary@google.com,bungeman@google.com,herb@google.com

Change-Id: I9bbb73aac447b51eb8215ac42331759fa4c9fa45
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/132580
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-06-06 17:46:05 +00:00
Mike Klein
f454bd3930 rm TestConfigParsing
No test tests, ok?  Gotta draw the line somewhere.

Change-Id: I52284272f74a72a858910a143ecd4ad68fe3f1de
Reviewed-on: https://skia-review.googlesource.com/132410
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-06-06 15:37:54 +00:00
Hal Canary
74b390d6b1 Revert "Have draw(Text|PosText|PosTextH) use a single entry on the device"
This reverts commit 4225b3220e.

Reason for revert: made valgrind unhappy.

Original change's description:
> Have draw(Text|PosText|PosTextH) use a single entry on the device
> 
> Handle the positioning of drawText at the canvas layer. Simplify
> the code by removing similar implementations.
> 
> Change-Id: I8b711783435072f560e29fca1dd934fa2e345ed2
> Reviewed-on: https://skia-review.googlesource.com/127131
> Reviewed-by: Ben Wagner <bungeman@google.com>
> Commit-Queue: Herb Derby <herb@google.com>

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

Change-Id: I65c9d30ae6ecb1f87e8660e56d8f8ce5daab7551
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/132403
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-06-06 13:29:57 +00:00
Herb Derby
4225b3220e Have draw(Text|PosText|PosTextH) use a single entry on the device
Handle the positioning of drawText at the canvas layer. Simplify
the code by removing similar implementations.

Change-Id: I8b711783435072f560e29fca1dd934fa2e345ed2
Reviewed-on: https://skia-review.googlesource.com/127131
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-06-05 20:11:39 +00:00
Brian Osman
2b23c4bf31 Dest color space no longer impacts mipmaps or texture sampling
PS5: Removes SkDestinationSurfaceColorMode, tracking of mipmap
mode on GrTexture, sRGB decode state per-texture. Because we
were often choosing sRGB configs for RGB color types, legacy
rendering would then be incorrect (too dark). So...

PS7: Stops ever using sRGB pixel configs when translating
image info or color type. Also removes a bunch of GrCaps bits
and a GrContextOption that are no longer relevant.

PS9: Adjusts surface creation unit test expectations, and
changes the raster rules accordingly.

At this point, sRGB configs are (obviously) going to be broken.

Locally, I ran 8888, gl, and the gbr- versions of both. Across
all GMs x configs, there are 13 diffs. 12 are GMs that create
surfaces with a color-space attached (and thus, the offscreen
is no longer getting sRGB pixel config). The only remainder
constructs an SkPictureImageGenerator, (with an attached color
space) and renders it to the gbr-gl canvas, which triggers a
a tagged surface inside the generator.

Bug: skia:
Change-Id: Ie5edfa157dd799f3121e8173fc4f97f6c8ed6789
Reviewed-on: https://skia-review.googlesource.com/131282
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-06-01 17:00:26 +00:00
Greg Daniel
81df0414c8 Reland "Use GrVkMemoryAllocator for vulkan memory allocations in ganesh."
This is a reland of 331c266ed7

Original change's description:
> Use GrVkMemoryAllocator for vulkan memory allocations in ganesh.
> 
> Besides using the new allocator, the big logical change is that map
> and unmap calls form GrVkMemory are specc'd to map the entire GrVkAlloc
> instead of a specific offset and size as they did before. As a
> consequence of this, we move the handling of non-coherent alignment
> for flush/invalidate calls to GrVkMemory instead of the callers.
> 
> Bug: skia:
> Change-Id: I794d713106602f27aa7e808c306bbb69fd2b67be
> Reviewed-on: https://skia-review.googlesource.com/130021
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>

Bug: skia:
Change-Id: Ia9a4192d344449fb444d2adaa1d62ff1ede4b21d
Reviewed-on: https://skia-review.googlesource.com/131083
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-05-31 18:21:25 +00:00
Greg Daniel
a9d3dae67a Revert "Use GrVkMemoryAllocator for vulkan memory allocations in ganesh."
This reverts commit 331c266ed7.

Reason for revert: breaking an intel vulkan bot

Original change's description:
> Use GrVkMemoryAllocator for vulkan memory allocations in ganesh.
> 
> Besides using the new allocator, the big logical change is that map
> and unmap calls form GrVkMemory are specc'd to map the entire GrVkAlloc
> instead of a specific offset and size as they did before. As a
> consequence of this, we move the handling of non-coherent alignment
> for flush/invalidate calls to GrVkMemory instead of the callers.
> 
> Bug: skia:
> Change-Id: I794d713106602f27aa7e808c306bbb69fd2b67be
> Reviewed-on: https://skia-review.googlesource.com/130021
> Commit-Queue: Greg Daniel <egdaniel@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>

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

Change-Id: I5237c00625dc95d3d9b36c1e5591762988d85562
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/131081
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-05-30 22:59:08 +00:00
Greg Daniel
331c266ed7 Use GrVkMemoryAllocator for vulkan memory allocations in ganesh.
Besides using the new allocator, the big logical change is that map
and unmap calls form GrVkMemory are specc'd to map the entire GrVkAlloc
instead of a specific offset and size as they did before. As a
consequence of this, we move the handling of non-coherent alignment
for flush/invalidate calls to GrVkMemory instead of the callers.

Bug: skia:
Change-Id: I794d713106602f27aa7e808c306bbb69fd2b67be
Reviewed-on: https://skia-review.googlesource.com/130021
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2018-05-30 19:52:38 +00:00
Mike Klein
cdbec8f197 remove bit, srgbnl config in DM
We're not going to need the bit.

I've rewritten "esrgb" and "srgbnl" to express themselves the way I'd
like them to work.  Their images are supressed in Gold already.

Change-Id: I6da58cc75dcb998cbfcf9a8f65de31c030adb494
Reviewed-on: https://skia-review.googlesource.com/130506
Reviewed-by: Brian Osman <brianosman@google.com>
2018-05-29 19:14:03 +00:00
Florin Malita
3b526b05d6 "Modularize" SkSG
* relocate all SkSG-related files under modules/sksg/
* fix various tidbits to make non-sksg builds possible
* drop obsolete SampleSGInval.cpp

Change-Id: I54e6c5bb1a09f45030fa8d607b3eb3f7cba78957
Reviewed-on: https://skia-review.googlesource.com/130025
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-05-25 17:11:52 +00:00
Mike Klein
6968f9ce54 SkColorSpaceXformSteps
Lots TODO.

Change-Id: I95edb764b85a5140d432adb506c3b537869e6df4
Reviewed-on: https://skia-review.googlesource.com/129933
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@chromium.org>
2018-05-24 18:24:48 +00:00
Mike Klein
6747f52778 Reland "start cleaning up non-skcms SkColorSpaceXforms"
This is a reland of 339133f82c

Original change's description:
> start cleaning up non-skcms SkColorSpaceXforms
> 
> I think this gets rid of
>   - SkColorSpaceXform_Base
>   - SkColorSpaceXform_XYZ
>   - SkColorSpaceXform_A2B
> and lots of support code.  Might be more left to clean up?
> 
> Change-Id: I560d974d1e879dfd6a63ee2244a3dd88bd495c8a
> Reviewed-on: https://skia-review.googlesource.com/129512
> Commit-Queue: Brian Osman <brianosman@google.com>
> Auto-Submit: Mike Klein <mtklein@chromium.org>
> Reviewed-by: Brian Osman <brianosman@google.com>

Change-Id: I33ee0d8bcfd72c401823a2e7d5168c9ecc9a5181
Reviewed-on: https://skia-review.googlesource.com/129624
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-05-23 12:30:36 +00:00
Mike Klein
e60ae82dec Revert "start cleaning up non-skcms SkColorSpaceXforms"
This reverts commit 339133f82c.

Reason for revert: broke NinePatchDrawableTest.testGetPadding?  stranger things have happened.

Original change's description:
> start cleaning up non-skcms SkColorSpaceXforms
> 
> I think this gets rid of
>   - SkColorSpaceXform_Base
>   - SkColorSpaceXform_XYZ
>   - SkColorSpaceXform_A2B
> and lots of support code.  Might be more left to clean up?
> 
> Change-Id: I560d974d1e879dfd6a63ee2244a3dd88bd495c8a
> Reviewed-on: https://skia-review.googlesource.com/129512
> Commit-Queue: Brian Osman <brianosman@google.com>
> Auto-Submit: Mike Klein <mtklein@chromium.org>
> Reviewed-by: Brian Osman <brianosman@google.com>

TBR=mtklein@chromium.org,brianosman@google.com

Change-Id: I9e76195481b8658b34936aeece278d81c286c0fa
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/129680
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-05-23 00:06:46 +00:00
Mike Klein
339133f82c start cleaning up non-skcms SkColorSpaceXforms
I think this gets rid of
  - SkColorSpaceXform_Base
  - SkColorSpaceXform_XYZ
  - SkColorSpaceXform_A2B
and lots of support code.  Might be more left to clean up?

Change-Id: I560d974d1e879dfd6a63ee2244a3dd88bd495c8a
Reviewed-on: https://skia-review.googlesource.com/129512
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
2018-05-22 18:19:35 +00:00
Ben Wagner
d90cd3b279 Revert "Revert "IWYU for tests starting with 'D'.""
This reverts commit edf8449d2c.

Change-Id: Ibeedd9965855b3ccfe44486d15307bf3da15fd9c
Reviewed-on: https://skia-review.googlesource.com/129516
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-05-22 17:12:35 +00:00
Mike Klein
edf8449d2c Revert "IWYU for tests starting with 'D'."
This reverts commit b5f2897ab5.

Reason for revert: looks like this broke the build for DM in Google3.  Need more include dirs there?

Original change's description:
> IWYU for tests starting with 'D'.
> 
> Change-Id: I9189e4b56ce1635b627119733447c2ed4220753d
> Reviewed-on: https://skia-review.googlesource.com/129319
> Reviewed-by: Herb Derby <herb@google.com>
> Commit-Queue: Ben Wagner <bungeman@google.com>

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

Change-Id: I01aac7dae6114685a0652cbde3defccc8a42caea
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/129443
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-05-22 12:23:15 +00:00
Ben Wagner
b5f2897ab5 IWYU for tests starting with 'D'.
Change-Id: I9189e4b56ce1635b627119733447c2ed4220753d
Reviewed-on: https://skia-review.googlesource.com/129319
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
2018-05-21 19:34:48 +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
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
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
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
Florin Malita
15a64e71f6 Convert A8 D32 mask blitters to Sk4px
Improves the newly added bench by ~25% (hsw):

-- before --

    micros   	bench
   2298.34  	shadermaskfilter_picture_80	8888
   2339.60  	shadermaskfilter_picture_ff	8888
   2287.11  	shadermaskfilter_bitmap_80	8888
   2223.14  	shadermaskfilter_bitmap_ff	8888

-- after --

   1693.36  	shadermaskfilter_picture_80	8888
   1637.45  	shadermaskfilter_picture_ff	8888
   1691.65  	shadermaskfilter_bitmap_80	8888
   1637.70  	shadermaskfilter_bitmap_ff	8888

But: skia:7810
Change-Id: I7274b10f517551ee2c0646842f72e0372d55e509
Reviewed-on: https://skia-review.googlesource.com/121642
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Klein <mtklein@google.com>
2018-04-18 19:52:53 +00:00
Florin Malita
8eaf64ae12 Fix SkTCopyOnFirstWrite copy semantics
The implicit SkTCopyOnFirstWrite copy-ctor and assignment operator are
incorrect: fObj must point to the local copy, not to the source copy
(when a copy has been made).

Add corrected explicit copy (and move) ctor + assignment operator.

Also add a get() helper to facilitate rawptr access.

Change-Id: Ie3983e12c04eae4f32c40e3e267618cf02008c20
Reviewed-on: https://skia-review.googlesource.com/120442
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-04-11 17:25:07 +00:00
Greg Daniel
52e16d9848 Update getBackendInfo calls on GrBackendTexture to support VkImageLayout better.
The big api level change here is that the getBackendInfo calls now return by value
instead of a pointer. These changes are being made in support of Vulkan so that
the client can update the VkImageLayout on the GrBackendTexture and have that
update get reflected in our internal tracking of the image. This is done by storing
a ref counted GrVkImageLayout object on the GrBackendTexture and the GrVkImage.

Bug: skia:
Change-Id: I8c6158fd3a66eb61fef97ebf09ea5364bca3f1ae
Reviewed-on: https://skia-review.googlesource.com/119101
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2018-04-10 14:20:22 +00:00
Jim Van Verth
4db18edb95 Add SkOffsetSimplePolygon.
Performs inset and outset operations on simple polygons and returns
a simple polygon, if possible.

Bug: skia:
Change-Id: I6d468174ad70b5279b736c532e19cbb84ff9f955
Reviewed-on: https://skia-review.googlesource.com/116483
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-04-03 14:37:50 +00:00
Ethan Nicholas
26a9aad63b initial SkSLJIT checkin
Docs-Preview: https://skia.org/?cl=112204
Bug: skia:
Change-Id: I10042a0200db00bd8ff8078467c409b1cf191f50
Reviewed-on: https://skia-review.googlesource.com/112204
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
2018-03-27 18:39:13 +00:00
Robert Phillips
96b6d537c2 Fix GrTextureStripAtlasManager cleanup order bug
Bug: 820703
Change-Id: I6f1a895ceb213d38361bc03a472cf2a48e4720a5
Reviewed-on: https://skia-review.googlesource.com/115001
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-03-19 15:36:26 +00:00
Greg Daniel
bdea98cff1 Delete unused VkClearTest
Bug: skia:
Change-Id: I4aa1886e7f4048fc13a741ddbc37b9ca3f48a41d
Reviewed-on: https://skia-review.googlesource.com/114510
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-03-15 17:30:26 +00:00
Herb Derby
d49665513b Remove TLS glyph cache calls.
Change-Id: Iafeb02d395cac81e8fe6d74c989a37607503919c
Reviewed-on: https://skia-review.googlesource.com/113208
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2018-03-09 19:32:22 +00:00
Greg Daniel
a8d9211bc3 Add promise images for deferred instantiation of wrapped gpu textures
This will allow a client to make an SkImage that "wraps" a gpu texture,
however the client does need to supply the actual gpu texture at Image
creation time. Instead it is retrieve at flush time via a callback.

Bug: skia:
Change-Id: I6267a55ab7102101a7bd80a6f547b6a870d2df08
Reviewed-on: https://skia-review.googlesource.com/109021
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
2018-03-09 18:02:00 +00:00
Mike Reed
b5e1f75580 Revert "Revert "add tiler for SkDraw""
This reverts commit 461ef7af88.

Prev CL to SkScan_Hairline.cpp fixed the bug that caused the earlier revert.

Bug: skia:
Change-Id: Ifd9a364c7546175be292f726e19465b72196b45e
Reviewed-on: https://skia-review.googlesource.com/112723
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2018-03-07 19:39:00 +00:00
Florin Malita
461ef7af88 Revert "add tiler for SkDraw"
This reverts commit be1b397180.

Reason for revert: 

Unexpected layout test diffs: https://test-results.appspot.com/data/layout_results/linux_trusty_blink_rel/24989/layout-test-results/results.html

Original change's description:
> add tiler for SkDraw
> 
> Bug: skia:2122
> Change-Id: I276de2064939151eef5fa14c53188e8b5728b7c9
> Reviewed-on: https://skia-review.googlesource.com/110840
> Commit-Queue: Mike Reed <reed@google.com>
> Reviewed-by: Yuqian Li <liyuqian@google.com>

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

Change-Id: Ia598c0d7c4ac6cfcdb905b847040c250fa366402
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:2122
Reviewed-on: https://skia-review.googlesource.com/112740
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2018-03-07 14:23:01 +00:00
Mike Reed
be1b397180 add tiler for SkDraw
Bug: skia:2122
Change-Id: I276de2064939151eef5fa14c53188e8b5728b7c9
Reviewed-on: https://skia-review.googlesource.com/110840
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Yuqian Li <liyuqian@google.com>
2018-03-06 19:56:46 +00:00
Greg Daniel
f3a4ef91d8 Add unit test the explicit tests create a GrVkCopyPipeline
Bug: skia:7663
Change-Id: I9883d903302fbbcd42f73601f49af96b6cc875ba
Reviewed-on: https://skia-review.googlesource.com/111361
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
2018-03-01 17:00:24 +00:00
Robert Phillips
4bc7011802 Separate creation time & flush time behavior in GrDrawOpAtlas (take 3)
This CL clarifies what is going on in the GrDrawOpAtlas and GrAtlasGlyphCache.

For the GrDrawOpAtlas:
  At creation time all the allowed pages are created (with their backing GrTextureProxies) but they aren't instantiated.

  The GrDrawOpAtlas::instantiate call is called in preFlushCB and allocates any pages known to be needed at the start of flush

  GrDrawOpAtlas::addToAtlas is called at flush time and, if a new page is activated, will instantiated it at that time.

  During compaction, an unused page will be deInstantiated but its Plots and backing GrTextureProxy will remain alive.

The GrAtlasGlyphCache reflects the changes to the GrDrawOpAtlas
  It now carries a GrProxyProvider for when it needs to create an atlas
  It passes in a GrResourceProvider* at flush time to allow instantiation.

  It does not, yet, allocate that GrDrawOpAtlases it might ever require.

TBR=bsalomon@google.com
Change-Id: I276d339d81e7b709140e082a7b58c5584f73ab70
Reviewed-on: https://skia-review.googlesource.com/111100
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2018-03-01 15:47:34 +00:00
Robert Phillips
ba7a165194 Revert "Revert "Revert "Separate creation time & flush time behavior in GrDrawOpAtlas (take 2)"""
This reverts commit 934c3d0c54.

Reason for revert: Chrome

Original change's description:
> Revert "Revert "Separate creation time & flush time behavior in GrDrawOpAtlas (take 2)""
> 
> This reverts commit 84d823a5e2.
> 
> Reason for revert: The DFT diffs don't repro on Windows so I'm chalking it up to minor device differences
> 
> Original change's description:
> > Revert "Separate creation time & flush time behavior in GrDrawOpAtlas (take 2)"
> > 
> > This reverts commit 96165ebeaa.
> > 
> > Reason for revert: DFT GMs w/ LCD text are slightly different
> > 
> > Original change's description:
> > > Separate creation time & flush time behavior in GrDrawOpAtlas (take 2)
> > > 
> > > This CL clarifies what is going on in the GrDrawOpAtlas and GrAtlasGlyphCache.
> > > 
> > > For the GrDrawOpAtlas:
> > >   At creation time all the allowed pages are created (with their backing GrTextureProxies) but they aren't instantiated.
> > > 
> > >   The GrDrawOpAtlas::instantiate call is called in preFlushCB and allocates any pages known to be needed at the start of flush
> > > 
> > >   GrDrawOpAtlas::addToAtlas is called at flush time and, if a new page is activated, will instantiated it at that time.
> > > 
> > >   During compaction, an unused page will be deInstantiated but its Plots and backing GrTextureProxy will remain alive.
> > > 
> > > The GrAtlasGlyphCache reflects the changes to the GrDrawOpAtlas
> > >   It now carries a GrProxyProvider for when it needs to create an atlas
> > >   It passes in a GrResourceProvider* at flush time to allow instantiation.
> > > 
> > >   It does not, yet, allocate that GrDrawOpAtlases it might ever require.
> > > 
> > > Change-Id: Ie9b64b13e261b01ee14be09fbf7e17841b7781dc
> > > Reviewed-on: https://skia-review.googlesource.com/109749
> > > Reviewed-by: Jim Van Verth <jvanverth@google.com>
> > > Commit-Queue: Robert Phillips <robertphillips@google.com>
> > 
> > TBR=jvanverth@google.com,robertphillips@google.com
> > 
> > Change-Id: I62efc61c8394477e54d6e79fa2f65180c91a4515
> > No-Presubmit: true
> > No-Tree-Checks: true
> > No-Try: true
> > Reviewed-on: https://skia-review.googlesource.com/110220
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> > Commit-Queue: Robert Phillips <robertphillips@google.com>
> 
> TBR=jvanverth@google.com,robertphillips@google.com
> 
> Change-Id: I7c87b4523f9b53285f0de5c2d741a25893522d9a
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/110221
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

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

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

Change-Id: I7dd73ab0159f38595f21b21eef3becc10aa0934d
Reviewed-on: https://skia-review.googlesource.com/111080
Reviewed-by: Robert Phillips <robertphillips@google.com>
2018-02-28 17:42:11 +00:00
Robert Phillips
934c3d0c54 Revert "Revert "Separate creation time & flush time behavior in GrDrawOpAtlas (take 2)""
This reverts commit 84d823a5e2.

Reason for revert: The DFT diffs don't repro on Windows so I'm chalking it up to minor device differences

Original change's description:
> Revert "Separate creation time & flush time behavior in GrDrawOpAtlas (take 2)"
> 
> This reverts commit 96165ebeaa.
> 
> Reason for revert: DFT GMs w/ LCD text are slightly different
> 
> Original change's description:
> > Separate creation time & flush time behavior in GrDrawOpAtlas (take 2)
> > 
> > This CL clarifies what is going on in the GrDrawOpAtlas and GrAtlasGlyphCache.
> > 
> > For the GrDrawOpAtlas:
> >   At creation time all the allowed pages are created (with their backing GrTextureProxies) but they aren't instantiated.
> > 
> >   The GrDrawOpAtlas::instantiate call is called in preFlushCB and allocates any pages known to be needed at the start of flush
> > 
> >   GrDrawOpAtlas::addToAtlas is called at flush time and, if a new page is activated, will instantiated it at that time.
> > 
> >   During compaction, an unused page will be deInstantiated but its Plots and backing GrTextureProxy will remain alive.
> > 
> > The GrAtlasGlyphCache reflects the changes to the GrDrawOpAtlas
> >   It now carries a GrProxyProvider for when it needs to create an atlas
> >   It passes in a GrResourceProvider* at flush time to allow instantiation.
> > 
> >   It does not, yet, allocate that GrDrawOpAtlases it might ever require.
> > 
> > Change-Id: Ie9b64b13e261b01ee14be09fbf7e17841b7781dc
> > Reviewed-on: https://skia-review.googlesource.com/109749
> > Reviewed-by: Jim Van Verth <jvanverth@google.com>
> > Commit-Queue: Robert Phillips <robertphillips@google.com>
> 
> TBR=jvanverth@google.com,robertphillips@google.com
> 
> Change-Id: I62efc61c8394477e54d6e79fa2f65180c91a4515
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/110220
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

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

Change-Id: I7c87b4523f9b53285f0de5c2d741a25893522d9a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/110221
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-02-26 16:49:28 +00:00
Robert Phillips
84d823a5e2 Revert "Separate creation time & flush time behavior in GrDrawOpAtlas (take 2)"
This reverts commit 96165ebeaa.

Reason for revert: DFT GMs w/ LCD text are slightly different

Original change's description:
> Separate creation time & flush time behavior in GrDrawOpAtlas (take 2)
> 
> This CL clarifies what is going on in the GrDrawOpAtlas and GrAtlasGlyphCache.
> 
> For the GrDrawOpAtlas:
>   At creation time all the allowed pages are created (with their backing GrTextureProxies) but they aren't instantiated.
> 
>   The GrDrawOpAtlas::instantiate call is called in preFlushCB and allocates any pages known to be needed at the start of flush
> 
>   GrDrawOpAtlas::addToAtlas is called at flush time and, if a new page is activated, will instantiated it at that time.
> 
>   During compaction, an unused page will be deInstantiated but its Plots and backing GrTextureProxy will remain alive.
> 
> The GrAtlasGlyphCache reflects the changes to the GrDrawOpAtlas
>   It now carries a GrProxyProvider for when it needs to create an atlas
>   It passes in a GrResourceProvider* at flush time to allow instantiation.
> 
>   It does not, yet, allocate that GrDrawOpAtlases it might ever require.
> 
> Change-Id: Ie9b64b13e261b01ee14be09fbf7e17841b7781dc
> Reviewed-on: https://skia-review.googlesource.com/109749
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

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

Change-Id: I62efc61c8394477e54d6e79fa2f65180c91a4515
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/110220
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-02-26 16:03:58 +00:00
Robert Phillips
96165ebeaa Separate creation time & flush time behavior in GrDrawOpAtlas (take 2)
This CL clarifies what is going on in the GrDrawOpAtlas and GrAtlasGlyphCache.

For the GrDrawOpAtlas:
  At creation time all the allowed pages are created (with their backing GrTextureProxies) but they aren't instantiated.

  The GrDrawOpAtlas::instantiate call is called in preFlushCB and allocates any pages known to be needed at the start of flush

  GrDrawOpAtlas::addToAtlas is called at flush time and, if a new page is activated, will instantiated it at that time.

  During compaction, an unused page will be deInstantiated but its Plots and backing GrTextureProxy will remain alive.

The GrAtlasGlyphCache reflects the changes to the GrDrawOpAtlas
  It now carries a GrProxyProvider for when it needs to create an atlas
  It passes in a GrResourceProvider* at flush time to allow instantiation.

  It does not, yet, allocate that GrDrawOpAtlases it might ever require.

Change-Id: Ie9b64b13e261b01ee14be09fbf7e17841b7781dc
Reviewed-on: https://skia-review.googlesource.com/109749
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-02-26 14:56:17 +00:00
Robert Phillips
59ddc6d5ee Revert "Separate creation time & flush time behavior in GrDrawOpAtlas"
This reverts commit 056c1a821a.

Reason for revert: GM issues

Original change's description:
> Separate creation time & flush time behavior in GrDrawOpAtlas
> 
> This CL clarifies what is going on in the GrDrawOpAtlas and GrAtlasGlyphCache.
> 
> For the GrDrawOpAtlas:
>   At creation time all the allowed pages are created (with their backing GrTextureProxies) but they aren't instantiated.
> 
>   The GrDrawOpAtlas::instantiate call is called in preFlushCB and allocates any pages known to be needed at the start of flush
> 
>   GrDrawOpAtlas::addToAtlas is called at flush time and, if a new page is activated, will instantiated it at that time.
> 
>   During compaction, an unused page will be deInstantiated but its Plots and backing GrTextureProxy will remain alive.
> 
> The GrAtlasGlyphCache reflects the changes to the GrDrawOpAtlas
>   It now carries a GrProxyProvider for when it needs to create an atlas
>   It passes in a GrResourceProvider* at flush time to allow instantiation.
> 
>   It does not, yet, allocate that GrDrawOpAtlases it might ever require.
> 
> Change-Id: I54909b7a3ba4bec2db5f1218f6a2a3a1636f66d6
> Reviewed-on: https://skia-review.googlesource.com/108520
> Commit-Queue: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Jim Van Verth <jvanverth@google.com>

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

Change-Id: I36eafe46209380f533aa84e831d1c9d18844b6be
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/109280
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-02-21 21:56:47 +00:00
Robert Phillips
056c1a821a Separate creation time & flush time behavior in GrDrawOpAtlas
This CL clarifies what is going on in the GrDrawOpAtlas and GrAtlasGlyphCache.

For the GrDrawOpAtlas:
  At creation time all the allowed pages are created (with their backing GrTextureProxies) but they aren't instantiated.

  The GrDrawOpAtlas::instantiate call is called in preFlushCB and allocates any pages known to be needed at the start of flush

  GrDrawOpAtlas::addToAtlas is called at flush time and, if a new page is activated, will instantiated it at that time.

  During compaction, an unused page will be deInstantiated but its Plots and backing GrTextureProxy will remain alive.

The GrAtlasGlyphCache reflects the changes to the GrDrawOpAtlas
  It now carries a GrProxyProvider for when it needs to create an atlas
  It passes in a GrResourceProvider* at flush time to allow instantiation.

  It does not, yet, allocate that GrDrawOpAtlases it might ever require.

Change-Id: I54909b7a3ba4bec2db5f1218f6a2a3a1636f66d6
Reviewed-on: https://skia-review.googlesource.com/108520
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2018-02-21 19:46:56 +00:00
Chris Dalton
535ba8d2b8 Drop unused support for MSAA sample locations
Bug: skia:
Change-Id: I96f0c25732d79c5881e400b121e81c5696a747a6
Reviewed-on: https://skia-review.googlesource.com/107441
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2018-02-20 17:19:13 +00:00