forked from mirrors/gecko-dev
Bug 1794722 - Part 2. Remove all uses of gfxVars::UseWebRender(). r=jrmuizel,media-playback-reviewers,alwu
This is always true. Differential Revision: https://phabricator.services.mozilla.com/D160121
This commit is contained in:
parent
53608b802f
commit
9d245b8325
22 changed files with 49 additions and 204 deletions
|
|
@ -10,7 +10,6 @@
|
|||
#include "ImageContainer.h"
|
||||
#include "mozilla/StaticPrefs_media.h"
|
||||
#include "mozilla/TaskQueue.h"
|
||||
#include "mozilla/gfx/gfxVars.h"
|
||||
#include "nsThreadUtils.h"
|
||||
#include "VideoUtils.h"
|
||||
|
||||
|
|
@ -210,13 +209,6 @@ int DAV1DDecoder::GetPicture(DecodedData& aData, MediaResult& aResult) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
#ifdef ANDROID
|
||||
if (!gfxVars::UseWebRender() && (*picture).p.bpc != 8) {
|
||||
aResult = MediaResult(NS_ERROR_DOM_MEDIA_NOT_SUPPORTED_ERR, __func__);
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
RefPtr<VideoData> v = ConstructImage(*picture);
|
||||
if (!v) {
|
||||
LOG("Image allocation error: %ux%u"
|
||||
|
|
|
|||
|
|
@ -38,7 +38,6 @@ class gfxVarReceiver;
|
|||
_(DXNV12Blocked, bool, false) \
|
||||
_(DXP010Blocked, bool, false) \
|
||||
_(DXP016Blocked, bool, false) \
|
||||
_(UseWebRender, bool, false) \
|
||||
_(UseWebRenderANGLE, bool, false) \
|
||||
_(UseWebRenderFlipSequentialWin, bool, false) \
|
||||
_(UseWebRenderDCompWin, bool, false) \
|
||||
|
|
|
|||
|
|
@ -273,9 +273,7 @@ mozilla::ipc::IPCResult GPUParent::RecvInit(
|
|||
// processes this happens in gfxPlatform::InitWebRenderConfig.
|
||||
ScopedGfxFeatureReporter reporter("WR",
|
||||
gfxPlatform::WebRenderPrefEnabled());
|
||||
if (gfxVars::UseWebRender()) {
|
||||
reporter.SetSuccessful();
|
||||
}
|
||||
reporter.SetSuccessful();
|
||||
}
|
||||
|
||||
for (const LayerTreeIdMapping& map : aMappings) {
|
||||
|
|
@ -299,14 +297,12 @@ mozilla::ipc::IPCResult GPUParent::RecvInit(
|
|||
}
|
||||
}
|
||||
}
|
||||
if (gfxVars::UseWebRender()) {
|
||||
DeviceManagerDx::Get()->CreateDirectCompositionDevice();
|
||||
// Ensure to initialize GfxInfo
|
||||
nsCOMPtr<nsIGfxInfo> gfxInfo = components::GfxInfo::Service();
|
||||
Unused << gfxInfo;
|
||||
DeviceManagerDx::Get()->CreateDirectCompositionDevice();
|
||||
// Ensure to initialize GfxInfo
|
||||
nsCOMPtr<nsIGfxInfo> gfxInfo = components::GfxInfo::Service();
|
||||
Unused << gfxInfo;
|
||||
|
||||
Factory::EnsureDWriteFactory();
|
||||
}
|
||||
Factory::EnsureDWriteFactory();
|
||||
#endif
|
||||
|
||||
#if defined(MOZ_WIDGET_GTK)
|
||||
|
|
@ -335,15 +331,13 @@ mozilla::ipc::IPCResult GPUParent::RecvInit(
|
|||
// Ensure we have an FT library for font instantiation.
|
||||
// This would normally be set by gfxPlatform::Init().
|
||||
// Since we bypass that, we must do it here instead.
|
||||
if (gfxVars::UseWebRender()) {
|
||||
FT_Library library = Factory::NewFTLibrary();
|
||||
MOZ_ASSERT(library);
|
||||
Factory::SetFTLibrary(library);
|
||||
FT_Library library = Factory::NewFTLibrary();
|
||||
MOZ_ASSERT(library);
|
||||
Factory::SetFTLibrary(library);
|
||||
|
||||
// true to match gfxPlatform::FontHintingEnabled(). We must hardcode
|
||||
// this value because we do not have a gfxPlatform instance.
|
||||
SkInitCairoFT(true);
|
||||
}
|
||||
// true to match gfxPlatform::FontHintingEnabled(). We must hardcode
|
||||
// this value because we do not have a gfxPlatform instance.
|
||||
SkInitCairoFT(true);
|
||||
|
||||
// Ensure that GfxInfo::Init is called on the main thread.
|
||||
nsCOMPtr<nsIGfxInfo> gfxInfo = components::GfxInfo::Service();
|
||||
|
|
@ -371,22 +365,11 @@ mozilla::ipc::IPCResult GPUParent::RecvInit(
|
|||
#endif
|
||||
|
||||
// Make sure to do this *after* we update gfxVars above.
|
||||
if (gfxVars::UseWebRender()) {
|
||||
if (gfxVars::UseCanvasRenderThread()) {
|
||||
gfx::CanvasRenderThread::Start();
|
||||
}
|
||||
wr::RenderThread::Start(aWrNamespace);
|
||||
image::ImageMemoryReporter::InitForWebRender();
|
||||
if (gfxVars::UseCanvasRenderThread()) {
|
||||
gfx::CanvasRenderThread::Start();
|
||||
}
|
||||
#ifdef XP_WIN
|
||||
else {
|
||||
if (gfxVars::UseDoubleBufferingWithCompositor()) {
|
||||
// This is needed to avoid freezing the window on a device crash on double
|
||||
// buffering, see bug 1549674.
|
||||
widget::WinCompositorWindowThread::Start();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
wr::RenderThread::Start(aWrNamespace);
|
||||
image::ImageMemoryReporter::InitForWebRender();
|
||||
|
||||
VRManager::ManagerInit();
|
||||
// Send a message to the UI process that we're done.
|
||||
|
|
|
|||
|
|
@ -586,10 +586,6 @@ bool GPUProcessManager::FallbackFromAcceleration(wr::WebRenderError aError,
|
|||
|
||||
bool GPUProcessManager::DisableWebRenderConfig(wr::WebRenderError aError,
|
||||
const nsCString& aMsg) {
|
||||
if (!gfx::gfxVars::UseWebRender()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// If we have a stable compositor process, this may just be due to an OOM or
|
||||
// bad driver state. In that case, we should consider restarting the GPU
|
||||
// process, or simulating a device reset to teardown the compositors to
|
||||
|
|
@ -658,13 +654,6 @@ void GPUProcessManager::NotifyWebRenderError(wr::WebRenderError aError) {
|
|||
}
|
||||
|
||||
bool GPUProcessManager::OnDeviceReset(bool aTrackThreshold) {
|
||||
#ifdef XP_WIN
|
||||
// Disable double buffering when device reset happens.
|
||||
if (!gfxVars::UseWebRender() && gfxVars::UseDoubleBufferingWithCompositor()) {
|
||||
gfxVars::SetUseDoubleBufferingWithCompositor(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Ignore resets for thresholding if requested.
|
||||
if (!aTrackThreshold) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -379,13 +379,7 @@ already_AddRefed<TextureClient> DXGIYCbCrTextureAllocationHelper::Allocate(
|
|||
? DXGI_FORMAT_R8_UNORM
|
||||
: DXGI_FORMAT_R16_UNORM,
|
||||
ySize.width, ySize.height, 1, 1);
|
||||
// WebRender requests keyed mutex
|
||||
if (mDevice == gfx::DeviceManagerDx::Get()->GetCompositorDevice() &&
|
||||
!gfxVars::UseWebRender()) {
|
||||
newDesc.MiscFlags = D3D11_RESOURCE_MISC_SHARED;
|
||||
} else {
|
||||
newDesc.MiscFlags = D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX;
|
||||
}
|
||||
newDesc.MiscFlags = D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX;
|
||||
|
||||
RefPtr<ID3D10Multithread> mt;
|
||||
HRESULT hr = mDevice->QueryInterface((ID3D10Multithread**)getter_AddRefs(mt));
|
||||
|
|
|
|||
|
|
@ -31,7 +31,6 @@ const char* GetLayersBackendName(LayersBackend aBackend) {
|
|||
case LayersBackend::LAYERS_NONE:
|
||||
return "none";
|
||||
case LayersBackend::LAYERS_WR:
|
||||
MOZ_ASSERT(gfx::gfxVars::UseWebRender());
|
||||
if (gfx::gfxVars::UseSoftwareWebRender()) {
|
||||
#ifdef XP_WIN
|
||||
if (gfx::gfxVars::AllowSoftwareWebRenderD3D11() &&
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
#include "gmock/gmock.h"
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/gfx/gfxVars.h"
|
||||
#include "mozilla/layers/GeckoContentController.h"
|
||||
#include "mozilla/layers/CompositorBridgeParent.h"
|
||||
#include "mozilla/layers/APZThreadUtils.h"
|
||||
|
|
|
|||
|
|
@ -68,10 +68,6 @@ class APZCOverscrollTester : public APZCBasicTester {
|
|||
|
||||
ScrollableLayerGuid CreateSimpleRootScrollableForWebRender() {
|
||||
ScrollableLayerGuid guid;
|
||||
if (!gfx::gfxVars::UseWebRender()) {
|
||||
return guid;
|
||||
}
|
||||
|
||||
guid.mScrollId = ScrollableLayerGuid::START_SCROLL_ID;
|
||||
guid.mLayersId = LayersId{0};
|
||||
|
||||
|
|
@ -1349,11 +1345,6 @@ TEST_F(
|
|||
|
||||
#ifndef MOZ_WIDGET_ANDROID // Currently fails on Android
|
||||
TEST_F(APZCOverscrollTester, OverscrollByPanGesturesInterruptedByReflowZoom) {
|
||||
if (!gfx::gfxVars::UseWebRender()) {
|
||||
// This test is only available with WebRender.
|
||||
return;
|
||||
}
|
||||
|
||||
SCOPED_GFX_PREF_BOOL("apz.overscroll.enabled", true);
|
||||
SCOPED_GFX_PREF_INT("mousewheel.with_control.action", 3); // reflow zoom.
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
#include "TextureRecorded.h"
|
||||
|
||||
#include "mozilla/gfx/gfxVars.h"
|
||||
#include "RecordedCanvasEventImpl.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
|
@ -114,13 +113,9 @@ void RecordedTextureData::OnForwardedToHost() {
|
|||
}
|
||||
|
||||
TextureFlags RecordedTextureData::GetTextureFlags() const {
|
||||
TextureFlags flags = TextureFlags::NO_FLAGS;
|
||||
// With WebRender, resource open happens asynchronously on RenderThread.
|
||||
// Use WAIT_HOST_USAGE_END to keep TextureClient alive during host side usage.
|
||||
if (gfx::gfxVars::UseWebRender()) {
|
||||
flags |= TextureFlags::WAIT_HOST_USAGE_END;
|
||||
}
|
||||
return flags;
|
||||
return TextureFlags::WAIT_HOST_USAGE_END;
|
||||
}
|
||||
|
||||
} // namespace layers
|
||||
|
|
|
|||
|
|
@ -605,14 +605,10 @@ void D3D11TextureData::GetDXGIResource(IDXGIResource** aOutResource) {
|
|||
}
|
||||
|
||||
TextureFlags D3D11TextureData::GetTextureFlags() const {
|
||||
TextureFlags flags = TextureFlags::NO_FLAGS;
|
||||
// With WebRender, resource open happens asynchronously on RenderThread.
|
||||
// During opening the resource on host side, TextureClient needs to be alive.
|
||||
// With WAIT_HOST_USAGE_END, keep TextureClient alive during host side usage.
|
||||
if (gfx::gfxVars::UseWebRender()) {
|
||||
flags |= TextureFlags::WAIT_HOST_USAGE_END;
|
||||
}
|
||||
return flags;
|
||||
return TextureFlags::WAIT_HOST_USAGE_END;
|
||||
}
|
||||
|
||||
DXGIYCbCrTextureData* DXGIYCbCrTextureData::Create(
|
||||
|
|
@ -746,14 +742,10 @@ void DXGIYCbCrTextureData::Deallocate(LayersIPCChannel*) {
|
|||
}
|
||||
|
||||
TextureFlags DXGIYCbCrTextureData::GetTextureFlags() const {
|
||||
TextureFlags flags = TextureFlags::NO_FLAGS;
|
||||
// With WebRender, resource open happens asynchronously on RenderThread.
|
||||
// During opening the resource on host side, TextureClient needs to be alive.
|
||||
// With WAIT_HOST_USAGE_END, keep TextureClient alive during host side usage.
|
||||
if (gfx::gfxVars::UseWebRender()) {
|
||||
flags |= TextureFlags::WAIT_HOST_USAGE_END;
|
||||
}
|
||||
return flags;
|
||||
return TextureFlags::WAIT_HOST_USAGE_END;
|
||||
}
|
||||
|
||||
already_AddRefed<TextureHost> CreateTextureHostD3D11(
|
||||
|
|
@ -884,10 +876,6 @@ bool DXGITextureHostD3D11::LockInternal() {
|
|||
}
|
||||
|
||||
already_AddRefed<gfx::DataSourceSurface> DXGITextureHostD3D11::GetAsSurface() {
|
||||
if (!gfxVars::UseWebRender()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
switch (GetFormat()) {
|
||||
case gfx::SurfaceFormat::R8G8B8X8:
|
||||
case gfx::SurfaceFormat::R8G8B8A8:
|
||||
|
|
@ -1772,7 +1760,7 @@ bool SyncObjectD3D11ClientContentDevice::IsSyncObjectValid() {
|
|||
}
|
||||
|
||||
// Update mDevice if the ContentDevice initialization is detected.
|
||||
if (!mContentDevice && dev && NS_IsMainThread() && gfxVars::UseWebRender()) {
|
||||
if (!mContentDevice && dev && NS_IsMainThread()) {
|
||||
mContentDevice = dev;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
#include "SharedSurfacesChild.h"
|
||||
#include "SharedSurfacesParent.h"
|
||||
#include "CompositorManagerChild.h"
|
||||
#include "mozilla/gfx/gfxVars.h"
|
||||
#include "mozilla/layers/IpcResourceUpdateQueue.h"
|
||||
#include "mozilla/layers/SourceSurfaceSharedData.h"
|
||||
#include "mozilla/layers/WebRenderBridgeChild.h"
|
||||
|
|
@ -171,7 +170,7 @@ nsresult SharedSurfacesChild::ShareInternal(SourceSurfaceSharedData* aSurface,
|
|||
MOZ_ASSERT(aUserData);
|
||||
|
||||
CompositorManagerChild* manager = CompositorManagerChild::GetInstance();
|
||||
if (NS_WARN_IF(!manager || !manager->CanSend() || !gfxVars::UseWebRender())) {
|
||||
if (NS_WARN_IF(!manager || !manager->CanSend())) {
|
||||
// We cannot try to share the surface, most likely because the GPU process
|
||||
// crashed. Ideally, we would retry when it is ready, but the handles may be
|
||||
// a scarce resource, which can cause much more serious problems if we run
|
||||
|
|
|
|||
|
|
@ -113,7 +113,6 @@ bool DeviceManagerDx::LoadD3D11() {
|
|||
|
||||
bool DeviceManagerDx::LoadDcomp() {
|
||||
MOZ_ASSERT(gfxConfig::GetFeature(Feature::D3D11_COMPOSITING).IsEnabled());
|
||||
MOZ_ASSERT(gfxVars::UseWebRender());
|
||||
MOZ_ASSERT(gfxVars::UseWebRenderANGLE());
|
||||
MOZ_ASSERT(gfxVars::UseWebRenderDCompWin());
|
||||
|
||||
|
|
@ -317,7 +316,7 @@ bool DeviceManagerDx::CreateCompositorDevicesLocked() {
|
|||
// Fallback from WR to D3D11 Non-WR compositor without re-creating gpu process
|
||||
// could happen when WR causes error. In this case, the attachments are loaded
|
||||
// synchronously.
|
||||
if (!gfx::gfxVars::UseWebRender() || gfx::gfxVars::UseSoftwareWebRender()) {
|
||||
if (gfx::gfxVars::UseSoftwareWebRender()) {
|
||||
PreloadAttachmentsOnCompositorThread();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -925,20 +925,17 @@ void gfxPlatform::Init() {
|
|||
gPlatform->InitWindowOcclusionConfig();
|
||||
gPlatform->InitBackdropFilterConfig();
|
||||
|
||||
#if defined(XP_WIN)
|
||||
// When using WebRender, we defer initialization of the D3D11 devices until
|
||||
// the (rare) cases where they're used. Note that the GPU process where
|
||||
// WebRender runs doesn't initialize gfxPlatform and performs explicit
|
||||
// initialization of the bits it needs.
|
||||
if (!UseWebRender()
|
||||
#if defined(XP_WIN)
|
||||
|| (UseWebRender() && XRE_IsParentProcess() &&
|
||||
!gfxConfig::IsEnabled(Feature::GPU_PROCESS) &&
|
||||
StaticPrefs::
|
||||
gfx_webrender_enabled_no_gpu_process_with_angle_win_AtStartup())
|
||||
#endif
|
||||
) {
|
||||
if (XRE_IsParentProcess() && !gfxConfig::IsEnabled(Feature::GPU_PROCESS) &&
|
||||
StaticPrefs::
|
||||
gfx_webrender_enabled_no_gpu_process_with_angle_win_AtStartup()) {
|
||||
gPlatform->EnsureDevicesInitialized();
|
||||
}
|
||||
#endif
|
||||
|
||||
if (gfxConfig::IsEnabled(Feature::GPU_PROCESS)) {
|
||||
GPUProcessManager* gpu = GPUProcessManager::Get();
|
||||
|
|
@ -1014,7 +1011,7 @@ void gfxPlatform::Init() {
|
|||
}
|
||||
|
||||
RegisterStrongMemoryReporter(new GfxMemoryImageReporter());
|
||||
if (XRE_IsParentProcess() && UseWebRender()) {
|
||||
if (XRE_IsParentProcess()) {
|
||||
RegisterStrongAsyncMemoryReporter(new WebRenderMemoryReporter());
|
||||
}
|
||||
|
||||
|
|
@ -1188,9 +1185,6 @@ bool gfxPlatform::IsHeadless() {
|
|||
return headless;
|
||||
}
|
||||
|
||||
/* static */
|
||||
bool gfxPlatform::UseWebRender() { return gfx::gfxVars::UseWebRender(); }
|
||||
|
||||
/* static */
|
||||
bool gfxPlatform::UseRemoteCanvas() {
|
||||
return XRE_IsContentProcess() && gfx::gfxVars::RemoteCanvasEnabled();
|
||||
|
|
@ -1310,7 +1304,7 @@ void gfxPlatform::InitLayersIPC() {
|
|||
widget::WinWindowOcclusionTracker::Ensure();
|
||||
}
|
||||
#endif
|
||||
if (!gfxConfig::IsEnabled(Feature::GPU_PROCESS) && UseWebRender()) {
|
||||
if (!gfxConfig::IsEnabled(Feature::GPU_PROCESS)) {
|
||||
RemoteTextureMap::Init();
|
||||
if (gfxVars::UseCanvasRenderThread()) {
|
||||
gfx::CanvasRenderThread::Start();
|
||||
|
|
@ -2107,8 +2101,8 @@ void gfxPlatform::InitializeCMS() {
|
|||
nsTArray<uint8_t> outputProfileData =
|
||||
gfxPlatform::GetPlatform()->GetPlatformCMSOutputProfileData();
|
||||
if (!outputProfileData.IsEmpty()) {
|
||||
gCMSOutputProfile = qcms_profile_from_memory_curves_only(outputProfileData.Elements(),
|
||||
outputProfileData.Length());
|
||||
gCMSOutputProfile = qcms_profile_from_memory_curves_only(
|
||||
outputProfileData.Elements(), outputProfileData.Length());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2602,9 +2596,7 @@ void gfxPlatform::InitWebRenderConfig() {
|
|||
// The parent process runs through all the real decision-making code
|
||||
// later in this function. For other processes we still want to report
|
||||
// the state of the feature for crash reports.
|
||||
if (gfxVars::UseWebRender()) {
|
||||
reporter.SetSuccessful();
|
||||
}
|
||||
reporter.SetSuccessful();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -2642,9 +2634,6 @@ void gfxPlatform::InitWebRenderConfig() {
|
|||
Preferences::RegisterPrefixCallbackAndCall(SwapIntervalPrefChangeCallback,
|
||||
"gfx.swap-interval");
|
||||
|
||||
// gfxFeature is not usable in the GPU process, so we use gfxVars to transmit
|
||||
// this feature
|
||||
gfxVars::SetUseWebRender(true);
|
||||
reporter.SetSuccessful();
|
||||
|
||||
Preferences::RegisterPrefixCallbackAndCall(WebRenderDebugPrefChangeCallback,
|
||||
|
|
@ -2807,7 +2796,7 @@ void gfxPlatform::InitWebRenderConfig() {
|
|||
}
|
||||
|
||||
if (Preferences::GetBool("gfx.webrender.flip-sequential", false)) {
|
||||
if (UseWebRender() && gfxVars::UseWebRenderANGLE()) {
|
||||
if (gfxVars::UseWebRenderANGLE()) {
|
||||
gfxVars::SetUseWebRenderFlipSequentialWin(true);
|
||||
}
|
||||
}
|
||||
|
|
@ -2878,8 +2867,6 @@ void gfxPlatform::InitHardwareVideoConfig() {
|
|||
}
|
||||
|
||||
void gfxPlatform::InitWebGLConfig() {
|
||||
// Depends on InitWebRenderConfig() for UseWebRender().
|
||||
|
||||
if (!XRE_IsParentProcess()) return;
|
||||
|
||||
const nsCOMPtr<nsIGfxInfo> gfxInfo = components::GfxInfo::Service();
|
||||
|
|
@ -3561,7 +3548,7 @@ bool gfxPlatform::FallbackFromAcceleration(FeatureStatus aStatus,
|
|||
if (StaticPrefs::gfx_webrender_fallback_software_d3d11_AtStartup() &&
|
||||
swglFallbackAllowed && gfxVars::AllowSoftwareWebRenderD3D11() &&
|
||||
gfxConfig::IsEnabled(Feature::D3D11_COMPOSITING) &&
|
||||
gfxVars::UseWebRender() && !gfxVars::UseSoftwareWebRender()) {
|
||||
!gfxVars::UseSoftwareWebRender()) {
|
||||
// Fallback to Software WebRender + D3D11 compositing.
|
||||
gfxCriticalNote << "Fallback WR to SW-WR + D3D11";
|
||||
gfxVars::SetUseSoftwareWebRender(true);
|
||||
|
|
@ -3586,15 +3573,6 @@ bool gfxPlatform::FallbackFromAcceleration(FeatureStatus aStatus,
|
|||
if (gfxConfig::IsEnabled(Feature::D3D11_COMPOSITING)) {
|
||||
gfxConfig::GetFeature(Feature::D3D11_COMPOSITING)
|
||||
.ForceDisable(aStatus, aMessage, aFailureId);
|
||||
|
||||
if (StaticPrefs::gfx_webrender_fallback_software_AtStartup() &&
|
||||
swglFallbackAllowed && !gfxVars::UseWebRender()) {
|
||||
// Fallback from D3D11 to Software WebRender.
|
||||
gfxCriticalNote << "Fallback D3D11 to SW-WR";
|
||||
gfxVars::SetUseWebRender(true);
|
||||
gfxVars::SetUseSoftwareWebRender(true);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -3607,12 +3585,6 @@ bool gfxPlatform::FallbackFromAcceleration(FeatureStatus aStatus,
|
|||
}
|
||||
#endif
|
||||
|
||||
if (!gfxVars::UseWebRender()) {
|
||||
// We were not using WebRender in the first place, and we have disabled
|
||||
// all forms of accelerated compositing.
|
||||
return false;
|
||||
}
|
||||
|
||||
if (StaticPrefs::gfx_webrender_fallback_software_AtStartup() &&
|
||||
swglFallbackAllowed && !gfxVars::UseSoftwareWebRender()) {
|
||||
// Fallback from WebRender to Software WebRender.
|
||||
|
|
@ -3621,8 +3593,6 @@ bool gfxPlatform::FallbackFromAcceleration(FeatureStatus aStatus,
|
|||
return true;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(gfxVars::UseWebRender());
|
||||
|
||||
if (!gfxVars::UseSoftwareWebRender()) {
|
||||
// Software WebRender may be disabled due to a startup issue with the
|
||||
// blocklist, despite it being our only fallback option based on the prefs.
|
||||
|
|
@ -3648,15 +3618,13 @@ void gfxPlatform::DisableGPUProcess() {
|
|||
gfxVars::SetRemoteCanvasEnabled(false);
|
||||
|
||||
RemoteTextureMap::Init();
|
||||
if (gfxVars::UseWebRender()) {
|
||||
if (gfxVars::UseCanvasRenderThread()) {
|
||||
gfx::CanvasRenderThread::Start();
|
||||
}
|
||||
// We need to initialize the parent process to prepare for WebRender if we
|
||||
// did not end up disabling it, despite losing the GPU process.
|
||||
wr::RenderThread::Start(GPUProcessManager::Get()->AllocateNamespace());
|
||||
image::ImageMemoryReporter::InitForWebRender();
|
||||
if (gfxVars::UseCanvasRenderThread()) {
|
||||
gfx::CanvasRenderThread::Start();
|
||||
}
|
||||
// We need to initialize the parent process to prepare for WebRender if we
|
||||
// did not end up disabling it, despite losing the GPU process.
|
||||
wr::RenderThread::Start(GPUProcessManager::Get()->AllocateNamespace());
|
||||
image::ImageMemoryReporter::InitForWebRender();
|
||||
}
|
||||
|
||||
void gfxPlatform::FetchAndImportContentDeviceData() {
|
||||
|
|
|
|||
|
|
@ -232,8 +232,6 @@ class gfxPlatform : public mozilla::layers::MemoryPressureListener {
|
|||
|
||||
static bool IsHeadless();
|
||||
|
||||
static bool UseWebRender();
|
||||
|
||||
static bool UseRemoteCanvas();
|
||||
|
||||
static bool IsBackendAccelerated(
|
||||
|
|
|
|||
|
|
@ -438,10 +438,7 @@ void gfxWindowsPlatform::InitAcceleration() {
|
|||
|
||||
void gfxWindowsPlatform::InitWebRenderConfig() {
|
||||
gfxPlatform::InitWebRenderConfig();
|
||||
|
||||
if (gfxVars::UseWebRender()) {
|
||||
UpdateBackendPrefs();
|
||||
}
|
||||
UpdateBackendPrefs();
|
||||
}
|
||||
|
||||
bool gfxWindowsPlatform::CanUseHardwareVideoDecoding() {
|
||||
|
|
@ -510,11 +507,6 @@ BackendPrefsData gfxWindowsPlatform::GetBackendPrefs() const {
|
|||
if (gfxConfig::IsEnabled(Feature::DIRECT2D)) {
|
||||
data.mCanvasBitmask |= BackendTypeBit(BackendType::DIRECT2D1_1);
|
||||
data.mCanvasDefault = BackendType::DIRECT2D1_1;
|
||||
// We do not use d2d for content when WebRender is used.
|
||||
if (!gfxVars::UseWebRender()) {
|
||||
data.mContentBitmask |= BackendTypeBit(BackendType::DIRECT2D1_1);
|
||||
data.mContentDefault = BackendType::DIRECT2D1_1;
|
||||
}
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
|
@ -592,7 +584,7 @@ mozilla::gfx::BackendType gfxWindowsPlatform::GetPreferredCanvasBackend() {
|
|||
mozilla::gfx::BackendType backend = gfxPlatform::GetPreferredCanvasBackend();
|
||||
|
||||
if (backend == BackendType::DIRECT2D1_1) {
|
||||
if (gfx::gfxVars::UseWebRender() && !gfx::gfxVars::UseWebRenderANGLE()) {
|
||||
if (!gfx::gfxVars::UseWebRenderANGLE()) {
|
||||
// We can't have D2D without ANGLE when WebRender is enabled, so fallback
|
||||
// to Skia.
|
||||
return BackendType::SKIA;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
#include "mozilla/dom/SVGSVGElement.h"
|
||||
#include "mozilla/dom/SVGDocument.h"
|
||||
#include "mozilla/gfx/2D.h"
|
||||
#include "mozilla/gfx/gfxVars.h"
|
||||
#include "mozilla/PendingAnimationTracker.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/ProfilerLabels.h"
|
||||
|
|
@ -972,13 +971,7 @@ VectorImage::Draw(gfxContext* aContext, const nsIntSize& aSize,
|
|||
// - We are using a DrawTargetRecording because we prefer the drawing commands
|
||||
// in general to the rasterized surface. This allows blob images to avoid
|
||||
// rasterized SVGs with WebRender.
|
||||
// - The size exceeds what we are willing to cache as a rasterized surface.
|
||||
// We don't do this for WebRender because the performance of the fallback
|
||||
// path is quite bad and upscaling the SVG from the clamped size is better
|
||||
// than bringing the browser to a crawl.
|
||||
if (aContext->GetDrawTarget()->GetBackendType() == BackendType::RECORDING ||
|
||||
(!gfxVars::UseWebRender() &&
|
||||
aSize != SurfaceCache::ClampVectorSize(aSize))) {
|
||||
if (aContext->GetDrawTarget()->GetBackendType() == BackendType::RECORDING) {
|
||||
aFlags |= FLAG_BYPASS_SURFACE_CACHE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@
|
|||
#include "mozilla/dom/ImageTracker.h"
|
||||
#include "mozilla/dom/Selection.h"
|
||||
#include "mozilla/gfx/2D.h"
|
||||
#include "mozilla/gfx/gfxVars.h"
|
||||
#include "mozilla/gfx/PathHelpers.h"
|
||||
#include "mozilla/intl/BidiEmbeddingLevel.h"
|
||||
#include "mozilla/Maybe.h"
|
||||
|
|
@ -11497,8 +11496,7 @@ CompositorHitTestInfo nsIFrame::GetCompositorHitTestInfo(
|
|||
// If WebRender is enabled, simple clip-paths can be converted into WR
|
||||
// clips that WR knows how to hit-test against, so we don't need to mark
|
||||
// it as an irregular area.
|
||||
if (!gfxVars::UseWebRender() ||
|
||||
!SVGIntegrationUtils::UsingSimpleClipPathForFrame(this)) {
|
||||
if (!SVGIntegrationUtils::UsingSimpleClipPathForFrame(this)) {
|
||||
result += CompositorHitTestFlags::eIrregularArea;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
#include "gfxContext.h"
|
||||
#include "SVGPaintServerFrame.h"
|
||||
#include "mozilla/gfx/Point.h"
|
||||
#include "mozilla/gfx/gfxVars.h"
|
||||
#include "mozilla/CSSClipPathInstance.h"
|
||||
#include "mozilla/FilterInstance.h"
|
||||
#include "mozilla/StaticPrefs_layers.h"
|
||||
|
|
@ -1101,13 +1100,8 @@ bool SVGIntegrationUtils::CanCreateWebRenderFiltersForFrame(nsIFrame* aFrame) {
|
|||
bool SVGIntegrationUtils::UsesSVGEffectsNotSupportedInCompositor(
|
||||
nsIFrame* aFrame) {
|
||||
// WebRender supports masks / clip-paths and some filters in the compositor.
|
||||
// Non-WebRender doesn't support any SVG effects in the compositor.
|
||||
if (aFrame->StyleEffects()->HasFilters()) {
|
||||
return !gfx::gfxVars::UseWebRender() ||
|
||||
!SVGIntegrationUtils::CanCreateWebRenderFiltersForFrame(aFrame);
|
||||
}
|
||||
if (SVGIntegrationUtils::UsingMaskOrClipPathForFrame(aFrame)) {
|
||||
return !gfx::gfxVars::UseWebRender();
|
||||
return !SVGIntegrationUtils::CanCreateWebRenderFiltersForFrame(aFrame);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -736,16 +736,6 @@ nsIXULRuntime::ContentWin32kLockdownState GetLiveWin32kLockdownState() {
|
|||
}
|
||||
}
|
||||
|
||||
// Win32k Lockdown requires WebRender, but WR is not currently guaranteed
|
||||
// on all computers. It can also fail to initialize and fallback to
|
||||
// non-WR render path.
|
||||
//
|
||||
// We don't want a situation where "Win32k Lockdown + No WR" occurs
|
||||
// without the user explicitly requesting unsupported behavior.
|
||||
if (!gfx::gfxVars::UseWebRender()) {
|
||||
return nsIXULRuntime::ContentWin32kLockdownState::MissingWebRender;
|
||||
}
|
||||
|
||||
// Non-native theming is required as well
|
||||
if (!StaticPrefs::widget_non_native_theme_enabled()) {
|
||||
return nsIXULRuntime::ContentWin32kLockdownState::MissingNonNativeTheming;
|
||||
|
|
|
|||
|
|
@ -1840,7 +1840,7 @@ nsresult GfxInfoBase::GetActiveCrashGuards(JSContext* aCx,
|
|||
|
||||
NS_IMETHODIMP
|
||||
GfxInfoBase::GetWebRenderEnabled(bool* aWebRenderEnabled) {
|
||||
*aWebRenderEnabled = gfxVars::UseWebRender();
|
||||
*aWebRenderEnabled = true;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1349,20 +1349,13 @@ already_AddRefed<WebRenderLayerManager> nsBaseWidget::CreateCompositorSession(
|
|||
gpu->EnsureGPUReady();
|
||||
|
||||
// If widget type does not supports acceleration, we may be allowed to use
|
||||
// software WebRender instead. If not, then we use ClientLayerManager even
|
||||
// when gfxVars::UseWebRender() is true. WebRender could coexist only with
|
||||
// BasicCompositor.
|
||||
// software WebRender instead.
|
||||
bool supportsAcceleration = WidgetTypeSupportsAcceleration();
|
||||
bool enableWR;
|
||||
bool enableSWWR;
|
||||
bool enableSWWR = true;
|
||||
if (supportsAcceleration ||
|
||||
StaticPrefs::gfx_webrender_unaccelerated_widget_force()) {
|
||||
enableWR = gfx::gfxVars::UseWebRender();
|
||||
enableSWWR = gfx::gfxVars::UseSoftwareWebRender();
|
||||
} else {
|
||||
enableWR = enableSWWR = gfx::gfxVars::UseWebRender();
|
||||
}
|
||||
MOZ_RELEASE_ASSERT(enableWR);
|
||||
bool enableAPZ = UseAPZ();
|
||||
CompositorOptions options(enableAPZ, enableSWWR);
|
||||
|
||||
|
|
|
|||
|
|
@ -7957,14 +7957,6 @@ void nsWindow::SetWindowTranslucencyInner(nsTransparencyMode aMode) {
|
|||
reinterpret_cast<HBRUSH>(GetStockObject(BLACK_BRUSH)));
|
||||
ReleaseDC(mWnd, hdc);
|
||||
}
|
||||
|
||||
// Disable double buffering with D3D compositor for disabling compositor
|
||||
// window usage.
|
||||
if (HasGlass() && !gfxVars::UseWebRender() &&
|
||||
gfxVars::UseDoubleBufferingWithCompositor()) {
|
||||
gfxVars::SetUseDoubleBufferingWithCompositor(false);
|
||||
GPUProcessManager::Get()->ResetCompositors();
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************************
|
||||
|
|
|
|||
Loading…
Reference in a new issue