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

Side by Side Diff: Source/core/rendering/RenderReplaced.cpp

Issue 16357011: Remove support for -webkit-color-correction (which we've never supported on (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: resolve merge conflicts, obey brace style changes Created 7 years, 6 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
« no previous file with comments | « Source/core/rendering/RenderObject.cpp ('k') | Source/core/rendering/RenderScrollbarTheme.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2000 Dirk Mueller (mueller@kde.org) 3 * Copyright (C) 2000 Dirk Mueller (mueller@kde.org)
4 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. 4 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved.
5 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved. 5 * Copyright (C) Research In Motion Limited 2011-2012. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 clipRoundedInnerRect(paintInfo.context, paintRect, roundedInnerRect) ; 151 clipRoundedInnerRect(paintInfo.context, paintRect, roundedInnerRect) ;
152 } 152 }
153 } 153 }
154 154
155 if (!completelyClippedOut) { 155 if (!completelyClippedOut) {
156 paintReplaced(paintInfo, adjustedPaintOffset); 156 paintReplaced(paintInfo, adjustedPaintOffset);
157 157
158 if (style()->hasBorderRadius()) 158 if (style()->hasBorderRadius())
159 paintInfo.context->restore(); 159 paintInfo.context->restore();
160 } 160 }
161 161
162 // The selection tint never gets clipped by border-radius rounding, since we want it to run right up to the edges of 162 // The selection tint never gets clipped by border-radius rounding, since we want it to run right up to the edges of
163 // surrounding content. 163 // surrounding content.
164 if (drawSelectionTint) { 164 if (drawSelectionTint) {
165 LayoutRect selectionPaintingRect = localSelectionRect(); 165 LayoutRect selectionPaintingRect = localSelectionRect();
166 selectionPaintingRect.moveBy(adjustedPaintOffset); 166 selectionPaintingRect.moveBy(adjustedPaintOffset);
167 paintInfo.context->fillRect(pixelSnappedIntRect(selectionPaintingRect), selectionBackgroundColor(), style()->colorSpace()); 167 paintInfo.context->fillRect(pixelSnappedIntRect(selectionPaintingRect), selectionBackgroundColor());
168 } 168 }
169 } 169 }
170 170
171 bool RenderReplaced::shouldPaint(PaintInfo& paintInfo, const LayoutPoint& paintO ffset) 171 bool RenderReplaced::shouldPaint(PaintInfo& paintInfo, const LayoutPoint& paintO ffset)
172 { 172 {
173 if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhase Outline && paintInfo.phase != PaintPhaseSelfOutline 173 if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhase Outline && paintInfo.phase != PaintPhaseSelfOutline
174 && paintInfo.phase != PaintPhaseSelection && paintInfo.phase != Pain tPhaseMask) 174 && paintInfo.phase != PaintPhaseSelection && paintInfo.phase != Pain tPhaseMask)
175 return false; 175 return false;
176 176
177 if (!paintInfo.shouldPaintWithinRoot(this)) 177 if (!paintInfo.shouldPaintWithinRoot(this))
178 return false; 178 return false;
179 179
180 // if we're invisible or haven't received a layout yet, then just bail. 180 // if we're invisible or haven't received a layout yet, then just bail.
181 if (style()->visibility() != VISIBLE) 181 if (style()->visibility() != VISIBLE)
182 return false; 182 return false;
183 183
184 LayoutPoint adjustedPaintOffset = paintOffset + location(); 184 LayoutPoint adjustedPaintOffset = paintOffset + location();
185 185
186 // Early exit if the element touches the edges. 186 // Early exit if the element touches the edges.
187 LayoutUnit top = adjustedPaintOffset.y() + visualOverflowRect().y(); 187 LayoutUnit top = adjustedPaintOffset.y() + visualOverflowRect().y();
188 LayoutUnit bottom = adjustedPaintOffset.y() + visualOverflowRect().maxY(); 188 LayoutUnit bottom = adjustedPaintOffset.y() + visualOverflowRect().maxY();
189 if (isSelected() && m_inlineBoxWrapper) { 189 if (isSelected() && m_inlineBoxWrapper) {
190 LayoutUnit selTop = paintOffset.y() + m_inlineBoxWrapper->root()->select ionTop(); 190 LayoutUnit selTop = paintOffset.y() + m_inlineBoxWrapper->root()->select ionTop();
191 LayoutUnit selBottom = paintOffset.y() + selTop + m_inlineBoxWrapper->ro ot()->selectionHeight(); 191 LayoutUnit selBottom = paintOffset.y() + selTop + m_inlineBoxWrapper->ro ot()->selectionHeight();
192 top = min(selTop, top); 192 top = min(selTop, top);
193 bottom = max(selBottom, bottom); 193 bottom = max(selBottom, bottom);
194 } 194 }
195 195
196 LayoutRect localRepaintRect = paintInfo.rect; 196 LayoutRect localRepaintRect = paintInfo.rect;
197 localRepaintRect.inflate(maximalOutlineSize(paintInfo.phase)); 197 localRepaintRect.inflate(maximalOutlineSize(paintInfo.phase));
198 if (adjustedPaintOffset.x() + visualOverflowRect().x() >= localRepaintRect.m axX() || adjustedPaintOffset.x() + visualOverflowRect().maxX() <= localRepaintRe ct.x()) 198 if (adjustedPaintOffset.x() + visualOverflowRect().x() >= localRepaintRect.m axX() || adjustedPaintOffset.x() + visualOverflowRect().maxX() <= localRepaintRe ct.x())
199 return false; 199 return false;
200 200
201 if (top >= localRepaintRect.maxY() || bottom <= localRepaintRect.y()) 201 if (top >= localRepaintRect.maxY() || bottom <= localRepaintRect.y())
202 return false; 202 return false;
203 203
204 return true; 204 return true;
205 } 205 }
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
581 return r; 581 return r;
582 } 582 }
583 583
584 void RenderReplaced::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const 584 void RenderReplaced::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
585 { 585 {
586 MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Rendering) ; 586 MemoryClassInfo info(memoryObjectInfo, this, PlatformMemoryTypes::Rendering) ;
587 RenderBox::reportMemoryUsage(memoryObjectInfo); 587 RenderBox::reportMemoryUsage(memoryObjectInfo);
588 } 588 }
589 589
590 } 590 }
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderObject.cpp ('k') | Source/core/rendering/RenderScrollbarTheme.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698