| 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 | |
| 52 PassRefPtr<Image> CSSGradientValue::image(RenderObject* renderer, const IntSize&
size) | 46 PassRefPtr<Image> CSSGradientValue::image(RenderObject* renderer, const IntSize&
size) |
| 53 { | 47 { |
| 54 if (size.isEmpty()) | 48 if (size.isEmpty()) |
| 55 return 0; | 49 return 0; |
| 56 | 50 |
| 57 bool cacheable = isCacheable(); | 51 bool cacheable = isCacheable(); |
| 58 if (cacheable) { | 52 if (cacheable) { |
| 59 if (!clients().contains(renderer)) | 53 if (!clients().contains(renderer)) |
| 60 return 0; | 54 return 0; |
| 61 | 55 |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 { | 454 { |
| 461 for (size_t i = 0; i < m_stops.size(); ++i) { | 455 for (size_t i = 0; i < m_stops.size(); ++i) { |
| 462 if (m_stops[i].m_resolvedColor.hasAlpha()) | 456 if (m_stops[i].m_resolvedColor.hasAlpha()) |
| 463 return false; | 457 return false; |
| 464 } | 458 } |
| 465 return true; | 459 return true; |
| 466 } | 460 } |
| 467 | 461 |
| 468 void CSSGradientValue::traceAfterDispatch(Visitor* visitor) | 462 void CSSGradientValue::traceAfterDispatch(Visitor* visitor) |
| 469 { | 463 { |
| 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); | |
| 475 CSSImageGeneratorValue::traceAfterDispatch(visitor); | 464 CSSImageGeneratorValue::traceAfterDispatch(visitor); |
| 476 } | 465 } |
| 477 | 466 |
| 478 String CSSLinearGradientValue::customCSSText() const | 467 String CSSLinearGradientValue::customCSSText() const |
| 479 { | 468 { |
| 480 StringBuilder result; | 469 StringBuilder result; |
| 481 if (m_gradientType == CSSDeprecatedLinearGradient) { | 470 if (m_gradientType == CSSDeprecatedLinearGradient) { |
| 482 result.appendLiteral("-webkit-gradient(linear, "); | 471 result.appendLiteral("-webkit-gradient(linear, "); |
| 483 result.append(m_firstX->cssText()); | 472 result.append(m_firstX->cssText()); |
| 484 result.append(' '); | 473 result.append(' '); |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 743 else if (m_firstY) | 732 else if (m_firstY) |
| 744 equalXandY = compareCSSValuePtr(m_firstY, other.m_firstY) && !other.m_fi
rstX; | 733 equalXandY = compareCSSValuePtr(m_firstY, other.m_firstY) && !other.m_fi
rstX; |
| 745 else | 734 else |
| 746 equalXandY = !other.m_firstX && !other.m_firstY; | 735 equalXandY = !other.m_firstX && !other.m_firstY; |
| 747 | 736 |
| 748 return equalXandY && m_stops == other.m_stops; | 737 return equalXandY && m_stops == other.m_stops; |
| 749 } | 738 } |
| 750 | 739 |
| 751 void CSSLinearGradientValue::traceAfterDispatch(Visitor* visitor) | 740 void CSSLinearGradientValue::traceAfterDispatch(Visitor* visitor) |
| 752 { | 741 { |
| 753 visitor->trace(m_angle); | |
| 754 CSSGradientValue::traceAfterDispatch(visitor); | 742 CSSGradientValue::traceAfterDispatch(visitor); |
| 755 } | 743 } |
| 756 | 744 |
| 757 String CSSRadialGradientValue::customCSSText() const | 745 String CSSRadialGradientValue::customCSSText() const |
| 758 { | 746 { |
| 759 StringBuilder result; | 747 StringBuilder result; |
| 760 | 748 |
| 761 if (m_gradientType == CSSDeprecatedRadialGradient) { | 749 if (m_gradientType == CSSDeprecatedRadialGradient) { |
| 762 result.appendLiteral("-webkit-gradient(radial, "); | 750 result.appendLiteral("-webkit-gradient(radial, "); |
| 763 result.append(m_firstX->cssText()); | 751 result.append(m_firstX->cssText()); |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1177 else { | 1165 else { |
| 1178 equalShape = !other.m_shape; | 1166 equalShape = !other.m_shape; |
| 1179 equalSizingBehavior = !other.m_sizingBehavior; | 1167 equalSizingBehavior = !other.m_sizingBehavior; |
| 1180 equalHorizontalAndVerticalSize = !other.m_endHorizontalSize && !other.m_
endVerticalSize; | 1168 equalHorizontalAndVerticalSize = !other.m_endHorizontalSize && !other.m_
endVerticalSize; |
| 1181 } | 1169 } |
| 1182 return equalShape && equalSizingBehavior && equalHorizontalAndVerticalSize &
& m_stops == other.m_stops; | 1170 return equalShape && equalSizingBehavior && equalHorizontalAndVerticalSize &
& m_stops == other.m_stops; |
| 1183 } | 1171 } |
| 1184 | 1172 |
| 1185 void CSSRadialGradientValue::traceAfterDispatch(Visitor* visitor) | 1173 void CSSRadialGradientValue::traceAfterDispatch(Visitor* visitor) |
| 1186 { | 1174 { |
| 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); | |
| 1193 CSSGradientValue::traceAfterDispatch(visitor); | 1175 CSSGradientValue::traceAfterDispatch(visitor); |
| 1194 } | 1176 } |
| 1195 | 1177 |
| 1196 } // namespace WebCore | 1178 } // namespace WebCore |
| OLD | NEW |