Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp

Issue 2327333003: Add a use counter of css clip of fixed-pos elements. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 // the repetitions are clipped out. 479 // the repetitions are clipped out.
480 if (!isFixedPosObjectInPagedMedia) 480 if (!isFixedPosObjectInPagedMedia)
481 clipRectForFragment.moveBy(fragment.paginationOffset); 481 clipRectForFragment.moveBy(fragment.paginationOffset);
482 clipRectForFragment.intersect(fragment.backgroundRect); 482 clipRectForFragment.intersect(fragment.backgroundRect);
483 if (clipRectForFragment.isEmpty()) 483 if (clipRectForFragment.isEmpty())
484 continue; 484 continue;
485 if (needsToClip(paintingInfo, clipRectForFragment)) { 485 if (needsToClip(paintingInfo, clipRectForFragment)) {
486 if (m_paintLayer.layoutObject()->isPositioned() && clipRectForFr agment.isClippedByClipCss()) 486 if (m_paintLayer.layoutObject()->isPositioned() && clipRectForFr agment.isClippedByClipCss())
487 UseCounter::count(m_paintLayer.layoutObject()->document(), U seCounter::ClipCssOfPositionedElement); 487 UseCounter::count(m_paintLayer.layoutObject()->document(), U seCounter::ClipCssOfPositionedElement);
488 clipRecorder.emplace(context, *parentLayer->layoutObject(), Disp layItem::ClipLayerParent, clipRectForFragment, &paintingInfo, fragment.paginatio nOffset, paintFlags); 488 clipRecorder.emplace(context, *parentLayer->layoutObject(), Disp layItem::ClipLayerParent, clipRectForFragment, &paintingInfo, fragment.paginatio nOffset, paintFlags);
489 if (m_paintLayer.layoutObject()->isFixedPositioned())
490 UseCounter::count(m_paintLayer.layoutObject()->document(), U seCounter::ClipCssOfFixedPositionElement);
489 } 491 }
490 } 492 }
491 if (paintFragmentByApplyingTransform(context, paintingInfo, paintFlags, fragment.paginationOffset) == MayBeClippedByPaintDirtyRect) 493 if (paintFragmentByApplyingTransform(context, paintingInfo, paintFlags, fragment.paginationOffset) == MayBeClippedByPaintDirtyRect)
492 result = MayBeClippedByPaintDirtyRect; 494 result = MayBeClippedByPaintDirtyRect;
493 } 495 }
494 return result; 496 return result;
495 } 497 }
496 498
497 PaintLayerPainter::PaintResult PaintLayerPainter::paintFragmentByApplyingTransfo rm(GraphicsContext& context, const PaintLayerPaintingInfo& paintingInfo, PaintLa yerFlags paintFlags, const LayoutPoint& fragmentTranslation) 499 PaintLayerPainter::PaintResult PaintLayerPainter::paintFragmentByApplyingTransfo rm(GraphicsContext& context, const PaintLayerPaintingInfo& paintingInfo, PaintLa yerFlags paintFlags, const LayoutPoint& fragmentTranslation)
498 { 500 {
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 if (!m_paintLayer.containsDirtyOverlayScrollbars()) 760 if (!m_paintLayer.containsDirtyOverlayScrollbars())
759 return; 761 return;
760 762
761 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe ct(damageRect)), paintFlags, LayoutSize()); 763 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe ct(damageRect)), paintFlags, LayoutSize());
762 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); 764 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars);
763 765
764 m_paintLayer.setContainsDirtyOverlayScrollbars(false); 766 m_paintLayer.setContainsDirtyOverlayScrollbars(false);
765 } 767 }
766 768
767 } // namespace blink 769 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/UseCounter.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698