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

Unified Diff: src/gpu/GrAtlasTextContext.cpp

Issue 1257683004: Steal refs from other TextBatch in onCombineIfPossible (Closed) Base URL: https://skia.googlesource.com/skia.git@implicitsize
Patch Set: rebase Created 5 years, 5 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAtlasTextContext.cpp
diff --git a/src/gpu/GrAtlasTextContext.cpp b/src/gpu/GrAtlasTextContext.cpp
index d5ffd2be492a11a36e4c0191e54e3e680707da20..86dd8aa7a54bbb6a4f66b16ac4cc176e2b79eec9 100644
--- a/src/gpu/GrAtlasTextContext.cpp
+++ b/src/gpu/GrAtlasTextContext.cpp
@@ -96,9 +96,6 @@ static inline GrColor skcolor_to_grcolor_nopremultiply(SkColor c) {
};
-// TODO
-// Distance field text in textblobs
-
GrAtlasTextContext::GrAtlasTextContext(GrContext* context,
GrDrawContext* drawContext,
const SkSurfaceProps& surfaceProps)
@@ -1938,9 +1935,14 @@ private:
}
memcpy(&fGeoData[fGeoCount], that->fGeoData.get(), that->fGeoCount * sizeof(Geometry));
- for (int i = fGeoCount; i < newGeoCount; ++i) {
- fGeoData[i].fBlob->ref();
+ // We steal the ref on the blobs from the other TextBatch and set its count to 0 so that
+ // it doesn't try to unref them.
+#ifdef SK_DEBUG
+ for (int i = 0; i < that->fGeoCount; ++i) {
+ that->fGeoData.get()[i].fBlob = (Blob*)0x1;
}
+#endif
+ that->fGeoCount = 0;
fGeoCount = newGeoCount;
this->joinBounds(that->bounds());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698