diff options
author | Cary Clark <caryclark@skia.org> | 2017-11-27 10:44:06 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-11-27 16:12:56 +0000 |
commit | a560c4796f5b83a2e55cf564dc847ad6498164b0 (patch) | |
tree | 1e47f0055e1a19621046ecbc601e999e67c34465 /tools/bookmaker/mdOut.cpp | |
parent | 56536c42f561f6d8902703a33cf178deb91f9d4d (diff) |
bookmaker refresh
Add support for more operator overloads.
Add SkSurface, SkPoint, SkIPoint, SkIPoint16 docs.
(SkImage doc skeleton added, but not really started.)
Force recompile all examples.
Docs-Preview: https://skia.org/?cl=67726
Bug: skia:6898
Change-Id: If9e2d23f79d5db64146dd22588f5cac970614b8a
Reviewed-on: https://skia-review.googlesource.com/67726
Commit-Queue: Cary Clark <caryclark@google.com>
Reviewed-by: Cary Clark <caryclark@google.com>
Diffstat (limited to 'tools/bookmaker/mdOut.cpp')
-rw-r--r-- | tools/bookmaker/mdOut.cpp | 50 |
1 files changed, 40 insertions, 10 deletions
diff --git a/tools/bookmaker/mdOut.cpp b/tools/bookmaker/mdOut.cpp index ed3cd2bcaf..6b082ad1de 100644 --- a/tools/bookmaker/mdOut.cpp +++ b/tools/bookmaker/mdOut.cpp @@ -62,7 +62,10 @@ string MdOut::addReferences(const char* refStart, const char* refEnd, lineStart = false; } else { leadingSpaces = string(base, wordStart - base); - } + } + if (!strncmp("SkPoint::operator-()", start, 20)) { + SkDebugf(""); + } t.skipToMethodEnd(); if (base == t.fChar) { break; @@ -74,6 +77,9 @@ string MdOut::addReferences(const char* refStart, const char* refEnd, continue; } ref = string(start, t.fChar - start); + if (412 == t.fLineCount) { + SkDebugf(""); + } if (const Definition* def = this->isDefined(t, ref, BmhParser::Resolvable::kOut != resolvable)) { SkASSERT(def->fFiddle.length()); @@ -105,7 +111,8 @@ string MdOut::addReferences(const char* refStart, const char* refEnd, return result; } if (!foundMatch) { - if (!(def = this->isDefined(t, fullRef, true))) { + if (!(def = this->isDefined(t, fullRef, + BmhParser::Resolvable::kOut != resolvable))) { if (!result.size()) { t.reportError("missing method"); } @@ -640,7 +647,7 @@ void MdOut::markTypeOut(Definition* def) { case MarkType::kCode: this->lfAlways(2); fprintf(fOut, "<pre style=\"padding: 1em 1em 1em 1em;" - "width: 50em; background-color: #f0f0f0\">"); + "width: 62.5em; background-color: #f0f0f0\">"); this->lf(1); break; case MarkType::kColumn: @@ -705,17 +712,34 @@ void MdOut::markTypeOut(Definition* def) { fprintf(fOut, "Example\n" "\n"); fHasFiddle = true; + bool showGpu = false; + bool gpuAndCpu = false; const Definition* platform = def->hasChild(MarkType::kPlatform); if (platform) { TextParser platParse(platform); fHasFiddle = !platParse.strnstr("!fiddle", platParse.fEnd); + showGpu = platParse.strnstr("gpu", platParse.fEnd); + if (showGpu) { + gpuAndCpu = platParse.strnstr("cpu", platParse.fEnd); + } } if (fHasFiddle) { - fprintf(fOut, "<div><fiddle-embed name=\"%s\">", def->fHash.c_str()); + fprintf(fOut, "<div><fiddle-embed name=\"%s\"", def->fHash.c_str()); + if (showGpu) { + fprintf(fOut, "gpu=\"true\""); + if (gpuAndCpu) { + fprintf(fOut, "cpu=\"true\""); + } + } + fprintf(fOut, ">"); } else { - fprintf(fOut, "<pre style=\"padding: 1em 1em 1em 1em;" - "width: 50em; background-color: #f0f0f0\">"); - this->lf(1); + fprintf(fOut, "<pre style=\"padding: 1em 1em 1em 1em; font-size: 13px" + " width: 62.5em; background-color: #f0f0f0\">"); + this->lfAlways(1); + if (def->fWrapper.length() > 0) { + fprintf(fOut, "%s", def->fWrapper.c_str()); + } + fRespectLeadingSpace = true; } } break; case MarkType::kExperimental: @@ -774,7 +798,7 @@ void MdOut::markTypeOut(Definition* def) { this->writePending(); string preformattedStr = preformat(formattedStr); fprintf(fOut, "<pre style=\"padding: 1em 1em 1em 1em;" - "width: 50em; background-color: #f0f0f0\">\n" + "width: 62.5em; background-color: #f0f0f0\">\n" "%s\n" "</pre>", preformattedStr.c_str()); this->lf(2); @@ -936,9 +960,15 @@ void MdOut::markTypeOut(Definition* def) { if (fHasFiddle) { fprintf(fOut, "</fiddle-embed></div>"); } else { + this->lfAlways(1); + if (def->fWrapper.length() > 0) { + fprintf(fOut, "}"); + this->lfAlways(1); + } fprintf(fOut, "</pre>"); } this->lf(2); + fRespectLeadingSpace = false; break; case MarkType::kList: fInList = false; @@ -1008,7 +1038,7 @@ void MdOut::mdHeaderOutLF(int depth, int lf) { } void MdOut::resolveOut(const char* start, const char* end, BmhParser::Resolvable resolvable) { - if (BmhParser::Resolvable::kLiteral == resolvable && end > start) { + if ((BmhParser::Resolvable::kLiteral == resolvable || fRespectLeadingSpace) && end > start) { while ('\n' == *start) { ++start; } @@ -1017,7 +1047,7 @@ void MdOut::resolveOut(const char* start, const char* end, BmhParser::Resolvable ++start; } if (start > spaceStart) { - fIndent = start - spaceStart; + fIndent = start - spaceStart; } this->writeBlockTrim(end - start, start); if ('\n' == end[-1]) { |