Lines Matching defs:paint
150 const SkPaint& paint,
158 draw.drawPoints(mode, count, points, paint, device);
169 static void transform_shader(SkPaint* paint, const SkMatrix& ctm) {
171 SkMatrix lm = SkPDFUtils::GetShaderLocalMatrix(paint->getShader());
175 paint->setShader(paint->getShader()->makeWithLocalMatrix(m));
180 SkTCopyOnFirstWrite<SkPaint> paint(srcPaint);
181 // If the paint will definitely draw opaquely, replace kSrc with
183 if (!paint->isSrcOver() &&
184 kSrcOver_SkXfermodeInterpretation == SkInterpretXfermode(*paint, false))
186 paint.writable()->setBlendMode(SkBlendMode::kSrcOver);
188 if (paint->getColorFilter()) {
190 SkPaintPriv::RemoveColorFilter(paint.writable(), sk_srgb_singleton());
192 SkASSERT(!paint->getColorFilter());
193 return paint;
196 static void set_style(SkTCopyOnFirstWrite<SkPaint>* paint, SkPaint::Style style) {
197 if (paint->get()->getStyle() != style) {
198 paint->writable()->setStyle(style);
233 const SkPaint& paint,
243 fBlendMode = paint.getBlendMode_or(SkBlendMode::kSrcOver);
245 fDevice->setUpContentEntry(clipStack, matrix, paint, textScale, &fDstFormXObject);
247 ScopedContentEntry(SkPDFDevice* dev, const SkPaint& paint, SkScalar textScale = 0)
248 : ScopedContentEntry(dev, &dev->cs(), dev->localToDevice(), paint, textScale) {}
404 SkTCopyOnFirstWrite<SkPaint> paint(clean_paint(srcPaint));
409 set_style(&paint, SkPaint::kStroke_Style);
415 if (paint->getPathEffect() || this->localToDevice().hasPerspective()) {
416 draw_points(mode, count, points, *paint, this->devClipBounds(), this);
421 if (mode == SkCanvas::kPoints_PointMode && paint->getStrokeCap() != SkPaint::kRound_Cap) {
422 if (paint->getStrokeWidth()) {
425 set_style(&paint, SkPaint::kFill_Style);
426 SkScalar strokeWidth = paint->getStrokeWidth();
431 this->drawRect(r, *paint);
435 if (paint->getStrokeCap() != SkPaint::kRound_Cap) {
436 paint.writable()->setStrokeCap(SkPaint::kRound_Cap);
441 ScopedContentEntry content(this, *paint);
462 SkASSERT(paint->getStrokeCap() == SkPaint::kRound_Cap);
474 void SkPDFDevice::drawRect(const SkRect& rect, const SkPaint& paint) {
477 this->internalDrawPath(this->cs(), this->localToDevice(), SkPath::Rect(r), paint, true);
480 void SkPDFDevice::drawRRect(const SkRRect& rrect, const SkPaint& paint) {
481 this->internalDrawPath(this->cs(), this->localToDevice(), SkPath::RRect(rrect), paint, true);
484 void SkPDFDevice::drawOval(const SkRect& oval, const SkPaint& paint) {
485 this->internalDrawPath(this->cs(), this->localToDevice(), SkPath::Oval(oval), paint, true);
488 void SkPDFDevice::drawPath(const SkPath& path, const SkPaint& paint, bool pathIsMutable) {
489 this->internalDrawPath(this->cs(), this->localToDevice(), path, paint, pathIsMutable);
498 SkTCopyOnFirstWrite<SkPaint> paint(origPaint);
500 SkStrokeRec::InitStyle initStyle = paint->getFillPath(path, &path)
507 if (!SkDraw::DrawToMask(path, &bounds, paint->getMaskFilter(), &SkMatrix::I(),
515 if (!as_MFB(paint->getMaskFilter())->filterMask(&dstMask, sourceMask, ctm, &margin)) {
527 if (!ctm.isIdentity() && paint->getShader()) {
528 transform_shader(paint.writable(), ctm); // Since we are using identity matrix.
530 ScopedContentEntry content(this, &clipStack, SkMatrix::I(), *paint);
565 SkTCopyOnFirstWrite<SkPaint> paint(clean_paint(srcPaint));
569 if (paint->getMaskFilter()) {
570 this->internalDrawPathWithFilter(clipStack, ctm, origPath, *paint);
576 if (paint->getPathEffect()) {
585 if (paint->getFillPath(*pathPtr, pathPtr)) {
586 set_style(&paint, SkPaint::kFill_Style);
588 set_style(&paint, SkPaint::kStroke_Style);
589 if (paint->getStrokeWidth() != 0) {
590 paint.writable()->setStrokeWidth(0);
593 paint.writable()->setPathEffect(nullptr);
596 if (this->handleInversePath(*pathPtr, *paint, pathIsMutable)) {
606 if (paint->getShader()) {
607 transform_shader(paint.writable(), matrix);
612 ScopedContentEntry content(this, &clipStack, matrix, *paint);
620 paint->getStyle() == SkPaint::kFill_Style ||
621 (paint->getStrokeCap() != SkPaint::kRound_Cap &&
622 paint->getStrokeCap() != SkPaint::kSquare_Cap);
623 SkPDFUtils::EmitPath(*pathPtr, paint->getStyle(), consumeDegeratePathSegments, content.stream(),
625 SkPDFUtils::PaintPath(paint->getStyle(), pathPtr->getFillType(), content.stream());
634 const SkPaint& paint,
638 src, dst, sampling, paint, this->localToDevice());
641 void SkPDFDevice::drawSprite(const SkBitmap& bm, int x, int y, const SkPaint& paint) {
644 this->internalDrawImageRect(SkKeyedImage(bm), nullptr, r, SkSamplingOptions(), paint,
858 SkTCopyOnFirstWrite<SkPaint> paint(clean_paint(runPaint));
859 ScopedContentEntry content(this, *paint, glyphRunFont.getScaleX());
959 void SkPDFDevice::onDrawGlyphRunList(const SkGlyphRunList& glyphRunList, const SkPaint& paint) {
962 this->internalDrawGlyphRun(glyphRun, glyphRunList.origin(), paint);
1035 const SkPaint& paint,
1047 SkPaint noInversePaint(paint);
1050 if (SkPaint::kStroke_Style == paint.getStyle() ||
1051 SkPaint::kStrokeAndFill_Style == paint.getStyle()) {
1052 bool doFillPath = paint.getFillPath(origPath, &modifiedPath);
1061 this->internalDrawPath(this->cs(), this->localToDevice(), modifiedPath, paint, true);
1079 bounds.outset(paint.getStrokeWidth() + SK_Scalar1,
1080 paint.getStrokeWidth() + SK_Scalar1);
1121 SkPaint paint;
1122 paint.setBlendMode(mode);
1123 ScopedContentEntry content(this, nullptr, SkMatrix::I(), paint);
1144 const SkPaint& paint,
1150 NOT_IMPLEMENTED(paint.getPathEffect() != nullptr, false);
1151 NOT_IMPLEMENTED(paint.getMaskFilter() != nullptr, false);
1152 NOT_IMPLEMENTED(paint.getColorFilter() != nullptr, false);
1157 SkColor4f color = paint.getColor4f();
1162 SkShader* shader = paint.getShader();
1194 auto c = paint.getColor4f();
1206 if (color == paint.getColor4f()) {
1207 newGraphicState = SkPDFGraphicState::GetGraphicStateForPaint(doc, paint);
1209 SkPaint newPaint = paint;
1219 const SkPaint& paint,
1223 SkBlendMode blendMode = paint.getBlendMode_or(SkBlendMode::kSrcOver);
1267 paint,
1430 SkPaint paint;
1431 paint.setColorFilter(sk_ref_sp(colorFilter));
1432 canvas->drawImage(image, 0, 0, SkSamplingOptions(), &paint);
1481 // If the image is opaque and the paint's alpha is too, replace
1483 SkTCopyOnFirstWrite<SkPaint> paint(srcPaint);
1484 if (!paint->isSrcOver() &&
1486 kSrcOver_SkXfermodeInterpretation == SkInterpretXfermode(*paint, false))
1488 paint.writable()->setBlendMode(SkBlendMode::kSrcOver);
1493 if (imageSubset.image()->isAlphaOnly() && paint->getColorFilter()) {
1501 tmpPaint.setShader(sk_ref_sp(paint->getShader()));
1502 tmpPaint.setColor4f(paint->getColor4f(), nullptr);
1505 if (paint->getShader() != nullptr) {
1506 paint.writable()->setShader(nullptr);
1513 // The ColorFilter applies to the paint color/shader, not the alpha layer.
1514 SkASSERT(nullptr == paint->getColorFilter());
1529 if (paint->getMaskFilter()) {
1532 tmpPaint.setMaskFilter(sk_ref_sp(paint->getMaskFilter()));
1543 if (!ctm.isIdentity() && paint->getShader()) {
1544 transform_shader(paint.writable(), ctm); // Since we are using identity matrix.
1546 ScopedContentEntry content(this, &this->cs(), SkMatrix::I(), *paint);
1558 if (paint->getMaskFilter()) {
1559 paint.writable()->setShader(imageSubset.image()->makeShader(SkSamplingOptions(),
1562 this->internalDrawPath(this->cs(), this->localToDevice(), path, *paint, true);
1646 ScopedContentEntry content(this, &this->cs(), scaled, *paint);
1658 if (SkColorFilter* colorFilter = paint->getColorFilter()) {
1686 const SkPaint& paint) {
1687 SkASSERT(!paint.getImageFilter());
1688 SkASSERT(!paint.getMaskFilter());
1695 this->INHERITED::drawDevice(device, sampling, paint);
1707 ScopedContentEntry content(this, &this->cs(), matrix, paint);
1723 const SkSamplingOptions& sampling, const SkPaint& paint) {
1728 SkASSERT(!paint.getMaskFilter() && !paint.getImageFilter());
1733 this->internalDrawImageRect(SkKeyedImage(resultBM), nullptr, r, sampling, paint,