Loading graphics/java/android/graphics/pdf/PdfRenderer.java +8 −1 Original line number Original line Diff line number Diff line Loading @@ -163,7 +163,12 @@ public final class PdfRenderer implements AutoCloseable { synchronized (sPdfiumLock) { synchronized (sPdfiumLock) { mNativeDocument = nativeCreate(mInput.getFd(), size); mNativeDocument = nativeCreate(mInput.getFd(), size); try { mPageCount = nativeGetPageCount(mNativeDocument); mPageCount = nativeGetPageCount(mNativeDocument); } catch (Throwable t) { nativeClose(mNativeDocument); throw t; } } } mCloseGuard.open("close"); mCloseGuard.open("close"); Loading Loading @@ -368,6 +373,8 @@ public final class PdfRenderer implements AutoCloseable { */ */ public void render(@NonNull Bitmap destination, @Nullable Rect destClip, public void render(@NonNull Bitmap destination, @Nullable Rect destClip, @Nullable Matrix transform, @RenderMode int renderMode) { @Nullable Matrix transform, @RenderMode int renderMode) { throwIfClosed(); if (destination.getConfig() != Config.ARGB_8888) { if (destination.getConfig() != Config.ARGB_8888) { throw new IllegalArgumentException("Unsupported pixel format"); throw new IllegalArgumentException("Unsupported pixel format"); } } Loading Loading
graphics/java/android/graphics/pdf/PdfRenderer.java +8 −1 Original line number Original line Diff line number Diff line Loading @@ -163,7 +163,12 @@ public final class PdfRenderer implements AutoCloseable { synchronized (sPdfiumLock) { synchronized (sPdfiumLock) { mNativeDocument = nativeCreate(mInput.getFd(), size); mNativeDocument = nativeCreate(mInput.getFd(), size); try { mPageCount = nativeGetPageCount(mNativeDocument); mPageCount = nativeGetPageCount(mNativeDocument); } catch (Throwable t) { nativeClose(mNativeDocument); throw t; } } } mCloseGuard.open("close"); mCloseGuard.open("close"); Loading Loading @@ -368,6 +373,8 @@ public final class PdfRenderer implements AutoCloseable { */ */ public void render(@NonNull Bitmap destination, @Nullable Rect destClip, public void render(@NonNull Bitmap destination, @Nullable Rect destClip, @Nullable Matrix transform, @RenderMode int renderMode) { @Nullable Matrix transform, @RenderMode int renderMode) { throwIfClosed(); if (destination.getConfig() != Config.ARGB_8888) { if (destination.getConfig() != Config.ARGB_8888) { throw new IllegalArgumentException("Unsupported pixel format"); throw new IllegalArgumentException("Unsupported pixel format"); } } Loading