Commit Graph

28 Commits

Author SHA1 Message Date
John Stiles
4498aa8ac7 Fix rewrite_includes to work in both Python 2 and 3.
This is patterned after http://review.skia.org/439776, but uses the
`six` library for Python 2/3 cross-compatibility.

Change-Id: If64c48c35d86b83c77316bb5536be6e7bd24c967
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/439936
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
2021-08-17 11:53:50 +00:00
Brian Osman
9ded59bbad Revert "Update rewrite_includes.py for python3"
This reverts commit bd40fb55bb.

Reason for revert: I give up.

Original change's description:
> Update rewrite_includes.py for python3
>
> Change-Id: Ib1b6f8c17554f8121bd2351b5b214e1b2a79f758
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/439776
> Reviewed-by: Kevin Lubick <kjlubick@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

TBR=kjlubick@google.com,brianosman@google.com,skcq-be@skia-corp.google.com.iam.gserviceaccount.com

Change-Id: I6be08249f805cce00d35e28e457fe5628b447629
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/439940
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-08-16 21:31:04 +00:00
Brian Osman
bd40fb55bb Update rewrite_includes.py for python3
Change-Id: Ib1b6f8c17554f8121bd2351b5b214e1b2a79f758
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/439776
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-08-16 19:07:20 +00:00
Brian Osman
8c26479048 Remove large swaths of code related to .fp files
Change-Id: Id2061ebe7873aa8b9480a2d8b0133c2fb79e79bb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/424098
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-07-08 16:53:47 +00:00
John Stiles
f35853a4a2 Clarify output from rewrite_includes assertion.
Previously, the conflicting header names were printed between several
lines of "boilerplate" text, and without any explanatory text. This
made them difficult to notice. The assertion now has an explanatory
message and prints the conflicting filenames directly at the point of
the assertion.

Before:
---
Running presubmit upload checks ...
tests/sksl/dslfp GrSwizzle.h /Users/johnstiles/skia/src/gpu/GrSwizzle.h
Traceback (most recent call last):
  File "tools/rewrite_includes.py", line 60, in <module>
    assert file_name not in headers
AssertionError

** Presubmit ERRORS ** (etc)
username$ _

After:
---
Running presubmit upload checks ...
Traceback (most recent call last):
  File "tools/rewrite_includes.py", line 61, in <module>
    assert file_name not in headers, message
AssertionError: Header filename is used more than once!
- tests/sksl/dslfp/GrSwizzle.h
- /Users/johnstiles/skia/src/gpu/GrSwizzle.h

** Presubmit ERRORS ** (etc)
username$ _

Change-Id: I2b6848ef82c4b1c6d4b5577a76969785e5e122bb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/397149
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
2021-04-15 19:44:32 +00:00
Eric Boren
a1db799824 Fix Python3 compatibility
Bug: skia:11768
Change-Id: I6107362457dce380e3fb1647ad58d8e33e453e2d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/388743
Commit-Queue: Eric Boren <borenet@google.com>
Reviewed-by: Ravi Mistry <rmistry@google.com>
2021-03-25 14:15:35 +00:00
Florin Malita
a5e8f6b402 [svg] Post-relocation cleanup
Remove transitional headers and build file workarounds.

Change-Id: Iebe63d44b6ae3a736c7b31a45975056ec92b91cd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327716
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Tyler Denniston <tdenniston@google.com>
2020-10-18 19:29:38 +00:00
Florin Malita
b3418103e9 Reland "[svg] Relocate out of experimental"
Move the SVG rendering code to modules/svg, and componentize.
Also split into include/src/utils.

As external clients still reference the old header locations,
introduce temporary forwarding headers to facilitate the migration.

This reverts commit d6cf56fd34.

TBR=

Change-Id: Ibadd7c8dc0464ec0c27841530ade0c2098305d20
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327344
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
2020-10-16 02:32:41 +00:00
Robert Phillips
d6cf56fd34 Revert "[svg] Relocate out of experimental"
This reverts commit 6fc4106a9d.

Reason for revert: Blocking the Android roll

Original change's description:
> [svg] Relocate out of experimental
>
> Move the SVG rendering code to modules/svg, and componentize.
> Also split into include/src/utils.
>
> As external clients still reference the old header locations,
> introduce temporary forwarding headers to facilitate the migration.
>
> Change-Id: Ib289dbdcd80c16a01c47805e7242f2e08bebc165
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326948
> Reviewed-by: Tyler Denniston <tdenniston@google.com>
> Commit-Queue: Florin Malita <fmalita@google.com>

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

