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

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

Issue 21430003: Implement interfaces in PaintInfo and make it a class. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@getterPaintInfo01
Patch Set: Second try Created 7 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 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2009 Google Inc. All rights reserved. 7 * Copyright (C) 2009 Google Inc. All rights reserved.
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after
1105 graphicsContext->drawConvexPolygon(4, quad, antialias); 1105 graphicsContext->drawConvexPolygon(4, quad, antialias);
1106 graphicsContext->setStrokeStyle(oldStrokeStyle); 1106 graphicsContext->setStrokeStyle(oldStrokeStyle);
1107 break; 1107 break;
1108 } 1108 }
1109 } 1109 }
1110 } 1110 }
1111 1111
1112 void RenderObject::paintFocusRing(PaintInfo& paintInfo, const LayoutPoint& paint Offset, RenderStyle* style) 1112 void RenderObject::paintFocusRing(PaintInfo& paintInfo, const LayoutPoint& paint Offset, RenderStyle* style)
1113 { 1113 {
1114 Vector<IntRect> focusRingRects; 1114 Vector<IntRect> focusRingRects;
1115 addFocusRingRects(focusRingRects, paintOffset, paintInfo.paintContainer); 1115 addFocusRingRects(focusRingRects, paintOffset, paintInfo.getPaintContainer() );
1116 if (style->outlineStyleIsAuto()) 1116 if (style->outlineStyleIsAuto())
1117 paintInfo.context->drawFocusRing(focusRingRects, style->outlineWidth(), style->outlineOffset(), resolveColor(style, CSSPropertyOutlineColor)); 1117 paintInfo.getContext()->drawFocusRing(focusRingRects, style->outlineWidt h(), style->outlineOffset(), resolveColor(style, CSSPropertyOutlineColor));
1118 else 1118 else
1119 addPDFURLRect(paintInfo.context, unionRect(focusRingRects)); 1119 addPDFURLRect(paintInfo.getContext(), unionRect(focusRingRects));
1120 } 1120 }
1121 1121
1122 void RenderObject::addPDFURLRect(GraphicsContext* context, const LayoutRect& rec t) 1122 void RenderObject::addPDFURLRect(GraphicsContext* context, const LayoutRect& rec t)
1123 { 1123 {
1124 if (rect.isEmpty()) 1124 if (rect.isEmpty())
1125 return; 1125 return;
1126 Node* n = node(); 1126 Node* n = node();
1127 if (!n || !n->isLink() || !n->isElementNode()) 1127 if (!n || !n->isLink() || !n->isElementNode())
1128 return; 1128 return;
1129 const AtomicString& href = toElement(n)->getAttribute(hrefAttr); 1129 const AtomicString& href = toElement(n)->getAttribute(hrefAttr);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
1167 IntRect outer = pixelSnappedIntRect(inner); 1167 IntRect outer = pixelSnappedIntRect(inner);
1168 outer.inflate(outlineWidth); 1168 outer.inflate(outlineWidth);
1169 1169
1170 // FIXME: This prevents outlines from painting inside the object. See bug 12 042 1170 // FIXME: This prevents outlines from painting inside the object. See bug 12 042
1171 if (outer.isEmpty()) 1171 if (outer.isEmpty())
1172 return; 1172 return;
1173 1173
1174 EBorderStyle outlineStyle = styleToUse->outlineStyle(); 1174 EBorderStyle outlineStyle = styleToUse->outlineStyle();
1175 Color outlineColor = resolveColor(styleToUse, CSSPropertyOutlineColor); 1175 Color outlineColor = resolveColor(styleToUse, CSSPropertyOutlineColor);
1176 1176
1177 GraphicsContext* graphicsContext = paintInfo.context; 1177 GraphicsContext* graphicsContext = paintInfo.getContext();
1178 bool useTransparencyLayer = outlineColor.hasAlpha(); 1178 bool useTransparencyLayer = outlineColor.hasAlpha();
1179 if (useTransparencyLayer) { 1179 if (useTransparencyLayer) {
1180 if (outlineStyle == SOLID) { 1180 if (outlineStyle == SOLID) {
1181 Path path; 1181 Path path;
1182 path.addRect(outer); 1182 path.addRect(outer);
1183 path.addRect(inner); 1183 path.addRect(inner);
1184 graphicsContext->setFillRule(RULE_EVENODD); 1184 graphicsContext->setFillRule(RULE_EVENODD);
1185 graphicsContext->setFillColor(outlineColor); 1185 graphicsContext->setFillColor(outlineColor);
1186 graphicsContext->fillPath(path); 1186 graphicsContext->fillPath(path);
1187 return; 1187 return;
(...skipping 2091 matching lines...) Expand 10 before | Expand all | Expand 10 after
3279 { 3279 {
3280 if (object1) { 3280 if (object1) {
3281 const WebCore::RenderObject* root = object1; 3281 const WebCore::RenderObject* root = object1;
3282 while (root->parent()) 3282 while (root->parent())
3283 root = root->parent(); 3283 root = root->parent();
3284 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); 3284 root->showRenderTreeAndMark(object1, "*", object2, "-", 0);
3285 } 3285 }
3286 } 3286 }
3287 3287
3288 #endif 3288 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698