st-shadow: Add a CoglFramebuffer argument

The last patch in the series, this one adapts StShadowHelper
to received a CoglFramebuffer. This is where we first touch
JavaScript with Cogl types, and as such, it depends on the
latest Mutter. Earlier versions of Mutter didn't have its
Mutter-Clutter GIR to generate types for various Cogl types.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/283
This commit is contained in:
Georges Basile Stavracas Neto 2018-10-08 22:33:19 -03:00
parent 09addfc87c
commit 23d6d13d80
No known key found for this signature in database
GPG Key ID: 886C17EE170D1385
3 changed files with 8 additions and 2 deletions

View File

@ -2,6 +2,7 @@
const AccountsService = imports.gi.AccountsService; const AccountsService = imports.gi.AccountsService;
const Cairo = imports.cairo; const Cairo = imports.cairo;
const Cogl = imports.gi.Cogl;
const Clutter = imports.gi.Clutter; const Clutter = imports.gi.Clutter;
const Gio = imports.gi.Gio; const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib; const GLib = imports.gi.GLib;
@ -405,7 +406,9 @@ class ScreenShieldArrow extends St.Bin {
let allocation = this._drawingArea.get_allocation_box(); let allocation = this._drawingArea.get_allocation_box();
let paintOpacity = this._drawingArea.get_paint_opacity(); let paintOpacity = this._drawingArea.get_paint_opacity();
this._shadowHelper.paint(allocation, paintOpacity); let framebuffer = Cogl.get_draw_framebuffer();
this._shadowHelper.paint(framebuffer, allocation, paintOpacity);
} }
this._drawingArea.paint(); this._drawingArea.paint();

View File

@ -276,6 +276,7 @@ st_shadow_helper_free (StShadowHelper *helper)
/** /**
* st_shadow_helper_paint: * st_shadow_helper_paint:
* @helper: a #StShadowHelper * @helper: a #StShadowHelper
* @framebuffer: a #CoglFramebuffer
* @actor_box: the bounding box of the shadow * @actor_box: the bounding box of the shadow
* @paint_opacity: the opacity at which the shadow is painted * @paint_opacity: the opacity at which the shadow is painted
* *
@ -284,11 +285,12 @@ st_shadow_helper_free (StShadowHelper *helper)
*/ */
void void
st_shadow_helper_paint (StShadowHelper *helper, st_shadow_helper_paint (StShadowHelper *helper,
CoglFramebuffer *framebuffer,
ClutterActorBox *actor_box, ClutterActorBox *actor_box,
guint8 paint_opacity) guint8 paint_opacity)
{ {
_st_paint_shadow_with_opacity (helper->shadow, _st_paint_shadow_with_opacity (helper->shadow,
cogl_get_draw_framebuffer (), framebuffer,
helper->pipeline, helper->pipeline,
actor_box, actor_box,
paint_opacity); paint_opacity);

View File

@ -84,6 +84,7 @@ void st_shadow_helper_update (StShadowHelper *helper,
ClutterActor *source); ClutterActor *source);
void st_shadow_helper_paint (StShadowHelper *helper, void st_shadow_helper_paint (StShadowHelper *helper,
CoglFramebuffer *framebuffer,
ClutterActorBox *actor_box, ClutterActorBox *actor_box,
guint8 paint_opacity); guint8 paint_opacity);