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

Unified Diff: src/gpu/GrAtlasTextBlob.h

Issue 1250693002: Add sanity check to GrAtlasTextBlob (Closed) Base URL: https://skia.googlesource.com/skia.git@debug
Patch Set: more 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 | « gyp/gpu.gypi ('k') | src/gpu/GrAtlasTextBlob.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAtlasTextBlob.h
diff --git a/src/gpu/GrAtlasTextBlob.h b/src/gpu/GrAtlasTextBlob.h
index a69e4307794e2939e44e2b7e013850b95e1cb10f..1f37c676e2cf53303f9b370619719db195192173 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
« no previous file with comments | « gyp/gpu.gypi ('k') | src/gpu/GrAtlasTextBlob.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698