Home | History | Annotate | Download | only in canvas

Lines Matching refs:attachment

60         virtual void attach(blink::WebGraphicsContext3D*, GLenum attachment) OVERRIDE;
61 virtual void unattach(blink::WebGraphicsContext3D*, GLenum attachment) OVERRIDE;
123 void WebGLRenderbufferAttachment::attach(blink::WebGraphicsContext3D* context, GLenum attachment)
126 if (attachment == GC3D_DEPTH_STENCIL_ATTACHMENT_WEBGL && m_renderbuffer->emulatedStencilBuffer()) {
130 context->framebufferRenderbuffer(GL_FRAMEBUFFER, attachment, GL_RENDERBUFFER, object);
134 void WebGLRenderbufferAttachment::unattach(blink::WebGraphicsContext3D* context, GLenum attachment)
136 if (attachment == GC3D_DEPTH_STENCIL_ATTACHMENT_WEBGL) {
140 context->framebufferRenderbuffer(GL_FRAMEBUFFER, attachment, GL_RENDERBUFFER, 0);
168 virtual void attach(blink::WebGraphicsContext3D*, GLenum attachment) OVERRIDE;
169 virtual void unattach(blink::WebGraphicsContext3D*, GLenum attachment) OVERRIDE;
229 void WebGLTextureAttachment::attach(blink::WebGraphicsContext3D* context, GLenum attachment)
232 context->framebufferTexture2D(GL_FRAMEBUFFER, attachment, m_target, object, m_level);
235 void WebGLTextureAttachment::unattach(blink::WebGraphicsContext3D* context, GLenum attachment)
237 if (attachment == GC3D_DEPTH_STENCIL_ATTACHMENT_WEBGL) {
241 context->framebufferTexture2D(GL_FRAMEBUFFER, attachment, m_target, 0, m_level);
297 void WebGLFramebuffer::setAttachmentForBoundFramebuffer(GLenum attachment, GLenum texTarget, WebGLTexture* texture, GLint level)
300 removeAttachmentFromBoundFramebuffer(attachment);
304 m_attachments.add(attachment, WebGLTextureAttachment::create(texture, texTarget, level));
310 void WebGLFramebuffer::setAttachmentForBoundFramebuffer(GLenum attachment, WebGLRenderbuffer* renderbuffer)
313 removeAttachmentFromBoundFramebuffer(attachment);
317 m_attachments.add(attachment, WebGLRenderbufferAttachment::create(renderbuffer));
323 void WebGLFramebuffer::attach(GLenum attachment, GLenum attachmentPoint)
326 WebGLAttachment* attachmentObject = getAttachment(attachment);
331 WebGLSharedObject* WebGLFramebuffer::getAttachmentObject(GLenum attachment) const
335 WebGLAttachment* attachmentObject = getAttachment(attachment);
339 bool WebGLFramebuffer::isAttachmentComplete(WebGLAttachment* attachedObject, GLenum attachment, const char** reason) const
348 if (attachment == GL_DEPTH_ATTACHMENT) {
362 } else if (attachment == GL_STENCIL_ATTACHMENT) {
371 } else if (attachment == GC3D_DEPTH_STENCIL_ATTACHMENT_WEBGL) {
385 } else if (attachment == GL_COLOR_ATTACHMENT0
386 || (context()->extensionEnabled(WebGLDrawBuffersName) && attachment > GL_COLOR_ATTACHMENT0
387 && attachment < static_cast<GLenum>(GL_COLOR_ATTACHMENT0 + context()->maxColorAttachments()))) {
414 *reason = "unknown framebuffer attachment point";
419 *reason = "attachment has a 0 dimension";
425 WebGLFramebuffer::WebGLAttachment* WebGLFramebuffer::getAttachment(GLenum attachment) const
427 const AttachmentMap::const_iterator it = m_attachments.find(attachment);
431 attachment)
437 WebGLAttachment* attachmentObject = getAttachment(attachment);
440 m_attachments.remove(attachment);
442 switch (attachment) {
457 void WebGLFramebuffer::removeAttachmentFromBoundFramebuffer(WebGLSharedObject* attachment)
462 if (!attachment)
470 if (attachmentObject->isSharedObject(attachment)) {
485 WebGLAttachment* attachment = getAttachment(GL_COLOR_ATTACHMENT0);
486 if (!attachment)
488 return attachment->format();
499 WebGLAttachment* attachment = it->value.get();
500 if (!isAttachmentComplete(attachment, it->key, reason))
502 if (!attachment->valid()) {
503 *reason = "attachment is not valid";
506 if (!attachment->format()) {
507 *reason = "attachment is an unsupported format";
522 width = attachment->width();
523 height = attachment->height();
525 if (width != attachment->width() || height != attachment->height()) {
557 WebGLAttachment* attachment = getAttachment(GL_STENCIL_ATTACHMENT);
558 if (!attachment)
559 attachment = getAttachment(GC3D_DEPTH_STENCIL_ATTACHMENT_WEBGL);
560 return attachment && attachment->valid();