Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(827)

Unified Diff: src/core/SkPath.cpp

Issue 677463002: Set temporary paths volatile so we don't cache them. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Mark more temp paths volatile. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkDraw.cpp ('k') | src/core/SkStroke.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPath.cpp
diff --git a/src/core/SkPath.cpp b/src/core/SkPath.cpp
index 06f8b7e259f44bbd33f2a06b9dc3ea1253572ee1..6fc09bb59a125cecc04f5f9449cbba9a2027336d 100644
--- a/src/core/SkPath.cpp
+++ b/src/core/SkPath.cpp
@@ -178,6 +178,7 @@ void SkPath::copyFields(const SkPath& that) {
fFillType = that.fFillType;
fConvexity = that.fConvexity;
fDirection = that.fDirection;
+ fIsVolatile = that.fIsVolatile;
}
bool operator==(const SkPath& a, const SkPath& b) {
@@ -196,6 +197,7 @@ void SkPath::swap(SkPath& that) {
SkTSwap<uint8_t>(fFillType, that.fFillType);
SkTSwap<uint8_t>(fConvexity, that.fConvexity);
SkTSwap<uint8_t>(fDirection, that.fDirection);
+ SkTSwap<SkBool8>(fIsVolatile, that.fIsVolatile);
#ifdef SK_BUILD_FOR_ANDROID
SkTSwap<const SkPath*>(fSourcePath, that.fSourcePath);
#endif
@@ -1606,6 +1608,7 @@ void SkPath::transform(const SkMatrix& matrix, SkPath* dst) const {
if (this != dst) {
dst->fFillType = fFillType;
dst->fConvexity = fConvexity;
+ dst->fIsVolatile = fIsVolatile;
}
if (kUnknown_Direction == fDirection) {
@@ -1978,7 +1981,8 @@ size_t SkPath::writeToMemory(void* storage) const {
int32_t packed = (fConvexity << kConvexity_SerializationShift) |
(fFillType << kFillType_SerializationShift) |
- (fDirection << kDirection_SerializationShift);
+ (fDirection << kDirection_SerializationShift) |
+ (fIsVolatile << kIsVolatile_SerializationShift);
buffer.write32(packed);
@@ -1999,6 +2003,7 @@ size_t SkPath::readFromMemory(const void* storage, size_t length) {
fConvexity = (packed >> kConvexity_SerializationShift) & 0xFF;
fFillType = (packed >> kFillType_SerializationShift) & 0xFF;
fDirection = (packed >> kDirection_SerializationShift) & 0x3;
+ fIsVolatile = (packed >> kIsVolatile_SerializationShift) & 0x1;
SkPathRef* pathRef = SkPathRef::CreateFromBuffer(&buffer);
size_t sizeRead = 0;
« no previous file with comments | « src/core/SkDraw.cpp ('k') | src/core/SkStroke.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698