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