OLD | NEW |
---|---|
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 #include "core/paint/NGBoxFragmentPainter.h" | 5 #include "core/paint/NGBoxFragmentPainter.h" |
6 | 6 |
7 #include "core/layout/BackgroundBleedAvoidance.h" | 7 #include "core/layout/BackgroundBleedAvoidance.h" |
8 #include "core/layout/ng/inline/ng_physical_line_box_fragment.h" | 8 #include "core/layout/ng/inline/ng_physical_line_box_fragment.h" |
9 #include "core/layout/ng/inline/ng_physical_text_fragment.h" | 9 #include "core/layout/ng/inline/ng_physical_text_fragment.h" |
10 #include "core/layout/ng/ng_physical_box_fragment.h" | 10 #include "core/layout/ng/ng_physical_box_fragment.h" |
(...skipping 26 matching lines...) Expand all Loading... | |
37 } | 37 } |
38 } | 38 } |
39 } | 39 } |
40 | 40 |
41 void NGBoxFragmentPainter::PaintLineBox( | 41 void NGBoxFragmentPainter::PaintLineBox( |
42 const NGPhysicalLineBoxFragment* fragment, | 42 const NGPhysicalLineBoxFragment* fragment, |
43 const PaintInfo& paint_info, | 43 const PaintInfo& paint_info, |
44 const LayoutPoint& paint_offset) { | 44 const LayoutPoint& paint_offset) { |
45 // TODO: Should this check if the line boxes intersects with the dirty rect | 45 // TODO: Should this check if the line boxes intersects with the dirty rect |
46 // like legacy layout or do we want to change the invalidation logic? | 46 // like legacy layout or do we want to change the invalidation logic? |
47 if (DrawingRecorder::UseCachedDrawingIfPossible( | |
kojii
2017/06/16 11:25:57
Can explain what this is?
| |
48 paint_info.context, *fragment, | |
49 DisplayItem::PaintPhaseToDrawingType(paint_info.phase))) | |
50 return; | |
47 | 51 |
48 LayoutRect overflow_rect(box_fragment_->VisualOverflowRect()); | 52 LayoutRect overflow_rect(box_fragment_->VisualOverflowRect()); |
49 overflow_rect.MoveBy(paint_offset); | 53 overflow_rect.MoveBy(paint_offset); |
50 | 54 |
51 // TODO(eae): Should this go here, in ::Paint or in the NGTextFragmentPainter | 55 // TODO(eae): Should this go here, in ::Paint or in the NGTextFragmentPainter |
52 // class? | 56 // class? |
53 DrawingRecorder recorder( | 57 DrawingRecorder recorder( |
54 paint_info.context, *fragment, | 58 paint_info.context, *fragment, |
55 DisplayItem::PaintPhaseToDrawingType(paint_info.phase), | 59 DisplayItem::PaintPhaseToDrawingType(paint_info.phase), |
56 PixelSnappedIntRect(overflow_rect)); | 60 PixelSnappedIntRect(overflow_rect)); |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
476 include_logical_left_edge, | 480 include_logical_left_edge, |
477 include_logical_right_edge); | 481 include_logical_right_edge); |
478 border_painter.PaintBorder(info, rect); | 482 border_painter.PaintBorder(info, rect); |
479 } | 483 } |
480 | 484 |
481 const Document& NGBoxFragmentPainter::GetDocument() const { | 485 const Document& NGBoxFragmentPainter::GetDocument() const { |
482 return box_fragment_->GetLayoutObject()->GetDocument(); | 486 return box_fragment_->GetLayoutObject()->GetDocument(); |
483 } | 487 } |
484 | 488 |
485 } // namespace blink | 489 } // namespace blink |
OLD | NEW |