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 #include "core/paint/PaintLayerPainter.h" | 5 #include "core/paint/PaintLayerPainter.h" |
6 | 6 |
7 #include "core/frame/LocalFrame.h" | 7 #include "core/frame/LocalFrame.h" |
8 #include "core/layout/LayoutInline.h" | 8 #include "core/layout/LayoutInline.h" |
9 #include "core/layout/LayoutView.h" | 9 #include "core/layout/LayoutView.h" |
10 #include "core/paint/ClipPathClipper.h" | 10 #include "core/paint/ClipPathClipper.h" |
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 // A fixed-position object is repeated on every page, but if it is c
lipped by an ancestor layer then | 494 // A fixed-position object is repeated on every page, but if it is c
lipped by an ancestor layer then |
495 // the repetitions are clipped out. | 495 // the repetitions are clipped out. |
496 if (!isFixedPosObjectInPagedMedia) | 496 if (!isFixedPosObjectInPagedMedia) |
497 clipRectForFragment.moveBy(fragment.paginationOffset); | 497 clipRectForFragment.moveBy(fragment.paginationOffset); |
498 clipRectForFragment.intersect(fragment.backgroundRect); | 498 clipRectForFragment.intersect(fragment.backgroundRect); |
499 if (clipRectForFragment.isEmpty()) | 499 if (clipRectForFragment.isEmpty()) |
500 continue; | 500 continue; |
501 if (needsToClip(paintingInfo, clipRectForFragment)) { | 501 if (needsToClip(paintingInfo, clipRectForFragment)) { |
502 if (m_paintLayer.layoutObject()->isPositioned() && clipRectForFr
agment.isClippedByClipCss()) | 502 if (m_paintLayer.layoutObject()->isPositioned() && clipRectForFr
agment.isClippedByClipCss()) |
503 UseCounter::count(m_paintLayer.layoutObject()->document(), U
seCounter::ClipCssOfPositionedElement); | 503 UseCounter::count(m_paintLayer.layoutObject()->document(), U
seCounter::ClipCssOfPositionedElement); |
| 504 if (m_paintLayer.layoutObject()->isFixedPositioned()) |
| 505 UseCounter::count(m_paintLayer.layoutObject()->document(), U
seCounter::ClipCssOfFixedPositionElement); |
504 clipRecorder.emplace(context, *parentLayer->layoutObject(), Disp
layItem::kClipLayerParent, clipRectForFragment, &paintingInfo, fragment.paginati
onOffset, paintFlags); | 506 clipRecorder.emplace(context, *parentLayer->layoutObject(), Disp
layItem::kClipLayerParent, clipRectForFragment, &paintingInfo, fragment.paginati
onOffset, paintFlags); |
505 } | 507 } |
506 } | 508 } |
507 if (paintFragmentByApplyingTransform(context, paintingInfo, paintFlags,
fragment.paginationOffset) == MayBeClippedByPaintDirtyRect) | 509 if (paintFragmentByApplyingTransform(context, paintingInfo, paintFlags,
fragment.paginationOffset) == MayBeClippedByPaintDirtyRect) |
508 result = MayBeClippedByPaintDirtyRect; | 510 result = MayBeClippedByPaintDirtyRect; |
509 } | 511 } |
510 return result; | 512 return result; |
511 } | 513 } |
512 | 514 |
513 PaintLayerPainter::PaintResult PaintLayerPainter::paintFragmentByApplyingTransfo
rm(GraphicsContext& context, const PaintLayerPaintingInfo& paintingInfo, PaintLa
yerFlags paintFlags, const LayoutPoint& fragmentTranslation) | 515 PaintLayerPainter::PaintResult PaintLayerPainter::paintFragmentByApplyingTransfo
rm(GraphicsContext& context, const PaintLayerPaintingInfo& paintingInfo, PaintLa
yerFlags paintFlags, const LayoutPoint& fragmentTranslation) |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 if (!m_paintLayer.containsDirtyOverlayScrollbars()) | 792 if (!m_paintLayer.containsDirtyOverlayScrollbars()) |
791 return; | 793 return; |
792 | 794 |
793 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe
ct(damageRect)), paintFlags, LayoutSize()); | 795 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe
ct(damageRect)), paintFlags, LayoutSize()); |
794 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); | 796 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); |
795 | 797 |
796 m_paintLayer.setContainsDirtyOverlayScrollbars(false); | 798 m_paintLayer.setContainsDirtyOverlayScrollbars(false); |
797 } | 799 } |
798 | 800 |
799 } // namespace blink | 801 } // namespace blink |
OLD | NEW |