Loading libs/hwui/VectorDrawable.cpp +4 −5 Original line number Diff line number Diff line Loading @@ -474,14 +474,13 @@ SkPaint* Tree::getPaint() { // Update the given paint with alpha and color filter. Return nullptr if no color filter is // specified and root alpha is 1. Otherwise, return updated paint. SkPaint* Tree::updatePaint(SkPaint* outPaint, TreeProperties* prop) { if (prop->getRootAlpha() == 1.0f && prop->getColorFilter() == nullptr) { return nullptr; } else { outPaint->setColorFilter(sk_ref_sp(prop->getColorFilter())); // HWUI always draws VD with bilinear filtering. outPaint->setFilterQuality(kLow_SkFilterQuality); if (prop->getRootAlpha() < 1.0f || prop->getColorFilter() != nullptr) { outPaint->setColorFilter(sk_ref_sp(prop->getColorFilter())); outPaint->setAlpha(prop->getRootAlpha() * 255); return outPaint; } return outPaint; } Bitmap& Tree::getBitmapUpdateIfDirty() { Loading libs/hwui/pipeline/skia/SkiaRecordingCanvas.cpp +2 −3 Original line number Diff line number Diff line Loading @@ -257,9 +257,8 @@ void SkiaRecordingCanvas::drawNinePatch(Bitmap& bitmap, const Res_png_9patch& ch SkRect dst = SkRect::MakeLTRB(dstLeft, dstTop, dstRight, dstBottom); PaintCoW filteredPaint(paint); // Besides kNone, the other three SkFilterQualities are treated the same. And Android's // Java API only supports kLow and kNone anyway. if (!filteredPaint || filteredPaint->getFilterQuality() == kNone_SkFilterQuality) { // HWUI always draws 9-patches with bilinear filtering, regardless of what is set in the Paint. if (!filteredPaint || filteredPaint->getFilterQuality() != kLow_SkFilterQuality) { filteredPaint.writeable().setFilterQuality(kLow_SkFilterQuality); } sk_sp<SkColorFilter> colorFilter; Loading Loading
libs/hwui/VectorDrawable.cpp +4 −5 Original line number Diff line number Diff line Loading @@ -474,14 +474,13 @@ SkPaint* Tree::getPaint() { // Update the given paint with alpha and color filter. Return nullptr if no color filter is // specified and root alpha is 1. Otherwise, return updated paint. SkPaint* Tree::updatePaint(SkPaint* outPaint, TreeProperties* prop) { if (prop->getRootAlpha() == 1.0f && prop->getColorFilter() == nullptr) { return nullptr; } else { outPaint->setColorFilter(sk_ref_sp(prop->getColorFilter())); // HWUI always draws VD with bilinear filtering. outPaint->setFilterQuality(kLow_SkFilterQuality); if (prop->getRootAlpha() < 1.0f || prop->getColorFilter() != nullptr) { outPaint->setColorFilter(sk_ref_sp(prop->getColorFilter())); outPaint->setAlpha(prop->getRootAlpha() * 255); return outPaint; } return outPaint; } Bitmap& Tree::getBitmapUpdateIfDirty() { Loading
libs/hwui/pipeline/skia/SkiaRecordingCanvas.cpp +2 −3 Original line number Diff line number Diff line Loading @@ -257,9 +257,8 @@ void SkiaRecordingCanvas::drawNinePatch(Bitmap& bitmap, const Res_png_9patch& ch SkRect dst = SkRect::MakeLTRB(dstLeft, dstTop, dstRight, dstBottom); PaintCoW filteredPaint(paint); // Besides kNone, the other three SkFilterQualities are treated the same. And Android's // Java API only supports kLow and kNone anyway. if (!filteredPaint || filteredPaint->getFilterQuality() == kNone_SkFilterQuality) { // HWUI always draws 9-patches with bilinear filtering, regardless of what is set in the Paint. if (!filteredPaint || filteredPaint->getFilterQuality() != kLow_SkFilterQuality) { filteredPaint.writeable().setFilterQuality(kLow_SkFilterQuality); } sk_sp<SkColorFilter> colorFilter; Loading