Commit 7c155a2f authored by leviw@chromium.org's avatar leviw@chromium.org
Browse files

2011-05-11 Levi Weintraub <leviw@chromium.org>

        Reviewed by Eric Seidel.

        Switch paintFillLayer and its progeny to use IntRect instead of four ints
        https://bugs.webkit.org/show_bug.cgi?id=60596

        Changing integers passed into paintFillLayer and other derivatives to IntRects
        and IntSizes that reflect their function.

        No new tests since this is just refactoring.

        * rendering/InlineFlowBox.cpp:
        (WebCore::InlineFlowBox::paintFillLayers):
        (WebCore::InlineFlowBox::paintFillLayer):
        (WebCore::InlineFlowBox::paintBoxDecorations):
        (WebCore::InlineFlowBox::paintMask):
        * rendering/InlineFlowBox.h:
        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::paintRootBoxFillLayers):
        (WebCore::RenderBox::paintBoxDecorationsWithSize):
        (WebCore::RenderBox::paintMaskImages):
        (WebCore::RenderBox::paintFillLayers):
        (WebCore::RenderBox::paintFillLayer):
        * rendering/RenderBox.h:
        * rendering/RenderBoxModelObject.cpp:
        (WebCore::RenderBoxModelObject::paintFillLayerExtended):
        * rendering/RenderBoxModelObject.h:
        * rendering/RenderFieldset.cpp:
        (WebCore::RenderFieldset::paintBoxDecorations):
        * rendering/RenderTable.cpp:
        (WebCore::RenderTable::paintBoxDecorations):
        * rendering/RenderTableCell.cpp:
        (WebCore::RenderTableCell::paintBackgroundsBehindCell):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@86303 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 589d1c43
2011-05-11 Levi Weintraub <leviw@chromium.org>
Reviewed by Eric Seidel.
Switch paintFillLayer and its progeny to use IntRect instead of four ints
https://bugs.webkit.org/show_bug.cgi?id=60596
Changing integers passed into paintFillLayer and other derivatives to IntRects
and IntSizes that reflect their function.
No new tests since this is just refactoring.
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::paintFillLayers):
(WebCore::InlineFlowBox::paintFillLayer):
(WebCore::InlineFlowBox::paintBoxDecorations):
(WebCore::InlineFlowBox::paintMask):
* rendering/InlineFlowBox.h:
* rendering/RenderBox.cpp:
(WebCore::RenderBox::paintRootBoxFillLayers):
(WebCore::RenderBox::paintBoxDecorationsWithSize):
(WebCore::RenderBox::paintMaskImages):
(WebCore::RenderBox::paintFillLayers):
(WebCore::RenderBox::paintFillLayer):
* rendering/RenderBox.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::paintFillLayerExtended):
* rendering/RenderBoxModelObject.h:
* rendering/RenderFieldset.cpp:
(WebCore::RenderFieldset::paintBoxDecorations):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::paintBoxDecorations):
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::paintBackgroundsBehindCell):
2011-05-11 Nat Duca <nduca@chromium.org>
 
