Revert "replace SkNVRefCnt with SkRefCnt"
This reverts commit 0fb1ee98cf7dfb87a3b376de8e0dff28c1b95619.
Reason for revert: looks like this increased size by ~8K.
Original change's description:
> replace SkNVRefCnt with SkRefCnt
>
> SkNVRefCnt trades a small amount of code size (vtable) and runtime
> (vptr) memory usage for a larger amount of code size (templating). It
> was written back in a time when all we were really thinking about was
> runtime memory usage, so I'm curious to see where performance, code
> size, and memory usage all move if it's removed.
>
> Looking at the types I've changed here, my guess is that performance and
> memory usage will be basically unchanged, and that code size will drop a
> bit. Nothing else it's nicer to have only one ref-counting base class.
>
> Change-Id: I7d56a2b9e2b9fb000ff97792159ea1ff4f5e6f13
> Reviewed-on: https://skia-review.googlesource.com/c/166203
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Mike Klein <mtklein@google.com>
TBR=mtklein@google.com,bsalomon@google.com,mtklein@chromium.org
Change-Id: Ibcfcc4b523c466a535bea5ffa30d0fe2574c5bd7
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/166360
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
diff --git a/src/gpu/GrBackendTextureImageGenerator.h b/src/gpu/GrBackendTextureImageGenerator.h
index 5f1afae..9d76e02 100644
--- a/src/gpu/GrBackendTextureImageGenerator.h
+++ b/src/gpu/GrBackendTextureImageGenerator.h
@@ -50,7 +50,7 @@
static void ReleaseRefHelper_TextureReleaseProc(void* ctx);
- class RefHelper : public SkRefCnt {
+ class RefHelper : public SkNVRefCnt<RefHelper> {
public:
RefHelper(GrTexture* texture, uint32_t owningContextID)
: fOriginalTexture(texture)
diff --git a/src/gpu/effects/GrSkSLFP.h b/src/gpu/effects/GrSkSLFP.h
index 619c568..c4acfd0 100644
--- a/src/gpu/effects/GrSkSLFP.h
+++ b/src/gpu/effects/GrSkSLFP.h
@@ -126,7 +126,7 @@
* upon the inputs to the SkSL (static if's, etc.) we first create a factory for a given SkSL
* string, then use that to create the actual GrFragmentProcessor.
*/
-class GrSkSLFPFactory : public SkRefCnt {
+class GrSkSLFPFactory : public SkNVRefCnt<GrSkSLFPFactory> {
public:
/**
* Constructs a GrSkSLFPFactory for a given SkSL source string. Creating a factory will
diff --git a/src/gpu/text/GrDistanceFieldAdjustTable.h b/src/gpu/text/GrDistanceFieldAdjustTable.h
index 03e4bab..fca9a8c 100644
--- a/src/gpu/text/GrDistanceFieldAdjustTable.h
+++ b/src/gpu/text/GrDistanceFieldAdjustTable.h
@@ -14,7 +14,7 @@
// Distance field text needs this table to compute a value for use in the fragment shader.
// Because the GrTextContext can go out of scope before the final flush, this needs to be
// refcnted and malloced
-struct GrDistanceFieldAdjustTable : public SkRefCnt {
+struct GrDistanceFieldAdjustTable : public SkNVRefCnt<GrDistanceFieldAdjustTable> {
GrDistanceFieldAdjustTable() { this->buildDistanceAdjustTables(); }
~GrDistanceFieldAdjustTable() {
delete[] fTable;
diff --git a/src/gpu/text/GrGlyphCache.h b/src/gpu/text/GrGlyphCache.h
index ec4ca2b..c38ba78 100644
--- a/src/gpu/text/GrGlyphCache.h
+++ b/src/gpu/text/GrGlyphCache.h
@@ -26,7 +26,7 @@
* of it's SkDescriptor as a key to access (or regenerate) the SkGlyphCache. GrTextStrikes are
* created by and owned by a GrGlyphCache.
*/
-class GrTextStrike : public SkRefCnt {
+class GrTextStrike : public SkNVRefCnt<GrTextStrike> {
public:
GrTextStrike(const SkDescriptor& fontScalerKey);
~GrTextStrike();
diff --git a/src/gpu/text/GrTextBlob.h b/src/gpu/text/GrTextBlob.h
index c5f34cd..8451d48 100644
--- a/src/gpu/text/GrTextBlob.h
+++ b/src/gpu/text/GrTextBlob.h
@@ -47,7 +47,7 @@
*
* *WARNING* If you add new fields to this struct, then you may need to to update AssertEqual
*/
-class GrTextBlob : public SkRefCnt {
+class GrTextBlob : public SkNVRefCnt<GrTextBlob> {
public:
SK_DECLARE_INTERNAL_LLIST_INTERFACE(GrTextBlob);
diff --git a/src/image/SkImage_Lazy.cpp b/src/image/SkImage_Lazy.cpp
index b7da07d..bd219c6 100644
--- a/src/image/SkImage_Lazy.cpp
+++ b/src/image/SkImage_Lazy.cpp
@@ -28,7 +28,7 @@
#endif
// Ref-counted tuple(SkImageGenerator, SkMutex) which allows sharing one generator among N images
-class SharedGenerator final : public SkRefCnt {
+class SharedGenerator final : public SkNVRefCnt<SharedGenerator> {
public:
static sk_sp<SharedGenerator> Make(std::unique_ptr<SkImageGenerator> gen) {
return gen ? sk_sp<SharedGenerator>(new SharedGenerator(std::move(gen))) : nullptr;