Bug 894957 - Don't attempt to draw transparent text. r=roc

This commit is contained in:
Markus Stange 2013-07-18 08:36:05 +02:00
Родитель cddb8f5c57
Коммит e340ea4b96
1 изменённых файлов: 10 добавлений и 2 удалений

Просмотреть файл

@ -5748,10 +5748,18 @@ gfxTextRun::Draw(gfxContext *aContext, gfxPoint aPt, gfxFont::DrawMode aDrawMode
"GLYPH_PATH cannot be used with GLYPH_FILL, GLYPH_STROKE or GLYPH_STROKE_UNDERNEATH");
NS_ASSERTION(aDrawMode == gfxFont::GLYPH_PATH || !aCallbacks, "callback must not be specified unless using GLYPH_PATH");
bool skipDrawing = mSkipDrawing;
if (aDrawMode == gfxFont::GLYPH_FILL) {
gfxRGBA currentColor;
if (aContext->GetDeviceColor(currentColor) && currentColor.a == 0) {
skipDrawing = true;
}
}
gfxFloat direction = GetDirection();
if (mSkipDrawing) {
// We're waiting for a user font to finish downloading;
if (skipDrawing) {
// We don't need to draw anything;
// but if the caller wants advance width, we need to compute it here
if (aAdvanceWidth) {
gfxTextRun::Metrics metrics = MeasureText(aStart, aLength,