aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrShape.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2016-09-23 12:09:16 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-09-23 12:09:16 -0700
commitaa840647fc7f057715bce62489b96c4299385135 (patch)
tree882f53aff47ce041f0a43537d166451ab2a94e6a /src/gpu/GrShape.cpp
parentbf41fa841b19ebab1eea7df573b3456dd6c5cac0 (diff)
Don't compute path keys for volatile paths in GrShape.
Otherwise, we will compute cache keys for internally transformed paths that don't repeat (e.g. clip paths transformed into device space with a changing view matrix). BUG=chromium:649562 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2369513002 Review-Url: https://codereview.chromium.org/2369513002
Diffstat (limited to 'src/gpu/GrShape.cpp')
-rw-r--r--src/gpu/GrShape.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gpu/GrShape.cpp b/src/gpu/GrShape.cpp
index 12fdd3bc14..7e0a3a4449 100644
--- a/src/gpu/GrShape.cpp
+++ b/src/gpu/GrShape.cpp
@@ -132,13 +132,13 @@ int GrShape::unstyledKeySize() const {
// 4 for the end points and 1 for the inverseness
return 5;
case Type::kPath: {
+ if (0 == fPathData.fGenID) {
+ return -1;
+ }
int dataKeySize = path_key_from_data_size(fPathData.fPath);
if (dataKeySize >= 0) {
return dataKeySize;
}
- if (0 == fPathData.fGenID) {
- return -1;
- }
// The key is the path ID and fill type.
return 2;
}
@@ -172,12 +172,12 @@ void GrShape::writeUnstyledKey(uint32_t* key) const {
*key++ = fLineData.fInverted ? 1 : 0;
break;
case Type::kPath: {
+ SkASSERT(fPathData.fGenID);
int dataKeySize = path_key_from_data_size(fPathData.fPath);
if (dataKeySize >= 0) {
write_path_key_from_data(fPathData.fPath, key);
return;
}
- SkASSERT(fPathData.fGenID);
*key++ = fPathData.fGenID;
// We could canonicalize the fill rule for paths that don't differentiate between
// even/odd or winding fill (e.g. convex).