The GrTessellator fix for doubly-added edges in
https://codereview.chromium.org/2259493002/ could leave
a MonotonePoly with zero edges. This is a problem for
Poly::addEdge(), which assumes that MonotonePolys always have
at least one edge. The fix is to move the check and early-out up to
Poly::addEdge(). This should also tighten up the vertex count.
(Unfortunately, the only repro I have for this issue is very
convoluted, and requires non-landed code.)
BUG=skia:5636
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2251643008
Review-Url: https://codereview.chromium.org/2251643008
Motivation: drawText can look up unicode mapping at draw time to see
if ActualText should be used after crrev.com/2084533004 lands.
For each SkTypeface, only call getAdvancedTypefaceMetrics() once per
document. Cache the result in the SkPDFCanon, indexed by SkFontID.
Also cache PDF FontDescriptors in the canon, also indexed by SkFontID
(Type1 fonts only).
Simplify PDF font lookup, map SkFontID+SkGlyphID into a uint64_t. Map
that uint64_t to SkPDFFonts. Remove SkPDFCanon::findFont(),
SkPDFCanon::addFont(), SkPDFFont::IsMatch(), and enum SkPDFFont::Match.
SkPDFFont no longer holds on to ref of SkAdvancedTypefaceMetrics.
Instead, SkPDFFont::GetFontResource() and SkPDFFont::getFontSubset()
get metrics from canon.
SkPDFFont multybite bool is now a function of type.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2253993002
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Win-MSVC-GCE-CPU-AVX2-x86_64-Release-GDI-Trybot,Test-Win-MSVC-GCE-CPU-AVX2-x86_64-Debug-GDI-Trybot
Review-Url: https://codereview.chromium.org/2253993002
Reason for revert:
because
Original issue's description:
> SkPDF: cache metrics once.
>
> Motivation: drawText can look up unicode mapping at draw time to see
> if ActualText should be used after crrev.com/2084533004 lands.
>
> For each SkTypeface, only call getAdvancedTypefaceMetrics() once per
> document. Cache the result in the SkPDFCanon, indexed by SkFontID.
> Also cache PDF FontDescriptors in the canon, also indexed by SkFontID
> (Type1 fonts only).
>
> Simplify PDF font lookup, map SkFontID+SkGlyphID into a uint64_t. Map
> that uint64_t to SkPDFFonts. Remove SkPDFCanon::findFont(),
> SkPDFCanon::addFont(), SkPDFFont::IsMatch(), and enum SkPDFFont::Match.
>
> SkPDFFont no longer holds on to ref of SkAdvancedTypefaceMetrics.
> Instead, SkPDFFont::GetFontResource() and SkPDFFont::getFontSubset()
> get metrics from canon.
>
> SkPDFFont multybite bool is now a function of type.
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2253993002
>
> Committed: https://skia.googlesource.com/skia/+/0a61270f4ba85d10659fb63a86817b435ec04c94TBR=bungeman@google.com,halcanary@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Review-Url: https://codereview.chromium.org/2251813006
In rare cases, floating point error causes the tesselator to add the
same Vertex to more than one Poly on the same side. This was not a big
problem when we were allocating new vertices when constructing Polys,
but after https://codereview.chromium.org/2029243002 it causes more serious
issues, since each Edge can only belong to two Polys, and violating this
condition messes up the linked list of Edges used for left & right Polys
and the associated estimated vertex count.
The fix is to simply let the first Poly win, and skip that vertex for
subsequent Polys. Since this only occurs in cases where vertices are very
close to each other, it should have little visual effect.
This is also exercised by Nebraska-StateSeal.svg.
BUG=skia:5636
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2259493002
Review-Url: https://codereview.chromium.org/2259493002
Motivation: drawText can look up unicode mapping at draw time to see
if ActualText should be used after crrev.com/2084533004 lands.
For each SkTypeface, only call getAdvancedTypefaceMetrics() once per
document. Cache the result in the SkPDFCanon, indexed by SkFontID.
Also cache PDF FontDescriptors in the canon, also indexed by SkFontID
(Type1 fonts only).
Simplify PDF font lookup, map SkFontID+SkGlyphID into a uint64_t. Map
that uint64_t to SkPDFFonts. Remove SkPDFCanon::findFont(),
SkPDFCanon::addFont(), SkPDFFont::IsMatch(), and enum SkPDFFont::Match.
SkPDFFont no longer holds on to ref of SkAdvancedTypefaceMetrics.
Instead, SkPDFFont::GetFontResource() and SkPDFFont::getFontSubset()
get metrics from canon.
SkPDFFont multybite bool is now a function of type.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2253993002
Review-Url: https://codereview.chromium.org/2253993002
Keep isOpaque as a convenience method -- many places really only need to
know that for optimization purposes (SrcOver -> Src, etc...).
In all the places where we pull data back out or convert to another
object and need to supply an SkImageInfo, we can avoid losing information
about premulness.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2250663002
Review-Url: https://codereview.chromium.org/2250663002
- kill off optimizeFor() now that we know it's broken and have a better way;
- simplify makeThreadsafe() a bit: we're not calling it anyway.
This sort of earns me back some crazy code currency,
which I am going to try to spend making reset() faster.
If anything, this appears to make makeThreadsafe() _faster_.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2254913002
Review-Url: https://codereview.chromium.org/2254913002
The IBMFamilyClass and Panose structures are obvious candidates
for simplification now that it is no longer necessary to nest
enums inside structs to avoid name clashes.
Review-Url: https://codereview.chromium.org/2253543004
This CL does two things. First it fixes a bug of ours where when using
a custom fbFetch variable (es 3.0 and higher), we sometimes overwrite
the out color and then attempt to use it as the dst color later. This is
fixed here by using an intermediate variable.
Secondly I've added a workaround to an andreno fbFetch where reading from
the outColor always returns the original dstColor even if we've overwritten
the value.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2248403003
Review-Url: https://codereview.chromium.org/2248403003
The SkLiteDL is recorded in some identity space (imagine, SkMatrix::I()),
but played back in a different one (here named SkMatrix original). Any
calls to setMatrix() need to be made relative to this new space.
All other ops already operate in relative coordinates.
This should let us not fiddle with setMatrix().
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2247353003
Review-Url: https://codereview.chromium.org/2247353003