Compile Slug::NextUnique on CPU builds also

Some linkers complain about having a missing symbol even if
the code paths that would use slugs are not actually used
(e.g. clang-cl on Windows)

Change-Id: Iee56ad2758d72f2555ce6c3263013958eaa026f3
Bug: b/327509180
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/820636
Commit-Queue: Kevin Lubick <kjlubick@google.com>
Reviewed-by: Herb Derby <herb@google.com>
diff --git a/src/text/SlugFromBuffer.cpp b/src/text/SlugFromBuffer.cpp
index 576b4a8..15b2779 100644
--- a/src/text/SlugFromBuffer.cpp
+++ b/src/text/SlugFromBuffer.cpp
@@ -11,6 +11,12 @@
 #include "include/private/chromium/Slug.h"
 #include "src/core/SkReadBuffer.h"
 
+#include <atomic>
+#include <cstdint>
+
+// This file contains Slug methods that need to be defined on CPU and GPU builds, even though
+// Slugs aren't fully implemented in the CPU backend (yet?)
+
 namespace sktext::gpu {
 
 sk_sp<Slug> Slug::MakeFromBuffer(SkReadBuffer& buffer) {
@@ -22,4 +28,9 @@
     return nullptr;
 }
 
+uint32_t Slug::NextUniqueID() {
+    static std::atomic<uint32_t> nextUnique = 1;
+    return nextUnique++;
+}
+
 }  // namespace sktext::gpu
diff --git a/src/text/gpu/Slug.cpp b/src/text/gpu/Slug.cpp
index 1a5aaaa..789b8e2 100644
--- a/src/text/gpu/Slug.cpp
+++ b/src/text/gpu/Slug.cpp
@@ -13,8 +13,6 @@
 #include "src/core/SkReadBuffer.h"
 #include "src/core/SkWriteBuffer.h"
 
-#include <atomic>
-
 class SkData;
 
 namespace sktext::gpu {
@@ -56,10 +54,5 @@
     canvas->drawSlug(this);
 }
 
-uint32_t Slug::NextUniqueID() {
-    static std::atomic<uint32_t> nextUnique = 1;
-    return nextUnique++;
-}
-
 }  // namespace sktext::gpu