Bug 630346 - Use basic layers for windows with transparency r=karlt
This commit is contained in:
@@ -3978,6 +3978,24 @@ nsWindow::EnsureGrabs(void)
|
||||
GrabPointer(sRetryGrabTime);
|
||||
}
|
||||
|
||||
void
|
||||
nsWindow::CleanLayerManagerRecursive(void) {
|
||||
if (mLayerManager) {
|
||||
mLayerManager->Destroy();
|
||||
mLayerManager = nullptr;
|
||||
}
|
||||
|
||||
DestroyCompositor();
|
||||
|
||||
GList* children = gdk_window_peek_children(mGdkWindow);
|
||||
for (GList* list = children; list; list = list->next) {
|
||||
nsWindow* window = get_window_for_gdk_window(GDK_WINDOW(list->data));
|
||||
if (window) {
|
||||
window->CleanLayerManagerRecursive();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
nsWindow::SetTransparencyMode(nsTransparencyMode aMode)
|
||||
{
|
||||
@@ -4016,6 +4034,10 @@ nsWindow::SetTransparencyMode(nsTransparencyMode aMode)
|
||||
// need to change anything yet
|
||||
|
||||
mIsTransparent = isTransparent;
|
||||
|
||||
// Need to clean our LayerManager up while still alive because
|
||||
// we don't want to use layers acceleration on shaped windows
|
||||
CleanLayerManagerRecursive();
|
||||
}
|
||||
|
||||
nsTransparencyMode
|
||||
@@ -6138,6 +6160,20 @@ nsWindow::BeginResizeDrag(nsGUIEvent* aEvent, int32_t aHorizontal, int32_t aVert
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsIWidget::LayerManager*
|
||||
nsWindow::GetLayerManager(PLayersChild* aShadowManager,
|
||||
LayersBackend aBackendHint,
|
||||
LayerManagerPersistence aPersistence,
|
||||
bool* aAllowRetaining)
|
||||
{
|
||||
if (!mLayerManager && eTransparencyTransparent == GetTransparencyMode()) {
|
||||
mLayerManager = CreateBasicLayerManager();
|
||||
}
|
||||
|
||||
return nsBaseWidget::GetLayerManager(aShadowManager, aBackendHint,
|
||||
aPersistence, aAllowRetaining);
|
||||
}
|
||||
|
||||
void
|
||||
nsWindow::ClearCachedResources()
|
||||
{
|
||||
|
||||
@@ -442,6 +442,14 @@ private:
|
||||
|
||||
void DispatchMissedButtonReleases(GdkEventCrossing *aGdkEvent);
|
||||
|
||||
// nsBaseWidget
|
||||
virtual LayerManager* GetLayerManager(PLayersChild* aShadowManager = nullptr,
|
||||
LayersBackend aBackendHint = mozilla::layers::LAYERS_NONE,
|
||||
LayerManagerPersistence aPersistence = LAYER_MANAGER_CURRENT,
|
||||
bool* aAllowRetaining = nullptr) MOZ_OVERRIDE;
|
||||
|
||||
void CleanLayerManagerRecursive();
|
||||
|
||||
/**
|
||||
* |mIMModule| takes all IME related stuff.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user