1a2326363a
Currently when we create a scratch resource, we immediately add it to scratch map and it will stay there until we delete the resource. The one exception to this is adding a unique key will remove a resource from the scratch map. This means there are resources in the scratch map that can't be returned when looking for a scratch because they are either already in use by something else or their budget was changed to unbudgeted. This means everything time we do a scratch lookup, even after finding the list of resources that match a key, we still have to iterate that list to see if we can use that resource or not. The problem comes when we may have lots of resources that all match the same key (think 1000s of identical buffers). Then the cost of iterating this list starts to get very high. This change makes it so only resources that can actively be used as a scratch at that moment are stored in the scratch map. Thus when we find a scratch resource we pull it out of the scratch map. When that resources refs go back to zero it is added back to the scratch map. Similar removal is also now used for changing a resource to and from budgeted. Change-Id: I52b415d0e035dfc589f3d712be85799a56827bf0 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/367976 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Greg Daniel <egdaniel@google.com> |
||
---|---|---|
animations | ||
bazel | ||
bench | ||
bin | ||
build/fuchsia | ||
build_overrides | ||
client_utils/android | ||
demos.skia.org | ||
dm | ||
docker | ||
docs/examples | ||
example | ||
experimental | ||
fuzz | ||
gm | ||
gn | ||
include | ||
infra | ||
modules | ||
platform_tools | ||
resources | ||
samplecode | ||
site | ||
specs | ||
src | ||
tests | ||
third_party | ||
tools | ||
.bazelignore | ||
.clang-format | ||
.clang-tidy | ||
.gitignore | ||
.gn | ||
AUTHORS | ||
BUILD.bazel | ||
BUILD.gn | ||
codereview.settings | ||
CONTRIBUTING | ||
CQ_COMMITTERS | ||
DEPS | ||
DIR_METADATA | ||
go.mod | ||
go.sum | ||
LICENSE | ||
PRESUBMIT.py | ||
public.bzl | ||
README | ||
README.chromium | ||
RELEASE_NOTES.txt | ||
whitespace.txt | ||
WORKSPACE.bazel |
Skia is a complete 2D graphic library for drawing Text, Geometries, and Images. See full details, and build instructions, at https://skia.org.