/src/skia/include/private/base/SkTemplates.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * Copyright 2006 The Android Open Source Project |
3 | | * |
4 | | * Use of this source code is governed by a BSD-style license that can be |
5 | | * found in the LICENSE file. |
6 | | */ |
7 | | |
8 | | #ifndef SkTemplates_DEFINED |
9 | | #define SkTemplates_DEFINED |
10 | | |
11 | | #include "include/private/base/SkAlign.h" |
12 | | #include "include/private/base/SkAssert.h" |
13 | | #include "include/private/base/SkDebug.h" |
14 | | #include "include/private/base/SkMalloc.h" |
15 | | #include "include/private/base/SkTLogic.h" |
16 | | #include "include/private/base/SkTo.h" |
17 | | |
18 | | #include <array> |
19 | | #include <cstddef> |
20 | | #include <cstdint> |
21 | | #include <cstring> |
22 | | #include <memory> |
23 | | #include <type_traits> |
24 | | #include <utility> |
25 | | |
26 | | |
27 | | /** \file SkTemplates.h |
28 | | |
29 | | This file contains light-weight template classes for type-safe and exception-safe |
30 | | resource management. |
31 | | */ |
32 | | |
33 | | /** |
34 | | * Marks a local variable as known to be unused (to avoid warnings). |
35 | | * Note that this does *not* prevent the local variable from being optimized away. |
36 | | */ |
37 | 24.4k | template<typename T> inline void sk_ignore_unused_variable(const T&) { } void sk_ignore_unused_variable<unsigned char>(unsigned char const&) Line | Count | Source | 37 | 24.4k | template<typename T> inline void sk_ignore_unused_variable(const T&) { } |
Unexecuted instantiation: void sk_ignore_unused_variable<bool>(bool const&) void sk_ignore_unused_variable<int>(int const&) Line | Count | Source | 37 | 6 | template<typename T> inline void sk_ignore_unused_variable(const T&) { } |
Unexecuted instantiation: void sk_ignore_unused_variable<float>(float const&) |
38 | | |
39 | | /** |
40 | | * This is a general purpose absolute-value function. |
41 | | * See SkAbs32 in (SkSafe32.h) for a 32-bit int specific version that asserts. |
42 | | */ |
43 | 454M | template <typename T> static inline T SkTAbs(T value) { |
44 | 454M | if (value < 0) { |
45 | 179M | value = -value; |
46 | 179M | } |
47 | 454M | return value; |
48 | 454M | } Unexecuted instantiation: DebugCanvas.cpp:float SkTAbs<float>(float) Unexecuted instantiation: DrawCommand.cpp:float SkTAbs<float>(float) Unexecuted instantiation: RandomScalerContext.cpp:float SkTAbs<float>(float) SkColorSpace.cpp:float SkTAbs<float>(float) Line | Count | Source | 43 | 425k | template <typename T> static inline T SkTAbs(T value) { | 44 | 425k | if (value < 0) { | 45 | 25.6k | value = -value; | 46 | 25.6k | } | 47 | 425k | return value; | 48 | 425k | } |
Unexecuted instantiation: SkColorSpaceXformSteps.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkDevice.cpp:float SkTAbs<float>(float) SkGeometry.cpp:float SkTAbs<float>(float) Line | Count | Source | 43 | 1.38M | template <typename T> static inline T SkTAbs(T value) { | 44 | 1.38M | if (value < 0) { | 45 | 910k | value = -value; | 46 | 910k | } | 47 | 1.38M | return value; | 48 | 1.38M | } |
Unexecuted instantiation: SkImageFilter.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkImageFilterTypes.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkPaint.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkPaintPriv.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkRRect.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkRect.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkRuntimeEffect.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkScan_Path.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkImage.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkColorShader.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkOpBuilder.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkOpContour.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkOpEdgeBuilder.cpp:float SkTAbs<float>(float) SkOpSegment.cpp:float SkTAbs<float>(float) Line | Count | Source | 43 | 205M | template <typename T> static inline T SkTAbs(T value) { | 44 | 205M | if (value < 0) { | 45 | 78.9M | value = -value; | 46 | 78.9M | } | 47 | 205M | return value; | 48 | 205M | } |
SkOpSegment.cpp:int SkTAbs<int>(int) Line | Count | Source | 43 | 100M | template <typename T> static inline T SkTAbs(T value) { | 44 | 100M | if (value < 0) { | 45 | 34.2M | value = -value; | 46 | 34.2M | } | 47 | 100M | return value; | 48 | 100M | } |
Unexecuted instantiation: SkOpSpan.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkPathOpsConic.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkPathOpsCubic.cpp:float SkTAbs<float>(float) SkPathOpsCurve.cpp:double SkTAbs<double>(double) Line | Count | Source | 43 | 145M | template <typename T> static inline T SkTAbs(T value) { | 44 | 145M | if (value < 0) { | 45 | 65.3M | value = -value; | 46 | 65.3M | } | 47 | 145M | return value; | 48 | 145M | } |
Unexecuted instantiation: SkPathOpsCurve.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkPathOpsDebug.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkPathOpsLine.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkPathOpsOp.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkPathOpsQuad.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkPathOpsRect.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkPathOpsSimplify.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkPathOpsTypes.cpp:int SkTAbs<int>(int) Unexecuted instantiation: SkPathOpsWinding.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkPathWriter.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkReduceOrder.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkPatchUtils.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkShadowUtils.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkBlendModeColorFilter.cpp:float SkTAbs<float>(float) Unexecuted instantiation: GrColorInfo.cpp:float SkTAbs<float>(float) Unexecuted instantiation: GrColorSpaceXform.cpp:float SkTAbs<float>(float) Unexecuted instantiation: GrTestUtils.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SurfaceDrawContext.cpp:float SkTAbs<float>(float) Unexecuted instantiation: GrSkSLFP.cpp:float SkTAbs<float>(float) Unexecuted instantiation: GrGLSLShaderBuilder.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkImage_GaneshBase.cpp:float SkTAbs<float>(float) Unexecuted instantiation: AAHairLinePathRenderer.cpp:float SkTAbs<float>(float) Unexecuted instantiation: DrawAtlasOp.cpp:float SkTAbs<float>(float) Unexecuted instantiation: DrawMeshOp.cpp:float SkTAbs<float>(float) Unexecuted instantiation: FillRectOp.cpp:float SkTAbs<float>(float) Unexecuted instantiation: LatticeOp.cpp:float SkTAbs<float>(float) Unexecuted instantiation: OpsTask.cpp:float SkTAbs<float>(float) Unexecuted instantiation: QuadPerEdgeAA.cpp:float SkTAbs<float>(float) Unexecuted instantiation: TextureOp.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkIcoCodec.cpp:float SkTAbs<float>(float) SkFontHost_FreeType_common.cpp:int SkTAbs<int>(int) Line | Count | Source | 43 | 217 | template <typename T> static inline T SkTAbs(T value) { | 44 | 217 | if (value < 0) { | 45 | 0 | value = -value; | 46 | 0 | } | 47 | 217 | return value; | 48 | 217 | } |
Unexecuted instantiation: DataUtils.cpp:int SkTAbs<int>(int) SkDraw.cpp:float SkTAbs<float>(float) Line | Count | Source | 43 | 21.4k | template <typename T> static inline T SkTAbs(T value) { | 44 | 21.4k | if (value < 0) { | 45 | 3.26k | value = -value; | 46 | 3.26k | } | 47 | 21.4k | return value; | 48 | 21.4k | } |
SkDrawBase.cpp:float SkTAbs<float>(float) Line | Count | Source | 43 | 71.2k | template <typename T> static inline T SkTAbs(T value) { | 44 | 71.2k | if (value < 0) { | 45 | 5.27k | value = -value; | 46 | 5.27k | } | 47 | 71.2k | return value; | 48 | 71.2k | } |
Unexecuted instantiation: SkDraw_atlas.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkRasterPipelineBlitter.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkImage_Base.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkAddIntersections.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkDConicLineIntersection.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkDCubicLineIntersection.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkDLineIntersection.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkDQuadLineIntersection.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkIntersections.cpp:float SkTAbs<float>(float) SkOpAngle.cpp:int SkTAbs<int>(int) Line | Count | Source | 43 | 658k | template <typename T> static inline T SkTAbs(T value) { | 44 | 658k | if (value < 0) { | 45 | 93.1k | value = -value; | 46 | 93.1k | } | 47 | 658k | return value; | 48 | 658k | } |
Unexecuted instantiation: SkOpAngle.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkOpCoincidence.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkOpCubicHull.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkPathOpsAsWinding.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkPathOpsCommon.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkPathOpsTSect.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkShadowTessellator.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkGradientBaseShader.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkBlendImageFilter.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkColorFilterImageFilter.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkCropImageFilter.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkLightingImageFilter.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkMatrixConvolutionImageFilter.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkRuntimeImageFilter.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkShaderImageFilter.cpp:float SkTAbs<float>(float) GrDistanceFieldGenFromVector.cpp:double SkTAbs<double>(double) Line | Count | Source | 43 | 80 | template <typename T> static inline T SkTAbs(T value) { | 44 | 80 | if (value < 0) { | 45 | 0 | value = -value; | 46 | 0 | } | 47 | 80 | return value; | 48 | 80 | } |
Unexecuted instantiation: GrDistanceFieldGenFromVector.cpp:float SkTAbs<float>(float) Unexecuted instantiation: GrFragmentProcessors.cpp:float SkTAbs<float>(float) Unexecuted instantiation: GrRenderTarget.cpp:float SkTAbs<float>(float) Unexecuted instantiation: GrBitmapTextGeoProc.cpp:float SkTAbs<float>(float) Unexecuted instantiation: GrGradientShader.cpp:float SkTAbs<float>(float) Unexecuted instantiation: Device.cpp:float SkTAbs<float>(float) Unexecuted instantiation: PaintParams.cpp:float SkTAbs<float>(float) Unexecuted instantiation: ShaderCodeDictionary.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkBlitter_Sprite.cpp:float SkTAbs<float>(float) SkPolyUtils.cpp:float SkTAbs<float>(float) Line | Count | Source | 43 | 1.72k | template <typename T> static inline T SkTAbs(T value) { | 44 | 1.72k | if (value < 0) { | 45 | 0 | value = -value; | 46 | 0 | } | 47 | 1.72k | return value; | 48 | 1.72k | } |
Unexecuted instantiation: ClipStack.cpp:float SkTAbs<float>(float) Unexecuted instantiation: ClipStack_graphite.cpp:float SkTAbs<float>(float) Unexecuted instantiation: KeyHelpers.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkPDFDocument.cpp:int SkTAbs<int>(int) Unexecuted instantiation: SkPDFMetadata.cpp:int SkTAbs<int>(int) Unexecuted instantiation: SkClipStack.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkPDFDevice.cpp:float SkTAbs<float>(float) Unexecuted instantiation: FactoryFunctions.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkOpSpan.cpp:int SkTAbs<int>(int) Unexecuted instantiation: SkPathOpsTightBounds.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkSGNode.cpp:float SkTAbs<float>(float) Unexecuted instantiation: SkSGPath.cpp:float SkTAbs<float>(float) |
49 | | |
50 | | /** |
51 | | * Returns a pointer to a D which comes immediately after S[count]. |
52 | | */ |
53 | | template <typename D, typename S> inline D* SkTAfter(S* ptr, size_t count = 1) { |
54 | | return reinterpret_cast<D*>(ptr + count); |
55 | | } |
56 | | |
57 | | /** |
58 | | * Returns a pointer to a D which comes byteOffset bytes after S. |
59 | | */ |
60 | 538M | template <typename D, typename S> inline D* SkTAddOffset(S* ptr, ptrdiff_t byteOffset) { |
61 | | // The intermediate char* has the same cv-ness as D as this produces better error messages. |
62 | | // This relies on the fact that reinterpret_cast can add constness, but cannot remove it. |
63 | 538M | return reinterpret_cast<D*>(reinterpret_cast<sknonstd::same_cv_t<char, D>*>(ptr) + byteOffset); |
64 | 538M | } Unexecuted instantiation: float* SkTAddOffset<float, void>(void*, long) void* SkTAddOffset<void, void>(void*, long) Line | Count | Source | 60 | 332M | template <typename D, typename S> inline D* SkTAddOffset(S* ptr, ptrdiff_t byteOffset) { | 61 | | // The intermediate char* has the same cv-ness as D as this produces better error messages. | 62 | | // This relies on the fact that reinterpret_cast can add constness, but cannot remove it. | 63 | 332M | return reinterpret_cast<D*>(reinterpret_cast<sknonstd::same_cv_t<char, D>*>(ptr) + byteOffset); | 64 | 332M | } |
void const* SkTAddOffset<void const, void const>(void const*, long) Line | Count | Source | 60 | 24.3M | template <typename D, typename S> inline D* SkTAddOffset(S* ptr, ptrdiff_t byteOffset) { | 61 | | // The intermediate char* has the same cv-ness as D as this produces better error messages. | 62 | | // This relies on the fact that reinterpret_cast can add constness, but cannot remove it. | 63 | 24.3M | return reinterpret_cast<D*>(reinterpret_cast<sknonstd::same_cv_t<char, D>*>(ptr) + byteOffset); | 64 | 24.3M | } |
unsigned char const* SkTAddOffset<unsigned char const, unsigned char const>(unsigned char const*, long) Line | Count | Source | 60 | 12.5M | template <typename D, typename S> inline D* SkTAddOffset(S* ptr, ptrdiff_t byteOffset) { | 61 | | // The intermediate char* has the same cv-ness as D as this produces better error messages. | 62 | | // This relies on the fact that reinterpret_cast can add constness, but cannot remove it. | 63 | 12.5M | return reinterpret_cast<D*>(reinterpret_cast<sknonstd::same_cv_t<char, D>*>(ptr) + byteOffset); | 64 | 12.5M | } |
unsigned int const* SkTAddOffset<unsigned int const, unsigned int const>(unsigned int const*, long) Line | Count | Source | 60 | 106 | template <typename D, typename S> inline D* SkTAddOffset(S* ptr, ptrdiff_t byteOffset) { | 61 | | // The intermediate char* has the same cv-ness as D as this produces better error messages. | 62 | | // This relies on the fact that reinterpret_cast can add constness, but cannot remove it. | 63 | 106 | return reinterpret_cast<D*>(reinterpret_cast<sknonstd::same_cv_t<char, D>*>(ptr) + byteOffset); | 64 | 106 | } |
Unexecuted instantiation: unsigned short const* SkTAddOffset<unsigned short const, unsigned short const>(unsigned short const*, long) unsigned char* SkTAddOffset<unsigned char, unsigned char>(unsigned char*, long) Line | Count | Source | 60 | 34.0M | template <typename D, typename S> inline D* SkTAddOffset(S* ptr, ptrdiff_t byteOffset) { | 61 | | // The intermediate char* has the same cv-ness as D as this produces better error messages. | 62 | | // This relies on the fact that reinterpret_cast can add constness, but cannot remove it. | 63 | 34.0M | return reinterpret_cast<D*>(reinterpret_cast<sknonstd::same_cv_t<char, D>*>(ptr) + byteOffset); | 64 | 34.0M | } |
Unexecuted instantiation: unsigned long const* SkTAddOffset<unsigned long const, unsigned long const>(unsigned long const*, long) float const* SkTAddOffset<float const, float const>(float const*, long) Line | Count | Source | 60 | 6.11k | template <typename D, typename S> inline D* SkTAddOffset(S* ptr, ptrdiff_t byteOffset) { | 61 | | // The intermediate char* has the same cv-ness as D as this produces better error messages. | 62 | | // This relies on the fact that reinterpret_cast can add constness, but cannot remove it. | 63 | 6.11k | return reinterpret_cast<D*>(reinterpret_cast<sknonstd::same_cv_t<char, D>*>(ptr) + byteOffset); | 64 | 6.11k | } |
unsigned int* SkTAddOffset<unsigned int, unsigned int>(unsigned int*, long) Line | Count | Source | 60 | 34.8M | template <typename D, typename S> inline D* SkTAddOffset(S* ptr, ptrdiff_t byteOffset) { | 61 | | // The intermediate char* has the same cv-ness as D as this produces better error messages. | 62 | | // This relies on the fact that reinterpret_cast can add constness, but cannot remove it. | 63 | 34.8M | return reinterpret_cast<D*>(reinterpret_cast<sknonstd::same_cv_t<char, D>*>(ptr) + byteOffset); | 64 | 34.8M | } |
Unexecuted instantiation: unsigned short* SkTAddOffset<unsigned short, unsigned short>(unsigned short*, long) Unexecuted instantiation: unsigned long* SkTAddOffset<unsigned long, unsigned long>(unsigned long*, long) unsigned int* SkTAddOffset<unsigned int, void>(void*, long) Line | Count | Source | 60 | 567k | template <typename D, typename S> inline D* SkTAddOffset(S* ptr, ptrdiff_t byteOffset) { | 61 | | // The intermediate char* has the same cv-ness as D as this produces better error messages. | 62 | | // This relies on the fact that reinterpret_cast can add constness, but cannot remove it. | 63 | 567k | return reinterpret_cast<D*>(reinterpret_cast<sknonstd::same_cv_t<char, D>*>(ptr) + byteOffset); | 64 | 567k | } |
Unexecuted instantiation: unsigned short* SkTAddOffset<unsigned short, void>(void*, long) Unexecuted instantiation: float const* SkTAddOffset<float const, void const>(void const*, long) Unexecuted instantiation: int const* SkTAddOffset<int const, void const>(void const*, long) Unexecuted instantiation: char const* SkTAddOffset<char const, void const>(void const*, long) Unexecuted instantiation: unsigned short const* SkTAddOffset<unsigned short const, void const>(void const*, long) Unexecuted instantiation: void* SkTAddOffset<void, char>(char*, long) unsigned long const* SkTAddOffset<unsigned long const, void const>(void const*, long) Line | Count | Source | 60 | 628 | template <typename D, typename S> inline D* SkTAddOffset(S* ptr, ptrdiff_t byteOffset) { | 61 | | // The intermediate char* has the same cv-ness as D as this produces better error messages. | 62 | | // This relies on the fact that reinterpret_cast can add constness, but cannot remove it. | 63 | 628 | return reinterpret_cast<D*>(reinterpret_cast<sknonstd::same_cv_t<char, D>*>(ptr) + byteOffset); | 64 | 628 | } |
unsigned int const* SkTAddOffset<unsigned int const, void const>(void const*, long) Line | Count | Source | 60 | 2.36k | template <typename D, typename S> inline D* SkTAddOffset(S* ptr, ptrdiff_t byteOffset) { | 61 | | // The intermediate char* has the same cv-ness as D as this produces better error messages. | 62 | | // This relies on the fact that reinterpret_cast can add constness, but cannot remove it. | 63 | 2.36k | return reinterpret_cast<D*>(reinterpret_cast<sknonstd::same_cv_t<char, D>*>(ptr) + byteOffset); | 64 | 2.36k | } |
unsigned int* SkTAddOffset<unsigned int, unsigned char>(unsigned char*, long) Line | Count | Source | 60 | 72 | template <typename D, typename S> inline D* SkTAddOffset(S* ptr, ptrdiff_t byteOffset) { | 61 | | // The intermediate char* has the same cv-ness as D as this produces better error messages. | 62 | | // This relies on the fact that reinterpret_cast can add constness, but cannot remove it. | 63 | 72 | return reinterpret_cast<D*>(reinterpret_cast<sknonstd::same_cv_t<char, D>*>(ptr) + byteOffset); | 64 | 72 | } |
char* SkTAddOffset<char, void>(void*, long) Line | Count | Source | 60 | 901 | template <typename D, typename S> inline D* SkTAddOffset(S* ptr, ptrdiff_t byteOffset) { | 61 | | // The intermediate char* has the same cv-ness as D as this produces better error messages. | 62 | | // This relies on the fact that reinterpret_cast can add constness, but cannot remove it. | 63 | 901 | return reinterpret_cast<D*>(reinterpret_cast<sknonstd::same_cv_t<char, D>*>(ptr) + byteOffset); | 64 | 901 | } |
void* SkTAddOffset<void, SkDescriptor>(SkDescriptor*, long) Line | Count | Source | 60 | 322 | template <typename D, typename S> inline D* SkTAddOffset(S* ptr, ptrdiff_t byteOffset) { | 61 | | // The intermediate char* has the same cv-ness as D as this produces better error messages. | 62 | | // This relies on the fact that reinterpret_cast can add constness, but cannot remove it. | 63 | 322 | return reinterpret_cast<D*>(reinterpret_cast<sknonstd::same_cv_t<char, D>*>(ptr) + byteOffset); | 64 | 322 | } |
void* SkTAddOffset<void, std::byte>(std::byte*, long) Line | Count | Source | 60 | 98.5M | template <typename D, typename S> inline D* SkTAddOffset(S* ptr, ptrdiff_t byteOffset) { | 61 | | // The intermediate char* has the same cv-ness as D as this produces better error messages. | 62 | | // This relies on the fact that reinterpret_cast can add constness, but cannot remove it. | 63 | 98.5M | return reinterpret_cast<D*>(reinterpret_cast<sknonstd::same_cv_t<char, D>*>(ptr) + byteOffset); | 64 | 98.5M | } |
Unexecuted instantiation: int* SkTAddOffset<int, int>(int*, long) void const* SkTAddOffset<void const, unsigned char>(unsigned char*, long) Line | Count | Source | 60 | 800k | template <typename D, typename S> inline D* SkTAddOffset(S* ptr, ptrdiff_t byteOffset) { | 61 | | // The intermediate char* has the same cv-ness as D as this produces better error messages. | 62 | | // This relies on the fact that reinterpret_cast can add constness, but cannot remove it. | 63 | 800k | return reinterpret_cast<D*>(reinterpret_cast<sknonstd::same_cv_t<char, D>*>(ptr) + byteOffset); | 64 | 800k | } |
|
65 | | |
66 | | template <typename T, T* P> struct SkOverloadedFunctionObject { |
67 | | template <typename... Args> |
68 | 999k | auto operator()(Args&&... args) const -> decltype(P(std::forward<Args>(args)...)) { |
69 | 999k | return P(std::forward<Args>(args)...); |
70 | 999k | } _ZNK26SkOverloadedFunctionObjectIFvPvEXadL_Z7sk_freeS0_EEEclIJRP7SkPointEEEDTcladL_Z7sk_freeS0_Espclsr3stdE7forwardIT_Efp_EEEDpOS7_ Line | Count | Source | 68 | 10.6k | auto operator()(Args&&... args) const -> decltype(P(std::forward<Args>(args)...)) { | 69 | 10.6k | return P(std::forward<Args>(args)...); | 70 | 10.6k | } |
_ZNK26SkOverloadedFunctionObjectIFvPvEXadL_Z7sk_freeS0_EEEclIJRPhEEEDTcladL_Z7sk_freeS0_Espclsr3stdE7forwardIT_Efp_EEEDpOS6_ Line | Count | Source | 68 | 41.2k | auto operator()(Args&&... args) const -> decltype(P(std::forward<Args>(args)...)) { | 69 | 41.2k | return P(std::forward<Args>(args)...); | 70 | 41.2k | } |
_ZNK26SkOverloadedFunctionObjectIFvPvEXadL_Z7sk_freeS0_EEEclIJRPN15SkFontArguments7Palette8OverrideEEEEDTcladL_Z7sk_freeS0_Espclsr3stdE7forwardIT_Efp_EEEDpOS9_ Line | Count | Source | 68 | 26.7k | auto operator()(Args&&... args) const -> decltype(P(std::forward<Args>(args)...)) { | 69 | 26.7k | return P(std::forward<Args>(args)...); | 70 | 26.7k | } |
_ZNK26SkOverloadedFunctionObjectIFvPvEXadL_Z7sk_freeS0_EEEclIJRPjEEEDTcladL_Z7sk_freeS0_Espclsr3stdE7forwardIT_Efp_EEEDpOS6_ Line | Count | Source | 68 | 49.6k | auto operator()(Args&&... args) const -> decltype(P(std::forward<Args>(args)...)) { | 69 | 49.6k | return P(std::forward<Args>(args)...); | 70 | 49.6k | } |
_ZNK26SkOverloadedFunctionObjectIFvPvEXadL_ZN13SkMaskBuilder9FreeImageES0_EEEclIJRPhEEEDTcladL_ZNS2_9FreeImageES0_Espclsr3stdE7forwardIT_Efp_EEEDpOS7_ Line | Count | Source | 68 | 105k | auto operator()(Args&&... args) const -> decltype(P(std::forward<Args>(args)...)) { | 69 | 105k | return P(std::forward<Args>(args)...); | 70 | 105k | } |
Unexecuted instantiation: _ZNK26SkOverloadedFunctionObjectIFvPvEXadL_Z7sk_freeS0_EEEclIJRPN15SkBBoxHierarchy8MetadataEEEEDTcladL_Z7sk_freeS0_Espclsr3stdE7forwardIT_Efp_EEEDpOS8_ Unexecuted instantiation: _ZNK26SkOverloadedFunctionObjectIFvPvEXadL_Z7sk_freeS0_EEEclIJRPPK9SkPictureEEEDTcladL_Z7sk_freeS0_Espclsr3stdE7forwardIT_Efp_EEEDpOS9_ _ZNK26SkOverloadedFunctionObjectIFvPvEXadL_Z7sk_freeS0_EEEclIJRPN8SkRecord6RecordEEEEDTcladL_Z7sk_freeS0_Espclsr3stdE7forwardIT_Efp_EEEDpOS8_ Line | Count | Source | 68 | 127k | auto operator()(Args&&... args) const -> decltype(P(std::forward<Args>(args)...)) { | 69 | 127k | return P(std::forward<Args>(args)...); | 70 | 127k | } |
_ZNK26SkOverloadedFunctionObjectIFvPvEXadL_Z7sk_freeS0_EEEclIJRPiEEEDTcladL_Z7sk_freeS0_Espclsr3stdE7forwardIT_Efp_EEEDpOS6_ Line | Count | Source | 68 | 385k | auto operator()(Args&&... args) const -> decltype(P(std::forward<Args>(args)...)) { | 69 | 385k | return P(std::forward<Args>(args)...); | 70 | 385k | } |
_ZNK26SkOverloadedFunctionObjectIFvPvEXadL_Z7sk_freeS0_EEEclIJRPcEEEDTcladL_Z7sk_freeS0_Espclsr3stdE7forwardIT_Efp_EEEDpOS6_ Line | Count | Source | 68 | 2.08k | auto operator()(Args&&... args) const -> decltype(P(std::forward<Args>(args)...)) { | 69 | 2.08k | return P(std::forward<Args>(args)...); | 70 | 2.08k | } |
_ZNK26SkOverloadedFunctionObjectIFvPvEXadL_Z7sk_freeS0_EEEclIJRS0_EEEDTcladL_Z7sk_freeS0_Espclsr3stdE7forwardIT_Efp_EEEDpOS5_ Line | Count | Source | 68 | 18.2k | auto operator()(Args&&... args) const -> decltype(P(std::forward<Args>(args)...)) { | 69 | 18.2k | return P(std::forward<Args>(args)...); | 70 | 18.2k | } |
_ZNK26SkOverloadedFunctionObjectIFvP17WebPChunkIteratorEXadL_Z29WebPDemuxReleaseChunkIteratorEEEclIJRS1_EEEDTcladL_Z29WebPDemuxReleaseChunkIteratorEspclsr3stdE7forwardIT_Efp_EEEDpOS6_ Line | Count | Source | 68 | 32.0k | auto operator()(Args&&... args) const -> decltype(P(std::forward<Args>(args)...)) { | 69 | 32.0k | return P(std::forward<Args>(args)...); | 70 | 32.0k | } |
_ZNK26SkOverloadedFunctionObjectIFvP12WebPIteratorEXadL_Z24WebPDemuxReleaseIteratorEEEclIJRS1_EEEDTcladL_Z24WebPDemuxReleaseIteratorEspclsr3stdE7forwardIT_Efp_EEEDpOS6_ Line | Count | Source | 68 | 39.1k | auto operator()(Args&&... args) const -> decltype(P(std::forward<Args>(args)...)) { | 69 | 39.1k | return P(std::forward<Args>(args)...); | 70 | 39.1k | } |
_ZNK26SkOverloadedFunctionObjectIFvP11WebPDemuxerEXadL_Z15WebPDemuxDeleteEEEclIJRS1_EEEDTcladL_Z15WebPDemuxDeleteEspclsr3stdE7forwardIT_Efp_EEEDpOS6_ Line | Count | Source | 68 | 17.7k | auto operator()(Args&&... args) const -> decltype(P(std::forward<Args>(args)...)) { | 69 | 17.7k | return P(std::forward<Args>(args)...); | 70 | 17.7k | } |
_ZNK26SkOverloadedFunctionObjectIFvP12WebPIDecoderEXadL_Z11WebPIDeleteEEEclIJRS1_EEEDTcladL_Z11WebPIDeleteEspclsr3stdE7forwardIT_Efp_EEEDpOS6_ Line | Count | Source | 68 | 21.9k | auto operator()(Args&&... args) const -> decltype(P(std::forward<Args>(args)...)) { | 69 | 21.9k | return P(std::forward<Args>(args)...); | 70 | 21.9k | } |
_ZNK26SkOverloadedFunctionObjectIFvP13WebPDecBufferEXadL_Z17WebPFreeDecBufferEEEclIJRS1_EEEDTcladL_Z17WebPFreeDecBufferEspclsr3stdE7forwardIT_Efp_EEEDpOS6_ Line | Count | Source | 68 | 22.0k | auto operator()(Args&&... args) const -> decltype(P(std::forward<Args>(args)...)) { | 69 | 22.0k | return P(std::forward<Args>(args)...); | 70 | 22.0k | } |
_ZNK26SkOverloadedFunctionObjectIFiP11FT_FaceRec_EXadL_Z12FT_Done_FaceEEEclIJRS1_EEEDTcladL_Z12FT_Done_FaceEspclsr3stdE7forwardIT_Efp_EEEDpOS6_ Line | Count | Source | 68 | 54.1k | auto operator()(Args&&... args) const -> decltype(P(std::forward<Args>(args)...)) { | 69 | 54.1k | return P(std::forward<Args>(args)...); | 70 | 54.1k | } |
_ZNK26SkOverloadedFunctionObjectIFiP11FT_SizeRec_EXadL_Z12FT_Done_SizeEEEclIJRS1_EEEDTcladL_Z12FT_Done_SizeEspclsr3stdE7forwardIT_Efp_EEEDpOS6_ Line | Count | Source | 68 | 37.5k | auto operator()(Args&&... args) const -> decltype(P(std::forward<Args>(args)...)) { | 69 | 37.5k | return P(std::forward<Args>(args)...); | 70 | 37.5k | } |
Unexecuted instantiation: _ZNK26SkOverloadedFunctionObjectIFvPvEXadL_Z7sk_freeS0_EEEclIJRPfEEEDTcladL_Z7sk_freeS0_Espclsr3stdE7forwardIT_Efp_EEEDpOS6_ Unexecuted instantiation: _ZNK26SkOverloadedFunctionObjectIFvPvEXadL_Z7sk_freeS0_EEEclIJRPN5skgpu8graphite14MonotonicValueINS5_31CompressedPaintersOrderSequenceEEEEEEDTcladL_Z7sk_freeS0_Espclsr3stdE7forwardIT_Efp_EEEDpOSB_ _ZNK26SkOverloadedFunctionObjectIFvP16XML_ParserStructEXadL_Z14XML_ParserFreeEEEclIJRS1_EEEDTcladL_Z14XML_ParserFreeEspclsr3stdE7forwardIT_Efp_EEEDpOS6_ Line | Count | Source | 68 | 2.80k | auto operator()(Args&&... args) const -> decltype(P(std::forward<Args>(args)...)) { | 69 | 2.80k | return P(std::forward<Args>(args)...); | 70 | 2.80k | } |
Unexecuted instantiation: _ZNK26SkOverloadedFunctionObjectIFvP9hb_font_tEXadL_Z15hb_font_destroyEEEclIJRS1_EEEDTcladL_Z15hb_font_destroyEspclsr3stdE7forwardIT_Efp_EEEDpOS6_ Unexecuted instantiation: _ZNK26SkOverloadedFunctionObjectIFvP11hb_buffer_tEXadL_Z17hb_buffer_destroyEEEclIJRS1_EEEDTcladL_Z17hb_buffer_destroyEspclsr3stdE7forwardIT_Efp_EEEDpOS6_ Unexecuted instantiation: _ZNK26SkOverloadedFunctionObjectIFvP9hb_blob_tEXadL_Z15hb_blob_destroyEEEclIJRS1_EEEDTcladL_Z15hb_blob_destroyEspclsr3stdE7forwardIT_Efp_EEEDpOS6_ Unexecuted instantiation: _ZNK26SkOverloadedFunctionObjectIFvP9hb_face_tEXadL_Z15hb_face_destroyEEEclIJRS1_EEEDTcladL_Z15hb_face_destroyEspclsr3stdE7forwardIT_Efp_EEEDpOS6_ Unexecuted instantiation: _ZNK26SkOverloadedFunctionObjectIFvP11hb_buffer_tEXadL_Z24hb_buffer_clear_contentsEEEclIJRS1_EEEDTcladL_Z24hb_buffer_clear_contentsEspclsr3stdE7forwardIT_Efp_EEEDpOS6_ Unexecuted instantiation: SkUnicode_icu.cpp:_ZNK26SkOverloadedFunctionObjectIFP5UTextS1_EXadL_ZL19utext_close_wrapperS1_EEEclIJRS1_EEEDTcladL_ZL19utext_close_wrapperS1_Espclsr3stdE7forwardIT_Efp_EEEDpOS6_ Unexecuted instantiation: SkUnicode_icu.cpp:_ZNK26SkOverloadedFunctionObjectIFvP14UBreakIteratorEXadL_ZL18ubrk_close_wrapperS1_EEEclIJRS1_EEEDTcladL_ZL18ubrk_close_wrapperS1_Espclsr3stdE7forwardIT_Efp_EEEDpOS6_ Unexecuted instantiation: _ZNK26SkOverloadedFunctionObjectIFvP17hb_subset_input_tEXadL_Z23hb_subset_input_destroyEEEclIJRS1_EEEDTcladL_Z23hb_subset_input_destroyEspclsr3stdE7forwardIT_Efp_EEEDpOS6_ Unexecuted instantiation: SkWebpEncoderImpl.cpp:_ZNK26SkOverloadedFunctionObjectIFvP8WebPDataEXadL_ZL13WebPDataClearS1_EEEclIJRS1_EEEDTcladL_ZL13WebPDataClearS1_Espclsr3stdE7forwardIT_Efp_EEEDpOS6_ Unexecuted instantiation: _ZNK26SkOverloadedFunctionObjectIFvP7WebPMuxEXadL_Z13WebPMuxDeleteEEEclIJRS1_EEEDTcladL_Z13WebPMuxDeleteEspclsr3stdE7forwardIT_Efp_EEEDpOS6_ _ZNK26SkOverloadedFunctionObjectIFvP11WebPPictureEXadL_Z15WebPPictureFreeEEEclIJRS1_EEEDTcladL_Z15WebPPictureFreeEspclsr3stdE7forwardIT_Efp_EEEDpOS6_ Line | Count | Source | 68 | 4.78k | auto operator()(Args&&... args) const -> decltype(P(std::forward<Args>(args)...)) { | 69 | 4.78k | return P(std::forward<Args>(args)...); | 70 | 4.78k | } |
|
71 | | }; |
72 | | |
73 | | template <auto F> using SkFunctionObject = |
74 | | SkOverloadedFunctionObject<std::remove_pointer_t<decltype(F)>, F>; |
75 | | |
76 | | /** \class SkAutoTCallVProc |
77 | | |
78 | | Call a function when this goes out of scope. The template uses two |
79 | | parameters, the object, and a function that is to be called in the destructor. |
80 | | If release() is called, the object reference is set to null. If the object |
81 | | reference is null when the destructor is called, we do not call the |
82 | | function. |
83 | | */ |
84 | | template <typename T, void (*P)(T*)> class SkAutoTCallVProc |
85 | | : public std::unique_ptr<T, SkFunctionObject<P>> { |
86 | | using inherited = std::unique_ptr<T, SkFunctionObject<P>>; |
87 | | public: |
88 | | using inherited::inherited; |
89 | | SkAutoTCallVProc(const SkAutoTCallVProc&) = delete; |
90 | | SkAutoTCallVProc(SkAutoTCallVProc&& that) : inherited(std::move(that)) {} |
91 | | |
92 | 156k | operator T*() const { return this->get(); } SkAutoTCallVProc<WebPDemuxer, &WebPDemuxDelete>::operator WebPDemuxer*() const Line | Count | Source | 92 | 110k | operator T*() const { return this->get(); } |
SkAutoTCallVProc<WebPIDecoder, &WebPIDelete>::operator WebPIDecoder*() const Line | Count | Source | 92 | 28.6k | operator T*() const { return this->get(); } |
SkAutoTCallVProc<XML_ParserStruct, &XML_ParserFree>::operator XML_ParserStruct*() const Line | Count | Source | 92 | 16.8k | operator T*() const { return this->get(); } |
Unexecuted instantiation: SkAutoTCallVProc<WebPMux, &WebPMuxDelete>::operator WebPMux*() const |
93 | | }; |
94 | | |
95 | | |
96 | | namespace skia_private { |
97 | | /** Allocate an array of T elements, and free the array in the destructor |
98 | | */ |
99 | | template <typename T> class AutoTArray { |
100 | | public: |
101 | 853 | AutoTArray() {} Unexecuted instantiation: skia_private::AutoTArray<SkPoint>::AutoTArray() Unexecuted instantiation: skia_private::AutoTArray<SkMatrix>::AutoTArray() skia_private::AutoTArray<unsigned short>::AutoTArray() Line | Count | Source | 101 | 853 | AutoTArray() {} |
Unexecuted instantiation: skia_private::AutoTArray<float>::AutoTArray() |
102 | | // Allocate size number of T elements |
103 | 116k | explicit AutoTArray(size_t size) { |
104 | 116k | fSize = check_size_bytes_too_big<T>(size); |
105 | 116k | fData.reset(size > 0 ? new T[size] : nullptr); |
106 | 116k | } Unexecuted instantiation: skia_private::AutoTArray<DDLTileHelper::TileData>::AutoTArray(unsigned long) Unexecuted instantiation: skia_private::AutoTArray<SkPoint>::AutoTArray(unsigned long) skia_private::AutoTArray<SkCanvas::ImageSetEntry>::AutoTArray(unsigned long) Line | Count | Source | 103 | 3.38k | explicit AutoTArray(size_t size) { | 104 | 3.38k | fSize = check_size_bytes_too_big<T>(size); | 105 | 3.38k | fData.reset(size > 0 ? new T[size] : nullptr); | 106 | 3.38k | } |
Unexecuted instantiation: skia_private::AutoTArray<SkMatrix>::AutoTArray(unsigned long) skia_private::AutoTArray<int>::AutoTArray(unsigned long) Line | Count | Source | 103 | 900 | explicit AutoTArray(size_t size) { | 104 | 900 | fSize = check_size_bytes_too_big<T>(size); | 105 | 900 | fData.reset(size > 0 ? new T[size] : nullptr); | 106 | 900 | } |
Unexecuted instantiation: skia_private::AutoTArray<SkRect>::AutoTArray(unsigned long) skia_private::AutoTArray<sk_sp<SkImageFilter> >::AutoTArray(unsigned long) Line | Count | Source | 103 | 110k | explicit AutoTArray(size_t size) { | 104 | 110k | fSize = check_size_bytes_too_big<T>(size); | 105 | 110k | fData.reset(size > 0 ? new T[size] : nullptr); | 106 | 110k | } |
skia_private::AutoTArray<unsigned short>::AutoTArray(unsigned long) Line | Count | Source | 103 | 853 | explicit AutoTArray(size_t size) { | 104 | 853 | fSize = check_size_bytes_too_big<T>(size); | 105 | 853 | fData.reset(size > 0 ? new T[size] : nullptr); | 106 | 853 | } |
Unexecuted instantiation: skia_private::AutoTArray<float>::AutoTArray(unsigned long) Unexecuted instantiation: skia_private::AutoTArray<GrMipLevel>::AutoTArray(unsigned long) skia_private::AutoTArray<unsigned char>::AutoTArray(unsigned long) Line | Count | Source | 103 | 2 | explicit AutoTArray(size_t size) { | 104 | 2 | fSize = check_size_bytes_too_big<T>(size); | 105 | 2 | fData.reset(size > 0 ? new T[size] : nullptr); | 106 | 2 | } |
Unexecuted instantiation: skia_private::AutoTArray<GrTextureSetEntry>::AutoTArray(unsigned long) Unexecuted instantiation: skia_private::AutoTArray<char>::AutoTArray(unsigned long) skia_private::AutoTArray<PromiseImageInfo>::AutoTArray(unsigned long) Line | Count | Source | 103 | 28 | explicit AutoTArray(size_t size) { | 104 | 28 | fSize = check_size_bytes_too_big<T>(size); | 105 | 28 | fData.reset(size > 0 ? new T[size] : nullptr); | 106 | 28 | } |
|
107 | | |
108 | | // TODO: remove when all uses are gone. |
109 | 3.41k | explicit AutoTArray(int size) : AutoTArray(SkToSizeT(size)) {} Unexecuted instantiation: skia_private::AutoTArray<DDLTileHelper::TileData>::AutoTArray(int) skia_private::AutoTArray<SkCanvas::ImageSetEntry>::AutoTArray(int) Line | Count | Source | 109 | 3.38k | explicit AutoTArray(int size) : AutoTArray(SkToSizeT(size)) {} |
Unexecuted instantiation: skia_private::AutoTArray<SkRect>::AutoTArray(int) Unexecuted instantiation: skia_private::AutoTArray<GrMipLevel>::AutoTArray(int) Unexecuted instantiation: skia_private::AutoTArray<float>::AutoTArray(int) skia_private::AutoTArray<unsigned char>::AutoTArray(int) Line | Count | Source | 109 | 2 | explicit AutoTArray(int size) : AutoTArray(SkToSizeT(size)) {} |
Unexecuted instantiation: skia_private::AutoTArray<GrTextureSetEntry>::AutoTArray(int) Unexecuted instantiation: skia_private::AutoTArray<char>::AutoTArray(int) Unexecuted instantiation: skia_private::AutoTArray<unsigned short>::AutoTArray(int) skia_private::AutoTArray<PromiseImageInfo>::AutoTArray(int) Line | Count | Source | 109 | 28 | explicit AutoTArray(int size) : AutoTArray(SkToSizeT(size)) {} |
|
110 | | |
111 | 111k | AutoTArray(AutoTArray&& other) : fData(std::move(other.fData)) { |
112 | 111k | fSize = std::exchange(other.fSize, 0); |
113 | 111k | } skia_private::AutoTArray<SkCanvas::ImageSetEntry>::AutoTArray(skia_private::AutoTArray<SkCanvas::ImageSetEntry>&&) Line | Count | Source | 111 | 603 | AutoTArray(AutoTArray&& other) : fData(std::move(other.fData)) { | 112 | 603 | fSize = std::exchange(other.fSize, 0); | 113 | 603 | } |
skia_private::AutoTArray<sk_sp<SkImageFilter> >::AutoTArray(skia_private::AutoTArray<sk_sp<SkImageFilter> >&&) Line | Count | Source | 111 | 110k | AutoTArray(AutoTArray&& other) : fData(std::move(other.fData)) { | 112 | 110k | fSize = std::exchange(other.fSize, 0); | 113 | 110k | } |
|
114 | 853 | AutoTArray& operator=(AutoTArray&& other) { |
115 | 853 | if (this != &other) { |
116 | 853 | fData = std::move(other.fData); |
117 | 853 | fSize = std::exchange(other.fSize, 0); |
118 | 853 | } |
119 | 853 | return *this; |
120 | 853 | } Unexecuted instantiation: skia_private::AutoTArray<SkPoint>::operator=(skia_private::AutoTArray<SkPoint>&&) Unexecuted instantiation: skia_private::AutoTArray<SkMatrix>::operator=(skia_private::AutoTArray<SkMatrix>&&) skia_private::AutoTArray<unsigned short>::operator=(skia_private::AutoTArray<unsigned short>&&) Line | Count | Source | 114 | 853 | AutoTArray& operator=(AutoTArray&& other) { | 115 | 853 | if (this != &other) { | 116 | 853 | fData = std::move(other.fData); | 117 | 853 | fSize = std::exchange(other.fSize, 0); | 118 | 853 | } | 119 | 853 | return *this; | 120 | 853 | } |
Unexecuted instantiation: skia_private::AutoTArray<float>::operator=(skia_private::AutoTArray<float>&&) Unexecuted instantiation: skia_private::AutoTArray<PromiseImageInfo>::operator=(skia_private::AutoTArray<PromiseImageInfo>&&) |
121 | | |
122 | | // Reallocates given a new count. Reallocation occurs even if new count equals old count. |
123 | 853 | void reset(size_t count = 0) { |
124 | 853 | *this = AutoTArray(count); |
125 | 853 | } Unexecuted instantiation: skia_private::AutoTArray<SkPoint>::reset(unsigned long) Unexecuted instantiation: skia_private::AutoTArray<SkMatrix>::reset(unsigned long) skia_private::AutoTArray<unsigned short>::reset(unsigned long) Line | Count | Source | 123 | 853 | void reset(size_t count = 0) { | 124 | 853 | *this = AutoTArray(count); | 125 | 853 | } |
Unexecuted instantiation: skia_private::AutoTArray<float>::reset(unsigned long) Unexecuted instantiation: skia_private::AutoTArray<PromiseImageInfo>::reset(unsigned long) |
126 | | |
127 | 3.25k | T* get() const { return fData.get(); } Unexecuted instantiation: skia_private::AutoTArray<SkPoint>::get() const skia_private::AutoTArray<SkCanvas::ImageSetEntry>::get() const Line | Count | Source | 127 | 626 | T* get() const { return fData.get(); } |
Unexecuted instantiation: skia_private::AutoTArray<SkMatrix>::get() const skia_private::AutoTArray<int>::get() const Line | Count | Source | 127 | 900 | T* get() const { return fData.get(); } |
skia_private::AutoTArray<unsigned short>::get() const Line | Count | Source | 127 | 1.70k | T* get() const { return fData.get(); } |
Unexecuted instantiation: skia_private::AutoTArray<float>::get() const Unexecuted instantiation: skia_private::AutoTArray<GrMipLevel>::get() const skia_private::AutoTArray<unsigned char>::get() const Line | Count | Source | 127 | 18 | T* get() const { return fData.get(); } |
Unexecuted instantiation: skia_private::AutoTArray<GrTextureSetEntry>::get() const |
128 | | |
129 | 18.2k | T& operator[](size_t index) const { |
130 | 18.2k | return fData[sk_collection_check_bounds(index, fSize)]; |
131 | 18.2k | } Unexecuted instantiation: skia_private::AutoTArray<DDLTileHelper::TileData>::operator[](unsigned long) const Unexecuted instantiation: skia_private::AutoTArray<SkPoint>::operator[](unsigned long) const skia_private::AutoTArray<int>::operator[](unsigned long) const Line | Count | Source | 129 | 10.1k | T& operator[](size_t index) const { | 130 | 10.1k | return fData[sk_collection_check_bounds(index, fSize)]; | 131 | 10.1k | } |
skia_private::AutoTArray<SkCanvas::ImageSetEntry>::operator[](unsigned long) const Line | Count | Source | 129 | 8.00k | T& operator[](size_t index) const { | 130 | 8.00k | return fData[sk_collection_check_bounds(index, fSize)]; | 131 | 8.00k | } |
Unexecuted instantiation: skia_private::AutoTArray<SkRect>::operator[](unsigned long) const skia_private::AutoTArray<sk_sp<SkImageFilter> >::operator[](unsigned long) const Line | Count | Source | 129 | 29 | T& operator[](size_t index) const { | 130 | 29 | return fData[sk_collection_check_bounds(index, fSize)]; | 131 | 29 | } |
Unexecuted instantiation: skia_private::AutoTArray<GrMipLevel>::operator[](unsigned long) const Unexecuted instantiation: skia_private::AutoTArray<float>::operator[](unsigned long) const Unexecuted instantiation: skia_private::AutoTArray<GrTextureSetEntry>::operator[](unsigned long) const Unexecuted instantiation: skia_private::AutoTArray<unsigned short>::operator[](unsigned long) const Unexecuted instantiation: skia_private::AutoTArray<PromiseImageInfo>::operator[](unsigned long) const |
132 | | |
133 | 15.5k | const T* data() const { return fData.get(); } |
134 | 0 | T* data() { return fData.get(); } Unexecuted instantiation: skia_private::AutoTArray<SkRect>::data() Unexecuted instantiation: skia_private::AutoTArray<char>::data() Unexecuted instantiation: skia_private::AutoTArray<unsigned short>::data() |
135 | | |
136 | 15.5k | size_t size() const { return fSize; } |
137 | 12.8k | bool empty() const { return fSize == 0; } |
138 | | size_t size_bytes() const { return sizeof(T) * fSize; } |
139 | | |
140 | | T* begin() { |
141 | | return fData; |
142 | | } |
143 | | const T* begin() const { |
144 | | return fData; |
145 | | } |
146 | | |
147 | | // It's safe to use fItemArray + fSize because if fItemArray is nullptr then adding 0 is |
148 | | // valid and returns nullptr. See [expr.add] in the C++ standard. |
149 | | T* end() { |
150 | | if (fData == nullptr) { |
151 | | SkASSERT(fSize == 0); |
152 | | } |
153 | | return fData + fSize; |
154 | | } |
155 | | const T* end() const { |
156 | | if (fData == nullptr) { |
157 | | SkASSERT(fSize == 0); |
158 | | } |
159 | | return fData + fSize; |
160 | | } |
161 | | |
162 | | private: |
163 | | std::unique_ptr<T[]> fData; |
164 | | size_t fSize = 0; |
165 | | }; |
166 | | |
167 | | /** Wraps AutoTArray, with room for kCountRequested elements preallocated. |
168 | | */ |
169 | | template <int kCountRequested, typename T> class AutoSTArray { |
170 | | public: |
171 | | AutoSTArray(AutoSTArray&&) = delete; |
172 | | AutoSTArray(const AutoSTArray&) = delete; |
173 | | AutoSTArray& operator=(AutoSTArray&&) = delete; |
174 | | AutoSTArray& operator=(const AutoSTArray&) = delete; |
175 | | |
176 | | /** Initialize with no objects */ |
177 | 1.21M | AutoSTArray() { |
178 | 1.21M | fArray = nullptr; |
179 | 1.21M | fCount = 0; |
180 | 1.21M | } skia_private::AutoSTArray<32, unsigned short>::AutoSTArray() Line | Count | Source | 177 | 13.7k | AutoSTArray() { | 178 | 13.7k | fArray = nullptr; | 179 | 13.7k | fCount = 0; | 180 | 13.7k | } |
skia_private::AutoSTArray<2, sk_sp<SkImageFilter> >::AutoSTArray() Line | Count | Source | 177 | 528k | AutoSTArray() { | 178 | 528k | fArray = nullptr; | 179 | 528k | fCount = 0; | 180 | 528k | } |
skia_private::AutoSTArray<20, SkGlyph const*>::AutoSTArray() Line | Count | Source | 177 | 60.0k | AutoSTArray() { | 178 | 60.0k | fArray = nullptr; | 179 | 60.0k | fCount = 0; | 180 | 60.0k | } |
skia_private::AutoSTArray<64, SkGlyph const*>::AutoSTArray() Line | Count | Source | 177 | 557 | AutoSTArray() { | 178 | 557 | fArray = nullptr; | 179 | 557 | fCount = 0; | 180 | 557 | } |
skia_private::AutoSTArray<4, float>::AutoSTArray() Line | Count | Source | 177 | 220k | AutoSTArray() { | 178 | 220k | fArray = nullptr; | 179 | 220k | fCount = 0; | 180 | 220k | } |
skia_private::AutoSTArray<8, unsigned int>::AutoSTArray() Line | Count | Source | 177 | 153k | AutoSTArray() { | 178 | 153k | fArray = nullptr; | 179 | 153k | fCount = 0; | 180 | 153k | } |
Unexecuted instantiation: skia_private::AutoSTArray<128, unsigned char>::AutoSTArray() skia_private::AutoSTArray<3, std::__1::unique_ptr<GrFragmentProcessor const, std::__1::default_delete<GrFragmentProcessor const> > >::AutoSTArray() Line | Count | Source | 177 | 116k | AutoSTArray() { | 178 | 116k | fArray = nullptr; | 179 | 116k | fCount = 0; | 180 | 116k | } |
skia_private::AutoSTArray<14, GrMipLevel>::AutoSTArray() Line | Count | Source | 177 | 60.0k | AutoSTArray() { | 178 | 60.0k | fArray = nullptr; | 179 | 60.0k | fCount = 0; | 180 | 60.0k | } |
skia_private::AutoSTArray<14, std::__1::unique_ptr<char [], std::__1::default_delete<char []> > >::AutoSTArray() Line | Count | Source | 177 | 60.0k | AutoSTArray() { | 178 | 60.0k | fArray = nullptr; | 179 | 60.0k | fCount = 0; | 180 | 60.0k | } |
Unexecuted instantiation: skia_private::AutoSTArray<16, GrMipLevel>::AutoSTArray() skia_private::AutoSTArray<24, unsigned int>::AutoSTArray() Line | Count | Source | 177 | 4.59k | AutoSTArray() { | 178 | 4.59k | fArray = nullptr; | 179 | 4.59k | fCount = 0; | 180 | 4.59k | } |
skia_private::AutoSTArray<64, SkRect>::AutoSTArray() Line | Count | Source | 177 | 5 | AutoSTArray() { | 178 | 5 | fArray = nullptr; | 179 | 5 | fCount = 0; | 180 | 5 | } |
Unexecuted instantiation: skia_private::AutoSTArray<16, SkRect>::AutoSTArray() |
181 | | |
182 | | /** Allocate count number of T elements |
183 | | */ |
184 | 5.20k | AutoSTArray(int count) { |
185 | 5.20k | fArray = nullptr; |
186 | 5.20k | fCount = 0; |
187 | 5.20k | this->reset(count); |
188 | 5.20k | } skia_private::AutoSTArray<16, SkRect>::AutoSTArray(int) Line | Count | Source | 184 | 3.16k | AutoSTArray(int count) { | 185 | 3.16k | fArray = nullptr; | 186 | 3.16k | fCount = 0; | 187 | 3.16k | this->reset(count); | 188 | 3.16k | } |
Unexecuted instantiation: skia_private::AutoSTArray<15, GrCPixmap>::AutoSTArray(int) Unexecuted instantiation: skia_private::AutoSTArray<15, GrMipLevel>::AutoSTArray(int) Unexecuted instantiation: skia_private::AutoSTArray<4, GrResourceHandle<GrGLSLUniformHandler::SamplerHandleKind> >::AutoSTArray(int) Unexecuted instantiation: GrVkPipelineState.cpp:skia_private::AutoSTArray<8, GrVkPipelineState::setAndBindTextures(GrVkGpu*, GrGeometryProcessor const&, GrPipeline const&, GrSurfaceProxy const* const*, GrVkCommandBuffer*)::SamplerBindings>::AutoSTArray(int) skia_private::AutoSTArray<32, float>::AutoSTArray(int) Line | Count | Source | 184 | 212 | AutoSTArray(int count) { | 185 | 212 | fArray = nullptr; | 186 | 212 | fCount = 0; | 187 | 212 | this->reset(count); | 188 | 212 | } |
skia_private::AutoSTArray<16, float>::AutoSTArray(int) Line | Count | Source | 184 | 120 | AutoSTArray(int count) { | 185 | 120 | fArray = nullptr; | 186 | 120 | fCount = 0; | 187 | 120 | this->reset(count); | 188 | 120 | } |
skia_private::AutoSTArray<64, TriangulationVertex>::AutoSTArray(int) Line | Count | Source | 184 | 796 | AutoSTArray(int count) { | 185 | 796 | fArray = nullptr; | 186 | 796 | fCount = 0; | 187 | 796 | this->reset(count); | 188 | 796 | } |
Unexecuted instantiation: skia_private::AutoSTArray<32, unsigned short>::AutoSTArray(int) Unexecuted instantiation: skia_private::AutoSTArray<32, SkRect>::AutoSTArray(int) Unexecuted instantiation: skia_private::AutoSTArray<128, unsigned short>::AutoSTArray(int) skia_private::AutoSTArray<16, unsigned int>::AutoSTArray(int) Line | Count | Source | 184 | 7 | AutoSTArray(int count) { | 185 | 7 | fArray = nullptr; | 186 | 7 | fCount = 0; | 187 | 7 | this->reset(count); | 188 | 7 | } |
skia_private::AutoSTArray<64, int>::AutoSTArray(int) Line | Count | Source | 184 | 900 | AutoSTArray(int count) { | 185 | 900 | fArray = nullptr; | 186 | 900 | fCount = 0; | 187 | 900 | this->reset(count); | 188 | 900 | } |
Unexecuted instantiation: skia_private::AutoSTArray<4, unsigned char>::AutoSTArray(int) Unexecuted instantiation: skia_private::AutoSTArray<4, int>::AutoSTArray(int) |
189 | | |
190 | 1.22M | ~AutoSTArray() { |
191 | 1.22M | this->reset(0); |
192 | 1.22M | } skia_private::AutoSTArray<32, unsigned short>::~AutoSTArray() Line | Count | Source | 190 | 13.7k | ~AutoSTArray() { | 191 | 13.7k | this->reset(0); | 192 | 13.7k | } |
skia_private::AutoSTArray<2, sk_sp<SkImageFilter> >::~AutoSTArray() Line | Count | Source | 190 | 528k | ~AutoSTArray() { | 191 | 528k | this->reset(0); | 192 | 528k | } |
skia_private::AutoSTArray<20, SkGlyph const*>::~AutoSTArray() Line | Count | Source | 190 | 60.0k | ~AutoSTArray() { | 191 | 60.0k | this->reset(0); | 192 | 60.0k | } |
skia_private::AutoSTArray<64, SkGlyph const*>::~AutoSTArray() Line | Count | Source | 190 | 557 | ~AutoSTArray() { | 191 | 557 | this->reset(0); | 192 | 557 | } |
skia_private::AutoSTArray<16, SkRect>::~AutoSTArray() Line | Count | Source | 190 | 3.16k | ~AutoSTArray() { | 191 | 3.16k | this->reset(0); | 192 | 3.16k | } |
skia_private::AutoSTArray<4, float>::~AutoSTArray() Line | Count | Source | 190 | 220k | ~AutoSTArray() { | 191 | 220k | this->reset(0); | 192 | 220k | } |
skia_private::AutoSTArray<8, unsigned int>::~AutoSTArray() Line | Count | Source | 190 | 153k | ~AutoSTArray() { | 191 | 153k | this->reset(0); | 192 | 153k | } |
Unexecuted instantiation: skia_private::AutoSTArray<128, unsigned char>::~AutoSTArray() Unexecuted instantiation: skia_private::AutoSTArray<15, GrCPixmap>::~AutoSTArray() skia_private::AutoSTArray<14, GrMipLevel>::~AutoSTArray() Line | Count | Source | 190 | 60.0k | ~AutoSTArray() { | 191 | 60.0k | this->reset(0); | 192 | 60.0k | } |
skia_private::AutoSTArray<14, std::__1::unique_ptr<char [], std::__1::default_delete<char []> > >::~AutoSTArray() Line | Count | Source | 190 | 60.0k | ~AutoSTArray() { | 191 | 60.0k | this->reset(0); | 192 | 60.0k | } |
Unexecuted instantiation: skia_private::AutoSTArray<16, GrMipLevel>::~AutoSTArray() Unexecuted instantiation: skia_private::AutoSTArray<15, GrMipLevel>::~AutoSTArray() Unexecuted instantiation: skia_private::AutoSTArray<4, GrResourceHandle<GrGLSLUniformHandler::SamplerHandleKind> >::~AutoSTArray() skia_private::AutoSTArray<3, std::__1::unique_ptr<GrFragmentProcessor const, std::__1::default_delete<GrFragmentProcessor const> > >::~AutoSTArray() Line | Count | Source | 190 | 116k | ~AutoSTArray() { | 191 | 116k | this->reset(0); | 192 | 116k | } |
skia_private::AutoSTArray<24, unsigned int>::~AutoSTArray() Line | Count | Source | 190 | 4.59k | ~AutoSTArray() { | 191 | 4.59k | this->reset(0); | 192 | 4.59k | } |
Unexecuted instantiation: GrVkPipelineState.cpp:skia_private::AutoSTArray<8, GrVkPipelineState::setAndBindTextures(GrVkGpu*, GrGeometryProcessor const&, GrPipeline const&, GrSurfaceProxy const* const*, GrVkCommandBuffer*)::SamplerBindings>::~AutoSTArray() skia_private::AutoSTArray<32, float>::~AutoSTArray() Line | Count | Source | 190 | 212 | ~AutoSTArray() { | 191 | 212 | this->reset(0); | 192 | 212 | } |
skia_private::AutoSTArray<16, float>::~AutoSTArray() Line | Count | Source | 190 | 120 | ~AutoSTArray() { | 191 | 120 | this->reset(0); | 192 | 120 | } |
skia_private::AutoSTArray<64, TriangulationVertex>::~AutoSTArray() Line | Count | Source | 190 | 796 | ~AutoSTArray() { | 191 | 796 | this->reset(0); | 192 | 796 | } |
skia_private::AutoSTArray<64, SkRect>::~AutoSTArray() Line | Count | Source | 190 | 5 | ~AutoSTArray() { | 191 | 5 | this->reset(0); | 192 | 5 | } |
Unexecuted instantiation: skia_private::AutoSTArray<32, SkRect>::~AutoSTArray() Unexecuted instantiation: skia_private::AutoSTArray<128, unsigned short>::~AutoSTArray() skia_private::AutoSTArray<16, unsigned int>::~AutoSTArray() Line | Count | Source | 190 | 7 | ~AutoSTArray() { | 191 | 7 | this->reset(0); | 192 | 7 | } |
skia_private::AutoSTArray<64, int>::~AutoSTArray() Line | Count | Source | 190 | 900 | ~AutoSTArray() { | 191 | 900 | this->reset(0); | 192 | 900 | } |
Unexecuted instantiation: skia_private::AutoSTArray<4, unsigned char>::~AutoSTArray() Unexecuted instantiation: skia_private::AutoSTArray<4, int>::~AutoSTArray() |
193 | | |
194 | | /** Destroys previous objects in the array and default constructs count number of objects */ |
195 | 2.25M | void reset(int count) { |
196 | 2.25M | T* start = fArray; |
197 | 2.25M | T* iter = start + fCount; |
198 | 4.10M | while (iter > start) { |
199 | 1.84M | (--iter)->~T(); |
200 | 1.84M | } |
201 | | |
202 | 2.25M | SkASSERT(count >= 0); |
203 | 2.25M | if (fCount != count) { |
204 | 1.41M | if (fCount > kCount) { |
205 | | // 'fArray' was allocated last time so free it now |
206 | 105k | SkASSERT((T*) fStorage != fArray); |
207 | 105k | sk_free(fArray); |
208 | 105k | } |
209 | | |
210 | 1.41M | if (count > kCount) { |
211 | 105k | fArray = (T*) sk_malloc_throw(count, sizeof(T)); |
212 | 1.30M | } else if (count > 0) { |
213 | 600k | fArray = (T*) fStorage; |
214 | 705k | } else { |
215 | 705k | fArray = nullptr; |
216 | 705k | } |
217 | | |
218 | 1.41M | fCount = count; |
219 | 1.41M | } |
220 | | |
221 | 2.25M | iter = fArray; |
222 | 2.25M | T* stop = fArray + count; |
223 | 4.10M | while (iter < stop) { |
224 | 1.84M | new (iter++) T; |
225 | 1.84M | } |
226 | 2.25M | } skia_private::AutoSTArray<3, std::__1::unique_ptr<GrFragmentProcessor const, std::__1::default_delete<GrFragmentProcessor const> > >::reset(int) Line | Count | Source | 195 | 232k | void reset(int count) { | 196 | 232k | T* start = fArray; | 197 | 232k | T* iter = start + fCount; | 198 | 321k | while (iter > start) { | 199 | 89.0k | (--iter)->~T(); | 200 | 89.0k | } | 201 | | | 202 | 232k | SkASSERT(count >= 0); | 203 | 232k | if (fCount != count) { | 204 | 161k | if (fCount > kCount) { | 205 | | // 'fArray' was allocated last time so free it now | 206 | 0 | SkASSERT((T*) fStorage != fArray); | 207 | 0 | sk_free(fArray); | 208 | 0 | } | 209 | | | 210 | 161k | if (count > kCount) { | 211 | 0 | fArray = (T*) sk_malloc_throw(count, sizeof(T)); | 212 | 161k | } else if (count > 0) { | 213 | 80.6k | fArray = (T*) fStorage; | 214 | 80.6k | } else { | 215 | 80.6k | fArray = nullptr; | 216 | 80.6k | } | 217 | | | 218 | 161k | fCount = count; | 219 | 161k | } | 220 | | | 221 | 232k | iter = fArray; | 222 | 232k | T* stop = fArray + count; | 223 | 321k | while (iter < stop) { | 224 | 89.0k | new (iter++) T; | 225 | 89.0k | } | 226 | 232k | } |
skia_private::AutoSTArray<32, unsigned short>::reset(int) Line | Count | Source | 195 | 13.9k | void reset(int count) { | 196 | 13.9k | T* start = fArray; | 197 | 13.9k | T* iter = start + fCount; | 198 | 22.9k | while (iter > start) { | 199 | 8.99k | (--iter)->~T(); | 200 | 8.99k | } | 201 | | | 202 | 13.9k | SkASSERT(count >= 0); | 203 | 13.9k | if (fCount != count) { | 204 | 466 | if (fCount > kCount) { | 205 | | // 'fArray' was allocated last time so free it now | 206 | 31 | SkASSERT((T*) fStorage != fArray); | 207 | 31 | sk_free(fArray); | 208 | 31 | } | 209 | | | 210 | 466 | if (count > kCount) { | 211 | 31 | fArray = (T*) sk_malloc_throw(count, sizeof(T)); | 212 | 435 | } else if (count > 0) { | 213 | 202 | fArray = (T*) fStorage; | 214 | 233 | } else { | 215 | 233 | fArray = nullptr; | 216 | 233 | } | 217 | | | 218 | 466 | fCount = count; | 219 | 466 | } | 220 | | | 221 | 13.9k | iter = fArray; | 222 | 13.9k | T* stop = fArray + count; | 223 | 22.9k | while (iter < stop) { | 224 | 8.99k | new (iter++) T; | 225 | 8.99k | } | 226 | 13.9k | } |
skia_private::AutoSTArray<2, sk_sp<SkImageFilter> >::reset(int) Line | Count | Source | 195 | 982k | void reset(int count) { | 196 | 982k | T* start = fArray; | 197 | 982k | T* iter = start + fCount; | 198 | 1.77M | while (iter > start) { | 199 | 797k | (--iter)->~T(); | 200 | 797k | } | 201 | | | 202 | 982k | SkASSERT(count >= 0); | 203 | 982k | if (fCount != count) { | 204 | 857k | if (fCount > kCount) { | 205 | | // 'fArray' was allocated last time so free it now | 206 | 82.9k | SkASSERT((T*) fStorage != fArray); | 207 | 82.9k | sk_free(fArray); | 208 | 82.9k | } | 209 | | | 210 | 857k | if (count > kCount) { | 211 | 82.9k | fArray = (T*) sk_malloc_throw(count, sizeof(T)); | 212 | 774k | } else if (count > 0) { | 213 | 345k | fArray = (T*) fStorage; | 214 | 428k | } else { | 215 | 428k | fArray = nullptr; | 216 | 428k | } | 217 | | | 218 | 857k | fCount = count; | 219 | 857k | } | 220 | | | 221 | 982k | iter = fArray; | 222 | 982k | T* stop = fArray + count; | 223 | 1.77M | while (iter < stop) { | 224 | 797k | new (iter++) T; | 225 | 797k | } | 226 | 982k | } |
skia_private::AutoSTArray<20, SkGlyph const*>::reset(int) Line | Count | Source | 195 | 120k | void reset(int count) { | 196 | 120k | T* start = fArray; | 197 | 120k | T* iter = start + fCount; | 198 | 683k | while (iter > start) { | 199 | 563k | (--iter)->~T(); | 200 | 563k | } | 201 | | | 202 | 120k | SkASSERT(count >= 0); | 203 | 120k | if (fCount != count) { | 204 | 120k | if (fCount > kCount) { | 205 | | // 'fArray' was allocated last time so free it now | 206 | 16.0k | SkASSERT((T*) fStorage != fArray); | 207 | 16.0k | sk_free(fArray); | 208 | 16.0k | } | 209 | | | 210 | 120k | if (count > kCount) { | 211 | 16.0k | fArray = (T*) sk_malloc_throw(count, sizeof(T)); | 212 | 104k | } else if (count > 0) { | 213 | 43.9k | fArray = (T*) fStorage; | 214 | 60.0k | } else { | 215 | 60.0k | fArray = nullptr; | 216 | 60.0k | } | 217 | | | 218 | 120k | fCount = count; | 219 | 120k | } | 220 | | | 221 | 120k | iter = fArray; | 222 | 120k | T* stop = fArray + count; | 223 | 683k | while (iter < stop) { | 224 | 563k | new (iter++) T; | 225 | 563k | } | 226 | 120k | } |
skia_private::AutoSTArray<64, SkGlyph const*>::reset(int) Line | Count | Source | 195 | 1.20k | void reset(int count) { | 196 | 1.20k | T* start = fArray; | 197 | 1.20k | T* iter = start + fCount; | 198 | 1.84k | while (iter > start) { | 199 | 644 | (--iter)->~T(); | 200 | 644 | } | 201 | | | 202 | 1.20k | SkASSERT(count >= 0); | 203 | 1.20k | if (fCount != count) { | 204 | 760 | if (fCount > kCount) { | 205 | | // 'fArray' was allocated last time so free it now | 206 | 0 | SkASSERT((T*) fStorage != fArray); | 207 | 0 | sk_free(fArray); | 208 | 0 | } | 209 | | | 210 | 760 | if (count > kCount) { | 211 | 0 | fArray = (T*) sk_malloc_throw(count, sizeof(T)); | 212 | 760 | } else if (count > 0) { | 213 | 380 | fArray = (T*) fStorage; | 214 | 380 | } else { | 215 | 380 | fArray = nullptr; | 216 | 380 | } | 217 | | | 218 | 760 | fCount = count; | 219 | 760 | } | 220 | | | 221 | 1.20k | iter = fArray; | 222 | 1.20k | T* stop = fArray + count; | 223 | 1.84k | while (iter < stop) { | 224 | 644 | new (iter++) T; | 225 | 644 | } | 226 | 1.20k | } |
skia_private::AutoSTArray<16, SkRect>::reset(int) Line | Count | Source | 195 | 6.33k | void reset(int count) { | 196 | 6.33k | T* start = fArray; | 197 | 6.33k | T* iter = start + fCount; | 198 | 24.2k | while (iter > start) { | 199 | 17.9k | (--iter)->~T(); | 200 | 17.9k | } | 201 | | | 202 | 6.33k | SkASSERT(count >= 0); | 203 | 6.33k | if (fCount != count) { | 204 | 6.33k | if (fCount > kCount) { | 205 | | // 'fArray' was allocated last time so free it now | 206 | 379 | SkASSERT((T*) fStorage != fArray); | 207 | 379 | sk_free(fArray); | 208 | 379 | } | 209 | | | 210 | 6.33k | if (count > kCount) { | 211 | 379 | fArray = (T*) sk_malloc_throw(count, sizeof(T)); | 212 | 5.95k | } else if (count > 0) { | 213 | 2.78k | fArray = (T*) fStorage; | 214 | 3.16k | } else { | 215 | 3.16k | fArray = nullptr; | 216 | 3.16k | } | 217 | | | 218 | 6.33k | fCount = count; | 219 | 6.33k | } | 220 | | | 221 | 6.33k | iter = fArray; | 222 | 6.33k | T* stop = fArray + count; | 223 | 24.2k | while (iter < stop) { | 224 | 17.9k | new (iter++) T; | 225 | 17.9k | } | 226 | 6.33k | } |
skia_private::AutoSTArray<4, float>::reset(int) Line | Count | Source | 195 | 390k | void reset(int count) { | 196 | 390k | T* start = fArray; | 197 | 390k | T* iter = start + fCount; | 198 | 417k | while (iter > start) { | 199 | 26.7k | (--iter)->~T(); | 200 | 26.7k | } | 201 | | | 202 | 390k | SkASSERT(count >= 0); | 203 | 390k | if (fCount != count) { | 204 | 2.88k | if (fCount > kCount) { | 205 | | // 'fArray' was allocated last time so free it now | 206 | 1.32k | SkASSERT((T*) fStorage != fArray); | 207 | 1.32k | sk_free(fArray); | 208 | 1.32k | } | 209 | | | 210 | 2.88k | if (count > kCount) { | 211 | 1.32k | fArray = (T*) sk_malloc_throw(count, sizeof(T)); | 212 | 1.56k | } else if (count > 0) { | 213 | 116 | fArray = (T*) fStorage; | 214 | 1.44k | } else { | 215 | 1.44k | fArray = nullptr; | 216 | 1.44k | } | 217 | | | 218 | 2.88k | fCount = count; | 219 | 2.88k | } | 220 | | | 221 | 390k | iter = fArray; | 222 | 390k | T* stop = fArray + count; | 223 | 417k | while (iter < stop) { | 224 | 26.7k | new (iter++) T; | 225 | 26.7k | } | 226 | 390k | } |
skia_private::AutoSTArray<8, unsigned int>::reset(int) Line | Count | Source | 195 | 256k | void reset(int count) { | 196 | 256k | T* start = fArray; | 197 | 256k | T* iter = start + fCount; | 198 | 299k | while (iter > start) { | 199 | 43.1k | (--iter)->~T(); | 200 | 43.1k | } | 201 | | | 202 | 256k | SkASSERT(count >= 0); | 203 | 256k | if (fCount != count) { | 204 | 9.32k | if (fCount > kCount) { | 205 | | // 'fArray' was allocated last time so free it now | 206 | 4.27k | SkASSERT((T*) fStorage != fArray); | 207 | 4.27k | sk_free(fArray); | 208 | 4.27k | } | 209 | | | 210 | 9.32k | if (count > kCount) { | 211 | 4.27k | fArray = (T*) sk_malloc_throw(count, sizeof(T)); | 212 | 5.05k | } else if (count > 0) { | 213 | 393 | fArray = (T*) fStorage; | 214 | 4.66k | } else { | 215 | 4.66k | fArray = nullptr; | 216 | 4.66k | } | 217 | | | 218 | 9.32k | fCount = count; | 219 | 9.32k | } | 220 | | | 221 | 256k | iter = fArray; | 222 | 256k | T* stop = fArray + count; | 223 | 299k | while (iter < stop) { | 224 | 43.1k | new (iter++) T; | 225 | 43.1k | } | 226 | 256k | } |
Unexecuted instantiation: skia_private::AutoSTArray<128, unsigned char>::reset(int) Unexecuted instantiation: skia_private::AutoSTArray<15, GrCPixmap>::reset(int) skia_private::AutoSTArray<14, GrMipLevel>::reset(int) Line | Count | Source | 195 | 120k | void reset(int count) { | 196 | 120k | T* start = fArray; | 197 | 120k | T* iter = start + fCount; | 198 | 180k | while (iter > start) { | 199 | 60.0k | (--iter)->~T(); | 200 | 60.0k | } | 201 | | | 202 | 120k | SkASSERT(count >= 0); | 203 | 120k | if (fCount != count) { | 204 | 120k | if (fCount > kCount) { | 205 | | // 'fArray' was allocated last time so free it now | 206 | 0 | SkASSERT((T*) fStorage != fArray); | 207 | 0 | sk_free(fArray); | 208 | 0 | } | 209 | | | 210 | 120k | if (count > kCount) { | 211 | 0 | fArray = (T*) sk_malloc_throw(count, sizeof(T)); | 212 | 120k | } else if (count > 0) { | 213 | 60.0k | fArray = (T*) fStorage; | 214 | 60.0k | } else { | 215 | 60.0k | fArray = nullptr; | 216 | 60.0k | } | 217 | | | 218 | 120k | fCount = count; | 219 | 120k | } | 220 | | | 221 | 120k | iter = fArray; | 222 | 120k | T* stop = fArray + count; | 223 | 180k | while (iter < stop) { | 224 | 60.0k | new (iter++) T; | 225 | 60.0k | } | 226 | 120k | } |
skia_private::AutoSTArray<14, std::__1::unique_ptr<char [], std::__1::default_delete<char []> > >::reset(int) Line | Count | Source | 195 | 120k | void reset(int count) { | 196 | 120k | T* start = fArray; | 197 | 120k | T* iter = start + fCount; | 198 | 180k | while (iter > start) { | 199 | 60.0k | (--iter)->~T(); | 200 | 60.0k | } | 201 | | | 202 | 120k | SkASSERT(count >= 0); | 203 | 120k | if (fCount != count) { | 204 | 120k | if (fCount > kCount) { | 205 | | // 'fArray' was allocated last time so free it now | 206 | 0 | SkASSERT((T*) fStorage != fArray); | 207 | 0 | sk_free(fArray); | 208 | 0 | } | 209 | | | 210 | 120k | if (count > kCount) { | 211 | 0 | fArray = (T*) sk_malloc_throw(count, sizeof(T)); | 212 | 120k | } else if (count > 0) { | 213 | 60.0k | fArray = (T*) fStorage; | 214 | 60.0k | } else { | 215 | 60.0k | fArray = nullptr; | 216 | 60.0k | } | 217 | | | 218 | 120k | fCount = count; | 219 | 120k | } | 220 | | | 221 | 120k | iter = fArray; | 222 | 120k | T* stop = fArray + count; | 223 | 180k | while (iter < stop) { | 224 | 60.0k | new (iter++) T; | 225 | 60.0k | } | 226 | 120k | } |
Unexecuted instantiation: skia_private::AutoSTArray<16, GrMipLevel>::reset(int) Unexecuted instantiation: skia_private::AutoSTArray<15, GrMipLevel>::reset(int) Unexecuted instantiation: skia_private::AutoSTArray<4, GrResourceHandle<GrGLSLUniformHandler::SamplerHandleKind> >::reset(int) skia_private::AutoSTArray<24, unsigned int>::reset(int) Line | Count | Source | 195 | 9.19k | void reset(int count) { | 196 | 9.19k | T* start = fArray; | 197 | 9.19k | T* iter = start + fCount; | 198 | 97.7k | while (iter > start) { | 199 | 88.5k | (--iter)->~T(); | 200 | 88.5k | } | 201 | | | 202 | 9.19k | SkASSERT(count >= 0); | 203 | 9.19k | if (fCount != count) { | 204 | 9.19k | if (fCount > kCount) { | 205 | | // 'fArray' was allocated last time so free it now | 206 | 182 | SkASSERT((T*) fStorage != fArray); | 207 | 182 | sk_free(fArray); | 208 | 182 | } | 209 | | | 210 | 9.19k | if (count > kCount) { | 211 | 182 | fArray = (T*) sk_malloc_throw(count, sizeof(T)); | 212 | 9.00k | } else if (count > 0) { | 213 | 4.41k | fArray = (T*) fStorage; | 214 | 4.59k | } else { | 215 | 4.59k | fArray = nullptr; | 216 | 4.59k | } | 217 | | | 218 | 9.19k | fCount = count; | 219 | 9.19k | } | 220 | | | 221 | 9.19k | iter = fArray; | 222 | 9.19k | T* stop = fArray + count; | 223 | 97.7k | while (iter < stop) { | 224 | 88.5k | new (iter++) T; | 225 | 88.5k | } | 226 | 9.19k | } |
Unexecuted instantiation: GrVkPipelineState.cpp:skia_private::AutoSTArray<8, GrVkPipelineState::setAndBindTextures(GrVkGpu*, GrGeometryProcessor const&, GrPipeline const&, GrSurfaceProxy const* const*, GrVkCommandBuffer*)::SamplerBindings>::reset(int) skia_private::AutoSTArray<32, float>::reset(int) Line | Count | Source | 195 | 424 | void reset(int count) { | 196 | 424 | T* start = fArray; | 197 | 424 | T* iter = start + fCount; | 198 | 3.19k | while (iter > start) { | 199 | 2.77k | (--iter)->~T(); | 200 | 2.77k | } | 201 | | | 202 | 424 | SkASSERT(count >= 0); | 203 | 424 | if (fCount != count) { | 204 | 408 | if (fCount > kCount) { | 205 | | // 'fArray' was allocated last time so free it now | 206 | 13 | SkASSERT((T*) fStorage != fArray); | 207 | 13 | sk_free(fArray); | 208 | 13 | } | 209 | | | 210 | 408 | if (count > kCount) { | 211 | 13 | fArray = (T*) sk_malloc_throw(count, sizeof(T)); | 212 | 395 | } else if (count > 0) { | 213 | 191 | fArray = (T*) fStorage; | 214 | 204 | } else { | 215 | 204 | fArray = nullptr; | 216 | 204 | } | 217 | | | 218 | 408 | fCount = count; | 219 | 408 | } | 220 | | | 221 | 424 | iter = fArray; | 222 | 424 | T* stop = fArray + count; | 223 | 3.19k | while (iter < stop) { | 224 | 2.77k | new (iter++) T; | 225 | 2.77k | } | 226 | 424 | } |
skia_private::AutoSTArray<16, float>::reset(int) Line | Count | Source | 195 | 240 | void reset(int count) { | 196 | 240 | T* start = fArray; | 197 | 240 | T* iter = start + fCount; | 198 | 11.9k | while (iter > start) { | 199 | 11.7k | (--iter)->~T(); | 200 | 11.7k | } | 201 | | | 202 | 240 | SkASSERT(count >= 0); | 203 | 240 | if (fCount != count) { | 204 | 148 | if (fCount > kCount) { | 205 | | // 'fArray' was allocated last time so free it now | 206 | 48 | SkASSERT((T*) fStorage != fArray); | 207 | 48 | sk_free(fArray); | 208 | 48 | } | 209 | | | 210 | 148 | if (count > kCount) { | 211 | 48 | fArray = (T*) sk_malloc_throw(count, sizeof(T)); | 212 | 100 | } else if (count > 0) { | 213 | 26 | fArray = (T*) fStorage; | 214 | 74 | } else { | 215 | 74 | fArray = nullptr; | 216 | 74 | } | 217 | | | 218 | 148 | fCount = count; | 219 | 148 | } | 220 | | | 221 | 240 | iter = fArray; | 222 | 240 | T* stop = fArray + count; | 223 | 11.9k | while (iter < stop) { | 224 | 11.7k | new (iter++) T; | 225 | 11.7k | } | 226 | 240 | } |
skia_private::AutoSTArray<64, TriangulationVertex>::reset(int) Line | Count | Source | 195 | 1.59k | void reset(int count) { | 196 | 1.59k | T* start = fArray; | 197 | 1.59k | T* iter = start + fCount; | 198 | 64.5k | while (iter > start) { | 199 | 62.9k | (--iter)->~T(); | 200 | 62.9k | } | 201 | | | 202 | 1.59k | SkASSERT(count >= 0); | 203 | 1.59k | if (fCount != count) { | 204 | 1.59k | if (fCount > kCount) { | 205 | | // 'fArray' was allocated last time so free it now | 206 | 143 | SkASSERT((T*) fStorage != fArray); | 207 | 143 | sk_free(fArray); | 208 | 143 | } | 209 | | | 210 | 1.59k | if (count > kCount) { | 211 | 143 | fArray = (T*) sk_malloc_throw(count, sizeof(T)); | 212 | 1.44k | } else if (count > 0) { | 213 | 653 | fArray = (T*) fStorage; | 214 | 796 | } else { | 215 | 796 | fArray = nullptr; | 216 | 796 | } | 217 | | | 218 | 1.59k | fCount = count; | 219 | 1.59k | } | 220 | | | 221 | 1.59k | iter = fArray; | 222 | 1.59k | T* stop = fArray + count; | 223 | 64.5k | while (iter < stop) { | 224 | 62.9k | new (iter++) T; | 225 | 62.9k | } | 226 | 1.59k | } |
skia_private::AutoSTArray<64, SkRect>::reset(int) Line | Count | Source | 195 | 10 | void reset(int count) { | 196 | 10 | T* start = fArray; | 197 | 10 | T* iter = start + fCount; | 198 | 55 | while (iter > start) { | 199 | 45 | (--iter)->~T(); | 200 | 45 | } | 201 | | | 202 | 10 | SkASSERT(count >= 0); | 203 | 10 | if (fCount != count) { | 204 | 10 | if (fCount > kCount) { | 205 | | // 'fArray' was allocated last time so free it now | 206 | 0 | SkASSERT((T*) fStorage != fArray); | 207 | 0 | sk_free(fArray); | 208 | 0 | } | 209 | | | 210 | 10 | if (count > kCount) { | 211 | 0 | fArray = (T*) sk_malloc_throw(count, sizeof(T)); | 212 | 10 | } else if (count > 0) { | 213 | 5 | fArray = (T*) fStorage; | 214 | 5 | } else { | 215 | 5 | fArray = nullptr; | 216 | 5 | } | 217 | | | 218 | 10 | fCount = count; | 219 | 10 | } | 220 | | | 221 | 10 | iter = fArray; | 222 | 10 | T* stop = fArray + count; | 223 | 55 | while (iter < stop) { | 224 | 45 | new (iter++) T; | 225 | 45 | } | 226 | 10 | } |
Unexecuted instantiation: skia_private::AutoSTArray<32, SkRect>::reset(int) Unexecuted instantiation: skia_private::AutoSTArray<128, unsigned short>::reset(int) skia_private::AutoSTArray<16, unsigned int>::reset(int) Line | Count | Source | 195 | 14 | void reset(int count) { | 196 | 14 | T* start = fArray; | 197 | 14 | T* iter = start + fCount; | 198 | 98 | while (iter > start) { | 199 | 84 | (--iter)->~T(); | 200 | 84 | } | 201 | | | 202 | 14 | SkASSERT(count >= 0); | 203 | 14 | if (fCount != count) { | 204 | 14 | if (fCount > kCount) { | 205 | | // 'fArray' was allocated last time so free it now | 206 | 0 | SkASSERT((T*) fStorage != fArray); | 207 | 0 | sk_free(fArray); | 208 | 0 | } | 209 | | | 210 | 14 | if (count > kCount) { | 211 | 0 | fArray = (T*) sk_malloc_throw(count, sizeof(T)); | 212 | 14 | } else if (count > 0) { | 213 | 7 | fArray = (T*) fStorage; | 214 | 7 | } else { | 215 | 7 | fArray = nullptr; | 216 | 7 | } | 217 | | | 218 | 14 | fCount = count; | 219 | 14 | } | 220 | | | 221 | 14 | iter = fArray; | 222 | 14 | T* stop = fArray + count; | 223 | 98 | while (iter < stop) { | 224 | 84 | new (iter++) T; | 225 | 84 | } | 226 | 14 | } |
skia_private::AutoSTArray<64, int>::reset(int) Line | Count | Source | 195 | 1.80k | void reset(int count) { | 196 | 1.80k | T* start = fArray; | 197 | 1.80k | T* iter = start + fCount; | 198 | 12.0k | while (iter > start) { | 199 | 10.2k | (--iter)->~T(); | 200 | 10.2k | } | 201 | | | 202 | 1.80k | SkASSERT(count >= 0); | 203 | 1.80k | if (fCount != count) { | 204 | 1.80k | if (fCount > kCount) { | 205 | | // 'fArray' was allocated last time so free it now | 206 | 4 | SkASSERT((T*) fStorage != fArray); | 207 | 4 | sk_free(fArray); | 208 | 4 | } | 209 | | | 210 | 1.80k | if (count > kCount) { | 211 | 4 | fArray = (T*) sk_malloc_throw(count, sizeof(T)); | 212 | 1.79k | } else if (count > 0) { | 213 | 896 | fArray = (T*) fStorage; | 214 | 900 | } else { | 215 | 900 | fArray = nullptr; | 216 | 900 | } | 217 | | | 218 | 1.80k | fCount = count; | 219 | 1.80k | } | 220 | | | 221 | 1.80k | iter = fArray; | 222 | 1.80k | T* stop = fArray + count; | 223 | 12.0k | while (iter < stop) { | 224 | 10.2k | new (iter++) T; | 225 | 10.2k | } | 226 | 1.80k | } |
Unexecuted instantiation: skia_private::AutoSTArray<3, std::__1::unique_ptr<GrFragmentProcessor const, std::__1::default_delete<GrFragmentProcessor const> > >::reset(int) Unexecuted instantiation: skia_private::AutoSTArray<32, unsigned short>::reset(int) Unexecuted instantiation: skia_private::AutoSTArray<2, sk_sp<SkImageFilter> >::reset(int) Unexecuted instantiation: skia_private::AutoSTArray<20, SkGlyph const*>::reset(int) Unexecuted instantiation: skia_private::AutoSTArray<64, SkGlyph const*>::reset(int) Unexecuted instantiation: skia_private::AutoSTArray<16, SkRect>::reset(int) Unexecuted instantiation: skia_private::AutoSTArray<4, float>::reset(int) Unexecuted instantiation: skia_private::AutoSTArray<8, unsigned int>::reset(int) Unexecuted instantiation: skia_private::AutoSTArray<128, unsigned char>::reset(int) Unexecuted instantiation: skia_private::AutoSTArray<15, GrCPixmap>::reset(int) Unexecuted instantiation: skia_private::AutoSTArray<14, GrMipLevel>::reset(int) Unexecuted instantiation: skia_private::AutoSTArray<14, std::__1::unique_ptr<char [], std::__1::default_delete<char []> > >::reset(int) Unexecuted instantiation: skia_private::AutoSTArray<16, GrMipLevel>::reset(int) Unexecuted instantiation: skia_private::AutoSTArray<15, GrMipLevel>::reset(int) Unexecuted instantiation: skia_private::AutoSTArray<4, GrResourceHandle<GrGLSLUniformHandler::SamplerHandleKind> >::reset(int) Unexecuted instantiation: skia_private::AutoSTArray<24, unsigned int>::reset(int) Unexecuted instantiation: GrVkPipelineState.cpp:skia_private::AutoSTArray<8, GrVkPipelineState::setAndBindTextures(GrVkGpu*, GrGeometryProcessor const&, GrPipeline const&, GrSurfaceProxy const* const*, GrVkCommandBuffer*)::SamplerBindings>::reset(int) Unexecuted instantiation: skia_private::AutoSTArray<32, float>::reset(int) Unexecuted instantiation: skia_private::AutoSTArray<16, float>::reset(int) Unexecuted instantiation: skia_private::AutoSTArray<64, TriangulationVertex>::reset(int) Unexecuted instantiation: skia_private::AutoSTArray<64, SkRect>::reset(int) Unexecuted instantiation: skia_private::AutoSTArray<32, SkRect>::reset(int) Unexecuted instantiation: skia_private::AutoSTArray<128, unsigned short>::reset(int) Unexecuted instantiation: skia_private::AutoSTArray<4, unsigned char>::reset(int) Unexecuted instantiation: skia_private::AutoSTArray<4, int>::reset(int) |
227 | | |
228 | | /** Return the number of T elements in the array |
229 | | */ |
230 | 2.04M | int count() const { return fCount; } Unexecuted instantiation: skia_private::AutoSTArray<3, std::__1::unique_ptr<GrFragmentProcessor const, std::__1::default_delete<GrFragmentProcessor const> > >::count() const skia_private::AutoSTArray<2, sk_sp<SkImageFilter> >::count() const Line | Count | Source | 230 | 1.33M | int count() const { return fCount; } |
skia_private::AutoSTArray<4, float>::count() const Line | Count | Source | 230 | 321k | int count() const { return fCount; } |
Unexecuted instantiation: skia_private::AutoSTArray<16, GrMipLevel>::count() const skia_private::AutoSTArray<8, unsigned int>::count() const Line | Count | Source | 230 | 368k | int count() const { return fCount; } |
skia_private::AutoSTArray<24, unsigned int>::count() const Line | Count | Source | 230 | 17.1k | int count() const { return fCount; } |
|
231 | | |
232 | | /** Return the array of T elements. Will be NULL if count == 0 |
233 | | */ |
234 | 646k | T* get() const { return fArray; } skia_private::AutoSTArray<32, unsigned short>::get() const Line | Count | Source | 234 | 466 | T* get() const { return fArray; } |
skia_private::AutoSTArray<20, SkGlyph const*>::get() const Line | Count | Source | 234 | 60.0k | T* get() const { return fArray; } |
skia_private::AutoSTArray<64, SkGlyph const*>::get() const Line | Count | Source | 234 | 644 | T* get() const { return fArray; } |
skia_private::AutoSTArray<16, SkRect>::get() const Line | Count | Source | 234 | 3.16k | T* get() const { return fArray; } |
skia_private::AutoSTArray<4, float>::get() const Line | Count | Source | 234 | 321k | T* get() const { return fArray; } |
Unexecuted instantiation: skia_private::AutoSTArray<15, GrCPixmap>::get() const skia_private::AutoSTArray<14, GrMipLevel>::get() const Line | Count | Source | 234 | 60.0k | T* get() const { return fArray; } |
Unexecuted instantiation: skia_private::AutoSTArray<16, GrMipLevel>::get() const skia_private::AutoSTArray<8, unsigned int>::get() const Line | Count | Source | 234 | 184k | T* get() const { return fArray; } |
Unexecuted instantiation: skia_private::AutoSTArray<4, GrResourceHandle<GrGLSLUniformHandler::SamplerHandleKind> >::get() const skia_private::AutoSTArray<24, unsigned int>::get() const Line | Count | Source | 234 | 13.6k | T* get() const { return fArray; } |
skia_private::AutoSTArray<32, float>::get() const Line | Count | Source | 234 | 417 | T* get() const { return fArray; } |
skia_private::AutoSTArray<16, float>::get() const Line | Count | Source | 234 | 213 | T* get() const { return fArray; } |
skia_private::AutoSTArray<64, SkRect>::get() const Line | Count | Source | 234 | 5 | T* get() const { return fArray; } |
Unexecuted instantiation: skia_private::AutoSTArray<32, SkRect>::get() const Unexecuted instantiation: skia_private::AutoSTArray<128, unsigned short>::get() const skia_private::AutoSTArray<16, unsigned int>::get() const Line | Count | Source | 234 | 7 | T* get() const { return fArray; } |
skia_private::AutoSTArray<64, int>::get() const Line | Count | Source | 234 | 900 | T* get() const { return fArray; } |
|
235 | | |
236 | 0 | T* begin() { return fArray; } Unexecuted instantiation: skia_private::AutoSTArray<128, unsigned char>::begin() Unexecuted instantiation: skia_private::AutoSTArray<15, GrMipLevel>::begin() Unexecuted instantiation: skia_private::AutoSTArray<4, int>::begin() |
237 | | |
238 | 0 | const T* begin() const { return fArray; } |
239 | | |
240 | 0 | T* end() { return fArray + fCount; } |
241 | | |
242 | 0 | const T* end() const { return fArray + fCount; } |
243 | | |
244 | | /** Return the nth element in the array |
245 | | */ |
246 | 4.84M | T& operator[](int index) const { |
247 | 4.84M | return fArray[sk_collection_check_bounds(index, fCount)]; |
248 | 4.84M | } skia_private::AutoSTArray<3, std::__1::unique_ptr<GrFragmentProcessor const, std::__1::default_delete<GrFragmentProcessor const> > >::operator[](int) const Line | Count | Source | 246 | 89.0k | T& operator[](int index) const { | 247 | 89.0k | return fArray[sk_collection_check_bounds(index, fCount)]; | 248 | 89.0k | } |
skia_private::AutoSTArray<2, sk_sp<SkImageFilter> >::operator[](int) const Line | Count | Source | 246 | 4.08M | T& operator[](int index) const { | 247 | 4.08M | return fArray[sk_collection_check_bounds(index, fCount)]; | 248 | 4.08M | } |
skia_private::AutoSTArray<16, SkRect>::operator[](int) const Line | Count | Source | 246 | 17.9k | T& operator[](int index) const { | 247 | 17.9k | return fArray[sk_collection_check_bounds(index, fCount)]; | 248 | 17.9k | } |
Unexecuted instantiation: skia_private::AutoSTArray<15, GrCPixmap>::operator[](int) const skia_private::AutoSTArray<14, GrMipLevel>::operator[](int) const Line | Count | Source | 246 | 60.0k | T& operator[](int index) const { | 247 | 60.0k | return fArray[sk_collection_check_bounds(index, fCount)]; | 248 | 60.0k | } |
skia_private::AutoSTArray<14, std::__1::unique_ptr<char [], std::__1::default_delete<char []> > >::operator[](int) const Line | Count | Source | 246 | 60.0k | T& operator[](int index) const { | 247 | 60.0k | return fArray[sk_collection_check_bounds(index, fCount)]; | 248 | 60.0k | } |
Unexecuted instantiation: skia_private::AutoSTArray<15, GrMipLevel>::operator[](int) const Unexecuted instantiation: skia_private::AutoSTArray<4, GrResourceHandle<GrGLSLUniformHandler::SamplerHandleKind> >::operator[](int) const skia_private::AutoSTArray<24, unsigned int>::operator[](int) const Line | Count | Source | 246 | 9.50k | T& operator[](int index) const { | 247 | 9.50k | return fArray[sk_collection_check_bounds(index, fCount)]; | 248 | 9.50k | } |
Unexecuted instantiation: GrVkPipelineState.cpp:skia_private::AutoSTArray<8, GrVkPipelineState::setAndBindTextures(GrVkGpu*, GrGeometryProcessor const&, GrPipeline const&, GrSurfaceProxy const* const*, GrVkCommandBuffer*)::SamplerBindings>::operator[](int) const skia_private::AutoSTArray<64, TriangulationVertex>::operator[](int) const Line | Count | Source | 246 | 517k | T& operator[](int index) const { | 247 | 517k | return fArray[sk_collection_check_bounds(index, fCount)]; | 248 | 517k | } |
skia_private::AutoSTArray<64, SkRect>::operator[](int) const Line | Count | Source | 246 | 45 | T& operator[](int index) const { | 247 | 45 | return fArray[sk_collection_check_bounds(index, fCount)]; | 248 | 45 | } |
Unexecuted instantiation: skia_private::AutoSTArray<32, unsigned short>::operator[](int) const Unexecuted instantiation: skia_private::AutoSTArray<32, SkRect>::operator[](int) const skia_private::AutoSTArray<64, int>::operator[](int) const Line | Count | Source | 246 | 10.2k | T& operator[](int index) const { | 247 | 10.2k | return fArray[sk_collection_check_bounds(index, fCount)]; | 248 | 10.2k | } |
Unexecuted instantiation: skia_private::AutoSTArray<4, unsigned char>::operator[](int) const |
249 | | |
250 | | /** Aliases matching other types, like std::vector. */ |
251 | | const T* data() const { return fArray; } |
252 | 250 | T* data() { return fArray; } skia_private::AutoSTArray<2, sk_sp<SkImageFilter> >::data() Line | Count | Source | 252 | 250 | T* data() { return fArray; } |
Unexecuted instantiation: skia_private::AutoSTArray<16, SkRect>::data() Unexecuted instantiation: skia_private::AutoSTArray<4, unsigned char>::data() Unexecuted instantiation: skia_private::AutoSTArray<4, int>::data() |
253 | 250 | size_t size() const { return fCount; } skia_private::AutoSTArray<2, sk_sp<SkImageFilter> >::size() const Line | Count | Source | 253 | 250 | size_t size() const { return fCount; } |
Unexecuted instantiation: skia_private::AutoSTArray<128, unsigned short>::size() const |
254 | | |
255 | | private: |
256 | | #if defined(SK_BUILD_FOR_GOOGLE3) |
257 | | // Stack frame size is limited for SK_BUILD_FOR_GOOGLE3. 4k is less than the actual max, |
258 | | // but some functions have multiple large stack allocations. |
259 | | static const int kMaxBytes = 4 * 1024; |
260 | | static const int kCount = kCountRequested * sizeof(T) > kMaxBytes |
261 | | ? kMaxBytes / sizeof(T) |
262 | | : kCountRequested; |
263 | | #else |
264 | | static const int kCount = kCountRequested; |
265 | | #endif |
266 | | |
267 | | int fCount; |
268 | | T* fArray; |
269 | | alignas(T) char fStorage[kCount * sizeof(T)]; |
270 | | }; |
271 | | |
272 | | /** Manages an array of T elements, freeing the array in the destructor. |
273 | | * Does NOT call any constructors/destructors on T (T must be POD). |
274 | | */ |
275 | | template <typename T, |
276 | | typename = std::enable_if_t<std::is_trivially_default_constructible<T>::value && |
277 | | std::is_trivially_destructible<T>::value>> |
278 | | class AutoTMalloc { |
279 | | public: |
280 | | /** Takes ownership of the ptr. The ptr must be a value which can be passed to sk_free. */ |
281 | 53.5M | explicit AutoTMalloc(T* ptr = nullptr) : fPtr(ptr) {} skia_private::AutoTMalloc<SkPoint, void>::AutoTMalloc(SkPoint*) Line | Count | Source | 281 | 832k | explicit AutoTMalloc(T* ptr = nullptr) : fPtr(ptr) {} |
skia_private::AutoTMalloc<unsigned char, void>::AutoTMalloc(unsigned char*) Line | Count | Source | 281 | 193k | explicit AutoTMalloc(T* ptr = nullptr) : fPtr(ptr) {} |
skia_private::AutoTMalloc<SkRecord::Record, void>::AutoTMalloc(SkRecord::Record*) Line | Count | Source | 281 | 191k | explicit AutoTMalloc(T* ptr = nullptr) : fPtr(ptr) {} |
Unexecuted instantiation: skia_private::AutoTMalloc<SkPicture const*, void>::AutoTMalloc(SkPicture const**) skia_private::AutoTMalloc<int, void>::AutoTMalloc(int*) Line | Count | Source | 281 | 7.20M | explicit AutoTMalloc(T* ptr = nullptr) : fPtr(ptr) {} |
Unexecuted instantiation: skia_private::AutoTMalloc<char, void>::AutoTMalloc(char*) skia_private::AutoTMalloc<SkFontArguments::Palette::Override, void>::AutoTMalloc(SkFontArguments::Palette::Override*) Line | Count | Source | 281 | 45.1M | explicit AutoTMalloc(T* ptr = nullptr) : fPtr(ptr) {} |
|
282 | | |
283 | | /** Allocates space for 'count' Ts. */ |
284 | | explicit AutoTMalloc(size_t count) |
285 | 30.3k | : fPtr(count ? (T*)sk_malloc_throw(count, sizeof(T)) : nullptr) {} skia_private::AutoTMalloc<unsigned int, void>::AutoTMalloc(unsigned long) Line | Count | Source | 285 | 8.49k | : fPtr(count ? (T*)sk_malloc_throw(count, sizeof(T)) : nullptr) {} |
Unexecuted instantiation: skia_private::AutoTMalloc<SkBBoxHierarchy::Metadata, void>::AutoTMalloc(unsigned long) Unexecuted instantiation: skia_private::AutoTMalloc<SkPicture const*, void>::AutoTMalloc(unsigned long) skia_private::AutoTMalloc<unsigned char, void>::AutoTMalloc(unsigned long) Line | Count | Source | 285 | 19.7k | : fPtr(count ? (T*)sk_malloc_throw(count, sizeof(T)) : nullptr) {} |
Unexecuted instantiation: skia_private::AutoTMalloc<float, void>::AutoTMalloc(unsigned long) Unexecuted instantiation: skia_private::AutoTMalloc<skgpu::graphite::MonotonicValue<skgpu::graphite::CompressedPaintersOrderSequence>, void>::AutoTMalloc(unsigned long) skia_private::AutoTMalloc<char, void>::AutoTMalloc(unsigned long) Line | Count | Source | 285 | 2.08k | : fPtr(count ? (T*)sk_malloc_throw(count, sizeof(T)) : nullptr) {} |
|
286 | | |
287 | | AutoTMalloc(AutoTMalloc&&) = default; |
288 | | AutoTMalloc& operator=(AutoTMalloc&&) = default; |
289 | | |
290 | | /** Resize the memory area pointed to by the current ptr preserving contents. */ |
291 | 2.16M | void realloc(size_t count) { |
292 | 2.16M | fPtr.reset(count ? (T*)sk_realloc_throw(fPtr.release(), count * sizeof(T)) : nullptr); |
293 | 2.16M | } skia_private::AutoTMalloc<SkRecord::Record, void>::realloc(unsigned long) Line | Count | Source | 291 | 179k | void realloc(size_t count) { | 292 | 179k | fPtr.reset(count ? (T*)sk_realloc_throw(fPtr.release(), count * sizeof(T)) : nullptr); | 293 | 179k | } |
skia_private::AutoTMalloc<int, void>::realloc(unsigned long) Line | Count | Source | 291 | 1.92M | void realloc(size_t count) { | 292 | 1.92M | fPtr.reset(count ? (T*)sk_realloc_throw(fPtr.release(), count * sizeof(T)) : nullptr); | 293 | 1.92M | } |
skia_private::AutoTMalloc<unsigned char, void>::realloc(unsigned long) Line | Count | Source | 291 | 54.5k | void realloc(size_t count) { | 292 | 54.5k | fPtr.reset(count ? (T*)sk_realloc_throw(fPtr.release(), count * sizeof(T)) : nullptr); | 293 | 54.5k | } |
|
294 | | |
295 | | /** Resize the memory area pointed to by the current ptr without preserving contents. */ |
296 | 69.1k | T* reset(size_t count = 0) { |
297 | 69.1k | fPtr.reset(count ? (T*)sk_malloc_throw(count, sizeof(T)) : nullptr); |
298 | 69.1k | return this->get(); |
299 | 69.1k | } skia_private::AutoTMalloc<SkFontArguments::Palette::Override, void>::reset(unsigned long) Line | Count | Source | 296 | 49.6k | T* reset(size_t count = 0) { | 297 | 49.6k | fPtr.reset(count ? (T*)sk_malloc_throw(count, sizeof(T)) : nullptr); | 298 | 49.6k | return this->get(); | 299 | 49.6k | } |
skia_private::AutoTMalloc<SkPoint, void>::reset(unsigned long) Line | Count | Source | 296 | 10.6k | T* reset(size_t count = 0) { | 297 | 10.6k | fPtr.reset(count ? (T*)sk_malloc_throw(count, sizeof(T)) : nullptr); | 298 | 10.6k | return this->get(); | 299 | 10.6k | } |
skia_private::AutoTMalloc<unsigned char, void>::reset(unsigned long) Line | Count | Source | 296 | 8.79k | T* reset(size_t count = 0) { | 297 | 8.79k | fPtr.reset(count ? (T*)sk_malloc_throw(count, sizeof(T)) : nullptr); | 298 | 8.79k | return this->get(); | 299 | 8.79k | } |
Unexecuted instantiation: skia_private::AutoTMalloc<char, void>::reset(unsigned long) |
300 | | |
301 | 21.2M | T* get() const { return fPtr.get(); } skia_private::AutoTMalloc<SkFontArguments::Palette::Override, void>::get() const Line | Count | Source | 301 | 573k | T* get() const { return fPtr.get(); } |
skia_private::AutoTMalloc<SkRecord::Record, void>::get() const Line | Count | Source | 301 | 385k | T* get() const { return fPtr.get(); } |
skia_private::AutoTMalloc<int, void>::get() const Line | Count | Source | 301 | 2.31M | T* get() const { return fPtr.get(); } |
skia_private::AutoTMalloc<unsigned char, void>::get() const Line | Count | Source | 301 | 17.9M | T* get() const { return fPtr.get(); } |
skia_private::AutoTMalloc<SkPoint, void>::get() const Line | Count | Source | 301 | 10.6k | T* get() const { return fPtr.get(); } |
skia_private::AutoTMalloc<unsigned int, void>::get() const Line | Count | Source | 301 | 8.49k | T* get() const { return fPtr.get(); } |
skia_private::AutoTMalloc<char, void>::get() const Line | Count | Source | 301 | 4.17k | T* get() const { return fPtr.get(); } |
|
302 | | |
303 | 27.6k | operator T*() { return fPtr.get(); } Unexecuted instantiation: skia_private::AutoTMalloc<SkBBoxHierarchy::Metadata, void>::operator SkBBoxHierarchy::Metadata*() skia_private::AutoTMalloc<SkPoint, void>::operator SkPoint*() Line | Count | Source | 303 | 24.8k | operator T*() { return fPtr.get(); } |
Unexecuted instantiation: skia_private::AutoTMalloc<char, void>::operator char*() skia_private::AutoTMalloc<unsigned char, void>::operator unsigned char*() Line | Count | Source | 303 | 2.81k | operator T*() { return fPtr.get(); } |
Unexecuted instantiation: skia_private::AutoTMalloc<float, void>::operator float*() |
304 | | |
305 | 0 | operator const T*() const { return fPtr.get(); } |
306 | | |
307 | 580M | T& operator[](int index) { return fPtr.get()[index]; } skia_private::AutoTMalloc<unsigned int, void>::operator[](int) Line | Count | Source | 307 | 233M | T& operator[](int index) { return fPtr.get()[index]; } |
Unexecuted instantiation: skia_private::AutoTMalloc<SkPicture const*, void>::operator[](int) skia_private::AutoTMalloc<SkRecord::Record, void>::operator[](int) Line | Count | Source | 307 | 2.96M | T& operator[](int index) { return fPtr.get()[index]; } |
skia_private::AutoTMalloc<unsigned char, void>::operator[](int) Line | Count | Source | 307 | 343M | T& operator[](int index) { return fPtr.get()[index]; } |
Unexecuted instantiation: skia_private::AutoTMalloc<float, void>::operator[](int) skia_private::AutoTMalloc<SkFontArguments::Palette::Override, void>::operator[](int) Line | Count | Source | 307 | 935k | T& operator[](int index) { return fPtr.get()[index]; } |
|
308 | | |
309 | 171k | const T& operator[](int index) const { return fPtr.get()[index]; } skia_private::AutoTMalloc<SkRecord::Record, void>::operator[](int) const Line | Count | Source | 309 | 171k | const T& operator[](int index) const { return fPtr.get()[index]; } |
Unexecuted instantiation: skia_private::AutoTMalloc<SkFontArguments::Palette::Override, void>::operator[](int) const |
310 | | |
311 | | /** Aliases matching other types, like std::vector. */ |
312 | 0 | const T* data() const { return fPtr.get(); } |
313 | 0 | T* data() { return fPtr.get(); } |
314 | | |
315 | | /** |
316 | | * Transfer ownership of the ptr to the caller, setting the internal |
317 | | * pointer to NULL. Note that this differs from get(), which also returns |
318 | | * the pointer, but it does not transfer ownership. |
319 | | */ |
320 | 19.0k | T* release() { return fPtr.release(); } Unexecuted instantiation: skia_private::AutoTMalloc<SkPicture const*, void>::release() skia_private::AutoTMalloc<unsigned char, void>::release() Line | Count | Source | 320 | 10.5k | T* release() { return fPtr.release(); } |
skia_private::AutoTMalloc<unsigned int, void>::release() Line | Count | Source | 320 | 8.49k | T* release() { return fPtr.release(); } |
|
321 | | |
322 | | private: |
323 | | std::unique_ptr<T, SkOverloadedFunctionObject<void(void*), sk_free>> fPtr; |
324 | | }; |
325 | | |
326 | | template <size_t kCountRequested, |
327 | | typename T, |
328 | | typename = std::enable_if_t<std::is_trivially_default_constructible<T>::value && |
329 | | std::is_trivially_destructible<T>::value>> |
330 | | class AutoSTMalloc { |
331 | | public: |
332 | 53.9M | AutoSTMalloc() : fPtr(fTStorage) {} skia_private::AutoSTMalloc<8ul, unsigned int, void>::AutoSTMalloc() Line | Count | Source | 332 | 1.09M | AutoSTMalloc() : fPtr(fTStorage) {} |
skia_private::AutoSTMalloc<17ul, SkPoint, void>::AutoSTMalloc() Line | Count | Source | 332 | 7.66M | AutoSTMalloc() : fPtr(fTStorage) {} |
skia_private::AutoSTMalloc<256ul, int, void>::AutoSTMalloc() Line | Count | Source | 332 | 35.9k | AutoSTMalloc() : fPtr(fTStorage) {} |
Unexecuted instantiation: skia_private::AutoSTMalloc<32ul, skgpu::tess::MiddleOutPolygonTriangulator::StackVertex, void>::AutoSTMalloc() skia_private::AutoSTMalloc<4ul, SkFontArguments::VariationPosition::Coordinate, void>::AutoSTMalloc() Line | Count | Source | 332 | 45.1M | AutoSTMalloc() : fPtr(fTStorage) {} |
skia_private::AutoSTMalloc<80ul, unsigned char, void>::AutoSTMalloc() Line | Count | Source | 332 | 9.45k | AutoSTMalloc() : fPtr(fTStorage) {} |
Unexecuted instantiation: skia_private::AutoSTMalloc<64ul, unsigned short, void>::AutoSTMalloc() Unexecuted instantiation: skia_private::AutoSTMalloc<64ul, SkPoint, void>::AutoSTMalloc() Unexecuted instantiation: skia_private::AutoSTMalloc<64ul, unsigned int, void>::AutoSTMalloc() |
333 | | |
334 | 2.30M | AutoSTMalloc(size_t count) { |
335 | 2.30M | if (count > kCount) { |
336 | 8.33k | fPtr = (T*)sk_malloc_throw(count, sizeof(T)); |
337 | 2.29M | } else if (count) { |
338 | 2.14M | fPtr = fTStorage; |
339 | 2.14M | } else { |
340 | 156k | fPtr = nullptr; |
341 | 156k | } |
342 | 2.30M | } Unexecuted instantiation: skia_private::AutoSTMalloc<16ul, sk_sp<SkFlattenable> (*)(SkReadBuffer&), void>::AutoSTMalloc(unsigned long) Unexecuted instantiation: skia_private::AutoSTMalloc<16ul, SkTypeface*, void>::AutoSTMalloc(unsigned long) skia_private::AutoSTMalloc<32ul, SkRasterPipelineStage, void>::AutoSTMalloc(unsigned long) Line | Count | Source | 334 | 1.07M | AutoSTMalloc(size_t count) { | 335 | 1.07M | if (count > kCount) { | 336 | 7.73k | fPtr = (T*)sk_malloc_throw(count, sizeof(T)); | 337 | 1.06M | } else if (count) { | 338 | 1.06M | fPtr = fTStorage; | 339 | 1.06M | } else { | 340 | 0 | fPtr = nullptr; | 341 | 0 | } | 342 | 1.07M | } |
skia_private::AutoSTMalloc<2ul, SkRasterPipeline_MemoryCtxPatch, void>::AutoSTMalloc(unsigned long) Line | Count | Source | 334 | 1.07M | AutoSTMalloc(size_t count) { | 335 | 1.07M | if (count > kCount) { | 336 | 0 | fPtr = (T*)sk_malloc_throw(count, sizeof(T)); | 337 | 1.07M | } else if (count) { | 338 | 1.07M | fPtr = fTStorage; | 339 | 1.07M | } else { | 340 | 0 | fPtr = nullptr; | 341 | 0 | } | 342 | 1.07M | } |
Unexecuted instantiation: skia_private::AutoSTMalloc<8192ul, unsigned char, void>::AutoSTMalloc(unsigned long) skia_private::AutoSTMalloc<4ul, int, void>::AutoSTMalloc(unsigned long) Line | Count | Source | 334 | 104k | AutoSTMalloc(size_t count) { | 335 | 104k | if (count > kCount) { | 336 | 63 | fPtr = (T*)sk_malloc_throw(count, sizeof(T)); | 337 | 104k | } else if (count) { | 338 | 1.52k | fPtr = fTStorage; | 339 | 102k | } else { | 340 | 102k | fPtr = nullptr; | 341 | 102k | } | 342 | 104k | } |
skia_private::AutoSTMalloc<4ul, long, void>::AutoSTMalloc(unsigned long) Line | Count | Source | 334 | 1.05k | AutoSTMalloc(size_t count) { | 335 | 1.05k | if (count > kCount) { | 336 | 42 | fPtr = (T*)sk_malloc_throw(count, sizeof(T)); | 337 | 1.01k | } else if (count) { | 338 | 1.01k | fPtr = fTStorage; | 339 | 1.01k | } else { | 340 | 0 | fPtr = nullptr; | 341 | 0 | } | 342 | 1.05k | } |
Unexecuted instantiation: skia_private::AutoSTMalloc<4ul, SkFontArguments::VariationPosition::Coordinate, void>::AutoSTMalloc(unsigned long) skia_private::AutoSTMalloc<4ul, SkFontArguments::Palette::Override, void>::AutoSTMalloc(unsigned long) Line | Count | Source | 334 | 54.1k | AutoSTMalloc(size_t count) { | 335 | 54.1k | if (count > kCount) { | 336 | 35 | fPtr = (T*)sk_malloc_throw(count, sizeof(T)); | 337 | 54.1k | } else if (count) { | 338 | 580 | fPtr = fTStorage; | 339 | 53.5k | } else { | 340 | 53.5k | fPtr = nullptr; | 341 | 53.5k | } | 342 | 54.1k | } |
Unexecuted instantiation: skia_private::AutoSTMalloc<64ul, short, void>::AutoSTMalloc(unsigned long) skia_private::AutoSTMalloc<64ul, unsigned short, void>::AutoSTMalloc(unsigned long) Line | Count | Source | 334 | 865 | AutoSTMalloc(size_t count) { | 335 | 865 | if (count > kCount) { | 336 | 194 | fPtr = (T*)sk_malloc_throw(count, sizeof(T)); | 337 | 671 | } else if (count) { | 338 | 671 | fPtr = fTStorage; | 339 | 671 | } else { | 340 | 0 | fPtr = nullptr; | 341 | 0 | } | 342 | 865 | } |
skia_private::AutoSTMalloc<64ul, OffsetEdge, void>::AutoSTMalloc(unsigned long) Line | Count | Source | 334 | 205 | AutoSTMalloc(size_t count) { | 335 | 205 | if (count > kCount) { | 336 | 31 | fPtr = (T*)sk_malloc_throw(count, sizeof(T)); | 337 | 174 | } else if (count) { | 338 | 174 | fPtr = fTStorage; | 339 | 174 | } else { | 340 | 0 | fPtr = nullptr; | 341 | 0 | } | 342 | 205 | } |
skia_private::AutoSTMalloc<64ul, SkPoint, void>::AutoSTMalloc(unsigned long) Line | Count | Source | 334 | 1.39k | AutoSTMalloc(size_t count) { | 335 | 1.39k | if (count > kCount) { | 336 | 235 | fPtr = (T*)sk_malloc_throw(count, sizeof(T)); | 337 | 1.15k | } else if (count) { | 338 | 1.12k | fPtr = fTStorage; | 339 | 1.12k | } else { | 340 | 35 | fPtr = nullptr; | 341 | 35 | } | 342 | 1.39k | } |
skia_private::AutoSTMalloc<64ul, int, void>::AutoSTMalloc(unsigned long) Line | Count | Source | 334 | 25 | AutoSTMalloc(size_t count) { | 335 | 25 | if (count > kCount) { | 336 | 0 | fPtr = (T*)sk_malloc_throw(count, sizeof(T)); | 337 | 25 | } else if (count) { | 338 | 25 | fPtr = fTStorage; | 339 | 25 | } else { | 340 | 0 | fPtr = nullptr; | 341 | 0 | } | 342 | 25 | } |
Unexecuted instantiation: skia_private::AutoSTMalloc<256ul, int, void>::AutoSTMalloc(unsigned long) Unexecuted instantiation: skia_private::AutoSTMalloc<256ul, unsigned short, void>::AutoSTMalloc(unsigned long) Unexecuted instantiation: skia_private::AutoSTMalloc<256ul, float, void>::AutoSTMalloc(unsigned long) Unexecuted instantiation: skia_private::AutoSTMalloc<4ul, unsigned char, void>::AutoSTMalloc(unsigned long) Unexecuted instantiation: skia_private::AutoSTMalloc<4ul, unsigned char [3], void>::AutoSTMalloc(unsigned long) Unexecuted instantiation: skia_private::AutoSTMalloc<4ul, unsigned long, void>::AutoSTMalloc(unsigned long) |
343 | | |
344 | | AutoSTMalloc(AutoSTMalloc&&) = delete; |
345 | | AutoSTMalloc(const AutoSTMalloc&) = delete; |
346 | | AutoSTMalloc& operator=(AutoSTMalloc&&) = delete; |
347 | | AutoSTMalloc& operator=(const AutoSTMalloc&) = delete; |
348 | | |
349 | 56.2M | ~AutoSTMalloc() { |
350 | 56.2M | if (fPtr != fTStorage) { |
351 | 616k | sk_free(fPtr); |
352 | 616k | } |
353 | 56.2M | } skia_private::AutoSTMalloc<8ul, unsigned int, void>::~AutoSTMalloc() Line | Count | Source | 349 | 1.09M | ~AutoSTMalloc() { | 350 | 1.09M | if (fPtr != fTStorage) { | 351 | 2.20k | sk_free(fPtr); | 352 | 2.20k | } | 353 | 1.09M | } |
skia_private::AutoSTMalloc<17ul, SkPoint, void>::~AutoSTMalloc() Line | Count | Source | 349 | 7.66M | ~AutoSTMalloc() { | 350 | 7.66M | if (fPtr != fTStorage) { | 351 | 421k | sk_free(fPtr); | 352 | 421k | } | 353 | 7.66M | } |
Unexecuted instantiation: skia_private::AutoSTMalloc<16ul, sk_sp<SkFlattenable> (*)(SkReadBuffer&), void>::~AutoSTMalloc() Unexecuted instantiation: skia_private::AutoSTMalloc<16ul, SkTypeface*, void>::~AutoSTMalloc() skia_private::AutoSTMalloc<32ul, SkRasterPipelineStage, void>::~AutoSTMalloc() Line | Count | Source | 349 | 1.07M | ~AutoSTMalloc() { | 350 | 1.07M | if (fPtr != fTStorage) { | 351 | 7.73k | sk_free(fPtr); | 352 | 7.73k | } | 353 | 1.07M | } |
skia_private::AutoSTMalloc<2ul, SkRasterPipeline_MemoryCtxPatch, void>::~AutoSTMalloc() Line | Count | Source | 349 | 1.07M | ~AutoSTMalloc() { | 350 | 1.07M | if (fPtr != fTStorage) { | 351 | 0 | sk_free(fPtr); | 352 | 0 | } | 353 | 1.07M | } |
skia_private::AutoSTMalloc<4ul, SkFontArguments::VariationPosition::Coordinate, void>::~AutoSTMalloc() Line | Count | Source | 349 | 45.1M | ~AutoSTMalloc() { | 350 | 45.1M | if (fPtr != fTStorage) { | 351 | 24.3k | sk_free(fPtr); | 352 | 24.3k | } | 353 | 45.1M | } |
skia_private::AutoSTMalloc<256ul, int, void>::~AutoSTMalloc() Line | Count | Source | 349 | 35.9k | ~AutoSTMalloc() { | 350 | 35.9k | if (fPtr != fTStorage) { | 351 | 0 | sk_free(fPtr); | 352 | 0 | } | 353 | 35.9k | } |
Unexecuted instantiation: skia_private::AutoSTMalloc<32ul, skgpu::tess::MiddleOutPolygonTriangulator::StackVertex, void>::~AutoSTMalloc() Unexecuted instantiation: skia_private::AutoSTMalloc<8192ul, unsigned char, void>::~AutoSTMalloc() skia_private::AutoSTMalloc<4ul, int, void>::~AutoSTMalloc() Line | Count | Source | 349 | 104k | ~AutoSTMalloc() { | 350 | 104k | if (fPtr != fTStorage) { | 351 | 102k | sk_free(fPtr); | 352 | 102k | } | 353 | 104k | } |
skia_private::AutoSTMalloc<4ul, long, void>::~AutoSTMalloc() Line | Count | Source | 349 | 1.05k | ~AutoSTMalloc() { | 350 | 1.05k | if (fPtr != fTStorage) { | 351 | 42 | sk_free(fPtr); | 352 | 42 | } | 353 | 1.05k | } |
skia_private::AutoSTMalloc<4ul, SkFontArguments::Palette::Override, void>::~AutoSTMalloc() Line | Count | Source | 349 | 54.1k | ~AutoSTMalloc() { | 350 | 54.1k | if (fPtr != fTStorage) { | 351 | 53.5k | sk_free(fPtr); | 352 | 53.5k | } | 353 | 54.1k | } |
Unexecuted instantiation: skia_private::AutoSTMalloc<64ul, short, void>::~AutoSTMalloc() skia_private::AutoSTMalloc<64ul, unsigned short, void>::~AutoSTMalloc() Line | Count | Source | 349 | 865 | ~AutoSTMalloc() { | 350 | 865 | if (fPtr != fTStorage) { | 351 | 194 | sk_free(fPtr); | 352 | 194 | } | 353 | 865 | } |
skia_private::AutoSTMalloc<80ul, unsigned char, void>::~AutoSTMalloc() Line | Count | Source | 349 | 9.45k | ~AutoSTMalloc() { | 350 | 9.45k | if (fPtr != fTStorage) { | 351 | 3.22k | sk_free(fPtr); | 352 | 3.22k | } | 353 | 9.45k | } |
skia_private::AutoSTMalloc<64ul, OffsetEdge, void>::~AutoSTMalloc() Line | Count | Source | 349 | 205 | ~AutoSTMalloc() { | 350 | 205 | if (fPtr != fTStorage) { | 351 | 31 | sk_free(fPtr); | 352 | 31 | } | 353 | 205 | } |
skia_private::AutoSTMalloc<64ul, SkPoint, void>::~AutoSTMalloc() Line | Count | Source | 349 | 1.39k | ~AutoSTMalloc() { | 350 | 1.39k | if (fPtr != fTStorage) { | 351 | 270 | sk_free(fPtr); | 352 | 270 | } | 353 | 1.39k | } |
skia_private::AutoSTMalloc<64ul, int, void>::~AutoSTMalloc() Line | Count | Source | 349 | 25 | ~AutoSTMalloc() { | 350 | 25 | if (fPtr != fTStorage) { | 351 | 0 | sk_free(fPtr); | 352 | 0 | } | 353 | 25 | } |
Unexecuted instantiation: skia_private::AutoSTMalloc<256ul, unsigned short, void>::~AutoSTMalloc() Unexecuted instantiation: skia_private::AutoSTMalloc<256ul, float, void>::~AutoSTMalloc() Unexecuted instantiation: skia_private::AutoSTMalloc<4ul, unsigned char, void>::~AutoSTMalloc() Unexecuted instantiation: skia_private::AutoSTMalloc<4ul, unsigned char [3], void>::~AutoSTMalloc() Unexecuted instantiation: skia_private::AutoSTMalloc<4ul, unsigned long, void>::~AutoSTMalloc() Unexecuted instantiation: skia_private::AutoSTMalloc<64ul, unsigned int, void>::~AutoSTMalloc() |
354 | | |
355 | | // doesn't preserve contents |
356 | 14.3M | T* reset(size_t count) { |
357 | 14.3M | if (fPtr != fTStorage) { |
358 | 2.41M | sk_free(fPtr); |
359 | 2.41M | } |
360 | 14.3M | if (count > kCount) { |
361 | 2.84M | fPtr = (T*)sk_malloc_throw(count, sizeof(T)); |
362 | 11.4M | } else if (count) { |
363 | 11.4M | fPtr = fTStorage; |
364 | 11.4M | } else { |
365 | 21.0k | fPtr = nullptr; |
366 | 21.0k | } |
367 | 14.3M | return fPtr; |
368 | 14.3M | } skia_private::AutoSTMalloc<8ul, unsigned int, void>::reset(unsigned long) Line | Count | Source | 356 | 2.11M | T* reset(size_t count) { | 357 | 2.11M | if (fPtr != fTStorage) { | 358 | 228 | sk_free(fPtr); | 359 | 228 | } | 360 | 2.11M | if (count > kCount) { | 361 | 2.50k | fPtr = (T*)sk_malloc_throw(count, sizeof(T)); | 362 | 2.10M | } else if (count) { | 363 | 2.10M | fPtr = fTStorage; | 364 | 2.10M | } else { | 365 | 0 | fPtr = nullptr; | 366 | 0 | } | 367 | 2.11M | return fPtr; | 368 | 2.11M | } |
skia_private::AutoSTMalloc<4ul, SkFontArguments::VariationPosition::Coordinate, void>::reset(unsigned long) Line | Count | Source | 356 | 27.6k | T* reset(size_t count) { | 357 | 27.6k | if (fPtr != fTStorage) { | 358 | 2.18k | sk_free(fPtr); | 359 | 2.18k | } | 360 | 27.6k | if (count > kCount) { | 361 | 5.44k | fPtr = (T*)sk_malloc_throw(count, sizeof(T)); | 362 | 22.1k | } else if (count) { | 363 | 1.12k | fPtr = fTStorage; | 364 | 21.0k | } else { | 365 | 21.0k | fPtr = nullptr; | 366 | 21.0k | } | 367 | 27.6k | return fPtr; | 368 | 27.6k | } |
skia_private::AutoSTMalloc<17ul, SkPoint, void>::reset(unsigned long) Line | Count | Source | 356 | 12.1M | T* reset(size_t count) { | 357 | 12.1M | if (fPtr != fTStorage) { | 358 | 2.41M | sk_free(fPtr); | 359 | 2.41M | } | 360 | 12.1M | if (count > kCount) { | 361 | 2.83M | fPtr = (T*)sk_malloc_throw(count, sizeof(T)); | 362 | 9.30M | } else if (count) { | 363 | 9.30M | fPtr = fTStorage; | 364 | 9.30M | } else { | 365 | 0 | fPtr = nullptr; | 366 | 0 | } | 367 | 12.1M | return fPtr; | 368 | 12.1M | } |
skia_private::AutoSTMalloc<256ul, int, void>::reset(unsigned long) Line | Count | Source | 356 | 21.3k | T* reset(size_t count) { | 357 | 21.3k | if (fPtr != fTStorage) { | 358 | 0 | sk_free(fPtr); | 359 | 0 | } | 360 | 21.3k | if (count > kCount) { | 361 | 0 | fPtr = (T*)sk_malloc_throw(count, sizeof(T)); | 362 | 21.3k | } else if (count) { | 363 | 21.3k | fPtr = fTStorage; | 364 | 21.3k | } else { | 365 | 0 | fPtr = nullptr; | 366 | 0 | } | 367 | 21.3k | return fPtr; | 368 | 21.3k | } |
Unexecuted instantiation: skia_private::AutoSTMalloc<32ul, skgpu::tess::MiddleOutPolygonTriangulator::StackVertex, void>::reset(unsigned long) skia_private::AutoSTMalloc<80ul, unsigned char, void>::reset(unsigned long) Line | Count | Source | 356 | 9.45k | T* reset(size_t count) { | 357 | 9.45k | if (fPtr != fTStorage) { | 358 | 0 | sk_free(fPtr); | 359 | 0 | } | 360 | 9.45k | if (count > kCount) { | 361 | 3.22k | fPtr = (T*)sk_malloc_throw(count, sizeof(T)); | 362 | 6.23k | } else if (count) { | 363 | 6.23k | fPtr = fTStorage; | 364 | 6.23k | } else { | 365 | 0 | fPtr = nullptr; | 366 | 0 | } | 367 | 9.45k | return fPtr; | 368 | 9.45k | } |
Unexecuted instantiation: skia_private::AutoSTMalloc<64ul, unsigned short, void>::reset(unsigned long) Unexecuted instantiation: skia_private::AutoSTMalloc<64ul, SkPoint, void>::reset(unsigned long) Unexecuted instantiation: skia_private::AutoSTMalloc<64ul, unsigned int, void>::reset(unsigned long) |
369 | | |
370 | 5.00M | T* get() const { return fPtr; } skia_private::AutoSTMalloc<8ul, unsigned int, void>::get() const Line | Count | Source | 370 | 2.28M | T* get() const { return fPtr; } |
skia_private::AutoSTMalloc<4ul, int, void>::get() const Line | Count | Source | 370 | 52.0k | T* get() const { return fPtr; } |
Unexecuted instantiation: skia_private::AutoSTMalloc<4ul, SkFontArguments::Palette::Override, void>::get() const skia_private::AutoSTMalloc<4ul, SkFontArguments::VariationPosition::Coordinate, void>::get() const Line | Count | Source | 370 | 523k | T* get() const { return fPtr; } |
Unexecuted instantiation: skia_private::AutoSTMalloc<16ul, sk_sp<SkFlattenable> (*)(SkReadBuffer&), void>::get() const Unexecuted instantiation: skia_private::AutoSTMalloc<16ul, SkTypeface*, void>::get() const skia_private::AutoSTMalloc<32ul, SkRasterPipelineStage, void>::get() const Line | Count | Source | 370 | 2.14M | T* get() const { return fPtr; } |
Unexecuted instantiation: skia_private::AutoSTMalloc<8192ul, unsigned char, void>::get() const skia_private::AutoSTMalloc<4ul, long, void>::get() const Line | Count | Source | 370 | 646 | T* get() const { return fPtr; } |
Unexecuted instantiation: skia_private::AutoSTMalloc<64ul, short, void>::get() const skia_private::AutoSTMalloc<64ul, int, void>::get() const Line | Count | Source | 370 | 57 | T* get() const { return fPtr; } |
Unexecuted instantiation: skia_private::AutoSTMalloc<256ul, int, void>::get() const Unexecuted instantiation: skia_private::AutoSTMalloc<256ul, unsigned short, void>::get() const Unexecuted instantiation: skia_private::AutoSTMalloc<256ul, float, void>::get() const Unexecuted instantiation: skia_private::AutoSTMalloc<4ul, unsigned char [3], void>::get() const Unexecuted instantiation: skia_private::AutoSTMalloc<4ul, unsigned long, void>::get() const Unexecuted instantiation: skia_private::AutoSTMalloc<64ul, unsigned short, void>::get() const Unexecuted instantiation: skia_private::AutoSTMalloc<64ul, SkPoint, void>::get() const Unexecuted instantiation: skia_private::AutoSTMalloc<64ul, unsigned int, void>::get() const |
371 | | |
372 | 57.1k | operator T*() { |
373 | 57.1k | return fPtr; |
374 | 57.1k | } Unexecuted instantiation: skia_private::AutoSTMalloc<32ul, skgpu::tess::MiddleOutPolygonTriangulator::StackVertex, void>::operator skgpu::tess::MiddleOutPolygonTriangulator::StackVertex*() Unexecuted instantiation: skia_private::AutoSTMalloc<4ul, SkFontArguments::VariationPosition::Coordinate, void>::operator SkFontArguments::VariationPosition::Coordinate*() skia_private::AutoSTMalloc<4ul, int, void>::operator int*() Line | Count | Source | 372 | 50.0k | operator T*() { | 373 | 50.0k | return fPtr; | 374 | 50.0k | } |
skia_private::AutoSTMalloc<64ul, unsigned short, void>::operator unsigned short*() Line | Count | Source | 372 | 865 | operator T*() { | 373 | 865 | return fPtr; | 374 | 865 | } |
Unexecuted instantiation: skia_private::AutoSTMalloc<4ul, unsigned char, void>::operator unsigned char*() skia_private::AutoSTMalloc<64ul, SkPoint, void>::operator SkPoint*() Line | Count | Source | 372 | 6.21k | operator T*() { | 373 | 6.21k | return fPtr; | 374 | 6.21k | } |
|
375 | | |
376 | | operator const T*() const { |
377 | | return fPtr; |
378 | | } |
379 | | |
380 | 11.0M | T& operator[](int index) { |
381 | 11.0M | return fPtr[index]; |
382 | 11.0M | } skia_private::AutoSTMalloc<8ul, unsigned int, void>::operator[](int) Line | Count | Source | 380 | 5.40M | T& operator[](int index) { | 381 | 5.40M | return fPtr[index]; | 382 | 5.40M | } |
skia_private::AutoSTMalloc<4ul, int, void>::operator[](int) Line | Count | Source | 380 | 3.97k | T& operator[](int index) { | 381 | 3.97k | return fPtr[index]; | 382 | 3.97k | } |
skia_private::AutoSTMalloc<4ul, SkFontArguments::Palette::Override, void>::operator[](int) Line | Count | Source | 380 | 1.05k | T& operator[](int index) { | 381 | 1.05k | return fPtr[index]; | 382 | 1.05k | } |
skia_private::AutoSTMalloc<2ul, SkRasterPipeline_MemoryCtxPatch, void>::operator[](int) Line | Count | Source | 380 | 3.90M | T& operator[](int index) { | 381 | 3.90M | return fPtr[index]; | 382 | 3.90M | } |
skia_private::AutoSTMalloc<256ul, int, void>::operator[](int) Line | Count | Source | 380 | 164k | T& operator[](int index) { | 381 | 164k | return fPtr[index]; | 382 | 164k | } |
Unexecuted instantiation: skia_private::AutoSTMalloc<32ul, skgpu::tess::MiddleOutPolygonTriangulator::StackVertex, void>::operator[](int) skia_private::AutoSTMalloc<4ul, long, void>::operator[](int) Line | Count | Source | 380 | 2.10k | T& operator[](int index) { | 381 | 2.10k | return fPtr[index]; | 382 | 2.10k | } |
skia_private::AutoSTMalloc<4ul, SkFontArguments::VariationPosition::Coordinate, void>::operator[](int) Line | Count | Source | 380 | 993k | T& operator[](int index) { | 381 | 993k | return fPtr[index]; | 382 | 993k | } |
skia_private::AutoSTMalloc<64ul, unsigned short, void>::operator[](int) Line | Count | Source | 380 | 84.4k | T& operator[](int index) { | 381 | 84.4k | return fPtr[index]; | 382 | 84.4k | } |
skia_private::AutoSTMalloc<64ul, OffsetEdge, void>::operator[](int) Line | Count | Source | 380 | 55.0k | T& operator[](int index) { | 381 | 55.0k | return fPtr[index]; | 382 | 55.0k | } |
skia_private::AutoSTMalloc<64ul, SkPoint, void>::operator[](int) Line | Count | Source | 380 | 412k | T& operator[](int index) { | 381 | 412k | return fPtr[index]; | 382 | 412k | } |
Unexecuted instantiation: skia_private::AutoSTMalloc<256ul, unsigned short, void>::operator[](int) Unexecuted instantiation: skia_private::AutoSTMalloc<256ul, float, void>::operator[](int) Unexecuted instantiation: skia_private::AutoSTMalloc<4ul, unsigned char, void>::operator[](int) Unexecuted instantiation: skia_private::AutoSTMalloc<4ul, unsigned long, void>::operator[](int) Unexecuted instantiation: skia_private::AutoSTMalloc<64ul, unsigned int, void>::operator[](int) |
383 | | |
384 | 7.62M | const T& operator[](int index) const { |
385 | 7.62M | return fPtr[index]; |
386 | 7.62M | } skia_private::AutoSTMalloc<8ul, unsigned int, void>::operator[](int) const Line | Count | Source | 384 | 7.61M | const T& operator[](int index) const { | 385 | 7.61M | return fPtr[index]; | 386 | 7.61M | } |
skia_private::AutoSTMalloc<4ul, int, void>::operator[](int) const Line | Count | Source | 384 | 1.98k | const T& operator[](int index) const { | 385 | 1.98k | return fPtr[index]; | 386 | 1.98k | } |
Unexecuted instantiation: skia_private::AutoSTMalloc<4ul, SkFontArguments::Palette::Override, void>::operator[](int) const Unexecuted instantiation: skia_private::AutoSTMalloc<4ul, SkFontArguments::VariationPosition::Coordinate, void>::operator[](int) const |
387 | | |
388 | | /** Aliases matching other types, like std::vector. */ |
389 | | const T* data() const { return fPtr; } |
390 | 1.07M | T* data() { return fPtr; } skia_private::AutoSTMalloc<2ul, SkRasterPipeline_MemoryCtxPatch, void>::data() Line | Count | Source | 390 | 1.07M | T* data() { return fPtr; } |
Unexecuted instantiation: skia_private::AutoSTMalloc<64ul, unsigned short, void>::data() Unexecuted instantiation: skia_private::AutoSTMalloc<64ul, SkPoint, void>::data() |
391 | | |
392 | | // Reallocs the array, can be used to shrink the allocation. Makes no attempt to be intelligent |
393 | 0 | void realloc(size_t count) { |
394 | 0 | if (count > kCount) { |
395 | 0 | if (fPtr == fTStorage) { |
396 | 0 | fPtr = (T*)sk_malloc_throw(count, sizeof(T)); |
397 | 0 | memcpy((void*)fPtr, fTStorage, kCount * sizeof(T)); |
398 | 0 | } else { |
399 | 0 | fPtr = (T*)sk_realloc_throw(fPtr, count, sizeof(T)); |
400 | 0 | } |
401 | 0 | } else if (count) { |
402 | 0 | if (fPtr != fTStorage) { |
403 | 0 | fPtr = (T*)sk_realloc_throw(fPtr, count, sizeof(T)); |
404 | 0 | } |
405 | 0 | } else { |
406 | 0 | this->reset(0); |
407 | 0 | } |
408 | 0 | } Unexecuted instantiation: skia_private::AutoSTMalloc<64ul, unsigned short, void>::realloc(unsigned long) Unexecuted instantiation: skia_private::AutoSTMalloc<64ul, SkPoint, void>::realloc(unsigned long) Unexecuted instantiation: skia_private::AutoSTMalloc<64ul, unsigned int, void>::realloc(unsigned long) |
409 | | |
410 | | private: |
411 | | // Since we use uint32_t storage, we might be able to get more elements for free. |
412 | | static const size_t kCountWithPadding = SkAlign4(kCountRequested*sizeof(T)) / sizeof(T); |
413 | | #if defined(SK_BUILD_FOR_GOOGLE3) |
414 | | // Stack frame size is limited for SK_BUILD_FOR_GOOGLE3. 4k is less than the actual max, but some functions |
415 | | // have multiple large stack allocations. |
416 | | static const size_t kMaxBytes = 4 * 1024; |
417 | | static const size_t kCount = kCountRequested * sizeof(T) > kMaxBytes |
418 | | ? kMaxBytes / sizeof(T) |
419 | | : kCountWithPadding; |
420 | | #else |
421 | | static const size_t kCount = kCountWithPadding; |
422 | | #endif |
423 | | |
424 | | T* fPtr; |
425 | | union { |
426 | | uint32_t fStorage32[SkAlign4(kCount*sizeof(T)) >> 2]; |
427 | | T fTStorage[1]; // do NOT want to invoke T::T() |
428 | | }; |
429 | | }; |
430 | | |
431 | | using UniqueVoidPtr = std::unique_ptr<void, SkOverloadedFunctionObject<void(void*), sk_free>>; |
432 | | |
433 | | } // namespace skia_private |
434 | | |
435 | | template<typename C, std::size_t... Is> |
436 | | constexpr auto SkMakeArrayFromIndexSequence(C c, std::index_sequence<Is...> is) |
437 | | -> std::array<decltype(c(std::declval<typename decltype(is)::value_type>())), sizeof...(Is)> { |
438 | | return {{ c(Is)... }}; |
439 | | } |
440 | | |
441 | | template<size_t N, typename C> constexpr auto SkMakeArray(C c) |
442 | | -> std::array<decltype(c(std::declval<typename std::index_sequence<N>::value_type>())), N> { |
443 | | return SkMakeArrayFromIndexSequence(c, std::make_index_sequence<N>{}); |
444 | | } |
445 | | |
446 | | #endif |