Have all vulkan android bots use API 26.

We have unit tests that require api 26 to run, but we have no vulkan
bots that would run them. API 26 is supported on all O devices and I
don't think we'll ever want to run Vulkan on previous android devices.
So I think it is fine for us to just test at api 26 for all our test
bots.

Change-Id: I8f92af6504960b7b688281ad71f5f307fdf57f49
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/556028
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This commit is contained in:
Greg Daniel 2022-07-06 16:22:43 -04:00 committed by SkCQ
parent 82e0cef747
commit 6db6110a10
4 changed files with 29 additions and 10 deletions

View File

@ -42,7 +42,7 @@ def compile_fn(api, checkout_root, out_dir):
if configuration != 'Debug':
args['is_debug'] = 'false'
if 'Vulkan' in extra_tokens:
args['ndk_api'] = 24
args['ndk_api'] = 26
args['skia_enable_vulkan_debug_layers'] = 'false'
args['skia_use_gl'] = 'false'
if 'ASAN' in extra_tokens:

View File

@ -36,7 +36,7 @@
"[START_DIR]/cache/work/skia/bin/gn",
"gen",
"[START_DIR]/cache/work/skia/out/Build-Mac-Clang-arm64-Debug-Android_Vulkan/Debug",
"--args=extra_cflags=[\"-O1\", \"-DREBUILD_IF_CHANGED_ndk_version=42\"] ndk=\"[START_DIR]/android_ndk_darwin\" ndk_api=24 skia_enable_vulkan_debug_layers=false skia_use_gl=false target_cpu=\"arm64\" werror=true"
"--args=extra_cflags=[\"-O1\", \"-DREBUILD_IF_CHANGED_ndk_version=42\"] ndk=\"[START_DIR]/android_ndk_darwin\" ndk_api=26 skia_enable_vulkan_debug_layers=false skia_use_gl=false target_cpu=\"arm64\" werror=true"
],
"cwd": "[START_DIR]/cache/work/skia",
"env": {

View File

@ -14,16 +14,21 @@
#include "src/gpu/ganesh/GrAHardwareBufferUtils_impl.h"
#include <android/hardware_buffer.h>
#ifdef SK_GL
#include <EGL/egl.h>
#include <EGL/eglext.h>
#include <GLES/gl.h>
#include <GLES/glext.h>
#endif
#include "include/gpu/GrDirectContext.h"
#include "include/gpu/gl/GrGLTypes.h"
#include "src/gpu/ganesh/GrDirectContextPriv.h"
#ifdef SK_GL
#include "include/gpu/gl/GrGLTypes.h"
#include "src/gpu/ganesh/gl/GrGLDefines_impl.h"
#include "src/gpu/ganesh/gl/GrGLUtil.h"
#endif
#ifdef SK_VULKAN
#include "src/gpu/ganesh/vk/GrVkCaps.h"
@ -69,6 +74,7 @@ GrBackendFormat GetBackendFormat(GrDirectContext* dContext, AHardwareBuffer* har
GrBackendApi backend = dContext->backend();
if (backend == GrBackendApi::kOpenGL) {
#ifdef SK_GL
switch (bufferFormat) {
//TODO: find out if we can detect, which graphic buffers support GR_GL_TEXTURE_2D
case AHARDWAREBUFFER_FORMAT_R8G8B8A8_UNORM:
@ -93,6 +99,9 @@ GrBackendFormat GetBackendFormat(GrDirectContext* dContext, AHardwareBuffer* har
return GrBackendFormat::MakeGL(GR_GL_RGBA8, GR_GL_TEXTURE_EXTERNAL);
}
}
#else // SK_GL
return GrBackendFormat();
#endif // SK_GL
} else if (backend == GrBackendApi::kVulkan) {
#ifdef SK_VULKAN
switch (bufferFormat) {
@ -162,13 +171,14 @@ GrBackendFormat GetBackendFormat(GrDirectContext* dContext, AHardwareBuffer* har
}
}
}
#else
#else // SK_VULKAN
return GrBackendFormat();
#endif
#endif // SK_VULKAN
}
return GrBackendFormat();
}
#ifdef SK_GL
class GLTextureHelper {
public:
GLTextureHelper(GrGLuint texID, EGLImageKHR image, EGLDisplay display, GrGLuint texTarget)
@ -279,6 +289,7 @@ static GrBackendTexture make_gl_backend_texture(
return GrBackendTexture(width, height, GrMipmapped::kNo, textureInfo);
}
#endif // SK_GL
#ifdef SK_VULKAN
class VulkanCleanupHelper {
@ -518,8 +529,9 @@ static GrBackendTexture make_vk_backend_texture(
return GrBackendTexture(width, height, imageInfo);
}
#endif
#endif // SK_VULKAN
#ifdef SK_GL
static bool can_import_protected_content_eglimpl() {
EGLDisplay dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY);
const char* exts = eglQueryString(dpy, EGL_EXTENSIONS);
@ -533,17 +545,20 @@ static bool can_import_protected_content_eglimpl() {
bool inMiddle = strstr(exts, " " PROT_CONTENT_EXT_STR " ");
return equal || atStart || atEnd || inMiddle;
}
#endif // SK_GL
static bool can_import_protected_content(GrDirectContext* dContext) {
if (GrBackendApi::kOpenGL == dContext->backend()) {
#ifdef SK_GL
// Only compute whether the extension is present once the first time this
// function is called.
static bool hasIt = can_import_protected_content_eglimpl();
return hasIt;
#endif // SK_GL
} else if (GrBackendApi::kVulkan == dContext->backend()) {
#ifdef SK_VULKAN
return static_cast<GrVkGpu*>(dContext->priv().getGpu())->protectedContext();
#endif
#endif // SK_VULKAN
}
return false;
}
@ -564,9 +579,13 @@ GrBackendTexture MakeBackendTexture(GrDirectContext* dContext, AHardwareBuffer*
bool createProtectedImage = isProtectedContent && can_import_protected_content(dContext);
if (GrBackendApi::kOpenGL == dContext->backend()) {
#ifdef SK_GL
return make_gl_backend_texture(dContext, hardwareBuffer, width, height, deleteProc,
updateProc, imageCtx, createProtectedImage, backendFormat,
isRenderable);
#else
return GrBackendTexture();
#endif // SK_GL
} else {
SkASSERT(GrBackendApi::kVulkan == dContext->backend());
#ifdef SK_VULKAN
@ -575,7 +594,7 @@ GrBackendTexture MakeBackendTexture(GrDirectContext* dContext, AHardwareBuffer*
isRenderable, fromAndroidWindow);
#else
return GrBackendTexture();
#endif
#endif // SK_VULKAN
}
}

View File

@ -1087,7 +1087,7 @@ void run_test(skiatest::Reporter* reporter, const GrContextOptions& options,
#ifdef SK_GL
srcHelper.reset(new EGLTestHelper(options));
#else
SkASSERT(false, "SrcType::kEGL used without OpenGL support.");
SkASSERTF(false, "SrcType::kEGL used without OpenGL support.");
#endif
}
if (srcHelper) {
@ -1104,7 +1104,7 @@ void run_test(skiatest::Reporter* reporter, const GrContextOptions& options,
SkASSERT(DstType::kEGL == dstType);
dstHelper.reset(new EGLTestHelper(options));
#else
SkASSERT(false, "DstType::kEGL used without OpenGL support.");
SkASSERTF(false, "DstType::kEGL used without OpenGL support.");
#endif
}
if (dstHelper) {