forked from flutter/flutter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reverts "[Impeller] move AHB check to Vulkan, use Vulkan surface on 2…
…9. (flutter#164109)" (flutter#164166) <!-- start_original_pr_link --> Reverts: flutter#164109 <!-- end_original_pr_link --> <!-- start_initiating_author --> Initiated by: jonahwilliams <!-- end_initiating_author --> <!-- start_revert_reason --> Reason for reverting: brain not work too good. <!-- end_revert_reason --> <!-- start_original_pr_author --> Original PR Author: jonahwilliams <!-- end_original_pr_author --> <!-- start_reviewers --> Reviewed By: {matanlurey} <!-- end_reviewers --> <!-- start_revert_body --> This change reverts the following previous change: Rather than conditionally disabling AHBs, just disable Vulkan on devices where AHB imports don't work. flutter#163473 flutter#160854 <!-- end_revert_body --> Co-authored-by: auto-submit[bot] <[email protected]>
- Loading branch information
1 parent
092be76
commit cca82ed
Showing
10 changed files
with
114 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
engine/src/flutter/impeller/toolkit/android/shadow_realm.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "impeller/toolkit/android/shadow_realm.h" | ||
|
||
#include <sys/system_properties.h> | ||
|
||
namespace impeller::android { | ||
|
||
constexpr std::string_view kAndroidHuawei = "android-huawei"; | ||
|
||
bool ShadowRealm::ShouldDisableAHB() { | ||
char clientidbase[PROP_VALUE_MAX]; | ||
__system_property_get("ro.com.google.clientidbase", clientidbase); | ||
|
||
auto api_level = android_get_device_api_level(); | ||
char first_api_level[PROP_VALUE_MAX]; | ||
__system_property_get("ro.product.first_api_level", first_api_level); | ||
|
||
return ShouldDisableAHBInternal(clientidbase, first_api_level, api_level); | ||
} | ||
|
||
// static | ||
bool ShadowRealm::ShouldDisableAHBInternal(std::string_view clientidbase, | ||
std::string_view first_api_level, | ||
uint32_t api_level) { | ||
// Most devices that have updated to API 29 don't seem to correctly | ||
// support AHBs: https://github.com/flutter/flutter/issues/157113 | ||
if (first_api_level.compare("28") == 0 || | ||
first_api_level.compare("27") == 0 || | ||
first_api_level.compare("26") == 0 || | ||
first_api_level.compare("25") == 0 || | ||
first_api_level.compare("24") == 0) { | ||
return true; | ||
} | ||
// From local testing, neither the swapchain nor AHB import works, see also: | ||
// https://github.com/flutter/flutter/issues/154068 | ||
if (clientidbase == kAndroidHuawei && api_level <= 29) { | ||
return true; | ||
} | ||
return false; | ||
} | ||
|
||
} // namespace impeller::android |
27 changes: 27 additions & 0 deletions
27
engine/src/flutter/impeller/toolkit/android/shadow_realm.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright 2013 The Flutter Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef FLUTTER_IMPELLER_TOOLKIT_ANDROID_SHADOW_REALM_H_ | ||
#define FLUTTER_IMPELLER_TOOLKIT_ANDROID_SHADOW_REALM_H_ | ||
|
||
#include <string_view> | ||
|
||
namespace impeller::android { | ||
|
||
// Looks like you're going to the Shadow Realm, Jimbo. | ||
class ShadowRealm { | ||
public: | ||
/// @brief Whether the device should disable any usage of Android Hardware | ||
/// Buffers regardless of stated support. | ||
static bool ShouldDisableAHB(); | ||
|
||
// For testing. | ||
static bool ShouldDisableAHBInternal(std::string_view clientidbase, | ||
std::string_view first_api_level, | ||
uint32_t api_level); | ||
}; | ||
|
||
} // namespace impeller::android | ||
|
||
#endif // FLUTTER_IMPELLER_TOOLKIT_ANDROID_SHADOW_REALM_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters