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

Unified Diff: src/core/SkRecordDraw.cpp

Issue 753253002: Use variable length key (rather than accumulated matrix) as save layer hoisting key (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Compiling Created 6 years, 1 month 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
Index: src/core/SkRecordDraw.cpp
diff --git a/src/core/SkRecordDraw.cpp b/src/core/SkRecordDraw.cpp
index 7e35d8a2c7da87867c84079fd19d72ef007c5cbb..a086197453d78e7a0c27b8c8a99a353f8f55deda 100644
--- a/src/core/SkRecordDraw.cpp
+++ b/src/core/SkRecordDraw.cpp
@@ -682,6 +682,11 @@ private:
dst.fRestoreOpID = src.fRestoreOpID;
dst.fHasNestedLayers = src.fHasNestedLayers;
dst.fIsNested = fSaveLayersInStack > 0 || src.fIsNested;
+
+ dst.fKeySize = fSaveLayerOpStack.count() + src.fKeySize;
+ dst.fKey = SkNEW_ARRAY(int, dst.fKeySize);
+ memcpy(dst.fKey, fSaveLayerOpStack.begin(), fSaveLayerOpStack.count() * sizeof(int));
+ memcpy(&dst.fKey[fSaveLayerOpStack.count()], src.fKey, src.fKeySize * sizeof(int));
}
}
@@ -737,12 +742,17 @@ private:
block.fRestoreOpID = fFillBounds.currentOp();
block.fHasNestedLayers = sli.fHasNestedSaveLayer;
block.fIsNested = fSaveLayersInStack > 0;
+
+ block.fKeySize = fSaveLayerOpStack.count();
+ block.fKey = SkNEW_ARRAY(int, block.fKeySize);
+ memcpy(block.fKey, fSaveLayerOpStack.begin(), block.fKeySize * sizeof(int));
}
// Used to collect saveLayer information for layer hoisting
- int fSaveLayersInStack;
+ int fSaveLayersInStack;
SkTDArray<SaveLayerInfo> fSaveLayerStack;
- SkLayerInfo* fAccelData;
+ SkTDArray<int> fSaveLayerOpStack;
+ SkLayerInfo* fAccelData;
SkRecords::FillBounds fFillBounds;
};
« src/core/SkLayerInfo.h ('K') | « src/core/SkLayerInfo.h ('k') | src/gpu/GrLayerCache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698