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

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

Issue 591613003: Move painting code from RenderObject into a new ObjectPainter class. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Merge again. Created 6 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/paint/BoxPainter.h ('k') | Source/core/paint/ObjectPainter.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 // 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/BoxPainter.h" 6 #include "core/paint/BoxPainter.h"
7 7
8 #include "core/HTMLNames.h" 8 #include "core/HTMLNames.h"
9 #include "core/frame/Settings.h" 9 #include "core/frame/Settings.h"
10 #include "core/html/HTMLFrameOwnerElement.h" 10 #include "core/html/HTMLFrameOwnerElement.h"
(...skipping 1617 matching lines...) Expand 10 before | Expand all | Expand 10 after
1628 GraphicsContextStateSaver clipStateSaver(*graphicsContext, shouldClip); 1628 GraphicsContextStateSaver clipStateSaver(*graphicsContext, shouldClip);
1629 if (shouldClip) { 1629 if (shouldClip) {
1630 bool aliasAdjacentSide1 = clipAdjacentSide1 || (clipForStyle && mitr eAdjacentSide1); 1630 bool aliasAdjacentSide1 = clipAdjacentSide1 || (clipForStyle && mitr eAdjacentSide1);
1631 bool aliasAdjacentSide2 = clipAdjacentSide2 || (clipForStyle && mitr eAdjacentSide2); 1631 bool aliasAdjacentSide2 = clipAdjacentSide2 || (clipForStyle && mitr eAdjacentSide2);
1632 clipBorderSidePolygon(graphicsContext, outerBorder, innerBorder, sid e, !aliasAdjacentSide1, !aliasAdjacentSide2); 1632 clipBorderSidePolygon(graphicsContext, outerBorder, innerBorder, sid e, !aliasAdjacentSide1, !aliasAdjacentSide2);
1633 // Since we clipped, no need to draw with a mitre. 1633 // Since we clipped, no need to draw with a mitre.
1634 mitreAdjacentSide1 = false; 1634 mitreAdjacentSide1 = false;
1635 mitreAdjacentSide2 = false; 1635 mitreAdjacentSide2 = false;
1636 } 1636 }
1637 1637
1638 obj.drawLineForBoxSide(graphicsContext, sideRect.x(), sideRect.y(), side Rect.maxX(), sideRect.maxY(), side, colorToPaint, edgeToRender.borderStyle(), 1638 ObjectPainter::drawLineForBoxSide(graphicsContext, sideRect.x(), sideRec t.y(), sideRect.maxX(), sideRect.maxY(), side, colorToPaint, edgeToRender.border Style(),
1639 mitreAdjacentSide1 ? adjacentEdge1.width : 0, mitreAdjacentSide2 ? a djacentEdge2.width : 0, antialias); 1639 mitreAdjacentSide1 ? adjacentEdge1.width : 0, mitreAdjacentSide2 ? a djacentEdge2.width : 0, antialias);
1640 } 1640 }
1641 } 1641 }
1642 1642
1643 void BoxPainter::paintBorderSides(RenderObject& obj, GraphicsContext* graphicsCo ntext, const RenderStyle* style, const RoundedRect& outerBorder, const RoundedRe ct& innerBorder, 1643 void BoxPainter::paintBorderSides(RenderObject& obj, GraphicsContext* graphicsCo ntext, const RenderStyle* style, const RoundedRect& outerBorder, const RoundedRe ct& innerBorder,
1644 const IntPoint& innerBorderAdjustment, const BorderEdge edges[], BorderEdgeF lags edgeSet, BackgroundBleedAvoidance bleedAvoidance, 1644 const IntPoint& innerBorderAdjustment, const BorderEdge edges[], BorderEdgeF lags edgeSet, BackgroundBleedAvoidance bleedAvoidance,
1645 bool includeLogicalLeftEdge, bool includeLogicalRightEdge, bool antialias, c onst Color* overrideColor) 1645 bool includeLogicalLeftEdge, bool includeLogicalRightEdge, bool antialias, c onst Color* overrideColor)
1646 { 1646 {
1647 bool renderRadii = outerBorder.isRounded(); 1647 bool renderRadii = outerBorder.isRounded();
1648 1648
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
2147 2147
2148 FloatPoint secondQuad[4]; 2148 FloatPoint secondQuad[4];
2149 secondQuad[0] = quad[0]; 2149 secondQuad[0] = quad[0];
2150 secondQuad[1] = FloatPoint(quad[0].x() - r1 * cx, quad[0].y() - r1 * cy); 2150 secondQuad[1] = FloatPoint(quad[0].x() - r1 * cx, quad[0].y() - r1 * cy);
2151 secondQuad[2] = quad[2]; 2151 secondQuad[2] = quad[2];
2152 secondQuad[3] = quad[3]; 2152 secondQuad[3] = quad[3];
2153 graphicsContext->clipConvexPolygon(4, secondQuad, !secondEdgeMatches); 2153 graphicsContext->clipConvexPolygon(4, secondQuad, !secondEdgeMatches);
2154 } 2154 }
2155 2155
2156 } // namespace blink 2156 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/paint/BoxPainter.h ('k') | Source/core/paint/ObjectPainter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698