Commit 5b37a8c8 authored by Peter Collingbourne's avatar Peter Collingbourne Committed by Commit Bot

Define various constants conditionally based on the NDK version.

Some of these definitions are present in the headers provided by newer
NDKs, so we need to depend on those headers when compiling against
the newer NDKs instead of defining the constants ourselves in order
to avoid a symbol redefinition error from the compiler.

Bug: 891999
Change-Id: I078099ade1b006006fd48a0deb085856591383bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1753191
Auto-Submit: Peter Collingbourne <pcc@chromium.org>
Reviewed-by: default avatarKhushal <khushalsagar@chromium.org>
Commit-Queue: Khushal <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#687348}
parent 0fc9202d
......@@ -5,6 +5,10 @@
#include "ui/gl/android/android_surface_control_compat.h"
#include <dlfcn.h>
#include <android/ndk-version.h>
#if __NDK_MAJOR__ >= 18
#include <android/data_space.h>
#endif
#include "base/android/build_info.h"
#include "base/atomic_sequence_num.h"
......@@ -33,11 +37,7 @@ enum {
ASURFACE_TRANSACTION_TRANSPARENCY_OPAQUE = 2,
};
enum {
ASURFACE_TRANSACTION_VISIBILITY_HIDE = 0,
ASURFACE_TRANSACTION_VISIBILITY_SHOW = 1,
};
#if __NDK_MAJOR__ < 18
enum {
ADATASPACE_UNKNOWN = 0,
ADATASPACE_SCRGB_LINEAR = 406913024,
......@@ -45,11 +45,13 @@ enum {
ADATASPACE_DISPLAY_P3 = 143261696,
ADATASPACE_BT2020_PQ = 163971072,
};
#endif
#if __NDK_MAJOR__ < 20
enum {
AHARDWAREBUFFER_USAGE_COMPOSER_OVERLAY = 1ULL << 11,
AHARDWAREBUFFER_USAGE_QCOMM_UBWC = 1ULL << 28,
};
#endif
// ASurfaceTransaction
using pASurfaceTransaction_create = ASurfaceTransaction* (*)(void);
......@@ -322,7 +324,7 @@ uint64_t SurfaceControl::RequiredUsage() {
}
void SurfaceControl::EnableQualcommUBWC() {
g_agb_required_usage_bits |= AHARDWAREBUFFER_USAGE_QCOMM_UBWC;
g_agb_required_usage_bits |= AHARDWAREBUFFER_USAGE_VENDOR_0;
}
SurfaceControl::Surface::Surface() = default;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment