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

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

Issue 716023002: Paint code cleanup: remove unnecessary indirections through the Render* code in several cases. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 | « Source/core/rendering/RenderObject.cpp ('k') | Source/core/rendering/RenderTable.h » ('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 * (C) 2000 Simon Hausmann <hausmann@kde.org> 3 * (C) 2000 Simon Hausmann <hausmann@kde.org>
4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de) 4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de)
5 * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 } 216 }
217 } 217 }
218 218
219 void RenderPart::layout() 219 void RenderPart::layout()
220 { 220 {
221 ASSERT(needsLayout()); 221 ASSERT(needsLayout());
222 222
223 clearNeedsLayout(); 223 clearNeedsLayout();
224 } 224 }
225 225
226 // FIXME: factor into PartPainter.
226 void RenderPart::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset) 227 void RenderPart::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
227 { 228 {
228 ANNOTATE_GRAPHICS_CONTEXT(paintInfo, this); 229 ANNOTATE_GRAPHICS_CONTEXT(paintInfo, this);
229 230
230 if (!shouldPaint(paintInfo, paintOffset)) 231 if (!shouldPaint(paintInfo, paintOffset))
231 return; 232 return;
232 233
233 LayoutPoint adjustedPaintOffset = paintOffset + location(); 234 LayoutPoint adjustedPaintOffset = paintOffset + location();
234 235
235 if (hasBoxDecorationBackground() && (paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection)) 236 if (hasBoxDecorationBackground() && (paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection))
236 paintBoxDecorationBackground(paintInfo, adjustedPaintOffset); 237 paintBoxDecorationBackground(paintInfo, adjustedPaintOffset);
237 238
238 if (paintInfo.phase == PaintPhaseMask) { 239 if (paintInfo.phase == PaintPhaseMask) {
239 paintMask(paintInfo, adjustedPaintOffset); 240 paintMask(paintInfo, adjustedPaintOffset);
240 return; 241 return;
241 } 242 }
242 243
243 if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSe lfOutline) && style()->hasOutline()) 244 if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSe lfOutline) && style()->hasOutline())
244 paintOutline(paintInfo, LayoutRect(adjustedPaintOffset, size())); 245 ObjectPainter(*this).paintOutline(paintInfo, LayoutRect(adjustedPaintOff set, size()));
245 246
246 if (paintInfo.phase != PaintPhaseForeground) 247 if (paintInfo.phase != PaintPhaseForeground)
247 return; 248 return;
248 249
249 if (style()->hasBorderRadius()) { 250 if (style()->hasBorderRadius()) {
250 LayoutRect borderRect = LayoutRect(adjustedPaintOffset, size()); 251 LayoutRect borderRect = LayoutRect(adjustedPaintOffset, size());
251 252
252 if (borderRect.isEmpty()) 253 if (borderRect.isEmpty())
253 return; 254 return;
254 255
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 if (widget->frameRect() == newFrame) 396 if (widget->frameRect() == newFrame)
396 return false; 397 return false;
397 398
398 RefPtrWillBeRawPtr<RenderPart> protector(this); 399 RefPtrWillBeRawPtr<RenderPart> protector(this);
399 RefPtrWillBeRawPtr<Node> protectedNode(node()); 400 RefPtrWillBeRawPtr<Node> protectedNode(node());
400 widget->setFrameRect(newFrame); 401 widget->setFrameRect(newFrame);
401 return widget->frameRect().size() != newFrame.size(); 402 return widget->frameRect().size() != newFrame.size();
402 } 403 }
403 404
404 } 405 }
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderObject.cpp ('k') | Source/core/rendering/RenderTable.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698