aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrAtlasTextBlob.h
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2015-07-21 11:39:34 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-07-21 11:39:35 -0700
commit259fbf191625d504e20c7ede69d988735fc569ad (patch)
tree35e29f248d57965594e8cdcfa22f1fc38a6388cb /src/gpu/GrAtlasTextBlob.h
parentf6e092aa9c49cbfb2e4fa4e2cf28fe8ab459499d (diff)
Add sanity check to GrAtlasTextBlob
Diffstat (limited to 'src/gpu/GrAtlasTextBlob.h')
-rw-r--r--src/gpu/GrAtlasTextBlob.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gpu/GrAtlasTextBlob.h b/src/gpu/GrAtlasTextBlob.h
index a69e430779..1f37c676e2 100644
--- a/src/gpu/GrAtlasTextBlob.h
+++ b/src/gpu/GrAtlasTextBlob.h
@@ -10,11 +10,17 @@
#include "GrBatchAtlas.h"
#include "GrBatchFontCache.h"
+#include "GrColor.h"
#include "SkDescriptor.h"
#include "SkMaskFilter.h"
#include "GrMemoryPool.h"
+#include "SkSurfaceProps.h"
#include "SkTInternalLList.h"
+// With this flag enabled, the GrAtlasTextContext will, as a sanity check, regenerate every blob
+// that comes in to verify the integrity of its cache
+//#define CACHE_SANITY_CHECK // VERY SLOW
+
/*
* A GrAtlasTextBlob contains a fully processed SkTextBlob, suitable for nearly immediate drawing
* on the GPU. These are initially created with valid positions and colors, but invalid
@@ -26,6 +32,8 @@
* the GrAtlas will not evict anything the Blob needs.
*
* Note: This struct should really be named GrCachedAtasTextBlob, but that is too verbose.
+ *
+ * *WARNING* If you add new fields to this struct, then you may need to to update AssertEqual
*/
struct GrAtlasTextBlob : public SkRefCnt {
SK_DECLARE_INTERNAL_LLIST_INTERFACE(GrAtlasTextBlob);
@@ -211,6 +219,11 @@ struct GrAtlasTextBlob : public SkRefCnt {
bool hasBitmap() const { return SkToBool(fTextType & kHasBitmap_TextType); }
void setHasDistanceField() { fTextType |= kHasDistanceField_TextType; }
void setHasBitmap() { fTextType |= kHasBitmap_TextType; }
+
+#ifdef CACHE_SANITY_CHECK
+ static void AssertEqual(const GrAtlasTextBlob&, const GrAtlasTextBlob&);
+ size_t fSize;
+#endif
};
#endif