Commit Graph

31 Commits

Author SHA1 Message Date
Robert Phillips
08ba085253 Revert "De-GL-ify tests, gm and tools"
This reverts commit 89fb346d2b.

Reason for revert: Google3 failure

Original change's description:
> De-GL-ify tests, gm and tools
> 
> Change-Id: Id15a3a4b2c8b80b9dc7ecdab1cf1af1f9282f442
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215447
> Reviewed-by: Jim Van Verth <jvanverth@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

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

Change-Id: I155b033ac48d9fea15f66b22a090fb34f3bb81fa
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215521
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-05-22 20:23:56 +00:00
Robert Phillips
89fb346d2b De-GL-ify tests, gm and tools
Change-Id: Id15a3a4b2c8b80b9dc7ecdab1cf1af1f9282f442
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215447
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-05-22 19:24:17 +00:00
Ben Wagner
d1701ba884 IWYU for gms starting with 'a'.
There is still a bit of manual mucking about with iwyu output to get
things nice, but the checker seems to be doing ok and the process is now
a bit easier. Will see how it goes.

This also pointed out the amount of code behind ifdefs should be
minimized by using the build system and 'constexpr if' when possible.

Change-Id: Ic63fa33c65e5ff40b58858e15fc51f27d862e20d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/211349
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-04-30 19:39:37 +00:00
Mike Klein
c0bd9f9fe5 rewrite includes to not need so much -Ifoo
Current strategy: everything from the top

Things to look at first are the manual changes:

   - added tools/rewrite_includes.py
   - removed -Idirectives from BUILD.gn
   - various compile.sh simplifications
   - tweak tools/embed_resources.py
   - update gn/find_headers.py to write paths from the top
   - update gn/gn_to_bp.py SkUserConfig.h layout
     so that #include "include/config/SkUserConfig.h" always
     gets the header we want.

No-Presubmit: true
Change-Id: I73a4b181654e0e38d229bc456c0d0854bae3363e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209706
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Hal Canary <halcanary@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2019-04-24 16:27:11 +00:00
Mike Reed
64670cb1b8 Reland "Simplify SkTypeface::charsToGlyphs API to require UTF32 input"
This is a reland of fde841de44

Original change's description:
> Simplify SkTypeface::charsToGlyphs API to require UTF32 input
> 
> Change-Id: I486713c496c40103eef13fa6068ac4d69e32f606
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/207865
> Commit-Queue: Ben Wagner <bungeman@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

Change-Id: I5162c93b3ea6146d09334545744b791d993397b8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208679
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-04-17 17:56:39 +00:00
Robert Phillips
33906ad1e2 Reland "Revert "Simplify SkTypeface::charsToGlyphs API to require UTF32 input""
This reverts commit 652b007a4c.

Reason for revert: Potentially causing Google3 errors

Original change's description:
> Revert "Revert "Simplify SkTypeface::charsToGlyphs API to require UTF32 input""
> 
> with legacy guard for google3
> 
> Needs this to land first: https://critique.corp.google.com/#review/243924283
> 
> This reverts commit 70ed05e53a.
> 
> Change-Id: I3e821dfcdbf3004382092338ebad7cceaf40cefd
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208668
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>
> Auto-Submit: Mike Reed <reed@google.com>

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

Change-Id: Id2b3ed8a6157b5e33721b0c5168c5680bfac15b0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208669
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2019-04-17 12:03:53 +00:00
Mike Reed
652b007a4c Revert "Revert "Simplify SkTypeface::charsToGlyphs API to require UTF32 input""
with legacy guard for google3

Needs this to land first: https://critique.corp.google.com/#review/243924283

This reverts commit 70ed05e53a.

Change-Id: I3e821dfcdbf3004382092338ebad7cceaf40cefd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208668
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-04-17 03:08:40 +00:00
Mike Reed
70ed05e53a Revert "Simplify SkTypeface::charsToGlyphs API to require UTF32 input"
This reverts commit fde841de44.

Reason for revert: used in headless on google3, need to add a guard

Original change's description:
> Simplify SkTypeface::charsToGlyphs API to require UTF32 input
> 
> Change-Id: I486713c496c40103eef13fa6068ac4d69e32f606
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/207865
> Commit-Queue: Ben Wagner <bungeman@google.com>
> Reviewed-by: Ben Wagner <bungeman@google.com>

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

Change-Id: I1d28ed5c31deaa76aa3c4b627454b0ad3356a6fc
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208800
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2019-04-17 00:02:12 +00:00
Mike Reed
fde841de44 Simplify SkTypeface::charsToGlyphs API to require UTF32 input
Change-Id: I486713c496c40103eef13fa6068ac4d69e32f606
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/207865
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2019-04-16 21:34:10 +00:00
Mike Klein
16b1efb871 allow GMs to fail in DM
And mark atlastext as GPU-only, so it's skipped instead
of running and failing on non-GPU --configs.

