Merge pull request #492 from Schneegans/fix/#480

Remove deprecated use of Clutter.Image
This commit is contained in:
Simon Schneegans
2025-02-12 16:18:26 +01:00
committed by GitHub
4 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -20,7 +20,7 @@ import * as utils from '../utils.js';
// preferences process. They are used only in the creator function of the ShaderFactory // preferences process. They are used only in the creator function of the ShaderFactory
// which is only called within GNOME Shell's process. // which is only called within GNOME Shell's process.
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js'); const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
const Clutter = await utils.importInShellOnly('gi://Clutter'); const St = await utils.importInShellOnly('gi://St');
const GdkPixbuf = await utils.importInShellOnly('gi://GdkPixbuf'); const GdkPixbuf = await utils.importInShellOnly('gi://GdkPixbuf');
const Cogl = await utils.importInShellOnly('gi://Cogl'); const Cogl = await utils.importInShellOnly('gi://Cogl');
@@ -56,7 +56,7 @@ export default class Effect {
// Create the texture in the first call. // Create the texture in the first call.
if (!this._shardTexture) { if (!this._shardTexture) {
const shardData = GdkPixbuf.Pixbuf.new_from_resource('/img/shards.png'); const shardData = GdkPixbuf.Pixbuf.new_from_resource('/img/shards.png');
this._shardTexture = new Clutter.Image(); this._shardTexture = new St.ImageContent();
this._shardTexture.set_data(shardData.get_pixels(), Cogl.PixelFormat.RGB_888, this._shardTexture.set_data(shardData.get_pixels(), Cogl.PixelFormat.RGB_888,
shardData.width, shardData.height, shardData.width, shardData.height,
shardData.rowstride); shardData.rowstride);
+2 -2
View File
@@ -20,7 +20,7 @@ import * as utils from '../utils.js';
// preferences process. They are used only in the creator function of the ShaderFactory // preferences process. They are used only in the creator function of the ShaderFactory
// which is only called within GNOME Shell's process. // which is only called within GNOME Shell's process.
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js'); const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
const Clutter = await utils.importInShellOnly('gi://Clutter'); const St = await utils.importInShellOnly('gi://St');
const GdkPixbuf = await utils.importInShellOnly('gi://GdkPixbuf'); const GdkPixbuf = await utils.importInShellOnly('gi://GdkPixbuf');
const Cogl = await utils.importInShellOnly('gi://Cogl'); const Cogl = await utils.importInShellOnly('gi://Cogl');
@@ -46,7 +46,7 @@ export default class Effect {
// Create the texture in the first call. // Create the texture in the first call.
if (!this._brushTexture) { if (!this._brushTexture) {
const brushData = GdkPixbuf.Pixbuf.new_from_resource('/img/brush.png'); const brushData = GdkPixbuf.Pixbuf.new_from_resource('/img/brush.png');
this._brushTexture = new Clutter.Image(); this._brushTexture = new St.ImageContent();
this._brushTexture.set_data(brushData.get_pixels(), this._brushTexture.set_data(brushData.get_pixels(),
Cogl.PixelFormat.RGBA_8888_PRE, brushData.width, Cogl.PixelFormat.RGBA_8888_PRE, brushData.width,
brushData.height, brushData.rowstride); brushData.height, brushData.rowstride);
+2 -2
View File
@@ -20,7 +20,7 @@ import * as utils from '../utils.js';
// preferences process. They are used only in the creator function of the ShaderFactory // preferences process. They are used only in the creator function of the ShaderFactory
// which is only called within GNOME Shell's process. // which is only called within GNOME Shell's process.
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js'); const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
const Clutter = await utils.importInShellOnly('gi://Clutter'); const St = await utils.importInShellOnly('gi://St');
const GdkPixbuf = await utils.importInShellOnly('gi://GdkPixbuf'); const GdkPixbuf = await utils.importInShellOnly('gi://GdkPixbuf');
const Cogl = await utils.importInShellOnly('gi://Cogl'); const Cogl = await utils.importInShellOnly('gi://Cogl');
@@ -50,7 +50,7 @@ export default class Effect {
// Create the texture in the first call. // Create the texture in the first call.
if (!this._dustTexture) { if (!this._dustTexture) {
const dustData = GdkPixbuf.Pixbuf.new_from_resource('/img/dust.png'); const dustData = GdkPixbuf.Pixbuf.new_from_resource('/img/dust.png');
this._dustTexture = new Clutter.Image(); this._dustTexture = new St.ImageContent();
this._dustTexture.set_data(dustData.get_pixels(), Cogl.PixelFormat.RGB_888, this._dustTexture.set_data(dustData.get_pixels(), Cogl.PixelFormat.RGB_888,
dustData.width, dustData.height, dustData.rowstride); dustData.width, dustData.height, dustData.rowstride);
} }
+2 -2
View File
@@ -20,7 +20,7 @@ import * as utils from '../utils.js';
// preferences process. They are used only in the creator function of the ShaderFactory // preferences process. They are used only in the creator function of the ShaderFactory
// which is only called within GNOME Shell's process. // which is only called within GNOME Shell's process.
const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js'); const ShaderFactory = await utils.importInShellOnly('./ShaderFactory.js');
const Clutter = await utils.importInShellOnly('gi://Clutter'); const St = await utils.importInShellOnly('gi://St');
const GdkPixbuf = await utils.importInShellOnly('gi://GdkPixbuf'); const GdkPixbuf = await utils.importInShellOnly('gi://GdkPixbuf');
const Cogl = await utils.importInShellOnly('gi://Cogl'); const Cogl = await utils.importInShellOnly('gi://Cogl');
@@ -46,7 +46,7 @@ export default class Effect {
// Create the texture in the first call. // Create the texture in the first call.
if (!this._clawTexture) { if (!this._clawTexture) {
const clawData = GdkPixbuf.Pixbuf.new_from_resource('/img/claws.png'); const clawData = GdkPixbuf.Pixbuf.new_from_resource('/img/claws.png');
this._clawTexture = new Clutter.Image(); this._clawTexture = new St.ImageContent();
this._clawTexture.set_data(clawData.get_pixels(), Cogl.PixelFormat.RGB_888, this._clawTexture.set_data(clawData.get_pixels(), Cogl.PixelFormat.RGB_888,
clawData.width, clawData.height, clawData.rowstride); clawData.width, clawData.height, clawData.rowstride);
} }