|
Lines 1163-1182
void InlineFlowBox::paintBoxDecorations(
Source/WebCore/rendering/InlineFlowBox.cpp_sec1
|
| 1163 |
} |
1163 |
} |
| 1164 |
} |
1164 |
} |
| 1165 |
|
1165 |
|
| 1166 |
void InlineFlowBox::paintMask(PaintInfo& paintInfo, const IntPoint& paintOffset) |
1166 |
void InlineFlowBox::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset) |
| 1167 |
{ |
1167 |
{ |
| 1168 |
if (!paintInfo.shouldPaintWithinRoot(renderer()) || renderer()->style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask) |
1168 |
if (!paintInfo.shouldPaintWithinRoot(renderer()) || renderer()->style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask) |
| 1169 |
return; |
1169 |
return; |
| 1170 |
|
1170 |
|
| 1171 |
// Pixel snap mask painting. |
1171 |
// Pixel snap mask painting. |
| 1172 |
IntRect frameRect = roundedFrameRect(); |
1172 |
LayoutRect frameRect = roundedFrameRect(); |
| 1173 |
|
1173 |
|
| 1174 |
constrainToLineTopAndBottomIfNeeded(frameRect); |
1174 |
constrainToLineTopAndBottomIfNeeded(frameRect); |
| 1175 |
|
1175 |
|
| 1176 |
// Move x/y to our coordinates. |
1176 |
// Move x/y to our coordinates. |
| 1177 |
IntRect localRect(frameRect); |
1177 |
LayoutRect localRect(frameRect); |
| 1178 |
flipForWritingMode(localRect); |
1178 |
flipForWritingMode(localRect); |
| 1179 |
IntPoint adjustedPaintOffset = paintOffset + localRect.location(); |
1179 |
LayoutPoint adjustedPaintOffset = paintOffset + localRect.location(); |
| 1180 |
|
1180 |
|
| 1181 |
const NinePieceImage& maskNinePieceImage = renderer()->style()->maskBoxImage(); |
1181 |
const NinePieceImage& maskNinePieceImage = renderer()->style()->maskBoxImage(); |
| 1182 |
StyleImage* maskBoxImage = renderer()->style()->maskBoxImage().image(); |
1182 |
StyleImage* maskBoxImage = renderer()->style()->maskBoxImage().image(); |
|
Lines 1197-1203
void InlineFlowBox::paintMask(PaintInfo&
Source/WebCore/rendering/InlineFlowBox.cpp_sec2
|
| 1197 |
} |
1197 |
} |
| 1198 |
} |
1198 |
} |
| 1199 |
|
1199 |
|
| 1200 |
IntRect paintRect = IntRect(adjustedPaintOffset, frameRect.size()); |
1200 |
LayoutRect paintRect = LayoutRect(adjustedPaintOffset, frameRect.size()); |
| 1201 |
paintFillLayers(paintInfo, Color(), renderer()->style()->maskLayers(), paintRect, compositeOp); |
1201 |
paintFillLayers(paintInfo, Color(), renderer()->style()->maskLayers(), paintRect, compositeOp); |
| 1202 |
|
1202 |
|
| 1203 |
bool hasBoxImage = maskBoxImage && maskBoxImage->canRender(renderer()->style()->effectiveZoom()); |
1203 |
bool hasBoxImage = maskBoxImage && maskBoxImage->canRender(renderer()->style()->effectiveZoom()); |
|
Lines 1207-1230
void InlineFlowBox::paintMask(PaintInfo&
Source/WebCore/rendering/InlineFlowBox.cpp_sec3
|
| 1207 |
// The simple case is where we are the only box for this object. In those |
1207 |
// The simple case is where we are the only box for this object. In those |
| 1208 |
// cases only a single call to draw is required. |
1208 |
// cases only a single call to draw is required. |
| 1209 |
if (!prevLineBox() && !nextLineBox()) { |
1209 |
if (!prevLineBox() && !nextLineBox()) { |
| 1210 |
boxModelObject()->paintNinePieceImage(paintInfo.context, IntRect(adjustedPaintOffset, frameRect.size()), renderer()->style(), maskNinePieceImage, compositeOp); |
1210 |
boxModelObject()->paintNinePieceImage(paintInfo.context, LayoutRect(adjustedPaintOffset, frameRect.size()), renderer()->style(), maskNinePieceImage, compositeOp); |
| 1211 |
} else { |
1211 |
} else { |
| 1212 |
// We have a mask image that spans multiple lines. |
1212 |
// We have a mask image that spans multiple lines. |
| 1213 |
// We need to adjust _tx and _ty by the width of all previous lines. |
1213 |
// We need to adjust _tx and _ty by the width of all previous lines. |
| 1214 |
int logicalOffsetOnLine = 0; |
1214 |
LayoutUnit logicalOffsetOnLine = 0; |
| 1215 |
for (InlineFlowBox* curr = prevLineBox(); curr; curr = curr->prevLineBox()) |
1215 |
for (InlineFlowBox* curr = prevLineBox(); curr; curr = curr->prevLineBox()) |
| 1216 |
logicalOffsetOnLine += curr->logicalWidth(); |
1216 |
logicalOffsetOnLine += curr->logicalWidth(); |
| 1217 |
int totalLogicalWidth = logicalOffsetOnLine; |
1217 |
LayoutUnit totalLogicalWidth = logicalOffsetOnLine; |
| 1218 |
for (InlineFlowBox* curr = this; curr; curr = curr->nextLineBox()) |
1218 |
for (InlineFlowBox* curr = this; curr; curr = curr->nextLineBox()) |
| 1219 |
totalLogicalWidth += curr->logicalWidth(); |
1219 |
totalLogicalWidth += curr->logicalWidth(); |
| 1220 |
int stripX = adjustedPaintOffset.x() - (isHorizontal() ? logicalOffsetOnLine : 0); |
1220 |
LayoutUnit stripX = adjustedPaintOffset.x() - (isHorizontal() ? logicalOffsetOnLine : 0); |
| 1221 |
int stripY = adjustedPaintOffset.y() - (isHorizontal() ? 0 : logicalOffsetOnLine); |
1221 |
LayoutUnit stripY = adjustedPaintOffset.y() - (isHorizontal() ? 0 : logicalOffsetOnLine); |
| 1222 |
int stripWidth = isHorizontal() ? totalLogicalWidth : frameRect.width(); |
1222 |
LayoutUnit stripWidth = isHorizontal() ? totalLogicalWidth : frameRect.width(); |
| 1223 |
int stripHeight = isHorizontal() ? frameRect.height() : totalLogicalWidth; |
1223 |
LayoutUnit stripHeight = isHorizontal() ? frameRect.height() : totalLogicalWidth; |
| 1224 |
|
1224 |
|
| 1225 |
GraphicsContextStateSaver stateSaver(*paintInfo.context); |
1225 |
GraphicsContextStateSaver stateSaver(*paintInfo.context); |
| 1226 |
paintInfo.context->clip(paintRect); |
1226 |
paintInfo.context->clip(paintRect); |
| 1227 |
boxModelObject()->paintNinePieceImage(paintInfo.context, IntRect(stripX, stripY, stripWidth, stripHeight), renderer()->style(), maskNinePieceImage, compositeOp); |
1227 |
boxModelObject()->paintNinePieceImage(paintInfo.context, LayoutRect(stripX, stripY, stripWidth, stripHeight), renderer()->style(), maskNinePieceImage, compositeOp); |
| 1228 |
} |
1228 |
} |
| 1229 |
|
1229 |
|
| 1230 |
if (pushTransparencyLayer) |
1230 |
if (pushTransparencyLayer) |