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

Side by Side Diff: Source/core/paint/LayerPainter.cpp

Issue 694753004: Correctly ignore "self" for border radius clipping when painting the background phase or fragments. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Merged. Created 6 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « LayoutTests/platform/linux/fast/clip/nested-rounded-rect-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "config.h" 5 #include "config.h"
6 #include "core/paint/LayerPainter.h" 6 #include "core/paint/LayerPainter.h"
7 7
8 #include "core/frame/Settings.h" 8 #include "core/frame/Settings.h"
9 #include "core/page/Page.h" 9 #include "core/page/Page.h"
10 #include "core/rendering/ClipPathOperation.h" 10 #include "core/rendering/ClipPathOperation.h"
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 const LayerFragment& fragment = layerFragments.at(i); 681 const LayerFragment& fragment = layerFragments.at(i);
682 682
683 // Begin transparency layers lazily now that we know we have to paint so mething. 683 // Begin transparency layers lazily now that we know we have to paint so mething.
684 if (haveTransparency || m_renderLayer.paintsWithBlendMode()) 684 if (haveTransparency || m_renderLayer.paintsWithBlendMode())
685 beginTransparencyLayers(context, localPaintingInfo.rootLayer, transp arencyPaintDirtyRect, localPaintingInfo.subPixelAccumulation, localPaintingInfo. paintBehavior); 685 beginTransparencyLayers(context, localPaintingInfo.rootLayer, transp arencyPaintDirtyRect, localPaintingInfo.subPixelAccumulation, localPaintingInfo. paintBehavior);
686 686
687 OwnPtr<ClipRecorder> clipRecorder; 687 OwnPtr<ClipRecorder> clipRecorder;
688 688
689 if (localPaintingInfo.clipToDirtyRect && needsToClip(localPaintingInfo, fragment.backgroundRect)) { 689 if (localPaintingInfo.clipToDirtyRect && needsToClip(localPaintingInfo, fragment.backgroundRect)) {
690 clipRecorder = adoptPtr(new ClipRecorder(&m_renderLayer, context, Di splayItem::ClipLayerBackground, fragment.backgroundRect)); 690 clipRecorder = adoptPtr(new ClipRecorder(&m_renderLayer, context, Di splayItem::ClipLayerBackground, fragment.backgroundRect));
691 applyRoundedRectClips(localPaintingInfo, context, fragment.backgroun dRect, paintFlags, *clipRecorder); 691 applyRoundedRectClips(localPaintingInfo, context, fragment.backgroun dRect, paintFlags, *clipRecorder, DoNotIncludeSelfForBorderRadius);
mstensho (USE GERRIT) 2014/11/03 13:28:08 There used to be a comment "Background painting wi
chrishtr 2014/11/03 17:36:21 Done.
692 } 692 }
693 693
694 // Paint the background. 694 // Paint the background.
695 // FIXME: Eventually we will collect the region from the fragment itself instead of just from the paint info. 695 // FIXME: Eventually we will collect the region from the fragment itself instead of just from the paint info.
696 PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.backgroundRect .rect()), PaintPhaseBlockBackground, paintBehavior, paintingRootForRenderer, 0, localPaintingInfo.rootLayer->renderer()); 696 PaintInfo paintInfo(context, pixelSnappedIntRect(fragment.backgroundRect .rect()), PaintPhaseBlockBackground, paintBehavior, paintingRootForRenderer, 0, localPaintingInfo.rootLayer->renderer());
697 m_renderLayer.renderer()->paint(paintInfo, toPoint(fragment.layerBounds. location() - m_renderLayer.renderBoxLocation() + subPixelAccumulationIfNeeded(lo calPaintingInfo.subPixelAccumulation, m_renderLayer.compositingState()))); 697 m_renderLayer.renderer()->paint(paintInfo, toPoint(fragment.layerBounds. location() - m_renderLayer.renderBoxLocation() + subPixelAccumulationIfNeeded(lo calPaintingInfo.subPixelAccumulation, m_renderLayer.compositingState())));
698 } 698 }
699 } 699 }
700 700
701 void LayerPainter::paintForegroundForFragments(const LayerFragments& layerFragme nts, GraphicsContext* context, 701 void LayerPainter::paintForegroundForFragments(const LayerFragments& layerFragme nts, GraphicsContext* context,
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
866 if (shouldRespectOverflowClip(paintFlags, m_renderLayer.renderer()) == IgnoreOverflowClip) 866 if (shouldRespectOverflowClip(paintFlags, m_renderLayer.renderer()) == IgnoreOverflowClip)
867 clipRectsContext.setIgnoreOverflowClip(); 867 clipRectsContext.setIgnoreOverflowClip();
868 LayoutRect parentClipRect = m_renderLayer.clipper().backgroundClipRe ct(clipRectsContext).rect(); 868 LayoutRect parentClipRect = m_renderLayer.clipper().backgroundClipRe ct(clipRectsContext).rect();
869 parentClipRect.moveBy(fragment.paginationOffset + offsetOfPagination LayerFromRoot); 869 parentClipRect.moveBy(fragment.paginationOffset + offsetOfPagination LayerFromRoot);
870 clipRect.intersect(parentClipRect); 870 clipRect.intersect(parentClipRect);
871 } 871 }
872 872
873 OwnPtr<ClipRecorder> clipRecorder; 873 OwnPtr<ClipRecorder> clipRecorder;
874 if (needsToClip(paintingInfo, clipRect)) { 874 if (needsToClip(paintingInfo, clipRect)) {
875 clipRecorder = adoptPtr(new ClipRecorder(m_renderLayer.parent(), con text, DisplayItem::ClipLayerFragmentParent, clipRect)); 875 clipRecorder = adoptPtr(new ClipRecorder(m_renderLayer.parent(), con text, DisplayItem::ClipLayerFragmentParent, clipRect));
876 LayerPainter(*m_renderLayer.parent()).applyRoundedRectClips(painting Info, context, clipRect, paintFlags, *clipRecorder, DoNotIncludeSelfForBorderRad ius); // Child clipping mask painting will handle clipping to self. 876 // FIXME: why should we have to deal with rounded rect clips here at all?
877 LayerPainter(*m_renderLayer.parent()).applyRoundedRectClips(painting Info, context, clipRect, paintFlags, *clipRecorder);
877 } 878 }
878 879
879 paintLayerByApplyingTransform(context, paintingInfo, paintFlags, fragmen t.paginationOffset); 880 paintLayerByApplyingTransform(context, paintingInfo, paintFlags, fragmen t.paginationOffset);
880 } 881 }
881 } 882 }
882 883
883 } // namespace blink 884 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/platform/linux/fast/clip/nested-rounded-rect-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698