From 3d3f7c3274cdfa7cdf875f455ac90eaec796efcc Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Sat, 29 May 2021 00:50:51 +0200 Subject: [PATCH] [DEV] add texture in GC --- .../CompositingGraphicContext.java | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/org/atriasoft/ewol/compositing/CompositingGraphicContext.java b/src/org/atriasoft/ewol/compositing/CompositingGraphicContext.java index e7ebc2c..7529f92 100644 --- a/src/org/atriasoft/ewol/compositing/CompositingGraphicContext.java +++ b/src/org/atriasoft/ewol/compositing/CompositingGraphicContext.java @@ -5,6 +5,7 @@ */ package org.atriasoft.ewol.compositing; +import org.atriasoft.egami.ImageByte; import org.atriasoft.esvg.CapMode; import org.atriasoft.esvg.GraphicContext; import org.atriasoft.esvg.JoinMode; @@ -16,7 +17,7 @@ import org.atriasoft.gale.resource.ResourceTexture2; public class CompositingGraphicContext extends Compositing { GraphicContext context = new GraphicContext(); - private final ResourceTexture2 resourcTexture = null; + private final ResourceTexture2 texture = new ResourceTexture2(); public CompositingGraphicContext() { @@ -67,12 +68,14 @@ public class CompositingGraphicContext extends Compositing { @Override public void flush() { - if (this.resourcTexture == null) { + if (this.texture == null) { Log.warning("texture is null"); return; } - this.resourcTexture.set(this.context.render()); - this.resourcTexture.flush(); + ImageByte img = this.context.render(); + //IOgami.storePNG(new Uri("/home/heero/000000000aaaaplopppp222.png"), img); + this.texture.set(img); + this.texture.flush(); } /** @@ -112,15 +115,15 @@ public class CompositingGraphicContext extends Compositing { * @return tre image registered size */ public Vector2i getRealSize() { - return this.resourcTexture.get().getSize(); + return this.texture.get().getSize(); } public int getRendererId() { - return this.resourcTexture.getRendererId(); + return this.texture.getRendererId(); } public ResourceTexture2 getResourceTexture() { - return this.resourcTexture; + return this.texture; } public float getStrokeWidth() { @@ -130,6 +133,10 @@ public class CompositingGraphicContext extends Compositing { public int getTextHeight() { return this.context.getTextHeight(); } + + public float getTextSize() { + return this.context.getTextSize(); + } /** * Sometimes the user declare an image but not allocate the ressources all the time, this is to know it ..