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

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

Issue 2181953004: Changed ComputedStyle's EVisibility to be an enum class and fixed naming (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@_move_computedstyle_around
Patch Set: Rebase Created 4 years, 4 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/BoxPainter.h" 5 #include "core/paint/BoxPainter.h"
6 6
7 #include "core/HTMLNames.h" 7 #include "core/HTMLNames.h"
8 #include "core/frame/Settings.h" 8 #include "core/frame/Settings.h"
9 #include "core/html/HTMLFrameOwnerElement.h" 9 #include "core/html/HTMLFrameOwnerElement.h"
10 #include "core/layout/ImageQualityController.h" 10 #include "core/layout/ImageQualityController.h"
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 obj.paint(info, scrolledPaintRect.location() - localOffset); 608 obj.paint(info, scrolledPaintRect.location() - localOffset);
609 } 609 }
610 610
611 context.endLayer(); 611 context.endLayer();
612 context.endLayer(); 612 context.endLayer();
613 } 613 }
614 } 614 }
615 615
616 void BoxPainter::paintMask(const PaintInfo& paintInfo, const LayoutPoint& paintO ffset) 616 void BoxPainter::paintMask(const PaintInfo& paintInfo, const LayoutPoint& paintO ffset)
617 { 617 {
618 if (m_layoutBox.style()->visibility() != VISIBLE || paintInfo.phase != Paint PhaseMask) 618 if (m_layoutBox.style()->visibility() != EVisibility::Visible || paintInfo.p hase != PaintPhaseMask)
619 return; 619 return;
620 620
621 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(paintInfo.contex t, m_layoutBox, paintInfo.phase)) 621 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(paintInfo.contex t, m_layoutBox, paintInfo.phase))
622 return; 622 return;
623 623
624 LayoutRect visualOverflowRect(m_layoutBox.visualOverflowRect()); 624 LayoutRect visualOverflowRect(m_layoutBox.visualOverflowRect());
625 visualOverflowRect.moveBy(paintOffset); 625 visualOverflowRect.moveBy(paintOffset);
626 626
627 LayoutObjectDrawingRecorder recorder(paintInfo.context, m_layoutBox, paintIn fo.phase, visualOverflowRect); 627 LayoutObjectDrawingRecorder recorder(paintInfo.context, m_layoutBox, paintIn fo.phase, visualOverflowRect);
628 LayoutRect paintRect = LayoutRect(paintOffset, m_layoutBox.size()); 628 LayoutRect paintRect = LayoutRect(paintOffset, m_layoutBox.size());
(...skipping 29 matching lines...) Expand all
658 } 658 }
659 659
660 if (pushTransparencyLayer) 660 if (pushTransparencyLayer)
661 paintInfo.context.endLayer(); 661 paintInfo.context.endLayer();
662 } 662 }
663 663
664 void BoxPainter::paintClippingMask(const PaintInfo& paintInfo, const LayoutPoint & paintOffset) 664 void BoxPainter::paintClippingMask(const PaintInfo& paintInfo, const LayoutPoint & paintOffset)
665 { 665 {
666 ASSERT(paintInfo.phase == PaintPhaseClippingMask); 666 ASSERT(paintInfo.phase == PaintPhaseClippingMask);
667 667
668 if (m_layoutBox.style()->visibility() != VISIBLE) 668 if (m_layoutBox.style()->visibility() != EVisibility::Visible)
669 return; 669 return;
670 670
671 if (!m_layoutBox.layer() || m_layoutBox.layer()->compositingState() != Paint sIntoOwnBacking) 671 if (!m_layoutBox.layer() || m_layoutBox.layer()->compositingState() != Paint sIntoOwnBacking)
672 return; 672 return;
673 673
674 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(paintInfo.contex t, m_layoutBox, paintInfo.phase)) 674 if (LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(paintInfo.contex t, m_layoutBox, paintInfo.phase))
675 return; 675 return;
676 676
677 IntRect paintRect = pixelSnappedIntRect(LayoutRect(paintOffset, m_layoutBox. size())); 677 IntRect paintRect = pixelSnappedIntRect(LayoutRect(paintOffset, m_layoutBox. size()));
678 LayoutObjectDrawingRecorder drawingRecorder(paintInfo.context, m_layoutBox, paintInfo.phase, paintRect); 678 LayoutObjectDrawingRecorder drawingRecorder(paintInfo.context, m_layoutBox, paintInfo.phase, paintRect);
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 } 820 }
821 } 821 }
822 822
823 bool BoxPainter::shouldForceWhiteBackgroundForPrintEconomy(const ComputedStyle& style, const Document& document) 823 bool BoxPainter::shouldForceWhiteBackgroundForPrintEconomy(const ComputedStyle& style, const Document& document)
824 { 824 {
825 return document.printing() && style.getPrintColorAdjust() == PrintColorAdjus tEconomy 825 return document.printing() && style.getPrintColorAdjust() == PrintColorAdjus tEconomy
826 && (!document.settings() || !document.settings()->shouldPrintBackgrounds ()); 826 && (!document.settings() || !document.settings()->shouldPrintBackgrounds ());
827 } 827 }
828 828
829 } // namespace blink 829 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698