#include <nativehelper/JNIHelp.h>
#include "core_jni_helpers.h"
#include <GraphicsJNI.h>
-#include <ScopedPrimitiveArray.h>
+#include <nativehelper/ScopedPrimitiveArray.h>
#include <gui/BufferItemConsumer.h>
#include <gui/BufferQueue.h>
// Render into the surface
{
ContextFactory factory;
- RenderProxy proxy{false, renderNode, &factory};
+ RenderProxy proxy{true, renderNode, &factory};
proxy.loadSystemProperties();
proxy.setSwapBehavior(SwapBehavior::kSwap_discardBuffer);
proxy.initialize(surface);
// Continue I guess?
}
sk_sp<Bitmap> bitmap = Bitmap::createFrom(buffer);
+ if (!bitmap.get()) {
+ ALOGW("Failed to create hardware bitmap from graphic buffer");
+ return nullptr;
+ }
return createBitmap(env, bitmap.release(), android::bitmap::kBitmapCreateFlag_Mutable);
}