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

Side by Side Diff: Source/core/rendering/svg/RenderSVGShape.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: Fixed Linux compilation (hopefuly Windows too), addressing some reviewer's suggestions. 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) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2008 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2008 Rob Buis <buis@kde.org>
4 * Copyright (C) 2005, 2007 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2005, 2007 Eric Seidel <eric@webkit.org>
5 * Copyright (C) 2009 Google, Inc. 5 * Copyright (C) 2009 Google, Inc.
6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> 6 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
7 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 7 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
8 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com> 8 * Copyright (C) 2009 Jeff Schiller <codedread@gmail.com>
9 * Copyright (C) 2011 Renata Hodovan <reni@webkit.org> 9 * Copyright (C) 2011 Renata Hodovan <reni@webkit.org>
10 * Copyright (C) 2011 University of Szeged 10 * Copyright (C) 2011 University of Szeged
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 return; 260 return;
261 } 261 }
262 262
263 strokeShape(style, context); 263 strokeShape(style, context);
264 } 264 }
265 265
266 void RenderSVGShape::paint(PaintInfo& paintInfo, const LayoutPoint&) 266 void RenderSVGShape::paint(PaintInfo& paintInfo, const LayoutPoint&)
267 { 267 {
268 ANNOTATE_GRAPHICS_CONTEXT(paintInfo, this); 268 ANNOTATE_GRAPHICS_CONTEXT(paintInfo, this);
269 269
270 if (paintInfo.context->paintingDisabled() || style()->visibility() == HIDDEN || isEmpty()) 270 if (paintInfo.getContext()->paintingDisabled() || style()->visibility() == H IDDEN || isEmpty())
271 return; 271 return;
272 FloatRect boundingBox = repaintRectInLocalCoordinates(); 272 FloatRect boundingBox = repaintRectInLocalCoordinates();
273 if (!SVGRenderSupport::paintInfoIntersectsRepaintRect(boundingBox, m_localTr ansform, paintInfo)) 273 if (!SVGRenderSupport::paintInfoIntersectsRepaintRect(boundingBox, m_localTr ansform, paintInfo))
274 return; 274 return;
275 275
276 PaintInfo childPaintInfo(paintInfo); 276 PaintInfo childPaintInfo(paintInfo);
277 bool drawsOutline = style()->outlineWidth() && (childPaintInfo.phase == Pain tPhaseOutline || childPaintInfo.phase == PaintPhaseSelfOutline); 277 bool drawsOutline = style()->outlineWidth() && (childPaintInfo.getPhase() == PaintPhaseOutline || childPaintInfo.getPhase() == PaintPhaseSelfOutline);
278 if (drawsOutline || childPaintInfo.phase == PaintPhaseForeground) { 278 if (drawsOutline || childPaintInfo.getPhase() == PaintPhaseForeground) {
279 GraphicsContextStateSaver stateSaver(*childPaintInfo.context); 279 GraphicsContextStateSaver stateSaver(*(childPaintInfo.getContext()));
280 childPaintInfo.applyTransform(m_localTransform); 280 childPaintInfo.applyTransform(m_localTransform);
281 281
282 if (childPaintInfo.phase == PaintPhaseForeground) { 282 if (childPaintInfo.getPhase() == PaintPhaseForeground) {
283 SVGRenderingContext renderingContext(this, childPaintInfo); 283 SVGRenderingContext renderingContext(this, childPaintInfo);
284 284
285 if (renderingContext.isRenderingPrepared()) { 285 if (renderingContext.isRenderingPrepared()) {
286 const SVGRenderStyle* svgStyle = style()->svgStyle(); 286 const SVGRenderStyle* svgStyle = style()->svgStyle();
287 if (svgStyle->shapeRendering() == SR_CRISPEDGES) 287 if (svgStyle->shapeRendering() == SR_CRISPEDGES)
288 childPaintInfo.context->setShouldAntialias(false); 288 childPaintInfo.getContext()->setShouldAntialias(false);
289 289
290 fillAndStrokeShape(childPaintInfo.context); 290 fillAndStrokeShape(childPaintInfo.getContext());
291 if (!m_markerPositions.isEmpty()) 291 if (!m_markerPositions.isEmpty())
292 drawMarkers(childPaintInfo); 292 drawMarkers(childPaintInfo);
293 } 293 }
294 } 294 }
295 295
296 if (drawsOutline) 296 if (drawsOutline)
297 paintOutline(childPaintInfo, IntRect(boundingBox)); 297 paintOutline(childPaintInfo, IntRect(boundingBox));
298 } 298 }
299 } 299 }
300 300
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
454 return; 454 return;
455 455
456 ASSERT(m_path); 456 ASSERT(m_path);
457 457
458 SVGMarkerData markerData(m_markerPositions); 458 SVGMarkerData markerData(m_markerPositions);
459 m_path->apply(&markerData, SVGMarkerData::updateFromPathElement); 459 m_path->apply(&markerData, SVGMarkerData::updateFromPathElement);
460 markerData.pathIsDone(); 460 markerData.pathIsDone();
461 } 461 }
462 462
463 } 463 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698