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

Unified Diff: src/gpu/gl/GrGLPathRendering.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 | « src/gpu/gl/GrGLPath.cpp ('k') | src/gpu/text/GrStencilAndCoverTextContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLPathRendering.cpp
diff --git a/src/gpu/gl/GrGLPathRendering.cpp b/src/gpu/gl/GrGLPathRendering.cpp
index 441967edc5ab868966b2a9dce7f09da5549bfcf5..723d73d5355306142275ea59e61c285f79201b5f 100644
--- a/src/gpu/gl/GrGLPathRendering.cpp
+++ b/src/gpu/gl/GrGLPathRendering.cpp
@@ -49,6 +49,22 @@ GR_STATIC_ASSERT(3 == GrPathRendering::kTranslate_PathTransformType);
GR_STATIC_ASSERT(4 == GrPathRendering::kAffine_PathTransformType);
GR_STATIC_ASSERT(GrPathRendering::kAffine_PathTransformType == GrPathRendering::kLast_PathTransformType);
+#ifdef SK_DEBUG
+static const GrGLenum gXformType2ComponentCount[] = {
+ 0,
+ 1,
+ 1,
+ 2,
+ 6
+};
+
+static void verify_floats(const float* floats, int count) {
+ for (int i = 0; i < count; ++i) {
+ SkASSERT(!SkScalarIsNaN(SkFloatToScalar(floats[i])));
+ }
+}
+#endif
+
static GrGLenum gr_stencil_op_to_gl_path_rendering_fill_mode(GrStencilOp op) {
switch (op) {
default:
@@ -155,6 +171,8 @@ void GrGLPathRendering::onDrawPaths(const DrawPathArgs& args, const GrPathRange*
const void* indices, PathIndexType indexType,
const float transformValues[], PathTransformType transformType,
int count) {
+ SkDEBUGCODE(verify_floats(transformValues, gXformType2ComponentCount[transformType] * count));
+
if (!this->gpu()->flushGLState(args)) {
return;
}
@@ -210,6 +228,7 @@ void GrGLPathRendering::setProgramPathFragmentInputTransform(GrGLuint program, G
coefficients[7] = SkScalarToFloat(matrix[SkMatrix::kMPersp1]);
coefficients[8] = SkScalarToFloat(matrix[SkMatrix::kMPersp2]);
}
+ SkDEBUGCODE(verify_floats(coefficients, components * 3));
GL_CALL(ProgramPathFragmentInputGen(program, location, genMode, components, coefficients));
}
@@ -232,6 +251,7 @@ void GrGLPathRendering::setProjectionMatrix(const SkMatrix& matrix,
float glMatrix[4 * 4];
fHWProjectionMatrixState.getRTAdjustedGLMatrix<4>(glMatrix);
+ SkDEBUGCODE(verify_floats(glMatrix, SK_ARRAY_COUNT(glMatrix)));
GL_CALL(MatrixLoadf(GR_GL_PATH_PROJECTION, glMatrix));
}
« no previous file with comments | « src/gpu/gl/GrGLPath.cpp ('k') | src/gpu/text/GrStencilAndCoverTextContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698