aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar Cary Clark <caryclark@skia.org>2018-03-20 15:53:27 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-20 20:20:20 +0000
commit06c20f356ddfcf95385c5d5ca9bf4428a7a16b81 (patch)
treec893c7616fc985d9c805e4fd42e63450085f9e59 /tools
parent8a05601d0c544acef70b8b5e5f7ebe3f1b1747cf (diff)
more SkImageInfo docs
fix a couple of fiddles with changed output rewrite some SkSurface image makers move towards replacing SkImageInfo.h R=caryclark@google.com Docs-Preview: https://skia.org/?cl=115163 Bug: skia:6898 Change-Id: Id9895b051cd457336c30250a69cf95359d1d34d7 Reviewed-on: https://skia-review.googlesource.com/115163 Commit-Queue: Cary Clark <caryclark@skia.org> Reviewed-by: Cary Clark <caryclark@skia.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/bookmaker/bookmaker.cpp6
-rw-r--r--tools/bookmaker/includeParser.cpp7
-rw-r--r--tools/bookmaker/includeWriter.cpp39
-rw-r--r--tools/bookmaker/mdOut.cpp9
4 files changed, 43 insertions, 18 deletions
diff --git a/tools/bookmaker/bookmaker.cpp b/tools/bookmaker/bookmaker.cpp
index 91e4cc2b23..4016a19439 100644
--- a/tools/bookmaker/bookmaker.cpp
+++ b/tools/bookmaker/bookmaker.cpp
@@ -154,6 +154,9 @@ bool BmhParser::addDefinition(const char* defStart, bool hasEnd, MarkType markTy
if (!this->popParentStack(definition)) {
return false;
}
+ if (fRoot == definition) {
+ fRoot = nullptr;
+ }
} else {
definition->fStart = defStart;
this->skipSpace();
@@ -1051,6 +1054,9 @@ bool BmhParser::findDefinitions() {
const char* lastMC = nullptr;
fParent = nullptr;
while (!this->eof()) {
+ if (195 == fLineCount && "docs\\SkImageInfo_Reference.bmh" == fFileName) {
+ SkDebugf("");
+ }
if (this->peek() == fMC) {
lastMC = fChar;
this->next();
diff --git a/tools/bookmaker/includeParser.cpp b/tools/bookmaker/includeParser.cpp
index 900617667c..8365a82d1c 100644
--- a/tools/bookmaker/includeParser.cpp
+++ b/tools/bookmaker/includeParser.cpp
@@ -1360,9 +1360,12 @@ bool IncludeParser::parseEnum(Definition* child, Definition* markupDef) {
const char* nameStart = enumName.fChar;
enumName.skipToSpace();
if (markupDef) {
- markupChild->fName = markupDef->fName + "::";
+ markupChild->fName = markupDef->fName + "::" +
+ string(nameStart, (size_t) (enumName.fChar - nameStart));
+ }
+ if (string::npos != markupChild->fName.find("SkColorType")) {
+ SkDebugf("");
}
- markupChild->fName += string(nameStart, (size_t) (enumName.fChar - nameStart));
if (!this->findComments(*child, markupChild)) {
return false;
}
diff --git a/tools/bookmaker/includeWriter.cpp b/tools/bookmaker/includeWriter.cpp
index 7af7202e8c..067c014070 100644
--- a/tools/bookmaker/includeWriter.cpp
+++ b/tools/bookmaker/includeWriter.cpp
@@ -254,6 +254,12 @@ void IncludeWriter::enumHeaderOut(const RootDefinition* root,
if (!enumDef) {
enumDef = root->find(fullName, RootDefinition::AllowParens::kNo);
}
+ if (!enumDef) {
+ auto mapEntry = fBmhParser->fEnumMap.find(enumName);
+ if (fBmhParser->fEnumMap.end() != mapEntry) {
+ enumDef = &mapEntry->second;
+ }
+ }
SkASSERT(enumDef);
// child[0] should be #Code comment starts at child[0].fTerminator
// though skip until #Code is found (in case there's a #ToDo, etc)
@@ -477,9 +483,12 @@ void IncludeWriter::enumMembersOut(const RootDefinition* root, Definition& child
break;
}
SkASSERT(token);
- string itemName = root->fName + "::";
- if (KeyWord::kClass == child.fParent->fKeyWord) {
- itemName += child.fParent->fName + "::";
+ string itemName;
+ if (!fEnumDef->isRoot()) {
+ itemName = root->fName + "::";
+ if (KeyWord::kClass == child.fParent->fKeyWord) {
+ itemName += child.fParent->fName + "::";
+ }
}
itemName += string(token->fContentStart, (int) (token->fContentEnd - token->fContentStart));
for (auto& enumItem : fEnumDef->fChildren) {
@@ -1029,6 +1038,9 @@ bool IncludeWriter::populate(Definition* def, ParentPair* prevPair, RootDefiniti
const Definition* requireDense = nullptr;
const Definition* startDef = nullptr;
for (auto& child : def->fTokens) {
+ if (51 == child.fLineCount) {
+ SkDebugf("");
+ }
if (KeyWord::kOperator == child.fKeyWord && method &&
Definition::MethodType::kOperator == method->fMethodType) {
eatOperator = true;
@@ -1155,8 +1167,7 @@ bool IncludeWriter::populate(Definition* def, ParentPair* prevPair, RootDefiniti
fContinuation = nullptr;
continue;
}
- fLineCount = child.fLineCount;
- return this->reportError<bool>("method not found");
+ return child.reportError<bool>("method not found");
}
this->methodOut(method, child);
continue;
@@ -1184,8 +1195,7 @@ bool IncludeWriter::populate(Definition* def, ParentPair* prevPair, RootDefiniti
fContinuation = nullptr;
continue;
}
- fLineCount = child.fLineCount;
- return this->reportError<bool>("method not found");
+ return child.reportError<bool>("method not found");
}
if (Bracket::kSlashSlash == child.fBracket || Bracket::kSlashStar == child.fBracket) {
if (!fDeferComment) {
@@ -1221,13 +1231,16 @@ bool IncludeWriter::populate(Definition* def, ParentPair* prevPair, RootDefiniti
}
startDef = &child;
fStart = child.fContentStart;
- methodName = root->fName + "::" + child.fName;
- inConstructor = root->fName == child.fName;
+ auto mapFind = fBmhParser->fMethodMap.find(child.fName);
+ if (fBmhParser->fMethodMap.end() != mapFind) {
+ inConstructor = false;
+ method = &mapFind->second;
+ } else {
+ methodName = root->fName + "::" + child.fName;
+ inConstructor = root->fName == child.fName;
+ method = root->find(methodName, RootDefinition::AllowParens::kNo);
+ }
fContinuation = child.fContentEnd;
- method = root->find(methodName, RootDefinition::AllowParens::kNo);
-// if (!method) {
-// method = root->find(methodName + "()", RootDefinition::AllowParens::kNo);
-// }
if (!method) {
continue;
}
diff --git a/tools/bookmaker/mdOut.cpp b/tools/bookmaker/mdOut.cpp
index ae435576d9..80d3e21faa 100644
--- a/tools/bookmaker/mdOut.cpp
+++ b/tools/bookmaker/mdOut.cpp
@@ -1129,7 +1129,9 @@ void MdOut::markTypeOut(Definition* def) {
SkASSERT(0); // handle everything
break;
}
+ TableState saveState = fTableState;
this->childrenOut(def, textStart);
+ fTableState = saveState;
switch (def->fMarkType) { // post child work, at least for tables
case MarkType::kAnchor:
if (fColumn > 0) {
@@ -1451,10 +1453,11 @@ void MdOut::subtopicOut(const TableContents& tableContents) {
}
}
if (!oneLiner) {
- SkDebugf(""); // convenient place to set a breakpoint
+ TextParser parser(entry.second->fFileName, entry.second->fStart,
+ entry.second->fContentStart, entry.second->fLineCount);
+ parser.reportError("missing #Line");
+ continue;
}
- // TODO: detect this earlier? throw error here?
- SkASSERT(oneLiner);
this->rowOut(entry.first.c_str(), string(oneLiner->fContentStart,
oneLiner->fContentEnd - oneLiner->fContentStart));
if (tableContents.fShowClones && entry.second->fCloned) {