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