コード例 #1
0
            public void UpdateFromGlyphData(ref GlyphData glyphData)
            {
                if (glyphData.DirtyUnicodeCodePoint)
                {
                    GlyphIndexOrCodePoint = glyphData.UnicodeCodePoint;
                    UpdateFromRenderInfo();
                    return;
                }

                if (glyphData.DirtyPosition)
                {
                    GlyphPosition.X = glyphData.X;
                    GlyphPosition.Y = glyphData.Y;
                }

                if (glyphData.DirtyScale)
                {
                    GlyphScale = GlyphScale * new Vector2(glyphData.ScaleX, glyphData.ScaleY);
                }

                if (glyphData.DirtyColor)
                {
                    GlyphColor = glyphData.Color;
                }
            }
コード例 #2
0
 public void PopulateGlyphData(ref GlyphData glyphData)
 {
     glyphData.UnicodeCodePoint = TextIsShaped ? GlyphCharacter : GlyphIndexOrCodePoint;
     glyphData.Pass             = GlyphShaderPass;
     glyphData.X      = GlyphPosition.X;
     glyphData.Y      = GlyphPosition.Y;
     glyphData.ScaleX = 1.0f;
     glyphData.ScaleY = 1.0f;
     glyphData.Color  = GlyphColor;
     glyphData.ClearDirtyFlags();
 }
コード例 #3
0
 /// <summary>
 /// Executes the glyph shader.
 /// </summary>
 /// <param name="context">The glyph shader contxt in which to execute the shader.</param>
 /// <param name="data">The data for the glyph which is being drawn.</param>
 /// <param name="index">The index of the glyph within its source string.</param>
 public void Execute(ref GlyphShaderContext context, ref GlyphData data, Int32 index)
 {
     if (glyphShaderScopedStack != null)
     {
         foreach (var shader in glyphShaderScopedStack)
         {
             shader.Value.Execute(ref context, ref data, index);
         }
     }
     else if (glyphShaderStack != null)
     {
         foreach (var shader in glyphShaderStack)
         {
             shader.Execute(ref context, ref data, index);
         }
     }
     else if (glyphShader != null)
     {
         glyphShader.Execute(ref context, ref data, index);
     }
 }
コード例 #4
0
            public Boolean ProcessGlyphShaderPass(ref GlyphShaderContext glyphShaderContext, ref GlyphData glyphData, Int32 i, ref Int32 length)
            {
                if (glyphShaderContext.IsValid)
                {
                    PopulateGlyphData(ref glyphData);
                    GlyphShaderPass++;

                    glyphShaderContext.Execute(ref glyphData, glyphShaderContext.SourceOffset + i);

                    UpdateFromGlyphData(ref glyphData);
                    if (glyphData.DirtyUnicodeCodePoint)
                    {
                        length = 0;
                        return(true);
                    }
                }

                GlyphShaderPass = 0;
                return(false);
            }
コード例 #5
0
 /// <summary>
 /// Executes the glyph shader
 /// </summary>
 /// <param name="context">The current glyph shader context.</param>
 /// <param name="data">The data for the glyph being drawn.</param>
 /// <param name="index">The index of the glyph within its source string.</param>
 public abstract void Execute(ref GlyphShaderContext context, ref GlyphData data, Int32 index);
コード例 #6
0
 /// <summary>
 /// Executes the glyph shader.
 /// </summary>
 /// <param name="data">The data for the glyph which is being drawn.</param>
 /// <param name="index">The index of the glyph within its source string.</param>
 public void Execute(ref GlyphData data, Int32 index)
 {
     glyphShader.Execute(ref this, ref data, index);
 }