Change-Id: I386cf77a15a9e1d392029804abaf937dae53f435
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327342
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-10-15 18:54:18 +00:00
Florin Malita
6fc4106a9d [svg] Relocate out of experimental
Move the SVG rendering code to modules/svg, and componentize.
Also split into include/src/utils.

As external clients still reference the old header locations,
introduce temporary forwarding headers to facilitate the migration.

Change-Id: Ib289dbdcd80c16a01c47805e7242f2e08bebc165
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326948
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
2020-10-15 14:36:06 +00:00
John Stiles
d836f84ab8 Generate SkSL golden output files from test inputs during the build.
Golden SkSL outputs are intended to eventually replace the majority of
our unit tests, since they can automatically update themselves when we
change implementation details of the compiler.

If you change the compiler output without updating the Golden files, the
CheckGeneratedFiles housekeeper will be triggered. Set
`skia_compile_processors` or `skia_compile_sksl_tests` to true in your
GN args to regenerate them.

Almost all of the tests from SkSLFPTests.cpp and SkSLGLSLTests.cpp can
be migrated into separate unit-test .fp/.sksl files in a followup CL.

hcm@ has signed off on removing the copyright boilerplate preamble from
our unit test files.

Change-Id: I9e24a944bbac8f8efd62c92481b022a0b1ecdd0b
Bug: skia:10694
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/316336
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2020-09-14 14:54:12 +00:00
Mike Klein
a121fb6860 renable SkM44.h checks
Change-Id: Id133cb4c97931fb6a8c7d1d6d6b0bb09cbd47d85
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273486
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2020-02-26 14:54:55 +00:00
Mike Reed
7f5e3c7e43 Reland "Skip rewriting headers that reference SkM44.h until we can remove the private copy of it"
This reverts commit 1eff9dce5b.

Reason for revert: breaks housekeeper -- don't know why

Original change's description:
> Revert "Skip rewriting headers that reference SkM44.h until we can remove the private copy of it"
> 
> This reverts commit 09a73000ea.
> 
> include/private/SkM44.h is gone, so we can undo this hack
> 
> Change-Id: I770063c8468ad7f4c51fa41ca407e4655c90c15f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273457
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>

TBR=reed@google.com

Change-Id: I9ce1d7ca55f5464b3ece16cd0d7060e4d402960e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273409
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-02-26 06:03:14 +00:00
Mike Reed
1eff9dce5b Revert "Skip rewriting headers that reference SkM44.h until we can remove the private copy of it"
This reverts commit 09a73000ea.

include/private/SkM44.h is gone, so we can undo this hack

Change-Id: I770063c8468ad7f4c51fa41ca407e4655c90c15f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273457
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-02-26 05:36:56 +00:00
Julia Lavrova
9b906ce536 Revert "remove private copy of SkM44.h"
This reverts commit f8ef81b35e.

Reason for revert: Build broken

Original change's description:
> remove private copy of SkM44.h
> 
> Change-Id: Ifd47b929bafd40d190722366a0c1e2b856220ab3
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272836
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Commit-Queue: Mike Reed <reed@google.com>

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

Change-Id: I0da4ad43d5eaf5813ec489bc9117d4b8fc2b930e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273330
Reviewed-by: Julia Lavrova <jlavrova@google.com>
Commit-Queue: Julia Lavrova <jlavrova@google.com>
2020-02-25 23:00:54 +00:00
Mike Reed
f8ef81b35e remove private copy of SkM44.h
Change-Id: Ifd47b929bafd40d190722366a0c1e2b856220ab3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272836
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2020-02-25 19:51:17 +00:00
Mike Reed
09a73000ea Skip rewriting headers that reference SkM44.h until we can remove the private copy of it
Change-Id: I4c390fa4e2eae71203c688433569a7afb5e02642
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272535
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-02-21 17:04:37 +00:00
Hal Canary
389c8e9d2d [minor] mark scripts as executable
if a filename ends with `.py` and  the file begins with '#!.*python.*',
make it executable.

Change-Id: I41de516ff37343d3b0979bde9fd61813aec7365c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/254439
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>
2019-11-21 17:06:27 +00:00
Kevin Lubick
87fe9b0395 Tell rewrite_includes to ignore node_modules
Change-Id: Ibd82b52d15f9de7fbbd4a5a91d7be8310f6568d5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/249135
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Kevin Lubick <kjlubick@google.com>
2019-10-17 19:44:49 +00:00
skia-autoroll
fe16a33005 Roll skia/third_party/skcms d931999c3afd..6655095842ec (1 commits)
Also whitelist third_party/skcms from #include rewrites.

https://skia.googlesource.com/skcms.git/+log/d931999c3afd..6655095842ec

