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

Unified Diff: src/gpu/gl/GrGLPath.cpp

Issue 1760163002: Avoid drawing NVPR DIF text when text size is 0 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: address review comment Created 4 years, 10 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 | « gm/textblobmixedsizes.cpp ('k') | src/gpu/gl/GrGLPathRendering.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLPath.cpp
diff --git a/src/gpu/gl/GrGLPath.cpp b/src/gpu/gl/GrGLPath.cpp
index 067b74e1549d4ab259b0a70f4307d4fa67fa73ac..6eab7d098dcbf4783e4a8c9de8f8459951f16606 100644
--- a/src/gpu/gl/GrGLPath.cpp
+++ b/src/gpu/gl/GrGLPath.cpp
@@ -79,6 +79,14 @@ inline GrGLenum cap_to_gl_cap(SkPaint::Cap cap) {
GR_STATIC_ASSERT(SK_ARRAY_COUNT(gSkCapsToGrGLCaps) == SkPaint::kCapCount);
}
+#ifdef SK_DEBUG
+inline void verify_floats(const float* floats, int count) {
+ for (int i = 0; i < count; ++i) {
+ SkASSERT(!SkScalarIsNaN(SkFloatToScalar(floats[i])));
+ }
+}
+#endif
+
inline void points_to_coords(const SkPoint points[], size_t first_point, size_t amount,
GrGLfloat coords[]) {
for (size_t i = 0; i < amount; ++i) {
@@ -170,6 +178,7 @@ inline bool init_path_object_for_general_path(GrGLGpu* gpu, GrGLuint pathID,
continue;
}
SkDEBUGCODE(numCoords += num_coords(verb));
+ SkDEBUGCODE(verify_floats(coords, coordsForVerb));
pathCoords.push_back_n(coordsForVerb, coords);
}
SkASSERT(verbCnt == pathCommands.count());
@@ -232,6 +241,7 @@ void GrGLPath::InitPathObjectPathData(GrGLGpu* gpu,
}
SkASSERT(verbCnt == pathCommands.count());
SkASSERT(verbCoordCnt == pathCoords.count());
+ SkDEBUGCODE(verify_floats(&pathCoords[0], pathCoords.count()));
GR_GL_CALL(gpu->glInterface(), PathCommands(pathID, pathCommands.count(), &pathCommands[0],
pathCoords.count(), GR_GL_FLOAT,
&pathCoords[0]));
« no previous file with comments | « gm/textblobmixedsizes.cpp ('k') | src/gpu/gl/GrGLPathRendering.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698