Reviewed by James Robinson.
......@@ -1016,20 +1016,20 @@ void InlineFlowBox::paint(PaintInfo& paintInfo, int tx, int ty, int lineTop, int
}
}
void InlineFlowBox::paintFillLayers(const PaintInfo& paintInfo, const Color& c, const FillLayer* fillLayer, int _tx, int _ty, int w, int h, CompositeOperator op)
void InlineFlowBox::paintFillLayers(const PaintInfo& paintInfo, const Color& c, const FillLayer* fillLayer, const IntRect& rect, CompositeOperator op)
{
if (!fillLayer)
return;
paintFillLayers(paintInfo, c, fillLayer->next(), _tx, _ty, w, h, op);
paintFillLayer(paintInfo, c, fillLayer, _tx, _ty, w, h, op);
paintFillLayers(paintInfo, c, fillLayer->next(), rect, op);
paintFillLayer(paintInfo, c, fillLayer, rect, op);
}
void InlineFlowBox::paintFillLayer(const PaintInfo& paintInfo, const Color& c, const FillLayer* fillLayer, int tx, int ty, int w, int h, CompositeOperator op)
void InlineFlowBox::paintFillLayer(const PaintInfo& paintInfo, const Color& c, const FillLayer* fillLayer, const IntRect& rect, CompositeOperator op)
{
StyleImage* img = fillLayer->image();
bool hasFillImage = img && img->canRender(renderer()->style()->effectiveZoom());
if ((!hasFillImage && !renderer()->style()->hasBorderRadius()) || (!prevLineBox() && !nextLineBox()) || !parent())
boxModelObject()->paintFillLayerExtended(paintInfo, c, fillLayer, tx, ty, w, h, BackgroundBleedNone, this, w, h, op);
boxModelObject()->paintFillLayerExtended(paintInfo, c, fillLayer, rect, BackgroundBleedNone, this, rect.size(), op);
else {
// We have a fill image that spans multiple lines.
// We need to adjust tx and ty by the width of all previous lines.
......@@ -1052,14 +1052,14 @@ void InlineFlowBox::paintFillLayer(const PaintInfo& paintInfo, const Color& c, c
for (InlineFlowBox* curr = this; curr; curr = curr->prevLineBox())
totalLogicalWidth += curr->logicalWidth();
}
int stripX = tx - (isHorizontal() ? logicalOffsetOnLine : 0);
int stripY = ty - (isHorizontal() ? 0 : logicalOffsetOnLine);
int stripX = rect.x() - (isHorizontal() ? logicalOffsetOnLine : 0);
int stripY = rect.y() - (isHorizontal() ? 0 : logicalOffsetOnLine);
int stripWidth = isHorizontal() ? totalLogicalWidth : width();
int stripHeight = isHorizontal() ? height() : totalLogicalWidth;
GraphicsContextStateSaver stateSaver(*paintInfo.context);
paintInfo.context->clip(IntRect(tx, ty, width(), height()));
boxModelObject()->paintFillLayerExtended(paintInfo, c, fillLayer, stripX, stripY, stripWidth, stripHeight, BackgroundBleedNone, this, w, h, op);
paintInfo.context->clip(IntRect(rect.x(), rect.y(), width(), height()));
boxModelObject()->paintFillLayerExtended(paintInfo, c, fillLayer, IntRect(stripX, stripY, stripWidth, stripHeight), BackgroundBleedNone, this, rect.size(), op);
}
}
......@@ -1113,7 +1113,7 @@ void InlineFlowBox::paintBoxDecorations(PaintInfo& paintInfo, int tx, int ty)
paintBoxShadow(context, styleToUse, Normal, tx, ty, w, h);
Color c = styleToUse->visitedDependentColor(CSSPropertyBackgroundColor);
paintFillLayers(paintInfo, c, styleToUse->backgroundLayers(), tx, ty, w, h);
paintFillLayers(paintInfo, c, styleToUse->backgroundLayers(), IntRect(tx, ty, w, h));
paintBoxShadow(context, styleToUse, Inset, tx, ty, w, h);
// :first-line cannot be used to put borders on a line. Always paint borders with our
......@@ -1204,7 +1204,7 @@ void InlineFlowBox::paintMask(PaintInfo& paintInfo, int tx, int ty)
}
}
paintFillLayers(paintInfo, Color(), renderer()->style()->maskLayers(), tx, ty, w, h, compositeOp);
paintFillLayers(paintInfo, Color(), renderer()->style()->maskLayers(), IntRect(tx, ty, w, h), compositeOp);
bool hasBoxImage = maskBoxImage && maskBoxImage->canRender(renderer()->style()->effectiveZoom());
if (!hasBoxImage || !maskBoxImage->isLoaded())
......
......@@ -105,8 +105,8 @@ public:
virtual void paintBoxDecorations(PaintInfo&, int tx, int ty);
virtual void paintMask(PaintInfo&, int tx, int ty);
void paintFillLayers(const PaintInfo&, const Color&, const FillLayer*, int tx, int ty, int w, int h, CompositeOperator = CompositeSourceOver);
void paintFillLayer(const PaintInfo&, const Color&, const FillLayer*, int tx, int ty, int w, int h, CompositeOperator = CompositeSourceOver);
void paintFillLayers(const PaintInfo&, const Color&, const FillLayer*, const IntRect&, CompositeOperator = CompositeSourceOver);
void paintFillLayer(const PaintInfo&, const Color&, const FillLayer*, const IntRect&, CompositeOperator = CompositeSourceOver);
void paintBoxShadow(GraphicsContext*, RenderStyle*, ShadowStyle, int tx, int ty, int w, int h);
virtual void paint(PaintInfo&, int tx, int ty, int lineTop, int lineBottom);
virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, int lineTop, int lineBottom);
......
......@@ -799,7 +799,7 @@ void RenderBox::paintRootBoxFillLayers(const PaintInfo& paintInfo)
// The background of the box generated by the root element covers the entire canvas, so just use
// the RenderView's docTop/Left/Width/Height accessors.
paintFillLayers(paintInfo, bgColor, bgLayer, view()->docLeft(), view()->docTop(), view()->docWidth(), view()->docHeight(), BackgroundBleedNone, CompositeSourceOver, bodyObject);
paintFillLayers(paintInfo, bgColor, bgLayer, view()->documentRect(), BackgroundBleedNone, CompositeSourceOver, bodyObject);
}
void RenderBox::paintBoxDecorations(PaintInfo& paintInfo, int tx, int ty)
......@@ -834,6 +834,7 @@ BackgroundBleedAvoidance RenderBox::determineBackgroundBleedAvoidance(GraphicsCo
void RenderBox::paintBoxDecorationsWithSize(PaintInfo& paintInfo, int tx, int ty, int width, int height)
{
IntRect paintRect = IntRect(tx, ty, width, height);
// border-fit can adjust where we paint our border and background. If set, we snugly fit our line box descendants. (The iChat
// balloon layout is an example of this).
borderFitAdjust(tx, width);
......@@ -849,7 +850,7 @@ void RenderBox::paintBoxDecorationsWithSize(PaintInfo& paintInfo, int tx, int ty
// To avoid the background color bleeding out behind the border, we'll render background and border
// into a transparency layer, and then clip that in one go (which requires setting up the clip before
// beginning the layer).
RoundedIntRect border = style()->getRoundedBorderFor(IntRect(tx, ty, width, height));
RoundedIntRect border = style()->getRoundedBorderFor(paintRect);
stateSaver.save();
paintInfo.context->addRoundedRectClip(border);
paintInfo.context->beginTransparencyLayer(1);
......@@ -857,22 +858,22 @@ void RenderBox::paintBoxDecorationsWithSize(PaintInfo& paintInfo, int tx, int ty
// If we have a native theme appearance, paint that before painting our background.
// The theme will tell us whether or not we should also paint the CSS background.
bool themePainted = style()->hasAppearance() && !theme()->paint(this, paintInfo, IntRect(tx, ty, width, height));
bool themePainted = style()->hasAppearance() && !theme()->paint(this, paintInfo, paintRect);
if (!themePainted) {
if (isRoot())
paintRootBoxFillLayers(paintInfo);
else if (!isBody() || document()->documentElement()->renderer()->hasBackground()) {
// The <body> only paints its background if the root element has defined a background
// independent of the body.
paintFillLayers(paintInfo, style()->visitedDependentColor(CSSPropertyBackgroundColor), style()->backgroundLayers(), tx, ty, width, height, bleedAvoidance);
paintFillLayers(paintInfo, style()->visitedDependentColor(CSSPropertyBackgroundColor), style()->backgroundLayers(), paintRect, bleedAvoidance);
}
if (style()->hasAppearance())
theme()->paintDecorations(this, paintInfo, IntRect(tx, ty, width, height));
theme()->paintDecorations(this, paintInfo, paintRect);
}
paintBoxShadow(paintInfo.context, tx, ty, width, height, style(), Inset);
// The theme will tell us whether or not we should also paint the CSS border.
if ((!style()->hasAppearance() || (!themePainted && theme()->paintBorderOnly(this, paintInfo, IntRect(tx, ty, width, height)))) && style()->hasBorder())
if ((!style()->hasAppearance() || (!themePainted && theme()->paintBorderOnly(this, paintInfo, paintRect))) && style()->hasBorder())
paintBorder(paintInfo.context, IntRect(tx, ty, width, height), style(), bleedAvoidance);
if (bleedAvoidance == BackgroundBleedUseTransparencyLayer)
......@@ -952,8 +953,9 @@ void RenderBox::paintMaskImages(const PaintInfo& paintInfo, int tx, int ty, int
}
if (allMaskImagesLoaded) {
paintFillLayers(paintInfo, Color(), style()->maskLayers(), tx, ty, w, h, BackgroundBleedNone, compositeOp);
paintNinePieceImage(paintInfo.context, IntRect(tx, ty, w, h), style(), style()->maskBoxImage(), compositeOp);
IntRect paintRect = IntRect(tx, ty, w, h);
paintFillLayers(paintInfo, Color(), style()->maskLayers(), paintRect, BackgroundBleedNone, compositeOp);
paintNinePieceImage(paintInfo.context, paintRect, style(), style()->maskBoxImage(), compositeOp);
}
if (pushTransparencyLayer)
......@@ -979,20 +981,20 @@ IntRect RenderBox::maskClipRect()
return result;
}
void RenderBox::paintFillLayers(const PaintInfo& paintInfo, const Color& c, const FillLayer* fillLayer, int tx, int ty, int width, int height,
void RenderBox::paintFillLayers(const PaintInfo& paintInfo, const Color& c, const FillLayer* fillLayer, const IntRect& rect,
BackgroundBleedAvoidance bleedAvoidance, CompositeOperator op, RenderObject* backgroundObject)
{
if (!fillLayer)
return;
paintFillLayers(paintInfo, c, fillLayer->next(), tx, ty, width, height, bleedAvoidance, op, backgroundObject);
paintFillLayer(paintInfo, c, fillLayer, tx, ty, width, height, bleedAvoidance, op, backgroundObject);
paintFillLayers(paintInfo, c, fillLayer->next(), rect, bleedAvoidance, op, backgroundObject);
paintFillLayer(paintInfo, c, fillLayer, rect, bleedAvoidance, op, backgroundObject);
}
void RenderBox::paintFillLayer(const PaintInfo& paintInfo, const Color& c, const FillLayer* fillLayer, int tx, int ty, int width, int height,
void RenderBox::paintFillLayer(const PaintInfo& paintInfo, const Color& c, const FillLayer* fillLayer, const IntRect& rect,
BackgroundBleedAvoidance bleedAvoidance, CompositeOperator op, RenderObject* backgroundObject)
{
paintFillLayerExtended(paintInfo, c, fillLayer, tx, ty, width, height, bleedAvoidance, 0, 0, 0, op, backgroundObject);
paintFillLayerExtended(paintInfo, c, fillLayer, rect, bleedAvoidance, 0, IntSize(), op, backgroundObject);
}
#if USE(ACCELERATED_COMPOSITING)
......
......@@ -405,8 +405,8 @@ protected:
virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
virtual void updateBoxModelInfoFromStyle();
void paintFillLayer(const PaintInfo&, const Color&, const FillLayer*, int tx, int ty, int width, int height, BackgroundBleedAvoidance, CompositeOperator, RenderObject* backgroundObject);
void paintFillLayers(const PaintInfo&, const Color&, const FillLayer*, int tx, int ty, int width, int height, BackgroundBleedAvoidance = BackgroundBleedNone, CompositeOperator = CompositeSourceOver, RenderObject* backgroundObject = 0);
void paintFillLayer(const PaintInfo&, const Color&, const FillLayer*, const IntRect&, BackgroundBleedAvoidance, CompositeOperator, RenderObject* backgroundObject);
void paintFillLayers(const PaintInfo&, const Color&, const FillLayer*, const IntRect&, BackgroundBleedAvoidance = BackgroundBleedNone, CompositeOperator = CompositeSourceOver, RenderObject* backgroundObject = 0);
void paintBoxDecorationsWithSize(PaintInfo&, int tx, int ty, int width, int height);
void paintMaskImages(const PaintInfo&, int tx, int ty, int width, int height);
......
......@@ -585,15 +585,11 @@ static IntRect backgroundRectAdjustedForBleedAvoidance(GraphicsContext* context,
return adjustedRect;
}
void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, const Color& color, const FillLayer* bgLayer, int tx, int ty, int w, int h,
BackgroundBleedAvoidance bleedAvoidance, InlineFlowBox* box, int inlineBoxWidth, int inlineBoxHeight, CompositeOperator op, RenderObject* backgroundObject)
void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, const Color& color, const FillLayer* bgLayer, const IntRect& rect,
BackgroundBleedAvoidance bleedAvoidance, InlineFlowBox* box, const IntSize& boxSize, CompositeOperator op, RenderObject* backgroundObject)
{
GraphicsContext* context = paintInfo.context;
if (context->paintingDisabled())
return;
IntRect borderRect(tx, ty, w, h);
if (borderRect.isEmpty())
if (context->paintingDisabled() || rect.isEmpty())
return;
bool includeLeftEdge = box ? box->includeLogicalLeftEdge() : true;
......@@ -631,10 +627,10 @@ void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co
return;
if (hasRoundedBorder && bleedAvoidance != BackgroundBleedUseTransparencyLayer) {
RoundedIntRect border = getBackgroundRoundedRect(backgroundRectAdjustedForBleedAvoidance(context, borderRect, bleedAvoidance), box, inlineBoxWidth, inlineBoxHeight, includeLeftEdge, includeRightEdge);
RoundedIntRect border = getBackgroundRoundedRect(backgroundRectAdjustedForBleedAvoidance(context, rect, bleedAvoidance), box, boxSize.width(), boxSize.height(), includeLeftEdge, includeRightEdge);
context->fillRoundedRect(border, bgColor, style()->colorSpace());
} else
context->fillRect(borderRect, bgColor, style()->colorSpace());
context->fillRect(rect, bgColor, style()->colorSpace());
return;
}
......@@ -642,7 +638,7 @@ void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co
bool clipToBorderRadius = hasRoundedBorder && bleedAvoidance != BackgroundBleedUseTransparencyLayer;
GraphicsContextStateSaver clipToBorderStateSaver(*context, clipToBorderRadius);
if (clipToBorderRadius) {
RoundedIntRect border = getBackgroundRoundedRect(backgroundRectAdjustedForBleedAvoidance(context, borderRect, bleedAvoidance), box, inlineBoxWidth, inlineBoxHeight, includeLeftEdge, includeRightEdge);
RoundedIntRect border = getBackgroundRoundedRect(backgroundRectAdjustedForBleedAvoidance(context, rect, bleedAvoidance), box, boxSize.width(), boxSize.height(), includeLeftEdge, includeRightEdge);
context->addRoundedRectClip(border);
}
......@@ -652,33 +648,33 @@ void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co
int pRight = includeRightEdge ? paddingRight() : 0;
GraphicsContextStateSaver clipWithScrollingStateSaver(*context, clippedWithLocalScrolling);
IntRect scrolledPaintRect = rect;
if (clippedWithLocalScrolling) {
// Clip to the overflow area.
context->clip(toRenderBox(this)->overflowClipRect(tx, ty));
context->clip(toRenderBox(this)->overflowClipRect(rect.x(), rect.y()));
// Now adjust our tx, ty, w, h to reflect a scrolled content box with borders at the ends.
// Adjust the paint rect to reflect a scrolled content box with borders at the ends.
IntSize offset = layer()->scrolledContentOffset();
tx -= offset.width();
ty -= offset.height();
w = bLeft + layer()->scrollWidth() + bRight;
h = borderTop() + layer()->scrollHeight() + borderBottom();
scrolledPaintRect.move(-offset);
scrolledPaintRect.setWidth(bLeft + layer()->scrollWidth() + bRight);
scrolledPaintRect.setHeight(borderTop() + layer()->scrollHeight() + borderBottom());
}
GraphicsContextStateSaver backgroundClipStateSaver(*context, false);
if (bgLayer->clip() == PaddingFillBox || bgLayer->clip() == ContentFillBox) {
// Clip to the padding or content boxes as necessary.
bool includePadding = bgLayer->clip() == ContentFillBox;
int x = tx + bLeft + (includePadding ? pLeft : 0);
int y = ty + borderTop() + (includePadding ? paddingTop() : 0);
int width = w - bLeft - bRight - (includePadding ? pLeft + pRight : 0);
int height = h - borderTop() - borderBottom() - (includePadding ? paddingTop() + paddingBottom() : 0);
IntRect clipRect = IntRect(scrolledPaintRect.x() + bLeft + (includePadding ? pLeft : 0),
scrolledPaintRect.y() + borderTop() + (includePadding ? paddingTop() : 0),
scrolledPaintRect.width() - bLeft - bRight - (includePadding ? pLeft + pRight : 0),
scrolledPaintRect.height() - borderTop() - borderBottom() - (includePadding ? paddingTop() + paddingBottom() : 0));
backgroundClipStateSaver.save();
context->clip(IntRect(x, y, width, height));
context->clip(clipRect);
} else if (bgLayer->clip() == TextFillBox) {
// We have to draw our text into a mask that can then be used to clip background drawing.
// First figure out how big the mask has to be. It should be no bigger than what we need
// to actually render, so we should intersect the dirty rect with the border box of the background.
IntRect maskRect(tx, ty, w, h);
IntRect maskRect = rect;
maskRect.intersect(paintInfo.rect);
// Now create the mask.
......@@ -694,11 +690,11 @@ void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co
PaintInfo info(maskImageContext, maskRect, PaintPhaseTextClip, true, 0, 0);
if (box) {
RootInlineBox* root = box->root();
box->paint(info, tx - box->x(), ty - box->y(), root->lineTop(), root->lineBottom());
box->paint(info, scrolledPaintRect.x() - box->x(), scrolledPaintRect.y() - box->y(), root->lineTop(), root->lineBottom());
} else {
int x = isBox() ? toRenderBox(this)->x() : 0;
int y = isBox() ? toRenderBox(this)->y() : 0;
paint(info, tx - x, ty - y);
paint(info, scrolledPaintRect.x() - x, scrolledPaintRect.y() - y);
}
// The mask has been created. Now we just need to clip to it.
......@@ -739,22 +735,22 @@ void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co
// Paint the color first underneath all images.
if (!bgLayer->next()) {
IntRect rect(tx, ty, w, h);
rect.intersect(paintInfo.rect);
IntRect backgroundRect(scrolledPaintRect);
backgroundRect.intersect(paintInfo.rect);
// If we have an alpha and we are painting the root element, go ahead and blend with the base background color.
if (isOpaqueRoot) {
Color baseColor = view()->frameView()->baseBackgroundColor();
if (baseColor.alpha() > 0) {
CompositeOperator previousOperator = context->compositeOperation();
context->setCompositeOperation(CompositeCopy);
context->fillRect(rect, baseColor, style()->colorSpace());
context->fillRect(backgroundRect, baseColor, style()->colorSpace());
context->setCompositeOperation(previousOperator);
} else
context->clearRect(rect);
context->clearRect(backgroundRect);
}
if (bgColor.isValid() && bgColor.alpha() > 0)
context->fillRect(rect, bgColor, style()->colorSpace());
context->fillRect(backgroundRect, bgColor, style()->colorSpace());
}
// no progressive loading of the background image
......@@ -763,7 +759,7 @@ void RenderBoxModelObject::paintFillLayerExtended(const PaintInfo& paintInfo, co
IntPoint phase;
IntSize tileSize;
calculateBackgroundImageGeometry(bgLayer, tx, ty, w, h, destRect, phase, tileSize);
calculateBackgroundImageGeometry(bgLayer, scrolledPaintRect.x(), scrolledPaintRect.y(), scrolledPaintRect.width(), scrolledPaintRect.height(), destRect, phase, tileSize);
IntPoint destOrigin = destRect.location();
destRect.intersect(paintInfo.rect);
if (!destRect.isEmpty()) {
......
......@@ -121,7 +121,7 @@ public:
void paintBorder(GraphicsContext*, const IntRect&, const RenderStyle*, BackgroundBleedAvoidance = BackgroundBleedNone, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true);
bool paintNinePieceImage(GraphicsContext*, const IntRect&, const RenderStyle*, const NinePieceImage&, CompositeOperator = CompositeSourceOver);
void paintBoxShadow(GraphicsContext*, int tx, int ty, int w, int h, const RenderStyle*, ShadowStyle, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true);
void paintFillLayerExtended(const PaintInfo&, const Color&, const FillLayer*, int tx, int ty, int width, int height, BackgroundBleedAvoidance, InlineFlowBox* = 0, int inlineBoxWidth = 0, int inlineBoxHeight = 0, CompositeOperator = CompositeSourceOver, RenderObject* backgroundObject = 0);
void paintFillLayerExtended(const PaintInfo&, const Color&, const FillLayer*, const IntRect&, BackgroundBleedAvoidance, InlineFlowBox* = 0, const IntSize& = IntSize(), CompositeOperator = CompositeSourceOver, RenderObject* backgroundObject = 0);
// Overridden by subclasses to determine line height and baseline position.
virtual int lineHeight(bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const = 0;
......
......@@ -144,7 +144,7 @@ void RenderFieldset::paintBoxDecorations(PaintInfo& paintInfo, int tx, int ty)
paintBoxShadow(paintInfo.context, tx, ty, w, h, style(), Normal);
paintFillLayers(paintInfo, style()->visitedDependentColor(CSSPropertyBackgroundColor), style()->backgroundLayers(), tx, ty, w, h);
paintFillLayers(paintInfo, style()->visitedDependentColor(CSSPropertyBackgroundColor), style()->backgroundLayers(), IntRect(tx, ty, w, h));
paintBoxShadow(paintInfo.context, tx, ty, w, h, style(), Inset);
if (!style()->hasBorder())
......
......@@ -565,7 +565,7 @@ void RenderTable::paintBoxDecorations(PaintInfo& paintInfo, int tx, int ty)
else if (!isBody() || document()->documentElement()->renderer()->hasBackground())
// The <body> only paints its background if the root element has defined a background
// independent of the body.
paintFillLayers(paintInfo, style()->visitedDependentColor(CSSPropertyBackgroundColor), style()->backgroundLayers(), rect.x(), rect.y(), rect.width(), rect.height());
paintFillLayers(paintInfo, style()->visitedDependentColor(CSSPropertyBackgroundColor), style()->backgroundLayers(), rect);
paintBoxShadow(paintInfo.context, rect.x(), rect.y(), rect.width(), rect.height(), style(), Inset);
......
......@@ -994,7 +994,7 @@ void RenderTableCell::paintBackgroundsBehindCell(PaintInfo& paintInfo, int tx, i
w - borderLeft() - borderRight(), h - borderTop() - borderBottom());
paintInfo.context->clip(clipRect);
}
paintFillLayers(paintInfo, c, bgLayer, tx, ty, w, h, BackgroundBleedNone, CompositeSourceOver, backgroundObject);
paintFillLayers(paintInfo, c, bgLayer, IntRect(tx, ty, w, h), BackgroundBleedNone, CompositeSourceOver, backgroundObject);
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment