Commit Graph

110 Commits

Author SHA1 Message Date
Herb Derby
5623d9e36f Replace SK_ARRAY_COUNT with std::size() for skia/docs
Change-Id: I9569ba4760546be6302c24658e64cb58c7db86e5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/550697
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Herb Derby <herb@google.com>
2022-06-16 20:09:58 +00:00
Brian Osman
a7a2324f14 Reland "Add kR8_unorm_SkColorType"
This is a reland of 3225c8cc46

Original change's description:
> Add kR8_unorm_SkColorType
>
> Change-Id: I97b5bc7f90715664f233ca7b7c41c0ecbfc29ac4
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/505679
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

Change-Id: I73fa17625d57e0e58da1b70e2e59ba200383cfe7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506460
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-02-10 18:00:19 +00:00
Brian Osman
0c7f1d9919 Revert "Add kR8_unorm_SkColorType"
This reverts commit 3225c8cc46.

Reason for revert: Client code needs to handle the new enum value.

Original change's description:
> Add kR8_unorm_SkColorType
>
> Change-Id: I97b5bc7f90715664f233ca7b7c41c0ecbfc29ac4
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/505679
> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>

Change-Id: I1174f533600827e29131198c10c243d9cf1300ae
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/506457
Auto-Submit: Brian Osman <brianosman@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2022-02-09 18:46:11 +00:00
Brian Osman
3225c8cc46 Add kR8_unorm_SkColorType
Change-Id: I97b5bc7f90715664f233ca7b7c41c0ecbfc29ac4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/505679
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2022-02-09 17:02:57 +00:00
John Stiles
3e6e29cf2e Convert 0 and NULL to nullptr.
The goal was to enable -Wzero-as-null-pointer-constant. Unfortunately,
this was thwarted by VK_NULL_HANDLE which is defined as 0ULL in the
Vulkan headers. It might be possible to enable the warning for a subset
of Skia, but not for the parts which interface with Vulkan.

Change-Id: Id27f5f57d9b2676d18f319f443fdf8bb5d4fb89d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/505801
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2022-02-09 14:20:57 +00:00
Kevin Lubick
f9c68800a2 Use angle brackets for system includes
Not only is this a best practice, it will make generating
BAZEL.build files easier.

Change-Id: Ib77c7dac6167235ec1b73a93bfd3a9c44b42ca83
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/474756
Reviewed-by: Ben Wagner <bungeman@google.com>
2021-11-22 17:03:11 +00:00
Brian Salomon
90ef83af20 Remove drawPatch/Vertices helpers that don't take SkBlendMode
Bug: skia:12662
Change-Id: Ic18220668a4f87e7340a53b3f191887a7a016a04
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/473141
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
2021-11-18 21:57:32 +00:00
Brian Osman
9f1e06aef9 Reland "Add sRGB 8888 colortype"
This is a reland of 0f7c10ef56

