Changeset 57482 in webkit
- Timestamp:
- Apr 12, 2010 2:53:35 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r57479 r57482 1 2010-04-12 David Hyatt <hyatt@apple.com> 2 3 Reviewed by Dan Bernstein. 4 5 https://bugs.webkit.org/show_bug.cgi?id=37469, clean up ShadowData to be encapsulated properly. 6 7 * css/CSSComputedStyleDeclaration.cpp: 8 (WebCore::CSSComputedStyleDeclaration::valueForShadow): 9 * page/animation/AnimationBase.cpp: 10 (WebCore::blendFunc): 11 (WebCore::PropertyWrapperShadow::PropertyWrapperShadow): 12 (WebCore::PropertyWrapperShadow::equals): 13 (WebCore::PropertyWrapperShadow::blend): 14 * page/mac/FrameMac.mm: 15 (WebCore::Frame::fontAttributesForSelectionStart): 16 * rendering/EllipsisBox.cpp: 17 (WebCore::EllipsisBox::paint): 18 * rendering/InlineFlowBox.cpp: 19 (WebCore::InlineFlowBox::placeBoxesHorizontally): 20 (WebCore::InlineFlowBox::computeVerticalOverflow): 21 (WebCore::InlineFlowBox::paintTextDecorations): 22 * rendering/InlineTextBox.cpp: 23 (WebCore::paintTextWithShadows): 24 (WebCore::InlineTextBox::paint): 25 (WebCore::InlineTextBox::paintDecoration): 26 * rendering/InlineTextBox.h: 27 * rendering/RenderBoxModelObject.cpp: 28 (WebCore::RenderBoxModelObject::paintBoxShadow): 29 * rendering/RenderLayer.cpp: 30 (WebCore::RenderLayer::calculateRects): 31 * rendering/RenderObject.cpp: 32 (WebCore::RenderObject::adjustRectForOutlineAndShadow): 33 * rendering/SVGInlineTextBox.cpp: 34 (WebCore::SVGInlineTextBox::paintCharacters): 35 * rendering/SVGRenderSupport.cpp: 36 (WebCore::SVGRenderBase::prepareToRenderSVGContent): 37 * rendering/style/RenderStyle.cpp: 38 (WebCore::RenderStyle::setTextShadow): 39 (WebCore::RenderStyle::setBoxShadow): 40 (WebCore::RenderStyle::getBoxShadowExtent): 41 (WebCore::RenderStyle::getBoxShadowHorizontalExtent): 42 (WebCore::RenderStyle::getBoxShadowVerticalExtent): 43 * rendering/style/RenderStyle.h: 44 (WebCore::InheritedFlags::textShadow): 45 (WebCore::InheritedFlags::boxShadow): 46 * rendering/style/SVGRenderStyle.cpp: 47 (WebCore::getSVGShadowExtent): 48 * rendering/style/ShadowData.cpp: 49 (WebCore::ShadowData::ShadowData): 50 (WebCore::ShadowData::operator==): 51 * rendering/style/ShadowData.h: 52 (WebCore::ShadowData::ShadowData): 53 (WebCore::ShadowData::~ShadowData): 54 (WebCore::ShadowData::x): 55 (WebCore::ShadowData::y): 56 (WebCore::ShadowData::blur): 57 (WebCore::ShadowData::spread): 58 (WebCore::ShadowData::style): 59 (WebCore::ShadowData::color): 60 (WebCore::ShadowData::next): 61 (WebCore::ShadowData::setNext): 62 1 63 2010-04-12 David Hyatt <hyatt@apple.com> 2 64 -
trunk/WebCore/css/CSSComputedStyleDeclaration.cpp
r57479 r57482 565 565 566 566 RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); 567 for (const ShadowData* s = shadow; s; s = s->next ) {568 RefPtr<CSSPrimitiveValue> x = CSSPrimitiveValue::create(s->x , CSSPrimitiveValue::CSS_PX);569 RefPtr<CSSPrimitiveValue> y = CSSPrimitiveValue::create(s->y , CSSPrimitiveValue::CSS_PX);570 RefPtr<CSSPrimitiveValue> blur = CSSPrimitiveValue::create(s->blur , CSSPrimitiveValue::CSS_PX);571 RefPtr<CSSPrimitiveValue> spread = propertyID == CSSPropertyTextShadow ? 0 : CSSPrimitiveValue::create(s->spread , CSSPrimitiveValue::CSS_PX);572 RefPtr<CSSPrimitiveValue> style = propertyID == CSSPropertyTextShadow || s->style == Normal ? 0 : CSSPrimitiveValue::createIdentifier(CSSValueInset);573 RefPtr<CSSPrimitiveValue> color = CSSPrimitiveValue::createColor(s->color .rgb());567 for (const ShadowData* s = shadow; s; s = s->next()) { 568 RefPtr<CSSPrimitiveValue> x = CSSPrimitiveValue::create(s->x(), CSSPrimitiveValue::CSS_PX); 569 RefPtr<CSSPrimitiveValue> y = CSSPrimitiveValue::create(s->y(), CSSPrimitiveValue::CSS_PX); 570 RefPtr<CSSPrimitiveValue> blur = CSSPrimitiveValue::create(s->blur(), CSSPrimitiveValue::CSS_PX); 571 RefPtr<CSSPrimitiveValue> spread = propertyID == CSSPropertyTextShadow ? 0 : CSSPrimitiveValue::create(s->spread(), CSSPrimitiveValue::CSS_PX); 572 RefPtr<CSSPrimitiveValue> style = propertyID == CSSPropertyTextShadow || s->style() == Normal ? 0 : CSSPrimitiveValue::createIdentifier(CSSValueInset); 573 RefPtr<CSSPrimitiveValue> color = CSSPrimitiveValue::createColor(s->color().rgb()); 574 574 list->prepend(ShadowValue::create(x.release(), y.release(), blur.release(), spread.release(), style.release(), color.release())); 575 575 } -
trunk/WebCore/page/animation/AnimationBase.cpp
r56825 r57482 136 136 { 137 137 ASSERT(from && to); 138 return new ShadowData(blendFunc(anim, from->x , to->x, progress), blendFunc(anim, from->y, to->y, progress),139 blendFunc(anim, from->blur , to->blur, progress), blendFunc(anim, from->spread, to->spread, progress),140 blendFunc(anim, from->style , to->style, progress), blendFunc(anim, from->color, to->color, progress));138 return new ShadowData(blendFunc(anim, from->x(), to->x(), progress), blendFunc(anim, from->y(), to->y(), progress), 139 blendFunc(anim, from->blur(), to->blur(), progress), blendFunc(anim, from->spread(), to->spread(), progress), 140 blendFunc(anim, from->style(), to->style(), progress), blendFunc(anim, from->color(), to->color(), progress)); 141 141 } 142 142 … … 297 297 #endif // USE(ACCELERATED_COMPOSITING) 298 298 299 class PropertyWrapperShadow : public PropertyWrapper Getter<ShadowData*>{299 class PropertyWrapperShadow : public PropertyWrapperBase { 300 300 public: 301 PropertyWrapperShadow(int prop, ShadowData* (RenderStyle::*getter)() const, void (RenderStyle::*setter)(ShadowData*, bool)) 302 : PropertyWrapperGetter<ShadowData*>(prop, getter) 301 PropertyWrapperShadow(int prop, const ShadowData* (RenderStyle::*getter)() const, void (RenderStyle::*setter)(ShadowData*, bool)) 302 : PropertyWrapperBase(prop) 303 , m_getter(getter) 303 304 , m_setter(setter) 304 305 { … … 307 308 virtual bool equals(const RenderStyle* a, const RenderStyle* b) const 308 309 { 309 ShadowData* shadowA = (a->*m_getter)();310 ShadowData* shadowB = (b->*m_getter)();310 const ShadowData* shadowA = (a->*m_getter)(); 311 const ShadowData* shadowB = (b->*m_getter)(); 311 312 312 313 while (true) { … … 320 321 return false; 321 322 322 shadowA = shadowA->next ;323 shadowB = shadowB->next ;323 shadowA = shadowA->next(); 324 shadowB = shadowB->next(); 324 325 } 325 326 … … 329 330 virtual void blend(const AnimationBase* anim, RenderStyle* dst, const RenderStyle* a, const RenderStyle* b, double progress) const 330 331 { 331 ShadowData* shadowA = (a->*m_getter)();332 ShadowData* shadowB = (b->*m_getter)();332 const ShadowData* shadowA = (a->*m_getter)(); 333 const ShadowData* shadowB = (b->*m_getter)(); 333 334 ShadowData defaultShadowData(0, 0, 0, 0, Normal, Color::transparent); 334 335 … … 336 337 337 338 while (shadowA || shadowB) { 338 ShadowData* srcShadow = shadowA ? shadowA : &defaultShadowData;339 ShadowData* dstShadow = shadowB ? shadowB : &defaultShadowData;339 const ShadowData* srcShadow = shadowA ? shadowA : &defaultShadowData; 340 const ShadowData* dstShadow = shadowB ? shadowB : &defaultShadowData; 340 341 341 342 if (!newShadowData) 342 343 newShadowData = blendFunc(anim, srcShadow, dstShadow, progress); 343 344 else 344 newShadowData-> next = blendFunc(anim, srcShadow, dstShadow, progress);345 346 shadowA = shadowA ? shadowA->next : 0;347 shadowB = shadowB ? shadowB->next : 0;345 newShadowData->setNext(blendFunc(anim, srcShadow, dstShadow, progress)); 346 347 shadowA = shadowA ? shadowA->next() : 0; 348 shadowB = shadowB ? shadowB->next() : 0; 348 349 } 349 350 … … 352 353 353 354 private: 355 const ShadowData* (RenderStyle::*m_getter)() const; 354 356 void (RenderStyle::*m_setter)(ShadowData*, bool); 355 357 }; -
trunk/WebCore/page/mac/FrameMac.mm
r53500 r57482 417 417 [result setObject:nsColor(style->color()) forKey:NSForegroundColorAttributeName]; 418 418 419 ShadowData* shadow = style->textShadow();419 const ShadowData* shadow = style->textShadow(); 420 420 if (shadow) { 421 421 NSShadow* s = [[NSShadow alloc] init]; 422 [s setShadowOffset:NSMakeSize(shadow->x , shadow->y)];423 [s setShadowBlurRadius:shadow->blur ];424 [s setShadowColor:nsColor(shadow->color )];422 [s setShadowOffset:NSMakeSize(shadow->x(), shadow->y())]; 423 [s setShadowBlurRadius:shadow->blur()]; 424 [s setShadowColor:nsColor(shadow->color())]; 425 425 [result setObject:s forKey:NSShadowAttributeName]; 426 426 } -
trunk/WebCore/rendering/EllipsisBox.cpp
r52548 r57482 37 37 bool setShadow = false; 38 38 if (style->textShadow()) { 39 context->setShadow(IntSize(style->textShadow()->x , style->textShadow()->y),40 style->textShadow()->blur , style->textShadow()->color, style->colorSpace());39 context->setShadow(IntSize(style->textShadow()->x(), style->textShadow()->y()), 40 style->textShadow()->blur(), style->textShadow()->color(), style->colorSpace()); 41 41 setShadow = true; 42 42 } -
trunk/WebCore/rendering/InlineFlowBox.cpp
r57292 r57482 297 297 int childOverflowLeft = leftGlyphOverflow; 298 298 int childOverflowRight = rightGlyphOverflow; 299 for ( ShadowData* shadow = rt->style()->textShadow(); shadow; shadow = shadow->next) {300 childOverflowLeft = min(childOverflowLeft, shadow->x - shadow->blur+ leftGlyphOverflow);301 childOverflowRight = max(childOverflowRight, shadow->x + shadow->blur+ rightGlyphOverflow);299 for (const ShadowData* shadow = rt->style()->textShadow(); shadow; shadow = shadow->next()) { 300 childOverflowLeft = min(childOverflowLeft, shadow->x() - shadow->blur() + leftGlyphOverflow); 301 childOverflowRight = max(childOverflowRight, shadow->x() + shadow->blur() + rightGlyphOverflow); 302 302 } 303 303 … … 574 574 int childOverflowTop = topGlyphOverflow; 575 575 int childOverflowBottom = bottomGlyphOverflow; 576 for ( ShadowData* shadow = rt->style()->textShadow(); shadow; shadow = shadow->next) {577 childOverflowTop = min(childOverflowTop, shadow->y - shadow->blur+ topGlyphOverflow);578 childOverflowBottom = max(childOverflowBottom, shadow->y + shadow->blur+ bottomGlyphOverflow);576 for (const ShadowData* shadow = rt->style()->textShadow(); shadow; shadow = shadow->next()) { 577 childOverflowTop = min(childOverflowTop, shadow->y() - shadow->blur() + topGlyphOverflow); 578 childOverflowBottom = max(childOverflowBottom, shadow->y() + shadow->blur() + bottomGlyphOverflow); 579 579 } 580 580 … … 982 982 bool setClip = false; 983 983 int extraOffset = 0; 984 ShadowData* shadow = styleToUse->textShadow();985 if (!linesAreOpaque && shadow && shadow->next ) {984 const ShadowData* shadow = styleToUse->textShadow(); 985 if (!linesAreOpaque && shadow && shadow->next()) { 986 986 IntRect clipRect(tx, ty, w, baselinePos + 2); 987 for ( ShadowData* s = shadow; s; s = s->next) {987 for (const ShadowData* s = shadow; s; s = s->next()) { 988 988 IntRect shadowRect(tx, ty, w, baselinePos + 2); 989 shadowRect.inflate(s->blur );990 shadowRect.move(s->x , s->y);989 shadowRect.inflate(s->blur()); 990 shadowRect.move(s->x(), s->y()); 991 991 clipRect.unite(shadowRect); 992 extraOffset = max(extraOffset, max(0, s->y ) + s->blur);992 extraOffset = max(extraOffset, max(0, s->y()) + s->blur()); 993 993 } 994 994 context->save(); … … 1003 1003 do { 1004 1004 if (shadow) { 1005 if (!shadow->next ) {1005 if (!shadow->next()) { 1006 1006 // The last set of lines paints normally inside the clip. 1007 1007 ty -= extraOffset; 1008 1008 extraOffset = 0; 1009 1009 } 1010 context->setShadow(IntSize(shadow->x , shadow->y - extraOffset), shadow->blur, shadow->color, colorSpace);1010 context->setShadow(IntSize(shadow->x(), shadow->y() - extraOffset), shadow->blur(), shadow->color(), colorSpace); 1011 1011 setShadow = true; 1012 shadow = shadow->next ;1012 shadow = shadow->next(); 1013 1013 } 1014 1014 -
trunk/WebCore/rendering/InlineTextBox.cpp
r57292 r57482 274 274 } 275 275 276 static void paintTextWithShadows(GraphicsContext* context, const Font& font, const TextRun& textRun, int startOffset, int endOffset, int truncationPoint, const IntPoint& textOrigin, int x, int y, int w, int h, ShadowData* shadow, bool stroked)276 static void paintTextWithShadows(GraphicsContext* context, const Font& font, const TextRun& textRun, int startOffset, int endOffset, int truncationPoint, const IntPoint& textOrigin, int x, int y, int w, int h, const ShadowData* shadow, bool stroked) 277 277 { 278 278 Color fillColor = context->fillColor(); … … 286 286 287 287 if (shadow) { 288 IntSize shadowOffset(shadow->x , shadow->y);289 int shadowBlur = shadow->blur ;290 const Color& shadowColor = shadow->color ;291 292 if (shadow->next || stroked || !opaque) {288 IntSize shadowOffset(shadow->x(), shadow->y()); 289 int shadowBlur = shadow->blur(); 290 const Color& shadowColor = shadow->color(); 291 292 if (shadow->next() || stroked || !opaque) { 293 293 IntRect shadowRect(x, y, w, h); 294 294 shadowRect.inflate(shadowBlur); … … 316 316 break; 317 317 318 if (shadow->next || stroked || !opaque)318 if (shadow->next() || stroked || !opaque) 319 319 context->restore(); 320 320 else 321 321 context->clearShadow(); 322 322 323 shadow = shadow->next ;323 shadow = shadow->next(); 324 324 } while (shadow || stroked || !opaque); 325 325 } … … 406 406 Color textStrokeColor; 407 407 float textStrokeWidth = styleToUse->textStrokeWidth(); 408 ShadowData* textShadow = paintInfo.forceBlackText ? 0 : styleToUse->textShadow();408 const ShadowData* textShadow = paintInfo.forceBlackText ? 0 : styleToUse->textShadow(); 409 409 410 410 if (paintInfo.forceBlackText) { … … 431 431 Color selectionStrokeColor = textStrokeColor; 432 432 float selectionStrokeWidth = textStrokeWidth; 433 ShadowData* selectionShadow = textShadow;433 const ShadowData* selectionShadow = textShadow; 434 434 if (haveSelection) { 435 435 // Check foreground color first. … … 442 442 443 443 if (RenderStyle* pseudoStyle = renderer()->getCachedPseudoStyle(SELECTION)) { 444 ShadowData* shadow = paintInfo.forceBlackText ? 0 : pseudoStyle->textShadow();444 const ShadowData* shadow = paintInfo.forceBlackText ? 0 : pseudoStyle->textShadow(); 445 445 if (shadow != selectionShadow) { 446 446 if (!paintSelectedTextOnly) … … 641 641 #endif 642 642 643 void InlineTextBox::paintDecoration(GraphicsContext* context, int tx, int ty, int deco, ShadowData* shadow)643 void InlineTextBox::paintDecoration(GraphicsContext* context, int tx, int ty, int deco, const ShadowData* shadow) 644 644 { 645 645 tx += m_x; … … 670 670 bool setClip = false; 671 671 int extraOffset = 0; 672 if (!linesAreOpaque && shadow && shadow->next ) {672 if (!linesAreOpaque && shadow && shadow->next()) { 673 673 context->save(); 674 674 IntRect clipRect(tx, ty, width, baseline + 2); 675 for ( ShadowData* s = shadow; s; s = s->next) {675 for (const ShadowData* s = shadow; s; s = s->next()) { 676 676 IntRect shadowRect(tx, ty, width, baseline + 2); 677 shadowRect.inflate(s->blur );678 shadowRect.move(s->x , s->y);677 shadowRect.inflate(s->blur()); 678 shadowRect.move(s->x(), s->y()); 679 679 clipRect.unite(shadowRect); 680 extraOffset = max(extraOffset, max(0, s->y ) + s->blur);680 extraOffset = max(extraOffset, max(0, s->y()) + s->blur()); 681 681 } 682 682 context->save(); … … 692 692 do { 693 693 if (shadow) { 694 if (!shadow->next ) {694 if (!shadow->next()) { 695 695 // The last set of lines paints normally inside the clip. 696 696 ty -= extraOffset; 697 697 extraOffset = 0; 698 698 } 699 context->setShadow(IntSize(shadow->x , shadow->y - extraOffset), shadow->blur, shadow->color, colorSpace);699 context->setShadow(IntSize(shadow->x(), shadow->y() - extraOffset), shadow->blur(), shadow->color(), colorSpace); 700 700 setShadow = true; 701 shadow = shadow->next ;701 shadow = shadow->next(); 702 702 } 703 703 -
trunk/WebCore/rendering/InlineTextBox.h
r57215 r57482 151 151 152 152 private: 153 void paintDecoration(GraphicsContext*, int tx, int ty, int decoration, ShadowData*);153 void paintDecoration(GraphicsContext*, int tx, int ty, int decoration, const ShadowData*); 154 154 void paintSelection(GraphicsContext*, int tx, int ty, RenderStyle*, const Font&); 155 155 void paintSpellingOrGrammarMarker(GraphicsContext*, int tx, int ty, const DocumentMarker&, RenderStyle*, const Font&, bool grammar); -
trunk/WebCore/rendering/RenderBoxModelObject.cpp
r57479 r57482 1323 1323 1324 1324 bool hasOpaqueBackground = s->backgroundColor().isValid() && s->backgroundColor().alpha() == 255; 1325 for ( ShadowData* shadow = s->boxShadow(); shadow; shadow = shadow->next) {1326 if (shadow->style != shadowStyle)1325 for (const ShadowData* shadow = s->boxShadow(); shadow; shadow = shadow->next()) { 1326 if (shadow->style() != shadowStyle) 1327 1327 continue; 1328 1328 1329 IntSize shadowOffset(shadow->x , shadow->y);1330 int shadowBlur = shadow->blur ;1331 int shadowSpread = shadow->spread ;1332 Color& shadowColor = shadow->color;1333 1334 if (shadow->style == Normal) {1329 IntSize shadowOffset(shadow->x(), shadow->y()); 1330 int shadowBlur = shadow->blur(); 1331 int shadowSpread = shadow->spread(); 1332 const Color& shadowColor = shadow->color(); 1333 1334 if (shadow->style() == Normal) { 1335 1335 IntRect fillRect(rect); 1336 1336 fillRect.inflate(shadowSpread); -
trunk/WebCore/rendering/RenderLayer.cpp
r57033 r57482 2912 2912 // If we establish a clip at all, then go ahead and make sure our background 2913 2913 // rect is intersected with our layer's bounds. 2914 if (ShadowData* boxShadow = renderer()->style()->boxShadow()) { 2914 // FIXME: This could be changed to just use generic visual overflow. 2915 // See https://bugs.webkit.org/show_bug.cgi?id=37467 for more information. 2916 if (const ShadowData* boxShadow = renderer()->style()->boxShadow()) { 2915 2917 IntRect overflow = layerBounds; 2916 2918 do { 2917 if (boxShadow->style == Normal) {2919 if (boxShadow->style() == Normal) { 2918 2920 IntRect shadowRect = layerBounds; 2919 shadowRect.move(boxShadow->x , boxShadow->y);2920 shadowRect.inflate(boxShadow->blur + boxShadow->spread);2921 shadowRect.move(boxShadow->x(), boxShadow->y()); 2922 shadowRect.inflate(boxShadow->blur() + boxShadow->spread()); 2921 2923 overflow.unite(shadowRect); 2922 2924 } 2923 2925 2924 boxShadow = boxShadow->next ;2926 boxShadow = boxShadow->next(); 2925 2927 } while (boxShadow); 2926 2928 backgroundRect.intersect(overflow); -
trunk/WebCore/rendering/RenderObject.cpp
r57292 r57482 2355 2355 { 2356 2356 int outlineSize = outlineStyleForRepaint()->outlineSize(); 2357 if ( ShadowData* boxShadow = style()->boxShadow()) {2357 if (const ShadowData* boxShadow = style()->boxShadow()) { 2358 2358 int shadowLeft = 0; 2359 2359 int shadowRight = 0; … … 2362 2362 2363 2363 do { 2364 if (boxShadow->style == Normal) {2365 shadowLeft = min(boxShadow->x - boxShadow->blur - boxShadow->spread- outlineSize, shadowLeft);2366 shadowRight = max(boxShadow->x + boxShadow->blur + boxShadow->spread+ outlineSize, shadowRight);2367 shadowTop = min(boxShadow->y - boxShadow->blur - boxShadow->spread- outlineSize, shadowTop);2368 shadowBottom = max(boxShadow->y + boxShadow->blur + boxShadow->spread+ outlineSize, shadowBottom);2364 if (boxShadow->style() == Normal) { 2365 shadowLeft = min(boxShadow->x() - boxShadow->blur() - boxShadow->spread() - outlineSize, shadowLeft); 2366 shadowRight = max(boxShadow->x() + boxShadow->blur() + boxShadow->spread() + outlineSize, shadowRight); 2367 shadowTop = min(boxShadow->y() - boxShadow->blur() - boxShadow->spread() - outlineSize, shadowTop); 2368 shadowBottom = max(boxShadow->y() + boxShadow->blur() + boxShadow->spread() + outlineSize, shadowBottom); 2369 2369 } 2370 2370 2371 boxShadow = boxShadow->next ;2371 boxShadow = boxShadow->next(); 2372 2372 } while (boxShadow); 2373 2373 -
trunk/WebCore/rendering/SVGInlineTextBox.cpp
r54556 r57482 406 406 if (isGlyphPhase || isSelectionGlyphPhase) { 407 407 // Set a text shadow if we have one. 408 // FIXME: Support multiple shadow effects. Need more from the CG API before 409 // we can do this. 408 // FIXME: Support multiple shadow effects. See how it's done in InlineTextBox.cpp. 410 409 bool setShadow = false; 411 410 if (styleToUse->textShadow()) { 412 paintInfo.context->setShadow(IntSize(styleToUse->textShadow()->x , styleToUse->textShadow()->y),413 styleToUse->textShadow()->blur , styleToUse->textShadow()->color,411 paintInfo.context->setShadow(IntSize(styleToUse->textShadow()->x(), styleToUse->textShadow()->y()), 412 styleToUse->textShadow()->blur(), styleToUse->textShadow()->color(), 414 413 styleToUse->colorSpace()); 415 414 setShadow = true; -
trunk/WebCore/rendering/SVGRenderSupport.cpp
r56693 r57482 106 106 } 107 107 108 if ( ShadowData* shadow = svgStyle->shadow()) {108 if (const ShadowData* shadow = svgStyle->shadow()) { 109 109 paintInfo.context->clip(repaintRect); 110 paintInfo.context->setShadow(IntSize(shadow->x , shadow->y), shadow->blur, shadow->color, style->colorSpace());110 paintInfo.context->setShadow(IntSize(shadow->x(), shadow->y()), shadow->blur(), shadow->color(), style->colorSpace()); 111 111 paintInfo.context->beginTransparencyLayer(1.0f); 112 112 } -
trunk/WebCore/rendering/style/RenderStyle.cpp
r57358 r57482 713 713 } 714 714 715 val-> next = rareData->textShadow;715 val->setNext(rareData->textShadow); 716 716 rareData->textShadow = val; 717 717 } … … 725 725 } 726 726 727 shadowData-> next = rareData->m_boxShadow.release();727 shadowData->setNext(rareData->m_boxShadow.release()); 728 728 rareData->m_boxShadow.set(shadowData); 729 729 } … … 922 922 left = 0; 923 923 924 for ( ShadowData* boxShadow = this->boxShadow(); boxShadow; boxShadow = boxShadow->next) {925 if (boxShadow->style == Inset)924 for (const ShadowData* boxShadow = this->boxShadow(); boxShadow; boxShadow = boxShadow->next()) { 925 if (boxShadow->style() == Inset) 926 926 continue; 927 int blurAndSpread = boxShadow->blur + boxShadow->spread;928 929 top = min(top, boxShadow->y - blurAndSpread);930 right = max(right, boxShadow->x + blurAndSpread);931 bottom = max(bottom, boxShadow->y + blurAndSpread);932 left = min(left, boxShadow->x - blurAndSpread);927 int blurAndSpread = boxShadow->blur() + boxShadow->spread(); 928 929 top = min(top, boxShadow->y() - blurAndSpread); 930 right = max(right, boxShadow->x() + blurAndSpread); 931 bottom = max(bottom, boxShadow->y() + blurAndSpread); 932 left = min(left, boxShadow->x() - blurAndSpread); 933 933 } 934 934 } … … 939 939 right = 0; 940 940 941 for ( ShadowData* boxShadow = this->boxShadow(); boxShadow; boxShadow = boxShadow->next) {942 if (boxShadow->style == Inset)941 for (const ShadowData* boxShadow = this->boxShadow(); boxShadow; boxShadow = boxShadow->next()) { 942 if (boxShadow->style() == Inset) 943 943 continue; 944 int blurAndSpread = boxShadow->blur + boxShadow->spread;945 946 left = min(left, boxShadow->x - blurAndSpread);947 right = max(right, boxShadow->x + blurAndSpread);944 int blurAndSpread = boxShadow->blur() + boxShadow->spread(); 945 946 left = min(left, boxShadow->x() - blurAndSpread); 947 right = max(right, boxShadow->x() + blurAndSpread); 948 948 } 949 949 } … … 954 954 bottom = 0; 955 955 956 for ( ShadowData* boxShadow = this->boxShadow(); boxShadow; boxShadow = boxShadow->next) {957 if (boxShadow->style == Inset)956 for (const ShadowData* boxShadow = this->boxShadow(); boxShadow; boxShadow = boxShadow->next()) { 957 if (boxShadow->style() == Inset) 958 958 continue; 959 int blurAndSpread = boxShadow->blur + boxShadow->spread;960 961 top = min(top, boxShadow->y - blurAndSpread);962 bottom = max(bottom, boxShadow->y + blurAndSpread);959 int blurAndSpread = boxShadow->blur() + boxShadow->spread(); 960 961 top = min(top, boxShadow->y() - blurAndSpread); 962 bottom = max(bottom, boxShadow->y() + blurAndSpread); 963 963 } 964 964 } -
trunk/WebCore/rendering/style/RenderStyle.h
r57371 r57482 615 615 } 616 616 617 ShadowData* textShadow() const { return rareInheritedData->textShadow; }617 const ShadowData* textShadow() const { return rareInheritedData->textShadow; } 618 618 const Color& textStrokeColor() const { return rareInheritedData->textStrokeColor; } 619 619 float textStrokeWidth() const { return rareInheritedData->textStrokeWidth; } … … 631 631 EBoxAlignment boxPack() const { return static_cast<EBoxAlignment>(rareNonInheritedData->flexibleBox->pack); } 632 632 633 ShadowData* boxShadow() const { return rareNonInheritedData->m_boxShadow.get(); }633 const ShadowData* boxShadow() const { return rareNonInheritedData->m_boxShadow.get(); } 634 634 void getBoxShadowExtent(int &top, int &right, int &bottom, int &left) const; 635 635 void getBoxShadowHorizontalExtent(int &left, int &right) const; -
trunk/WebCore/rendering/style/SVGRenderStyle.cpp
r53300 r57482 153 153 left = 0; 154 154 155 int blurAndSpread = shadow->blur + shadow->spread;156 157 top = min(top, shadow->y - blurAndSpread);158 right = max(right, shadow->x + blurAndSpread);159 bottom = max(bottom, shadow->y + blurAndSpread);160 left = min(left, shadow->x - blurAndSpread);155 int blurAndSpread = shadow->blur() + shadow->spread(); 156 157 top = min(top, shadow->y() - blurAndSpread); 158 right = max(right, shadow->x() + blurAndSpread); 159 bottom = max(bottom, shadow->y() + blurAndSpread); 160 left = min(left, shadow->x() - blurAndSpread); 161 161 } 162 162 -
trunk/WebCore/rendering/style/ShadowData.cpp
r46361 r57482 26 26 27 27 ShadowData::ShadowData(const ShadowData& o) 28 : x(o.x)29 , y(o.y)30 , blur(o.blur)31 , spread(o.spread)32 , style(o.style)33 , color(o.color)28 : m_x(o.m_x) 29 , m_y(o.m_y) 30 , m_blur(o.m_blur) 31 , m_spread(o.m_spread) 32 , m_style(o.m_style) 33 , m_color(o.m_color) 34 34 { 35 next = o.next ? new ShadowData(*o.next) : 0;35 m_next = o.m_next ? new ShadowData(*o.m_next) : 0; 36 36 } 37 37 38 38 bool ShadowData::operator==(const ShadowData& o) const 39 39 { 40 if (( next && !o.next) || (!next && o.next) ||41 ( next && o.next && *next != *o.next))40 if ((m_next && !o.m_next) || (!m_next && o.m_next) || 41 (m_next && o.m_next && *m_next != *o.m_next)) 42 42 return false; 43 43 44 return x == o.x && y == o.y && blur == o.blur && spread == o.spread && style == o.style && color == o.color;44 return m_x == o.m_x && m_y == o.m_y && m_blur == o.m_blur && m_spread == o.m_spread && m_style == o.m_style && m_color == o.m_color; 45 45 } 46 46 -
trunk/WebCore/rendering/style/ShadowData.h
r51466 r57482 35 35 // This struct holds information about shadows for the text-shadow and box-shadow properties. 36 36 37 struct ShadowData : FastAllocBase { 37 class ShadowData : public FastAllocBase { 38 public: 38 39 ShadowData() 39 : x(0)40 , y(0)41 , blur(0)42 , spread(0)43 , style(Normal)44 , next(0)40 : m_x(0) 41 , m_y(0) 42 , m_blur(0) 43 , m_spread(0) 44 , m_style(Normal) 45 , m_next(0) 45 46 { 46 47 } 47 48 48 49 ShadowData(int x, int y, int blur, int spread, ShadowStyle style, const Color& color) 49 : x(x)50 , y(y)51 , blur(blur)52 , spread(spread)53 , style(style)54 , color(color)55 , next(0)50 : m_x(x) 51 , m_y(y) 52 , m_blur(blur) 53 , m_spread(spread) 54 , m_style(style) 55 , m_color(color) 56 , m_next(0) 56 57 { 57 58 } 58 59 59 60 ShadowData(const ShadowData& o); 60 61 ~ShadowData() { delete next; } 61 ~ShadowData() { delete m_next; } 62 62 63 63 bool operator==(const ShadowData& o) const; … … 67 67 } 68 68 69 int x; 70 int y; 71 int blur; 72 int spread; 73 ShadowStyle style; 74 Color color; 75 ShadowData* next; 69 int x() const { return m_x; } 70 int y() const { return m_y; } 71 int blur() const { return m_blur; } 72 int spread() const { return m_spread; } 73 ShadowStyle style() const { return m_style; } 74 const Color& color() const { return m_color; } 75 76 const ShadowData* next() const { return m_next; } 77 void setNext(ShadowData* shadow) { m_next = shadow; } 78 79 private: 80 int m_x; 81 int m_y; 82 int m_blur; 83 int m_spread; 84 ShadowStyle m_style; 85 Color m_color; 86 ShadowData* m_next; 76 87 }; 77 88
Note: See TracChangeset
for help on using the changeset viewer.