本文整理汇总了C++中SVGPaintServer::isTransformDependent方法的典型用法代码示例。如果您正苦于以下问题:C++ SVGPaintServer::isTransformDependent方法的具体用法?C++ SVGPaintServer::isTransformDependent怎么用?C++ SVGPaintServer::isTransformDependent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SVGPaintServer
的用法示例。
在下文中一共展示了SVGPaintServer::isTransformDependent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateGraphicsContext
bool SVGLayoutSupport::updateGraphicsContext(const PaintInfo& paintInfo, GraphicsContextStateSaver& stateSaver, const ComputedStyle& style, LayoutObject& layoutObject, LayoutSVGResourceMode resourceMode, const AffineTransform* additionalPaintServerTransform)
{
ASSERT(paintInfo.context == stateSaver.context());
GraphicsContext& context = *paintInfo.context;
if (paintInfo.isRenderingClipPathAsMaskImage()) {
if (resourceMode == ApplyToStrokeMode)
return false;
context.setFillColor(SVGComputedStyle::initialFillPaintColor());
return true;
}
SVGPaintServer paintServer = SVGPaintServer::requestForLayoutObject(layoutObject, style, resourceMode);
if (!paintServer.isValid())
return false;
if (additionalPaintServerTransform && paintServer.isTransformDependent())
paintServer.prependTransform(*additionalPaintServerTransform);
const SVGComputedStyle& svgStyle = style.svgStyle();
float paintAlpha = resourceMode == ApplyToFillMode ? svgStyle.fillOpacity() : svgStyle.strokeOpacity();
paintServer.apply(context, resourceMode, paintAlpha, stateSaver);
if (resourceMode == ApplyToFillMode)
context.setFillRule(svgStyle.fillRule());
else
applyStrokeStyleToContext(context, style, layoutObject);
return true;
}
示例2: updateGraphicsContext
bool SVGRenderSupport::updateGraphicsContext(const PaintInfo& paintInfo, GraphicsContextStateSaver& stateSaver, RenderStyle* style, RenderObject& renderer, RenderSVGResourceMode resourceMode, const AffineTransform* additionalPaintServerTransform)
{
ASSERT(style);
ASSERT(paintInfo.context == stateSaver.context());
GraphicsContext* context = paintInfo.context;
if (paintInfo.isRenderingClipPathAsMaskImage()) {
if (resourceMode == ApplyToStrokeMode)
return false;
context->setAlphaAsFloat(1);
context->setFillColor(SVGRenderStyle::initialFillPaintColor());
return true;
}
SVGPaintServer paintServer = SVGPaintServer::requestForRenderer(renderer, style, resourceMode);
if (!paintServer.isValid())
return false;
if (additionalPaintServerTransform && paintServer.isTransformDependent())
paintServer.prependTransform(*additionalPaintServerTransform);
paintServer.apply(*context, resourceMode, &stateSaver);
const SVGRenderStyle& svgStyle = style->svgStyle();
if (resourceMode == ApplyToFillMode) {
context->setAlphaAsFloat(svgStyle.fillOpacity());
context->setFillRule(svgStyle.fillRule());
} else {
context->setAlphaAsFloat(svgStyle.strokeOpacity());
applyStrokeStyleToContext(context, style, &renderer);
}
return true;
}
示例3: paintForLayoutObject
bool SVGPaintContext::paintForLayoutObject(
const PaintInfo& paintInfo,
const ComputedStyle& style,
const LayoutObject& layoutObject,
LayoutSVGResourceMode resourceMode,
SkPaint& paint,
const AffineTransform* additionalPaintServerTransform) {
if (paintInfo.isRenderingClipPathAsMaskImage()) {
if (resourceMode == ApplyToStrokeMode)
return false;
paint.setColor(SVGComputedStyle::initialFillPaintColor().rgb());
paint.setShader(nullptr);
return true;
}
SVGPaintServer paintServer =
SVGPaintServer::requestForLayoutObject(layoutObject, style, resourceMode);
if (!paintServer.isValid())
return false;
if (additionalPaintServerTransform && paintServer.isTransformDependent())
paintServer.prependTransform(*additionalPaintServerTransform);
const SVGComputedStyle& svgStyle = style.svgStyle();
float paintAlpha = resourceMode == ApplyToFillMode ? svgStyle.fillOpacity()
: svgStyle.strokeOpacity();
paintServer.applyToSkPaint(paint, paintAlpha);
// We always set filter quality to 'low' here. This value will only have an
// effect for patterns, which are SkPictures, so using high-order filter
// should have little effect on the overall quality.
paint.setFilterQuality(kLow_SkFilterQuality);
// TODO(fs): The color filter can set when generating a picture for a mask -
// due to color-interpolation. We could also just apply the
// color-interpolation property from the the shape itself (which could mean
// the paintserver if it has it specified), since that would be more in line
// with the spec for color-interpolation. For now, just steal it from the GC
// though.
// Additionally, it's not really safe/guaranteed to be correct, as
// something down the paint pipe may want to farther tweak the color
// filter, which could yield incorrect results. (Consider just using
// saveLayer() w/ this color filter explicitly instead.)
paint.setColorFilter(sk_ref_sp(paintInfo.context.getColorFilter()));
return true;
}