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

Side by Side Diff: src/gpu/GrAtlasTextBlob.cpp

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 unified diff | Download patch
« no previous file with comments | « src/gpu/GrAtlasTextBlob.h ('k') | src/gpu/GrAtlasTextContext.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #include "GrAtlasTextBlob.h"
9
10 #ifdef CACHE_SANITY_CHECK
11 void GrAtlasTextBlob::AssertEqual(const GrAtlasTextBlob& l, const GrAtlasTextBlo b& r) {
12 SkASSERT(l.fSize == r.fSize);
13 SkASSERT(l.fPool == r.fPool);
14
15 SkASSERT(l.fBlurRec.fSigma == r.fBlurRec.fSigma);
16 SkASSERT(l.fBlurRec.fStyle == r.fBlurRec.fStyle);
17 SkASSERT(l.fBlurRec.fQuality == r.fBlurRec.fQuality);
18
19 SkASSERT(l.fStrokeInfo.fFrameWidth == r.fStrokeInfo.fFrameWidth);
20 SkASSERT(l.fStrokeInfo.fMiterLimit == r.fStrokeInfo.fMiterLimit);
21 SkASSERT(l.fStrokeInfo.fJoin == r.fStrokeInfo.fJoin);
22
23 SkASSERT(l.fBigGlyphs.count() == r.fBigGlyphs.count());
24 for (int i = 0; i < l.fBigGlyphs.count(); i++) {
25 const BigGlyph& lBigGlyph = l.fBigGlyphs[i];
26 const BigGlyph& rBigGlyph = r.fBigGlyphs[i];
27
28 SkASSERT(lBigGlyph.fPath == rBigGlyph.fPath);
29 // We can't assert that these have the same translations
30 }
31
32 SkASSERT(l.fKey == r.fKey);
33 SkASSERT(l.fViewMatrix.cheapEqualTo(r.fViewMatrix));
34 SkASSERT(l.fPaintColor == r.fPaintColor);
35 SkASSERT(l.fMaxMinScale == r.fMaxMinScale);
36 SkASSERT(l.fMinMaxScale == r.fMinMaxScale);
37 SkASSERT(l.fTextType == r.fTextType);
38
39 SkASSERT(l.fRunCount == r.fRunCount);
40 for (int i = 0; i < l.fRunCount; i++) {
41 const Run& lRun = l.fRuns[i];
42 const Run& rRun = r.fRuns[i];
43
44 if (lRun.fStrike.get()) {
45 SkASSERT(rRun.fStrike.get());
46 SkASSERT(GrBatchTextStrike::GetKey(*lRun.fStrike) ==
47 GrBatchTextStrike::GetKey(*rRun.fStrike));
48
49 } else {
50 SkASSERT(!rRun.fStrike.get());
51 }
52
53 if (lRun.fTypeface.get()) {
54 SkASSERT(rRun.fTypeface.get());
55 SkASSERT(SkTypeface::Equal(lRun.fTypeface, rRun.fTypeface));
56 } else {
57 SkASSERT(!rRun.fTypeface.get());
58 }
59
60 // TODO BOUNDS ARE ALL MESSED UP
61 //SkASSERT(lRun.fVertexBounds == rRun.fVertexBounds);
62
63 SkASSERT(lRun.fDescriptor.getDesc());
64 SkASSERT(rRun.fDescriptor.getDesc());
65 SkASSERT(lRun.fDescriptor.getDesc()->equals(*rRun.fDescriptor.getDesc()) );
66
67 if (lRun.fOverrideDescriptor.get()) {
68 SkASSERT(lRun.fOverrideDescriptor->getDesc());
69 SkASSERT(rRun.fOverrideDescriptor.get() && rRun.fOverrideDescriptor- >getDesc());;
70 SkASSERT(lRun.fOverrideDescriptor->getDesc()->equals(
71 *rRun.fOverrideDescriptor->getDesc()));
72 } else {
73 SkASSERT(!rRun.fOverrideDescriptor.get());
74 }
75
76 // color can be changed
77 //SkASSERT(lRun.fColor == rRun.fColor);
78 SkASSERT(lRun.fInitialized == rRun.fInitialized);
79 SkASSERT(lRun.fDrawAsPaths == rRun.fDrawAsPaths);
80
81 SkASSERT(lRun.fSubRunInfo.count() == rRun.fSubRunInfo.count());
82 for(int j = 0; j < lRun.fSubRunInfo.count(); j++) {
83 const Run::SubRunInfo& lSubRun = lRun.fSubRunInfo[j];
84 const Run::SubRunInfo& rSubRun = rRun.fSubRunInfo[j];
85
86 SkASSERT(lSubRun.fVertexStartIndex == rSubRun.fVertexStartIndex);
87 SkASSERT(lSubRun.fVertexEndIndex == rSubRun.fVertexEndIndex);
88 SkASSERT(lSubRun.fGlyphStartIndex == rSubRun.fGlyphStartIndex);
89 SkASSERT(lSubRun.fGlyphEndIndex == rSubRun.fGlyphEndIndex);
90 SkASSERT(lSubRun.fTextRatio == rSubRun.fTextRatio);
91 SkASSERT(lSubRun.fMaskFormat == rSubRun.fMaskFormat);
92 SkASSERT(lSubRun.fDrawAsDistanceFields == rSubRun.fDrawAsDistanceFie lds);
93 SkASSERT(lSubRun.fUseLCDText == rSubRun.fUseLCDText);
94
95 //We can't compare the bulk use tokens with this method
96 /*
97 SkASSERT(lSubRun.fBulkUseToken.fPlotsToUpdate.count() ==
98 rSubRun.fBulkUseToken.fPlotsToUpdate.count());
99 SkASSERT(lSubRun.fBulkUseToken.fPlotAlreadyUpdated ==
100 rSubRun.fBulkUseToken.fPlotAlreadyUpdated);
101 for (int k = 0; k < lSubRun.fBulkUseToken.fPlotsToUpdate.count(); k+ +) {
102 SkASSERT(lSubRun.fBulkUseToken.fPlotsToUpdate[k] ==
103 rSubRun.fBulkUseToken.fPlotsToUpdate[k]);
104 }*/
105 }
106 }
107 }
108
109 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrAtlasTextBlob.h ('k') | src/gpu/GrAtlasTextContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698