• Home
  • Raw
  • Download

Lines Matching +full:source +full:- +full:pristine

4  * Use of this source code is governed by a BSD-style license that can be
42 // Multipliers for DPI-relative units.
78 this->resolve(x, SkSVGLengthContext::LengthType::kHorizontal), in resolveRect()
79 this->resolve(y, SkSVGLengthContext::LengthType::kVertical), in resolveRect()
80 this->resolve(w, SkSVGLengthContext::LengthType::kHorizontal), in resolveRect()
81 this->resolve(h, SkSVGLengthContext::LengthType::kVertical)); in resolveRect()
114 if (props.fStrokeDashArray->type() != SkSVGDashArray::Type::kDashArray) { in dash_effect()
159 , fCanvasSaveCount(canvas->getSaveCount()) in SkSVGRenderContext()
190 fCanvas->restoreToCount(fCanvasSaveCount); in ~SkSVGRenderContext()
195 SkDebugf("non-local iri references not currently supported"); in findNodeById()
207 SkASSERT(fPresentationContext->fInherited.f ## ATTR.isValue()); \ in applyPresentationAttributes()
209 if (attr.isValue() && *attr != *fPresentationContext->fInherited.f ## ATTR) { \ in applyPresentationAttributes()
211 fPresentationContext.writable()->fInherited.f ## ATTR.set(*attr); \ in applyPresentationAttributes()
243 this->applyOpacity(*attrs.fOpacity, flags, hasFilter); in applyPresentationAttributes()
247 this->applyClip(*attrs.fClipPath); in applyPresentationAttributes()
251 this->applyMask(*attrs.fMask); in applyPresentationAttributes()
256 this->applyFilter(*attrs.fFilter); in applyPresentationAttributes()
261 // TODO: resolve these in a pre-render styling pass and assert here that they are values. in applyPresentationAttributes()
262 // - stop-color in applyPresentationAttributes()
263 // - stop-opacity in applyPresentationAttributes()
264 // - flood-color in applyPresentationAttributes()
265 // - flood-opacity in applyPresentationAttributes()
266 // - lighting-color in applyPresentationAttributes()
274 const auto& props = fPresentationContext->fInherited; in applyOpacity()
275 const bool hasFill = props.fFill ->type() != SkSVGPaint::Type::kNone, in applyOpacity()
276 hasStroke = props.fStroke->type() != SkSVGPaint::Type::kNone; in applyOpacity()
280 // - the target node doesn't have any descendants; in applyOpacity()
281 // - it only has a stroke or a fill (but not both); in applyOpacity()
282 // - it does not have a filter. in applyOpacity()
287 // Expensive, layer-based fall back. in applyOpacity()
291 fCanvas->saveLayer(nullptr, &opacityPaint); in applyOpacity()
300 const auto node = this->findNodeById(filter.iri()); in applyFilter()
301 if (!node || node->tag() != SkSVGTag::kFilter) { in applyFilter()
306 sk_sp<SkImageFilter> imageFilter = filterNode->buildFilterDAG(*this); in applyFilter()
311 fCanvas->saveLayer(nullptr, &filterPaint); in applyFilter()
317 if (fCanvas->getSaveCount() == fCanvasSaveCount) { in saveOnce()
318 fCanvas->save(); in saveOnce()
321 SkASSERT(fCanvas->getSaveCount() > fCanvasSaveCount); in saveOnce()
329 const auto clipNode = this->findNodeById(clip.iri()); in applyClip()
330 if (!clipNode || clipNode->tag() != SkSVGTag::kClipPath) { in applyClip()
334 const SkPath clipPath = static_cast<const SkSVGClipPath*>(clipNode.get())->resolveClip(*this); in applyClip()
338 // - apply to the current canvas, for drawing in applyClip()
339 // - track in the presentation context, for asPath() composition in applyClip()
343 this->saveOnce(); in applyClip()
345 fCanvas->clipPath(clipPath, true); in applyClip()
354 const auto node = this->findNodeById(mask.iri()); in applyMask()
355 if (!node || node->tag() != SkSVGTag::kMask) { in applyMask()
360 const auto mask_bounds = mask_node->bounds(*this); in applyMask()
363 fCanvas->saveLayer(mask_bounds, nullptr); in applyMask()
366 mask_node->renderMask(*this); in applyMask()
371 fCanvas->saveLayer(mask_bounds, &masking_paint); in applyMask()
374 fCanvas->clipRect(mask_bounds, true); in applyMask()
378 // Restoring triggers srcIn-compositing the content against the mask. in applyMask()
392 p->setColor(this->resolveSvgColor(paint_selector.color())); in commonPaint()
397 // leaking into the paint server context, use a pristine presentation context when in commonPaint()
412 const auto node = this->findNodeById(paint_selector.iri()); in commonPaint()
413 if (!node || !node->asPaint(local_ctx, p.get())) { in commonPaint()
415 p->setColor(this->resolveSvgColor(paint_selector.color())); in commonPaint()
422 p->setAntiAlias(true); // TODO: shape-rendering support in commonPaint()
425 // - initial paint server opacity (e.g. color stop opacity) in commonPaint()
426 // - paint-specific opacity (e.g. 'fill-opacity', 'stroke-opacity') in commonPaint()
427 // - deferred opacity override (optimization for leaf nodes 'opacity') in commonPaint()
428 p->setAlphaf(SkTPin(p->getAlphaf() * paint_opacity * fDeferredPaintOpacity, 0.0f, 1.0f)); in commonPaint()
434 const auto& props = fPresentationContext->fInherited; in fillPaint()
435 auto p = this->commonPaint(*props.fFill, *props.fFillOpacity); in fillPaint()
438 p->setStyle(SkPaint::kFill_Style); in fillPaint()
445 const auto& props = fPresentationContext->fInherited; in strokePaint()
446 auto p = this->commonPaint(*props.fStroke, *props.fStrokeOpacity); in strokePaint()
449 p->setStyle(SkPaint::kStroke_Style); in strokePaint()
450 p->setStrokeWidth(fLengthContext->resolve(*props.fStrokeWidth, in strokePaint()
452 p->setStrokeCap(toSkCap(*props.fStrokeLineCap)); in strokePaint()
453 p->setStrokeJoin(toSkJoin(*props.fStrokeLineJoin)); in strokePaint()
454 p->setStrokeMiter(*props.fStrokeMiterLimit); in strokePaint()
455 p->setPathEffect(dash_effect(props, *fLengthContext)); in strokePaint()
466 return *fPresentationContext->fInherited.fColor; in resolveSvgColor()
481 const auto obb = fOBBScope.fNode->objectBoundingBox(*fOBBScope.fCtx); in transformForCurrentOBB()
494 auto r = lctx->resolveRect(x, y, w, h); in resolveOBBRect()
495 const auto obbt = this->transformForCurrentOBB(obbu); in resolveOBBRect()