| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef BoxPainter_h | 5 #ifndef BoxPainter_h |
| 6 #define BoxPainter_h | 6 #define BoxPainter_h |
| 7 | 7 |
| 8 #include "core/layout/LayoutBoxModelObject.h" | 8 #include "core/layout/LayoutBoxModelObject.h" |
| 9 #include "core/paint/ObjectPainter.h" | 9 #include "core/paint/ObjectPainter.h" |
| 10 #include "wtf/Allocator.h" | 10 #include "wtf/Allocator.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 void paintBoxDecorationBackground(const PaintInfo&, const LayoutPoint&); | 27 void paintBoxDecorationBackground(const PaintInfo&, const LayoutPoint&); |
| 28 void paintMask(const PaintInfo&, const LayoutPoint&); | 28 void paintMask(const PaintInfo&, const LayoutPoint&); |
| 29 void paintClippingMask(const PaintInfo&, const LayoutPoint&); | 29 void paintClippingMask(const PaintInfo&, const LayoutPoint&); |
| 30 | 30 |
| 31 typedef Vector<const FillLayer*, 8> FillLayerOcclusionOutputList; | 31 typedef Vector<const FillLayer*, 8> FillLayerOcclusionOutputList; |
| 32 // Returns true if the result fill layers have non-associative blending or c
ompositing mode. | 32 // Returns true if the result fill layers have non-associative blending or c
ompositing mode. |
| 33 // (i.e. The rendering will be different without creating isolation group by
context.saveLayer().) | 33 // (i.e. The rendering will be different without creating isolation group by
context.saveLayer().) |
| 34 // Note that the output list will be in top-bottom order. | 34 // Note that the output list will be in top-bottom order. |
| 35 bool calculateFillLayerOcclusionCulling(FillLayerOcclusionOutputList &revers
edPaintList, const FillLayer&); | 35 bool calculateFillLayerOcclusionCulling(FillLayerOcclusionOutputList &revers
edPaintList, const FillLayer&); |
| 36 | 36 |
| 37 // Returns true if the fill layer will certainly occlude anything painted be
hind it. |
| 38 static bool isFillLayerOpaque(const FillLayer&, const LayoutObject&); |
| 39 |
| 37 void paintFillLayers(const PaintInfo&, const Color&, const FillLayer&, const
LayoutRect&, BackgroundBleedAvoidance = BackgroundBleedNone, SkXfermode::Mode =
SkXfermode::kSrcOver_Mode, const LayoutObject* backgroundObject = nullptr); | 40 void paintFillLayers(const PaintInfo&, const Color&, const FillLayer&, const
LayoutRect&, BackgroundBleedAvoidance = BackgroundBleedNone, SkXfermode::Mode =
SkXfermode::kSrcOver_Mode, const LayoutObject* backgroundObject = nullptr); |
| 38 void paintMaskImages(const PaintInfo&, const LayoutRect&); | 41 void paintMaskImages(const PaintInfo&, const LayoutRect&); |
| 39 void paintBoxDecorationBackgroundWithRect(const PaintInfo&, const LayoutPoin
t&, const LayoutRect&); | 42 void paintBoxDecorationBackgroundWithRect(const PaintInfo&, const LayoutPoin
t&, const LayoutRect&); |
| 40 static void paintFillLayer(const LayoutBoxModelObject&, const PaintInfo&, co
nst Color&, const FillLayer&, const LayoutRect&, BackgroundBleedAvoidance, const
InlineFlowBox* = nullptr, const LayoutSize& = LayoutSize(), SkXfermode::Mode =
SkXfermode::kSrcOver_Mode, const LayoutObject* backgroundObject = nullptr); | 43 static void paintFillLayer(const LayoutBoxModelObject&, const PaintInfo&, co
nst Color&, const FillLayer&, const LayoutRect&, BackgroundBleedAvoidance, const
InlineFlowBox* = nullptr, const LayoutSize& = LayoutSize(), SkXfermode::Mode =
SkXfermode::kSrcOver_Mode, const LayoutObject* backgroundObject = nullptr); |
| 41 static InterpolationQuality chooseInterpolationQuality(const LayoutObject&,
Image*, const void*, const LayoutSize&); | 44 static InterpolationQuality chooseInterpolationQuality(const LayoutObject&,
Image*, const void*, const LayoutSize&); |
| 42 static bool paintNinePieceImage(const LayoutBoxModelObject&, GraphicsContext
&, const LayoutRect&, const ComputedStyle&, const NinePieceImage&, SkXfermode::M
ode = SkXfermode::kSrcOver_Mode); | 45 static bool paintNinePieceImage(const LayoutBoxModelObject&, GraphicsContext
&, const LayoutRect&, const ComputedStyle&, const NinePieceImage&, SkXfermode::M
ode = SkXfermode::kSrcOver_Mode); |
| 43 static void paintBorder(const LayoutBoxModelObject&, const PaintInfo&, const
LayoutRect&, const ComputedStyle&, BackgroundBleedAvoidance = BackgroundBleedNo
ne, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true); | 46 static void paintBorder(const LayoutBoxModelObject&, const PaintInfo&, const
LayoutRect&, const ComputedStyle&, BackgroundBleedAvoidance = BackgroundBleedNo
ne, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true); |
| 44 static void paintBoxShadow(const PaintInfo&, const LayoutRect&, const Comput
edStyle&, ShadowStyle, bool includeLogicalLeftEdge = true, bool includeLogicalRi
ghtEdge = true); | 47 static void paintBoxShadow(const PaintInfo&, const LayoutRect&, const Comput
edStyle&, ShadowStyle, bool includeLogicalLeftEdge = true, bool includeLogicalRi
ghtEdge = true); |
| 45 static bool shouldForceWhiteBackgroundForPrintEconomy(const ComputedStyle&,
const Document&); | 48 static bool shouldForceWhiteBackgroundForPrintEconomy(const ComputedStyle&,
const Document&); |
| 46 | 49 |
| 47 private: | 50 private: |
| 48 void paintBackground(const PaintInfo&, const LayoutRect&, const Color& backg
roundColor, BackgroundBleedAvoidance = BackgroundBleedNone); | 51 void paintBackground(const PaintInfo&, const LayoutRect&, const Color& backg
roundColor, BackgroundBleedAvoidance = BackgroundBleedNone); |
| 49 static FloatRoundedRect backgroundRoundedRectAdjustedForBleedAvoidance(const
LayoutObject&, const LayoutRect&, BackgroundBleedAvoidance, const InlineFlowBox
*, const LayoutSize&, bool includeLogicalLeftEdge, bool includeLogicalRightEdge)
; | 52 static FloatRoundedRect backgroundRoundedRectAdjustedForBleedAvoidance(const
LayoutObject&, const LayoutRect&, BackgroundBleedAvoidance, const InlineFlowBox
*, const LayoutSize&, bool includeLogicalLeftEdge, bool includeLogicalRightEdge)
; |
| 50 static FloatRoundedRect getBackgroundRoundedRect(const LayoutObject&, const
LayoutRect&, const InlineFlowBox*, LayoutUnit inlineBoxWidth, LayoutUnit inlineB
oxHeight, | 53 static FloatRoundedRect getBackgroundRoundedRect(const LayoutObject&, const
LayoutRect&, const InlineFlowBox*, LayoutUnit inlineBoxWidth, LayoutUnit inlineB
oxHeight, |
| 51 bool includeLogicalLeftEdge, bool includeLogicalRightEdge); | 54 bool includeLogicalLeftEdge, bool includeLogicalRightEdge); |
| 52 static void applyBoxShadowForBackground(GraphicsContext&, const LayoutObject
&); | 55 static void applyBoxShadowForBackground(GraphicsContext&, const LayoutObject
&); |
| 53 | 56 |
| 54 LayoutRect boundsForDrawingRecorder(const LayoutPoint& paintOffset); | 57 LayoutRect boundsForDrawingRecorder(const LayoutPoint& paintOffset); |
| 55 | 58 |
| 56 const LayoutBox& m_layoutBox; | 59 const LayoutBox& m_layoutBox; |
| 57 }; | 60 }; |
| 58 | 61 |
| 59 } // namespace blink | 62 } // namespace blink |
| 60 | 63 |
| 61 #endif | 64 #endif |
| OLD | NEW |