Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f2883b32 authored by Mike Reed's avatar Mike Reed
Browse files

explicitly call tryAllocPixels if you want to check for failure

allows us to remove SK_SUPPORT_LEGACY_ALLOCPIXELS_BOOL

Change-Id: I095a04e358404bc413ceebe81e7e1adfbbbec027
parent fcc07884
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -386,7 +386,7 @@ static jobject doDecode(JNIEnv* env, SkStreamRewindable* stream, jobject padding
        // to/from unpremultiplied bitmaps.
        outputBitmap->setInfo(SkImageInfo::Make(scaledWidth, scaledHeight,
                colorType, decodingBitmap.alphaType()));
        if (!outputBitmap->allocPixels(outputAllocator, NULL)) {
        if (!outputBitmap->tryAllocPixels(outputAllocator, NULL)) {
            return nullObjectReturn("allocation failed for scaled bitmap");
        }

+1 −1
Original line number Diff line number Diff line
@@ -383,7 +383,7 @@ static void drawBitmapArray(JNIEnv* env, jobject, jlong canvasHandle,
                           hasAlpha ? kN32_SkColorType : kRGB_565_SkColorType,
                           kPremul_SkAlphaType);
    SkBitmap bitmap;
    if (!bitmap.allocPixels(info)) {
    if (!bitmap.tryAllocPixels(info)) {
        return;
    }

+1 −1
Original line number Diff line number Diff line
@@ -390,7 +390,7 @@ static void android_view_GLES20Canvas_drawBitmapData(JNIEnv* env, jobject clazz,
                               hasAlpha ? kN32_SkColorType : kRGB_565_SkColorType,
                               kPremul_SkAlphaType);
    SkBitmap* bitmap = new SkBitmap;
    if (!bitmap->allocPixels(info)) {
    if (!bitmap->tryAllocPixels(info)) {
        delete bitmap;
        return;
    }