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 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 914 paintMaskImages(paintInfo, paintRect); | 914 paintMaskImages(paintInfo, paintRect); |
| 915 } | 915 } |
| 916 | 916 |
| 917 void RenderBox::paintClippingMask(PaintInfo& paintInfo, const LayoutPoint& paint Offset) | 917 void RenderBox::paintClippingMask(PaintInfo& paintInfo, const LayoutPoint& paint Offset) |
| 918 { | 918 { |
| 919 // FIXME(sky): Remove | 919 // FIXME(sky): Remove |
| 920 } | 920 } |
| 921 | 921 |
| 922 void RenderBox::paintMaskImages(const PaintInfo& paintInfo, const LayoutRect& pa intRect) | 922 void RenderBox::paintMaskImages(const PaintInfo& paintInfo, const LayoutRect& pa intRect) |
| 923 { | 923 { |
| 924 // Figure out if we need to push a transparency layer to render our mask. | 924 paintFillLayers(paintInfo, Color::transparent, style()->maskLayers(), paintR ect, BackgroundBleedNone, CompositeSourceOver); |
| 925 bool pushTransparencyLayer = false; | 925 paintNinePieceImage(paintInfo.context, paintRect, style(), style()->maskBoxI mage(), CompositeSourceOver); |
|
ojan
2014/12/01 19:00:38
Do paintFillLayers and/or paintNinePieceImage ever
rafaelw
2014/12/01 19:26:11
Nope. done. Also paintFillLayer
| |
| 926 bool flattenCompositingLayers = view()->frameView() && view()->frameView()-> paintBehavior() & PaintBehaviorFlattenCompositingLayers; | |
| 927 CompositeOperator compositeOp = CompositeSourceOver; | |
| 928 | |
| 929 bool allMaskImagesLoaded = true; | |
| 930 | |
| 931 if (flattenCompositingLayers) { | |
| 932 pushTransparencyLayer = true; | |
| 933 StyleImage* maskBoxImage = style()->maskBoxImage().image(); | |
| 934 const FillLayer& maskLayers = style()->maskLayers(); | |
| 935 | |
| 936 // Don't render a masked element until all the mask images have loaded, to prevent a flash of unmasked content. | |
| 937 if (maskBoxImage) | |
| 938 allMaskImagesLoaded &= maskBoxImage->isLoaded(); | |
| 939 | |
| 940 allMaskImagesLoaded &= maskLayers.imagesAreLoaded(); | |
| 941 | |
| 942 paintInfo.context->setCompositeOperation(CompositeDestinationIn); | |
| 943 paintInfo.context->beginTransparencyLayer(1); | |
| 944 compositeOp = CompositeSourceOver; | |
| 945 } | |
| 946 | |
| 947 if (allMaskImagesLoaded) { | |
| 948 paintFillLayers(paintInfo, Color::transparent, style()->maskLayers(), pa intRect, BackgroundBleedNone, compositeOp); | |
| 949 paintNinePieceImage(paintInfo.context, paintRect, style(), style()->mask BoxImage(), compositeOp); | |
| 950 } | |
| 951 | |
| 952 if (pushTransparencyLayer) | |
| 953 paintInfo.context->endLayer(); | |
| 954 } | 926 } |
| 955 | 927 |
| 956 void RenderBox::paintFillLayers(const PaintInfo& paintInfo, const Color& c, cons t FillLayer& fillLayer, const LayoutRect& rect, | 928 void RenderBox::paintFillLayers(const PaintInfo& paintInfo, const Color& c, cons t FillLayer& fillLayer, const LayoutRect& rect, |
| 957 BackgroundBleedAvoidance bleedAvoidance, CompositeOperator op, RenderObject* backgroundObject) | 929 BackgroundBleedAvoidance bleedAvoidance, CompositeOperator op, RenderObject* backgroundObject) |
| 958 { | 930 { |
| 959 Vector<const FillLayer*, 8> layers; | 931 Vector<const FillLayer*, 8> layers; |
| 960 const FillLayer* curLayer = &fillLayer; | 932 const FillLayer* curLayer = &fillLayer; |
| 961 bool shouldDrawBackgroundInSeparateBuffer = false; | 933 bool shouldDrawBackgroundInSeparateBuffer = false; |
| 962 bool isBottomLayerOccluded = false; | 934 bool isBottomLayerOccluded = false; |
| 963 while (curLayer) { | 935 while (curLayer) { |
| (...skipping 2524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3488 | 3460 |
| 3489 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style) | 3461 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style) |
| 3490 { | 3462 { |
| 3491 backgroundColor = style.colorIncludingFallback(CSSPropertyBackgroundColor); | 3463 backgroundColor = style.colorIncludingFallback(CSSPropertyBackgroundColor); |
| 3492 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage(); | 3464 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage(); |
| 3493 ASSERT(hasBackground == style.hasBackground()); | 3465 ASSERT(hasBackground == style.hasBackground()); |
| 3494 hasBorder = style.hasBorder(); | 3466 hasBorder = style.hasBorder(); |
| 3495 } | 3467 } |
| 3496 | 3468 |
| 3497 } // namespace blink | 3469 } // namespace blink |
| OLD | NEW |