/*
 * Copyright 2018 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#include "SkSGImage.h"

#include "SkCanvas.h"
#include "SkImage.h"

namespace sksg {

Image::Image(sk_sp<SkImage> image) : fImage(std::move(image)) {}

void Image::onRender(SkCanvas* canvas) const {
    SkPaint paint;
    paint.setAntiAlias(fAntiAlias);
    paint.setFilterQuality(fQuality);

    canvas->drawImage(fImage, 0, 0);
}

SkRect Image::onRevalidate(InvalidationController*, const SkMatrix& ctm) {
    return SkRect::Make(fImage->bounds());
}

} // namespace sksg

/*
 * Copyright 2018 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#include "SkSGImage.h"

#include "SkCanvas.h"
#include "SkImage.h"

namespace sksg {

Image::Image(sk_sp<SkImage> image) : fImage(std::move(image)) {}

void Image::onRender(SkCanvas* canvas) const {
    SkPaint paint;
    paint.setAntiAlias(fAntiAlias);
    paint.setFilterQuality(fQuality);

    canvas->drawImage(fImage, 0, 0, &paint);
}

SkRect Image::onRevalidate(InvalidationController*, const SkMatrix& ctm) {
    return SkRect::Make(fImage->bounds());
}

} // namespace sksg

Fix image filter quality handling
[sksg] Fix image filter quality handling

TBR=

Change-Id: I06bd30650f1a9d70225b3e3374313f672dae3a8d
Reviewed-on: https://skia-review.googlesource.com/144343
Reviewed-by: Florin Malita <a8262bf13ea8c26821e91ea9bca6740a77c96dcd@chromium.org>
Commit-Queue: Florin Malita <a8262bf13ea8c26821e91ea9bca6740a77c96dcd@chromium.org>
