Backed out changeset c8d0a8cf50a1 (bug 1044706) for Reftest Failures

This commit is contained in:
Carsten "Tomcat" Book 2014-07-29 13:41:42 +02:00
parent 317306ba9d
commit e5d79023a1
2 changed files with 13 additions and 15 deletions

View File

@ -3066,7 +3066,7 @@ struct TextRunDrawParams {
gfxContext *context; gfxContext *context;
gfxFont::Spacing *spacing; gfxFont::Spacing *spacing;
gfxTextRunDrawCallbacks *callbacks; gfxTextRunDrawCallbacks *callbacks;
gfxTextContextPaint *runContextPaint; gfxTextContextPaint *contextPaint;
gfxFloat direction; gfxFloat direction;
double devPerApp; double devPerApp;
DrawMode drawMode; DrawMode drawMode;
@ -3077,7 +3077,6 @@ struct TextRunDrawParams {
struct FontDrawParams { struct FontDrawParams {
RefPtr<ScaledFont> scaledFont; RefPtr<ScaledFont> scaledFont;
RefPtr<GlyphRenderingOptions> renderingOptions; RefPtr<GlyphRenderingOptions> renderingOptions;
gfxTextContextPaint *contextPaint;
Matrix *passedInvMatrix; Matrix *passedInvMatrix;
Matrix matInv; Matrix matInv;
double synBoldOnePixelOffset; double synBoldOnePixelOffset;
@ -3151,12 +3150,12 @@ private:
FlushStroke(buf, state); FlushStroke(buf, state);
} }
if (int(mRunParams.drawMode) & int(DrawMode::GLYPH_FILL)) { if (int(mRunParams.drawMode) & int(DrawMode::GLYPH_FILL)) {
if (state.pattern || mFontParams.contextPaint) { if (state.pattern || mRunParams.contextPaint) {
Pattern *pat; Pattern *pat;
nsRefPtr<gfxPattern> fillPattern; nsRefPtr<gfxPattern> fillPattern;
if (!mFontParams.contextPaint || if (!mRunParams.contextPaint ||
!(fillPattern = mFontParams.contextPaint->GetFillPattern( !(fillPattern = mRunParams.contextPaint->GetFillPattern(
mRunParams.context->CurrentMatrix()))) { mRunParams.context->CurrentMatrix()))) {
if (state.pattern) { if (state.pattern) {
pat = state.pattern->GetPattern(mRunParams.dt, pat = state.pattern->GetPattern(mRunParams.dt,
@ -3236,9 +3235,9 @@ private:
{ {
RefPtr<Path> path = RefPtr<Path> path =
mFontParams.scaledFont->GetPathForGlyphs(aBuf, mRunParams.dt); mFontParams.scaledFont->GetPathForGlyphs(aBuf, mRunParams.dt);
if (mFontParams.contextPaint) { if (mRunParams.contextPaint) {
nsRefPtr<gfxPattern> strokePattern = nsRefPtr<gfxPattern> strokePattern =
mFontParams.contextPaint->GetStrokePattern( mRunParams.contextPaint->GetStrokePattern(
mRunParams.context->CurrentMatrix()); mRunParams.context->CurrentMatrix());
if (strokePattern) { if (strokePattern) {
mRunParams.dt->Stroke(path, mRunParams.dt->Stroke(path,
@ -3316,7 +3315,7 @@ gfxFont::DrawOneGlyph(uint32_t aGlyphID, double aAdvance, gfxPoint *aPt,
} }
DrawMode mode = ForcePaintingDrawMode(runParams.drawMode); DrawMode mode = ForcePaintingDrawMode(runParams.drawMode);
if (RenderSVGGlyph(runParams.context, devPt, mode, if (RenderSVGGlyph(runParams.context, devPt, mode,
aGlyphID, runParams.runContextPaint, aGlyphID, runParams.contextPaint,
runParams.callbacks, *aEmittedGlyphs)) { runParams.callbacks, *aEmittedGlyphs)) {
return; return;
} }
@ -3420,7 +3419,7 @@ gfxFont::DrawGlyphs(gfxShapedText *aShapedText,
void void
gfxFont::Draw(gfxTextRun *aTextRun, uint32_t aStart, uint32_t aEnd, gfxFont::Draw(gfxTextRun *aTextRun, uint32_t aStart, uint32_t aEnd,
gfxPoint *aPt, const TextRunDrawParams& aRunParams) gfxPoint *aPt, TextRunDrawParams& aRunParams)
{ {
NS_ASSERTION(aRunParams.drawMode == DrawMode::GLYPH_PATH || NS_ASSERTION(aRunParams.drawMode == DrawMode::GLYPH_PATH ||
!(int(aRunParams.drawMode) & int(DrawMode::GLYPH_PATH)), !(int(aRunParams.drawMode) & int(DrawMode::GLYPH_PATH)),
@ -3439,10 +3438,9 @@ gfxFont::Draw(gfxTextRun *aTextRun, uint32_t aStart, uint32_t aEnd,
fontParams.haveSVGGlyphs = GetFontEntry()->TryGetSVGData(this); fontParams.haveSVGGlyphs = GetFontEntry()->TryGetSVGData(this);
fontParams.haveColorGlyphs = GetFontEntry()->TryGetColorGlyphs(); fontParams.haveColorGlyphs = GetFontEntry()->TryGetColorGlyphs();
fontParams.contextPaint = aRunParams.runContextPaint;
nsAutoPtr<gfxTextContextPaint> contextPaint; nsAutoPtr<gfxTextContextPaint> contextPaint;
if (fontParams.haveSVGGlyphs && !fontParams.contextPaint) { if (fontParams.haveSVGGlyphs && !aRunParams.contextPaint) {
// If no pattern is specified for fill, use the current pattern // If no pattern is specified for fill, use the current pattern
NS_ASSERTION((int(aRunParams.drawMode) & int(DrawMode::GLYPH_STROKE)) == 0, NS_ASSERTION((int(aRunParams.drawMode) & int(DrawMode::GLYPH_STROKE)) == 0,
"no pattern supplied for stroking text"); "no pattern supplied for stroking text");
@ -3450,7 +3448,7 @@ gfxFont::Draw(gfxTextRun *aTextRun, uint32_t aStart, uint32_t aEnd,
contextPaint = contextPaint =
new SimpleTextContextPaint(fillPattern, nullptr, new SimpleTextContextPaint(fillPattern, nullptr,
aRunParams.context->CurrentMatrix()); aRunParams.context->CurrentMatrix());
fontParams.contextPaint = contextPaint; aRunParams.contextPaint = contextPaint;
} }
// Synthetic-bold strikes are each offset one device pixel in run direction. // Synthetic-bold strikes are each offset one device pixel in run direction.
@ -7106,7 +7104,7 @@ gfxTextRun::Draw(gfxContext *aContext, gfxPoint aPt, DrawMode aDrawMode,
params.direction = direction; params.direction = direction;
params.drawMode = aDrawMode; params.drawMode = aDrawMode;
params.callbacks = aCallbacks; params.callbacks = aCallbacks;
params.runContextPaint = aContextPaint; params.contextPaint = aContextPaint;
params.paintSVGGlyphs = !aCallbacks || aCallbacks->mShouldPaintSVGGlyphs; params.paintSVGGlyphs = !aCallbacks || aCallbacks->mShouldPaintSVGGlyphs;
params.dt = aContext->GetDrawTarget(); params.dt = aContext->GetDrawTarget();

View File

@ -1772,7 +1772,7 @@ public:
* for LTR textruns, the right end for RTL textruns. * for LTR textruns, the right end for RTL textruns.
* On return, this will be updated to the other end of the baseline. * On return, this will be updated to the other end of the baseline.
* In application units, really! * In application units, really!
* @param aRunParams record with drawing parameters, see TextRunDrawParams. * @param aParams record with drawing parameters, see TextRunDrawParams.
* Particular fields of interest include * Particular fields of interest include
* .spacing spacing to insert before and after characters (for RTL * .spacing spacing to insert before and after characters (for RTL
* glyphs, before-spacing is inserted to the right of characters). There * glyphs, before-spacing is inserted to the right of characters). There
@ -1791,7 +1791,7 @@ public:
* -- all glyphs use this font * -- all glyphs use this font
*/ */
void Draw(gfxTextRun *aTextRun, uint32_t aStart, uint32_t aEnd, void Draw(gfxTextRun *aTextRun, uint32_t aStart, uint32_t aEnd,
gfxPoint *aPt, const TextRunDrawParams& aRunParams); gfxPoint *aPt, TextRunDrawParams& aParams);
/** /**
* Measure a run of characters. See gfxTextRun::Metrics. * Measure a run of characters. See gfxTextRun::Metrics.