Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(222)

Side by Side Diff: Source/core/rendering/RenderBox.cpp

Issue 381473002: Use reference for FillLayer if possible (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/RenderBox.h ('k') | Source/core/rendering/RenderBoxModelObject.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after
1096 child->paint(childInfo, adjustedPaintOffset); 1096 child->paint(childInfo, adjustedPaintOffset);
1097 } 1097 }
1098 1098
1099 void RenderBox::paintRootBoxFillLayers(const PaintInfo& paintInfo) 1099 void RenderBox::paintRootBoxFillLayers(const PaintInfo& paintInfo)
1100 { 1100 {
1101 if (paintInfo.skipRootBackground()) 1101 if (paintInfo.skipRootBackground())
1102 return; 1102 return;
1103 1103
1104 RenderObject* rootBackgroundRenderer = rendererForRootBackground(); 1104 RenderObject* rootBackgroundRenderer = rendererForRootBackground();
1105 1105
1106 const FillLayer* bgLayer = rootBackgroundRenderer->style()->backgroundLayers (); 1106 const FillLayer& bgLayer = rootBackgroundRenderer->style()->backgroundLayers ();
1107 Color bgColor = rootBackgroundRenderer->resolveColor(CSSPropertyBackgroundCo lor); 1107 Color bgColor = rootBackgroundRenderer->resolveColor(CSSPropertyBackgroundCo lor);
1108 1108
1109 paintFillLayers(paintInfo, bgColor, bgLayer, view()->backgroundRect(this), B ackgroundBleedNone, CompositeSourceOver, rootBackgroundRenderer); 1109 paintFillLayers(paintInfo, bgColor, bgLayer, view()->backgroundRect(this), B ackgroundBleedNone, CompositeSourceOver, rootBackgroundRenderer);
1110 } 1110 }
1111 1111
1112 BackgroundBleedAvoidance RenderBox::determineBackgroundBleedAvoidance(GraphicsCo ntext* context) const 1112 BackgroundBleedAvoidance RenderBox::determineBackgroundBleedAvoidance(GraphicsCo ntext* context) const
1113 { 1113 {
1114 if (context->paintingDisabled()) 1114 if (context->paintingDisabled())
1115 return BackgroundBleedNone; 1115 return BackgroundBleedNone;
1116 1116
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
1209 { 1209 {
1210 ASSERT(hasBackground()); 1210 ASSERT(hasBackground());
1211 LayoutRect backgroundRect = pixelSnappedIntRect(borderBoxRect()); 1211 LayoutRect backgroundRect = pixelSnappedIntRect(borderBoxRect());
1212 1212
1213 Color backgroundColor = resolveColor(CSSPropertyBackgroundColor); 1213 Color backgroundColor = resolveColor(CSSPropertyBackgroundColor);
1214 if (backgroundColor.alpha()) { 1214 if (backgroundColor.alpha()) {
1215 paintedExtent = backgroundRect; 1215 paintedExtent = backgroundRect;
1216 return true; 1216 return true;
1217 } 1217 }
1218 1218
1219 if (!style()->backgroundLayers()->image() || style()->backgroundLayers()->ne xt()) { 1219 if (!style()->backgroundLayers().image() || style()->backgroundLayers().next ()) {
1220 paintedExtent = backgroundRect; 1220 paintedExtent = backgroundRect;
1221 return true; 1221 return true;
1222 } 1222 }
1223 1223
1224 BackgroundImageGeometry geometry; 1224 BackgroundImageGeometry geometry;
1225 calculateBackgroundImageGeometry(0, style()->backgroundLayers(), backgroundR ect, geometry); 1225 calculateBackgroundImageGeometry(0, style()->backgroundLayers(), backgroundR ect, geometry);
1226 if (geometry.hasNonLocalGeometry()) 1226 if (geometry.hasNonLocalGeometry())
1227 return false; 1227 return false;
1228 paintedExtent = geometry.destRect(); 1228 paintedExtent = geometry.destRect();
1229 return true; 1229 return true;
(...skipping 13 matching lines...) Expand all
1243 // In this case it is safe to not assume opaqueness. 1243 // In this case it is safe to not assume opaqueness.
1244 // FIXME: May be ask theme if it paints opaque. 1244 // FIXME: May be ask theme if it paints opaque.
1245 if (style()->hasAppearance()) 1245 if (style()->hasAppearance())
1246 return false; 1246 return false;
1247 // FIXME: Check the opaqueness of background images. 1247 // FIXME: Check the opaqueness of background images.
1248 1248
1249 // FIXME: Use rounded rect if border radius is present. 1249 // FIXME: Use rounded rect if border radius is present.
1250 if (style()->hasBorderRadius()) 1250 if (style()->hasBorderRadius())
1251 return false; 1251 return false;
1252 // FIXME: The background color clip is defined by the last layer. 1252 // FIXME: The background color clip is defined by the last layer.
1253 if (style()->backgroundLayers()->next()) 1253 if (style()->backgroundLayers().next())
1254 return false; 1254 return false;
1255 LayoutRect backgroundRect; 1255 LayoutRect backgroundRect;
1256 switch (style()->backgroundClip()) { 1256 switch (style()->backgroundClip()) {
1257 case BorderFillBox: 1257 case BorderFillBox:
1258 backgroundRect = borderBoxRect(); 1258 backgroundRect = borderBoxRect();
1259 break; 1259 break;
1260 case PaddingFillBox: 1260 case PaddingFillBox:
1261 backgroundRect = paddingBoxRect(); 1261 backgroundRect = paddingBoxRect();
1262 break; 1262 break;
1263 case ContentFillBox: 1263 case ContentFillBox:
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
1337 if (style()->boxShadow()) 1337 if (style()->boxShadow())
1338 return false; 1338 return false;
1339 LayoutRect backgroundRect; 1339 LayoutRect backgroundRect;
1340 if (!getBackgroundPaintedExtent(backgroundRect)) 1340 if (!getBackgroundPaintedExtent(backgroundRect))
1341 return false; 1341 return false;
1342 return foregroundIsKnownToBeOpaqueInRect(backgroundRect, backgroundObscurati onTestMaxDepth); 1342 return foregroundIsKnownToBeOpaqueInRect(backgroundRect, backgroundObscurati onTestMaxDepth);
1343 } 1343 }
1344 1344
1345 bool RenderBox::backgroundHasOpaqueTopLayer() const 1345 bool RenderBox::backgroundHasOpaqueTopLayer() const
1346 { 1346 {
1347 const FillLayer* fillLayer = style()->backgroundLayers(); 1347 const FillLayer& fillLayer = style()->backgroundLayers();
1348 if (!fillLayer || fillLayer->clip() != BorderFillBox) 1348 if (fillLayer.clip() != BorderFillBox)
1349 return false; 1349 return false;
1350 1350
1351 // Clipped with local scrolling 1351 // Clipped with local scrolling
1352 if (hasOverflowClip() && fillLayer->attachment() == LocalBackgroundAttachmen t) 1352 if (hasOverflowClip() && fillLayer.attachment() == LocalBackgroundAttachment )
1353 return false; 1353 return false;
1354 1354
1355 if (fillLayer->hasOpaqueImage(this) && fillLayer->hasRepeatXY() && fillLayer ->image()->canRender(*this, style()->effectiveZoom())) 1355 if (fillLayer.hasOpaqueImage(this) && fillLayer.hasRepeatXY() && fillLayer.i mage()->canRender(*this, style()->effectiveZoom()))
1356 return true; 1356 return true;
1357 1357
1358 // If there is only one layer and no image, check whether the background col or is opaque 1358 // If there is only one layer and no image, check whether the background col or is opaque
1359 if (!fillLayer->next() && !fillLayer->hasImage()) { 1359 if (!fillLayer.next() && !fillLayer.hasImage()) {
1360 Color bgColor = resolveColor(CSSPropertyBackgroundColor); 1360 Color bgColor = resolveColor(CSSPropertyBackgroundColor);
1361 if (bgColor.alpha() == 255) 1361 if (bgColor.alpha() == 255)
1362 return true; 1362 return true;
1363 } 1363 }
1364 1364
1365 return false; 1365 return false;
1366 } 1366 }
1367 1367
1368 void RenderBox::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset) 1368 void RenderBox::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
1369 { 1369 {
(...skipping 26 matching lines...) Expand all
1396 bool pushTransparencyLayer = false; 1396 bool pushTransparencyLayer = false;
1397 bool compositedMask = hasLayer() && layer()->hasCompositedMask(); 1397 bool compositedMask = hasLayer() && layer()->hasCompositedMask();
1398 bool flattenCompositingLayers = view()->frameView() && view()->frameView()-> paintBehavior() & PaintBehaviorFlattenCompositingLayers; 1398 bool flattenCompositingLayers = view()->frameView() && view()->frameView()-> paintBehavior() & PaintBehaviorFlattenCompositingLayers;
1399 CompositeOperator compositeOp = CompositeSourceOver; 1399 CompositeOperator compositeOp = CompositeSourceOver;
1400 1400
1401 bool allMaskImagesLoaded = true; 1401 bool allMaskImagesLoaded = true;
1402 1402
1403 if (!compositedMask || flattenCompositingLayers) { 1403 if (!compositedMask || flattenCompositingLayers) {
1404 pushTransparencyLayer = true; 1404 pushTransparencyLayer = true;
1405 StyleImage* maskBoxImage = style()->maskBoxImage().image(); 1405 StyleImage* maskBoxImage = style()->maskBoxImage().image();
1406 const FillLayer* maskLayers = style()->maskLayers(); 1406 const FillLayer& maskLayers = style()->maskLayers();
1407 1407
1408 // Don't render a masked element until all the mask images have loaded, to prevent a flash of unmasked content. 1408 // Don't render a masked element until all the mask images have loaded, to prevent a flash of unmasked content.
1409 if (maskBoxImage) 1409 if (maskBoxImage)
1410 allMaskImagesLoaded &= maskBoxImage->isLoaded(); 1410 allMaskImagesLoaded &= maskBoxImage->isLoaded();
1411 1411
1412 if (maskLayers) 1412 allMaskImagesLoaded &= maskLayers.imagesAreLoaded();
1413 allMaskImagesLoaded &= maskLayers->imagesAreLoaded();
1414 1413
1415 paintInfo.context->setCompositeOperation(CompositeDestinationIn); 1414 paintInfo.context->setCompositeOperation(CompositeDestinationIn);
1416 paintInfo.context->beginTransparencyLayer(1); 1415 paintInfo.context->beginTransparencyLayer(1);
1417 compositeOp = CompositeSourceOver; 1416 compositeOp = CompositeSourceOver;
1418 } 1417 }
1419 1418
1420 if (allMaskImagesLoaded) { 1419 if (allMaskImagesLoaded) {
1421 paintFillLayers(paintInfo, Color::transparent, style()->maskLayers(), pa intRect, BackgroundBleedNone, compositeOp); 1420 paintFillLayers(paintInfo, Color::transparent, style()->maskLayers(), pa intRect, BackgroundBleedNone, compositeOp);
1422 paintNinePieceImage(paintInfo.context, paintRect, style(), style()->mask BoxImage(), compositeOp); 1421 paintNinePieceImage(paintInfo.context, paintRect, style(), style()->mask BoxImage(), compositeOp);
1423 } 1422 }
1424 1423
1425 if (pushTransparencyLayer) 1424 if (pushTransparencyLayer)
1426 paintInfo.context->endLayer(); 1425 paintInfo.context->endLayer();
1427 } 1426 }
1428 1427
1429 void RenderBox::paintFillLayers(const PaintInfo& paintInfo, const Color& c, cons t FillLayer* fillLayer, const LayoutRect& rect, 1428 void RenderBox::paintFillLayers(const PaintInfo& paintInfo, const Color& c, cons t FillLayer& fillLayer, const LayoutRect& rect,
1430 BackgroundBleedAvoidance bleedAvoidance, CompositeOperator op, RenderObject* backgroundObject) 1429 BackgroundBleedAvoidance bleedAvoidance, CompositeOperator op, RenderObject* backgroundObject)
1431 { 1430 {
1432 Vector<const FillLayer*, 8> layers; 1431 Vector<const FillLayer*, 8> layers;
1433 const FillLayer* curLayer = fillLayer; 1432 const FillLayer* curLayer = &fillLayer;
1434 bool shouldDrawBackgroundInSeparateBuffer = false; 1433 bool shouldDrawBackgroundInSeparateBuffer = false;
1435 while (curLayer) { 1434 while (curLayer) {
1436 layers.append(curLayer); 1435 layers.append(curLayer);
1437 // Stop traversal when an opaque layer is encountered. 1436 // Stop traversal when an opaque layer is encountered.
1438 // FIXME : It would be possible for the following occlusion culling test to be more aggressive 1437 // FIXME : It would be possible for the following occlusion culling test to be more aggressive
1439 // on layers with no repeat by testing whether the image covers the layo ut rect. 1438 // on layers with no repeat by testing whether the image covers the layo ut rect.
1440 // Testing that here would imply duplicating a lot of calculations that are currently done in 1439 // Testing that here would imply duplicating a lot of calculations that are currently done in
1441 // RenderBoxModelObject::paintFillLayerExtended. A more efficient soluti on might be to move 1440 // RenderBoxModelObject::paintFillLayerExtended. A more efficient soluti on might be to move
1442 // the layer recursion into paintFillLayerExtended, or to compute the la yer geometry here 1441 // the layer recursion into paintFillLayerExtended, or to compute the la yer geometry here
1443 // and pass it down. 1442 // and pass it down.
1444 1443
1445 if (!shouldDrawBackgroundInSeparateBuffer && curLayer->blendMode() != bl ink::WebBlendModeNormal) 1444 if (!shouldDrawBackgroundInSeparateBuffer && curLayer->blendMode() != bl ink::WebBlendModeNormal)
1446 shouldDrawBackgroundInSeparateBuffer = true; 1445 shouldDrawBackgroundInSeparateBuffer = true;
1447 1446
1448 // The clipOccludesNextLayers condition must be evaluated first to avoid short-circuiting. 1447 // The clipOccludesNextLayers condition must be evaluated first to avoid short-circuiting.
1449 if (curLayer->clipOccludesNextLayers(curLayer == fillLayer) && curLayer- >hasOpaqueImage(this) && curLayer->image()->canRender(*this, style()->effectiveZ oom()) && curLayer->hasRepeatXY() && curLayer->blendMode() == blink::WebBlendMod eNormal && !boxShadowShouldBeAppliedToBackground(bleedAvoidance)) 1448 if (curLayer->clipOccludesNextLayers(curLayer == &fillLayer) && curLayer ->hasOpaqueImage(this) && curLayer->image()->canRender(*this, style()->effective Zoom()) && curLayer->hasRepeatXY() && curLayer->blendMode() == blink::WebBlendMo deNormal && !boxShadowShouldBeAppliedToBackground(bleedAvoidance))
1450 break; 1449 break;
1451 curLayer = curLayer->next(); 1450 curLayer = curLayer->next();
1452 } 1451 }
1453 1452
1454 GraphicsContext* context = paintInfo.context; 1453 GraphicsContext* context = paintInfo.context;
1455 if (!context) 1454 if (!context)
1456 shouldDrawBackgroundInSeparateBuffer = false; 1455 shouldDrawBackgroundInSeparateBuffer = false;
1457 if (shouldDrawBackgroundInSeparateBuffer) 1456 if (shouldDrawBackgroundInSeparateBuffer)
1458 context->beginTransparencyLayer(1); 1457 context->beginTransparencyLayer(1);
1459 1458
1460 Vector<const FillLayer*>::const_reverse_iterator topLayer = layers.rend(); 1459 Vector<const FillLayer*>::const_reverse_iterator topLayer = layers.rend();
1461 for (Vector<const FillLayer*>::const_reverse_iterator it = layers.rbegin(); it != topLayer; ++it) 1460 for (Vector<const FillLayer*>::const_reverse_iterator it = layers.rbegin(); it != topLayer; ++it)
1462 paintFillLayer(paintInfo, c, *it, rect, bleedAvoidance, op, backgroundOb ject); 1461 paintFillLayer(paintInfo, c, **it, rect, bleedAvoidance, op, backgroundO bject);
1463 1462
1464 if (shouldDrawBackgroundInSeparateBuffer) 1463 if (shouldDrawBackgroundInSeparateBuffer)
1465 context->endLayer(); 1464 context->endLayer();
1466 } 1465 }
1467 1466
1468 void RenderBox::paintFillLayer(const PaintInfo& paintInfo, const Color& c, const FillLayer* fillLayer, const LayoutRect& rect, 1467 void RenderBox::paintFillLayer(const PaintInfo& paintInfo, const Color& c, const FillLayer& fillLayer, const LayoutRect& rect,
1469 BackgroundBleedAvoidance bleedAvoidance, CompositeOperator op, RenderObject* backgroundObject) 1468 BackgroundBleedAvoidance bleedAvoidance, CompositeOperator op, RenderObject* backgroundObject)
1470 { 1469 {
1471 paintFillLayerExtended(paintInfo, c, fillLayer, rect, bleedAvoidance, 0, Lay outSize(), op, backgroundObject); 1470 paintFillLayerExtended(paintInfo, c, fillLayer, rect, bleedAvoidance, 0, Lay outSize(), op, backgroundObject);
1472 } 1471 }
1473 1472
1474 void RenderBox::imageChanged(WrappedImagePtr image, const IntRect*) 1473 void RenderBox::imageChanged(WrappedImagePtr image, const IntRect*)
1475 { 1474 {
1476 if (!parent()) 1475 if (!parent())
1477 return; 1476 return;
1478 1477
1479 AllowPaintInvalidationScope scoper(frameView()); 1478 AllowPaintInvalidationScope scoper(frameView());
1480 1479
1481 if ((style()->borderImage().image() && style()->borderImage().image()->data( ) == image) || 1480 if ((style()->borderImage().image() && style()->borderImage().image()->data( ) == image) ||
1482 (style()->maskBoxImage().image() && style()->maskBoxImage().image()->dat a() == image)) { 1481 (style()->maskBoxImage().image() && style()->maskBoxImage().image()->dat a() == image)) {
1483 paintInvalidationForWholeRenderer(); 1482 paintInvalidationForWholeRenderer();
1484 return; 1483 return;
1485 } 1484 }
1486 1485
1487 ShapeValue* shapeOutsideValue = style()->shapeOutside(); 1486 ShapeValue* shapeOutsideValue = style()->shapeOutside();
1488 if (!frameView()->isInPerformLayout() && isFloating() && shapeOutsideValue & & shapeOutsideValue->image() && shapeOutsideValue->image()->data() == image) { 1487 if (!frameView()->isInPerformLayout() && isFloating() && shapeOutsideValue & & shapeOutsideValue->image() && shapeOutsideValue->image()->data() == image) {
1489 ShapeOutsideInfo::ensureInfo(*this).markShapeAsDirty(); 1488 ShapeOutsideInfo::ensureInfo(*this).markShapeAsDirty();
1490 markShapeOutsideDependentsForLayout(); 1489 markShapeOutsideDependentsForLayout();
1491 } 1490 }
1492 1491
1493 bool didFullRepaint = repaintLayerRectsForImage(image, style()->backgroundLa yers(), true); 1492 bool didFullRepaint = repaintLayerRectsForImage(image, style()->backgroundLa yers(), true);
1494 if (!didFullRepaint) 1493 if (!didFullRepaint)
1495 repaintLayerRectsForImage(image, style()->maskLayers(), false); 1494 repaintLayerRectsForImage(image, style()->maskLayers(), false);
1496 } 1495 }
1497 1496
1498 bool RenderBox::repaintLayerRectsForImage(WrappedImagePtr image, const FillLayer * layers, bool drawingBackground) 1497 bool RenderBox::repaintLayerRectsForImage(WrappedImagePtr image, const FillLayer & layers, bool drawingBackground)
1499 { 1498 {
1500 LayoutRect rendererRect; 1499 LayoutRect rendererRect;
1501 RenderBox* layerRenderer = 0; 1500 RenderBox* layerRenderer = 0;
1502 1501
1503 for (const FillLayer* curLayer = layers; curLayer; curLayer = curLayer->next ()) { 1502 for (const FillLayer* curLayer = &layers; curLayer; curLayer = curLayer->nex t()) {
1504 if (curLayer->image() && image == curLayer->image()->data() && curLayer- >image()->canRender(*this, style()->effectiveZoom())) { 1503 if (curLayer->image() && image == curLayer->image()->data() && curLayer- >image()->canRender(*this, style()->effectiveZoom())) {
1505 // Now that we know this image is being used, compute the renderer a nd the rect if we haven't already. 1504 // Now that we know this image is being used, compute the renderer a nd the rect if we haven't already.
1506 if (!layerRenderer) { 1505 if (!layerRenderer) {
1507 bool drawingRootBackground = drawingBackground && (isDocumentEle ment() || (isBody() && !document().documentElement()->renderer()->hasBackground( ))); 1506 bool drawingRootBackground = drawingBackground && (isDocumentEle ment() || (isBody() && !document().documentElement()->renderer()->hasBackground( )));
1508 if (drawingRootBackground) { 1507 if (drawingRootBackground) {
1509 layerRenderer = view(); 1508 layerRenderer = view();
1510 1509
1511 LayoutUnit rw; 1510 LayoutUnit rw;
1512 LayoutUnit rh; 1511 LayoutUnit rh;
1513 1512
1514 if (FrameView* frameView = toRenderView(layerRenderer)->fram eView()) { 1513 if (FrameView* frameView = toRenderView(layerRenderer)->fram eView()) {
1515 rw = frameView->contentsWidth(); 1514 rw = frameView->contentsWidth();
1516 rh = frameView->contentsHeight(); 1515 rh = frameView->contentsHeight();
1517 } else { 1516 } else {
1518 rw = layerRenderer->width(); 1517 rw = layerRenderer->width();
1519 rh = layerRenderer->height(); 1518 rh = layerRenderer->height();
1520 } 1519 }
1521 rendererRect = LayoutRect(-layerRenderer->marginLeft(), 1520 rendererRect = LayoutRect(-layerRenderer->marginLeft(),
1522 -layerRenderer->marginTop(), 1521 -layerRenderer->marginTop(),
1523 std::max(layerRenderer->width() + layerRenderer->marginW idth() + layerRenderer->borderLeft() + layerRenderer->borderRight(), rw), 1522 std::max(layerRenderer->width() + layerRenderer->marginW idth() + layerRenderer->borderLeft() + layerRenderer->borderRight(), rw),
1524 std::max(layerRenderer->height() + layerRenderer->margin Height() + layerRenderer->borderTop() + layerRenderer->borderBottom(), rh)); 1523 std::max(layerRenderer->height() + layerRenderer->margin Height() + layerRenderer->borderTop() + layerRenderer->borderBottom(), rh));
1525 } else { 1524 } else {
1526 layerRenderer = this; 1525 layerRenderer = this;
1527 rendererRect = borderBoxRect(); 1526 rendererRect = borderBoxRect();
1528 } 1527 }
1529 } 1528 }
1530 1529
1531 BackgroundImageGeometry geometry; 1530 BackgroundImageGeometry geometry;
1532 layerRenderer->calculateBackgroundImageGeometry(0, curLayer, rendere rRect, geometry); 1531 layerRenderer->calculateBackgroundImageGeometry(0, *curLayer, render erRect, geometry);
1533 if (geometry.hasNonLocalGeometry()) { 1532 if (geometry.hasNonLocalGeometry()) {
1534 // Rather than incur the costs of computing the paintContainer f or renderers with fixed backgrounds 1533 // Rather than incur the costs of computing the paintContainer f or renderers with fixed backgrounds
1535 // in order to get the right destRect, just repaint the entire r enderer. 1534 // in order to get the right destRect, just repaint the entire r enderer.
1536 layerRenderer->paintInvalidationForWholeRenderer(); 1535 layerRenderer->paintInvalidationForWholeRenderer();
1537 return true; 1536 return true;
1538 } 1537 }
1539 1538
1540 layerRenderer->invalidatePaintRectangle(geometry.destRect()); 1539 layerRenderer->invalidatePaintRectangle(geometry.destRect());
1541 if (geometry.destRect() == rendererRect) 1540 if (geometry.destRect() == rendererRect)
1542 return true; 1541 return true;
(...skipping 3104 matching lines...) Expand 10 before | Expand all | Expand 10 after
4647 return 0; 4646 return 0;
4648 4647
4649 if (!layoutState && !flowThreadContainingBlock()) 4648 if (!layoutState && !flowThreadContainingBlock())
4650 return 0; 4649 return 0;
4651 4650
4652 RenderBlock* containerBlock = containingBlock(); 4651 RenderBlock* containerBlock = containingBlock();
4653 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); 4652 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop();
4654 } 4653 }
4655 4654
4656 } // namespace WebCore 4655 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBox.h ('k') | Source/core/rendering/RenderBoxModelObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698