🪲 Fix some effects on GNOME 48

This commit is contained in:
Simon Schneegans
2025-03-08 13:30:50 +01:00
parent 410fd32052
commit 84cf784080
6 changed files with 31 additions and 35 deletions
+1 -9
View File
@@ -20,9 +20,6 @@ import * as utils from '../utils.js';
// preferences process. They are used only in the creator function of the ShaderFactory
// which is only called within GNOME Shell's process.
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
const St = await utils.importInShellOnly('gi://St');
const GdkPixbuf = await utils.importInShellOnly('gi://GdkPixbuf');
const Cogl = await utils.importInShellOnly('gi://Cogl');
const _ = await utils.importGettext();
@@ -47,12 +44,7 @@ export default class Effect {
this.shaderFactory = new ShaderFactory(Effect.getNick(), (shader) => {
// Create the texture in the first call.
if (!this._fontTexture) {
const fontData = GdkPixbuf.Pixbuf.new_from_resource('/img/matrixFont.png');
this._fontTexture = new St.ImageContent();
this._fontTexture.set_data(
fontData.get_pixels(),
fontData.has_alpha ? Cogl.PixelFormat.RGBA_8888 : Cogl.PixelFormat.RGB_888,
fontData.width, fontData.height, fontData.rowstride);
this._fontTexture = utils.getImageResource('/img/matrixFont.png');
}
// Store uniform locations of newly created shaders.