Пример #1
0
static void
UnmarkAttachment(WebGLFBAttachPoint& attachment)
{
    WebGLFramebufferAttachable* maybe = attachment.Texture();
    if (!maybe)
        maybe = attachment.Renderbuffer();

    if (maybe)
        maybe->UnmarkAttachment(attachment);
}
Пример #2
0
static bool
MatchOrReplaceSize(const WebGLFBAttachPoint& cur, uint32_t* const out_width,
                   uint32_t* const out_height)
{
    if (!cur.HasImage())
        return true;

    uint32_t width;
    uint32_t height;
    cur.Size(&width, &height);

    if (!*out_width) {
        MOZ_ASSERT(!*out_height);
        *out_width = width;
        *out_height = height;
        return true;
    }

    return (width == *out_width &&
            height == *out_height);
}
Пример #3
0
GLenum
WebGLFramebuffer::GetFormatForAttachment(const WebGLFBAttachPoint& attachment) const
{
    MOZ_ASSERT(attachment.IsDefined());
    MOZ_ASSERT(attachment.Texture() || attachment.Renderbuffer());

    if (attachment.Texture()) {
        const WebGLTexture& tex = *attachment.Texture();
        MOZ_ASSERT(tex.HasImageInfoAt(attachment.ImageTarget(), 0));

        const WebGLTexture::ImageInfo& imgInfo = tex.ImageInfoAt(attachment.ImageTarget(),
                                                                 0);
        return imgInfo.EffectiveInternalFormat().get();
    }

    if (attachment.Renderbuffer())
        return attachment.Renderbuffer()->InternalFormat();

    return LOCAL_GL_NONE;
}
Пример #4
0
static bool
AttachmentsDontMatch(const WebGLFBAttachPoint& a, const WebGLFBAttachPoint& b)
{
    if (a.Texture()) {
        return (a.Texture() != b.Texture());
    }

    if (a.Renderbuffer()) {
        return (a.Renderbuffer() != b.Renderbuffer());
    }

    return false;
}
Пример #5
0
static bool
RectsMatch(const WebGLFBAttachPoint& attachment,
           const WebGLRectangleObject& rect)
{
    return attachment.RectangleObject().HasSameDimensionsAs(rect);
}
Пример #6
0
static bool
IsIncomplete(const WebGLFBAttachPoint& cur)
{
    return cur.IsDefined() && !cur.IsComplete();
}