diff options
author | Cary Clark <caryclark@skia.org> | 2019-01-07 15:16:56 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2019-01-07 21:06:29 +0000 |
commit | 26d173fee72b4674d0d044fb7d693c628408e57f (patch) | |
tree | 7d9feaf9546aef4ed0c9a577b9b67eba7e07df91 /tools | |
parent | a3efc72e28b8fc0066067519e67944b758fb4033 (diff) | |
download | platform_external_skqp-26d173fee72b4674d0d044fb7d693c628408e57f.tar.gz platform_external_skqp-26d173fee72b4674d0d044fb7d693c628408e57f.tar.bz2 platform_external_skqp-26d173fee72b4674d0d044fb7d693c628408e57f.zip |
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>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/bookmaker/includeParser.cpp | 30 | ||||
-rw-r--r-- | tools/bookmaker/includeWriter.cpp | 2 |
2 files changed, 25 insertions, 7 deletions
diff --git a/tools/bookmaker/includeParser.cpp b/tools/bookmaker/includeParser.cpp index 82bbce58a7..73a8015b61 100644 --- a/tools/bookmaker/includeParser.cpp +++ b/tools/bookmaker/includeParser.cpp @@ -310,11 +310,18 @@ bool IncludeParser::advanceInclude(TextParser& i) { 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 @@ string IncludeParser::writeCodeBlock(const Definition& iDef) { 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]) { diff --git a/tools/bookmaker/includeWriter.cpp b/tools/bookmaker/includeWriter.cpp index 209d4245df..34f6f087e9 100644 --- a/tools/bookmaker/includeWriter.cpp +++ b/tools/bookmaker/includeWriter.cpp @@ -1197,6 +1197,8 @@ void IncludeWriter::structSizeMembers(const Definition& child) { inMethod = false; } else if (Punctuation::kSemicolon == token.fPunctuation) { inMethod = false; + } else if (Punctuation::kAsterisk == token.fPunctuation) { + inMethod = false; } else { SkASSERT(0); // incomplete } |