Change-Id: I2d19c4f0ff1439dcd923a3064eb3ba78432a5113
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281043
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
Updated to use sentinel GL context even when GL backend is not built.
This reverts commit 1171d314ef.
Change-Id: Ia94bbe4865ddd4e898446c13886877c539f0eb0b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/277976
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This reverts commit 9d4b788807.
Copyright issue has been fixed in
https://skia-review.googlesource.com/c/skia/+/275998.
Original description:
Bug: skia:9756
In CanvasKit, a large part of the binary is for encoding. Clients
would be happier with a smaller binary and no webp/jpeg encoding. Make
this an option by splitting up the GN arguments.
Split SK_HAS_WEBP_LIBRARY into SK_CODEC_DECODES_WEBP (to match the
existing SK_CODEC_DECODES_RAW) and SK_ENCODE_WEBP. Same for JPEG and
PNG.
Update CanvasKit compile script to disable webp and jpeg encoding.
Update debugger compile script to disable all encoding.
Change IsPng signature to match other SkCodecs.
TBR=djsollen@google.com
Change-Id: Ic847bae0154e0a2922100b3f2ee14a077ee5635a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/276007
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
This reverts commit 94aaf7cdf5.
Reason for revert: you know what I already typed the reason stop making rules that people have to follow, robots.
Original change's description:
> Split building encoding from decoding
>
> Bug: skia:9756
>
> In CanvasKit, a large part of the binary is for encoding. Clients
> would be happier with a smaller binary and no webp/jpeg encoding. Make
> this an option by splitting up the GN arguments.
>
> Split SK_HAS_WEBP_LIBRARY into SK_CODEC_DECODES_WEBP (to match the
> existing SK_CODEC_DECODES_RAW) and SK_ENCODE_WEBP. Same for JPEG and
> PNG.
>
> Update CanvasKit compile script to disable webp and jpeg encoding.
> Update debugger compile script to disable all encoding.
>
> Change IsPng signature to match other SkCodecs.
>
> Change-Id: Iec8466ee1b76bc3d1e377c24201068b776cd7718
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273768
> Commit-Queue: Leon Scroggins <scroggo@google.com>
> Reviewed-by: Derek Sollenberger <djsollen@google.com>
> Reviewed-by: Kevin Lubick <kjlubick@google.com>
> Reviewed-by: Nathaniel Nifong <nifong@google.com>
TBR=djsollen@google.com,scroggo@google.com,kjlubick@google.com,nifong@google.com
Change-Id: I4fc2ea916743fda7e7d0d668b59e52052e880104
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:9756
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275710
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Bug: skia:9756
In CanvasKit, a large part of the binary is for encoding. Clients
would be happier with a smaller binary and no webp/jpeg encoding. Make
this an option by splitting up the GN arguments.
Split SK_HAS_WEBP_LIBRARY into SK_CODEC_DECODES_WEBP (to match the
existing SK_CODEC_DECODES_RAW) and SK_ENCODE_WEBP. Same for JPEG and
PNG.
Update CanvasKit compile script to disable webp and jpeg encoding.
Update debugger compile script to disable all encoding.
Change IsPng signature to match other SkCodecs.
Change-Id: Iec8466ee1b76bc3d1e377c24201068b776cd7718
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/273768
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Derek Sollenberger <djsollen@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Nathaniel Nifong <nifong@google.com>
Use std::min and std::max everywhere.
SkTPin still exists. We can't use std::clamp yet, and even when
we can, it has undefined behavior with NaN. SkTPin is written
to ensure that we return a value in the [lo, hi] range.
Change-Id: I506852a36e024ae405358d5078a872e2c77fa71e
Docs-Preview: https://skia.org/?cl=269357
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/269357
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This will allow usage of emscripten 1.39.6 to build
Change-Id: I089f47fa4fa38bf55c5071f5d711856c8ab422b8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/267080
Reviewed-by: Kevin Lubick <kjlubick@google.com>
After the update to emscripten 1.39.6, source maps don't
work on ASMJS builds and debugger needed the same change
of the default MAIN_MODULE setting as canvaskit and pathkit.
Change-Id: Ifb920dee998ae41fd500adca587b1ad20cfef584
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/267076
Reviewed-by: Kevin Lubick <kjlubick@google.com>
I also added the `get_examples.py` script which pulls down new fiddles.
Change-Id: I953e461685a4d118ac4e425453e47d665a485aa2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/264570
Commit-Queue: Hal Canary <halcanary@skia.org>
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
- Consolidate Skottie logic into SkottieViewController class that no longer
knows about which backend we use.
- Abstract out SkiaViewController interdace which SkottieViewController
implements.
- Create three classes SkiaGLView, SkiaUIView, and SkiaMtkView, which all
accept SkiaViewController objects but override GLKView, UIView, and
MTKView.
- SkAnimationDraw and SkTimeKeeper now SkiaViewController
implementation details, no longer shared in headers.
Cq-Include-Trybots: skia/skia.primary:Build-Mac-Clang-arm64-Debug-iOS_Metal
Cq-Include-Trybots: skia/skia.primary:Build-Mac-Clang-arm64-Debug-iOS
Change-Id: I96ff2911d63da7d5327c81f91996b2a1b12c4419
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/261178
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
This reverts commit aac8e44d5c.
Reason for revert: Attempted fix didn't work, still producing red on tree.
Original change's description:
> Add vis of android device clip restriction, fix regular clip vis on gpu
>
> Change-Id: I103025f4a9955c46f34b02d4e3ef1626796029e1
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263521
> Commit-Queue: Nathaniel Nifong <nifong@google.com>
> Reviewed-by: Kevin Lubick <kjlubick@google.com>
TBR=kjlubick@google.com,nifong@google.com
Change-Id: Ia1f3a53b829ceb15467da12a104d87d7b1e7dad9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/263697
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Change-Id: I9af324bec969a1f7feb84f8e5ea97b573c56694f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/260396
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Eric Boren <borenet@google.com>
Also: mv experimental/skottie_ios tools/skottie_ios_app
Motivation: make using SkMetalViewBridge that much easier for clients.
Change-Id: I985930ae0751d218e89c48c57b69d85ad7a1e703
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/259279
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
While working on creating bindings for dlang, I noticed that there was a
missing call to `sk_imageinfo_delete`, corresponding to the call to
`sk_imageinfo_new` in the c-api example. At first I thought that
`sk_surface_new_raster` (or something else) would free the image info
object internally, but after checking the implementation I saw this was
not the case.
This can be trivially verified with valgrind:
Before this change:
$ valgrind ./skia-c-example 2>&1 | grep 'definitely lost'
==186215== definitely lost: 24 bytes in 1 blocks
After:
$ valgrind ./skia-c-example 2>&1 | grep 'definitely lost'
==185878== definitely lost: 0 bytes in 0 blocks
Test: built and ran skia-c-example.c under valgrind
Change-Id: Ie3fba2e7602341d2f5e7dac198b3ec5923777cbd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/260021
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
All caller were passing the maxium value, those that weren't still function if they are made to.
Change-Id: Id9b5d8dbbbdf10a02ea0f3b21d500059ec383e3a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/259808
Commit-Queue: Nathaniel Nifong <nifong@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
skottie_ios builds either with or without Metal. The SkAnimationDraw
and SkTimeKeeper classes help abstract out the common elements of the
UIView and the MTKView implementations.
Cq-Include-Trybots: skia/skia.primary:Build-Mac-Clang-arm-Debug-iOS
Cq-Include-Trybots: skia/skia.primary:Build-Mac-Clang-arm-Release-iOS
Cq-Include-Trybots: skia/skia.primary:Build-Mac-Clang-arm64-Debug-iOS
Cq-Include-Trybots: skia/skia.primary:Build-Mac-Clang-arm64-Debug-iOS_Metal
Cq-Include-Trybots: skia/skia.primary:Build-Mac-Clang-arm64-Release-iOS
Cq-Include-Trybots: skia/skia.primary:Build-Mac-Clang-arm64-Release-iOS_Metal
Cq-Include-Trybots: skia/skia.primary:Build-Mac-Clang-x64-Release-iOS
Change-Id: I2c5d217b6349188f32a81e013eb29c6254428831
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/258636
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Note that I don't dereference this pointer, I'm just showing it to the user as it is currently
the only common identifier between the command list and the resource tab.
A longer term fix would be to show the resourse tab's indices in the command list. this is tougher
because it involves replacing UrlDataManager without breaking skiaserve.
Change-Id: Iaa0d60831e96128f19b6358e82b2e89f80444927
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/258800
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Nathaniel Nifong <nifong@google.com>
* Turns out that dealloc is unnecessary. Some compilers
give an error when it is there.
* Use __bridge cast, since some compilers require it.
Cq-Include-Trybots: luci.skia.skia.primary:Build-Mac-Clang-arm64-Debug-iOS_Metal
Cq-Include-Trybots: luci.skia.skia.primary:Build-Mac-Clang-arm64-Release-iOS_Metal
Change-Id: I42d9ef16a5d6425c98a8a2b564bf4a06f26886f5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/257677
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Auto-Submit: Hal Canary <halcanary@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
This reverts commit 3e7af41224.
Change-Id: Id4f66b3956f4bdbe690db20fc478b7365ee89717
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256676
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
This is a reland of 4e385e21a4
Original change's description:
> Minimal iOS app: Perform present subsequent to flush
>
> Currently the backbuffer present is not on the same MTLCommandQueue
> as the flush from Skia, which probably means that it's happening
> concurrently. This can overwhelm the GPU. This CL submits the present
> to the same queue as the flush.
>
> Change-Id: Ibaf805553931c9dc46368b362a2391425ae3e60e
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248557
> Reviewed-by: Hal Canary <halcanary@skia.org>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
Change-Id: I118047630b8936838d5da8ef4307ad5c5e8d2ade
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248562
Reviewed-by: Hal Canary <halcanary@skia.org>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
This reverts commit 4e385e21a4.
Reason for revert: Causing issues with iOS Skottie app.
Original change's description:
> Minimal iOS app: Perform present subsequent to flush
>
> Currently the backbuffer present is not on the same MTLCommandQueue
> as the flush from Skia, which probably means that it's happening
> concurrently. This can overwhelm the GPU. This CL submits the present
> to the same queue as the flush.
>
> Change-Id: Ibaf805553931c9dc46368b362a2391425ae3e60e
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248557
> Reviewed-by: Hal Canary <halcanary@skia.org>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
TBR=jvanverth@google.com,halcanary@google.com,halcanary@skia.org
Change-Id: I56a9f1f12ebceeb750948e459ff9f90e06b7b2e4
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248561
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Currently the backbuffer present is not on the same MTLCommandQueue
as the flush from Skia, which probably means that it's happening
concurrently. This can overwhelm the GPU. This CL submits the present
to the same queue as the flush.
Change-Id: Ibaf805553931c9dc46368b362a2391425ae3e60e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/248557
Reviewed-by: Hal Canary <halcanary@skia.org>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Change-Id: If57514c9e7e8d0a417eb9388873bbb348fc49076
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/247384
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Try to keep a consistent style for objective-C++ code.
Also, share code between both apps.
CQ_INCLUDE_TRYBOTS=skia.primary:Build-Mac-Clang-arm64-Debug-iOS_Metal,Build-Mac-Clang-arm64-Release-iOS_Metal
Change-Id: I4b749780c81319bd048f4295c21dfa91910e262d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241042
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Add version SkImageInfo::Make() that takes SkISize instead of separate
width and height.
Change-Id: I42aa79d23b19e22f5405631728c245b04bce0559
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/245172
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>