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 1234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1245 static bool isCandidateForOpaquenessTest(RenderBox* childBox) | 1245 static bool isCandidateForOpaquenessTest(RenderBox* childBox) |
1246 { | 1246 { |
1247 RenderStyle* childStyle = childBox->style(); | 1247 RenderStyle* childStyle = childBox->style(); |
1248 if (childStyle->position() != StaticPosition && childBox->containingBlock()
!= childBox->parent()) | 1248 if (childStyle->position() != StaticPosition && childBox->containingBlock()
!= childBox->parent()) |
1249 return false; | 1249 return false; |
1250 if (childStyle->visibility() != VISIBLE || childStyle->shapeOutside()) | 1250 if (childStyle->visibility() != VISIBLE || childStyle->shapeOutside()) |
1251 return false; | 1251 return false; |
1252 if (!childBox->width() || !childBox->height()) | 1252 if (!childBox->width() || !childBox->height()) |
1253 return false; | 1253 return false; |
1254 if (RenderLayer* childLayer = childBox->layer()) { | 1254 if (RenderLayer* childLayer = childBox->layer()) { |
1255 if (childLayer->isComposited()) | 1255 // FIXME: perhaps this could be less conservative? |
| 1256 if (childLayer->compositingState() != NotComposited) |
1256 return false; | 1257 return false; |
1257 // FIXME: Deal with z-index. | 1258 // FIXME: Deal with z-index. |
1258 if (!childStyle->hasAutoZIndex()) | 1259 if (!childStyle->hasAutoZIndex()) |
1259 return false; | 1260 return false; |
1260 if (childLayer->hasTransform() || childLayer->isTransparent() || childLa
yer->hasFilter()) | 1261 if (childLayer->hasTransform() || childLayer->isTransparent() || childLa
yer->hasFilter()) |
1261 return false; | 1262 return false; |
1262 } | 1263 } |
1263 return true; | 1264 return true; |
1264 } | 1265 } |
1265 | 1266 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1340 | 1341 |
1341 LayoutRect paintRect = LayoutRect(paintOffset, size()); | 1342 LayoutRect paintRect = LayoutRect(paintOffset, size()); |
1342 paintMaskImages(paintInfo, paintRect); | 1343 paintMaskImages(paintInfo, paintRect); |
1343 } | 1344 } |
1344 | 1345 |
1345 void RenderBox::paintClippingMask(PaintInfo& paintInfo, const LayoutPoint& paint
Offset) | 1346 void RenderBox::paintClippingMask(PaintInfo& paintInfo, const LayoutPoint& paint
Offset) |
1346 { | 1347 { |
1347 if (!paintInfo.shouldPaintWithinRoot(this) || style()->visibility() != VISIB
LE || paintInfo.phase != PaintPhaseClippingMask || paintInfo.context->paintingDi
sabled()) | 1348 if (!paintInfo.shouldPaintWithinRoot(this) || style()->visibility() != VISIB
LE || paintInfo.phase != PaintPhaseClippingMask || paintInfo.context->paintingDi
sabled()) |
1348 return; | 1349 return; |
1349 | 1350 |
1350 if (!layer() || !layer()->isComposited()) | 1351 if (!layer() || layer()->compositingState() != PaintsIntoOwnBacking) |
1351 return; | 1352 return; |
1352 | 1353 |
| 1354 // We should never have this state in this function. A layer with a mask |
| 1355 // should have always created its own backing if it became composited. |
| 1356 ASSERT(layer()->compositingState() != HasOwnBackingButPaintsIntoAncestor); |
| 1357 |
1353 LayoutRect paintRect = LayoutRect(paintOffset, size()); | 1358 LayoutRect paintRect = LayoutRect(paintOffset, size()); |
1354 paintInfo.context->fillRect(pixelSnappedIntRect(paintRect), Color::black); | 1359 paintInfo.context->fillRect(pixelSnappedIntRect(paintRect), Color::black); |
1355 } | 1360 } |
1356 | 1361 |
1357 void RenderBox::paintMaskImages(const PaintInfo& paintInfo, const LayoutRect& pa
intRect) | 1362 void RenderBox::paintMaskImages(const PaintInfo& paintInfo, const LayoutRect& pa
intRect) |
1358 { | 1363 { |
1359 // Figure out if we need to push a transparency layer to render our mask. | 1364 // Figure out if we need to push a transparency layer to render our mask. |
1360 bool pushTransparencyLayer = false; | 1365 bool pushTransparencyLayer = false; |
1361 bool compositedMask = hasLayer() && layer()->hasCompositedMask(); | 1366 bool compositedMask = hasLayer() && layer()->hasCompositedMask(); |
1362 bool flattenCompositingLayers = view()->frameView() && view()->frameView()->
paintBehavior() & PaintBehaviorFlattenCompositingLayers; | 1367 bool flattenCompositingLayers = view()->frameView() && view()->frameView()->
paintBehavior() & PaintBehaviorFlattenCompositingLayers; |
(...skipping 3420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4783 return 0; | 4788 return 0; |
4784 | 4789 |
4785 if (!layoutState && !flowThreadContainingBlock()) | 4790 if (!layoutState && !flowThreadContainingBlock()) |
4786 return 0; | 4791 return 0; |
4787 | 4792 |
4788 RenderBlock* containerBlock = containingBlock(); | 4793 RenderBlock* containerBlock = containingBlock(); |
4789 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); | 4794 return containerBlock->offsetFromLogicalTopOfFirstPage() + logicalTop(); |
4790 } | 4795 } |
4791 | 4796 |
4792 } // namespace WebCore | 4797 } // namespace WebCore |
OLD | NEW |