| 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 BoxPainterBase_h | 5 #ifndef BoxPainterBase_h |
| 6 #define BoxPainterBase_h | 6 #define BoxPainterBase_h |
| 7 | 7 |
| 8 #include "core/layout/BackgroundBleedAvoidance.h" | 8 #include "core/layout/BackgroundBleedAvoidance.h" |
| 9 #include "core/style/ShadowData.h" | 9 #include "core/style/ShadowData.h" |
| 10 #include "core/style/StyleImage.h" | 10 #include "core/style/StyleImage.h" |
| 11 #include "platform/graphics/GraphicsTypes.h" | 11 #include "platform/graphics/GraphicsTypes.h" |
| 12 #include "platform/wtf/Allocator.h" | 12 #include "platform/wtf/Allocator.h" |
| 13 #include "third_party/skia/include/core/SkBlendMode.h" |
| 13 | 14 |
| 14 namespace blink { | 15 namespace blink { |
| 15 | 16 |
| 16 class ComputedStyle; | 17 class ComputedStyle; |
| 17 class Document; | 18 class Document; |
| 18 class FloatRoundedRect; | 19 class FloatRoundedRect; |
| 19 class LayoutPoint; | 20 class LayoutPoint; |
| 20 class LayoutRect; | 21 class LayoutRect; |
| 21 class FillLayer; | 22 class FillLayer; |
| 22 class LayoutRectOutsets; | 23 class LayoutRectOutsets; |
| 24 class ImageResourceObserver; |
| 23 struct PaintInfo; | 25 struct PaintInfo; |
| 24 | 26 |
| 25 // Base class for box painting. Has no dependencies on the layout tree and thus | 27 // Base class for box painting. Has no dependencies on the layout tree and thus |
| 26 // provides functionality and definitions that can be shared between both legacy | 28 // provides functionality and definitions that can be shared between both legacy |
| 27 // layout and LayoutNG. For performance reasons no virtual methods are utilized. | 29 // layout and LayoutNG. For performance reasons no virtual methods are utilized. |
| 28 class BoxPainterBase { | 30 class BoxPainterBase { |
| 29 STACK_ALLOCATED(); | 31 STACK_ALLOCATED(); |
| 30 | 32 |
| 31 public: | 33 public: |
| 32 BoxPainterBase() {} | 34 BoxPainterBase() {} |
| (...skipping 15 matching lines...) Expand all Loading... |
| 48 // This form is used by callers requiring special computation of the outer | 50 // This form is used by callers requiring special computation of the outer |
| 49 // bounds of the shadow. For example, TableCellPainter insets the bounds by | 51 // bounds of the shadow. For example, TableCellPainter insets the bounds by |
| 50 // half widths of collapsed borders instead of the default whole widths. | 52 // half widths of collapsed borders instead of the default whole widths. |
| 51 static void PaintInsetBoxShadowInBounds( | 53 static void PaintInsetBoxShadowInBounds( |
| 52 const PaintInfo&, | 54 const PaintInfo&, |
| 53 const FloatRoundedRect& bounds, | 55 const FloatRoundedRect& bounds, |
| 54 const ComputedStyle&, | 56 const ComputedStyle&, |
| 55 bool include_logical_left_edge = true, | 57 bool include_logical_left_edge = true, |
| 56 bool include_logical_right_edge = true); | 58 bool include_logical_right_edge = true); |
| 57 | 59 |
| 60 static void PaintBorder(const ImageResourceObserver&, |
| 61 const Document&, |
| 62 Node*, |
| 63 const PaintInfo&, |
| 64 const LayoutRect&, |
| 65 const ComputedStyle&, |
| 66 BackgroundBleedAvoidance = kBackgroundBleedNone, |
| 67 bool include_logical_left_edge = true, |
| 68 bool include_logical_right_edge = true); |
| 69 |
| 58 static bool ShouldForceWhiteBackgroundForPrintEconomy(const Document&, | 70 static bool ShouldForceWhiteBackgroundForPrintEconomy(const Document&, |
| 59 const ComputedStyle&); | 71 const ComputedStyle&); |
| 60 | 72 |
| 61 LayoutRect BoundsForDrawingRecorder(const PaintInfo&, | 73 LayoutRect BoundsForDrawingRecorder(const PaintInfo&, |
| 62 const LayoutPoint& adjusted_paint_offset); | 74 const LayoutPoint& adjusted_paint_offset); |
| 63 | 75 |
| 64 typedef Vector<const FillLayer*, 8> FillLayerOcclusionOutputList; | 76 typedef Vector<const FillLayer*, 8> FillLayerOcclusionOutputList; |
| 65 // Returns true if the result fill layers have non-associative blending or | 77 // Returns true if the result fill layers have non-associative blending or |
| 66 // compositing mode. (i.e. The rendering will be different without creating | 78 // compositing mode. (i.e. The rendering will be different without creating |
| 67 // isolation group by context.saveLayer().) Note that the output list will be | 79 // isolation group by context.saveLayer().) Note that the output list will be |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 const LayoutRect&, | 134 const LayoutRect&, |
| 123 BackgroundBleedAvoidance, | 135 BackgroundBleedAvoidance, |
| 124 bool has_line_box_sibling, | 136 bool has_line_box_sibling, |
| 125 const LayoutSize&, | 137 const LayoutSize&, |
| 126 LayoutRectOutsets border_padding_insets); | 138 LayoutRectOutsets border_padding_insets); |
| 127 }; | 139 }; |
| 128 | 140 |
| 129 } // namespace blink | 141 } // namespace blink |
| 130 | 142 |
| 131 #endif | 143 #endif |
| OLD | NEW |