| 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 PaintLayerPainter_h | 5 #ifndef PaintLayerPainter_h |
| 6 #define PaintLayerPainter_h | 6 #define PaintLayerPainter_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/paint/PaintLayerFragment.h" | 9 #include "core/paint/PaintLayerFragment.h" |
| 10 #include "core/paint/PaintLayerPaintingInfo.h" | 10 #include "core/paint/PaintLayerPaintingInfo.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 PaintResult PaintLayerContents(GraphicsContext&, | 47 PaintResult PaintLayerContents(GraphicsContext&, |
| 48 const PaintLayerPaintingInfo&, | 48 const PaintLayerPaintingInfo&, |
| 49 PaintLayerFlags, | 49 PaintLayerFlags, |
| 50 FragmentPolicy = kAllowMultipleFragments); | 50 FragmentPolicy = kAllowMultipleFragments); |
| 51 | 51 |
| 52 void PaintOverlayScrollbars(GraphicsContext&, | 52 void PaintOverlayScrollbars(GraphicsContext&, |
| 53 const LayoutRect& damage_rect, | 53 const LayoutRect& damage_rect, |
| 54 const GlobalPaintFlags); | 54 const GlobalPaintFlags); |
| 55 | 55 |
| 56 private: | 56 private: |
| 57 friend class PaintLayerPainterTest; | |
| 58 | |
| 59 enum ClipState { kHasNotClipped, kHasClipped }; | 57 enum ClipState { kHasNotClipped, kHasClipped }; |
| 60 | 58 |
| 61 inline bool IsFixedPositionObjectInPagedMedia(); | 59 inline bool IsFixedPositionObjectInPagedMedia(); |
| 62 | 60 |
| 63 // "For paged media, boxes with fixed positions are repeated on every page." | 61 // "For paged media, boxes with fixed positions are repeated on every page." |
| 64 // https://www.w3.org/TR/2011/REC-CSS2-20110607/visuren.html#fixed-positioning | 62 // https://www.w3.org/TR/2011/REC-CSS2-20110607/visuren.html#fixed-positioning |
| 65 // Repeats singleFragmentIgnoredPagination of the fixed-position object in | 63 // Repeats singleFragmentIgnoredPagination of the fixed-position object in |
| 66 // each page, with paginationOffset and layerBounds adjusted for each page. | 64 // each page, with paginationOffset and layerBounds adjusted for each page. |
| 67 // TODO(wangxianzhu): Fold this into PaintLayer::collectFragments(). | 65 // TODO(wangxianzhu): Fold this into PaintLayer::collectFragments(). |
| 68 void RepeatFixedPositionObjectInPages( | 66 void RepeatFixedPositionObjectInPages( |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 void FillMaskingFragment(GraphicsContext&, const ClipRect&); | 137 void FillMaskingFragment(GraphicsContext&, const ClipRect&); |
| 140 | 138 |
| 141 static bool NeedsToClip(const PaintLayerPaintingInfo& local_painting_info, | 139 static bool NeedsToClip(const PaintLayerPaintingInfo& local_painting_info, |
| 142 const ClipRect&); | 140 const ClipRect&); |
| 143 | 141 |
| 144 // Returns whether this layer should be painted during sofware painting (i.e., | 142 // Returns whether this layer should be painted during sofware painting (i.e., |
| 145 // not via calls from CompositedLayerMapping to draw into composited layers). | 143 // not via calls from CompositedLayerMapping to draw into composited layers). |
| 146 bool ShouldPaintLayerInSoftwareMode(const GlobalPaintFlags, | 144 bool ShouldPaintLayerInSoftwareMode(const GlobalPaintFlags, |
| 147 PaintLayerFlags paint_flags); | 145 PaintLayerFlags paint_flags); |
| 148 | 146 |
| 149 // Returns true if the painted output of this PaintLayer and its children is | |
| 150 // invisible and therefore can't impact painted output. | |
| 151 bool PaintedOutputInvisible(const PaintLayerPaintingInfo&); | |
| 152 | |
| 153 PaintLayer& paint_layer_; | 147 PaintLayer& paint_layer_; |
| 154 }; | 148 }; |
| 155 | 149 |
| 156 } // namespace blink | 150 } // namespace blink |
| 157 | 151 |
| 158 #endif // PaintLayerPainter_h | 152 #endif // PaintLayerPainter_h |
| OLD | NEW |