Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[sailfishos][compositor] Respect gfxPrefs::ClearCompoisitorContext fo…
…r clearing

Signed-off-by: Raine Makelainen <raine.makelainen@jolla.com>
  • Loading branch information
rainemak committed May 27, 2020
1 parent eb3a3a4 commit 16bf53c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 5 additions & 2 deletions gfx/layers/opengl/CompositorOGL.cpp
Expand Up @@ -703,8 +703,11 @@ CompositorOGL::BeginFrame(const nsIntRegion& aInvalidRegion,
aClipRectOut->SetRect(0, 0, width, height);
}

mGLContext->fClearColor(mClearColor.r, mClearColor.g, mClearColor.b, mClearColor.a);
mGLContext->fClear(LOCAL_GL_COLOR_BUFFER_BIT | LOCAL_GL_DEPTH_BUFFER_BIT);
// If clearing if done DrawWindowUnderlay respect the preference.
if (gfxPrefs::ClearCompoisitorContext()) {
mGLContext->fClearColor(mClearColor.r, mClearColor.g, mClearColor.b, mClearColor.a);
mGLContext->fClear(LOCAL_GL_COLOR_BUFFER_BIT | LOCAL_GL_DEPTH_BUFFER_BIT);
}
}

void
Expand Down
2 changes: 2 additions & 0 deletions gfx/thebes/gfxPrefs.h
Expand Up @@ -366,7 +366,9 @@ class gfxPrefs final
DECL_GFX_PREF(Once, "gfx.canvas.skiagl.cache-items", CanvasSkiaGLCacheItems, int32_t, 256);
DECL_GFX_PREF(Once, "gfx.canvas.skiagl.cache-size", CanvasSkiaGLCacheSize, int32_t, 96);
DECL_GFX_PREF(Once, "gfx.canvas.skiagl.dynamic-cache", CanvasSkiaGLDynamicCache, bool, false);

DECL_GFX_PREF(Once, "gfx.compositor.external-window", UseExternalWindow, bool, false);
DECL_GFX_PREF(Once, "gfx.compositor.clear-context", ClearCompoisitorContext, bool, true);

DECL_GFX_PREF(Live, "gfx.color_management.enablev4", CMSEnableV4, bool, false);
DECL_GFX_PREF(Live, "gfx.color_management.mode", CMSMode, int32_t,-1);
Expand Down

0 comments on commit 16bf53c

Please sign in to comment.