drawBitmap is deprecated, use drawImage (flutter/engine#24135)

Co-authored-by: Mike Reed <reed@google.com>
This commit is contained in:
Michael Reed
2021-02-02 11:24:42 -05:00
committed by GitHub
parent 1905590f86
commit e79a215a31

View File

@@ -13,6 +13,7 @@
#include "flutter/fml/trace_event.h"
#include "flutter/shell/platform/android/android_shell_holder.h"
#include "flutter/shell/platform/android/jni/platform_view_android_jni.h"
#include "third_party/skia/include/core/SkImage.h"
namespace flutter {
@@ -130,9 +131,10 @@ bool AndroidSurfaceSoftware::PresentBackingStore(
if (canvas) {
SkBitmap bitmap;
if (bitmap.installPixels(pixmap)) {
canvas->drawBitmapRect(
bitmap, SkRect::MakeIWH(native_buffer.width, native_buffer.height),
nullptr);
canvas->drawImageRect(
bitmap.asImage(),
SkRect::MakeIWH(native_buffer.width, native_buffer.height),
SkSamplingOptions());
}
}
}