OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) |
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv
ed. |
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 1057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1068 void RenderBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset) | 1068 void RenderBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset) |
1069 { | 1069 { |
1070 LayoutPoint adjustedPaintOffset = paintOffset + location(); | 1070 LayoutPoint adjustedPaintOffset = paintOffset + location(); |
1071 // default implementation. Just pass paint through to the children | 1071 // default implementation. Just pass paint through to the children |
1072 PaintInfo childInfo(paintInfo); | 1072 PaintInfo childInfo(paintInfo); |
1073 childInfo.updatePaintingRootForChildren(this); | 1073 childInfo.updatePaintingRootForChildren(this); |
1074 for (RenderObject* child = firstChild(); child; child = child->nextSibling()
) | 1074 for (RenderObject* child = firstChild(); child; child = child->nextSibling()
) |
1075 child->paint(childInfo, adjustedPaintOffset); | 1075 child->paint(childInfo, adjustedPaintOffset); |
1076 } | 1076 } |
1077 | 1077 |
1078 void RenderBox::paintRootBoxFillLayers(const PaintInfo& paintInfo) | 1078 void RenderBox::paintRootBoxFillLayers(PaintInfo& paintInfo) |
1079 { | 1079 { |
1080 if (paintInfo.skipRootBackground()) | 1080 if (paintInfo.skipRootBackground()) |
1081 return; | 1081 return; |
1082 | 1082 |
1083 RenderObject* rootBackgroundRenderer = rendererForRootBackground(); | 1083 RenderObject* rootBackgroundRenderer = rendererForRootBackground(); |
1084 | 1084 |
1085 const FillLayer* bgLayer = rootBackgroundRenderer->style()->backgroundLayers
(); | 1085 const FillLayer* bgLayer = rootBackgroundRenderer->style()->backgroundLayers
(); |
1086 Color bgColor = rootBackgroundRenderer->resolveColor(CSSPropertyBackgroundCo
lor); | 1086 Color bgColor = rootBackgroundRenderer->resolveColor(CSSPropertyBackgroundCo
lor); |
1087 | 1087 |
1088 paintFillLayers(paintInfo, bgColor, bgLayer, view()->backgroundRect(this), B
ackgroundBleedNone, CompositeSourceOver, rootBackgroundRenderer); | 1088 paintFillLayers(paintInfo, bgColor, bgLayer, view()->backgroundRect(this), B
ackgroundBleedNone, CompositeSourceOver, rootBackgroundRenderer); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1121 return BackgroundBleedBackgroundOverBorder; | 1121 return BackgroundBleedBackgroundOverBorder; |
1122 | 1122 |
1123 return BackgroundBleedUseTransparencyLayer; | 1123 return BackgroundBleedUseTransparencyLayer; |
1124 } | 1124 } |
1125 | 1125 |
1126 void RenderBox::paintBoxDecorations(PaintInfo& paintInfo, const LayoutPoint& pai
ntOffset) | 1126 void RenderBox::paintBoxDecorations(PaintInfo& paintInfo, const LayoutPoint& pai
ntOffset) |
1127 { | 1127 { |
1128 if (!paintInfo.shouldPaintWithinRoot(this)) | 1128 if (!paintInfo.shouldPaintWithinRoot(this)) |
1129 return; | 1129 return; |
1130 | 1130 |
1131 LayoutRect paintRect = borderBoxRectInRegion(paintInfo.renderRegion); | 1131 LayoutRect paintRect = borderBoxRectInRegion(paintInfo.getRenderRegion()); |
1132 paintRect.moveBy(paintOffset); | 1132 paintRect.moveBy(paintOffset); |
1133 | 1133 |
1134 BackgroundBleedAvoidance bleedAvoidance = determineBackgroundBleedAvoidance(
paintInfo.context); | 1134 BackgroundBleedAvoidance bleedAvoidance = determineBackgroundBleedAvoidance(
paintInfo.getContext()); |
1135 | 1135 |
1136 // FIXME: Should eventually give the theme control over whether the box shad
ow should paint, since controls could have | 1136 // FIXME: Should eventually give the theme control over whether the box shad
ow should paint, since controls could have |
1137 // custom shadows of their own. | 1137 // custom shadows of their own. |
1138 if (!boxShadowShouldBeAppliedToBackground(bleedAvoidance)) | 1138 if (!boxShadowShouldBeAppliedToBackground(bleedAvoidance)) |
1139 paintBoxShadow(paintInfo, paintRect, style(), Normal); | 1139 paintBoxShadow(paintInfo, paintRect, style(), Normal); |
1140 | 1140 |
1141 GraphicsContextStateSaver stateSaver(*paintInfo.context, false); | 1141 GraphicsContextStateSaver stateSaver(*(paintInfo.getContext()), false); |
1142 if (bleedAvoidance == BackgroundBleedUseTransparencyLayer) { | 1142 if (bleedAvoidance == BackgroundBleedUseTransparencyLayer) { |
1143 // To avoid the background color bleeding out behind the border, we'll r
ender background and border | 1143 // To avoid the background color bleeding out behind the border, we'll r
ender background and border |
1144 // into a transparency layer, and then clip that in one go (which requir
es setting up the clip before | 1144 // into a transparency layer, and then clip that in one go (which requir
es setting up the clip before |
1145 // beginning the layer). | 1145 // beginning the layer). |
1146 RoundedRect border = style()->getRoundedBorderFor(paintRect, view()); | 1146 RoundedRect border = style()->getRoundedBorderFor(paintRect, view()); |
1147 stateSaver.save(); | 1147 stateSaver.save(); |
1148 paintInfo.context->clipRoundedRect(border); | 1148 paintInfo.getContext()->clipRoundedRect(border); |
1149 paintInfo.context->beginTransparencyLayer(1); | 1149 paintInfo.getContext()->beginTransparencyLayer(1); |
1150 } | 1150 } |
1151 | 1151 |
1152 // If we have a native theme appearance, paint that before painting our back
ground. | 1152 // If we have a native theme appearance, paint that before painting our back
ground. |
1153 // The theme will tell us whether or not we should also paint the CSS backgr
ound. | 1153 // The theme will tell us whether or not we should also paint the CSS backgr
ound. |
1154 IntRect snappedPaintRect(pixelSnappedIntRect(paintRect)); | 1154 IntRect snappedPaintRect(pixelSnappedIntRect(paintRect)); |
1155 bool themePainted = style()->hasAppearance() && !theme()->paint(this, paintI
nfo, snappedPaintRect); | 1155 bool themePainted = style()->hasAppearance() && !theme()->paint(this, paintI
nfo, snappedPaintRect); |
1156 if (!themePainted) { | 1156 if (!themePainted) { |
1157 if (bleedAvoidance == BackgroundBleedBackgroundOverBorder) | 1157 if (bleedAvoidance == BackgroundBleedBackgroundOverBorder) |
1158 paintBorder(paintInfo, paintRect, style(), bleedAvoidance); | 1158 paintBorder(paintInfo, paintRect, style(), bleedAvoidance); |
1159 | 1159 |
1160 paintBackground(paintInfo, paintRect, bleedAvoidance); | 1160 paintBackground(paintInfo, paintRect, bleedAvoidance); |
1161 | 1161 |
1162 if (style()->hasAppearance()) | 1162 if (style()->hasAppearance()) |
1163 theme()->paintDecorations(this, paintInfo, snappedPaintRect); | 1163 theme()->paintDecorations(this, paintInfo, snappedPaintRect); |
1164 } | 1164 } |
1165 paintBoxShadow(paintInfo, paintRect, style(), Inset); | 1165 paintBoxShadow(paintInfo, paintRect, style(), Inset); |
1166 | 1166 |
1167 // The theme will tell us whether or not we should also paint the CSS border
. | 1167 // The theme will tell us whether or not we should also paint the CSS border
. |
1168 if (bleedAvoidance != BackgroundBleedBackgroundOverBorder && (!style()->hasA
ppearance() || (!themePainted && theme()->paintBorderOnly(this, paintInfo, snapp
edPaintRect))) && style()->hasBorder()) | 1168 if (bleedAvoidance != BackgroundBleedBackgroundOverBorder && (!style()->hasA
ppearance() || (!themePainted && theme()->paintBorderOnly(this, paintInfo, snapp
edPaintRect))) && style()->hasBorder()) |
1169 paintBorder(paintInfo, paintRect, style(), bleedAvoidance); | 1169 paintBorder(paintInfo, paintRect, style(), bleedAvoidance); |
1170 | 1170 |
1171 if (bleedAvoidance == BackgroundBleedUseTransparencyLayer) | 1171 if (bleedAvoidance == BackgroundBleedUseTransparencyLayer) |
1172 paintInfo.context->endTransparencyLayer(); | 1172 paintInfo.getContext()->endTransparencyLayer(); |
1173 } | 1173 } |
1174 | 1174 |
1175 void RenderBox::paintBackground(const PaintInfo& paintInfo, const LayoutRect& pa
intRect, BackgroundBleedAvoidance bleedAvoidance) | 1175 void RenderBox::paintBackground(PaintInfo& paintInfo, const LayoutRect& paintRec
t, BackgroundBleedAvoidance bleedAvoidance) |
1176 { | 1176 { |
1177 if (isRoot()) { | 1177 if (isRoot()) { |
1178 paintRootBoxFillLayers(paintInfo); | 1178 paintRootBoxFillLayers(paintInfo); |
1179 return; | 1179 return; |
1180 } | 1180 } |
1181 if (isBody() && skipBodyBackground(this)) | 1181 if (isBody() && skipBodyBackground(this)) |
1182 return; | 1182 return; |
1183 if (backgroundIsKnownToBeObscured()) | 1183 if (backgroundIsKnownToBeObscured()) |
1184 return; | 1184 return; |
1185 paintFillLayers(paintInfo, resolveColor(CSSPropertyBackgroundColor), style()
->backgroundLayers(), paintRect, bleedAvoidance); | 1185 paintFillLayers(paintInfo, resolveColor(CSSPropertyBackgroundColor), style()
->backgroundLayers(), paintRect, bleedAvoidance); |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1326 StyleColor bgColor = resolveStyleColor(CSSPropertyBackgroundColor); | 1326 StyleColor bgColor = resolveStyleColor(CSSPropertyBackgroundColor); |
1327 if (bgColor.isValid() && bgColor.alpha() == 255) | 1327 if (bgColor.isValid() && bgColor.alpha() == 255) |
1328 return true; | 1328 return true; |
1329 } | 1329 } |
1330 | 1330 |
1331 return false; | 1331 return false; |
1332 } | 1332 } |
1333 | 1333 |
1334 void RenderBox::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset) | 1334 void RenderBox::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset) |
1335 { | 1335 { |
1336 if (!paintInfo.shouldPaintWithinRoot(this) || style()->visibility() != VISIB
LE || paintInfo.phase != PaintPhaseMask || paintInfo.context->paintingDisabled()
) | 1336 if (!paintInfo.shouldPaintWithinRoot(this) || style()->visibility() != VISIB
LE || paintInfo.getPhase() != PaintPhaseMask || paintInfo.getContext()->painting
Disabled()) |
1337 return; | 1337 return; |
1338 | 1338 |
1339 LayoutRect paintRect = LayoutRect(paintOffset, size()); | 1339 LayoutRect paintRect = LayoutRect(paintOffset, size()); |
1340 paintMaskImages(paintInfo, paintRect); | 1340 paintMaskImages(paintInfo, paintRect); |
1341 } | 1341 } |
1342 | 1342 |
1343 void RenderBox::paintMaskImages(const PaintInfo& paintInfo, const LayoutRect& pa
intRect) | 1343 void RenderBox::paintMaskImages(PaintInfo& paintInfo, const LayoutRect& paintRec
t) |
1344 { | 1344 { |
1345 // Figure out if we need to push a transparency layer to render our mask. | 1345 // Figure out if we need to push a transparency layer to render our mask. |
1346 bool pushTransparencyLayer = false; | 1346 bool pushTransparencyLayer = false; |
1347 bool compositedMask = hasLayer() && layer()->hasCompositedMask(); | 1347 bool compositedMask = hasLayer() && layer()->hasCompositedMask(); |
1348 bool flattenCompositingLayers = view()->frameView() && view()->frameView()->
paintBehavior() & PaintBehaviorFlattenCompositingLayers; | 1348 bool flattenCompositingLayers = view()->frameView() && view()->frameView()->
paintBehavior() & PaintBehaviorFlattenCompositingLayers; |
1349 CompositeOperator compositeOp = CompositeSourceOver; | 1349 CompositeOperator compositeOp = CompositeSourceOver; |
1350 | 1350 |
1351 bool allMaskImagesLoaded = true; | 1351 bool allMaskImagesLoaded = true; |
1352 | 1352 |
1353 if (!compositedMask || flattenCompositingLayers) { | 1353 if (!compositedMask || flattenCompositingLayers) { |
1354 pushTransparencyLayer = true; | 1354 pushTransparencyLayer = true; |
1355 StyleImage* maskBoxImage = style()->maskBoxImage().image(); | 1355 StyleImage* maskBoxImage = style()->maskBoxImage().image(); |
1356 const FillLayer* maskLayers = style()->maskLayers(); | 1356 const FillLayer* maskLayers = style()->maskLayers(); |
1357 | 1357 |
1358 // Don't render a masked element until all the mask images have loaded,
to prevent a flash of unmasked content. | 1358 // Don't render a masked element until all the mask images have loaded,
to prevent a flash of unmasked content. |
1359 if (maskBoxImage) | 1359 if (maskBoxImage) |
1360 allMaskImagesLoaded &= maskBoxImage->isLoaded(); | 1360 allMaskImagesLoaded &= maskBoxImage->isLoaded(); |
1361 | 1361 |
1362 if (maskLayers) | 1362 if (maskLayers) |
1363 allMaskImagesLoaded &= maskLayers->imagesAreLoaded(); | 1363 allMaskImagesLoaded &= maskLayers->imagesAreLoaded(); |
1364 | 1364 |
1365 paintInfo.context->setCompositeOperation(CompositeDestinationIn); | 1365 paintInfo.getContext()->setCompositeOperation(CompositeDestinationIn); |
1366 paintInfo.context->beginTransparencyLayer(1); | 1366 paintInfo.getContext()->beginTransparencyLayer(1); |
1367 compositeOp = CompositeSourceOver; | 1367 compositeOp = CompositeSourceOver; |
1368 } | 1368 } |
1369 | 1369 |
1370 if (allMaskImagesLoaded) { | 1370 if (allMaskImagesLoaded) { |
1371 paintFillLayers(paintInfo, Color(), style()->maskLayers(), paintRect, Ba
ckgroundBleedNone, compositeOp); | 1371 paintFillLayers(paintInfo, Color(), style()->maskLayers(), paintRect, Ba
ckgroundBleedNone, compositeOp); |
1372 paintNinePieceImage(paintInfo.context, paintRect, style(), style()->mask
BoxImage(), compositeOp); | 1372 paintNinePieceImage(paintInfo.getContext(), paintRect, style(), style()-
>maskBoxImage(), compositeOp); |
1373 } | 1373 } |
1374 | 1374 |
1375 if (pushTransparencyLayer) | 1375 if (pushTransparencyLayer) |
1376 paintInfo.context->endTransparencyLayer(); | 1376 paintInfo.getContext()->endTransparencyLayer(); |
1377 } | 1377 } |
1378 | 1378 |
1379 LayoutRect RenderBox::maskClipRect() | 1379 LayoutRect RenderBox::maskClipRect() |
1380 { | 1380 { |
1381 const NinePieceImage& maskBoxImage = style()->maskBoxImage(); | 1381 const NinePieceImage& maskBoxImage = style()->maskBoxImage(); |
1382 if (maskBoxImage.image()) { | 1382 if (maskBoxImage.image()) { |
1383 LayoutRect borderImageRect = borderBoxRect(); | 1383 LayoutRect borderImageRect = borderBoxRect(); |
1384 | 1384 |
1385 // Apply outsets to the border box. | 1385 // Apply outsets to the border box. |
1386 borderImageRect.expand(style()->maskBoxImageOutsets()); | 1386 borderImageRect.expand(style()->maskBoxImageOutsets()); |
1387 return borderImageRect; | 1387 return borderImageRect; |
1388 } | 1388 } |
1389 | 1389 |
1390 LayoutRect result; | 1390 LayoutRect result; |
1391 LayoutRect borderBox = borderBoxRect(); | 1391 LayoutRect borderBox = borderBoxRect(); |
1392 for (const FillLayer* maskLayer = style()->maskLayers(); maskLayer; maskLaye
r = maskLayer->next()) { | 1392 for (const FillLayer* maskLayer = style()->maskLayers(); maskLayer; maskLaye
r = maskLayer->next()) { |
1393 if (maskLayer->image()) { | 1393 if (maskLayer->image()) { |
1394 BackgroundImageGeometry geometry; | 1394 BackgroundImageGeometry geometry; |
1395 calculateBackgroundImageGeometry(maskLayer, borderBox, geometry); | 1395 calculateBackgroundImageGeometry(maskLayer, borderBox, geometry); |
1396 result.unite(geometry.destRect()); | 1396 result.unite(geometry.destRect()); |
1397 } | 1397 } |
1398 } | 1398 } |
1399 return result; | 1399 return result; |
1400 } | 1400 } |
1401 | 1401 |
1402 void RenderBox::paintFillLayers(const PaintInfo& paintInfo, const Color& c, cons
t FillLayer* fillLayer, const LayoutRect& rect, | 1402 void RenderBox::paintFillLayers(PaintInfo& paintInfo, const Color& c, const Fill
Layer* fillLayer, const LayoutRect& rect, |
1403 BackgroundBleedAvoidance bleedAvoidance, CompositeOperator op, RenderObject*
backgroundObject) | 1403 BackgroundBleedAvoidance bleedAvoidance, CompositeOperator op, RenderObject*
backgroundObject) |
1404 { | 1404 { |
1405 Vector<const FillLayer*, 8> layers; | 1405 Vector<const FillLayer*, 8> layers; |
1406 const FillLayer* curLayer = fillLayer; | 1406 const FillLayer* curLayer = fillLayer; |
1407 bool shouldDrawBackgroundInSeparateBuffer = false; | 1407 bool shouldDrawBackgroundInSeparateBuffer = false; |
1408 while (curLayer) { | 1408 while (curLayer) { |
1409 layers.append(curLayer); | 1409 layers.append(curLayer); |
1410 // Stop traversal when an opaque layer is encountered. | 1410 // Stop traversal when an opaque layer is encountered. |
1411 // FIXME : It would be possible for the following occlusion culling test
to be more aggressive | 1411 // FIXME : It would be possible for the following occlusion culling test
to be more aggressive |
1412 // on layers with no repeat by testing whether the image covers the layo
ut rect. | 1412 // on layers with no repeat by testing whether the image covers the layo
ut rect. |
1413 // Testing that here would imply duplicating a lot of calculations that
are currently done in | 1413 // Testing that here would imply duplicating a lot of calculations that
are currently done in |
1414 // RenderBoxModelObject::paintFillLayerExtended. A more efficient soluti
on might be to move | 1414 // RenderBoxModelObject::paintFillLayerExtended. A more efficient soluti
on might be to move |
1415 // the layer recursion into paintFillLayerExtended, or to compute the la
yer geometry here | 1415 // the layer recursion into paintFillLayerExtended, or to compute the la
yer geometry here |
1416 // and pass it down. | 1416 // and pass it down. |
1417 | 1417 |
1418 if (!shouldDrawBackgroundInSeparateBuffer && curLayer->blendMode() != Bl
endModeNormal) | 1418 if (!shouldDrawBackgroundInSeparateBuffer && curLayer->blendMode() != Bl
endModeNormal) |
1419 shouldDrawBackgroundInSeparateBuffer = true; | 1419 shouldDrawBackgroundInSeparateBuffer = true; |
1420 | 1420 |
1421 // The clipOccludesNextLayers condition must be evaluated first to avoid
short-circuiting. | 1421 // The clipOccludesNextLayers condition must be evaluated first to avoid
short-circuiting. |
1422 if (curLayer->clipOccludesNextLayers(curLayer == fillLayer) && curLayer-
>hasOpaqueImage(this) && curLayer->image()->canRender(this, style()->effectiveZo
om()) && curLayer->hasRepeatXY() && curLayer->blendMode() == BlendModeNormal) | 1422 if (curLayer->clipOccludesNextLayers(curLayer == fillLayer) && curLayer-
>hasOpaqueImage(this) && curLayer->image()->canRender(this, style()->effectiveZo
om()) && curLayer->hasRepeatXY() && curLayer->blendMode() == BlendModeNormal) |
1423 break; | 1423 break; |
1424 curLayer = curLayer->next(); | 1424 curLayer = curLayer->next(); |
1425 } | 1425 } |
1426 | 1426 |
1427 GraphicsContext* context = paintInfo.context; | 1427 GraphicsContext* context = paintInfo.getContext(); |
1428 if (!context) | 1428 if (!context) |
1429 shouldDrawBackgroundInSeparateBuffer = false; | 1429 shouldDrawBackgroundInSeparateBuffer = false; |
1430 if (shouldDrawBackgroundInSeparateBuffer) | 1430 if (shouldDrawBackgroundInSeparateBuffer) |
1431 context->beginTransparencyLayer(1); | 1431 context->beginTransparencyLayer(1); |
1432 | 1432 |
1433 Vector<const FillLayer*>::const_reverse_iterator topLayer = layers.rend(); | 1433 Vector<const FillLayer*>::const_reverse_iterator topLayer = layers.rend(); |
1434 for (Vector<const FillLayer*>::const_reverse_iterator it = layers.rbegin();
it != topLayer; ++it) | 1434 for (Vector<const FillLayer*>::const_reverse_iterator it = layers.rbegin();
it != topLayer; ++it) |
1435 paintFillLayer(paintInfo, c, *it, rect, bleedAvoidance, op, backgroundOb
ject); | 1435 paintFillLayer(paintInfo, c, *it, rect, bleedAvoidance, op, backgroundOb
ject); |
1436 | 1436 |
1437 if (shouldDrawBackgroundInSeparateBuffer) | 1437 if (shouldDrawBackgroundInSeparateBuffer) |
1438 context->endTransparencyLayer(); | 1438 context->endTransparencyLayer(); |
1439 } | 1439 } |
1440 | 1440 |
1441 void RenderBox::paintFillLayer(const PaintInfo& paintInfo, const Color& c, const
FillLayer* fillLayer, const LayoutRect& rect, | 1441 void RenderBox::paintFillLayer(PaintInfo& paintInfo, const Color& c, const FillL
ayer* fillLayer, const LayoutRect& rect, |
1442 BackgroundBleedAvoidance bleedAvoidance, CompositeOperator op, RenderObject*
backgroundObject) | 1442 BackgroundBleedAvoidance bleedAvoidance, CompositeOperator op, RenderObject*
backgroundObject) |
1443 { | 1443 { |
1444 paintFillLayerExtended(paintInfo, c, fillLayer, rect, bleedAvoidance, 0, Lay
outSize(), op, backgroundObject); | 1444 paintFillLayerExtended(paintInfo, c, fillLayer, rect, bleedAvoidance, 0, Lay
outSize(), op, backgroundObject); |
1445 } | 1445 } |
1446 | 1446 |
1447 static bool layersUseImage(WrappedImagePtr image, const FillLayer* layers) | 1447 static bool layersUseImage(WrappedImagePtr image, const FillLayer* layers) |
1448 { | 1448 { |
1449 for (const FillLayer* curLayer = layers; curLayer; curLayer = curLayer->next
()) { | 1449 for (const FillLayer* curLayer = layers; curLayer; curLayer = curLayer->next
()) { |
1450 if (curLayer->image() && image == curLayer->image()->data()) | 1450 if (curLayer->image() && image == curLayer->image()->data()) |
1451 return true; | 1451 return true; |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1513 layerRenderer->repaintRectangle(geometry.destRect()); | 1513 layerRenderer->repaintRectangle(geometry.destRect()); |
1514 if (geometry.destRect() == rendererRect) | 1514 if (geometry.destRect() == rendererRect) |
1515 return true; | 1515 return true; |
1516 } | 1516 } |
1517 } | 1517 } |
1518 return false; | 1518 return false; |
1519 } | 1519 } |
1520 | 1520 |
1521 bool RenderBox::pushContentsClip(PaintInfo& paintInfo, const LayoutPoint& accumu
latedOffset) | 1521 bool RenderBox::pushContentsClip(PaintInfo& paintInfo, const LayoutPoint& accumu
latedOffset) |
1522 { | 1522 { |
1523 if (paintInfo.phase == PaintPhaseBlockBackground || paintInfo.phase == Paint
PhaseSelfOutline || paintInfo.phase == PaintPhaseMask) | 1523 if (paintInfo.getPhase() == PaintPhaseBlockBackground || paintInfo.getPhase(
) == PaintPhaseSelfOutline || paintInfo.getPhase() == PaintPhaseMask) |
1524 return false; | 1524 return false; |
1525 | 1525 |
1526 bool isControlClip = hasControlClip(); | 1526 bool isControlClip = hasControlClip(); |
1527 bool isOverflowClip = hasOverflowClip() && !layer()->isSelfPaintingLayer(); | 1527 bool isOverflowClip = hasOverflowClip() && !layer()->isSelfPaintingLayer(); |
1528 | 1528 |
1529 if (!isControlClip && !isOverflowClip) | 1529 if (!isControlClip && !isOverflowClip) |
1530 return false; | 1530 return false; |
1531 | 1531 |
1532 if (paintInfo.phase == PaintPhaseOutline) | 1532 if (paintInfo.getPhase() == PaintPhaseOutline) { |
1533 paintInfo.phase = PaintPhaseChildOutlines; | 1533 paintInfo.setPhase(PaintPhaseChildOutlines); |
1534 else if (paintInfo.phase == PaintPhaseChildBlockBackground) { | 1534 } else if (paintInfo.getPhase() == PaintPhaseChildBlockBackground) { |
1535 paintInfo.phase = PaintPhaseBlockBackground; | 1535 paintInfo.setPhase(PaintPhaseBlockBackground); |
1536 paintObject(paintInfo, accumulatedOffset); | 1536 paintObject(paintInfo, accumulatedOffset); |
1537 paintInfo.phase = PaintPhaseChildBlockBackgrounds; | 1537 paintInfo.setPhase(PaintPhaseChildBlockBackgrounds); |
1538 } | 1538 } |
1539 IntRect clipRect = pixelSnappedIntRect(isControlClip ? controlClipRect(accum
ulatedOffset) : overflowClipRect(accumulatedOffset, paintInfo.renderRegion)); | 1539 IntRect clipRect = pixelSnappedIntRect(isControlClip ? controlClipRect(accum
ulatedOffset) : overflowClipRect(accumulatedOffset, paintInfo.getRenderRegion())
); |
1540 paintInfo.context->save(); | 1540 paintInfo.getContext()->save(); |
1541 if (style()->hasBorderRadius()) | 1541 if (style()->hasBorderRadius()) |
1542 paintInfo.context->clipRoundedRect(style()->getRoundedInnerBorderFor(Lay
outRect(accumulatedOffset, size()))); | 1542 paintInfo.getContext()->clipRoundedRect(style()->getRoundedInnerBorderFo
r(LayoutRect(accumulatedOffset, size()))); |
1543 paintInfo.context->clip(clipRect); | 1543 paintInfo.getContext()->clip(clipRect); |
1544 return true; | 1544 return true; |
1545 } | 1545 } |
1546 | 1546 |
1547 void RenderBox::popContentsClip(PaintInfo& paintInfo, PaintPhase originalPhase,
const LayoutPoint& accumulatedOffset) | 1547 void RenderBox::popContentsClip(PaintInfo& paintInfo, PaintPhase originalPhase,
const LayoutPoint& accumulatedOffset) |
1548 { | 1548 { |
1549 ASSERT(hasControlClip() || (hasOverflowClip() && !layer()->isSelfPaintingLay
er())); | 1549 ASSERT(hasControlClip() || (hasOverflowClip() && !layer()->isSelfPaintingLay
er())); |
1550 | 1550 |
1551 paintInfo.context->restore(); | 1551 paintInfo.getContext()->restore(); |
1552 if (originalPhase == PaintPhaseOutline) { | 1552 if (originalPhase == PaintPhaseOutline) { |
1553 paintInfo.phase = PaintPhaseSelfOutline; | 1553 paintInfo.setPhase(PaintPhaseSelfOutline); |
1554 paintObject(paintInfo, accumulatedOffset); | 1554 paintObject(paintInfo, accumulatedOffset); |
1555 paintInfo.phase = originalPhase; | 1555 paintInfo.setPhase(originalPhase); |
1556 } else if (originalPhase == PaintPhaseChildBlockBackground) | 1556 } else if (originalPhase == PaintPhaseChildBlockBackground) { |
1557 paintInfo.phase = originalPhase; | 1557 paintInfo.setPhase(originalPhase); |
| 1558 } |
1558 } | 1559 } |
1559 | 1560 |
1560 LayoutRect RenderBox::overflowClipRect(const LayoutPoint& location, RenderRegion
* region, OverlayScrollbarSizeRelevancy relevancy) | 1561 LayoutRect RenderBox::overflowClipRect(const LayoutPoint& location, RenderRegion
* region, OverlayScrollbarSizeRelevancy relevancy) |
1561 { | 1562 { |
1562 // FIXME: When overflow-clip (CSS3) is implemented, we'll obtain the propert
y | 1563 // FIXME: When overflow-clip (CSS3) is implemented, we'll obtain the propert
y |
1563 // here. | 1564 // here. |
1564 LayoutRect clipRect = borderBoxRectInRegion(region); | 1565 LayoutRect clipRect = borderBoxRectInRegion(region); |
1565 clipRect.setLocation(location + clipRect.location() + LayoutSize(borderLeft(
), borderTop())); | 1566 clipRect.setLocation(location + clipRect.location() + LayoutSize(borderLeft(
), borderTop())); |
1566 clipRect.setSize(clipRect.size() - LayoutSize(borderLeft() + borderRight(),
borderTop() + borderBottom())); | 1567 clipRect.setSize(clipRect.size() - LayoutSize(borderLeft() + borderRight(),
borderTop() + borderBottom())); |
1567 | 1568 |
(...skipping 3119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4687 } | 4688 } |
4688 | 4689 |
4689 if (didSplitParentAnonymousBoxes) | 4690 if (didSplitParentAnonymousBoxes) |
4690 markBoxForRelayoutAfterSplit(this); | 4691 markBoxForRelayoutAfterSplit(this); |
4691 | 4692 |
4692 ASSERT(beforeChild->parent() == this); | 4693 ASSERT(beforeChild->parent() == this); |
4693 return beforeChild; | 4694 return beforeChild; |
4694 } | 4695 } |
4695 | 4696 |
4696 } // namespace WebCore | 4697 } // namespace WebCore |
OLD | NEW |