Merge drawDevice and respect ctm for the paint
See GM savelayer_maskfilter Bug: skia: Change-Id: I70ce73f19067fc8c097a55e99e305e14e8a320ac Reviewed-on: https://skia-review.googlesource.com/120182 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
This commit is contained in:
parent
1b49a05a60
commit
321fb4e456
@ -489,9 +489,7 @@ void SkBitmapDevice::drawDevice(SkBaseDevice* device, int x, int y, const SkPain
|
|||||||
if (paint->getMaskFilter()) {
|
if (paint->getMaskFilter()) {
|
||||||
paint.writable()->setMaskFilter(paint->getMaskFilter()->makeWithLocalMatrix(this->ctm()));
|
paint.writable()->setMaskFilter(paint->getMaskFilter()->makeWithLocalMatrix(this->ctm()));
|
||||||
}
|
}
|
||||||
|
this->drawSprite(static_cast<SkBitmapDevice*>(device)->fBitmap, x, y, *paint);
|
||||||
LOOP_TILER( drawSprite(static_cast<SkBitmapDevice*>(device)->fBitmap,
|
|
||||||
TILER_X(x), TILER_Y(y), *paint))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -218,17 +218,6 @@ void SkThreadedBMPDevice::drawVertices(const SkVertices* vertices, SkBlendMode b
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void SkThreadedBMPDevice::drawDevice(SkBaseDevice* device, int x, int y, const SkPaint& paint) {
|
|
||||||
SkASSERT(!paint.getImageFilter());
|
|
||||||
SkRect drawBounds = SkRect::MakeXYWH(x, y, device->width(), device->height());
|
|
||||||
// copy the bitmap because it may deleted after this call
|
|
||||||
SkBitmap* bitmap = fAlloc.make<SkBitmap>(static_cast<SkBitmapDevice*>(device)->fBitmap);
|
|
||||||
fQueue.push<false>(drawBounds, [=](SkArenaAlloc*, const DrawState& ds,
|
|
||||||
const SkIRect& tileBounds){
|
|
||||||
TileDraw(ds, tileBounds).drawSprite(*bitmap, x, y, paint);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
sk_sp<SkSpecialImage> SkThreadedBMPDevice::snapSpecial() {
|
sk_sp<SkSpecialImage> SkThreadedBMPDevice::snapSpecial() {
|
||||||
this->flush();
|
this->flush();
|
||||||
return this->makeSpecial(fBitmap);
|
return this->makeSpecial(fBitmap);
|
||||||
|
@ -38,7 +38,6 @@ protected:
|
|||||||
void drawPosText(const void* text, size_t len, const SkScalar pos[],
|
void drawPosText(const void* text, size_t len, const SkScalar pos[],
|
||||||
int scalarsPerPos, const SkPoint& offset, const SkPaint& paint) override;
|
int scalarsPerPos, const SkPoint& offset, const SkPaint& paint) override;
|
||||||
void drawVertices(const SkVertices*, SkBlendMode, const SkPaint&) override;
|
void drawVertices(const SkVertices*, SkBlendMode, const SkPaint&) override;
|
||||||
void drawDevice(SkBaseDevice*, int x, int y, const SkPaint&) override;
|
|
||||||
|
|
||||||
void drawBitmap(const SkBitmap&, const SkMatrix&, const SkRect* dstOrNull,
|
void drawBitmap(const SkBitmap&, const SkMatrix&, const SkRect* dstOrNull,
|
||||||
const SkPaint&) override;
|
const SkPaint&) override;
|
||||||
|
Loading…
Reference in New Issue
Block a user