Chromium Code Reviews| 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 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 821 } | 821 } |
| 822 | 822 |
| 823 static bool isCandidateForOpaquenessTest(RenderBox* childBox) | 823 static bool isCandidateForOpaquenessTest(RenderBox* childBox) |
| 824 { | 824 { |
| 825 RenderStyle* childStyle = childBox->style(); | 825 RenderStyle* childStyle = childBox->style(); |
| 826 if (childStyle->position() != StaticPosition && childBox->containingBlock() != childBox->parent()) | 826 if (childStyle->position() != StaticPosition && childBox->containingBlock() != childBox->parent()) |
| 827 return false; | 827 return false; |
| 828 if (!childBox->width() || !childBox->height()) | 828 if (!childBox->width() || !childBox->height()) |
| 829 return false; | 829 return false; |
| 830 if (RenderLayer* childLayer = childBox->layer()) { | 830 if (RenderLayer* childLayer = childBox->layer()) { |
| 831 // FIXME: perhaps this could be less conservative? | |
| 832 if (childLayer->compositingState() != NotComposited) | |
| 833 return false; | |
| 834 // FIXME: Deal with z-index. | 831 // FIXME: Deal with z-index. |
| 835 if (!childStyle->hasAutoZIndex()) | 832 if (!childStyle->hasAutoZIndex()) |
| 836 return false; | 833 return false; |
| 837 if (childLayer->hasTransform() || childLayer->isTransparent() || childLa yer->hasFilter()) | 834 if (childLayer->hasTransform() || childLayer->isTransparent() || childLa yer->hasFilter()) |
| 838 return false; | 835 return false; |
| 839 if (childBox->hasOverflowClip() && childStyle->hasBorderRadius()) | 836 if (childBox->hasOverflowClip() && childStyle->hasBorderRadius()) |
| 840 return false; | 837 return false; |
| 841 } | 838 } |
| 842 return true; | 839 return true; |
| 843 } | 840 } |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 916 | 913 |
| 917 void RenderBox::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset) | 914 void RenderBox::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset) |
| 918 { | 915 { |
| 919 if (!paintInfo.shouldPaintWithinRoot(this) || paintInfo.phase != PaintPhaseM ask) | 916 if (!paintInfo.shouldPaintWithinRoot(this) || paintInfo.phase != PaintPhaseM ask) |
| 920 return; | 917 return; |
| 921 | 918 |
| 922 LayoutRect paintRect = LayoutRect(paintOffset, size()); | 919 LayoutRect paintRect = LayoutRect(paintOffset, size()); |
| 923 paintMaskImages(paintInfo, paintRect); | 920 paintMaskImages(paintInfo, paintRect); |
| 924 } | 921 } |
| 925 | 922 |
| 926 void RenderBox::paintClippingMask(PaintInfo& paintInfo, const LayoutPoint& paint Offset) | 923 void RenderBox::paintClippingMask(PaintInfo& paintInfo, const LayoutPoint& paint Offset) |
|
ojan
2014/11/27 02:09:20
It looks like clipping masks depended on the compo
| |
| 927 { | 924 { |
| 928 if (!paintInfo.shouldPaintWithinRoot(this) || paintInfo.phase != PaintPhaseC lippingMask) | 925 // FIXME(sky): Remove |
| 929 return; | |
| 930 | |
| 931 if (!layer() || layer()->compositingState() != PaintsIntoOwnBacking) | |
| 932 return; | |
| 933 | |
| 934 // We should never have this state in this function. A layer with a mask | |
| 935 // should have always created its own backing if it became composited. | |
| 936 ASSERT(layer()->compositingState() != HasOwnBackingButPaintsIntoAncestor); | |
| 937 | |
| 938 LayoutRect paintRect = LayoutRect(paintOffset, size()); | |
| 939 paintInfo.context->fillRect(pixelSnappedIntRect(paintRect), Color::black); | |
| 940 } | 926 } |
| 941 | 927 |
| 942 void RenderBox::paintMaskImages(const PaintInfo& paintInfo, const LayoutRect& pa intRect) | 928 void RenderBox::paintMaskImages(const PaintInfo& paintInfo, const LayoutRect& pa intRect) |
| 943 { | 929 { |
| 944 // Figure out if we need to push a transparency layer to render our mask. | 930 // Figure out if we need to push a transparency layer to render our mask. |
| 945 bool pushTransparencyLayer = false; | 931 bool pushTransparencyLayer = false; |
| 946 bool compositedMask = hasLayer() && layer()->hasCompositedMask(); | 932 bool compositedMask = hasLayer() && layer()->hasCompositedMask(); |
| 947 bool flattenCompositingLayers = view()->frameView() && view()->frameView()-> paintBehavior() & PaintBehaviorFlattenCompositingLayers; | 933 bool flattenCompositingLayers = view()->frameView() && view()->frameView()-> paintBehavior() & PaintBehaviorFlattenCompositingLayers; |
| 948 CompositeOperator compositeOp = CompositeSourceOver; | 934 CompositeOperator compositeOp = CompositeSourceOver; |
| 949 | 935 |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1074 const LayoutPoint oldPositionFromPaintInvalidationContainer = previousPositi onFromPaintInvalidationContainer(); | 1060 const LayoutPoint oldPositionFromPaintInvalidationContainer = previousPositi onFromPaintInvalidationContainer(); |
| 1075 setPreviousPaintInvalidationRect(boundsRectForPaintInvalidation(&newPaintInv alidationContainer, &paintInvalidationState)); | 1061 setPreviousPaintInvalidationRect(boundsRectForPaintInvalidation(&newPaintInv alidationContainer, &paintInvalidationState)); |
| 1076 setPreviousPositionFromPaintInvalidationContainer(RenderLayer::positionFromP aintInvalidationContainer(this, &newPaintInvalidationContainer, &paintInvalidati onState)); | 1062 setPreviousPositionFromPaintInvalidationContainer(RenderLayer::positionFromP aintInvalidationContainer(this, &newPaintInvalidationContainer, &paintInvalidati onState)); |
| 1077 | 1063 |
| 1078 InvalidationReason reason = InvalidationNone; | 1064 InvalidationReason reason = InvalidationNone; |
| 1079 | 1065 |
| 1080 // If we are set to do a full paint invalidation that means the RenderView w ill be | 1066 // If we are set to do a full paint invalidation that means the RenderView w ill be |
| 1081 // issue paint invalidations. We can then skip issuing of paint invalidation s for the child | 1067 // issue paint invalidations. We can then skip issuing of paint invalidation s for the child |
| 1082 // renderers as they'll be covered by the RenderView. | 1068 // renderers as they'll be covered by the RenderView. |
| 1083 if (!view()->doingFullPaintInvalidation()) { | 1069 if (!view()->doingFullPaintInvalidation()) { |
| 1084 if ((onlyNeededPositionedMovementLayout() && compositingState() != Paint sIntoOwnBacking) | 1070 if (onlyNeededPositionedMovementLayout() |
| 1085 || (shouldDoFullPaintInvalidationIfSelfPaintingLayer() | 1071 || (shouldDoFullPaintInvalidationIfSelfPaintingLayer() |
| 1086 && hasLayer() | 1072 && hasLayer() |
| 1087 && layer()->isSelfPaintingLayer())) { | 1073 && layer()->isSelfPaintingLayer())) { |
| 1088 setShouldDoFullPaintInvalidation(true, MarkOnlyThis); | 1074 setShouldDoFullPaintInvalidation(true, MarkOnlyThis); |
| 1089 } | 1075 } |
| 1090 | 1076 |
| 1091 reason = RenderObject::invalidatePaintIfNeeded(newPaintInvalidationConta iner, oldPaintInvalidationRect, oldPositionFromPaintInvalidationContainer, paint InvalidationState); | 1077 reason = RenderObject::invalidatePaintIfNeeded(newPaintInvalidationConta iner, oldPaintInvalidationRect, oldPositionFromPaintInvalidationContainer, paint InvalidationState); |
| 1092 if (reason == InvalidationNone || reason == InvalidationIncremental) | 1078 if (reason == InvalidationNone || reason == InvalidationIncremental) |
| 1093 invalidatePaintForOverflowIfNeeded(); | 1079 invalidatePaintForOverflowIfNeeded(); |
| 1094 | 1080 |
| (...skipping 2414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3509 | 3495 |
| 3510 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style) | 3496 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style) |
| 3511 { | 3497 { |
| 3512 backgroundColor = style.colorIncludingFallback(CSSPropertyBackgroundColor); | 3498 backgroundColor = style.colorIncludingFallback(CSSPropertyBackgroundColor); |
| 3513 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage(); | 3499 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage(); |
| 3514 ASSERT(hasBackground == style.hasBackground()); | 3500 ASSERT(hasBackground == style.hasBackground()); |
| 3515 hasBorder = style.hasBorder(); | 3501 hasBorder = style.hasBorder(); |
| 3516 } | 3502 } |
| 3517 | 3503 |
| 3518 } // namespace blink | 3504 } // namespace blink |
| OLD | NEW |