Use the NDK headers for AHardwareBuffer.
Bug: 6672
Change-Id: I5abd86149e912d91234853109ebd2a6b0ac5eaa2
Reviewed-on: https://skia-review.googlesource.com/20980
Reviewed-by: Stan Iliev <stani@google.com>
Commit-Queue: Derek Sollenberger <djsollen@google.com>
diff --git a/src/gpu/GrAHardwareBufferImageGenerator.cpp b/src/gpu/GrAHardwareBufferImageGenerator.cpp
index 50ef50e..8f6cb88 100644
--- a/src/gpu/GrAHardwareBufferImageGenerator.cpp
+++ b/src/gpu/GrAHardwareBufferImageGenerator.cpp
@@ -6,13 +6,14 @@
*/
#include "SkTypes.h"
-//TODO: This define is temporary and we will compile with NDK after
-//TODO: Skia bug 6672 is resolved.
-#ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
+
+#if defined(SK_BUILD_FOR_ANDROID) && __ANDROID_API__ >= 26
#define GL_GLEXT_PROTOTYPES
#define EGL_EGLEXT_PROTOTYPES
#include "GrAHardwareBufferImageGenerator.h"
+#include <android/hardware_buffer.h>
+
#include "GrBackendSurface.h"
#include "GrContext.h"
#include "GrContextPriv.h"
@@ -65,8 +66,7 @@
GrAHardwareBufferImageGenerator::GrAHardwareBufferImageGenerator(const SkImageInfo& info,
AHardwareBuffer* graphicBuffer, SkAlphaType alphaType)
: INHERITED(info)
- , fGraphicBuffer(graphicBuffer)
- , fAlphaType(alphaType) {
+ , fGraphicBuffer(graphicBuffer) {
AHardwareBuffer_acquire(fGraphicBuffer);
}