Skip to content

Commit e515ff8

Browse files
author
David Hyatt
committed
Fix Mac build bustage (lots of float/int confusion). I am not sure
whether rounding was desired or not... this is just a band-aid to get the build working again. * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintMenuListButtonGradients): (WebCore::RenderThemeMac::paintMenuListButton): (WebCore::RenderThemeMac::adjustMenuListButtonStyle): Canonical link: https://commits.webkit.org/13445@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@16049 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 15462ff commit e515ff8

2 files changed

Lines changed: 19 additions & 9 deletions

File tree

WebCore/ChangeLog

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
2006-08-26 David Hyatt <hyatt@apple.com>
2+
3+
Fix Mac build bustage (lots of float/int confusion). I am not sure
4+
whether rounding was desired or not... this is just a band-aid to get
5+
the build working again.
6+
7+
* rendering/RenderThemeMac.mm:
8+
(WebCore::RenderThemeMac::paintMenuListButtonGradients):
9+
(WebCore::RenderThemeMac::paintMenuListButton):
10+
(WebCore::RenderThemeMac::adjustMenuListButtonStyle):
11+
112
2006-08-25 David Hyatt <hyatt@apple.com>
213

314
More refactoring of image to disentangle graphics (e.g., Cairo) from

WebCore/rendering/RenderThemeMac.mm

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -756,13 +756,13 @@ static void MainGradientInterpolate( void *info, float const *inData, float *out
756756

757757
CGColorSpaceRef cspace = CGColorSpaceCreateDeviceRGB();
758758

759-
IntRect topGradient(r.x(), r.y(), r.width(), r.height() / 2.0);
759+
FloatRect topGradient(r.x(), r.y(), r.width(), r.height() / 2.0);
760760
struct CGFunctionCallbacks topCallbacks = { 0, TopGradientInterpolate, NULL };
761761
CGFunctionRef topFunction = CGFunctionCreate( NULL, 1, NULL, 4, NULL, &topCallbacks );
762762
CGShadingRef topShading = CGShadingCreateAxial( cspace, CGPointMake(topGradient.x(), topGradient.y()),
763763
CGPointMake(topGradient.x(), topGradient.bottom()), topFunction, false, false );
764764

765-
IntRect bottomGradient(r.x() + radius, r.y() + r.height() / 2.0, r.width() - 2 * radius, r.height() / 2.0);
765+
FloatRect bottomGradient(r.x() + radius, r.y() + r.height() / 2.0, r.width() - 2 * radius, r.height() / 2.0);
766766
struct CGFunctionCallbacks bottomCallbacks = { 0, BottomGradientInterpolate, NULL };
767767
CGFunctionRef bottomFunction = CGFunctionCreate( NULL, 1, NULL, 4, NULL, &bottomCallbacks );
768768
CGShadingRef bottomShading = CGShadingCreateAxial( cspace, CGPointMake(bottomGradient.x(), bottomGradient.y()),
@@ -788,15 +788,15 @@ static void MainGradientInterpolate( void *info, float const *inData, float *out
788788

789789
i.p->save();
790790
CGContextClipToRect(context, topGradient);
791-
i.p->addRoundedRectClip(topGradient,
791+
i.p->addRoundedRectClip(enclosingIntRect(topGradient),
792792
o->style()->borderTopLeftRadius(), o->style()->borderTopRightRadius(),
793793
IntSize(), IntSize());
794794
CGContextDrawShading(context, topShading);
795795
i.p->restore();
796796

797797
i.p->save();
798798
CGContextClipToRect(context, bottomGradient);
799-
i.p->addRoundedRectClip(bottomGradient,
799+
i.p->addRoundedRectClip(enclosingIntRect(bottomGradient),
800800
IntSize(), IntSize(),
801801
o->style()->borderBottomLeftRadius(), o->style()->borderBottomRightRadius());
802802
CGContextDrawShading(context, bottomShading);
@@ -854,7 +854,7 @@ static void MainGradientInterpolate( void *info, float const *inData, float *out
854854
Color leftSeparatorColor(0, 0, 0, 40);
855855
Color rightSeparatorColor(255, 255, 255, 40);
856856
int separatorSpace = 2;
857-
int leftEdgeOfSeparator = leftEdge - arrowPaddingLeft;
857+
int leftEdgeOfSeparator = int(leftEdge - arrowPaddingLeft); // FIXME: Round?
858858

859859
// Draw the separator to the left of the arrows
860860
i.p->setPen(Pen(leftSeparatorColor));
@@ -909,13 +909,12 @@ static void MainGradientInterpolate( void *info, float const *inData, float *out
909909
// We're overriding the padding to allow for the arrow control. WinIE doesn't honor padding on selects, so
910910
// this shouldn't cause problems on the web. If IE7 changes that, we should reconsider this.
911911
style->setPaddingLeft(Length(styledPopupPaddingLeft, Fixed));
912-
style->setPaddingRight(Length(arrowWidth + arrowPaddingLeft + arrowPaddingRight + paddingBeforeSeparator, Fixed));
912+
style->setPaddingRight(Length(int(ceilf(arrowWidth + arrowPaddingLeft + arrowPaddingRight + paddingBeforeSeparator)), Fixed));
913913
style->setPaddingTop(Length(styledPopupPaddingTop, Fixed));
914914
style->setPaddingBottom(Length(styledPopupPaddingBottom, Fixed));
915915

916-
if (style->hasBorderRadius()) {
917-
style->setBorderRadius(IntSize(baseBorderRadius + fontScale - 1, baseBorderRadius + fontScale - 1));
918-
}
916+
if (style->hasBorderRadius())
917+
style->setBorderRadius(IntSize(int(baseBorderRadius + fontScale - 1), int(baseBorderRadius + fontScale - 1))); // FIXME: Round up?
919918

920919
const int minHeight = 15;
921920
style->setMinHeight(Length(minHeight, Fixed));

0 commit comments

Comments
 (0)