Hash :
f62405c5
Author :
Date :
2022-10-31T18:47:52
Add utilities to get the Android backtrace
* Added getBacktraceInfo(), which returns the backtrace information
from the ANGLE code, including the addresses and the symbols if
possible
* Returns the data in an instance of the new class BacktraceInfo.
* In order to access this function, backtrace_utils.h has been
included in vk_utils.h
* New GN flag to make use of this feature:
* angle_enable_unwind_backtrace_support
* Current only available on Android (debug mode)
* If the flag is disabled, getBacktraceInfo() returns an empty
object.
* Added functions in util/ (per platform) to print the BacktraceInfo
data.
* Example of usage:
angle::printBacktraceInfo(angle::getBacktraceInfo());
* Minor edit: Moved cstdint from android_util.cpp to its header.
Bug: b/258475923
Change-Id: I6115462a1a2845d40c7cafc14ce52df09ecdcf34
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3995843
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Reviewed-by: Charlie Lao <cclao@google.com>
Commit-Queue: Amirali Abdolrashidi <abdolrashidi@google.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
//
// Copyright 2018 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// android_util.h: Utilities for the using the Android platform
#ifndef COMMON_ANDROIDUTIL_H_
#define COMMON_ANDROIDUTIL_H_
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <array>
#include <cstdint>
#include "angle_gl.h"
struct ANativeWindowBuffer;
struct AHardwareBuffer;
namespace angle
{
namespace android
{
constexpr std::array<GLenum, 3> kSupportedSizedInternalFormats = {GL_RGBA8, GL_RGB8, GL_RGB565};
ANativeWindowBuffer *ClientBufferToANativeWindowBuffer(EGLClientBuffer clientBuffer);
EGLClientBuffer AHardwareBufferToClientBuffer(const AHardwareBuffer *hardwareBuffer);
AHardwareBuffer *ClientBufferToAHardwareBuffer(EGLClientBuffer clientBuffer);
EGLClientBuffer CreateEGLClientBufferFromAHardwareBuffer(int width,
int height,
int depth,
int androidFormat,
int usage);
void GetANativeWindowBufferProperties(const ANativeWindowBuffer *buffer,
int *width,
int *height,
int *depth,
int *pixelFormat,
uint64_t *usage);
GLenum NativePixelFormatToGLInternalFormat(int pixelFormat);
int GLInternalFormatToNativePixelFormat(GLenum internalFormat);
bool NativePixelFormatIsYUV(int pixelFormat);
AHardwareBuffer *ANativeWindowBufferToAHardwareBuffer(ANativeWindowBuffer *windowBuffer);
uint64_t GetAHBUsage(int eglNativeBufferUsage);
} // namespace android
} // namespace angle
#endif // COMMON_ANDROIDUTIL_H_