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

Unified Diff: src/gpu/GrPathRendering.cpp

Issue 1116123003: Improve caching of dashed paths in GrStencilAndCoverPathRenderer (Closed) Base URL: https://skia.googlesource.com/skia.git@dashing-nvpr-01
Patch Set: Created 5 years, 7 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/gpu/GrPathRendering.h ('k') | src/gpu/GrStencilAndCoverPathRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrPathRendering.cpp
diff --git a/src/gpu/GrPathRendering.cpp b/src/gpu/GrPathRendering.cpp
index fba55d5e1e4403bb511bf4f242b11a7f353d7d9d..e97d754a46bedd6a6120bf79ca534faa0d92559b 100644
--- a/src/gpu/GrPathRendering.cpp
+++ b/src/gpu/GrPathRendering.cpp
@@ -15,13 +15,18 @@
class GlyphGenerator : public GrPathRange::PathGenerator {
public:
GlyphGenerator(const SkTypeface& typeface, const SkDescriptor& desc)
- : fDesc(desc.copy()),
- fScalerContext(typeface.createScalerContext(fDesc)) {
+ : fScalerContext(typeface.createScalerContext(&desc))
+#ifdef SK_DEBUG
+ , fDesc(desc.copy())
+#endif
+ {
fFlipMatrix.setScale(1, -1);
}
virtual ~GlyphGenerator() {
+#ifdef SK_DEBUG
SkDescriptor::Free(fDesc);
+#endif
}
int getNumPaths() override {
@@ -36,20 +41,22 @@ public:
fScalerContext->getPath(skGlyph, out);
out->transform(fFlipMatrix); // Load glyphs with the inverted y-direction.
}
-
+#ifdef SK_DEBUG
bool isEqualTo(const SkDescriptor& desc) const override {
return fDesc->equals(desc);
}
-
+#endif
private:
- SkDescriptor* const fDesc;
const SkAutoTDelete<SkScalerContext> fScalerContext;
SkMatrix fFlipMatrix;
+#ifdef SK_DEBUG
+ SkDescriptor* const fDesc;
+#endif
};
GrPathRange* GrPathRendering::createGlyphs(const SkTypeface* typeface,
const SkDescriptor* desc,
- const SkStrokeRec& stroke) {
+ const GrStrokeInfo& stroke) {
if (NULL == typeface) {
typeface = SkTypeface::GetDefaultTypeface();
SkASSERT(NULL != typeface);
« no previous file with comments | « src/gpu/GrPathRendering.h ('k') | src/gpu/GrStencilAndCoverPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698