Skip to content

Commit

Permalink
Bug 1741111 - Remove LayersBackend::LAYERS_BASIC r=gfx-reviewers,brad…
Browse files Browse the repository at this point in the history
…werth

LayersBackend::LAYERS_BASIC is not used any more.

Differential Revision: https://phabricator.services.mozilla.com/D131104
  • Loading branch information
sotaro committed Nov 17, 2021
1 parent bd15e9d commit 248d551
Show file tree
Hide file tree
Showing 14 changed files with 9 additions and 34 deletions.
1 change: 0 additions & 1 deletion dom/canvas/ClientWebGLContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,6 @@ bool ClientWebGLContext::CreateHostContext(const uvec2& requestedSize) {
if (options.failIfMajorPerformanceCaveat) {
const auto backend = GetCompositorBackendType();
bool isCompositorSlow = false;
isCompositorSlow |= (backend == layers::LayersBackend::LAYERS_BASIC);
isCompositorSlow |= (backend == layers::LayersBackend::LAYERS_WR &&
gfx::gfxVars::UseSoftwareWebRender());

Expand Down
2 changes: 1 addition & 1 deletion dom/ipc/BrowserChild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2844,7 +2844,7 @@ void BrowserChild::InitRenderingState(
// remote layer manager though, so that's fine.
MOZ_ASSERT(!mPuppetWidget->HasLayerManager() ||
mPuppetWidget->GetWindowRenderer()->GetBackendType() ==
layers::LayersBackend::LAYERS_BASIC);
layers::LayersBackend::LAYERS_NONE);
bool success = false;
if (mLayersConnected == Some(true)) {
success = CreateRemoteLayerManager(compositorChild);
Expand Down
3 changes: 1 addition & 2 deletions dom/media/platforms/wmf/WMFDecoderModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ static bool IsRemoteAcceleratedCompositor(

TextureFactoryIdentifier ident =
aKnowsCompositor->GetTextureFactoryIdentifier();
return ident.mParentBackend != LayersBackend::LAYERS_BASIC &&
!aKnowsCompositor->UsingSoftwareWebRender() &&
return !aKnowsCompositor->UsingSoftwareWebRender() &&
ident.mParentProcessType == GeckoProcessType_GPU;
}

Expand Down
3 changes: 1 addition & 2 deletions gfx/layers/BufferTexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ bool ComputeHasIntermediateBuffer(gfx::SurfaceFormat aFormat,
return false;
}

return aLayersBackend != LayersBackend::LAYERS_BASIC ||
aFormat == gfx::SurfaceFormat::UNKNOWN;
return aFormat == gfx::SurfaceFormat::UNKNOWN;
}

BufferTextureData* BufferTextureData::Create(
Expand Down
1 change: 0 additions & 1 deletion gfx/layers/CanvasRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ TextureType TexTypeForWebgl(KnowsCompositor* const knowsCompositor) {
MOZ_CRASH("Unexpected LayersBackend::LAYERS_LAST");

case LayersBackend::LAYERS_NONE:
case LayersBackend::LAYERS_BASIC:
return TextureType::Unknown;

case LayersBackend::LAYERS_D3D11:
Expand Down
2 changes: 0 additions & 2 deletions gfx/layers/LayersTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ const char* GetLayersBackendName(LayersBackend aBackend) {
return "webrender_software";
}
return "webrender";
case LayersBackend::LAYERS_BASIC:
return "basic";
default:
MOZ_ASSERT_UNREACHABLE("unknown layers backend");
return "unknown";
Expand Down
1 change: 0 additions & 1 deletion gfx/layers/LayersTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ enum class WindowKind : int8_t { MAIN = 0, SECONDARY, LAST };

enum class LayersBackend : int8_t {
LAYERS_NONE = 0,
LAYERS_BASIC,
LAYERS_OPENGL,
LAYERS_D3D11,
LAYERS_WR,
Expand Down
2 changes: 1 addition & 1 deletion layout/painting/WindowRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ void FallbackRenderer::EndTransactionWithList(nsDisplayListBuilder* aBuilder,
DrawTarget* dt = mTarget->GetDrawTarget();

BackendType backend = gfxPlatform::GetPlatform()->GetContentBackendFor(
LayersBackend::LAYERS_BASIC);
LayersBackend::LAYERS_NONE);
RefPtr<DrawTarget> dest =
gfxPlatform::GetPlatform()->CreateDrawTargetForBackend(
backend, dt->GetSize(), dt->GetFormat());
Expand Down
6 changes: 2 additions & 4 deletions widget/cocoa/nsChildView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1358,8 +1358,7 @@ static void blinkRgn(RgnHandle rgn) {
targetContext->Clip();

nsAutoRetainCocoaObject kungFuDeathGrip(mView);
if (GetWindowRenderer()->GetBackendType() == LayersBackend::LAYERS_NONE ||
GetWindowRenderer()->GetBackendType() == LayersBackend::LAYERS_BASIC) {
if (GetWindowRenderer()->GetBackendType() == LayersBackend::LAYERS_NONE) {
nsBaseWidget::AutoLayerManagerSetup setupLayerManager(this, targetContext,
BufferMode::BUFFER_NONE);
return PaintWindow(aRegion);
Expand Down Expand Up @@ -1406,8 +1405,7 @@ static void blinkRgn(RgnHandle rgn) {
void nsChildView::HandleMainThreadCATransaction() {
WillPaintWindow();

if (GetWindowRenderer()->GetBackendType() == LayersBackend::LAYERS_NONE ||
GetWindowRenderer()->GetBackendType() == LayersBackend::LAYERS_BASIC) {
if (GetWindowRenderer()->GetBackendType() == LayersBackend::LAYERS_NONE) {
// We're in BasicLayers mode, i.e. main thread software compositing.
// Composite the window into our layer's surface.
PaintWindowInContentLayer();
Expand Down
3 changes: 1 addition & 2 deletions widget/gtk/nsWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3646,8 +3646,7 @@ gboolean nsWindow::OnExposeEvent(cairo_t* cr) {

bool painted = false;
{
if (renderer->GetBackendType() == LayersBackend::LAYERS_NONE ||
renderer->GetBackendType() == LayersBackend::LAYERS_BASIC) {
if (renderer->GetBackendType() == LayersBackend::LAYERS_NONE) {
if (GetTransparencyMode() == eTransparencyTransparent &&
layerBuffering == BufferMode::BUFFER_NONE && mHasAlphaVisual) {
// If our draw target is unbuffered and we use an alpha channel,
Expand Down
6 changes: 0 additions & 6 deletions widget/uikit/nsWindow.mm
Original file line number Diff line number Diff line change
Expand Up @@ -347,12 +347,6 @@ - (void)drawRect:(CGRect)aRect inContext:(CGContextRef)aContext {

// nsAutoRetainCocoaObject kungFuDeathGrip(self);
bool painted = false;
if (mGeckoChild->GetLayerManager()->GetBackendType() == LayersBackend::LAYERS_BASIC) {
nsBaseWidget::AutoLayerManagerSetup setupLayerManager(mGeckoChild, targetContext,
BufferMode::BUFFER_NONE);
painted = mGeckoChild->PaintWindow(region);
}

targetContext = nullptr;
targetSurface = nullptr;

Expand Down
3 changes: 0 additions & 3 deletions widget/windows/CompositorWidgetParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,6 @@ CompositorWidgetParent::EndBackBufferDrawing() {
}

bool CompositorWidgetParent::InitCompositor(layers::Compositor* aCompositor) {
if (aCompositor->GetBackendType() == layers::LayersBackend::LAYERS_BASIC) {
DeviceManagerDx::Get()->InitializeDirectDraw();
}
return true;
}

Expand Down
3 changes: 0 additions & 3 deletions widget/windows/InProcessWinCompositorWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,6 @@ InProcessWinCompositorWidget::EndBackBufferDrawing() {

bool InProcessWinCompositorWidget::InitCompositor(
layers::Compositor* aCompositor) {
if (aCompositor->GetBackendType() == layers::LayersBackend::LAYERS_BASIC) {
DeviceManagerDx::Get()->InitializeDirectDraw();
}
return true;
}

Expand Down
7 changes: 2 additions & 5 deletions widget/windows/nsWindowGfx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,7 @@ bool nsWindow::OnPaint(HDC aDC, uint32_t aNestingLevel) {
mLastPaintBounds = mBounds;

#ifdef MOZ_XUL
if (!aDC &&
(renderer->GetBackendType() == LayersBackend::LAYERS_NONE ||
renderer->GetBackendType() == LayersBackend::LAYERS_BASIC) &&
if (!aDC && (renderer->GetBackendType() == LayersBackend::LAYERS_NONE) &&
(eTransparencyTransparent == mTransparencyMode)) {
// For layered translucent windows all drawing should go to memory DC and no
// WM_PAINT messages are normally generated. To support asynchronous
Expand Down Expand Up @@ -273,8 +271,7 @@ bool nsWindow::OnPaint(HDC aDC, uint32_t aNestingLevel) {
#endif // WIDGET_DEBUG_OUTPUT

switch (renderer->GetBackendType()) {
case LayersBackend::LAYERS_NONE:
case LayersBackend::LAYERS_BASIC: {
case LayersBackend::LAYERS_NONE: {
RefPtr<gfxASurface> targetSurface;

#if defined(MOZ_XUL)
Expand Down

0 comments on commit 248d551

Please sign in to comment.