work on path
Work on SkPath.h documentation; fixed self-consistency
bugs identified by bookmaker. Fixed a couple of
minor typos in SkPath.h itself.
Also brought SkPaint and SkCanvas docs up to date.
TBR=reed@google.com
Docs-Preview: https://skia.org/?cl=39040
Bug: skia: 6898
Change-Id: Id89d4e2fa7fb6ee2e3cbec7ea762e06308b67d8b
Reviewed-on: https://skia-review.googlesource.com/39040
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@google.com>
Reviewed-by: Cary Clark <caryclark@skia.org>
diff --git a/tools/bookmaker/includeParser.cpp b/tools/bookmaker/includeParser.cpp
index 6aed937..21a47d6 100644
--- a/tools/bookmaker/includeParser.cpp
+++ b/tools/bookmaker/includeParser.cpp
@@ -25,6 +25,7 @@
const IncludeKey kKeyWords[] = {
{ "", KeyWord::kNone, KeyProperty::kNone },
+ { "SK_API", KeyWord::kSK_API, KeyProperty::kModifier },
{ "bool", KeyWord::kBool, KeyProperty::kNumber },
{ "char", KeyWord::kChar, KeyProperty::kNumber },
{ "class", KeyWord::kClass, KeyProperty::kObject },
@@ -236,7 +237,6 @@
if (this->internalName(token)) {
continue;
}
- const char* methodID = bmhParser.fMaps[(int) token.fMarkType].fName;
if (!def) {
string paramName = className + "::";
paramName += string(token.fContentStart,
@@ -304,11 +304,27 @@
}
}
if (!def) {
+ if ("SK_ATTR_DEPRECATED" == token.fName) {
+ break;
+ }
+ if (0 == token.fName.find("SkDEBUGCODE")) {
+ break;
+ }
+ }
+ if (!def) {
+ // simple method names inside nested classes have a bug and are missing trailing parens
+ string withParens = fullName + "()"; // FIXME: this shouldn't be necessary
+ def = root->find(withParens);
+ }
+ if (!def) {
SkDebugf("method missing from bmh: %s\n", fullName.c_str());
break;
}
- if (def->crossCheck(methodID, token)) {
+ if (def->crossCheck2(token)) {
def->fVisited = true;
+ if (MarkType::kDefinedBy == def->fMarkType) {
+ def->fParent->fVisited = true;
+ }
} else {
SkDebugf("method differs from bmh: %s\n", fullName.c_str());
}
@@ -912,11 +928,13 @@
iter = std::next(iter);
++lastPublic;
}
+ fLastObject = nullptr;
while (childIter != includeDef->fChildren.end() && (*childIter)->fParentIndex < lastPublic) {
Definition* child = *childIter;
if (!this->parseObject(child, markupDef)) {
return false;
}
+ fLastObject = child;
childIter = std::next(childIter);
}
while (childIter != includeDef->fChildren.end()) {
@@ -1292,10 +1310,18 @@
case Definition::Type::kBracket:
switch (child->fBracket) {
case Bracket::kParen:
+ if (fLastObject) {
+ TextParser checkDeprecated(child->fFileName, fLastObject->fTerminator + 1,
+ child->fStart, fLastObject->fLineCount);
+ checkDeprecated.skipWhiteSpace();
+ if (checkDeprecated.startsWith("SK_ATTR_DEPRECATED")) {
+ break;
+ }
+ }
if (!this->parseMethod(child, markupDef)) {
return this->reportError<bool>("failed to parse method");
}
- break;
+ break;
case Bracket::kSlashSlash:
case Bracket::kSlashStar:
// comments are picked up by parsing objects first
@@ -1336,6 +1362,9 @@
case Bracket::kAngle:
// pick up templated function pieces when method is found
break;
+ case Bracket::kDebugCode:
+ // todo: handle this
+ break;
default:
return this->reportError<bool>("unhandled bracket");
}
@@ -1457,6 +1486,11 @@
case '(':
case '[':
case '{': {
+ if (fIncludeWord && '(' == test && fChar - fIncludeWord >= 10 &&
+ !strncmp("SkDEBUGCODE", fIncludeWord, 10)) {
+ this->pushBracket(Bracket::kDebugCode);
+ break;
+ }
if (fInCharCommentString) {
break;
}
@@ -1555,6 +1589,8 @@
} else {
fInFunction = '}' != test;
}
+ } else if (')' == test && Bracket::kDebugCode == this->topBracket()) {
+ this->popBracket();
} else {
return reportError<bool>("malformed close bracket");
}