Merge "Add optional data argument to SkPixelRef::globalRef()"
diff --git a/include/core/SkPaint.h b/include/core/SkPaint.h
index ea21ceb..f2df226 100644
--- a/include/core/SkPaint.h
+++ b/include/core/SkPaint.h
@@ -93,7 +93,10 @@
void setHinting(Hinting hintingLevel)
{
- fHinting = hintingLevel;
+ if ((unsigned) hintingLevel != fHinting) {
+ fGenerationID++;
+ fHinting = hintingLevel;
+ }
}
/** Specifies the bit values that are stored in the paint's flags.
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp
index 23aca78..f203d35 100644
--- a/src/core/SkPaint.cpp
+++ b/src/core/SkPaint.cpp
@@ -114,8 +114,9 @@
fRasterizer->safeUnref();
fLooper->safeUnref();
+ uint32_t oldGenerationID = fGenerationID;
memcpy(this, &src, sizeof(src));
- fGenerationID++;
+ fGenerationID = oldGenerationID + 1;
return *this;
}
@@ -129,8 +130,9 @@
{
SkPaint init;
+ uint32_t oldGenerationID = fGenerationID;
*this = init;
- fGenerationID++;
+ fGenerationID = oldGenerationID + 1;
}
uint32_t SkPaint::getGenerationID() const {