skia2/gn
Michael Ludwig cd01979004 Refactor GrMemoryPool into reusable GrBlockAllocator
This moves the byte block linked list structure outside of GrMemoryPool
into a new type, GrBlockAllocator. This new type is solely responsible
for managing the byte blocks, tracking where the next allocation
occurs, and creating/destroying the byte blocks. It also tries to
encapsulate all of/most alignment related math, while making it
convenient for clients to add per-allocation padding/metadata.

It has added functionality compared to the original block linked list
that was embedded in GrMemoryPool:
 - Supports resetting the entire allocator
 - Supports resizing the last allocation
 - Is able to rewind an entire stack of allocations, instead of just the
   last allocation.
 - Supports multiple block growth policies instead of just a fixed size.
 - Supports templated alignment, and variable alignment within a single
   GrBlockAllocator
 - Query the amount of available memory
 - Performs as much math as possible in 32-bit ints with static asserts
   that ensure overflow won't happen.

Some of this flexibility was added so that the GrBlockAllocator can be
used to implement an arena allocator similar to SkArenaAlloc, or to
replace the use of SkTArray in GrQuadBuffer. It is also likely possible
that GrAllocator can be written on top of GrBlockAllocator. I will try
to perform these consolidations in later CLs.

Change-Id: Ia6c8709642369b66b88eb1bc46264fb2aa9b62ab
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/262216
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2020-03-17 14:41:14 +00:00
..
toolchain set lib_switch to empty for the msvc toolchain 2020-03-06 19:32:50 +00:00
__init__.py Make gn directory importable in python 2017-03-20 17:40:30 +00:00
bench.gni Remove exotic legacy bitmap drawing entry points: Nine, Lattice 2020-03-11 13:11:47 +00:00
BUILD.gn remove -D_GLIBCXX_DEBUG 2020-03-11 18:12:48 +00:00
BUILDCONFIG.gn Enable ASAN on Windows 2019-12-30 17:06:26 +00:00
call.py [minor] mark scripts as executable 2019-11-21 17:06:27 +00:00
checkdir.py fix print functions for python3 gn scripts 2020-03-06 17:42:39 +00:00
checkpath.py Python3 tweaks 2019-12-17 17:12:03 +00:00
codesign_ios.py [minor] mark scripts as executable 2019-11-21 17:06:27 +00:00
compile_ib_files.py Reland "Add launch screen to iOS apps" 2019-09-05 14:05:08 +00:00
compile_processors.py moved files generated from .fp files into generated/ directories 2019-04-10 18:02:02 +00:00
copy_git_directory.py GN tools: copy_git_directory.py better error message. 2019-11-19 17:04:18 +00:00
core.gni remove SkTLS 2020-03-06 14:41:01 +00:00
cp.py [minor] mark scripts as executable 2019-11-21 17:06:27 +00:00
create_sksl_enums.py [minor] mark scripts as executable 2019-11-21 17:06:27 +00:00
effects_imagefilters.gni Add new SkImageFilters factory API 2019-08-02 13:33:35 +00:00
effects.gni Add SkShaderMaskFilter.h to public header list 2019-06-21 14:40:25 +00:00
find_headers.py Python3 tweaks 2019-12-17 17:12:03 +00:00
find_msvc.py fall back to vswhere.exe to find msvc 2020-03-08 23:57:16 +00:00
find_xcode_sysroot.py fix print functions for python3 gn scripts 2020-03-06 17:42:39 +00:00
flutter_defines.gni switch to virtual with no bones 2020-03-03 13:35:00 +00:00
fuchsia_defines.gni remove legacy hinting-enum guards 2018-11-28 20:15:03 +00:00
gen_plist_ios.py [minor] mark scripts as executable 2019-11-21 17:06:27 +00:00
gm.gni Reland: Initial checkin of GM verifier framework 2020-02-06 15:01:31 +00:00
gn_meta_sln.py fix print functions for python3 gn scripts 2020-03-06 17:42:39 +00:00
gn_to_bp_utils.py fix print functions for python3 gn scripts 2020-03-06 17:42:39 +00:00
gn_to_bp.py Remove mips workarounds for Android. 2020-03-13 18:46:26 +00:00
gn_to_cmake.py [infra] Change CMake build to use a temporary directory 2020-01-14 11:41:55 +00:00
gpu.gni Refactor GrMemoryPool into reusable GrBlockAllocator 2020-03-17 14:41:14 +00:00
highest_version_dir.py fix print functions for python3 gn scripts 2020-03-06 17:42:39 +00:00
ios.gni gn: split out iOS templates to gn/ios.gni 2019-09-16 18:49:24 +00:00
is_clang.py fix print functions for python3 gn scripts 2020-03-06 17:42:39 +00:00
make_gm_gni.py GMs: re-sort gni, script to regenerate gni, file name convention 2019-05-02 20:08:37 +00:00
opts.gni clean up SkBitmapProcState::platformProcs() 2018-12-03 21:24:31 +00:00
pdf.gni SkPDF: move type1 font code into single file 2019-04-18 21:01:58 +00:00
push_to_android.py
run_sksllex.py Revert "Revert "SkSL now supports null child processors"" 2019-02-22 17:50:30 +00:00
samples.gni sample3d 2020-01-11 21:23:27 +00:00
shared_sources.gni remove empty skia_for_chromium_defines 2019-01-17 17:37:01 +00:00
skia.gni Reland "Split building encoding from decoding" 2020-03-09 20:21:19 +00:00
sksl.gni remove LerpRed shader 2020-03-12 18:37:17 +00:00
tests.gni Refactor GrMemoryPool into reusable GrBlockAllocator 2020-03-17 14:41:14 +00:00
utils.gni rm Sk3D.h -- long live SkMat4 2020-02-20 13:15:33 +00:00
xps.gni GN: split out skia_*_public from skia_*_sources 2019-03-15 18:29:19 +00:00