| OLD | NEW |
| 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 897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 908 switch (style) { | 908 switch (style) { |
| 909 case BNONE: | 909 case BNONE: |
| 910 case BHIDDEN: | 910 case BHIDDEN: |
| 911 return; | 911 return; |
| 912 case DOTTED: | 912 case DOTTED: |
| 913 case DASHED: { | 913 case DASHED: { |
| 914 if (thickness > 0) { | 914 if (thickness > 0) { |
| 915 bool wasAntialiased = graphicsContext->shouldAntialias(); | 915 bool wasAntialiased = graphicsContext->shouldAntialias(); |
| 916 StrokeStyle oldStrokeStyle = graphicsContext->strokeStyle(); | 916 StrokeStyle oldStrokeStyle = graphicsContext->strokeStyle(); |
| 917 graphicsContext->setShouldAntialias(antialias); | 917 graphicsContext->setShouldAntialias(antialias); |
| 918 graphicsContext->setStrokeColor(color, m_style->colorSpace()); | 918 graphicsContext->setStrokeColor(color); |
| 919 graphicsContext->setStrokeThickness(thickness); | 919 graphicsContext->setStrokeThickness(thickness); |
| 920 graphicsContext->setStrokeStyle(style == DASHED ? DashedStroke :
DottedStroke); | 920 graphicsContext->setStrokeStyle(style == DASHED ? DashedStroke :
DottedStroke); |
| 921 | 921 |
| 922 switch (side) { | 922 switch (side) { |
| 923 case BSBottom: | 923 case BSBottom: |
| 924 case BSTop: | 924 case BSTop: |
| 925 graphicsContext->drawLine(IntPoint(x1, (y1 + y2) / 2), I
ntPoint(x2, (y1 + y2) / 2)); | 925 graphicsContext->drawLine(IntPoint(x1, (y1 + y2) / 2), I
ntPoint(x2, (y1 + y2) / 2)); |
| 926 break; | 926 break; |
| 927 case BSRight: | 927 case BSRight: |
| 928 case BSLeft: | 928 case BSLeft: |
| 929 graphicsContext->drawLine(IntPoint((x1 + x2) / 2, y1), I
ntPoint((x1 + x2) / 2, y2)); | 929 graphicsContext->drawLine(IntPoint((x1 + x2) / 2, y1), I
ntPoint((x1 + x2) / 2, y2)); |
| 930 break; | 930 break; |
| 931 } | 931 } |
| 932 graphicsContext->setShouldAntialias(wasAntialiased); | 932 graphicsContext->setShouldAntialias(wasAntialiased); |
| 933 graphicsContext->setStrokeStyle(oldStrokeStyle); | 933 graphicsContext->setStrokeStyle(oldStrokeStyle); |
| 934 } | 934 } |
| 935 break; | 935 break; |
| 936 } | 936 } |
| 937 case DOUBLE: { | 937 case DOUBLE: { |
| 938 int thirdOfThickness = (thickness + 1) / 3; | 938 int thirdOfThickness = (thickness + 1) / 3; |
| 939 ASSERT(thirdOfThickness); | 939 ASSERT(thirdOfThickness); |
| 940 | 940 |
| 941 if (adjacentWidth1 == 0 && adjacentWidth2 == 0) { | 941 if (adjacentWidth1 == 0 && adjacentWidth2 == 0) { |
| 942 StrokeStyle oldStrokeStyle = graphicsContext->strokeStyle(); | 942 StrokeStyle oldStrokeStyle = graphicsContext->strokeStyle(); |
| 943 graphicsContext->setStrokeStyle(NoStroke); | 943 graphicsContext->setStrokeStyle(NoStroke); |
| 944 graphicsContext->setFillColor(color, m_style->colorSpace()); | 944 graphicsContext->setFillColor(color); |
| 945 | 945 |
| 946 bool wasAntialiased = graphicsContext->shouldAntialias(); | 946 bool wasAntialiased = graphicsContext->shouldAntialias(); |
| 947 graphicsContext->setShouldAntialias(antialias); | 947 graphicsContext->setShouldAntialias(antialias); |
| 948 | 948 |
| 949 switch (side) { | 949 switch (side) { |
| 950 case BSTop: | 950 case BSTop: |
| 951 case BSBottom: | 951 case BSBottom: |
| 952 graphicsContext->drawRect(IntRect(x1, y1, length, thirdO
fThickness)); | 952 graphicsContext->drawRect(IntRect(x1, y1, length, thirdO
fThickness)); |
| 953 graphicsContext->drawRect(IntRect(x1, y2 - thirdOfThickn
ess, length, thirdOfThickness)); | 953 graphicsContext->drawRect(IntRect(x1, y2 - thirdOfThickn
ess, length, thirdOfThickness)); |
| 954 break; | 954 break; |
| 955 case BSLeft: | 955 case BSLeft: |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1056 if (side == BSTop || side == BSLeft) | 1056 if (side == BSTop || side == BSLeft) |
| 1057 color = color.dark(); | 1057 color = color.dark(); |
| 1058 // fall through | 1058 // fall through |
| 1059 case OUTSET: | 1059 case OUTSET: |
| 1060 if (style == OUTSET && (side == BSBottom || side == BSRight)) | 1060 if (style == OUTSET && (side == BSBottom || side == BSRight)) |
| 1061 color = color.dark(); | 1061 color = color.dark(); |
| 1062 // fall through | 1062 // fall through |
| 1063 case SOLID: { | 1063 case SOLID: { |
| 1064 StrokeStyle oldStrokeStyle = graphicsContext->strokeStyle(); | 1064 StrokeStyle oldStrokeStyle = graphicsContext->strokeStyle(); |
| 1065 graphicsContext->setStrokeStyle(NoStroke); | 1065 graphicsContext->setStrokeStyle(NoStroke); |
| 1066 graphicsContext->setFillColor(color, m_style->colorSpace()); | 1066 graphicsContext->setFillColor(color); |
| 1067 ASSERT(x2 >= x1); | 1067 ASSERT(x2 >= x1); |
| 1068 ASSERT(y2 >= y1); | 1068 ASSERT(y2 >= y1); |
| 1069 if (!adjacentWidth1 && !adjacentWidth2) { | 1069 if (!adjacentWidth1 && !adjacentWidth2) { |
| 1070 // Turn off antialiasing to match the behavior of drawConvexPoly
gon(); | 1070 // Turn off antialiasing to match the behavior of drawConvexPoly
gon(); |
| 1071 // this matters for rects in transformed contexts. | 1071 // this matters for rects in transformed contexts. |
| 1072 bool wasAntialiased = graphicsContext->shouldAntialias(); | 1072 bool wasAntialiased = graphicsContext->shouldAntialias(); |
| 1073 graphicsContext->setShouldAntialias(antialias); | 1073 graphicsContext->setShouldAntialias(antialias); |
| 1074 graphicsContext->drawRect(IntRect(x1, y1, x2 - x1, y2 - y1)); | 1074 graphicsContext->drawRect(IntRect(x1, y1, x2 - x1, y2 - y1)); |
| 1075 graphicsContext->setShouldAntialias(wasAntialiased); | 1075 graphicsContext->setShouldAntialias(wasAntialiased); |
| 1076 graphicsContext->setStrokeStyle(oldStrokeStyle); | 1076 graphicsContext->setStrokeStyle(oldStrokeStyle); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1177 Color outlineColor = styleToUse->visitedDependentColor(CSSPropertyOutlineCol
or); | 1177 Color outlineColor = styleToUse->visitedDependentColor(CSSPropertyOutlineCol
or); |
| 1178 | 1178 |
| 1179 GraphicsContext* graphicsContext = paintInfo.context; | 1179 GraphicsContext* graphicsContext = paintInfo.context; |
| 1180 bool useTransparencyLayer = outlineColor.hasAlpha(); | 1180 bool useTransparencyLayer = outlineColor.hasAlpha(); |
| 1181 if (useTransparencyLayer) { | 1181 if (useTransparencyLayer) { |
| 1182 if (outlineStyle == SOLID) { | 1182 if (outlineStyle == SOLID) { |
| 1183 Path path; | 1183 Path path; |
| 1184 path.addRect(outer); | 1184 path.addRect(outer); |
| 1185 path.addRect(inner); | 1185 path.addRect(inner); |
| 1186 graphicsContext->setFillRule(RULE_EVENODD); | 1186 graphicsContext->setFillRule(RULE_EVENODD); |
| 1187 graphicsContext->setFillColor(outlineColor, styleToUse->colorSpace()
); | 1187 graphicsContext->setFillColor(outlineColor); |
| 1188 graphicsContext->fillPath(path); | 1188 graphicsContext->fillPath(path); |
| 1189 return; | 1189 return; |
| 1190 } | 1190 } |
| 1191 graphicsContext->beginTransparencyLayer(static_cast<float>(outlineColor.
alpha()) / 255); | 1191 graphicsContext->beginTransparencyLayer(static_cast<float>(outlineColor.
alpha()) / 255); |
| 1192 outlineColor = Color(outlineColor.red(), outlineColor.green(), outlineCo
lor.blue()); | 1192 outlineColor = Color(outlineColor.red(), outlineColor.green(), outlineCo
lor.blue()); |
| 1193 } | 1193 } |
| 1194 | 1194 |
| 1195 int leftOuter = outer.x(); | 1195 int leftOuter = outer.x(); |
| 1196 int leftInner = inner.x(); | 1196 int leftInner = inner.x(); |
| 1197 int rightOuter = outer.maxX(); | 1197 int rightOuter = outer.maxX(); |
| (...skipping 1993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3191 { | 3191 { |
| 3192 if (object1) { | 3192 if (object1) { |
| 3193 const WebCore::RenderObject* root = object1; | 3193 const WebCore::RenderObject* root = object1; |
| 3194 while (root->parent()) | 3194 while (root->parent()) |
| 3195 root = root->parent(); | 3195 root = root->parent(); |
| 3196 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); | 3196 root->showRenderTreeAndMark(object1, "*", object2, "-", 0); |
| 3197 } | 3197 } |
| 3198 } | 3198 } |
| 3199 | 3199 |
| 3200 #endif | 3200 #endif |
| OLD | NEW |