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

Unified Diff: Source/core/paint/ObjectPainter.cpp

Issue 657023006: GC::drawConvexPolygon() & friends cleanup (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: speculative RenderThemeChromiumMac fix Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/paint/BoxPainter.cpp ('k') | Source/core/rendering/RenderThemeChromiumMac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/ObjectPainter.cpp
diff --git a/Source/core/paint/ObjectPainter.cpp b/Source/core/paint/ObjectPainter.cpp
index 9663588702297dae5dbfeb990067034263ed236c..69be8db0c41695f08710789381aac5938e92f1fa 100644
--- a/Source/core/paint/ObjectPainter.cpp
+++ b/Source/core/paint/ObjectPainter.cpp
@@ -299,21 +299,21 @@ void ObjectPainter::drawRidgeOrGrooveBoxSide(GraphicsContext* graphicsContext, i
void ObjectPainter::drawSolidBoxSide(GraphicsContext* graphicsContext, int x1, int y1, int x2, int y2,
BoxSide side, Color color, int adjacentWidth1, int adjacentWidth2, bool antialias)
{
- StrokeStyle oldStrokeStyle = graphicsContext->strokeStyle();
- graphicsContext->setStrokeStyle(NoStroke);
- graphicsContext->setFillColor(color);
ASSERT(x2 >= x1);
ASSERT(y2 >= y1);
+
if (!adjacentWidth1 && !adjacentWidth2) {
- // Turn off antialiasing to match the behavior of drawConvexPolygon();
+ // Tweak antialiasing to match the behavior of fillPolygon();
// this matters for rects in transformed contexts.
bool wasAntialiased = graphicsContext->shouldAntialias();
- graphicsContext->setShouldAntialias(antialias);
- graphicsContext->drawRect(IntRect(x1, y1, x2 - x1, y2 - y1));
- graphicsContext->setShouldAntialias(wasAntialiased);
- graphicsContext->setStrokeStyle(oldStrokeStyle);
+ if (antialias != wasAntialiased)
+ graphicsContext->setShouldAntialias(antialias);
+ graphicsContext->fillRect(IntRect(x1, y1, x2 - x1, y2 - y1), color);
+ if (antialias != wasAntialiased)
+ graphicsContext->setShouldAntialias(wasAntialiased);
return;
}
+
FloatPoint quad[4];
switch (side) {
case BSTop:
@@ -342,8 +342,7 @@ void ObjectPainter::drawSolidBoxSide(GraphicsContext* graphicsContext, int x1, i
break;
}
- graphicsContext->drawConvexPolygon(4, quad, antialias);
- graphicsContext->setStrokeStyle(oldStrokeStyle);
+ graphicsContext->fillPolygon(4, quad, color, antialias);
}
} // namespace blink
« no previous file with comments | « Source/core/paint/BoxPainter.cpp ('k') | Source/core/rendering/RenderThemeChromiumMac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698