README.md |
The files here are part of the base package (see also include/private/base). The distinction |
253 |
SkArenaAlloc.cpp |
|
6147 |
SkArenaAlloc.h |
|
12921 |
SkArenaAllocList.h |
A singly linked list of Ts stored in a SkArenaAlloc. The arena rather than the list owns
the elements. This supports forward iteration and range based for loops.
|
2098 |
SkASAN.h |
|
1736 |
SkAutoMalloc.h |
Manage an allocated block of heap memory. This object is the sole manager of
the lifetime of the block, so the caller must not call sk_free() or delete
on the block, unless release() was called.
|
5909 |
SkBezierCurves.cpp |
= beta_X(0) |
4377 |
SkBezierCurves.h |
Utilities for dealing with cubic Bézier curves. These have a start XY
point, an end XY point, and two control XY points in between. They take
a parameter t which is between 0 and 1 (inclusive) which is used to
interpolate between the start and end points, via a route dictated by
the control points, and return a new XY point.
We store a Bézier curve as an array of 8 floats or doubles, where
the even indices are the X coordinates, and the odd indices are the Y
coordinates.
|
2389 |
SkBlockAllocator.cpp |
prev= |
11161 |
SkBlockAllocator.h |
SkBlockAllocator provides low-level support for a block allocated arena with a dynamic tail that
tracks space reservations within each block. Its APIs provide the ability to reserve space,
resize reservations, and release reservations. It will automatically create new blocks if needed
and destroy all remaining blocks when it is destructed. It assumes that anything allocated within
its blocks has its destructors called externally. It is recommended that SkBlockAllocator is
wrapped by a higher-level allocator that uses the low-level APIs to implement a simpler,
purpose-focused API w/o having to worry as much about byte-level concerns.
SkBlockAllocator has no limit to its total size, but each allocation is limited to 512MB (which
should be sufficient for Skia's use cases). This upper allocation limit allows all internal
operations to be performed using 'int' and avoid many overflow checks. Static asserts are used
to ensure that those operations would not overflow when using the largest possible values.
Possible use modes:
1. No upfront allocation, either on the stack or as a field
SkBlockAllocator allocator(policy, heapAllocSize);
2. In-place new'd
void* mem = operator new(totalSize);
SkBlockAllocator* allocator = new (mem) SkBlockAllocator(policy, heapAllocSize,
totalSize- sizeof(SkBlockAllocator));
delete allocator;
3. Use SkSBlockAllocator to increase the preallocation size
SkSBlockAllocator<1024> allocator(policy, heapAllocSize);
sizeof(allocator) == 1024;
|
34505 |
SkBuffer.cpp |
|
2069 |
SkBuffer.h |
\class SkRBuffer
Light weight class for reading data from a memory block.
The RBuffer is given the buffer to read from, with either a specified size
or no size (in which case no range checking is performed). It is iillegal
to attempt to read a value from an empty RBuffer (data == null).
|
4253 |
SkContainers.cpp |
|
3648 |
SkCubics.cpp |
|
8726 |
SkCubics.h |
Utilities for dealing with cubic formulas with one variable:
f(t) = A*t^3 + B*t^2 + C*t + d
|
1938 |
SkDeque.cpp |
|
8782 |
SkEndian.h |
\file SkEndian.h
Macros and helper functions for handling 16 and 32 bit values in
big and little endian formats.
|
6529 |
SkFloatingPoint.cpp |
|
1789 |
SkHalf.cpp |
|
2655 |
SkHalf.h |
|
1172 |
SkLeanWindows.h |
|
873 |
SkMalloc.cpp |
|
717 |
SkMathPriv.cpp |
www.worldserver.com/turk/computergraphics/FixedSqrt.pdf
|
1761 |
SkMathPriv.h |
Return the integer square root of value, with a bias of bitBias
|
10383 |
SkMSAN.h |
|
1411 |
SkQuads.cpp |
normal form: x^2 + px + q = 0 |
2317 |
SkQuads.h |
Utilities for dealing with quadratic formulas with one variable:
f(t) = A*t^2 + B*t + C
|
824 |
SkRandom.h |
\class SkRandom
Utility class that implements pseudo random 32bit numbers using Marsaglia's
multiply-with-carry "mother of all" algorithm. Unlike rand(), this class holds
its own state, so that multiple instances can be used with no side-effects.
Has a large period and all bits are well-randomized.
|
4973 |
SkRectMemcpy.h |
|
871 |
SkSafeMath.cpp |
|
455 |
SkSafeMath.h |
Return a + b, unless this result is an overflow/underflow. In those cases, fOK will
be set to false, and it is undefined what this returns.
|
3414 |
SkScopeExit.h |
SkScopeExit calls a std:::function<void()> in its destructor. |
1336 |
SkSemaphore.cpp |
initial count |
2711 |
SkStringView.h |
|
1447 |
SkTBlockList.h |
SkTBlockList manages dynamic storage for instances of T, reserving fixed blocks such that
allocation is amortized across every N instances. In this way it is a hybrid of an array-based
vector and a linked-list. T can be any type and non-trivial destructors are automatically
invoked when the SkTBlockList is destructed. The addresses of instances are guaranteed
not to move except when a list is concatenated to another.
The collection supports storing a templated number of elements inline before heap-allocated
blocks are made to hold additional instances. By default, the heap blocks are sized to hold the
same number of items as the inline block. A common pattern is to have the inline size hold only
a small number of items for the common case and then allocate larger blocks when needed.
If the size of a collection is N, and its block size is B, the complexity of the common
operations are:
- push_back()/emplace_back(): O(1), with malloc O(B)
- pop_back(): O(1), with free O(B)
- front()/back(): O(1)
- reset(): O(N) for non-trivial types, O(N/B) for trivial types
- concat(): O(B)
- random access: O(N/B)
- iteration: O(1) at each step
These characteristics make it well suited for allocating items in a LIFO ordering, or otherwise
acting as a stack, or simply using it as a typed allocator.
|
17731 |
SkTDArray.cpp |
|
7418 |
SkTDPQueue.h |
This class implements a priority queue. T is the type of the elements in the queue. LESS is a
function that compares two Ts and returns true if the first is higher priority than the second.
Optionally objects may know their index into the priority queue. The queue will update the index
as the objects move through the queue. This is enabled by using a non-nullptr function for INDEX.
When an INDEX function is provided random deletes from the queue are allowed using remove().
Additionally, the * priority is allowed to change as long as priorityDidChange() is called
afterwards. In debug builds the index will be set to -1 before an element is removed from the
queue.
|
7246 |
SkThreadID.cpp |
|
424 |
SkTInternalLList.h |
This macro creates the member variables required by the SkTInternalLList class. It should be
placed in the private section of any class that will be stored in a double linked list.
|
7802 |
SkTLazy.h |
Efficient way to defer allocating/initializing a class until it is needed
(if ever).
|
5882 |
SkTSearch.cpp |
|
2855 |
SkTSearch.h |
All of the SkTSearch variants want to return the index (0...N-1) of the
found element, or the bit-not of where to insert the element.
At a simple level, if the return value is negative, it was not found.
For clients that want to insert the new element if it was not found, use
the following logic:
int index = SkTSearch(...);
if (index >= 0) {
// found at index
} else {
index = ~index; // now we are positive
// insert at index
}
|
4284 |
SkTSort.h |
Sifts a broken heap. The input array is a heap from root to bottom
except that the root entry may be out of place.
Sinks a hole from array[root] to leaf and then sifts the original array[root] element
from the leaf level up.
This version does extra work, in that it copies child to parent on the way down,
then copies parent to child on the way back up. When copies are inexpensive,
this is an optimization as this sift variant should only be used when
the potentially out of place root entry value is expected to be small.
@param root the one based index into array of the out-of-place root of the heap.
@param bottom the one based index in the array of the last entry in the heap.
|
7330 |
SkUTF.cpp |
@returns -1 iff invalid UTF8 byte,
0 iff UTF8 continuation byte,
1 iff ASCII byte,
2 iff leading byte of 2-byte sequence,
3 iff leading byte of 3-byte sequence, and
4 iff leading byte of 4-byte sequence.
I.e.: if return value > 0, then gives length of sequence.
|
9219 |
SkUTF.h |
Given a sequence of UTF-8 bytes, return the number of unicode codepoints.
If the sequence is invalid UTF-8, return -1.
|
3911 |
SkUtils.cpp |
|
462 |
SkUtils.h |
|
1858 |
SkVx.h |
|
45878 |
SkZip.h |
|
8424 |