Index: src/core/SkPixelRef.cpp |
diff --git a/src/core/SkPixelRef.cpp b/src/core/SkPixelRef.cpp |
index e79dfba27ceebf729ec553cd83bce750c7be6d74..2a46385c2416f545b88d3e2da7a0c25315bcf920 100644 |
--- a/src/core/SkPixelRef.cpp |
+++ b/src/core/SkPixelRef.cpp |
@@ -356,6 +356,18 @@ void SkPixelRef::changeAlphaType(SkAlphaType at) { |
void SkPixelRef::setImmutable() { |
fMutability = kImmutable; |
} |
+ |
+void SkPixelRef::setImmutableWithID(uint32_t genID) { |
+ /* |
+ * We are forcing the genID to match an external value. The caller must ensure that this |
+ * value does not conflict with other content. |
+ * |
+ * One use is to force this pixelref's id to match an SkImage's id |
+ */ |
+ fMutability = kImmutable; |
+ fTaggedGenID.store(genID); |
+} |
+ |
void SkPixelRef::setTemporarilyImmutable() { |
SkASSERT(fMutability != kImmutable); |
fMutability = kTemporarilyImmutable; |