| Index: Source/core/rendering/RenderThemeChromiumMac.mm
|
| diff --git a/Source/core/rendering/RenderThemeChromiumMac.mm b/Source/core/rendering/RenderThemeChromiumMac.mm
|
| index e6c7b279518f932f832a49666349479b676fbe14..36ec9b732a5172c82a227fd9b7a97681921fb29e 100644
|
| --- a/Source/core/rendering/RenderThemeChromiumMac.mm
|
| +++ b/Source/core/rendering/RenderThemeChromiumMac.mm
|
| @@ -750,9 +750,9 @@ NSControlSize RenderThemeChromiumMac::controlSizeForSystemFont(RenderStyle* styl
|
| return NSMiniControlSize;
|
| }
|
|
|
| -bool RenderThemeChromiumMac::paintTextField(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
|
| +bool RenderThemeChromiumMac::paintTextField(RenderObject* o, PaintInfo& paintInfo, const IntRect& r)
|
| {
|
| - LocalCurrentGraphicsContext localContext(paintInfo.context);
|
| + LocalCurrentGraphicsContext localContext(paintInfo.getContext());
|
|
|
| #if __MAC_OS_X_VERSION_MIN_REQUIRED <= 1070
|
| bool useNSTextFieldCell = o->style()->hasAppearance()
|
| @@ -771,7 +771,7 @@ bool RenderThemeChromiumMac::paintTextField(RenderObject* o, const PaintInfo& pa
|
|
|
| NSTextFieldCell *textField = this->textField();
|
|
|
| - GraphicsContextStateSaver stateSaver(*paintInfo.context);
|
| + GraphicsContextStateSaver stateSaver(*(paintInfo.getContext()));
|
|
|
| [textField setEnabled:(isEnabled(o) && !isReadOnlyControl(o))];
|
| [textField drawWithFrame:NSRect(r) inView:documentViewFor(o)];
|
| @@ -785,13 +785,13 @@ void RenderThemeChromiumMac::adjustTextFieldStyle(RenderStyle*, Element*) const
|
| {
|
| }
|
|
|
| -bool RenderThemeChromiumMac::paintCapsLockIndicator(RenderObject*, const PaintInfo& paintInfo, const IntRect& r)
|
| +bool RenderThemeChromiumMac::paintCapsLockIndicator(RenderObject*, PaintInfo& paintInfo, const IntRect& r)
|
| {
|
| - if (paintInfo.context->paintingDisabled())
|
| + if (paintInfo.getContext()->paintingDisabled())
|
| return true;
|
|
|
| // This draws the caps lock indicator as it was done by WKDrawCapsLockIndicator.
|
| - LocalCurrentGraphicsContext localContext(paintInfo.context);
|
| + LocalCurrentGraphicsContext localContext(paintInfo.getContext());
|
| CGContextRef c = localContext.cgContext();
|
| CGMutablePathRef shape = CGPathCreateMutable();
|
|
|
| @@ -847,9 +847,9 @@ bool RenderThemeChromiumMac::paintCapsLockIndicator(RenderObject*, const PaintIn
|
| return false;
|
| }
|
|
|
| -bool RenderThemeChromiumMac::paintTextArea(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
|
| +bool RenderThemeChromiumMac::paintTextArea(RenderObject* o, PaintInfo& paintInfo, const IntRect& r)
|
| {
|
| - LocalCurrentGraphicsContext localContext(paintInfo.context);
|
| + LocalCurrentGraphicsContext localContext(paintInfo.getContext());
|
| _NSDrawCarbonThemeListBox(r, isEnabled(o) && !isReadOnlyControl(o), YES, YES);
|
| return false;
|
| }
|
| @@ -886,9 +886,9 @@ const int* RenderThemeChromiumMac::popupButtonPadding(NSControlSize size) const
|
| return padding[size];
|
| }
|
|
|
| -bool RenderThemeChromiumMac::paintMenuList(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
|
| +bool RenderThemeChromiumMac::paintMenuList(RenderObject* o, PaintInfo& paintInfo, const IntRect& r)
|
| {
|
| - LocalCurrentGraphicsContext localContext(paintInfo.context);
|
| + LocalCurrentGraphicsContext localContext(paintInfo.getContext());
|
| setPopupButtonCellState(o, r);
|
|
|
| NSPopUpButtonCell* popupButton = this->popupButton();
|
| @@ -903,17 +903,17 @@ bool RenderThemeChromiumMac::paintMenuList(RenderObject* o, const PaintInfo& pai
|
| if (r.width() >= minimumMenuListSize(o->style()))
|
| inflatedRect = inflateRect(inflatedRect, size, popupButtonMargins(), zoomLevel);
|
|
|
| - GraphicsContextStateSaver stateSaver(*paintInfo.context);
|
| + GraphicsContextStateSaver stateSaver(*(paintInfo.getContext()));
|
|
|
| // On Leopard, the cell will draw outside of the given rect, so we have to clip to the rect
|
| - paintInfo.context->clip(inflatedRect);
|
| + paintInfo.getContext()->clip(inflatedRect);
|
|
|
| if (zoomLevel != 1.0f) {
|
| inflatedRect.setWidth(inflatedRect.width() / zoomLevel);
|
| inflatedRect.setHeight(inflatedRect.height() / zoomLevel);
|
| - paintInfo.context->translate(inflatedRect.x(), inflatedRect.y());
|
| - paintInfo.context->scale(FloatSize(zoomLevel, zoomLevel));
|
| - paintInfo.context->translate(-inflatedRect.x(), -inflatedRect.y());
|
| + paintInfo.getContext()->translate(inflatedRect.x(), inflatedRect.y());
|
| + paintInfo.getContext()->scale(FloatSize(zoomLevel, zoomLevel));
|
| + paintInfo.getContext()->translate(-inflatedRect.x(), -inflatedRect.y());
|
| }
|
|
|
| NSView *view = documentViewFor(o);
|
| @@ -939,15 +939,15 @@ IntSize RenderThemeChromiumMac::meterSizeForBounds(const RenderMeter* renderMete
|
| bounds.height() < cellSize.height ? cellSize.height : bounds.height());
|
| }
|
|
|
| -bool RenderThemeChromiumMac::paintMeter(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
|
| +bool RenderThemeChromiumMac::paintMeter(RenderObject* renderObject, PaintInfo& paintInfo, const IntRect& rect)
|
| {
|
| if (!renderObject->isMeter())
|
| return true;
|
|
|
| - LocalCurrentGraphicsContext localContext(paintInfo.context);
|
| + LocalCurrentGraphicsContext localContext(paintInfo.getContext());
|
|
|
| NSLevelIndicatorCell* cell = levelIndicatorFor(toRenderMeter(renderObject));
|
| - GraphicsContextStateSaver stateSaver(*paintInfo.context);
|
| + GraphicsContextStateSaver stateSaver(*(paintInfo.getContext()));
|
|
|
| [cell drawWithFrame:rect inView:documentViewFor(renderObject)];
|
| [cell setControlView:nil];
|
| @@ -1063,7 +1063,7 @@ void RenderThemeChromiumMac::adjustProgressBarStyle(RenderStyle*, Element*) cons
|
| {
|
| }
|
|
|
| -bool RenderThemeChromiumMac::paintProgressBar(RenderObject* renderObject, const PaintInfo& paintInfo, const IntRect& rect)
|
| +bool RenderThemeChromiumMac::paintProgressBar(RenderObject* renderObject, PaintInfo& paintInfo, const IntRect& rect)
|
| {
|
| if (!renderObject->isProgress())
|
| return true;
|
| @@ -1105,14 +1105,14 @@ bool RenderThemeChromiumMac::paintProgressBar(RenderObject* renderObject, const
|
| CGContextRef cgContext = cgContextContainer.context();
|
| HIThemeDrawTrack(&trackInfo, 0, cgContext, kHIThemeOrientationNormal);
|
|
|
| - GraphicsContextStateSaver stateSaver(*paintInfo.context);
|
| + GraphicsContextStateSaver stateSaver(*(paintInfo.getContext()));
|
|
|
| if (!renderProgress->style()->isLeftToRightDirection()) {
|
| - paintInfo.context->translate(2 * inflatedRect.x() + inflatedRect.width(), 0);
|
| - paintInfo.context->scale(FloatSize(-1, 1));
|
| + paintInfo.getContext()->translate(2 * inflatedRect.x() + inflatedRect.width(), 0);
|
| + paintInfo.getContext()->scale(FloatSize(-1, 1));
|
| }
|
|
|
| - paintInfo.context->drawImageBuffer(imageBuffer.get(), inflatedRect.location());
|
| + paintInfo.getContext()->drawImageBuffer(imageBuffer.get(), inflatedRect.location());
|
| return false;
|
| }
|
|
|
| @@ -1158,15 +1158,15 @@ static void MainGradientInterpolate(void*, const CGFloat* inData, CGFloat* outDa
|
| outData[i] = (1.0f - a) * dark[i] + a * light[i];
|
| }
|
|
|
| -void RenderThemeChromiumMac::paintMenuListButtonGradients(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
|
| +void RenderThemeChromiumMac::paintMenuListButtonGradients(RenderObject* o, PaintInfo& paintInfo, const IntRect& r)
|
| {
|
| if (r.isEmpty())
|
| return;
|
|
|
| - ContextContainer cgContextContainer(paintInfo.context);
|
| + ContextContainer cgContextContainer(paintInfo.getContext());
|
| CGContextRef context = cgContextContainer.context();
|
|
|
| - GraphicsContextStateSaver stateSaver(*paintInfo.context);
|
| + GraphicsContextStateSaver stateSaver(*(paintInfo.getContext()));
|
|
|
| RoundedRect border = o->style()->getRoundedBorderFor(r, o->view());
|
| int radius = border.radii().topLeft().width();
|
| @@ -1192,40 +1192,40 @@ void RenderThemeChromiumMac::paintMenuListButtonGradients(RenderObject* o, const
|
| RetainPtr<CGShadingRef> rightShading(AdoptCF, CGShadingCreateAxial(cspace, CGPointMake(r.maxX(), r.y()), CGPointMake(r.maxX() - radius, r.y()), mainFunction.get(), false, false));
|
|
|
| {
|
| - GraphicsContextStateSaver stateSaver(*paintInfo.context);
|
| + GraphicsContextStateSaver stateSaver(*(paintInfo.getContext()));
|
| CGContextClipToRect(context, r);
|
| - paintInfo.context->clipRoundedRect(border);
|
| + paintInfo.getContext()->clipRoundedRect(border);
|
| context = cgContextContainer.context();
|
| CGContextDrawShading(context, mainShading.get());
|
| }
|
|
|
| {
|
| - GraphicsContextStateSaver stateSaver(*paintInfo.context);
|
| + GraphicsContextStateSaver stateSaver(*(paintInfo.getContext()));
|
| CGContextClipToRect(context, topGradient);
|
| - paintInfo.context->clipRoundedRect(RoundedRect(enclosingIntRect(topGradient), border.radii().topLeft(), border.radii().topRight(), IntSize(), IntSize()));
|
| + paintInfo.getContext()->clipRoundedRect(RoundedRect(enclosingIntRect(topGradient), border.radii().topLeft(), border.radii().topRight(), IntSize(), IntSize()));
|
| context = cgContextContainer.context();
|
| CGContextDrawShading(context, topShading.get());
|
| }
|
|
|
| if (!bottomGradient.isEmpty()) {
|
| - GraphicsContextStateSaver stateSaver(*paintInfo.context);
|
| + GraphicsContextStateSaver stateSaver(*(paintInfo.getContext()));
|
| CGContextClipToRect(context, bottomGradient);
|
| - paintInfo.context->clipRoundedRect(RoundedRect(enclosingIntRect(bottomGradient), IntSize(), IntSize(), border.radii().bottomLeft(), border.radii().bottomRight()));
|
| + paintInfo.getContext()->clipRoundedRect(RoundedRect(enclosingIntRect(bottomGradient), IntSize(), IntSize(), border.radii().bottomLeft(), border.radii().bottomRight()));
|
| context = cgContextContainer.context();
|
| CGContextDrawShading(context, bottomShading.get());
|
| }
|
|
|
| {
|
| - GraphicsContextStateSaver stateSaver(*paintInfo.context);
|
| + GraphicsContextStateSaver stateSaver(*(paintInfo.getContext()));
|
| CGContextClipToRect(context, r);
|
| - paintInfo.context->clipRoundedRect(border);
|
| + paintInfo.getContext()->clipRoundedRect(border);
|
| context = cgContextContainer.context();
|
| CGContextDrawShading(context, leftShading.get());
|
| CGContextDrawShading(context, rightShading.get());
|
| }
|
| }
|
|
|
| -bool RenderThemeChromiumMac::paintMenuListButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
|
| +bool RenderThemeChromiumMac::paintMenuListButton(RenderObject* o, PaintInfo& paintInfo, const IntRect& r)
|
| {
|
| IntRect bounds = IntRect(r.x() + o->style()->borderLeftWidth(),
|
| r.y() + o->style()->borderTopWidth(),
|
| @@ -1245,10 +1245,10 @@ bool RenderThemeChromiumMac::paintMenuListButton(RenderObject* o, const PaintInf
|
| if (bounds.width() < arrowWidth + arrowPaddingLeft * o->style()->effectiveZoom())
|
| return false;
|
|
|
| - GraphicsContextStateSaver stateSaver(*paintInfo.context);
|
| + GraphicsContextStateSaver stateSaver(*(paintInfo.getContext()));
|
|
|
| - paintInfo.context->setFillColor(o->resolveColor(CSSPropertyColor));
|
| - paintInfo.context->setStrokeStyle(NoStroke);
|
| + paintInfo.getContext()->setFillColor(o->resolveColor(CSSPropertyColor));
|
| + paintInfo.getContext()->setStrokeStyle(NoStroke);
|
|
|
| FloatPoint arrow1[3];
|
| arrow1[0] = FloatPoint(leftEdge, centerY - spaceBetweenArrows / 2.0f);
|
| @@ -1256,7 +1256,7 @@ bool RenderThemeChromiumMac::paintMenuListButton(RenderObject* o, const PaintInf
|
| arrow1[2] = FloatPoint(leftEdge + arrowWidth / 2.0f, centerY - spaceBetweenArrows / 2.0f - arrowHeight);
|
|
|
| // Draw the top arrow
|
| - paintInfo.context->drawConvexPolygon(3, arrow1, true);
|
| + paintInfo.getContext()->drawConvexPolygon(3, arrow1, true);
|
|
|
| FloatPoint arrow2[3];
|
| arrow2[0] = FloatPoint(leftEdge, centerY + spaceBetweenArrows / 2.0f);
|
| @@ -1264,7 +1264,7 @@ bool RenderThemeChromiumMac::paintMenuListButton(RenderObject* o, const PaintInf
|
| arrow2[2] = FloatPoint(leftEdge + arrowWidth / 2.0f, centerY + spaceBetweenArrows / 2.0f + arrowHeight);
|
|
|
| // Draw the bottom arrow
|
| - paintInfo.context->drawConvexPolygon(3, arrow2, true);
|
| + paintInfo.getContext()->drawConvexPolygon(3, arrow2, true);
|
|
|
| Color leftSeparatorColor(0, 0, 0, 40);
|
| Color rightSeparatorColor(255, 255, 255, 40);
|
| @@ -1274,14 +1274,14 @@ bool RenderThemeChromiumMac::paintMenuListButton(RenderObject* o, const PaintInf
|
| int leftEdgeOfSeparator = static_cast<int>(leftEdge - arrowPaddingLeft * o->style()->effectiveZoom()); // FIXME: Round?
|
|
|
| // Draw the separator to the left of the arrows
|
| - paintInfo.context->setStrokeThickness(1.0f); // Deliberately ignores zoom since it looks nicer if it stays thin.
|
| - paintInfo.context->setStrokeStyle(SolidStroke);
|
| - paintInfo.context->setStrokeColor(leftSeparatorColor);
|
| - paintInfo.context->drawLine(IntPoint(leftEdgeOfSeparator, bounds.y()),
|
| + paintInfo.getContext()->setStrokeThickness(1.0f); // Deliberately ignores zoom since it looks nicer if it stays thin.
|
| + paintInfo.getContext()->setStrokeStyle(SolidStroke);
|
| + paintInfo.getContext()->setStrokeColor(leftSeparatorColor);
|
| + paintInfo.getContext()->drawLine(IntPoint(leftEdgeOfSeparator, bounds.y()),
|
| IntPoint(leftEdgeOfSeparator, bounds.maxY()));
|
|
|
| - paintInfo.context->setStrokeColor(rightSeparatorColor);
|
| - paintInfo.context->drawLine(IntPoint(leftEdgeOfSeparator + separatorSpace, bounds.y()),
|
| + paintInfo.getContext()->setStrokeColor(rightSeparatorColor);
|
| + paintInfo.getContext()->drawLine(IntPoint(leftEdgeOfSeparator + separatorSpace, bounds.y()),
|
| IntPoint(leftEdgeOfSeparator + separatorSpace, bounds.maxY()));
|
| return false;
|
| }
|
| @@ -1413,7 +1413,7 @@ int RenderThemeChromiumMac::minimumMenuListSize(RenderStyle* style) const
|
| const int sliderTrackWidth = 5;
|
| const int sliderTrackBorderWidth = 1;
|
|
|
| -bool RenderThemeChromiumMac::paintSliderTrack(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
|
| +bool RenderThemeChromiumMac::paintSliderTrack(RenderObject* o, PaintInfo& paintInfo, const IntRect& r)
|
| {
|
| paintSliderTicks(o, paintInfo, r);
|
|
|
| @@ -1433,11 +1433,11 @@ bool RenderThemeChromiumMac::paintSliderTrack(RenderObject* o, const PaintInfo&
|
| unzoomedRect.setHeight(unzoomedRect.height() / zoomLevel);
|
| }
|
|
|
| - GraphicsContextStateSaver stateSaver(*paintInfo.context);
|
| + GraphicsContextStateSaver stateSaver(*(paintInfo.getContext()));
|
| if (zoomLevel != 1) {
|
| - paintInfo.context->translate(unzoomedRect.x(), unzoomedRect.y());
|
| - paintInfo.context->scale(FloatSize(zoomLevel, zoomLevel));
|
| - paintInfo.context->translate(-unzoomedRect.x(), -unzoomedRect.y());
|
| + paintInfo.getContext()->translate(unzoomedRect.x(), unzoomedRect.y());
|
| + paintInfo.getContext()->scale(FloatSize(zoomLevel, zoomLevel));
|
| + paintInfo.getContext()->translate(-unzoomedRect.x(), -unzoomedRect.y());
|
| }
|
|
|
| Color fillColor(205, 205, 205);
|
| @@ -1463,15 +1463,15 @@ bool RenderThemeChromiumMac::paintSliderTrack(RenderObject* o, const PaintInfo&
|
| IntSize fillRadius(fillRadiusSize, fillRadiusSize);
|
| IntRect fillBounds = enclosedIntRect(unzoomedRect);
|
| RoundedRect fillRect(fillBounds, fillRadius, fillRadius, fillRadius, fillRadius);
|
| - paintInfo.context->fillRoundedRect(fillRect, fillColor);
|
| + paintInfo.getContext()->fillRoundedRect(fillRect, fillColor);
|
|
|
| IntSize shadowOffset(isVerticalSlider ? 1 : 0,
|
| isVerticalSlider ? 0 : 1);
|
| int shadowBlur = 3;
|
| int shadowSpread = 0;
|
| - paintInfo.context->save();
|
| - paintInfo.context->drawInnerShadow(fillRect, shadowColor, shadowOffset, shadowBlur, shadowSpread);
|
| - paintInfo.context->restore();
|
| + paintInfo.getContext()->save();
|
| + paintInfo.getContext()->drawInnerShadow(fillRect, shadowColor, shadowOffset, shadowBlur, shadowSpread);
|
| + paintInfo.getContext()->restore();
|
|
|
| RefPtr<Gradient> borderGradient = Gradient::create(fillBounds.minXMinYCorner(),
|
| isVerticalSlider ? fillBounds.maxXMinYCorner() : fillBounds.minXMaxYCorner());
|
| @@ -1483,9 +1483,9 @@ bool RenderThemeChromiumMac::paintSliderTrack(RenderObject* o, const PaintInfo&
|
| float borderRadiusSize = (isVerticalSlider ? borderRect.width() : borderRect.height()) / 2;
|
| FloatSize borderRadius(borderRadiusSize, borderRadiusSize);
|
| borderPath.addRoundedRect(borderRect, borderRadius, borderRadius, borderRadius, borderRadius);
|
| - paintInfo.context->setStrokeGradient(borderGradient);
|
| - paintInfo.context->setStrokeThickness(sliderTrackBorderWidth);
|
| - paintInfo.context->strokePath(borderPath);
|
| + paintInfo.getContext()->setStrokeGradient(borderGradient);
|
| + paintInfo.getContext()->setStrokeThickness(sliderTrackBorderWidth);
|
| + paintInfo.getContext()->strokePath(borderPath);
|
| return false;
|
| }
|
|
|
| @@ -1493,16 +1493,16 @@ const int sliderThumbWidth = 15;
|
| const int sliderThumbHeight = 15;
|
| const int sliderThumbBorderWidth = 1;
|
|
|
| -bool RenderThemeChromiumMac::paintSliderThumb(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
|
| +bool RenderThemeChromiumMac::paintSliderThumb(RenderObject* o, PaintInfo& paintInfo, const IntRect& r)
|
| {
|
| - GraphicsContextStateSaver stateSaver(*paintInfo.context);
|
| + GraphicsContextStateSaver stateSaver(*(paintInfo.getContext()));
|
| float zoomLevel = o->style()->effectiveZoom();
|
|
|
| FloatRect unzoomedRect(r.x(), r.y(), sliderThumbWidth, sliderThumbHeight);
|
| if (zoomLevel != 1.0f) {
|
| - paintInfo.context->translate(unzoomedRect.x(), unzoomedRect.y());
|
| - paintInfo.context->scale(FloatSize(zoomLevel, zoomLevel));
|
| - paintInfo.context->translate(-unzoomedRect.x(), -unzoomedRect.y());
|
| + paintInfo.getContext()->translate(unzoomedRect.x(), unzoomedRect.y());
|
| + paintInfo.getContext()->scale(FloatSize(zoomLevel, zoomLevel));
|
| + paintInfo.getContext()->translate(-unzoomedRect.x(), -unzoomedRect.y());
|
| }
|
|
|
| Color fillGradientTopColor(250, 250, 250);
|
| @@ -1539,10 +1539,10 @@ bool RenderThemeChromiumMac::paintSliderThumb(RenderObject* o, const PaintInfo&
|
| FloatRect shadowBounds = unzoomedRect;
|
| borderBounds.inflate(-sliderThumbBorderWidth);
|
| FloatSize shadowOffset(0, 1);
|
| - paintInfo.context->setShadow(shadowOffset, sliderThumbShadowBlur, shadowColor);
|
| - paintInfo.context->setFillColor(Color::black);
|
| - paintInfo.context->fillEllipse(borderBounds);
|
| - paintInfo.context->clearShadow();
|
| + paintInfo.getContext()->setShadow(shadowOffset, sliderThumbShadowBlur, shadowColor);
|
| + paintInfo.getContext()->setFillColor(Color::black);
|
| + paintInfo.getContext()->fillEllipse(borderBounds);
|
| + paintInfo.getContext()->clearShadow();
|
|
|
| IntRect fillBounds = enclosedIntRect(unzoomedRect);
|
| RefPtr<Gradient> fillGradient = Gradient::create(fillBounds.minXMinYCorner(), fillBounds.minXMaxYCorner());
|
| @@ -1550,34 +1550,34 @@ bool RenderThemeChromiumMac::paintSliderThumb(RenderObject* o, const PaintInfo&
|
| fillGradient->addColorStop(0.52, fillGradientUpperMiddleColor);
|
| fillGradient->addColorStop(0.52, fillGradientLowerMiddleColor);
|
| fillGradient->addColorStop(1.0, fillGradientBottomColor);
|
| - paintInfo.context->setFillGradient(fillGradient);
|
| - paintInfo.context->fillEllipse(borderBounds);
|
| + paintInfo.getContext()->setFillGradient(fillGradient);
|
| + paintInfo.getContext()->fillEllipse(borderBounds);
|
|
|
| RefPtr<Gradient> borderGradient = Gradient::create(fillBounds.minXMinYCorner(), fillBounds.minXMaxYCorner());
|
| borderGradient->addColorStop(0.0, borderGradientTopColor);
|
| borderGradient->addColorStop(1.0, borderGradientBottomColor);
|
| - paintInfo.context->setStrokeGradient(borderGradient);
|
| - paintInfo.context->setStrokeThickness(sliderThumbBorderWidth);
|
| - paintInfo.context->strokeEllipse(borderBounds);
|
| + paintInfo.getContext()->setStrokeGradient(borderGradient);
|
| + paintInfo.getContext()->setStrokeThickness(sliderThumbBorderWidth);
|
| + paintInfo.getContext()->strokeEllipse(borderBounds);
|
|
|
| if (isFocused(o)) {
|
| Path borderPath;
|
| borderPath.addEllipse(borderBounds);
|
| - paintInfo.context->drawFocusRing(borderPath, 5, -2, focusRingColor());
|
| + paintInfo.getContext()->drawFocusRing(borderPath, 5, -2, focusRingColor());
|
| }
|
|
|
| return false;
|
| }
|
|
|
| -bool RenderThemeChromiumMac::paintSearchField(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
|
| +bool RenderThemeChromiumMac::paintSearchField(RenderObject* o, PaintInfo& paintInfo, const IntRect& r)
|
| {
|
| - LocalCurrentGraphicsContext localContext(paintInfo.context);
|
| + LocalCurrentGraphicsContext localContext(paintInfo.getContext());
|
|
|
| NSSearchFieldCell* search = this->search();
|
| setSearchCellState(o, r);
|
| [search setControlSize:searchFieldControlSizeForFont(o->style())];
|
|
|
| - GraphicsContextStateSaver stateSaver(*paintInfo.context);
|
| + GraphicsContextStateSaver stateSaver(*(paintInfo.getContext()));
|
|
|
| float zoomLevel = o->style()->effectiveZoom();
|
|
|
| @@ -1586,9 +1586,9 @@ bool RenderThemeChromiumMac::paintSearchField(RenderObject* o, const PaintInfo&
|
| if (zoomLevel != 1.0f) {
|
| unzoomedRect.setWidth(unzoomedRect.width() / zoomLevel);
|
| unzoomedRect.setHeight(unzoomedRect.height() / zoomLevel);
|
| - paintInfo.context->translate(unzoomedRect.x(), unzoomedRect.y());
|
| - paintInfo.context->scale(FloatSize(zoomLevel, zoomLevel));
|
| - paintInfo.context->translate(-unzoomedRect.x(), -unzoomedRect.y());
|
| + paintInfo.getContext()->translate(unzoomedRect.x(), unzoomedRect.y());
|
| + paintInfo.getContext()->scale(FloatSize(zoomLevel, zoomLevel));
|
| + paintInfo.getContext()->translate(-unzoomedRect.x(), -unzoomedRect.y());
|
| }
|
|
|
| // Set the search button to nil before drawing. Then reset it so we can draw it later.
|
| @@ -1668,7 +1668,7 @@ void RenderThemeChromiumMac::adjustSearchFieldStyle(RenderStyle* style, Element*
|
| style->setBoxShadow(nullptr);
|
| }
|
|
|
| -bool RenderThemeChromiumMac::paintSearchFieldCancelButton(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
|
| +bool RenderThemeChromiumMac::paintSearchFieldCancelButton(RenderObject* o, PaintInfo& paintInfo, const IntRect& r)
|
| {
|
| Element* input = o->node()->shadowHost();
|
| if (!input)
|
| @@ -1677,16 +1677,16 @@ bool RenderThemeChromiumMac::paintSearchFieldCancelButton(RenderObject* o, const
|
| if (!input->renderer()->isBox())
|
| return false;
|
|
|
| - GraphicsContextStateSaver stateSaver(*paintInfo.context);
|
| + GraphicsContextStateSaver stateSaver(*(paintInfo.getContext()));
|
|
|
| float zoomLevel = o->style()->effectiveZoom();
|
| FloatRect unzoomedRect(r);
|
| if (zoomLevel != 1.0f) {
|
| unzoomedRect.setWidth(unzoomedRect.width() / zoomLevel);
|
| unzoomedRect.setHeight(unzoomedRect.height() / zoomLevel);
|
| - paintInfo.context->translate(unzoomedRect.x(), unzoomedRect.y());
|
| - paintInfo.context->scale(FloatSize(zoomLevel, zoomLevel));
|
| - paintInfo.context->translate(-unzoomedRect.x(), -unzoomedRect.y());
|
| + paintInfo.getContext()->translate(unzoomedRect.x(), unzoomedRect.y());
|
| + paintInfo.getContext()->scale(FloatSize(zoomLevel, zoomLevel));
|
| + paintInfo.getContext()->translate(-unzoomedRect.x(), -unzoomedRect.y());
|
| }
|
|
|
| Color fillColor(200, 200, 200);
|
| @@ -1711,14 +1711,14 @@ bool RenderThemeChromiumMac::paintSearchFieldCancelButton(RenderObject* o, const
|
| xPath.addRoundedRect(FloatRect(-lineWidth / 2, -lineLength / 2, lineWidth, lineLength),
|
| lineRectRadius, lineRectRadius, lineRectRadius, lineRectRadius);
|
|
|
| - paintInfo.context->translate(centerX, centerY);
|
| - paintInfo.context->rotate(deg2rad(45.0));
|
| - paintInfo.context->clipOut(xPath);
|
| - paintInfo.context->rotate(deg2rad(-45.0));
|
| - paintInfo.context->translate(-centerX, -centerY);
|
| + paintInfo.getContext()->translate(centerX, centerY);
|
| + paintInfo.getContext()->rotate(deg2rad(45.0));
|
| + paintInfo.getContext()->clipOut(xPath);
|
| + paintInfo.getContext()->rotate(deg2rad(-45.0));
|
| + paintInfo.getContext()->translate(-centerX, -centerY);
|
|
|
| - paintInfo.context->setFillColor(fillColor);
|
| - paintInfo.context->fillEllipse(unzoomedRect);
|
| + paintInfo.getContext()->setFillColor(fillColor);
|
| + paintInfo.getContext()->fillEllipse(unzoomedRect);
|
|
|
| return false;
|
| }
|
| @@ -1753,7 +1753,7 @@ void RenderThemeChromiumMac::adjustSearchFieldDecorationStyle(RenderStyle* style
|
| style->setBoxShadow(nullptr);
|
| }
|
|
|
| -bool RenderThemeChromiumMac::paintSearchFieldDecoration(RenderObject*, const PaintInfo&, const IntRect&)
|
| +bool RenderThemeChromiumMac::paintSearchFieldDecoration(RenderObject*, PaintInfo&, const IntRect&)
|
| {
|
| return false;
|
| }
|
| @@ -1766,7 +1766,7 @@ void RenderThemeChromiumMac::adjustSearchFieldResultsDecorationStyle(RenderStyle
|
| style->setBoxShadow(nullptr);
|
| }
|
|
|
| -bool RenderThemeChromiumMac::paintSearchFieldResultsDecoration(RenderObject* o, const PaintInfo& paintInfo, const IntRect& r)
|
| +bool RenderThemeChromiumMac::paintSearchFieldResultsDecoration(RenderObject* o, PaintInfo& paintInfo, const IntRect& r)
|
| {
|
| Node* input = o->node()->shadowHost();
|
| if (!input)
|
| @@ -1774,19 +1774,19 @@ bool RenderThemeChromiumMac::paintSearchFieldResultsDecoration(RenderObject* o,
|
| if (!input->renderer()->isBox())
|
| return false;
|
|
|
| - GraphicsContextStateSaver stateSaver(*paintInfo.context);
|
| + GraphicsContextStateSaver stateSaver(*(paintInfo.getContext()));
|
|
|
| float zoomLevel = o->style()->effectiveZoom();
|
| FloatRect unzoomedRect(r);
|
| if (zoomLevel != 1) {
|
| unzoomedRect.setWidth(unzoomedRect.width() / zoomLevel);
|
| unzoomedRect.setHeight(unzoomedRect.height() / zoomLevel);
|
| - paintInfo.context->translate(unzoomedRect.x(), unzoomedRect.y());
|
| - paintInfo.context->scale(FloatSize(zoomLevel, zoomLevel));
|
| - paintInfo.context->translate(-unzoomedRect.x(), -unzoomedRect.y());
|
| + paintInfo.getContext()->translate(unzoomedRect.x(), unzoomedRect.y());
|
| + paintInfo.getContext()->scale(FloatSize(zoomLevel, zoomLevel));
|
| + paintInfo.getContext()->translate(-unzoomedRect.x(), -unzoomedRect.y());
|
| }
|
|
|
| - LocalCurrentGraphicsContext localContext(paintInfo.context);
|
| + LocalCurrentGraphicsContext localContext(paintInfo.getContext());
|
|
|
| NSSearchFieldCell* search = this->search();
|
| setSearchCellState(input->renderer(), r);
|
| @@ -1947,17 +1947,17 @@ void RenderThemeChromiumMac::adjustMediaSliderThumbSize(RenderStyle* style) cons
|
| RenderMediaControlsChromium::adjustMediaSliderThumbSize(style);
|
| }
|
|
|
| -bool RenderThemeChromiumMac::paintMediaPlayButton(RenderObject* object, const PaintInfo& paintInfo, const IntRect& rect)
|
| +bool RenderThemeChromiumMac::paintMediaPlayButton(RenderObject* object, PaintInfo& paintInfo, const IntRect& rect)
|
| {
|
| return RenderMediaControlsChromium::paintMediaControlsPart(MediaPlayButton, object, paintInfo, rect);
|
| }
|
|
|
| -bool RenderThemeChromiumMac::paintMediaMuteButton(RenderObject* object, const PaintInfo& paintInfo, const IntRect& rect)
|
| +bool RenderThemeChromiumMac::paintMediaMuteButton(RenderObject* object, PaintInfo& paintInfo, const IntRect& rect)
|
| {
|
| return RenderMediaControlsChromium::paintMediaControlsPart(MediaMuteButton, object, paintInfo, rect);
|
| }
|
|
|
| -bool RenderThemeChromiumMac::paintMediaSliderTrack(RenderObject* object, const PaintInfo& paintInfo, const IntRect& rect)
|
| +bool RenderThemeChromiumMac::paintMediaSliderTrack(RenderObject* object, PaintInfo& paintInfo, const IntRect& rect)
|
| {
|
| return RenderMediaControlsChromium::paintMediaControlsPart(MediaSlider, object, paintInfo, rect);
|
| }
|
| @@ -1974,22 +1974,22 @@ String RenderThemeChromiumMac::extraDefaultStyleSheet()
|
| String(themeChromiumUserAgentStyleSheet, sizeof(themeChromiumUserAgentStyleSheet));
|
| }
|
|
|
| -bool RenderThemeChromiumMac::paintMediaVolumeSliderContainer(RenderObject* object, const PaintInfo& paintInfo, const IntRect& rect)
|
| +bool RenderThemeChromiumMac::paintMediaVolumeSliderContainer(RenderObject* object, PaintInfo& paintInfo, const IntRect& rect)
|
| {
|
| return true;
|
| }
|
|
|
| -bool RenderThemeChromiumMac::paintMediaVolumeSliderTrack(RenderObject* object, const PaintInfo& paintInfo, const IntRect& rect)
|
| +bool RenderThemeChromiumMac::paintMediaVolumeSliderTrack(RenderObject* object, PaintInfo& paintInfo, const IntRect& rect)
|
| {
|
| return RenderMediaControlsChromium::paintMediaControlsPart(MediaVolumeSlider, object, paintInfo, rect);
|
| }
|
|
|
| -bool RenderThemeChromiumMac::paintMediaVolumeSliderThumb(RenderObject* object, const PaintInfo& paintInfo, const IntRect& rect)
|
| +bool RenderThemeChromiumMac::paintMediaVolumeSliderThumb(RenderObject* object, PaintInfo& paintInfo, const IntRect& rect)
|
| {
|
| return RenderMediaControlsChromium::paintMediaControlsPart(MediaVolumeSliderThumb, object, paintInfo, rect);
|
| }
|
|
|
| -bool RenderThemeChromiumMac::paintMediaSliderThumb(RenderObject* object, const PaintInfo& paintInfo, const IntRect& rect)
|
| +bool RenderThemeChromiumMac::paintMediaSliderThumb(RenderObject* object, PaintInfo& paintInfo, const IntRect& rect)
|
| {
|
| return RenderMediaControlsChromium::paintMediaControlsPart(MediaSliderThumb, object, paintInfo, rect);
|
| }
|
| @@ -2004,12 +2004,12 @@ String RenderThemeChromiumMac::formatMediaControlsCurrentTime(float currentTime,
|
| return RenderMediaControlsChromium::formatMediaControlsCurrentTime(currentTime, duration);
|
| }
|
|
|
| -bool RenderThemeChromiumMac::paintMediaFullscreenButton(RenderObject* object, const PaintInfo& paintInfo, const IntRect& rect)
|
| +bool RenderThemeChromiumMac::paintMediaFullscreenButton(RenderObject* object, PaintInfo& paintInfo, const IntRect& rect)
|
| {
|
| return RenderMediaControlsChromium::paintMediaControlsPart(MediaEnterFullscreenButton, object, paintInfo, rect);
|
| }
|
|
|
| -bool RenderThemeChromiumMac::paintMediaToggleClosedCaptionsButton(RenderObject* object, const PaintInfo& paintInfo, const IntRect& rect)
|
| +bool RenderThemeChromiumMac::paintMediaToggleClosedCaptionsButton(RenderObject* object, PaintInfo& paintInfo, const IntRect& rect)
|
| {
|
| return RenderMediaControlsChromium::paintMediaControlsPart(MediaShowClosedCaptionsButton, object, paintInfo, rect);
|
| }
|
|
|