当前位置: 首页>>代码示例>>Java>>正文


Java GlyphList.getY方法代码示例

本文整理汇总了Java中sun.font.GlyphList.getY方法的典型用法代码示例。如果您正苦于以下问题:Java GlyphList.getY方法的具体用法?Java GlyphList.getY怎么用?Java GlyphList.getY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sun.font.GlyphList的用法示例。


在下文中一共展示了GlyphList.getY方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: enqueueGlyphList

import sun.font.GlyphList; //导入方法依赖的package包/类
private void enqueueGlyphList(final SunGraphics2D sg2d,
                              final GlyphList gl)
{
    // assert rq.lock.isHeldByCurrentThread();
    RenderBuffer buf = rq.getBuffer();
    final int totalGlyphs = gl.getNumGlyphs();
    int glyphBytesRequired = totalGlyphs * BYTES_PER_GLYPH_IMAGE;
    int posBytesRequired =
        gl.usePositions() ? totalGlyphs * BYTES_PER_GLYPH_POSITION : 0;
    int totalBytesRequired = 24 + glyphBytesRequired + posBytesRequired;

    final long[] images = gl.getImages();
    final float glyphListOrigX = gl.getX() + 0.5f;
    final float glyphListOrigY = gl.getY() + 0.5f;

    // make sure the RenderQueue keeps a hard reference to the FontStrike
    // so that the associated glyph images are not disposed while enqueued
    rq.addReference(gl.getStrike());

    if (totalBytesRequired <= buf.capacity()) {
        if (totalBytesRequired > buf.remaining()) {
            // process the queue first and then enqueue the glyphs
            rq.flushNow();
        }
        rq.ensureAlignment(20);
        buf.putInt(DRAW_GLYPH_LIST);
        // enqueue parameters
        buf.putInt(totalGlyphs);
        buf.putInt(createPackedParams(sg2d, gl));
        buf.putFloat(glyphListOrigX);
        buf.putFloat(glyphListOrigY);
        // now enqueue glyph information
        buf.put(images, 0, totalGlyphs);
        if (gl.usePositions()) {
            float[] positions = gl.getPositions();
            buf.put(positions, 0, 2*totalGlyphs);
        }
    } else {
        // queue is too small to accommodate glyphs; perform
        // the operation directly on the queue flushing thread
        rq.flushAndInvokeNow(new Runnable() {
            public void run() {
                drawGlyphList(totalGlyphs, gl.usePositions(),
                              gl.isSubPixPos(), gl.isRGBOrder(),
                              sg2d.lcdTextContrast,
                              glyphListOrigX, glyphListOrigY,
                              images, gl.getPositions());
            }
        });
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:52,代码来源:BufferedTextPipe.java

示例2: enqueueGlyphList

import sun.font.GlyphList; //导入方法依赖的package包/类
private void enqueueGlyphList(final SunGraphics2D sg2d,
                              final GlyphList gl)
{
    // assert rq.lock.isHeldByCurrentThread();
    RenderBuffer buf = rq.getBuffer();
    final int totalGlyphs = gl.getNumGlyphs();
    int glyphBytesRequired = totalGlyphs * BYTES_PER_GLYPH_IMAGE;
    int posBytesRequired =
        gl.usePositions() ? totalGlyphs * BYTES_PER_GLYPH_POSITION : 0;
    int totalBytesRequired = 24 + glyphBytesRequired + posBytesRequired;

    final long[] images = gl.getImages();
    final float glyphListOrigX = gl.getX() + 0.5f;
    final float glyphListOrigY = gl.getY() + 0.5f;

    // make sure the RenderQueue keeps a hard reference to the FontStrike
    // so that the associated glyph images are not disposed while enqueued
    rq.addReference(gl.getStrike());

    if (totalBytesRequired <= buf.capacity()) {
        if (totalBytesRequired > buf.remaining()) {
            // process the queue first and then enqueue the glyphs
            rq.flushNow();
        }
        rq.ensureAlignment(20);
        buf.putInt(DRAW_GLYPH_LIST);
        // enqueue parameters
        buf.putInt(totalGlyphs);
        buf.putInt(createPackedParams(sg2d, gl));
        buf.putFloat(glyphListOrigX);
        buf.putFloat(glyphListOrigY);
        // now enqueue glyph information
        buf.put(images, 0, totalGlyphs);
        if (gl.usePositions()) {
            float[] positions = gl.getPositions();
            buf.put(positions, 0, 2*totalGlyphs);
        }
    } else {
        // queue is too small to accomodate glyphs; perform
        // the operation directly on the queue flushing thread
        rq.flushAndInvokeNow(new Runnable() {
            public void run() {
                drawGlyphList(totalGlyphs, gl.usePositions(),
                              gl.isSubPixPos(), gl.isRGBOrder(),
                              sg2d.lcdTextContrast,
                              glyphListOrigX, glyphListOrigY,
                              images, gl.getPositions());
            }
        });
    }
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:52,代码来源:BufferedTextPipe.java


注:本文中的sun.font.GlyphList.getY方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。