Change-Id: I9b41873bed14e20f2e086a04f57b247994e9266e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/205347
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2019-04-02 17:46:26 +00:00
Mike Klein
ea3f014e2b sk_tool_utils -> ToolUtils, and git clang-format
sk_tool_utils doesn't really fit the naming convention
the rest of code under tools/ tends to use.

Change-Id: I45326a174101c6eb4b6149e9c742f658f2fd23b1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/202313
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-03-20 18:05:42 +00:00
Chris Dalton
50e24d7d5f Add a mechanism for GMs to silently exclude themselves from Gold
This is useful, for example, when trying to test a hardware feature
that isn't supported in the current context.

Bug: skia:8731
Change-Id: I9a363159300c92e4039bfd05400238c27002efb1
Reviewed-on: https://skia-review.googlesource.com/c/189133
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-02-08 00:05:15 +00:00
Chris Dalton
d7a5a1d27e Add a central skiagm::GM::DrawFailureMessage for error messages
Bug: skia:8731
Change-Id: If73216bd427a1ce773fa41044a45c1bbd7ea08e9
Reviewed-on: https://skia-review.googlesource.com/c/189124
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
2019-02-04 17:49:42 +00:00
Mike Reed
94cca60bfa start to use font for measure, not paint
-- lots more where this came from

Bug: skia:2664
Change-Id: I8bb47f02c156b0b88fbb92fec73af0eb6641b1bf
Reviewed-on: https://skia-review.googlesource.com/c/173769
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2018-12-02 21:31:36 +00:00
Hal Canary
ea60b951d7 IWYU: SkUtils.h
Change-Id: Ieac05047826b1fb80950d65573d38494a1a5c5e7
Reviewed-on: https://skia-review.googlesource.com/148383
Commit-Queue: Hal Canary <halcanary@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-08-21 16:05:44 +00:00
Hal Canary
f107a2fd01 SkUTF
Create new header and namespace, `SkUTF` where we are putting all of our
robust, well documented UTF-8, UTF-16, and UTF-32 functions:
`SkUTF::{Count,Next,To}UTF{8,16,32}()`.

SkUTF.h and SkUTF.cpp do not depend on the rest of Skia and are suitable
for re-use in other modules.

Some of the old UTF-{8,16} functions still live in SkUtils.h; their use
will be phased out in future CLs.

Also added more unit testing and cleaned up old tests.

Removed functions that were unused outside of tests or used only once.

Change-Id: Iaa59b8705abccf9c4ba082f855da368a0bad8380
Reviewed-on: https://skia-review.googlesource.com/143306
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-07-31 20:11:19 +00:00
Hal Canary
4014ba6ec7 SkUtils: remove some versions of UTF routines.
Change-Id: Ib1f776ae472117c23d2145253adf25fceb412b32
Reviewed-on: https://skia-review.googlesource.com/143111
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-07-25 17:21:56 +00:00
Robert Phillips
c994a93b32 Move op memory storage to GrContext (take 2)
TBR=bsalomon@google.com

Change-Id: I4a448694d4114d83cd3a720cfc8bd37de51733d1
Reviewed-on: https://skia-review.googlesource.com/135707
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-06-19 19:51:20 +00:00
Robert Phillips
4f6ba2e522 Revert "Move op memory storage to GrContext"
This reverts commit c8cee446bf.

Reason for revert: TSAN issues

Original change's description:
> Move op memory storage to GrContext
> 
> TBR=bsalomon@google.com
> Change-Id: Ifa95bf0073b9d948f2c937d10088b7734b971f90
> Reviewed-on: https://skia-review.googlesource.com/131500
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Robert Phillips <robertphillips@google.com>

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

Change-Id: Ia0d2b7408314d9b67d57388315376bbea23d3780
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/135181
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-06-15 15:59:45 +00:00
Robert Phillips
c8cee446bf Move op memory storage to GrContext
TBR=bsalomon@google.com
Change-Id: Ifa95bf0073b9d948f2c937d10088b7734b971f90
Reviewed-on: https://skia-review.googlesource.com/131500
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-06-15 11:33:14 +00:00
Robert Phillips
a3f70261cc Switch MDB GrContextOptions over to Enable style
Change-Id: Id6541c346a13649c89ca3b9ccb13972976f9b973
Reviewed-on: https://skia-review.googlesource.com/105603
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-02-08 16:28:30 +00:00
Robert Phillips
8e546043c6 Revert "Re-enable explicit resource allocation in Skia (take 2)"
This reverts commit ed858ec095.

Reason for revert: Breaking some text GMs

