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 1266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1277 return false; | 1277 return false; |
1278 // FIXME: box-shadow is painted while background painting. | 1278 // FIXME: box-shadow is painted while background painting. |
1279 if (style()->boxShadow()) | 1279 if (style()->boxShadow()) |
1280 return false; | 1280 return false; |
1281 LayoutRect backgroundRect; | 1281 LayoutRect backgroundRect; |
1282 if (!getBackgroundPaintedExtent(backgroundRect)) | 1282 if (!getBackgroundPaintedExtent(backgroundRect)) |
1283 return false; | 1283 return false; |
1284 return foregroundIsKnownToBeOpaqueInRect(backgroundRect, backgroundObscurati
onTestMaxDepth); | 1284 return foregroundIsKnownToBeOpaqueInRect(backgroundRect, backgroundObscurati
onTestMaxDepth); |
1285 } | 1285 } |
1286 | 1286 |
1287 bool LayoutBox::backgroundHasOpaqueTopLayer() const | |
1288 { | |
1289 const FillLayer& fillLayer = style()->backgroundLayers(); | |
1290 if (fillLayer.clip() != BorderFillBox) | |
1291 return false; | |
1292 | |
1293 // Clipped with local scrolling | |
1294 if (hasOverflowClip() && fillLayer.attachment() == LocalBackgroundAttachment
) | |
1295 return false; | |
1296 | |
1297 if (fillLayer.hasOpaqueImage(this) && fillLayer.hasRepeatXY() && fillLayer.i
mage()->canRender(*this, style()->effectiveZoom())) | |
1298 return true; | |
1299 | |
1300 // If there is only one layer and no image, check whether the background col
or is opaque | |
1301 if (!fillLayer.next() && !fillLayer.hasImage()) { | |
1302 Color bgColor = resolveColor(CSSPropertyBackgroundColor); | |
1303 if (bgColor.alpha() == 255) | |
1304 return true; | |
1305 } | |
1306 | |
1307 return false; | |
1308 } | |
1309 | |
1310 void LayoutBox::paintMask(const PaintInfo& paintInfo, const LayoutPoint& paintOf
fset) | 1287 void LayoutBox::paintMask(const PaintInfo& paintInfo, const LayoutPoint& paintOf
fset) |
1311 { | 1288 { |
1312 BoxPainter(*this).paintMask(paintInfo, paintOffset); | 1289 BoxPainter(*this).paintMask(paintInfo, paintOffset); |
1313 } | 1290 } |
1314 | 1291 |
1315 void LayoutBox::imageChanged(WrappedImagePtr image, const IntRect*) | 1292 void LayoutBox::imageChanged(WrappedImagePtr image, const IntRect*) |
1316 { | 1293 { |
1317 // TODO(chrishtr): support PaintInvalidationDelayedFull for animated border
images. | 1294 // TODO(chrishtr): support PaintInvalidationDelayedFull for animated border
images. |
1318 if ((style()->borderImage().image() && style()->borderImage().image()->data(
) == image) | 1295 if ((style()->borderImage().image() && style()->borderImage().image()->data(
) == image) |
1319 || (style()->maskBoxImage().image() && style()->maskBoxImage().image()->
data() == image)) { | 1296 || (style()->maskBoxImage().image() && style()->maskBoxImage().image()->
data() == image)) { |
(...skipping 3451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4771 bool LayoutBox::canRenderBorderImage() const | 4748 bool LayoutBox::canRenderBorderImage() const |
4772 { | 4749 { |
4773 if (!style()->hasBorderDecoration()) | 4750 if (!style()->hasBorderDecoration()) |
4774 return false; | 4751 return false; |
4775 | 4752 |
4776 StyleImage* borderImage = style()->borderImage().image(); | 4753 StyleImage* borderImage = style()->borderImage().image(); |
4777 return borderImage && borderImage->canRender(*this, style()->effectiveZoom()
) && borderImage->isLoaded(); | 4754 return borderImage && borderImage->canRender(*this, style()->effectiveZoom()
) && borderImage->isLoaded(); |
4778 } | 4755 } |
4779 | 4756 |
4780 } // namespace blink | 4757 } // namespace blink |
OLD | NEW |