This is a reland of fa87f9c7b9
Went back to original approach of checking isFramebufferOnly outside
GrCopyRenderTask::Make().
Original change's description:
> Add backend texture and backend render target versions snapshot GMs
>
> GPU may behave differently depending on whether the SkSurface backing
> store is wrapped and whether it is a texture or not.
>
> Bug: skia:11208
> Change-Id: I5e9921d56c0840cfe34ed2926a55be7460409b23
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/364639
> Reviewed-by: Adlai Holler <adlai@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
Bug: skia:11208
Change-Id: I7af6078e904fdd772b97ad3a27e26cab577fc6a3
Cq-Include-Trybots: luci.skia.skia.primary:Test-Ubuntu18-Clang-Golo-GPU-QuadroP400-x86_64-Debug-All-PreAbandonGpuContext
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/365702
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
This reverts commit fa87f9c7b9.
Reason for revert: assert on n5x/n7
Original change's description:
> Add backend texture and backend render target versions snapshot GMs
>
> GPU may behave differently depending on whether the SkSurface backing
> store is wrapped and whether it is a texture or not.
>
> Bug: skia:11208
> Change-Id: I5e9921d56c0840cfe34ed2926a55be7460409b23
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/364639
> Reviewed-by: Adlai Holler <adlai@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,robertphillips@google.com,adlai@google.com
Change-Id: Id1488586e2d17cdce35f95ea6aa9b2bffd9218d0
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:11208
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/365698
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
GPU may behave differently depending on whether the SkSurface backing
store is wrapped and whether it is a texture or not.
Bug: skia:11208
Change-Id: I5e9921d56c0840cfe34ed2926a55be7460409b23
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/364639
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
The goal here is remove the need for all the specialized vulkan buffer
subclasses and to not have the new class use GrVkResources for tracking
lifetime on command buffers.
This CL just makes the new class and it is not actually used by anything
yet.
Bug: skia:11226
Change-Id: I5f8d8d112af773ba1e8da17e07e75f6f4100e927
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/364617
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
These are basic vector types, required by GLSL ES2, but we could not
create helper functions using them because they were missing from our
GrSLType enum. (This also prevented Runtime Effects from using these
types in helper functions.)
Change-Id: I78c328499e8ed90cb29c641b90ee59460a5a45de
Bug: skia:11246
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/364036
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
These types are supported by SkSL but were mysteriously absent from
GrSL.
Change-Id: Id3479a23b1ddee0604362ed8c12da0eea7c6fa56
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/355981
Commit-Queue: John Stiles <johnstiles@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
This is a reland of 6ea387e7c7
Original change's description:
> Enable GrTessellationPathRenderer by default
>
> Moves GrTessellationPathRenderer to the end of the chain and enables
> it by default.
>
> Also updates nvpr to not draw volatile paths. The tessellator is much
> faster at these.
>
> Bug: skia:10419
> Change-Id: I97ca7d4d1dff65fc9d4040c267f9808c8c33b548
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344377
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
Bug: skia:10419
Change-Id: I53b50d6aa01ae1bea697e05c3f60d57d132d6aad
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345759
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
To unblock https://skia-review.googlesource.com/c/skia/+/347616:
In file included from ../../../../../../skia/tools/public_headers_warnings_check.cpp:8:
In file included from gen\skia.h:19:
In file included from ../../../../../../skia\include/core/SkContourMeasure.h:11:
In file included from ../../../../../../skia\include\core\SkPath.h:13:
In file included from ../../../../../../skia\include/private/SkPathRef.h:16:
In file included from ../../../../../../skia\include/private/SkIDChangeListener.h:13:
../../../../../../skia\include/private/SkTDArray.h(76,48): error: implicit conversion changes signedness: 'const int' to 'unsigned long long' [-Werror,-Wsign-conversion]
!memcmp(a.fArray, b.fArray, a.fCount * sizeof(T)));
~~^~~~~~ ~
...
Change-Id: I1b55580ae5e73bde41cecb20d137295bbaf8cbb6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/347860
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Commit-Queue: Florin Malita <fmalita@google.com>
Updated Pair type in SkTHashMap to derive from std::pair to fix C++14
issues with structured bindings.
Original change's description:
> Add support for range-based for loops to SkTHashSet/Map.
>
> This allows loops over SkTHashes to break in the middle, and also
> removes the need to use lambda captures to bring variables inside the
> loop's scope.
>
> Change-Id: Ief55d776b2c57a44b24cfe1c94493a5d514791c8
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/346496
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>
Change-Id: I2ac5b2c59e70ed0ec3b42b32e7994d6bcdf56b40
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/346502
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
This reverts commit 5d00e15625.
Reason for revert: tree breakage on Chromebook standard lib
Original change's description:
> Add support for range-based for loops to SkTHashSet/Map.
>
> This allows loops over SkTHashes to break in the middle, and also
> removes the need to use lambda captures to bring variables inside the
> loop's scope.
>
> Change-Id: Ief55d776b2c57a44b24cfe1c94493a5d514791c8
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/346496
> Reviewed-by: Mike Klein <mtklein@google.com>
> Commit-Queue: John Stiles <johnstiles@google.com>
TBR=mtklein@google.com,johnstiles@google.com
Change-Id: I165872ac41f66f3b3255cf8970626392e5283412
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/346500
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
This allows loops over SkTHashes to break in the middle, and also
removes the need to use lambda captures to bring variables inside the
loop's scope.
Change-Id: Ief55d776b2c57a44b24cfe1c94493a5d514791c8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/346496
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
This reverts commit 6ea387e7c7.
Reason for revert: valgrind failing
Original change's description:
> Enable GrTessellationPathRenderer by default
>
> Moves GrTessellationPathRenderer to the end of the chain and enables
> it by default.
>
> Also updates nvpr to not draw volatile paths. The tessellator is much
> faster at these.
>
> Bug: skia:10419
> Change-Id: I97ca7d4d1dff65fc9d4040c267f9808c8c33b548
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344377
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,csmartdalton@google.com
Change-Id: I3718ae210ebc403959d187160214cf0df895e4f5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:10419
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/345718
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Moves GrTessellationPathRenderer to the end of the chain and enables
it by default.
Also updates nvpr to not draw volatile paths. The tessellator is much
faster at these.
Bug: skia:10419
Change-Id: I97ca7d4d1dff65fc9d4040c267f9808c8c33b548
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344377
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Adds a new kDirectionLight_ShadowFlag which indicates that lightPosition
is a vector pointing towards the light, and lightRadius is the blur
radius when the occluder is at z == 1. For other values of z it will
scale linearly. The direction is specified in device space.
Bug: skia:10781
Change-Id: I14d530f006e5541ed6e22bfbeb29c7441c21fb8e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/321792
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Just the class/files. variable names and additional comments to follow.
Change-Id: Ic03d07fd5009eaf3d706c2536486a117328963fc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342617
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Initially we restricted tessellated stroking to opaque solid colors.
This CL adds support for transparency by enabling a stencil test. The
stencil test also allows us to use mixed samples.
Bug: skia:10419
Change-Id: Ie40f3099d2b009f92ed49f7f43e5f269b1a479af
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/340798
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Follow-on to https://skia-review.googlesource.com/c/skia/+/342616
Assuming this survives, we can probably simplify other code in SkPath
(e.g. Iterators) that today worry about consing up moves after close.
Change-Id: I913d6be9c20547267230c287d394fd300b985d31
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/342619
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
These macros are not meant to leak out of the file.
Change-Id: I7e24f65a3053785410c7fac760fd3af46c5c1f1c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/337739
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
It's a bad idea, difficult to reason about, and may be causing
deadlocks.
Change-Id: Id9749661f4f3f942ee983e9c1fdab2bd7f287edb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/335242
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Previously, `checkRealloc` would always size up the requested buffer to
allow for 50% extra growth. In some cases (e.g. repeated push_back),
this is a clear win for performance. In other cases (e.g. assigning one
array to another, reserve_back), this extra padding is typically
unwanted and goes against most caller's expectations.
Change-Id: I2d2b5cf81268026822dc5ea08396771bbf06b25a
Bug: skia:10930
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/333797
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: John Stiles <johnstiles@google.com>
Lots of this stuff can be delegated to each other,
cutting the protected SkTArray constructors to two.
Change-Id: Ie35b7a5ceb0ffef5a9548afccc546e076bd668cc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/333256
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
This decreases alignment for things like float
and increases alignment for things like __m128.
The other users of SkAlignedSStorage looked simple enough to port to
aligned char[]. I haven't changed either of their alignments---still
the old max(void*,double)---but we can now if we want.
All that together lets us delete SkAlignedSStorage.
Change-Id: I6b5957a26f42ad859de383054573fb58d5cd0576
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/333196
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Using private inheritance is similar to having a class member,
except it's initialized before the next base class, SkTArray.
This lets us pass it to SkTArray's constructors.
I think we can make related changes (updating the various SkAlignedFoo,
not using them here, or not using them anywhere) independently.
... storage constructors made explicit at suggestion of GCC's -Wextra.
... now with explicit static_cast<STORAGE*>(this)
Change-Id: I665cf840e111da68f039416c9649ce328cc308d6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/333146
Reviewed-by: John Stiles <johnstiles@google.com>
f01a9d9020
is the culprit
Revert "GrRefCntedCallback has Make function."
This reverts commit b2c42140ea.
Revert "Add SkImage::MakeFromYUVATexturesCopyToExternal"
This reverts commit f01a9d9020.
Bug: skia:10632
Change-Id: Ief076f168b63ff8ca15b607163a13d5f52a733d2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331798
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Each caller does not need to check for null function.
Also inherit from SkNVRefCnt.
Change-Id: I9a53c3c8e9dec1361db6cfb21b97d178173b23ac
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331490
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Also added unit tests for each of SkTArray's various constructors, and
added `SkTArray::value_type` which allows calling code to refer to the
array's value-type. These unit tests exposed some preexisting strict-
aliasing issues in SkSTArray when compiled on GCC 6+ with optimizations
enabled, which are being investigated separately at skia:10891.
Change-Id: Ia0fb18830cfbbdcb1545fe7f7ac51d8e768a3f94
Bug: skia:10891
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330279
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
With the addition of vertex data to the thread safe cache we also have
to handle the case where a given SkPath becomes inaccessible and
proactively invalidate the matching entry.
Bug: 1108408
Change-Id: Id11ce2aa10517f7c0772a253634d3c0d13e13460
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330261
Reviewed-by: Adlai Holler <adlai@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
This reverts commit 375721d7bb.
Some manual edits needed due to time elapsed.
Bug: chromium:1141332, skia:10566
Change-Id: Iadb15d3f5334d9eed4e7053e9c19d75a0bbeb9de
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/330196
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Adds an SkChopCubicAt overload that performs two chops at once in
SIMD. Also updates SkChopCubicAt to accept T values of 0 and 1. This
has been the source of bugs in the past.
Bug: skia:10419
Change-Id: Ic8a482a69192fb1685f3766411cbdceed830f9b7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327436
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Bug: skia:10866
Change-Id: I06c675a423380d30017ebcc5485d556211d403fa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/329390
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Michael Ludwig <michaelludwig@google.com>
It's just much easier to remember and think about
max(lo, min(x, hi)) than max(min(hi, x), lo), and
both pin NaN to one of the two limits. I'm not sure
if anything in Skia depends on which limit we pin to.
Change-Id: Iceca36a8fffd7072180e82b8b6eb81cbdb5ac97f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327788
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Change-Id: I70b2fdea570a9091afc81a1455fa61f90b0357a1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/327786
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
The semantics of `vector::reserve` and `SkTArray::reserve` were not the
same. SkTArray::reserve takes a delta over the current array size,
whereas vector takes a total array size. This could lead to subtle
errors with over- or under-reservation, hurting performance.
This CL renames `SkTArray::reserve` to `SkTArray::reserve_back` to give
the SkTArray behavior a distinct (hopefully easily understandable) name,
leaving its functionality as-is.
Change-Id: Icbd3114bb317fd5f307f393c02ae6fb6f83764e9
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326956
Commit-Queue: John Stiles <johnstiles@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Instead of looking at point/verb/weight counts, add an
SkPathRef::approximateBytesUsed() using their reserve counts.
This shows SkPathBuilder::snapshot() can return more memory-efficient
SkPaths than SkPathBuilder::detach(), at the cost of a copy.
Change-Id: I4e208c41643480d7682daba6ac674ffa63c74de2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326608
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Klein <mtklein@google.com>
Now that we have skvx::map(), anyone can write this sort of
scalar-to-vector code. There are no vector instructions for these, so
they'll never going to be particularly interesting for SkVx to provide.
We did work out _approximate_ versions of each of these for SkVM, and
that's what we use to evaluate these programs there. So if this stuff
really matters we could port that logic back over to SkVx.h.
But in terms of pure refactoring, I think this is where we want to sit
until we decide to use those approximations. I don't really want to
invest much time in the SkSLByteCode interpreter any more.
Change-Id: I4e595dee5fd9e608905305e46b2aebcab986c561
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326277
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Cq-Include-Trybots: luci.chromium.try:linux_chromium_cfi_rel_ng
Bug: chromium:1137652, chromium:1137958
Change-Id: I8575b588f9a1ba89740b95382b2462338e34bec5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326478
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Cut & paste with some reorganization of includes & forward-decls.
Next up is GrContextPriv.
Change-Id: I72d2d95c62692e3b37608517b796c0041ffedea3
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326157
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Adlai Holler <adlai@google.com>
This is a reland of b3c42efd25
with a few more signed/unsigned mismatches fixed up.
Original change's description:
> pack SkTArray
>
> Same idea as http://review.skia.org/325857; I just wanted to feel out
> the options myself. A couple key ideas:
>
> Prefer SkTo32() to separate range assertions and casts.
>
> Keep using int indices, counting to this->count() where
> fCount would have warned about signed/unsigned mismatch.
>
> I've kept new comments and assertions to minimum. In the end we won't
> change the max size of SkTArray, and I don't see much need to call out
> how much it hasn't changed. Reading back over the accumulated changes,
> I don't really see much that's newly error-prone.
>
> Change-Id: I86a8a161b9ae44f24fc25093741945b75fbfa770
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326106
> Commit-Queue: Mike Klein <mtklein@google.com>
> Reviewed-by: John Stiles <johnstiles@google.com>
Change-Id: I04d928ecc185fb5c7b9d32f60e94df9f8d137898
Cq-Include-Trybots: luci.skia.skia.primary:Build-Win-MSVC-x86_64-Debug-Vulkan,Build-Win-MSVC-x86-Debug
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326297
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Cut & paste job, but I did replace some cases of just calling
inherited implementations with using-statements. There are
other methods on this class that are using-statements and
that pattern is cleaner.
Change-Id: Ie369c643e44bdb8f82dfffcf45c1f65d48606899
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/325660
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Adlai Holler <adlai@google.com>
This reverts commit b3c42efd25.
Reason for revert: Build-Win-MSVC-x86_64-Debug-Vulkan
Original change's description:
> pack SkTArray
>
> Same idea as http://review.skia.org/325857; I just wanted to feel out
> the options myself. A couple key ideas:
>
> Prefer SkTo32() to separate range assertions and casts.
>
> Keep using int indices, counting to this->count() where
> fCount would have warned about signed/unsigned mismatch.
>
> I've kept new comments and assertions to minimum. In the end we won't
> change the max size of SkTArray, and I don't see much need to call out
> how much it hasn't changed. Reading back over the accumulated changes,
> I don't really see much that's newly error-prone.
>
> Change-Id: I86a8a161b9ae44f24fc25093741945b75fbfa770
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326106
> Commit-Queue: Mike Klein <mtklein@google.com>
> Reviewed-by: John Stiles <johnstiles@google.com>
TBR=mtklein@google.com,johnstiles@google.com
Change-Id: I8267a05e1ce075bfa7893c60f7c77dbf4f8cf061
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326296
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
These don't return reliable portable results, so I don't want to promote
them as good ideas to use. You can get at least 5 different results
from these across the four main architectures we support, and they've
been the root cause of bugs uncovered only in production on undertested
platforms.
Luckily, unused outside of tests.
Change-Id: I532731fe4cddf127253341e5ace8d9c5c9ebb0f1
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326108
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Same idea as http://review.skia.org/325857; I just wanted to feel out
the options myself. A couple key ideas:
Prefer SkTo32() to separate range assertions and casts.
Keep using int indices, counting to this->count() where
fCount would have warned about signed/unsigned mismatch.
I've kept new comments and assertions to minimum. In the end we won't
change the max size of SkTArray, and I don't see much need to call out
how much it hasn't changed. Reading back over the accumulated changes,
I don't really see much that's newly error-prone.
Change-Id: I86a8a161b9ae44f24fc25093741945b75fbfa770
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/326106
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>