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

Side by Side Diff: Source/core/rendering/RenderThemeChromiumMac.mm

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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/paint/ObjectPainter.cpp ('k') | Source/platform/graphics/GraphicsContext.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) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2008, 2009 Google, Inc. 3 * Copyright (C) 2008, 2009 Google, Inc.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after
1091 float fontScale = std::min(o->style()->fontSize() / baseFontSize, bounds.hei ght() / (baseArrowHeight * 2 + baseSpaceBetweenArrows)); 1091 float fontScale = std::min(o->style()->fontSize() / baseFontSize, bounds.hei ght() / (baseArrowHeight * 2 + baseSpaceBetweenArrows));
1092 float centerY = bounds.y() + bounds.height() / 2.0f; 1092 float centerY = bounds.y() + bounds.height() / 2.0f;
1093 float arrowHeight = baseArrowHeight * fontScale; 1093 float arrowHeight = baseArrowHeight * fontScale;
1094 float arrowWidth = baseArrowWidth * fontScale; 1094 float arrowWidth = baseArrowWidth * fontScale;
1095 float leftEdge = bounds.maxX() - arrowPaddingRight * o->style()->effectiveZo om() - arrowWidth; 1095 float leftEdge = bounds.maxX() - arrowPaddingRight * o->style()->effectiveZo om() - arrowWidth;
1096 float spaceBetweenArrows = baseSpaceBetweenArrows * fontScale; 1096 float spaceBetweenArrows = baseSpaceBetweenArrows * fontScale;
1097 1097
1098 if (bounds.width() < arrowWidth + arrowPaddingLeft * o->style()->effectiveZo om()) 1098 if (bounds.width() < arrowWidth + arrowPaddingLeft * o->style()->effectiveZo om())
1099 return false; 1099 return false;
1100 1100
1101 GraphicsContextStateSaver stateSaver(*paintInfo.context); 1101 Color color = o->style()->visitedDependentColor(CSSPropertyColor);
1102
1103 paintInfo.context->setFillColor(o->style()->visitedDependentColor(CSSPropert yColor));
1104 paintInfo.context->setStrokeStyle(NoStroke);
1105 1102
1106 FloatPoint arrow1[3]; 1103 FloatPoint arrow1[3];
1107 arrow1[0] = FloatPoint(leftEdge, centerY - spaceBetweenArrows / 2.0f); 1104 arrow1[0] = FloatPoint(leftEdge, centerY - spaceBetweenArrows / 2.0f);
1108 arrow1[1] = FloatPoint(leftEdge + arrowWidth, centerY - spaceBetweenArrows / 2.0f); 1105 arrow1[1] = FloatPoint(leftEdge + arrowWidth, centerY - spaceBetweenArrows / 2.0f);
1109 arrow1[2] = FloatPoint(leftEdge + arrowWidth / 2.0f, centerY - spaceBetweenA rrows / 2.0f - arrowHeight); 1106 arrow1[2] = FloatPoint(leftEdge + arrowWidth / 2.0f, centerY - spaceBetweenA rrows / 2.0f - arrowHeight);
1110 1107
1111 // Draw the top arrow. 1108 // Draw the top arrow.
1112 paintInfo.context->drawConvexPolygon(3, arrow1, true); 1109 paintInfo.context->fillPolygon(3, arrow1, color, true);
1113 1110
1114 FloatPoint arrow2[3]; 1111 FloatPoint arrow2[3];
1115 arrow2[0] = FloatPoint(leftEdge, centerY + spaceBetweenArrows / 2.0f); 1112 arrow2[0] = FloatPoint(leftEdge, centerY + spaceBetweenArrows / 2.0f);
1116 arrow2[1] = FloatPoint(leftEdge + arrowWidth, centerY + spaceBetweenArrows / 2.0f); 1113 arrow2[1] = FloatPoint(leftEdge + arrowWidth, centerY + spaceBetweenArrows / 2.0f);
1117 arrow2[2] = FloatPoint(leftEdge + arrowWidth / 2.0f, centerY + spaceBetweenA rrows / 2.0f + arrowHeight); 1114 arrow2[2] = FloatPoint(leftEdge + arrowWidth / 2.0f, centerY + spaceBetweenA rrows / 2.0f + arrowHeight);
1118 1115
1119 // Draw the bottom arrow. 1116 // Draw the bottom arrow.
1120 paintInfo.context->drawConvexPolygon(3, arrow2, true); 1117 paintInfo.context->fillPolygon(3, arrow2, color, true);
1121 return false; 1118 return false;
1122 } 1119 }
1123 1120
1124 static const IntSize* menuListButtonSizes() 1121 static const IntSize* menuListButtonSizes()
1125 { 1122 {
1126 static const IntSize sizes[3] = { IntSize(0, 21), IntSize(0, 18), IntSize(0, 15) }; 1123 static const IntSize sizes[3] = { IntSize(0, 21), IntSize(0, 18), IntSize(0, 15) };
1127 return sizes; 1124 return sizes;
1128 } 1125 }
1129 1126
1130 void RenderThemeChromiumMac::adjustMenuListStyle(RenderStyle* style, Element* e) const 1127 void RenderThemeChromiumMac::adjustMenuListStyle(RenderStyle* style, Element* e) const
(...skipping 743 matching lines...) Expand 10 before | Expand all | Expand 10 after
1874 1871
1875 bool RenderThemeChromiumMac::shouldUseFallbackTheme(RenderStyle* style) const 1872 bool RenderThemeChromiumMac::shouldUseFallbackTheme(RenderStyle* style) const
1876 { 1873 {
1877 ControlPart part = style->appearance(); 1874 ControlPart part = style->appearance();
1878 if (part == CheckboxPart || part == RadioPart) 1875 if (part == CheckboxPart || part == RadioPart)
1879 return style->effectiveZoom() != 1; 1876 return style->effectiveZoom() != 1;
1880 return false; 1877 return false;
1881 } 1878 }
1882 1879
1883 } // namespace blink 1880 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/paint/ObjectPainter.cpp ('k') | Source/platform/graphics/GraphicsContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698