Example #1
0
bool RenderTheme::paintBorderOnly(const RenderObject& o, const PaintInfo& paintInfo, const LayoutRect& r)
{
    if (paintInfo.context->paintingDisabled())
        return false;

#if PLATFORM(IOS)
    UNUSED_PARAM(r);
    return o.style().appearance() != NoControlPart;
#else
    FloatRect devicePixelSnappedRect = pixelSnappedForPainting(r, o.document().deviceScaleFactor());
    // Call the appropriate paint method based off the appearance value.
    switch (o.style().appearance()) {
    case TextFieldPart:
        return paintTextField(o, paintInfo, devicePixelSnappedRect);
    case ListboxPart:
    case TextAreaPart:
        return paintTextArea(o, paintInfo, devicePixelSnappedRect);
    case MenulistButtonPart:
    case SearchFieldPart:
        return true;
    case CheckboxPart:
    case RadioPart:
    case PushButtonPart:
    case SquareButtonPart:
    case DefaultButtonPart:
    case ButtonPart:
    case MenulistPart:
#if ENABLE(METER_ELEMENT)
    case MeterPart:
    case RelevancyLevelIndicatorPart:
    case ContinuousCapacityLevelIndicatorPart:
    case DiscreteCapacityLevelIndicatorPart:
    case RatingLevelIndicatorPart:
#endif
#if ENABLE(PROGRESS_ELEMENT)
    case ProgressBarPart:
#endif
    case SliderHorizontalPart:
    case SliderVerticalPart:
    case SliderThumbHorizontalPart:
    case SliderThumbVerticalPart:
    case SearchFieldCancelButtonPart:
    case SearchFieldDecorationPart:
    case SearchFieldResultsDecorationPart:
    case SearchFieldResultsButtonPart:
#if ENABLE(INPUT_SPEECH)
    case InputSpeechButtonPart:
#endif
#if ENABLE(SERVICE_CONTROLS)
    case ImageControlsButtonPart:
#endif
    default:
        break;
    }

    return false;
#endif
}
Example #2
0
void FilterEffectRendererHelper::applyFilterEffect(GraphicsContext* destinationContext)
{
    ASSERT(m_haveFilterEffect && m_renderLayer->filterRenderer());
    FilterEffectRenderer* filter = m_renderLayer->filterRenderer();
    filter->inputContext()->restore();

    filter->apply();
    
    // Get the filtered output and draw it in place.
    LayoutRect destRect = filter->outputRect();
    destRect.move(m_paintOffset.x(), m_paintOffset.y());

    destinationContext->drawImageBuffer(filter->output(), m_renderLayer->renderer().style().colorSpace(),
        pixelSnappedForPainting(destRect, m_renderLayer->renderer().document().deviceScaleFactor()), CompositeSourceOver);

    filter->clearIntermediateResults();
}
Example #3
0
bool RenderTheme::paintDecorations(const RenderObject& renderer, const PaintInfo& paintInfo, const LayoutRect& rect)
{
    if (paintInfo.context->paintingDisabled())
        return false;

    IntRect integralSnappedRect = pixelSnappedIntRect(rect);
    FloatRect devicePixelSnappedRect = pixelSnappedForPainting(rect, renderer.document().deviceScaleFactor());

    // Call the appropriate paint method based off the appearance value.
    switch (renderer.style().appearance()) {
    case MenulistButtonPart:
        return paintMenuListButtonDecorations(renderer, paintInfo, integralSnappedRect);
    case TextFieldPart:
        return paintTextFieldDecorations(renderer, paintInfo, devicePixelSnappedRect);
    case TextAreaPart:
        return paintTextAreaDecorations(renderer, paintInfo, devicePixelSnappedRect);
    case CheckboxPart:
        return paintCheckboxDecorations(renderer, paintInfo, integralSnappedRect);
    case RadioPart:
        return paintRadioDecorations(renderer, paintInfo, integralSnappedRect);
    case PushButtonPart:
        return paintPushButtonDecorations(renderer, paintInfo, integralSnappedRect);
    case SquareButtonPart:
        return paintSquareButtonDecorations(renderer, paintInfo, integralSnappedRect);
    case ButtonPart:
        return paintButtonDecorations(renderer, paintInfo, integralSnappedRect);
    case MenulistPart:
        return paintMenuListDecorations(renderer, paintInfo, integralSnappedRect);
    case SliderThumbHorizontalPart:
    case SliderThumbVerticalPart:
        return paintSliderThumbDecorations(renderer, paintInfo, integralSnappedRect);
    case SearchFieldPart:
        return paintSearchFieldDecorations(renderer, paintInfo, integralSnappedRect);
#if ENABLE(METER_ELEMENT)
    case MeterPart:
    case RelevancyLevelIndicatorPart:
    case ContinuousCapacityLevelIndicatorPart:
    case DiscreteCapacityLevelIndicatorPart:
    case RatingLevelIndicatorPart:
#endif
#if ENABLE(PROGRESS_ELEMENT)
    case ProgressBarPart:
#endif
    case SliderHorizontalPart:
    case SliderVerticalPart:
    case ListboxPart:
    case DefaultButtonPart:
    case SearchFieldCancelButtonPart:
    case SearchFieldDecorationPart:
    case SearchFieldResultsDecorationPart:
    case SearchFieldResultsButtonPart:
#if ENABLE(INPUT_SPEECH)
    case InputSpeechButtonPart:
#endif
#if ENABLE(SERVICE_CONTROLS)
    case ImageControlsButtonPart:
#endif
    default:
        break;
    }

    return false;
}