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

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

Issue 2196583002: Paint local background colors onto foreground layer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporate test related cleanups and comments. 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/PaintLayerPainter.h" 5 #include "core/paint/PaintLayerPainter.h"
6 6
7 #include "core/frame/FrameView.h" 7 #include "core/frame/FrameView.h"
8 #include "core/frame/Settings.h" 8 #include "core/frame/Settings.h"
9 #include "core/layout/LayoutBlock.h" 9 #include "core/layout/LayoutBlock.h"
10 #include "core/layout/LayoutView.h" 10 #include "core/layout/LayoutView.h"
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 ASSERT(objectPaintProperties && objectPaintProperties->localBorderBo xProperties()); 374 ASSERT(objectPaintProperties && objectPaintProperties->localBorderBo xProperties());
375 PaintChunkProperties properties(context.getPaintController().current PaintChunkProperties()); 375 PaintChunkProperties properties(context.getPaintController().current PaintChunkProperties());
376 auto& localBorderBoxProperties = *objectPaintProperties->localBorder BoxProperties(); 376 auto& localBorderBoxProperties = *objectPaintProperties->localBorder BoxProperties();
377 properties.transform = localBorderBoxProperties.propertyTreeState.tr ansform; 377 properties.transform = localBorderBoxProperties.propertyTreeState.tr ansform;
378 properties.clip = localBorderBoxProperties.propertyTreeState.clip; 378 properties.clip = localBorderBoxProperties.propertyTreeState.clip;
379 properties.effect = localBorderBoxProperties.propertyTreeState.effec t; 379 properties.effect = localBorderBoxProperties.propertyTreeState.effec t;
380 properties.backfaceHidden = m_paintLayer.layoutObject()->hasHiddenBa ckface(); 380 properties.backfaceHidden = m_paintLayer.layoutObject()->hasHiddenBa ckface();
381 scopedPaintChunkProperties.emplace(context.getPaintController(), m_p aintLayer, properties); 381 scopedPaintChunkProperties.emplace(context.getPaintController(), m_p aintLayer, properties);
382 } 382 }
383 383
384 bool shouldPaintBackground = isPaintingCompositedBackground && shouldPai ntContent && !selectionOnly; 384 bool isPaintingRootLayer = (&m_paintLayer) == paintingInfo.rootLayer;
385 bool shouldPaintBackground = shouldPaintContent && !selectionOnly
386 && (isPaintingCompositedBackground || (isPaintingRootLayer && !(pain tFlags & PaintLayerPaintingSkipRootBackground)));
385 bool shouldPaintNegZOrderList = (isPaintingScrollingContent && isPaintin gOverflowContents) || (!isPaintingScrollingContent && isPaintingCompositedBackgr ound); 387 bool shouldPaintNegZOrderList = (isPaintingScrollingContent && isPaintin gOverflowContents) || (!isPaintingScrollingContent && isPaintingCompositedBackgr ound);
386 bool shouldPaintOwnContents = isPaintingCompositedForeground && shouldPa intContent; 388 bool shouldPaintOwnContents = isPaintingCompositedForeground && shouldPa intContent;
387 bool shouldPaintNormalFlowAndPosZOrderLists = isPaintingCompositedForegr ound; 389 bool shouldPaintNormalFlowAndPosZOrderLists = isPaintingCompositedForegr ound;
388 bool shouldPaintOverlayScrollbars = isPaintingOverlayScrollbars; 390 bool shouldPaintOverlayScrollbars = isPaintingOverlayScrollbars;
389 391
390 if (shouldPaintBackground) { 392 if (shouldPaintBackground) {
391 paintBackgroundForFragments(layerFragments, context, paintingInfo.pa intDirtyRect, 393 paintBackgroundForFragments(layerFragments, context, paintingInfo.pa intDirtyRect,
392 localPaintingInfo, paintFlags); 394 localPaintingInfo, paintFlags);
393 } 395 }
394 396
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 569
568 // TODO(jbroman): Put the real transform origin here, instead of using a 570 // TODO(jbroman): Put the real transform origin here, instead of using a
569 // matrix with the origin baked in. 571 // matrix with the origin baked in.
570 FloatPoint3D transformOrigin; 572 FloatPoint3D transformOrigin;
571 Transform3DRecorder transform3DRecorder(context, *m_paintLayer.layoutObject( ), DisplayItem::Transform3DElementTransform, transform, transformOrigin); 573 Transform3DRecorder transform3DRecorder(context, *m_paintLayer.layoutObject( ), DisplayItem::Transform3DElementTransform, transform, transformOrigin);
572 574
573 // Now do a paint with the root layer shifted to be us. 575 // Now do a paint with the root layer shifted to be us.
574 PaintLayerPaintingInfo transformedPaintingInfo(&m_paintLayer, LayoutRect(enc losingIntRect(transform.inverse().mapRect(paintingInfo.paintDirtyRect))), painti ngInfo.getGlobalPaintFlags(), 576 PaintLayerPaintingInfo transformedPaintingInfo(&m_paintLayer, LayoutRect(enc losingIntRect(transform.inverse().mapRect(paintingInfo.paintDirtyRect))), painti ngInfo.getGlobalPaintFlags(),
575 adjustedSubPixelAccumulation); 577 adjustedSubPixelAccumulation);
576 transformedPaintingInfo.ancestorHasClipPathClipping = paintingInfo.ancestorH asClipPathClipping; 578 transformedPaintingInfo.ancestorHasClipPathClipping = paintingInfo.ancestorH asClipPathClipping;
579
580 // Remove skip root background flag when we're painting with a new root.
581 if (&m_paintLayer != paintingInfo.rootLayer)
582 paintFlags &= ~PaintLayerPaintingSkipRootBackground;
583
577 return paintLayerContentsAndReflection(context, transformedPaintingInfo, pai ntFlags, ForceSingleFragment); 584 return paintLayerContentsAndReflection(context, transformedPaintingInfo, pai ntFlags, ForceSingleFragment);
578 } 585 }
579 586
580 PaintLayerPainter::PaintResult PaintLayerPainter::paintChildren(unsigned childre nToVisit, GraphicsContext& context, const PaintLayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags) 587 PaintLayerPainter::PaintResult PaintLayerPainter::paintChildren(unsigned childre nToVisit, GraphicsContext& context, const PaintLayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags)
581 { 588 {
582 PaintResult result = FullyPainted; 589 PaintResult result = FullyPainted;
583 if (!m_paintLayer.hasSelfPaintingLayerDescendant()) 590 if (!m_paintLayer.hasSelfPaintingLayerDescendant())
584 return result; 591 return result;
585 592
586 #if ENABLE(ASSERT) 593 #if ENABLE(ASSERT)
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 if (!m_paintLayer.containsDirtyOverlayScrollbars()) 816 if (!m_paintLayer.containsDirtyOverlayScrollbars())
810 return; 817 return;
811 818
812 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe ct(damageRect)), paintFlags, LayoutSize()); 819 PaintLayerPaintingInfo paintingInfo(&m_paintLayer, LayoutRect(enclosingIntRe ct(damageRect)), paintFlags, LayoutSize());
813 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars); 820 paintLayer(context, paintingInfo, PaintLayerPaintingOverlayScrollbars);
814 821
815 m_paintLayer.setContainsDirtyOverlayScrollbars(false); 822 m_paintLayer.setContainsDirtyOverlayScrollbars(false);
816 } 823 }
817 824
818 } // namespace blink 825 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/BoxPainter.cpp ('k') | third_party/WebKit/Source/core/paint/TableRowPainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698