Skip to content

Commit

Permalink
gpu/android: Remove setup for disabling AImageReader.
Browse files Browse the repository at this point in the history
All workarounds have been removed, this removes the setup for applying
these workarounds. This is the first step towards being able to assume
SurfaceControl is turned on for all Q devices which will allow doing
setup at app startup, before the native library is loaded and the GPU
process is initialized.

R=ericrk@chromium.org, vikassoni@chromium.org

Bug: 1031636
Change-Id: Iecdfc335076089ba7887ba0d5111d4f70cf81c95
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2015553
Auto-Submit: Khushal <khushalsagar@chromium.org>
Reviewed-by: vikas soni <vikassoni@chromium.org>
Reviewed-by: Tommy Nyquist <nyquist@chromium.org>
Reviewed-by: Eric Karl <ericrk@chromium.org>
Commit-Queue: Khushal <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#736238}
  • Loading branch information
khushalsagar authored and Commit Bot committed Jan 29, 2020
1 parent f3ebd2f commit dcd5a39
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 31 deletions.
8 changes: 1 addition & 7 deletions base/android/android_image_reader_compat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,15 @@
namespace base {
namespace android {

bool AndroidImageReader::disable_support_ = false;

AndroidImageReader& AndroidImageReader::GetInstance() {
// C++11 static local variable initialization is
// thread-safe.
static base::NoDestructor<AndroidImageReader> instance;
return *instance;
}

void AndroidImageReader::DisableSupport() {
disable_support_ = true;
}

bool AndroidImageReader::IsSupported() {
return !disable_support_ && is_supported_;
return is_supported_;
}

AndroidImageReader::AndroidImageReader() {
Expand Down
4 changes: 0 additions & 4 deletions base/android/android_image_reader_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ class BASE_EXPORT AndroidImageReader {
// Thread safe GetInstance.
static AndroidImageReader& GetInstance();

// Disable image reader support.
static void DisableSupport();

// Check if the image reader usage is supported. This function returns TRUE
// if android version is >=OREO, image reader support is not disabled and all
// the required functions are loaded.
Expand Down Expand Up @@ -67,7 +64,6 @@ class BASE_EXPORT AndroidImageReader {
AndroidImageReader();
bool LoadFunctions();

static bool disable_support_;
bool is_supported_;
pAImage_delete AImage_delete_;
pAImage_deleteAsync AImage_deleteAsync_;
Expand Down
8 changes: 0 additions & 8 deletions gpu/config/gpu_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ GpuFeatureStatus GetAndroidSurfaceControlFeatureStatus(
#if !defined(OS_ANDROID)
return kGpuFeatureStatusDisabled;
#else
if (blacklisted_features.count(GPU_FEATURE_TYPE_ANDROID_SURFACE_CONTROL))
return kGpuFeatureStatusBlacklisted;

if (!gpu_preferences.enable_android_surface_control)
return kGpuFeatureStatusDisabled;

Expand Down Expand Up @@ -291,11 +288,6 @@ void AdjustGpuFeatureStatusToWorkarounds(GpuFeatureInfo* gpu_feature_info) {
gpu_feature_info->status_values[GPU_FEATURE_TYPE_ACCELERATED_WEBGL2] =
kGpuFeatureStatusBlacklisted;
}

if (gpu_feature_info->IsWorkaroundEnabled(DISABLE_AIMAGEREADER)) {
gpu_feature_info->status_values[GPU_FEATURE_TYPE_ANDROID_SURFACE_CONTROL] =
kGpuFeatureStatusBlacklisted;
}
}

GPUInfo* g_gpu_info_cache = nullptr;
Expand Down
1 change: 0 additions & 1 deletion gpu/config/gpu_workaround_list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ decode_encode_srgb_for_generatemipmap
depth_stencil_renderbuffer_resize_emulation
disable_2d_canvas_auto_flush
disable_accelerated_vpx_decode
disable_aimagereader
disable_async_readpixels
disable_av_sample_buffer_display_layer
disable_blend_equation_advanced
Expand Down
11 changes: 0 additions & 11 deletions gpu/ipc/service/gpu_init.cc
Original file line number Diff line number Diff line change
Expand Up @@ -511,12 +511,6 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line,
ui::OzonePlatform::GetInstance()->AfterSandboxEntry();
#endif

#if defined(OS_ANDROID)
// Disable AImageReader if the workaround is enabled.
if (gpu_feature_info_.IsWorkaroundEnabled(DISABLE_AIMAGEREADER)) {
base::android::AndroidImageReader::DisableSupport();
}
#endif
#if defined(USE_OZONE)
gpu_feature_info_.supported_buffer_formats_for_allocation_and_texturing =
std::move(supported_buffer_formats_for_texturing);
Expand All @@ -543,11 +537,6 @@ void GpuInit::InitializeInProcess(base::CommandLine* command_line,

default_offscreen_surface_ = gl::init::CreateOffscreenGLSurface(gfx::Size());

// Disable AImageReader if the workaround is enabled.
if (gpu_feature_info_.IsWorkaroundEnabled(DISABLE_AIMAGEREADER)) {
base::android::AndroidImageReader::DisableSupport();
}

UMA_HISTOGRAM_ENUMERATION("GPU.GLImplementation", gl::GetGLImplementation());
}
#else
Expand Down

0 comments on commit dcd5a39

Please sign in to comment.