Anonymous enums play havoc with documentation;
there's no name to refer to. It may be that all
enums may either be named or replaced with constexpr
without breaking anything. Try replacing all
anonymous enums in include/core to see what happens.
This names SkCanvas::SaveLayerFlagsSet but leaves
SkCanvas::SaveLayerFlags as a uint32_t, to reduce
risk as compared to review.skia.org/123584.
There's also some chance that external linkage will
break if some client refers to anonymous enum in a way
that could require its address: see
https://stackoverflow.com/questions/22867654/enum-vs-constexpr-for-actual-static-constants-inside-classes
(This CL does not require definitions + declarations)
Brought bookmaker docs in line with this change.
This also tripped over missing code in bookmaker
handling constexpr so added that as well.
R=reed@google.com,bsalomon@google.com
Docs-Preview: https://skia.org/?cl=123920
Docs-Preview: https://skia.org/?cl=123584
Bug: skia:6898
Change-Id: I14a342edcfd59e139ef9e4501f562417c4c60391
Reviewed-on: https://skia-review.googlesource.com/123920
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Cary Clark <caryclark@skia.org>
Today, we only know if we fail a copy during the flush so we have no
way to cleanly handle a failed copy. This will allow us to know if we'll
fail a copy during recording and allow us to do some appropriate fallback
and/or dropping of the draw.
Bug: skia:
Change-Id: I38f209dbd4ebb4e762210b4609147d4b0a1b01b1
Reviewed-on: https://skia-review.googlesource.com/123560
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Bug: skia:
Change-Id: I5ed334f63e64991944394dc8103092a2c6280546
Reviewed-on: https://skia-review.googlesource.com/122000
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
include/private:
- SkAutoTArray, SkAutoTMalloc no longer use bare pointers to owned memory,
- SkTHash and SkAutoTArray are now std::move()able.
- SkAutoTArray::swap no longer neccesary.
- SkAutoTMalloc::operator=() defined.
src/pdf:
- SkPDFCanon and SkPDFObjectSerializer are now std::move()able.
- `template <class T> static void renew(T* t) { t->~T(); new (t) T; }` is gone.
Change-Id: I2f36a0780c47d1427a85da240121c898387fb4cf
Reviewed-on: https://skia-review.googlesource.com/123401
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
Bug: b/77917978
For
drawImageLattice
drawBitmapLattice
drawImageNine
drawBitmapNine
, respect the SkFilterQuality on the SkPaint. Previously the GPU used
the lowest quality to avoid a bleeding effect, leading to ugly nine-
patches on Android.
For all backends, cap the filter quality at kLow_SkFilterQuality.
Update SkCanvas' documentation to specify this.
Change-Id: Id28c7753834975f039170f14bc51be4f2bd44d41
Reviewed-on: https://skia-review.googlesource.com/121891
Reviewed-by: Cary Clark <caryclark@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Leon Scroggins <scroggo@google.com>
Auto-Submit: Leon Scroggins <scroggo@google.com>
SkVertices::Builder uses custom new operator but not exposed to dll.
While delete operator in SkVertices.h could be inlined, it causes crash on Windows DLL builds. This patch fixes this issue.
Change-Id: I8b635ad3aa4a3f496a392ce7840417947999e4b0
Reviewed-on: https://skia-review.googlesource.com/122480
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Column-major is an implementation choice, not an interface. There is
exactly one acceptable subscript notation for indexing matrix elements,
and it's row first, then column. Having these named backwards was
unnecessarily confusing.
Note that this doesn't alter behavior in any way, it just brings this
function in line with expectations from any reasonable mathematician.
Change-Id: Ie4ceb40281ef507889d25403afbf24116514c45a
Reviewed-on: https://skia-review.googlesource.com/122790
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
When debugging DDL it is useful to just see which ops are being drawn instead of the entire reordering history.
Change-Id: I89708fecbd53c097b00e65b0da426bfb8046b0ee
Reviewed-on: https://skia-review.googlesource.com/122780
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Neat but unused.
Change-Id: I1b2d160df274b05cfb5582a5385085cc2db89f7d
Reviewed-on: https://skia-review.googlesource.com/121960
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This adds explicit overflow checks to the two likeliest
places where non-buggy code could overflow SkTDArray.
We have an #ifdef'd out PathMeasure_explosion GM that
overflows before this CL and aborts with it.
Bug: skia:7674
Change-Id: Ia0c430f4a8bb9bad687d13c875f604fd7da45aab
Reviewed-on: https://skia-review.googlesource.com/122342
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
We already assert that setCount()'s argument is non-negative.
This does the same for setReserve().
There was one call site I could find that was actually sometimes
passing negative values to setReserve(), guarded here.
Already reviewed: https://skia-review.googlesource.com/c/skia/+/115982
Change-Id: Ia52a286732bf4056e9baf09555d27bab9abf2554
Reviewed-on: https://skia-review.googlesource.com/122305
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
It's only used in one call site, which is clearer without it.
Already reviewed: https://skia-review.googlesource.com/c/skia/+/115982
Change-Id: I3d0f8c1f0756e01e29cdb9f9328b0f557d3650d3
Reviewed-on: https://skia-review.googlesource.com/122302
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
We were missing a few that got unreffed due to failed proxy
instantiation.
Bug: skia:7655
Bug: skia:7111
Change-Id: I95847a16890f2993a1433d4d9fdaa8a4a6c2f0b6
Reviewed-on: https://skia-review.googlesource.com/122121
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Bug: skia:7713
Change-Id: If06c0368e91c33bbac9e7715227d619c4834684f
Reviewed-on: https://skia-review.googlesource.com/121884
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Overriding bits of the paint was added with keyboard bindings but
without being reflected in the GUI. This adds these flags to the GUI.
Change-Id: I633801fb776248952afe7cbe8857676ef8b57135
Reviewed-on: https://skia-review.googlesource.com/121796
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Bug: skia:7419
Change-Id: I912d4ae842d9cab09395fac3136e2e900611c8e5
Reviewed-on: https://skia-review.googlesource.com/121358
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
The original intent of this flag is now handled by SkPixelGeomety on
SkSurfaceProps on SkSurface.
BUG=skia:7515
Change-Id: I54bb1be072b5b5b2164a59196bfeacac254823c7
Reviewed-on: https://skia-review.googlesource.com/121346
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Herb Derby <herb@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
We will not allocate new mips on a wrapped texture but we will use mips
if the wrapped texture already has one. If we need mips for a draw this
will trigger a copy to occur.
Also some cleanup up of our InternalSurfaceFlags in general.
Bug: skia:7806
Change-Id: I7aa666478cc91bba6e0644b323825fcc9b49793a
Reviewed-on: https://skia-review.googlesource.com/121348
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
This reverts commit c828109ebd.
Reason for revert: Need to fix flutter
Original change's description:
> Delete getRenderTargetHandle call on SkSurface.
>
> All clients and internal code should be switched (once changes land soon)
> to the new getBackendRenderTarget call instead.
>
> Bug: skia:
> Change-Id: I6f490b6d26a72f37f97216be04e541483206510d
> Reviewed-on: https://skia-review.googlesource.com/121103
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>
TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: skia:
Change-Id: I571298f839757fcdedcd8117519e740ac7ef1344
Reviewed-on: https://skia-review.googlesource.com/121480
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
All clients and internal code should be switched (once changes land soon)
to the new getBackendRenderTarget call instead.
Bug: skia:
Change-Id: I6f490b6d26a72f37f97216be04e541483206510d
Reviewed-on: https://skia-review.googlesource.com/121103
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
The implicit SkTCopyOnFirstWrite copy-ctor and assignment operator are
incorrect: fObj must point to the local copy, not to the source copy
(when a copy has been made).
Add corrected explicit copy (and move) ctor + assignment operator.
Also add a get() helper to facilitate rawptr access.
Change-Id: Ie3983e12c04eae4f32c40e3e267618cf02008c20
Reviewed-on: https://skia-review.googlesource.com/120442
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
This reverts commit 2097fd03ff.
Reason for revert: This is breaking a lot of Windows bots (esp. on the shadermaskfilter_localmatrix)
Original change's description:
> Fix handling of MaskFilter matrices
>
> 1) extend GrFPArgs to track pre/post local matrices, add helpers for
> creating pre/post wrapper args
>
> 2) add a SkShaderBase helper (totalLocalMatrix) to centralize the LM
> sandwich logic.
>
> 3) update call sites to use the above
>
> 4) rename SkMatrixFilter::makeWithLocalMatrix -> makeWithMatrix, to
> disambiguate vs. SkShader::makeWithLocalMatrix.
>
> BUG=skia:7744
>
> Change-Id: Ib2b7b007e6924979b00649dde7c94ef4b34771f1
> Reviewed-on: https://skia-review.googlesource.com/119330
> Commit-Queue: Florin Malita <fmalita@chromium.org>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,robertphillips@google.com,fmalita@chromium.org,reed@google.com
Change-Id: I918dbb95bf00b3122e6699b84566ec82dbb5fc5c
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7744
Reviewed-on: https://skia-review.googlesource.com/120340
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
1) extend GrFPArgs to track pre/post local matrices, add helpers for
creating pre/post wrapper args
2) add a SkShaderBase helper (totalLocalMatrix) to centralize the LM
sandwich logic.
3) update call sites to use the above
4) rename SkMatrixFilter::makeWithLocalMatrix -> makeWithMatrix, to
disambiguate vs. SkShader::makeWithLocalMatrix.
BUG=skia:7744
Change-Id: Ib2b7b007e6924979b00649dde7c94ef4b34771f1
Reviewed-on: https://skia-review.googlesource.com/119330
Commit-Queue: Florin Malita <fmalita@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Adds an additional ctor so clients who used brace initialization on the
struct don't break.
Bug: skia:
Change-Id: I78ebdbe8242147e48859f2234265365141fe81b1
Reviewed-on: https://skia-review.googlesource.com/120185
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
The big api level change here is that the getBackendInfo calls now return by value
instead of a pointer. These changes are being made in support of Vulkan so that
the client can update the VkImageLayout on the GrBackendTexture and have that
update get reflected in our internal tracking of the image. This is done by storing
a ref counted GrVkImageLayout object on the GrBackendTexture and the GrVkImage.
Bug: skia:
Change-Id: I8c6158fd3a66eb61fef97ebf09ea5364bca3f1ae
Reviewed-on: https://skia-review.googlesource.com/119101
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
R=brianosman@google.com,robertphillips@google.com
TBR=reed@google.com
Bug: 824145,skia:7792
Change-Id: I24f121cfa7d437c95b94bd917d3c4888a10c519e
Reviewed-on: https://skia-review.googlesource.com/119569
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Change-Id: I1d99d9bb83d8a612d1c1fd298c1f7ed706a2277b
Reviewed-on: https://skia-review.googlesource.com/118990
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
SK_IGNORE_TO_STRING is not defined anywhere.
The same effect can be had by using a modern
linker.
Removing it simplifies bookmaker and makes
our includes easier to understand.
R=robertphillips@google.comTBR=reed@google.com
Bug: skia:6898
Change-Id: Ib716f5ef1b42a7fbda0df43ece212d1b7c40289f
Reviewed-on: https://skia-review.googlesource.com/118963
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
This provides an alternative way to access these values which will allow removal GrContext::caps() from public API
Change-Id: I53d3c00563da8847e1fc14aea9750dc9fd90d1e5
Reviewed-on: https://skia-review.googlesource.com/118962
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Change-Id: I63477fd4b8d48dc50af72736f0f8df566cd96d4a
Reviewed-on: https://skia-review.googlesource.com/85220
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Cary Clark <caryclark@skia.org>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>