aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/core/SkPaint.h5
-rw-r--r--src/core/SkPaint.cpp6
2 files changed, 8 insertions, 3 deletions
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 @@ public:
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 @@ SkPaint& SkPaint::operator=(const SkPaint& src)
fRasterizer->safeUnref();
fLooper->safeUnref();
+ uint32_t oldGenerationID = fGenerationID;
memcpy(this, &src, sizeof(src));
- fGenerationID++;
+ fGenerationID = oldGenerationID + 1;
return *this;
}
@@ -129,8 +130,9 @@ void SkPaint::reset()
{
SkPaint init;
+ uint32_t oldGenerationID = fGenerationID;
*this = init;
- fGenerationID++;
+ fGenerationID = oldGenerationID + 1;
}
uint32_t SkPaint::getGenerationID() const {