git log d931999c3afd..6655095842ec --date=short --no-merges --format='%ad %ae %s'
2019-08-20 mtklein@google.com Add missing b-tweak to skcms_TF_Invert()

Created with:
  gclient setdep -r skia/third_party/skcms@6655095842ec

The AutoRoll server is located here: https://autoroll.skia.org/r/skcms-skia-autoroll

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md

If the roll is causing failures, please contact the current sheriff, who should
be CC'd on the roll, and stop the roller if necessary.

CQ_INCLUDE_TRYBOTS=luci.chromium.try:linux-blink-rel

Bug: chromium:976551
Change-Id: I6566968525070f0af808d04211b16e71f9850cea
TBR=egdaniel@google.com,mtklein@google.com
TBR=egdaniel@google.com,mtklein@google.com

Change-Id: I2c9b6a270693e9e93303b9cfef1262488bba1aae
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/235936
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-08-20 20:57:15 +00:00
Hal Canary
4df3d5340e rewrite_includes.py: make it work on windows
Also:
    Revert "don't try to format includes on windows"
    This reverts commit e68b5bd4e6.

Change-Id: I93dc4dba4808c07882e977ac0693c93e282bbad5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230878
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-08-05 16:14:35 +00:00
Mike Klein
140a4767f0 make presubmit failures clearer
A presubmit failure will now print something like

~/skia (reed↑2|…) $ git cl presubmit
Running presubmit commit checks ...
Some files need rewritten #includes:
	src/core/SkBitmapCache.cpp
	src/core/SkBitmapController.cpp
	tests/SkResourceCacheTest.cpp
To do this automatically, run
python tools/rewrite_includes.py src/core/SkBitmapCache.cpp src/core/SkBitmapController.cpp tests/SkResourceCacheTest.cpp

** Presubmit ERRORS **
`python tools/rewrite_includes.py --dry-run gn/core.gni src/core/SkBitmapCache.cpp src/core/SkBitmapCache.h src/core/SkBitmapController.cpp src/core/SkBitmapController.h src/core/SkBitmapProcState.cpp src/core/SkBitmapProcState.h src/shaders/SkBitmapProcShader.cpp src/shaders/SkBitmapProcShader.h src/shaders/SkImageShader.cpp tests/SkResourceCacheTest.cpp tools/rewrite_includes.py` failed

Change-Id: I84018a6e102efa8b477a2523f6b0fc927a674e1a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/231676
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-08-01 20:49:11 +00:00
Mike Klein
bb413430e4 add a fast subset option and --dry-run
You can now pass files to rewrite, still defaulting
to all sources.  This speeds things up and is nice
for a Git or PRESUBMIT hook, added here too.

Passing --dry-run or -n will just check that the
files we would have written is the same, printing
the names of any mismatches and failing if any.

Cq-Include-Trybots: skia.primary:Housekeeper-PerCommit-CheckGeneratedFiles
Tricium: no
Change-Id: I94218f49071b8634841b04e4b536ad1ae5d9d5fd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/230143
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
2019-07-26 18:32:43 +00:00
Mike Klein
66ed6a0cad tweak how we avoid rewriting vulkan includes
This may be splitting hairs, but it occurred to me that this
might be a clearer way of expressing what we're trying to do,
avoiding treating include/third_party/vulkan as our own.

Change-Id: I2bb3c2da5b2294cc219d3a3745a6b52dd09ec21d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229801
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2019-07-26 16:18:32 +00:00
Mike Klein
52337de95c re-run tools/rewrite_includes.py
PS2 adds a rewrite for Skia #include <...> to #include "...", letting
them be otherwise rewritten and sorted too.  (We do need one exception
for the Vulkan headers, which will otherwise be rewritten to always
point to our own.)  I don't think it's particularly important to
favor "" or <>, but picking one keeps things consistent.

PS3 adds a missing SkMutex.h include.

PS4 fixes a terrible readability problem.

Change-Id: Id9fe752727ef30e802b1daf755ee2ed15e267577
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229742
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-07-25 15:40:33 +00:00
Mike Klein
ad44dd500f preserve comments past the #include ""
Tacking on parts[2] lets us keep things like IWYU comments

    #include "something.h" // IWYU pragma: keep

Rerun the script too... not much interesting.

Change-Id: I9f02c81ffece0ecf3e99730d4a12d49e01417ddc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/213697
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-05-14 19:35:34 +00:00
Mike Klein
e11e5c162f AFAICT, only gm/etc1 uses third_party/etc1
The need for -Ithird_party/gif has already been
rewritten away, and we can do the same for etc1.

Change-Id: I97408652682b5ec406647108056e7a1ea6a56c29
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/210131
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2019-04-24 18:57:58 +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