Skip to content

Commit

Permalink
Bug 1741121 - LayersBackend::LAYERS_CLIENT r=gfx-reviewers,jrmuizel
Browse files Browse the repository at this point in the history
  • Loading branch information
sotaro committed Nov 15, 2021
1 parent ef0b8c1 commit 9764ed8
Show file tree
Hide file tree
Showing 8 changed files with 4 additions and 20 deletions.
2 changes: 0 additions & 2 deletions gfx/layers/CanvasRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ TextureType TexTypeForWebgl(KnowsCompositor* const knowsCompositor) {
const auto layersBackend = knowsCompositor->GetCompositorBackendType();

switch (layersBackend) {
case LayersBackend::LAYERS_CLIENT:
MOZ_CRASH("Unexpected LayersBackend::LAYERS_CLIENT");
case LayersBackend::LAYERS_LAST:
MOZ_CRASH("Unexpected LayersBackend::LAYERS_LAST");

Expand Down
2 changes: 0 additions & 2 deletions gfx/layers/LayersTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ const char* GetLayersBackendName(LayersBackend aBackend) {
return "opengl";
case LayersBackend::LAYERS_D3D11:
return "d3d11";
case LayersBackend::LAYERS_CLIENT:
return "client";
case LayersBackend::LAYERS_WR:
MOZ_ASSERT(gfx::gfxVars::UseWebRender());
if (gfx::gfxVars::UseSoftwareWebRender()) {
Expand Down
1 change: 0 additions & 1 deletion gfx/layers/LayersTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ enum class LayersBackend : int8_t {
LAYERS_BASIC,
LAYERS_OPENGL,
LAYERS_D3D11,
LAYERS_CLIENT,
LAYERS_WR,
LAYERS_LAST
};
Expand Down
4 changes: 1 addition & 3 deletions gfx/layers/ipc/CompositorBridgeChild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,7 @@ mozilla::ipc::IPCResult CompositorBridgeChild::RecvDidComposite(
for (const auto& id : aTransactionIds) {
if (mLayerManager) {
MOZ_ASSERT(!aId.IsValid());
MOZ_ASSERT(mLayerManager->GetBackendType() ==
LayersBackend::LAYERS_CLIENT ||
mLayerManager->GetBackendType() == LayersBackend::LAYERS_WR);
MOZ_ASSERT(mLayerManager->GetBackendType() == LayersBackend::LAYERS_WR);
// Hold a reference to keep LayerManager alive. See Bug 1242668.
RefPtr<WebRenderLayerManager> m = mLayerManager;
m->DidComposite(id, aCompositeStart, aCompositeEnd);
Expand Down
6 changes: 1 addition & 5 deletions widget/cocoa/nsChildView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1217,7 +1217,7 @@ static void blinkRgn(RgnHandle rgn) {

if (!mView || !mVisible) return;

NS_ASSERTION(GetWindowRenderer()->GetBackendType() != LayersBackend::LAYERS_CLIENT,
NS_ASSERTION(GetWindowRenderer()->GetBackendType() != LayersBackend::LAYERS_WR,
"Shouldn't need to invalidate with accelerated OMTC layers!");

EnsureContentLayerForMainThreadPainting();
Expand Down Expand Up @@ -1364,10 +1364,6 @@ static void blinkRgn(RgnHandle rgn) {
BufferMode::BUFFER_NONE);
return PaintWindow(aRegion);
}
if (GetWindowRenderer()->GetBackendType() == LayersBackend::LAYERS_CLIENT) {
// We only need this so that we actually get DidPaintWindow fired
return PaintWindow(aRegion);
}
return false;
}

Expand Down
3 changes: 1 addition & 2 deletions widget/gtk/nsWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3581,8 +3581,7 @@ gboolean nsWindow::OnExposeEvent(cairo_t* cr) {
}

// If this widget uses OMTC...
if (renderer->GetBackendType() == LayersBackend::LAYERS_CLIENT ||
renderer->GetBackendType() == LayersBackend::LAYERS_WR) {
if (renderer->GetBackendType() == LayersBackend::LAYERS_WR) {
listener->PaintWindow(this, region);

// Re-get the listener since the will paint notification might have
Expand Down
5 changes: 1 addition & 4 deletions widget/uikit/nsWindow.mm
Original file line number Diff line number Diff line change
Expand Up @@ -351,9 +351,6 @@ - (void)drawRect:(CGRect)aRect inContext:(CGContextRef)aContext {
nsBaseWidget::AutoLayerManagerSetup setupLayerManager(mGeckoChild, targetContext,
BufferMode::BUFFER_NONE);
painted = mGeckoChild->PaintWindow(region);
} else if (mGeckoChild->GetLayerManager()->GetBackendType() == LayersBackend::LAYERS_CLIENT) {
// We only need this so that we actually get DidPaintWindow fired
painted = mGeckoChild->PaintWindow(region);
}

targetContext = nullptr;
Expand Down Expand Up @@ -572,7 +569,7 @@ - (void)drawRect:(CGRect)aRect inContext:(CGContextRef)aContext {
void nsWindow::Invalidate(const LayoutDeviceIntRect& aRect) {
if (!mNativeView || !mVisible) return;

MOZ_RELEASE_ASSERT(GetLayerManager()->GetBackendType() != LayersBackend::LAYERS_CLIENT,
MOZ_RELEASE_ASSERT(GetLayerManager()->GetBackendType() != LayersBackend::LAYERS_WR,
"Shouldn't need to invalidate with accelerated OMTC layers!");

[mNativeView setNeedsLayout];
Expand Down
1 change: 0 additions & 1 deletion widget/windows/nsWindowGfx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,6 @@ bool nsWindow::OnPaint(HDC aDC, uint32_t aNestingLevel) {
}
#endif
} break;
case LayersBackend::LAYERS_CLIENT:
case LayersBackend::LAYERS_WR: {
result = listener->PaintWindow(this, region);
if (!gfxEnv::DisableForcePresent() &&
Expand Down

0 comments on commit 9764ed8

Please sign in to comment.