aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar bsalomon <bsalomon@google.com>2015-07-27 07:00:00 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-07-27 07:00:00 -0700
commit1c63436f39796d3ed5f27f54d07f6cc120006b94 (patch)
tree10bec8b2075e17013ad1d60e2934747dfc2dafa8 /src/gpu
parentcf4e5676123ef10d1f48867bd1f3d7d1236f0e45 (diff)
Steal refs from other TextBatch in onCombineIfPossible
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/GrAtlasTextContext.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gpu/GrAtlasTextContext.cpp b/src/gpu/GrAtlasTextContext.cpp
index d5ffd2be49..86dd8aa7a5 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());