本文整理汇总了C++中RenderStyle::filter方法的典型用法代码示例。如果您正苦于以下问题:C++ RenderStyle::filter方法的具体用法?C++ RenderStyle::filter怎么用?C++ RenderStyle::filter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RenderStyle
的用法示例。
在下文中一共展示了RenderStyle::filter方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: buildCachedResources
bool SVGResources::buildCachedResources(const RenderElement& renderer, const RenderStyle& style)
{
ASSERT(renderer.element());
ASSERT_WITH_SECURITY_IMPLICATION(renderer.element()->isSVGElement());
if (!renderer.element())
return false;
auto& element = downcast<SVGElement>(*renderer.element());
Document& document = element.document();
SVGDocumentExtensions& extensions = document.accessSVGExtensions();
const AtomicString& tagName = element.localName();
if (tagName.isNull())
return false;
const SVGRenderStyle& svgStyle = style.svgStyle();
bool foundResources = false;
if (clipperFilterMaskerTags().contains(tagName)) {
if (svgStyle.hasClipper()) {
AtomicString id(svgStyle.clipperResource());
if (setClipper(getRenderSVGResourceById<RenderSVGResourceClipper>(document, id)))
foundResources = true;
else
registerPendingResource(extensions, id, element);
}
if (style.hasFilter()) {
const FilterOperations& filterOperations = style.filter();
if (filterOperations.size() == 1) {
const FilterOperation& filterOperation = *filterOperations.at(0);
if (filterOperation.type() == FilterOperation::REFERENCE) {
const auto& referenceFilterOperation = downcast<ReferenceFilterOperation>(filterOperation);
AtomicString id = SVGURIReference::fragmentIdentifierFromIRIString(referenceFilterOperation.url(), element.document());
if (setFilter(getRenderSVGResourceById<RenderSVGResourceFilter>(document, id)))
foundResources = true;
else
registerPendingResource(extensions, id, element);
}
}
}
if (svgStyle.hasMasker()) {
AtomicString id(svgStyle.maskerResource());
if (setMasker(getRenderSVGResourceById<RenderSVGResourceMasker>(document, id)))
foundResources = true;
else
registerPendingResource(extensions, id, element);
}
}
if (markerTags().contains(tagName) && svgStyle.hasMarkers()) {
AtomicString markerStartId(svgStyle.markerStartResource());
if (setMarkerStart(getRenderSVGResourceById<RenderSVGResourceMarker>(document, markerStartId)))
foundResources = true;
else
registerPendingResource(extensions, markerStartId, element);
AtomicString markerMidId(svgStyle.markerMidResource());
if (setMarkerMid(getRenderSVGResourceById<RenderSVGResourceMarker>(document, markerMidId)))
foundResources = true;
else
registerPendingResource(extensions, markerMidId, element);
AtomicString markerEndId(svgStyle.markerEndResource());
if (setMarkerEnd(getRenderSVGResourceById<RenderSVGResourceMarker>(document, markerEndId)))
foundResources = true;
else
registerPendingResource(extensions, markerEndId, element);
}
if (fillAndStrokeTags().contains(tagName)) {
if (svgStyle.hasFill()) {
bool hasPendingResource = false;
AtomicString id;
if (setFill(paintingResourceFromSVGPaint(document, svgStyle.fillPaintType(), svgStyle.fillPaintUri(), id, hasPendingResource)))
foundResources = true;
else if (hasPendingResource)
registerPendingResource(extensions, id, element);
}
if (svgStyle.hasStroke()) {
bool hasPendingResource = false;
AtomicString id;
if (setStroke(paintingResourceFromSVGPaint(document, svgStyle.strokePaintType(), svgStyle.strokePaintUri(), id, hasPendingResource)))
foundResources = true;
else if (hasPendingResource)
registerPendingResource(extensions, id, element);
}
}
if (chainableResourceTags().contains(tagName)) {
AtomicString id(targetReferenceFromResource(element));
if (setLinkedResource(getRenderSVGResourceContainerById(document, id)))
foundResources = true;
else
registerPendingResource(extensions, id, element);
//.........这里部分代码省略.........
示例2: propertiesEqual
//.........这里部分代码省略.........
return a.stopOpacity() == b.stopOpacity();
case CSSPropertyStroke:
return a.strokePaintType() == b.strokePaintType()
&& (a.strokePaintType() != SVGPaint::SVG_PAINTTYPE_RGBCOLOR || a.strokePaintColor() == b.strokePaintColor());
case CSSPropertyStrokeDasharray:
return dataEquivalent(a.strokeDashArray(), b.strokeDashArray());
case CSSPropertyStrokeDashoffset:
return dataEquivalent(a.strokeDashOffset(), b.strokeDashOffset());
case CSSPropertyStrokeMiterlimit:
return a.strokeMiterLimit() == b.strokeMiterLimit();
case CSSPropertyStrokeOpacity:
return a.strokeOpacity() == b.strokeOpacity();
case CSSPropertyStrokeWidth:
return dataEquivalent(a.strokeWidth(), b.strokeWidth());
case CSSPropertyTextDecorationColor:
return a.textDecorationColor().resolve(a.color()) == b.textDecorationColor().resolve(b.color())
&& a.visitedLinkTextDecorationColor().resolve(a.color()) == b.visitedLinkTextDecorationColor().resolve(b.color());
case CSSPropertyTextIndent:
return a.textIndent() == b.textIndent();
case CSSPropertyTextShadow:
return dataEquivalent(a.textShadow(), b.textShadow());
case CSSPropertyTop:
return a.top() == b.top();
case CSSPropertyVisibility:
return a.visibility() == b.visibility();
case CSSPropertyWebkitBackgroundSize:
return fillLayersEqual<CSSPropertyWebkitBackgroundSize>(a.backgroundLayers(), b.backgroundLayers());
case CSSPropertyWebkitBorderHorizontalSpacing:
return a.horizontalBorderSpacing() == b.horizontalBorderSpacing();
case CSSPropertyWebkitBorderVerticalSpacing:
return a.verticalBorderSpacing() == b.verticalBorderSpacing();
case CSSPropertyWebkitBoxShadow:
return dataEquivalent(a.boxShadow(), b.boxShadow());
case CSSPropertyWebkitClipPath:
return dataEquivalent(a.clipPath(), b.clipPath());
case CSSPropertyWebkitColumnCount:
return a.columnCount() == b.columnCount();
case CSSPropertyWebkitColumnGap:
return a.columnGap() == b.columnGap();
case CSSPropertyWebkitColumnRuleColor:
return a.columnRuleColor().resolve(a.color()) == b.columnRuleColor().resolve(b.color())
&& a.visitedLinkColumnRuleColor().resolve(a.color()) == b.visitedLinkColumnRuleColor().resolve(b.color());
case CSSPropertyWebkitColumnRuleWidth:
return a.columnRuleWidth() == b.columnRuleWidth();
case CSSPropertyWebkitColumnWidth:
return a.columnWidth() == b.columnWidth();
case CSSPropertyWebkitFilter:
return a.filter() == b.filter();
case CSSPropertyWebkitMaskBoxImageOutset:
return a.maskBoxImageOutset() == b.maskBoxImageOutset();
case CSSPropertyWebkitMaskBoxImageSlice:
return a.maskBoxImageSlices() == b.maskBoxImageSlices();
case CSSPropertyWebkitMaskBoxImageSource:
return dataEquivalent(a.maskBoxImageSource(), b.maskBoxImageSource());
case CSSPropertyWebkitMaskBoxImageWidth:
return a.maskBoxImageWidth() == b.maskBoxImageWidth();
case CSSPropertyWebkitMaskImage:
return dataEquivalent(a.maskImage(), b.maskImage());
case CSSPropertyWebkitMaskPositionX:
return fillLayersEqual<CSSPropertyWebkitMaskPositionX>(a.maskLayers(), b.maskLayers());
case CSSPropertyWebkitMaskPositionY:
return fillLayersEqual<CSSPropertyWebkitMaskPositionY>(a.maskLayers(), b.maskLayers());
case CSSPropertyWebkitMaskSize:
return fillLayersEqual<CSSPropertyWebkitMaskSize>(a.maskLayers(), b.maskLayers());
case CSSPropertyPerspective:
return a.perspective() == b.perspective();
case CSSPropertyPerspectiveOrigin:
return a.perspectiveOriginX() == b.perspectiveOriginX() && a.perspectiveOriginY() == b.perspectiveOriginY();
case CSSPropertyWebkitPerspectiveOriginX:
return a.perspectiveOriginX() == b.perspectiveOriginX();
case CSSPropertyWebkitPerspectiveOriginY:
return a.perspectiveOriginY() == b.perspectiveOriginY();
case CSSPropertyWebkitTextStrokeColor:
return a.textStrokeColor().resolve(a.color()) == b.textStrokeColor().resolve(b.color())
&& a.visitedLinkTextStrokeColor().resolve(a.color()) == b.visitedLinkTextStrokeColor().resolve(b.color());
case CSSPropertyTransform:
return a.transform() == b.transform();
case CSSPropertyTransformOrigin:
return a.transformOriginX() == b.transformOriginX() && a.transformOriginY() == b.transformOriginY() && a.transformOriginZ() == b.transformOriginZ();
case CSSPropertyWebkitTransformOriginX:
return a.transformOriginX() == b.transformOriginX();
case CSSPropertyWebkitTransformOriginY:
return a.transformOriginY() == b.transformOriginY();
case CSSPropertyWebkitTransformOriginZ:
return a.transformOriginZ() == b.transformOriginZ();
case CSSPropertyWidows:
return a.widows() == b.widows();
case CSSPropertyWidth:
return a.width() == b.width();
case CSSPropertyWordSpacing:
return a.wordSpacing() == b.wordSpacing();
case CSSPropertyZIndex:
return a.zIndex() == b.zIndex();
case CSSPropertyZoom:
return a.zoom() == b.zoom();
default:
ASSERT_NOT_REACHED();
return true;
}
}
示例3: createFromColor
// FIXME: Generate this function.
PassRefPtr<AnimatableValue> CSSAnimatableValueFactory::create(CSSPropertyID property, const RenderStyle& style)
{
ASSERT(CSSPropertyMetadata::isAnimatableProperty(property));
switch (property) {
case CSSPropertyBackgroundColor:
return createFromColor(property, style);
case CSSPropertyBackgroundImage:
return createFromFillLayers<CSSPropertyBackgroundImage>(style.backgroundLayers(), style);
case CSSPropertyBackgroundPositionX:
return createFromFillLayers<CSSPropertyBackgroundPositionX>(style.backgroundLayers(), style);
case CSSPropertyBackgroundPositionY:
return createFromFillLayers<CSSPropertyBackgroundPositionY>(style.backgroundLayers(), style);
case CSSPropertyBackgroundSize:
case CSSPropertyWebkitBackgroundSize:
return createFromFillLayers<CSSPropertyBackgroundSize>(style.backgroundLayers(), style);
case CSSPropertyBorderBottomColor:
return createFromColor(property, style);
case CSSPropertyBorderBottomLeftRadius:
return createFromLengthSize(style.borderBottomLeftRadius(), style);
case CSSPropertyBorderBottomRightRadius:
return createFromLengthSize(style.borderBottomRightRadius(), style);
case CSSPropertyBorderBottomWidth:
return createFromDouble(style.borderBottomWidth());
case CSSPropertyBorderImageOutset:
return createFromBorderImageLengthBox(style.borderImageOutset(), style);
case CSSPropertyBorderImageSlice:
return createFromLengthBox(style.borderImageSlices(), style);
case CSSPropertyBorderImageSource:
return createFromStyleImage(style.borderImageSource());
case CSSPropertyBorderImageWidth:
return createFromBorderImageLengthBox(style.borderImageWidth(), style);
case CSSPropertyBorderLeftColor:
return createFromColor(property, style);
case CSSPropertyBorderLeftWidth:
return createFromDouble(style.borderLeftWidth());
case CSSPropertyBorderRightColor:
return createFromColor(property, style);
case CSSPropertyBorderRightWidth:
return createFromDouble(style.borderRightWidth());
case CSSPropertyBorderTopColor:
return createFromColor(property, style);
case CSSPropertyBorderTopLeftRadius:
return createFromLengthSize(style.borderTopLeftRadius(), style);
case CSSPropertyBorderTopRightRadius:
return createFromLengthSize(style.borderTopRightRadius(), style);
case CSSPropertyBorderTopWidth:
return createFromDouble(style.borderTopWidth());
case CSSPropertyBottom:
return createFromLength(style.bottom(), style);
case CSSPropertyBoxShadow:
case CSSPropertyWebkitBoxShadow:
return AnimatableShadow::create(style.boxShadow());
case CSSPropertyClip:
if (style.hasAutoClip())
return AnimatableUnknown::create(CSSPrimitiveValue::create(CSSValueAuto));
return createFromLengthBox(style.clip(), style);
case CSSPropertyColor:
return createFromColor(property, style);
case CSSPropertyFilter:
return AnimatableFilterOperations::create(style.filter());
case CSSPropertyFlexGrow:
return createFromDouble(style.flexGrow(), AnimatableDouble::InterpolationIsNonContinuousWithZero);
case CSSPropertyFlexShrink:
return createFromDouble(style.flexShrink(), AnimatableDouble::InterpolationIsNonContinuousWithZero);
case CSSPropertyFlexBasis:
return createFromLength(style.flexBasis(), style);
case CSSPropertyFontSize:
// Must pass a specified size to setFontSize if Text Autosizing is enabled, but a computed size
// if text zoom is enabled (if neither is enabled it's irrelevant as they're probably the same).
// FIXME: Should we introduce an option to pass the computed font size here, allowing consumers to
// enable text zoom rather than Text Autosizing? See http://crbug.com/227545.
return createFromDouble(style.specifiedFontSize());
case CSSPropertyFontStretch:
return createFromFontStretch(style.fontStretch());
case CSSPropertyFontWeight:
return createFromFontWeight(style.fontWeight());
case CSSPropertyHeight:
return createFromLength(style.height(), style);
case CSSPropertyLeft:
return createFromLength(style.left(), style);
case CSSPropertyLetterSpacing:
return createFromDouble(style.letterSpacing());
case CSSPropertyLineHeight:
return createFromLineHeight(style.specifiedLineHeight(), style);
case CSSPropertyMarginBottom:
return createFromLength(style.marginBottom(), style);
case CSSPropertyMarginLeft:
return createFromLength(style.marginLeft(), style);
case CSSPropertyMarginRight:
return createFromLength(style.marginRight(), style);
case CSSPropertyMarginTop:
return createFromLength(style.marginTop(), style);
case CSSPropertyMaxHeight:
return createFromLength(style.maxHeight(), style);
case CSSPropertyMaxWidth:
return createFromLength(style.maxWidth(), style);
case CSSPropertyMinHeight:
return createFromLength(style.minHeight(), style);
case CSSPropertyMinWidth:
//.........这里部分代码省略.........
示例4: createFromColor
//.........这里部分代码省略.........
return createFromLength(style.right(), style);
case CSSPropertyStrokeWidth:
return AnimatableSVGLength::create(style.strokeWidth());
case CSSPropertyStopColor:
return createFromColor(property, style);
case CSSPropertyStopOpacity:
return createFromDouble(style.stopOpacity());
case CSSPropertyStrokeDasharray:
return AnimatableStrokeDasharrayList::create(style.strokeDashArray());
case CSSPropertyStrokeDashoffset:
return AnimatableSVGLength::create(style.strokeDashOffset());
case CSSPropertyStrokeMiterlimit:
return createFromDouble(style.strokeMiterLimit());
case CSSPropertyStrokeOpacity:
return createFromDouble(style.strokeOpacity());
case CSSPropertyStroke:
return AnimatableSVGPaint::create(style.svgStyle()->strokePaintType(), style.svgStyle()->strokePaintColor(), style.svgStyle()->strokePaintUri());
case CSSPropertyTextDecorationColor:
return createFromColor(property, style);
case CSSPropertyTextIndent:
return createFromLength(style.textIndent(), style);
case CSSPropertyTextShadow:
return AnimatableShadow::create(style.textShadow());
case CSSPropertyTop:
return createFromLength(style.top(), style);
case CSSPropertyWebkitBorderHorizontalSpacing:
return createFromDouble(style.horizontalBorderSpacing());
case CSSPropertyWebkitBorderVerticalSpacing:
return createFromDouble(style.verticalBorderSpacing());
case CSSPropertyWebkitClipPath:
return AnimatableClipPathOperation::create(style.clipPath());
case CSSPropertyWebkitColumnCount:
return createFromDouble(style.columnCount());
case CSSPropertyWebkitColumnGap:
return createFromDouble(style.columnGap());
case CSSPropertyWebkitColumnRuleColor:
return createFromColor(property, style);
case CSSPropertyWebkitColumnRuleWidth:
return createFromDouble(style.columnRuleWidth());
case CSSPropertyWebkitColumnWidth:
return createFromDouble(style.columnWidth());
case CSSPropertyWebkitFilter:
return AnimatableFilterOperations::create(style.filter());
case CSSPropertyWebkitMaskBoxImageOutset:
return createFromBorderImageLengthBox(style.maskBoxImageOutset(), style);
case CSSPropertyWebkitMaskBoxImageSlice:
return createFromLengthBoxAndBool(style.maskBoxImageSlices(), style.maskBoxImageSlicesFill(), style);
case CSSPropertyWebkitMaskBoxImageSource:
return createFromStyleImage(style.maskBoxImageSource());
case CSSPropertyWebkitMaskBoxImageWidth:
return createFromBorderImageLengthBox(style.maskBoxImageWidth(), style);
case CSSPropertyWebkitMaskImage:
return createFromFillLayers<CSSPropertyWebkitMaskImage>(style.maskLayers(), style);
case CSSPropertyWebkitMaskPositionX:
return createFromFillLayers<CSSPropertyWebkitMaskPositionX>(style.maskLayers(), style);
case CSSPropertyWebkitMaskPositionY:
return createFromFillLayers<CSSPropertyWebkitMaskPositionY>(style.maskLayers(), style);
case CSSPropertyWebkitMaskSize:
return createFromFillLayers<CSSPropertyWebkitMaskSize>(style.maskLayers(), style);
case CSSPropertyWebkitPerspective:
return createFromDouble(style.perspective());
case CSSPropertyWebkitPerspectiveOriginX:
return createFromLength(style.perspectiveOriginX(), style);
case CSSPropertyWebkitPerspectiveOriginY:
return createFromLength(style.perspectiveOriginY(), style);
case CSSPropertyShapeInside:
return AnimatableShapeValue::create(style.shapeInside());
case CSSPropertyShapeOutside:
return AnimatableShapeValue::create(style.shapeOutside());
case CSSPropertyShapeMargin:
return createFromLength(style.shapeMargin(), style);
case CSSPropertyWebkitTextStrokeColor:
return createFromColor(property, style);
case CSSPropertyWebkitTransform:
return AnimatableTransform::create(style.transform());
case CSSPropertyWebkitTransformOriginX:
return createFromLength(style.transformOriginX(), style);
case CSSPropertyWebkitTransformOriginY:
return createFromLength(style.transformOriginY(), style);
case CSSPropertyWebkitTransformOriginZ:
return createFromDouble(style.transformOriginZ());
case CSSPropertyWidows:
return createFromDouble(style.widows());
case CSSPropertyWidth:
return createFromLength(style.width(), style);
case CSSPropertyWordSpacing:
return createFromDouble(style.wordSpacing());
case CSSPropertyVisibility:
return AnimatableVisibility::create(style.visibility());
case CSSPropertyZIndex:
return createFromDouble(style.zIndex());
case CSSPropertyZoom:
return createFromDouble(style.zoom());
default:
ASSERT_WITH_MESSAGE(!CSSAnimations::isAnimatableProperty(property), "Web Animations not yet implemented: Create AnimatableValue from render style: %s", getPropertyNameString(property).utf8().data());
ASSERT_NOT_REACHED();
// This return value is to avoid a release crash if possible.
return AnimatableUnknown::create(0);
}
}