Skip to content

Commit

Permalink
Backed out changeset ea2341b06e6f (bug 994541) for reftest timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
Ed Morley committed Jul 21, 2014
1 parent 10349d0 commit 5cc8eef
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
19 changes: 18 additions & 1 deletion modules/libpref/src/init/all.js
Original file line number Diff line number Diff line change
Expand Up @@ -3832,7 +3832,7 @@ pref("layers.max-active", -1);
pref("layers.scroll-graph", false);

// Set the default values, and then override per-platform as needed
pref("layers.offmainthreadcomposition.enabled", true);
pref("layers.offmainthreadcomposition.enabled", false);
// Compositor target frame rate. NOTE: If vsync is enabled the compositor
// frame rate will still be capped.
// -1 -> default (match layout.frame_rate or 60 FPS)
Expand All @@ -3845,14 +3845,31 @@ pref("layers.async-video.enabled", true);
pref("layers.async-video-oop.enabled",true);

#ifdef XP_WIN
pref("layers.offmainthreadcomposition.enabled", true);
// XXX - see bug 1009616
pref("layers.async-video-oop.enabled", false);
#endif

#ifdef MOZ_WIDGET_QT
pref("layers.offmainthreadcomposition.enabled", true);
#endif

#ifdef XP_MACOSX
pref("layers.offmainthreadcomposition.enabled", true);
#endif

// ANDROID covers android and b2g
#ifdef ANDROID
pref("layers.offmainthreadcomposition.enabled", true);
#endif

// same effect as layers.offmainthreadcomposition.enabled, but specifically for
// use with tests.
pref("layers.offmainthreadcomposition.testing.enabled", false);

// whether to allow use of the basic compositor
pref("layers.offmainthreadcomposition.force-basic", false);

// Whether to animate simple opacity and transforms on the compositor
pref("layers.offmainthreadcomposition.async-animations", false);

Expand Down
18 changes: 18 additions & 0 deletions widget/xpwidgets/nsBaseWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,20 @@ nsBaseWidget::GetPreferredCompositorBackends(nsTArray<LayersBackend>& aHints)
aHints.AppendElement(LayersBackend::LAYERS_BASIC);
}

static void
CheckForBasicBackends(nsTArray<LayersBackend>& aHints)
{
#ifndef XP_WIN
for (size_t i = 0; i < aHints.Length(); ++i) {
if (aHints[i] == LayersBackend::LAYERS_BASIC &&
!Preferences::GetBool("layers.offmainthreadcomposition.force-basic", false)) {
// basic compositor is not stable enough for regular use
aHints[i] = LayersBackend::LAYERS_NONE;
}
}
#endif
}

void nsBaseWidget::CreateCompositor(int aWidth, int aHeight)
{
MOZ_ASSERT(gfxPlatform::UsesOffMainThreadCompositing(),
Expand Down Expand Up @@ -901,6 +915,10 @@ void nsBaseWidget::CreateCompositor(int aWidth, int aHeight)
nsTArray<LayersBackend> backendHints;
GetPreferredCompositorBackends(backendHints);

if (!mRequireOffMainThreadCompositing) {
CheckForBasicBackends(backendHints);
}

bool success = false;
if (!backendHints.IsEmpty()) {
shadowManager = mCompositorChild->SendPLayerTransactionConstructor(
Expand Down

0 comments on commit 5cc8eef

Please sign in to comment.