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

Unified Diff: include/core/SkPath.h

Issue 677463002: Set temporary paths volatile so we don't cache them. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Init fIsVolatile 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 | « expectations/gm/ignored-tests.txt ('k') | src/core/SkDraw.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkPath.h
diff --git a/include/core/SkPath.h b/include/core/SkPath.h
index 57da95973cda896d00d39a064c4e72f9a1143a6a..f5a6d4a2e7e43a24c1993dc09f082a72cfa91557 100644
--- a/include/core/SkPath.h
+++ b/include/core/SkPath.h
@@ -185,6 +185,23 @@ public:
return fPathRef->isFinite();
}
+ /** Returns true if the path is volatile (i.e. should not be cached by devices.)
+ */
+ bool isVolatile() const {
+ return SkToBool(fIsVolatile);
+ }
+
+ /** Specify whether this path is volatile. Paths are not volatile by
+ default. Temporary paths that are discarded or modified after use should be
+ marked as volatile. This provides a hint to the device that the path
+ should not be cached. Providing this hint when appropriate can
+ improve performance by avoiding unnecessary overhead and resource
+ consumption on the device.
+ */
+ void setIsVolatile(bool isVolatile) {
+ fIsVolatile = isVolatile;
+ }
+
/** Test a line for zero length
@return true if the line is of zero length; otherwise false.
@@ -971,7 +988,7 @@ private:
// 1 free bit at 29
kUnused1_SerializationShift = 28, // 1 free bit
kDirection_SerializationShift = 26, // requires 2 bits
- kUnused2_SerializationShift = 25, // 1 free bit
+ kIsVolatile_SerializationShift = 25, // requires 1 bit
// 1 free bit at 24
kConvexity_SerializationShift = 16, // requires 8 bits
kFillType_SerializationShift = 8, // requires 8 bits
@@ -984,6 +1001,7 @@ private:
uint8_t fFillType;
mutable uint8_t fConvexity;
mutable uint8_t fDirection;
+ mutable SkBool8 fIsVolatile;
#ifdef SK_BUILD_FOR_ANDROID
const SkPath* fSourcePath;
#endif
« no previous file with comments | « expectations/gm/ignored-tests.txt ('k') | src/core/SkDraw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698