Original change's description:
> Re-enable explicit resource allocation in Skia (take 2)
> 
> Unsurprisingly, given how we're adding them to the opList's deferredProxy list, a proxy can appear twice.
> 
> Change-Id: I474357a1c3ee8cedf51dbeffcd0e0a96f396375c
> Reviewed-on: https://skia-review.googlesource.com/103701
> 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: I90aa30c37bfc506e5a8e4c2ccf3bd1b968fd9c5f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/105100
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2018-02-07 16:02:50 +00:00
Robert Phillips
ed858ec095 Re-enable explicit resource allocation in Skia (take 2)
Unsurprisingly, given how we're adding them to the opList's deferredProxy list, a proxy can appear twice.

Change-Id: I474357a1c3ee8cedf51dbeffcd0e0a96f396375c
Reviewed-on: https://skia-review.googlesource.com/103701
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-02-07 14:22:58 +00:00
Brian Salomon
b5086961f3 Add matrix stack to SkAtlasTextTarget.
Makes SkAtlasTextRenderer::SDFVertex now has a 3 component position vector.

Change-Id: I7ec1a8068fb84388a82e1748d6e9d02820d55abd
Reviewed-on: https://skia-review.googlesource.com/84202
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
2017-12-20 14:00:44 +00:00
Brian Salomon
cf1aa5327e Fix SkInternalAtlasTextContext to update advance the flush token after issuing each draw.
This was causing SkAtlasTextTarget:flush() calls beyond the first to skip the uploads of glyphs added to the atlas after the first flush().

Change-Id: I291b88d50629e38914d4b6af21fc25d8a41fbd9d
Reviewed-on: https://skia-review.googlesource.com/77584
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-11-30 15:37:57 +00:00
Brian Salomon
a0ba714ad5 Require glyph positions in SkAtlasTextTarget::drawText
Change-Id: Idf0977befc8ed4fd9eb3b733db5e945457b2164c
Reviewed-on: https://skia-review.googlesource.com/73701
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-11-20 19:43:18 +00:00
Brian Salomon
0c1c2b39dd Make SkAtlasTextTarget use glyph IDs
Bug: skia:
Change-Id: Idefd69f02f62fea22c41a3476676773221c3ae81
Reviewed-on: https://skia-review.googlesource.com/73700
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-11-20 18:33:38 +00:00
Brian Salomon
40dc8a71f5 Add clear function to TestAtlasTextRendering interface
Bug: skia:
Change-Id: I24563abe5e72e57e6764ddf6aca76ccf098cc488
Reviewed-on: https://skia-review.googlesource.com/73640
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-11-20 17:59:48 +00:00
Brian Salomon
cbcb0a12ad Revert "Revert "Add Atlas Text interface for rendering SDF glyphs.""
This reverts commit 9c2202ffc2.

Bug: skia:
Change-Id: I482ddf74f8e40d3d0908c840ba5c6ff981ccefbd
Reviewed-on: https://skia-review.googlesource.com/73345
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2017-11-19 18:55:18 +00:00
Greg Daniel
9c2202ffc2 Revert "Add Atlas Text interface for rendering SDF glyphs."
This reverts commit 39631f3df1.

Reason for revert: break google3 rool

Original change's description:
> Add Atlas Text interface for rendering SDF glyphs.
> 
> This new API is built upon SDF text atlas code from the GPU backend. Unlike using the GPU
> backend to draw text, this set of interfaces allows the client to render the SDF glyphs. The
> client issues text draws to potentially multiple targets and then the client flushes. The
> client then gets commands from Skia with data to put into a texture atlas and vertices to
> draw that reference the texture. The client is responsible for creating the texture, uploading
> the SDF data to the texture, and drawing the vertices provided by Skia.
> 
> Change-Id: Ie9447e19b85f0ce1c2b942e5216c787a74f335d3
> Reviewed-on: https://skia-review.googlesource.com/59360
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

Change-Id: I4aad0c99e645b476fd8ba25731f2a10e8802bb25
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/73420
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
2017-11-18 13:32:08 +00:00
Brian Salomon
39631f3df1 Add Atlas Text interface for rendering SDF glyphs.
This new API is built upon SDF text atlas code from the GPU backend. Unlike using the GPU
backend to draw text, this set of interfaces allows the client to render the SDF glyphs. The
client issues text draws to potentially multiple targets and then the client flushes. The
client then gets commands from Skia with data to put into a texture atlas and vertices to
draw that reference the texture. The client is responsible for creating the texture, uploading
the SDF data to the texture, and drawing the vertices provided by Skia.

Change-Id: Ie9447e19b85f0ce1c2b942e5216c787a74f335d3
Reviewed-on: https://skia-review.googlesource.com/59360
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2017-11-17 20:35:06 +00:00