fix bookmaker

Illustrations calling SkTextUtils::DrawString must pass font
as well as paint.

TBR=reed@google.com,jcgregorio@google.com

Docs-Preview: https://skia.org/?cl=181562
Bug: skia:
Change-Id: I907c1c69026d3dc40282545b492a790b2349a8a0
Reviewed-on: https://skia-review.googlesource.com/c/181562
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
Reviewed-by: Joe Gregorio <jcgregorio@google.com>
Reviewed-by: Mike Reed <reed@google.com>
diff --git a/tools/bookmaker/includeParser.cpp b/tools/bookmaker/includeParser.cpp
index 82bbce5..73a8015 100644
--- a/tools/bookmaker/includeParser.cpp
+++ b/tools/bookmaker/includeParser.cpp
@@ -310,11 +310,18 @@
     if ('{' == i.peek()) {
         if (looks_like_method(i)) {
             fCheck.fState = CheckCode::State::kMethod;
-            if (!i.skipToBalancedEndBracket('{', '}')) {
-                i.reportError("unbalanced open brace");
+            bool inBalance = false;
+            TextParser paren(i.fFileName, i.fStart, i.fEnd, i.fLineCount);
+            paren.skipToEndBracket('(');
+            paren.skipToBalancedEndBracket('(', ')');
+            inBalance = i.fChar < paren.fChar;
+            if (!inBalance) {
+                if (!i.skipToBalancedEndBracket('{', '}')) {
+                    i.reportError("unbalanced open brace");
+                }
+                i.skipToLineStart(&fCheck.fIndent, &fCheck.fWriteReturn);
+                return false;
             }
-            i.skipToLineStart(&fCheck.fIndent, &fCheck.fWriteReturn);
-            return false;
         } else if (looks_like_class_decl(i)) {
             fCheck.fState = CheckCode::State::kClassDeclaration;
             fCheck.fPrivateBrace = fCheck.fBraceCount + 1;
@@ -434,9 +441,18 @@
         i.fEnd = loc;
     }
     if (i.contains("{", i.fEnd, &loc)) {
-        i.fEnd = loc + 1;
-        while (i.fEnd < iDef.fContentEnd && ' ' >= i.fEnd[0]) {
-            ++i.fEnd;
+        bool inBalance = false;
+        if (MarkType::kMethod == iDef.fMarkType) {
+            TextParser paren(&iDef);
+            paren.skipToEndBracket('(');
+            paren.skipToBalancedEndBracket('(', ')');
+            inBalance = loc < paren.fChar;
+        }
+        if (!inBalance) {
+            i.fEnd = loc + 1;
+            while (i.fEnd < iDef.fContentEnd && ' ' >= i.fEnd[0]) {
+                ++i.fEnd;
+            }
         }
     }
     while (i.fEnd > i.fStart && ' ' == i.fEnd[-1]) {