fix bookmaker return value

crosscheck in bookmaker allows
discovery of multiple errors,
but fails to return that an
error occurred.

Fix SkSurface so it is up to date with includes.
Add include parameter name in SkSurface.
Allow longer parameter descriptions.

TBR=bsalomon@google.com,rmistry@google.com
Docs-Preview: https://skia.org/?cl=88041
Bug: skia:6898
Change-Id: I9daf83f7f6753b3d1dc996a76e4693b3b8d6798c
Reviewed-on: https://skia-review.googlesource.com/88041
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Ravi Mistry <rmistry@google.com>
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@google.com>
diff --git a/tools/bookmaker/includeParser.cpp b/tools/bookmaker/includeParser.cpp
index cd6e9e3..2846614 100644
--- a/tools/bookmaker/includeParser.cpp
+++ b/tools/bookmaker/includeParser.cpp
@@ -301,11 +301,13 @@
                                         def->fVisited = true;
                                     } else {
                                         SkDebugf("missing toString bmh: %s\n", fullName.c_str());
+                                        fFailed = true;
                                     }
                                 }
                                 break;
                             } else {
                                 SkDebugf("method macro differs from bmh: %s\n", fullName.c_str());
+                                fFailed = true;
                             }
                         }
                     }
@@ -337,6 +339,7 @@
                     }
                     if (!def) {
                         SkDebugf("method missing from bmh: %s\n", fullName.c_str());
+                        fFailed = true;
                         break;
                     }
                     if (def->crossCheck2(token)) {
@@ -346,6 +349,7 @@
                         }
                     } else {
                        SkDebugf("method differs from bmh: %s\n", fullName.c_str());
+                       fFailed = true;
                     }
                 } break;
                 case MarkType::kComment:
@@ -382,6 +386,7 @@
                         }
                         if (!def) {
                             SkDebugf("enum missing from bmh: %s\n", fullName.c_str());
+                            fFailed = true;
                             break;
                         }
                     }
@@ -394,12 +399,14 @@
                     }
                     if (MarkType::kCode != def->fMarkType) {
                         SkDebugf("enum code missing from bmh: %s\n", fullName.c_str());
+                        fFailed = true;
                         break;
                     }
                     if (def->crossCheck(token)) {
                         def->fVisited = true;
                     } else {
-                       SkDebugf("enum differs from bmh: %s\n", def->fName.c_str());
+                        SkDebugf("enum differs from bmh: %s\n", def->fName.c_str());
+                        fFailed = true;
                     }
                     for (auto& child : token.fChildren) {
                         string constName = MarkType::kEnumClass == token.fMarkType ?
@@ -413,6 +420,7 @@
                         if (!def) {
                             if (string::npos == child->fName.find("Legacy_")) {
                                 SkDebugf("const missing from bmh: %s\n", constName.c_str());
+                                fFailed = true;
                             }
                         } else {
                             def->fVisited = true;
@@ -424,6 +432,7 @@
                         def->fVisited = true;
                     } else {
                         SkDebugf("member missing from bmh: %s\n", fullName.c_str());
+                        fFailed = true;
                     }
                     break;
                 case MarkType::kTypedef:
@@ -431,6 +440,7 @@
                         def->fVisited = true;
                     } else {
                         SkDebugf("typedef missing from bmh: %s\n", fullName.c_str());
+                        fFailed = true;
                     }
                     break;
                 default:
@@ -448,11 +458,12 @@
         RootDefinition* root = &finder->second;
         if (!root->dumpUnVisited(bmhParser.fSkip)) {
             SkDebugf("some struct elements not found; struct finding in includeParser is missing\n");
+            fFailed = true;
         }
         SkDebugf("cross-checked %s\n", className.c_str());
     }
     bmhParser.fWroteOut = true;
-    return true;
+    return !fFailed;
 }
 
 IClassDefinition* IncludeParser::defineClass(const Definition& includeDef,