We'll need this for a proper implementation of onUpdateBackendTexture().
Change-Id: I4b9ac93934ef39ed3c82a55f7d74fc1f826f7740
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323558
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Stephen White <senorblanco@google.com>
Change-Id: I53af66c1b65971c204ac7c515e0d0e39481b015d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323097
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
This is a massive breaking change for all existing users of CanvasKit.
It will be (one of the only) changes in 0.19.0 to make the transition
easier.
Suggested reviewing order:
- index.d.ts (to see type changes). Notice SkPicture still has Sk
prefix, but no other types do (this felt "right" since Sk is
part of the name of the type, but I can be swayed on this).
- canvaskit-wasm-tests.ts
- tests/*.spec.js
- interface.js and helper.js
- html examples
- markdown files
Change-Id: I3b3d3815df2078f986893df3c70101d6248c117d
Docs-Preview: https://skia.org/?cl=322617
Bug: skia:10717
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322617
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Nathaniel Nifong <nifong@google.com>
In practice, callers of getInputBounds already have an output pixel
region they need covered by the image filter, so DeviceSpace<SkIRect>
is more appropriate than DeviceSpace<SkRect>
Change-Id: Ica062b59257966d12240201b7d942cbaed56adb3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323598
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Chromiun no longer use set_sources_assignment_filter() anywhere in the
build, so these are no longer needed.
Bug: chromium:1018739
Change-Id: I0e460922947430ed357838ff4196516d19c382a5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323636
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Before this change each backend had its own special stencil format
struct that contained information like the actual format, stencil bits,
etc. This change removes all of that and instead reliess on static
helper functions that can return all this information based on the
backend format.
Besides being cleaner, this change helps move towards being able to
combine all surface attachment classes into a unified class.
Bug: skia:10727
Change-Id: I26003e44f55ce32293e9092bafce5baef6f938d3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322958
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Currently there is nothing using these formats, but this change just adds
them along with a quaries about their properties. They will be used in a
follow up change.
Bug: skia:10727
Change-Id: Iaaf13baf372799d47c65bd974fd204a32be57617
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322622
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
This removes VarDeclarationsStatement entirely. VarDeclaration instances
appear directly as statements in Programs. SkSL that declares multiple
variables in a single declaration is transformed to represent that as a
series of VarDeclaration statements.
Similarly, global variable declarations are represented by
GlobalVarDeclaration program elements, one per variable.
Bug: skia:10806
Change-Id: Idd8a2d971a8217733ed57f0dd2249d62f2f0e9c5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323102
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Also, remove unused #include of SkBitSet.
Change-Id: Ib1b903f78e835a75c8ba88ac35bfa270df7bc0e3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322681
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Encode as PNG to an SkWStream instead of a path.
It's just as natural at the call sites, if not more so,
and is more flexible for environments without a filesystem.
While here, tweak the method names and add some comments.
Change-Id: I8ce9869471fc7e1a0955d51ecb621e76c2e1d4d8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323509
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
We'll also be needing this helper for HW-generated blur mask caching
Bug: 1108408
Change-Id: I60d91ae8864239f0cf68830d0a5b4266d27545d3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323109
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Change-Id: Id3ee43fb72408f5bd0287f8b57b4a83109109aae
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/321778
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Klein <mtklein@google.com>
go/skiastyle: "Variables declared constexpr or const, and whose value is
fixed for the duration of the program, are named with a leading "k" and
then camel-capped."
Change-Id: Id9cf292a923d6b4db760975ffb7bc1a04c516e87
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322440
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
This reverts commit 57c37ad0e4.
Reason for revert: Breaking the Mali400 bots.
Original change's description:
> Add a 2d cross product intrinsic to sksl
>
> Change-Id: Iebaf4616665547d6ca4900e1247d5b68e0f3512a
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/321790
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
TBR=brianosman@google.com,csmartdalton@google.com,ethannicholas@google.com,johnstiles@google.com
Change-Id: I3e1aa251e883e3d2a1170b0fc6cdc84ea06e784a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323556
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
and begin using it for cached SW-generated blur masks.
This is needed to begin mixing and matching HW & SW-generated blur
masks since they have different draw-rects.
It will also be useful if/when we add support for triangulated paths
to the thread-safe cache.
Bug: 1108408
Change-Id: I085ad1127dc2deb98b35d704b06e50b27c72fd1c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322657
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
I wrote code that called SkAutoTArray::data() and discovered that it
was broken, but not generating compile errors because it's part of a
template and never instantiated anywhere else. I fixed the
implementation and added it to our container unit test to prevent later
regression. This revealed another issue, that "containers in
SkTemplates.h [should] all have a consistent api", according to
test_container_apis. However, data() was never added to the non-array
container APIs. So I added data() to the other containers as well.
Change-Id: I52532c91fdab3fc8c4539053ba8420815b7b0ee5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323276
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
I don't think we need the extra bin folder; we should be
able to declare our types all in index.d.ts.
This also checks in the package-lock.json, now that we
have devDependencies to run those type checks.
`make typecheck` runs the typecheck tests.
The tsconfig.json and tslint.json were created following
the instructions at https://github.com/microsoft/dtslint
and using the DefinitelyTyped rules.
Bug: skia:10717
Change-Id: I7f943e9cfa264496e0d8932018ab1749702ab2c4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322957
Reviewed-by: Nathaniel Nifong <nifong@google.com>
Change-Id: Iebaf4616665547d6ca4900e1247d5b68e0f3512a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/321790
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
SymbolTable::addAlias can be used to create a Symbol that's an alias for
an existing symbol, but uses a different name. (e.g. in Runtime Effects,
a `fragmentProcessor` is a `shader` and `float4` is also `vec4`.)
SymbolTable::addWithoutOwnership will now assert if an attempt is made
to add a Symbol with the wrong name. In a followup CL, the name argument
will be removed entirely and it will simply use the Symbol's name.
Change-Id: I9aee7717e2600a6d84ebe4c3ab7fca40229faa5d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323106
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Also rm extra space in CK binding.
Change-Id: I3ec50d24cf77ed7773bd0f9c7a6a141221ecd063
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323104
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Rather than showing a generic `assert(!fErrorCount)` message, this will
put the actual error message in the IDE error log.
Example: http://screen/7hPTTFronJV3ssb
Change-Id: Ic05f354281275d2aca3e006035b01efae29302e3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323098
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Change-Id: I308dda52c259e1a23d14395d9a632fe2eafab19f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/323016
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Identical to https://skia-review.googlesource.com/c/skia/+/286070.
Bug: skia:10165
Cq-Include-Trybots: skia/skia.primary:Build-Debian10-Clang-arm-Debug-Chromebook_GLES;skia/skia.primary:Test-Mac10.13-Clang-MacBookPro11.5-CPU-AVX2-x86_64-Release-All-TSAN,Build-Debian10-Clang-arm64-Debug-Android_ASAN
Change-Id: I0ec9d5f6875768e665f444e1ada211d3da537678
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322976
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Adds a new helper that creates a GrBackendRenderTarget using
GrGpu and then wraps it in a SkSurface. Uses the SkSurface
release proc to delete the BERT using GrGpu.
Upgrades GrGpu::createTestingOnlyBackendRenderTarget to create MSAA
buffers.
Updates many tests/tool to call sites to use the helper instead of
SkSurface::MakeFromBackendTextureAsRenderTarget.
Adds syncToCpu bool to SkSurface:: and GrContext::flushAndSubmit.
Bug: skia:9832
Change-Id: I73a8f0ce09dc6523729af0814464c6b6657fda06
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/293683
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
This fixes includes like <cxxabi.h> in Android ASAN builds.
Bug: skia:10165
Change-Id: Ieeff45b29cd527dd0a60ed21422378f5aa610cc7
Cq-Include-Trybots: luci.skia.skia.primary:Build-Debian10-Clang-arm64-Debug-Android_ASAN,Build-Debian10-Clang-arm-Debug-Android_ASAN
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322906
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Added a flag to switch from using the memory pool to
using new and delete for GrOp allocation.
Just add the following to your gn args.
extra_cflags = [
"-DGR_OP_ALLOCATE_USE_NEW",
]
Change-Id: Icea4a6df047cff2cd5e50032f0bd4b714a5740d4
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322625
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
When flattening we always flatten to kTopLeft.
Rename some origin params to SkImage factories to make it clearer
that they refer to input texture origins.
Only preserve the origin in the variants that immediately flatten
to RGBA as part of contract (make SkImage_Gpu not SkImage_GpuYUVA).
Bug: skia:10632
Change-Id: I0ed9d693758086c4050f983b579d0d77daefc3d7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322486
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This starts pulling apart draw_shape_with_mask_filter so we can
share HW-generated blur masks with DDL recording threads.
Change-Id: I2ff3ed8557e979dce342f4dd0156112d47f8a6a7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322479
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This should be it. Caught up with 0.18.0
Change-Id: Ibe846d756601e42e315ab510807abd4bbd9cf30d
Bug: skia:10717
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322323
Reviewed-by: Kevin Lubick <kjlubick@google.com>
The docs on the C++ side are not complete in some areas, so
these docs are incomplete as well.
Bug: skia:10717
Change-Id: I1cbb559ab5c8b3973686b85f420ccd9752eaa24d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322321
Reviewed-by: Kevin Lubick <kjlubick@google.com>
This moves the type juggling to the callers, but means that we don't
have to allocate a second vector in the constructor and copy things
over.
Change-Id: If017a7d6fe4eaa678679b1506f6c0c241d72a381
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/322626
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>