| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 #include "platform/graphics/Gradient.h" | 36 #include "platform/graphics/Gradient.h" |
| 37 #include "platform/graphics/GradientGeneratedImage.h" | 37 #include "platform/graphics/GradientGeneratedImage.h" |
| 38 #include "platform/graphics/Image.h" | 38 #include "platform/graphics/Image.h" |
| 39 #include "wtf/text/StringBuilder.h" | 39 #include "wtf/text/StringBuilder.h" |
| 40 #include "wtf/text/WTFString.h" | 40 #include "wtf/text/WTFString.h" |
| 41 | 41 |
| 42 using namespace std; | 42 using namespace std; |
| 43 | 43 |
| 44 namespace WebCore { | 44 namespace WebCore { |
| 45 | 45 |
| 46 void CSSGradientColorStop::trace(Visitor* visitor) |
| 47 { |
| 48 visitor->trace(m_position); |
| 49 visitor->trace(m_color); |
| 50 } |
| 51 |
| 46 PassRefPtr<Image> CSSGradientValue::image(RenderObject* renderer, const IntSize&
size) | 52 PassRefPtr<Image> CSSGradientValue::image(RenderObject* renderer, const IntSize&
size) |
| 47 { | 53 { |
| 48 if (size.isEmpty()) | 54 if (size.isEmpty()) |
| 49 return 0; | 55 return 0; |
| 50 | 56 |
| 51 bool cacheable = isCacheable(); | 57 bool cacheable = isCacheable(); |
| 52 if (cacheable) { | 58 if (cacheable) { |
| 53 if (!clients().contains(renderer)) | 59 if (!clients().contains(renderer)) |
| 54 return 0; | 60 return 0; |
| 55 | 61 |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 { | 460 { |
| 455 for (size_t i = 0; i < m_stops.size(); ++i) { | 461 for (size_t i = 0; i < m_stops.size(); ++i) { |
| 456 if (m_stops[i].m_resolvedColor.hasAlpha()) | 462 if (m_stops[i].m_resolvedColor.hasAlpha()) |
| 457 return false; | 463 return false; |
| 458 } | 464 } |
| 459 return true; | 465 return true; |
| 460 } | 466 } |
| 461 | 467 |
| 462 void CSSGradientValue::traceAfterDispatch(Visitor* visitor) | 468 void CSSGradientValue::traceAfterDispatch(Visitor* visitor) |
| 463 { | 469 { |
| 470 visitor->trace(m_firstX); |
| 471 visitor->trace(m_firstY); |
| 472 visitor->trace(m_secondX); |
| 473 visitor->trace(m_secondY); |
| 474 visitor->trace(m_stops); |
| 464 CSSImageGeneratorValue::traceAfterDispatch(visitor); | 475 CSSImageGeneratorValue::traceAfterDispatch(visitor); |
| 465 } | 476 } |
| 466 | 477 |
| 467 String CSSLinearGradientValue::customCSSText() const | 478 String CSSLinearGradientValue::customCSSText() const |
| 468 { | 479 { |
| 469 StringBuilder result; | 480 StringBuilder result; |
| 470 if (m_gradientType == CSSDeprecatedLinearGradient) { | 481 if (m_gradientType == CSSDeprecatedLinearGradient) { |
| 471 result.appendLiteral("-webkit-gradient(linear, "); | 482 result.appendLiteral("-webkit-gradient(linear, "); |
| 472 result.append(m_firstX->cssText()); | 483 result.append(m_firstX->cssText()); |
| 473 result.append(' '); | 484 result.append(' '); |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 732 else if (m_firstY) | 743 else if (m_firstY) |
| 733 equalXandY = compareCSSValuePtr(m_firstY, other.m_firstY) && !other.m_fi
rstX; | 744 equalXandY = compareCSSValuePtr(m_firstY, other.m_firstY) && !other.m_fi
rstX; |
| 734 else | 745 else |
| 735 equalXandY = !other.m_firstX && !other.m_firstY; | 746 equalXandY = !other.m_firstX && !other.m_firstY; |
| 736 | 747 |
| 737 return equalXandY && m_stops == other.m_stops; | 748 return equalXandY && m_stops == other.m_stops; |
| 738 } | 749 } |
| 739 | 750 |
| 740 void CSSLinearGradientValue::traceAfterDispatch(Visitor* visitor) | 751 void CSSLinearGradientValue::traceAfterDispatch(Visitor* visitor) |
| 741 { | 752 { |
| 753 visitor->trace(m_angle); |
| 742 CSSGradientValue::traceAfterDispatch(visitor); | 754 CSSGradientValue::traceAfterDispatch(visitor); |
| 743 } | 755 } |
| 744 | 756 |
| 745 String CSSRadialGradientValue::customCSSText() const | 757 String CSSRadialGradientValue::customCSSText() const |
| 746 { | 758 { |
| 747 StringBuilder result; | 759 StringBuilder result; |
| 748 | 760 |
| 749 if (m_gradientType == CSSDeprecatedRadialGradient) { | 761 if (m_gradientType == CSSDeprecatedRadialGradient) { |
| 750 result.appendLiteral("-webkit-gradient(radial, "); | 762 result.appendLiteral("-webkit-gradient(radial, "); |
| 751 result.append(m_firstX->cssText()); | 763 result.append(m_firstX->cssText()); |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1165 else { | 1177 else { |
| 1166 equalShape = !other.m_shape; | 1178 equalShape = !other.m_shape; |
| 1167 equalSizingBehavior = !other.m_sizingBehavior; | 1179 equalSizingBehavior = !other.m_sizingBehavior; |
| 1168 equalHorizontalAndVerticalSize = !other.m_endHorizontalSize && !other.m_
endVerticalSize; | 1180 equalHorizontalAndVerticalSize = !other.m_endHorizontalSize && !other.m_
endVerticalSize; |
| 1169 } | 1181 } |
| 1170 return equalShape && equalSizingBehavior && equalHorizontalAndVerticalSize &
& m_stops == other.m_stops; | 1182 return equalShape && equalSizingBehavior && equalHorizontalAndVerticalSize &
& m_stops == other.m_stops; |
| 1171 } | 1183 } |
| 1172 | 1184 |
| 1173 void CSSRadialGradientValue::traceAfterDispatch(Visitor* visitor) | 1185 void CSSRadialGradientValue::traceAfterDispatch(Visitor* visitor) |
| 1174 { | 1186 { |
| 1187 visitor->trace(m_firstRadius); |
| 1188 visitor->trace(m_secondRadius); |
| 1189 visitor->trace(m_shape); |
| 1190 visitor->trace(m_sizingBehavior); |
| 1191 visitor->trace(m_endHorizontalSize); |
| 1192 visitor->trace(m_endVerticalSize); |
| 1175 CSSGradientValue::traceAfterDispatch(visitor); | 1193 CSSGradientValue::traceAfterDispatch(visitor); |
| 1176 } | 1194 } |
| 1177 | 1195 |
| 1178 } // namespace WebCore | 1196 } // namespace WebCore |
| OLD | NEW |