Original change's description:
> Add sRGB 8888 colortype
>
> A color type that linearizes just after loading, and re-encodes to sRGB
> just before storing, mimicking the GPU formats that work the same way.
>
> Notes:
>   - No mipmap support
>   - No SkPngEncoder support (HashAndEncode's .pngs are ok, though?)
>   - Needs better testing
>
> This is a re-creation of reviews.skia.org/392990
>
> Change-Id: I4739c2280211e7176aae98ba0a8476a7fe5efa72
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438219
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

Change-Id: I5b6bb28c4c1faa6c97fcad7552d12c331535714d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/441402
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-08-24 12:56:32 +00:00
Brian Osman
405eb7b72f Revert "Add sRGB 8888 colortype"
This reverts commit 0f7c10ef56.

Reason for revert: Unhappy rollers

Original change's description:
> Add sRGB 8888 colortype
>
> A color type that linearizes just after loading, and re-encodes to sRGB
> just before storing, mimicking the GPU formats that work the same way.
>
> Notes:
>   - No mipmap support
>   - No SkPngEncoder support (HashAndEncode's .pngs are ok, though?)
>   - Needs better testing
>
> This is a re-creation of reviews.skia.org/392990
>
> Change-Id: I4739c2280211e7176aae98ba0a8476a7fe5efa72
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438219
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>

TBR=bsalomon@google.com,robertphillips@google.com,brianosman@google.com,reed@google.com,skcq-be@skia-corp.google.com.iam.gserviceaccount.com

Change-Id: Ie199535b9b65ec7c7fef3c773452ea06bdbd2d9c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/441376
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
2021-08-23 17:38:05 +00:00
Brian Osman
0f7c10ef56 Add sRGB 8888 colortype
A color type that linearizes just after loading, and re-encodes to sRGB
just before storing, mimicking the GPU formats that work the same way.

Notes:
  - No mipmap support
  - No SkPngEncoder support (HashAndEncode's .pngs are ok, though?)
  - Needs better testing

This is a re-creation of reviews.skia.org/392990

Change-Id: I4739c2280211e7176aae98ba0a8476a7fe5efa72
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438219
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2021-08-23 15:14:41 +00:00
John Stiles
488654b839 Fix cases of variable shadowing in /tools/.
If we manage to fix all the existing cases of variable shadowing, we
could enable -Wshadow.

(Turtle.cpp is #included from a cpp in the tools directory.)

Change-Id: I1685086ec0ceae1d51efa7daa0f46137b535ce77
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/438476
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-08-11 16:05:52 +00:00
Mike Reed
90f4e9f5f7 Hide getBlendMode()
... since it mysteriously returns something even if the blender doesn't
map to any enum. Clients should use asBlendMode() or getBlendMode_or().

Change-Id: I5dc5aea51f47f297ef9b2a89535d47ac58aea9bd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/425177
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-07-07 20:55:26 +00:00
Kevin Lubick
2d1b7165a4 [fiddle] Update named fiddles
//tools/fiddle/make_all_examples_cpp.py had not run in a while, so
some of these fiddles were not being compiled regularly and bit-rotted.

A follow-up CL will try running that script as a presubmit.

Change-Id: Ib851cb5d70485e354de3388abf56666492335d46
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/423956
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-07-01 15:20:14 +00:00
John Stiles
7bf799956d Reland "Add format-specifier warnings to SkDebugf."
This is a reland of e58831cd95

Original change's description:
> Add format-specifier warnings to SkDebugf.
>
> This CL fixes up many existing format-specifier violations in Skia.
> Note that GCC has a warning for formatting nothing, so existing calls to
> `SkDebugf("")` have been removed, or replaced with `SkDebugf("%s", "")`.
> These were apparently meant to be used as a place to set a breakpoint.
>
> Some of our clients also use SkDebug with bad format specifiers, so this
> check is currently only enabled when SKIA_IMPLEMENTATION is true.
>
> Change-Id: I8177a1298a624c6936adc24e0d8f481362a356d0
> Bug: skia:12143
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/420902
> Auto-Submit: John Stiles <johnstiles@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

Bug: skia:12143
Change-Id: Id3c0c21436ebd13899908d5ed5d44c42a0e23921
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/421918
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-06-25 17:57:43 +00:00
Tyler Denniston
283dba5785 Revert "Add format-specifier warnings to SkDebugf."
This reverts commit e58831cd95.

Reason for revert: looks like breaking a few build bots

Original change's description:
> Add format-specifier warnings to SkDebugf.
>
> This CL fixes up many existing format-specifier violations in Skia.
> Note that GCC has a warning for formatting nothing, so existing calls to
> `SkDebugf("")` have been removed, or replaced with `SkDebugf("%s", "")`.
> These were apparently meant to be used as a place to set a breakpoint.
>
> Some of our clients also use SkDebug with bad format specifiers, so this
> check is currently only enabled when SKIA_IMPLEMENTATION is true.
>
> Change-Id: I8177a1298a624c6936adc24e0d8f481362a356d0
> Bug: skia:12143
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/420902
> Auto-Submit: John Stiles <johnstiles@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>

TBR=brianosman@google.com,ethannicholas@google.com,johnstiles@google.com

Change-Id: I07848c1bf8992925c9498e916744d0840355a077
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:12143
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/421917
Reviewed-by: Tyler Denniston <tdenniston@google.com>
Commit-Queue: Tyler Denniston <tdenniston@google.com>
2021-06-25 13:33:10 +00:00
John Stiles
e58831cd95 Add format-specifier warnings to SkDebugf.
This CL fixes up many existing format-specifier violations in Skia.
Note that GCC has a warning for formatting nothing, so existing calls to
`SkDebugf("")` have been removed, or replaced with `SkDebugf("%s", "")`.
These were apparently meant to be used as a place to set a breakpoint.

Some of our clients also use SkDebug with bad format specifiers, so this
check is currently only enabled when SKIA_IMPLEMENTATION is true.

Change-Id: I8177a1298a624c6936adc24e0d8f481362a356d0
Bug: skia:12143
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/420902
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
2021-06-25 11:05:59 +00:00
Brian Osman
cc2d073020 Remove SkPaint::getHash
This was a particularly bad hash (A == B didn't imply
hash(A) == hash(B)). It was also entirely unused.

Change-Id: Id923bf1035effce04e12b1cc01d1c6aa4d11fdb6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/419336
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2021-06-17 14:59:23 +00:00
Mike Reed
10a5ff2cac Must pass filtering to picture shader
Change-Id: I820867df80daa1594d6202cad5e8e95c060293fe
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/386838
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2021-03-18 22:18:47 +00:00
Mike Reed
9223665316 Guard legacy matrixtransforms, and expose new one
Bug: skia:11236
Bug: skia:11235
Change-Id: I53fc0532a6067c5b30fc0345ded95d50d9955d38
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/363098
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
2021-02-01 22:10:39 +00:00
Mike Reed
b339d051e0 pass sampling to drawImage
Bug: skia:7650
Change-Id: I0fa4c5f3fb350705f78ee91f4bdfb4edd83d0ed9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/361360
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-01-28 17:56:52 +00:00
Mike Reed
ecdd979bc0 drawBitmap is deprecated
Bug: skia:11216
Change-Id: I4affb8e00ff7e7b3e8d873ddfd653f397ca8d928
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/360979
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-01-28 02:44:21 +00:00
Michael Ludwig
ed552f8702 Move deprecated image filter headers out of include/ and into src/
Bug: skia:9310
Change-Id: I387f0251f05a2b6f2bc5a759f608d5766ed11ce2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/357285
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Mike Reed <reed@google.com>
2021-01-28 00:41:21 +00:00
Mike Reed
e1f72f9392 drawBitmap is deprecated
Bug: skia:11216
Change-Id: I15f7723e70cb6b252bf313530fd6d783a7635a00
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/360777
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-01-27 23:18:21 +00:00
Mike Reed
34a0c97f5e don't use drawBitmap
Bug: skia:11216
Change-Id: I89a40e330f27f30c461f2b6012bf26c082b66094
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/359076
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-01-26 02:24:21 +00:00
Mike Reed
9911630fc2 Hide misc non-sampling draw methods
Related chrome CL:
https://chromium-review.googlesource.com/c/chromium/src/+/2646604

Bug: skia:7650
Change-Id: I1069a6151cb70bb6d2c743cf2513f47284c9df7b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/358221
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2021-01-25 17:54:56 +00:00
Mike Reed
2ac6ce8e6e Simplify common case for recttorect
Change-Id: I70e295a677b8cac3d578e3cd57472c833af03877
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354336
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2021-01-15 18:37:46 +00:00
Mike Reed
5ec22387ff Simplify common case of linear filtering with no mips
Change-Id: I08b4a7bc088705b93a0aa680f6733d09c7ad23dd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/354221
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-01-15 16:47:16 +00:00
Mike Reed
b746b1f598 Pass sampling to surface.draw
Bug: skia:7650
Change-Id: I97941a44faa4176f94d57a9c1626ac36b0c0c4ea
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/350557
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2021-01-06 19:05:00 +00:00
Mike Reed
dc607e35e1 Use bitmap.asImage()
Change-Id: Ie16194937530d7cd75f84d9af66c31b77875ef83
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/347043
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-12-23 17:41:47 +00:00
Mike Reed
b41bd15a4b Use samplingoptions for bitmap shader
Change-Id: I64c67ddcac29b68cdd0d25e4af4153358939b0ee
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/343736
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-12-12 17:08:11 +00:00
Mike Reed
b86cd3d3f0 Use samplingoptions in imageshader
Change-Id: I7d94fe7aed702afd0626a40db201caaf7c2a7764
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342927
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2020-12-10 21:59:19 +00:00
Mike Reed
410681932a Use explicit sampling param
Change-Id: Ifcb074365da8113fd5e0186d4afcf41041862e82
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342761
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-12-10 14:01:58 +00:00
Mike Reed
edb22ec498 work on better SkPath::dump
ForceClose is a pain, and already removed from some
(hopefully all at some point) of our iterators

Follow-on plan: use raw iter, and output code compatible with
SkPath::Make()

Change-Id: Icda4ad2e605eb2fb9842dd35b5e0d4a0939e62eb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/341237
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-12-06 19:47:31 +00:00
Mike Reed
1a4140e598 deprecate getTotalMatrix
Change-Id: Iec7d67f4ec3fdf4d5280f3de3d6146a69a60c646
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/339995
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-12-03 17:37:35 +00:00
Mike Reed
ce0c876ce2 hide legacy scalePixels and makeShader
Change-Id: Idae1e44aa0417adb943fd20112fb4f1fa81167f2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337719
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
2020-11-24 00:41:33 +00:00
Mike Reed
6052c0bee0 Only expose isConvex on path publicly.
Subsequent CLs can work on combining convexity and direction

Bug: skia:10670
Change-Id: Ia44769ea88ffd99a56d4c6729a80a2044e790ec2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/313837
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
2020-08-28 16:56:29 +00:00
Adlai Holler
bcfc554fde Add GrDirectContext arg to SkImage::readPixels
Note: The polarity of the staging flag is inverted from usual because
a G3 dependency with no SkUserConfig.h relies on the legacy API.

Once this lands, we will migrate them and others, then remove the
staging API. The inverted staging flag is kind of nice, actually - I may
use that pattern in the future. It means less total CLs and it's just as
easy to flip the bit on or off during debugging.

Bug: skia:104662
Change-Id: I48cba1eeae3e2e6f79918c6d243e0666e68ec71b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310656
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2020-08-27 19:26:29 +00:00
Robert Phillips
3b356c5696 Update more example code to GrDirectContext/GrRecordingContext pair
Change-Id: Ic12b8292a09be097e99d2dc912d6d5188e645fbd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/307299
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
2020-08-13 19:30:12 +00:00
Adlai Holler
14dc791bc4 Reland "Migrate SkImage::MakeFromTexture to GrRecordingContext"
This reverts commit 74b83a4ea9.

Reason for revert: Flutter is updated

Original change's description:
> Revert "Migrate SkImage::MakeFromTexture to GrRecordingContext"
> 
> This reverts commit daa9e7455d.
> 
> Reason for revert: Broke Build-Debian9-Clang-arm-Release-Flutter_Android_Docker
> 
> Original change's description:
> > Migrate SkImage::MakeFromTexture to GrRecordingContext
> > 
> > Android migration landed in Android CL 12234077
> > Chrome migration is landing in Chrome CL 2335812
> > 
> > Note: makeFromCompressedTexture is not used by Chrome.
> > 
> > Bug: skia:104662
> > Change-Id: Ibbe6d412cf22e87188926383d10b21f780208e48
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305102
> > Commit-Queue: Adlai Holler <adlai@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Auto-Submit: Adlai Holler <adlai@google.com>
> 
> TBR=bsalomon@google.com,robertphillips@google.com,adlai@google.com
> 
> Change-Id: I570945521c6cd78dfeea81e492b7e2b31dd0e6f5
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:104662
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308505
> Reviewed-by: Adlai Holler <adlai@google.com>
> Commit-Queue: Adlai Holler <adlai@google.com>

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

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

Bug: skia:104662
Change-Id: Ie1d7fd9e597e6e6e5bd91bec086e83a8c1f45a37
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309321
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
2020-08-12 18:35:51 +00:00
Adlai Holler
c41ae2a3cf Reland "Migrate MakeCrossContextFromPixmap to GrDirectContext"
This reverts commit ae04cc9099.

Reason for revert: Flutter g3 roll complete

Original change's description:
> Revert "Migrate MakeCrossContextFromPixmap to GrDirectContext"
> 
> This reverts commit 066f7d6b1a.
> 
> Reason for revert: Cant land until flutter PR 20235 reaches g3
> 
> Original change's description:
> > Migrate MakeCrossContextFromPixmap to GrDirectContext
> > 
> > This function isn't used by Chrome so we migrate directly.
> > Flutter migration is at https://github.com/flutter/engine/pull/20235
> > 
> > Bug: skia:104662
> > Change-Id: I9d875acdbd162f50a6d86b3a4cae3f400e4dd38f
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305180
> > Commit-Queue: Adlai Holler <adlai@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> 
> TBR=bsalomon@google.com,robertphillips@google.com,adlai@google.com
> 
> Change-Id: I100a87075ffdf5c0cda78c95f1cfe3310f97630e
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:104662
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308501
> Reviewed-by: Adlai Holler <adlai@google.com>
> Commit-Queue: Adlai Holler <adlai@google.com>

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

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

Bug: skia:104662
Change-Id: I32e36aa1c70902296e7f28d0f8b52d4e55b264a4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309320
Reviewed-by: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2020-08-11 19:53:06 +00:00
Adlai Holler
74b83a4ea9 Revert "Migrate SkImage::MakeFromTexture to GrRecordingContext"
This reverts commit daa9e7455d.

Reason for revert: Broke Build-Debian9-Clang-arm-Release-Flutter_Android_Docker

Original change's description:
> Migrate SkImage::MakeFromTexture to GrRecordingContext
> 
> Android migration landed in Android CL 12234077
> Chrome migration is landing in Chrome CL 2335812
> 
> Note: makeFromCompressedTexture is not used by Chrome.
> 
> Bug: skia:104662
> Change-Id: Ibbe6d412cf22e87188926383d10b21f780208e48
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305102
> Commit-Queue: Adlai Holler <adlai@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Auto-Submit: Adlai Holler <adlai@google.com>

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

Change-Id: I570945521c6cd78dfeea81e492b7e2b31dd0e6f5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:104662
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308505
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2020-08-06 17:25:09 +00:00
Adlai Holler
ae04cc9099 Revert "Migrate MakeCrossContextFromPixmap to GrDirectContext"
This reverts commit 066f7d6b1a.

Reason for revert: Cant land until flutter PR 20235 reaches g3

Original change's description:
> Migrate MakeCrossContextFromPixmap to GrDirectContext
> 
> This function isn't used by Chrome so we migrate directly.
> Flutter migration is at https://github.com/flutter/engine/pull/20235
> 
> Bug: skia:104662
> Change-Id: I9d875acdbd162f50a6d86b3a4cae3f400e4dd38f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305180
> Commit-Queue: Adlai Holler <adlai@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Robert Phillips <robertphillips@google.com>

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

Change-Id: I100a87075ffdf5c0cda78c95f1cfe3310f97630e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:104662
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/308501
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2020-08-06 16:17:28 +00:00
Adlai Holler
daa9e7455d Migrate SkImage::MakeFromTexture to GrRecordingContext
Android migration landed in Android CL 12234077
Chrome migration is landing in Chrome CL 2335812

Note: makeFromCompressedTexture is not used by Chrome.

Bug: skia:104662
Change-Id: Ibbe6d412cf22e87188926383d10b21f780208e48
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305102
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
2020-08-06 14:02:56 +00:00
Adlai Holler
066f7d6b1a Migrate MakeCrossContextFromPixmap to GrDirectContext
This function isn't used by Chrome so we migrate directly.
Flutter migration is at https://github.com/flutter/engine/pull/20235

Bug: skia:104662
Change-Id: I9d875acdbd162f50a6d86b3a4cae3f400e4dd38f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/305180
Commit-Queue: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-08-06 14:00:57 +00:00
John Stiles
fbd050bd0b Enable ClangTidy check modernize-make-unique.
The majority of existing call sites were automatically updated using
clang-tidy -fix. A small handful required a manual update,
e.g. CppCodeGen.

This check is a bit lenient, and in particular will not flag cases like
`std::unique_ptr<Base>(new Derived())` which is still pretty common
throughout our codebase. This CL does not attempt to replace all the
cases that ClangTidy does not flag.

Change-Id: I5eba48ef880e25d22de80f321a68c389ba769e36
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/307459
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-08-03 17:53:52 +00:00
Adlai Holler
e34b282ed0 Migrate MakeFromAdoptedTexture to GrDirectContext
More recontexting for SkImage. Chrome flag in CL 2323135.
Flutter migration landed in https://github.com/flutter/engine/pull/19962

Bug: skia:104662
Change-Id: Id725eb130310639457ba90f378ecdb334dd5f3cd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/306182
Auto-Submit: Adlai Holler <adlai@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2020-07-29 20:15:00 +00:00
Mike Reed
564d49ec10 Remove subset parameter from making encoded/generator images
Since subsetting may require rasterizing/resolving the generator, we may
also need access to the GrDirectContext. To simplify apis, rely on
makeSubset() for that.

Related: https://skia-review.googlesource.com/c/skia/+/305970

Change-Id: I1980e3c823fb6cf54f197c350942c2f82b03e20f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/306136
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2020-07-28 17:33:12 +00:00
Adlai Holler
247835b6c8 Reland "Migrate SkImage::makeWithFilter to GrRecordingContext"
This reverts commit d13b97f94c.

Reason for revert: Fixed chromium canary

Original change's description:
> Revert "Migrate SkImage::makeWithFilter to GrRecordingContext"
>
> This reverts commit 7f0129d424.
>
> Reason for revert: Broke Chrome roll
>
> Original change's description:
> > Migrate SkImage::makeWithFilter to GrRecordingContext
> >
> > The staging flag landed in Chrome CL 2307531.
> >
> > Bug: skia:104662
> > Change-Id: I8a483bfb83e890bb0566cd252a464a6add89df4f
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304003
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Adlai Holler <adlai@google.com>
>
> TBR=bsalomon@google.com,robertphillips@google.com,adlai@google.com
>
> Change-Id: I280dbffa26da71d53872266e62fa3bcaa3c00989
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:104662
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304802
> Reviewed-by: Adlai Holler <adlai@google.com>
> Commit-Queue: Adlai Holler <adlai@google.com>

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


Bug: skia:104662
Change-Id: I815677659f776966b1c7e362ce3df444834dd482
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304803
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
2020-07-22 12:58:23 +00:00
Adlai Holler
d13b97f94c Revert "Migrate SkImage::makeWithFilter to GrRecordingContext"
This reverts commit 7f0129d424.

Reason for revert: Broke Chrome roll

Original change's description:
> Migrate SkImage::makeWithFilter to GrRecordingContext
> 
> The staging flag landed in Chrome CL 2307531.
> 
> Bug: skia:104662
> Change-Id: I8a483bfb83e890bb0566cd252a464a6add89df4f
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304003
> Reviewed-by: Robert Phillips <robertphillips@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Adlai Holler <adlai@google.com>

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

Change-Id: I280dbffa26da71d53872266e62fa3bcaa3c00989
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:104662
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304802
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2020-07-21 20:02:10 +00:00
Adlai Holler
7f0129d424 Migrate SkImage::makeWithFilter to GrRecordingContext
The staging flag landed in Chrome CL 2307531.

Bug: skia:104662
Change-Id: I8a483bfb83e890bb0566cd252a464a6add89df4f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/304003
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
2020-07-21 17:37:27 +00:00