Bug 1563311 - Remove uses of MOZ_BUILD_WEBRENDER. r=aosmond

This removes support for building Firefox/Gecko without WebRender.

Differential Revision: https://phabricator.services.mozilla.com/D36819

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Kartikaya Gupta 2019-07-05 11:05:17 +00:00
parent f5a83e7113
commit c8cff9effe
12 changed files with 4 additions and 89 deletions

View File

@ -2163,16 +2163,6 @@ nsDOMWindowUtils::GetUsingAdvancedLayers(bool* retval) {
return NS_OK;
}
NS_IMETHODIMP
nsDOMWindowUtils::GetIsWebRenderBuilt(bool* retval) {
#ifdef MOZ_BUILD_WEBRENDER
*retval = true;
#else
*retval = false;
#endif
return NS_OK;
}
NS_IMETHODIMP
nsDOMWindowUtils::GetIsWebRenderRequested(bool* retval) {
*retval = gfxPlatform::WebRenderPrefEnabled() ||

View File

@ -1311,11 +1311,6 @@ interface nsIDOMWindowUtils : nsISupports {
*/
readonly attribute boolean usingAdvancedLayers;
/**
* True if the current build includes WebRender.
*/
readonly attribute boolean isWebRenderBuilt;
/**
* True if webrender was requested by the user (via pref or env-var), false
* otherwise. Note that this doesn't represent whether or not webrender is

View File

@ -212,9 +212,6 @@ static bool IsAccelAngleSupported(const nsCOMPtr<nsIGfxInfo>& gfxInfo,
if (wr::RenderThread::IsInRenderThread()) {
// We can only enter here with WebRender, so assert that this is a
// WebRender-enabled build.
#ifndef MOZ_BUILD_WEBRENDER
MOZ_ASSERT(false);
#endif
return true;
}
int32_t angleSupport;

View File

@ -1755,11 +1755,6 @@ mozilla::ipc::IPCResult CompositorBridgeParent::RecvAdoptChild(
PWebRenderBridgeParent* CompositorBridgeParent::AllocPWebRenderBridgeParent(
const wr::PipelineId& aPipelineId, const LayoutDeviceIntSize& aSize) {
#ifndef MOZ_BUILD_WEBRENDER
// Extra guard since this in the parent process and we don't want a malicious
// child process invoking this codepath before it's ready
MOZ_RELEASE_ASSERT(false);
#endif
MOZ_ASSERT(wr::AsLayersId(aPipelineId) == mRootLayerTreeID);
MOZ_ASSERT(!mWrBridge);
MOZ_ASSERT(!mCompositor);
@ -1828,11 +1823,6 @@ PWebRenderBridgeParent* CompositorBridgeParent::AllocPWebRenderBridgeParent(
bool CompositorBridgeParent::DeallocPWebRenderBridgeParent(
PWebRenderBridgeParent* aActor) {
#ifndef MOZ_BUILD_WEBRENDER
// Extra guard since this in the parent process and we don't want a malicious
// child process invoking this codepath before it's ready
MOZ_RELEASE_ASSERT(false);
#endif
WebRenderBridgeParent* parent = static_cast<WebRenderBridgeParent*>(aActor);
{
MonitorAutoLock lock(*sIndirectLayerTreesLock);

View File

@ -207,11 +207,6 @@ bool ContentCompositorBridgeParent::DeallocPAPZParent(PAPZParent* aActor) {
PWebRenderBridgeParent*
ContentCompositorBridgeParent::AllocPWebRenderBridgeParent(
const wr::PipelineId& aPipelineId, const LayoutDeviceIntSize& aSize) {
#ifndef MOZ_BUILD_WEBRENDER
// Extra guard since this in the parent process and we don't want a malicious
// child process invoking this codepath before it's ready
MOZ_RELEASE_ASSERT(false);
#endif
LayersId layersId = wr::AsLayersId(aPipelineId);
// Check to see if this child process has access to this layer tree.
if (!LayerTreeOwnerTracker::Get()->IsMapped(layersId, OtherPid())) {
@ -272,11 +267,6 @@ ContentCompositorBridgeParent::AllocPWebRenderBridgeParent(
bool ContentCompositorBridgeParent::DeallocPWebRenderBridgeParent(
PWebRenderBridgeParent* aActor) {
#ifndef MOZ_BUILD_WEBRENDER
// Extra guard since this in the parent process and we don't want a malicious
// child process invoking this codepath before it's ready
MOZ_RELEASE_ASSERT(false);
#endif
WebRenderBridgeParent* parent = static_cast<WebRenderBridgeParent*>(aActor);
EraseLayerState(wr::AsLayersId(parent->PipelineId()));
parent->Release(); // IPDL reference

View File

@ -111,8 +111,7 @@ function runTest() {
var shouldGetWR = false;
try {
shouldGetWR = SpecialPowers.DOMWindowUtils.isWebRenderBuilt &&
SpecialPowers.DOMWindowUtils.isWebRenderRequested;
shouldGetWR = SpecialPowers.DOMWindowUtils.isWebRenderRequested;
} catch (e) {}
var advancedLayersEnabled = false;

View File

@ -2960,12 +2960,6 @@ void gfxPlatform::InitWebRenderConfig() {
NS_LITERAL_CSTRING("FEATURE_FAILURE_SAFE_MODE"));
}
#ifndef MOZ_BUILD_WEBRENDER
featureWebRender.ForceDisable(
FeatureStatus::UnavailableNotBuilt, "Build doesn't include WebRender",
NS_LITERAL_CSTRING("FEATURE_FAILURE_NO_WEBRENDER"));
#endif
#ifdef XP_WIN
if (Preferences::GetBool("gfx.webrender.force-angle", false)) {
if (!gfxConfig::IsEnabled(Feature::D3D11_HW_ANGLE)) {

View File

@ -6,7 +6,6 @@ To build and run WebRender in Gecko:
Ensure that rustc and cargo are in your $PATH (adding $HOME/.cargo/bin/ should be sufficient)
2. Build using |mach build|.
You don't need anything special in your mozconfig for local builds; webrender will be built by default.
If you are building a non-nightly version (e.g. beta) you may need to add |ac_add_options --enable-webrender=build| to your mozconfig.
3. Run with |MOZ_WEBRENDER=1| in your environment. e.g. |MOZ_WEBRENDER=1 ./mach run|.
Alternatively, you can set the gfx.webrender.enabled pref to true (browser restart required).
Note that on Linux, acceleration is disabled by default and it needs to be enabled for WebRender to work.

View File

@ -22,8 +22,6 @@ parse_deps = true
include = ["log", "euclid", "webrender", "webrender_api"]
[fn]
prefix = "WR_INLINE"
postfix = "WR_FUNC"
args = "Vertical"
rename_args = "GeckoCase"

View File

@ -761,7 +761,6 @@ pub unsafe extern "C" fn wr_renderer_readback(renderer: &mut Renderer,
format, &mut slice);
}
/// cbindgen:postfix=WR_DESTRUCTOR_SAFE_FUNC
#[no_mangle]
pub unsafe extern "C" fn wr_renderer_delete(renderer: *mut Renderer) {
let renderer = Box::from_raw(renderer);
@ -841,7 +840,6 @@ pub unsafe extern "C" fn wr_renderer_flush_pipeline_info(renderer: &mut Renderer
WrPipelineInfo::new(&info)
}
/// cbindgen:postfix=WR_DESTRUCTOR_SAFE_FUNC
#[no_mangle]
pub unsafe extern "C" fn wr_pipeline_info_delete(_info: WrPipelineInfo) {
// _info will be dropped here, and the drop impl on FfiVec will free
@ -1057,7 +1055,6 @@ pub unsafe extern "C" fn wr_thread_pool_new() -> *mut WrThreadPool {
Box::into_raw(Box::new(WrThreadPool(workers)))
}
/// cbindgen:postfix=WR_DESTRUCTOR_SAFE_FUNC
#[no_mangle]
pub unsafe extern "C" fn wr_thread_pool_delete(thread_pool: *mut WrThreadPool) {
Box::from_raw(thread_pool);
@ -1070,7 +1067,6 @@ pub unsafe extern "C" fn wr_program_cache_new(prof_path: &nsAString, thread_pool
Box::into_raw(Box::new(program_cache))
}
/// cbindgen:postfix=WR_DESTRUCTOR_SAFE_FUNC
#[no_mangle]
pub unsafe extern "C" fn wr_program_cache_delete(program_cache: *mut WrProgramCache) {
Box::from_raw(program_cache);
@ -1298,7 +1294,6 @@ pub extern "C" fn wr_api_create_document(
)));
}
/// cbindgen:postfix=WR_DESTRUCTOR_SAFE_FUNC
#[no_mangle]
pub unsafe extern "C" fn wr_api_delete_document(dh: &mut DocumentHandle) {
dh.api.delete_document(dh.document_id);
@ -1318,13 +1313,11 @@ pub extern "C" fn wr_api_clone(
*out_handle = Box::into_raw(Box::new(handle));
}
/// cbindgen:postfix=WR_DESTRUCTOR_SAFE_FUNC
#[no_mangle]
pub unsafe extern "C" fn wr_api_delete(dh: *mut DocumentHandle) {
let _ = Box::from_raw(dh);
}
/// cbindgen:postfix=WR_DESTRUCTOR_SAFE_FUNC
#[no_mangle]
pub unsafe extern "C" fn wr_api_shut_down(dh: &mut DocumentHandle) {
dh.api.shut_down();
@ -1348,7 +1341,6 @@ pub unsafe extern "C" fn wr_api_accumulate_memory_report(
*report += dh.api.report_memory();
}
/// cbindgen:postfix=WR_DESTRUCTOR_SAFE_FUNC
#[no_mangle]
pub unsafe extern "C" fn wr_api_clear_all_caches(dh: &mut DocumentHandle) {
dh.api.send_debug_cmd(DebugCommand::ClearCaches(ClearCache::all()));
@ -1372,7 +1364,6 @@ pub extern "C" fn wr_transaction_new(do_async: bool) -> *mut Transaction {
Box::into_raw(Box::new(make_transaction(do_async)))
}
/// cbindgen:postfix=WR_DESTRUCTOR_SAFE_FUNC
#[no_mangle]
pub extern "C" fn wr_transaction_delete(txn: *mut Transaction) {
unsafe { let _ = Box::from_raw(txn); }
@ -1802,7 +1793,6 @@ pub unsafe extern "C" fn wr_transaction_clear_display_list(
);
}
/// cbindgen:postfix=WR_DESTRUCTOR_SAFE_FUNC
#[no_mangle]
pub extern "C" fn wr_api_send_external_event(dh: &mut DocumentHandle,
evt: usize) {
@ -2035,7 +2025,6 @@ pub extern "C" fn wr_state_new(pipeline_id: WrPipelineId,
Box::into_raw(state)
}
/// cbindgen:postfix=WR_DESTRUCTOR_SAFE_FUNC
#[no_mangle]
pub extern "C" fn wr_state_delete(state: *mut WrState) {
assert!(unsafe { !is_in_render_thread() });
@ -3148,7 +3137,6 @@ pub extern "C" fn wr_add_ref_arc(arc: &ArcVecU8) -> *const VecU8 {
Arc::into_raw(arc.clone())
}
/// cbindgen:postfix=WR_DESTRUCTOR_SAFE_FUNC
#[no_mangle]
pub unsafe extern "C" fn wr_dec_ref_arc(arc: *const VecU8) {
Arc::from_raw(arc);
@ -3216,7 +3204,6 @@ impl WrSpatialId {
}
}
/// cbindgen:postfix=WR_DESTRUCTOR_SAFE_FUNC
#[no_mangle]
pub unsafe extern "C" fn wr_device_delete(device: *mut Device) {
Box::from_raw(device);
@ -3261,7 +3248,6 @@ pub extern "C" fn wr_shaders_new(gl_context: *mut c_void,
Box::into_raw(Box::new(shaders))
}
/// cbindgen:postfix=WR_DESTRUCTOR_SAFE_FUNC
#[no_mangle]
pub unsafe extern "C" fn wr_shaders_delete(shaders: *mut WrShaders, gl_context: *mut c_void) {
let mut device = wr_device_new(gl_context, None);

View File

@ -90,30 +90,8 @@ void apz_sample_transforms(mozilla::wr::WrWindowId aWindowId,
void apz_deregister_sampler(mozilla::wr::WrWindowId aWindowId);
} // extern "C"
// Some useful defines to stub out webrender binding functions for when we
// build gecko without webrender. We try to tell the compiler these functions
// are unreachable in that case, but VC++ emits a warning if it finds any
// unreachable functions invoked from destructors. That warning gets turned into
// an error and causes the build to fail. So for wr_* functions called by
// destructors in C++ classes, use WR_DESTRUCTOR_SAFE_FUNC instead, which omits
// the unreachable annotation.
#ifdef MOZ_BUILD_WEBRENDER
# define WR_INLINE
# define WR_FUNC
# define WR_DESTRUCTOR_SAFE_FUNC
#else
# define WR_INLINE inline
# define WR_FUNC \
{ MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE("WebRender disabled"); }
# define WR_DESTRUCTOR_SAFE_FUNC \
{}
#endif
#include "webrender_ffi_generated.h"
#undef WR_FUNC
#undef WR_DESTRUCTOR_SAFE_FUNC
// More functions invoked from Rust code. These are down here because they
// refer to data structures from webrender_ffi_generated.h
extern "C" {

View File

@ -12,10 +12,9 @@ if CONFIG['MOZ_DEBUG']:
'gecko_refcount_logging',
]
if CONFIG['MOZ_BUILD_WEBRENDER']:
gkrust_features += ['quantum_render']
if CONFIG['MOZ_WEBRENDER_DEBUGGER']:
gkrust_features += ['webrender_debugger']
gkrust_features += ['quantum_render']
if CONFIG['MOZ_WEBRENDER_DEBUGGER']:
gkrust_features += ['webrender_debugger']
if CONFIG['MOZ_PULSEAUDIO']:
gkrust_features += ['cubeb_pulse_rust']