Prevent unbounded listener growth on SkPixelRefs.

Use SkIDChangeListener and update GrBitmapTextureMaker to add listener
to key to deregister if texture is purged before genID changes.

Add a common listener list implementation and replace existing lists.

Change-Id: Ib0c78241eaf59b59b892d8b004b2bb095140bc6d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/274549
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
diff --git a/gn/core.gni b/gn/core.gni
index f21d233..d4e92fa 100644
--- a/gn/core.gni
+++ b/gn/core.gni
@@ -226,7 +226,7 @@
   "$_src/core/SkGraphics.cpp",
   "$_src/core/SkHalf.cpp",
   "$_src/core/SkICC.cpp",
-  "$_src/core/SkIDChangeListener.h",
+  "$_src/core/SkIDChangeListener.cpp",
   "$_src/core/SkImageFilter.cpp",
   "$_src/core/SkImageFilter_Base.h",
   "$_src/core/SkImageFilterCache.cpp",
@@ -466,6 +466,7 @@
   "$_include/private/SkFloatBits.h",
   "$_include/private/SkFloatingPoint.h",
   "$_include/private/SkHalf.h",
+  "$_include/private/SkIDChangeListener.h",
   "$_include/private/SkMalloc.h",
   "$_include/private/SkMutex.h",
   "$_include/private/SkNoncopyable.h",