本文整理汇总了C++中GraphicsContext::clearShadow方法的典型用法代码示例。如果您正苦于以下问题:C++ GraphicsContext::clearShadow方法的具体用法?C++ GraphicsContext::clearShadow怎么用?C++ GraphicsContext::clearShadow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GraphicsContext
的用法示例。
在下文中一共展示了GraphicsContext::clearShadow方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: paint
void EllipsisBox::paint(RenderObject::PaintInfo& paintInfo, int tx, int ty)
{
GraphicsContext* context = paintInfo.context;
RenderStyle* style = m_object->style(m_firstLine);
if (style->font() != context->font())
context->setFont(style->font());
Color textColor = style->color();
if (textColor != context->fillColor())
context->setFillColor(textColor);
bool setShadow = false;
if (style->textShadow()) {
context->setShadow(IntSize(style->textShadow()->x, style->textShadow()->y),
style->textShadow()->blur, style->textShadow()->color);
setShadow = true;
}
const String& str = m_str;
TextStyle textStyle(0, 0, 0, false, style->visuallyOrdered());
context->drawText(TextRun(str.impl()), IntPoint(m_x + tx, m_y + ty + m_baseline), textStyle);
if (setShadow)
context->clearShadow();
if (m_markupBox) {
// Paint the markup box
tx += m_x + m_width - m_markupBox->xPos();
ty += m_y + m_baseline - (m_markupBox->yPos() + m_markupBox->baseline());
m_markupBox->paint(paintInfo, tx, ty);
}
}
示例2: paint
void EllipsisBox::paint(RenderObject::PaintInfo& paintInfo, int tx, int ty)
{
GraphicsContext* context = paintInfo.context;
RenderStyle* style = m_renderer->style(m_firstLine);
Color textColor = style->color();
if (textColor != context->fillColor())
context->setFillColor(textColor, style->colorSpace());
bool setShadow = false;
if (style->textShadow()) {
context->setShadow(IntSize(style->textShadow()->x, style->textShadow()->y),
style->textShadow()->blur, style->textShadow()->color, style->colorSpace());
setShadow = true;
}
if (selectionState() != RenderObject::SelectionNone) {
paintSelection(context, tx, ty, style, style->font());
// Select the correct color for painting the text.
Color foreground = paintInfo.forceBlackText ? Color::black : renderer()->selectionForegroundColor();
if (foreground.isValid() && foreground != textColor)
context->setFillColor(foreground, style->colorSpace());
}
const String& str = m_str;
context->drawText(style->font(), TextRun(str.characters(), str.length(), false, 0, 0, false, style->visuallyOrdered()), IntPoint(m_x + tx, m_y + ty + style->font().ascent()));
// Restore the regular fill color.
if (textColor != context->fillColor())
context->setFillColor(textColor, style->colorSpace());
if (setShadow)
context->clearShadow();
if (m_markupBox) {
// Paint the markup box
tx += m_x + m_width - m_markupBox->x();
ty += m_y + style->font().ascent() - (m_markupBox->y() + m_markupBox->renderer()->style(m_firstLine)->font().ascent());
m_markupBox->paint(paintInfo, tx, ty);
}
}
示例3: fillShape
void RenderSVGRect::fillShape(GraphicsContext& context) const
{
if (m_usePathFallback) {
RenderSVGShape::fillShape(context);
return;
}
#if USE(CG)
// FIXME: CG implementation of GraphicsContextCG::fillRect has an own
// shadow drawing method, which draws an extra shadow.
// This is a workaround for switching off the extra shadow.
// https://bugs.webkit.org/show_bug.cgi?id=68899
if (context.hasShadow()) {
GraphicsContextStateSaver stateSaver(context);
context.clearShadow();
context.fillRect(m_fillBoundingBox);
return;
}
#endif
context.fillRect(m_fillBoundingBox);
}
示例4: apply
void ClearShadow::apply(GraphicsContext& context) const
{
context.clearShadow();
}