| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 virtual void onDetached(GraphicsContext3D*) = 0; | 59 virtual void onDetached(GraphicsContext3D*) = 0; |
| 60 virtual void attach(GraphicsContext3D*, GC3Denum attachment) = 0; | 60 virtual void attach(GraphicsContext3D*, GC3Denum attachment) = 0; |
| 61 virtual void unattach(GraphicsContext3D*, GC3Denum attachment) = 0; | 61 virtual void unattach(GraphicsContext3D*, GC3Denum attachment) = 0; |
| 62 | 62 |
| 63 protected: | 63 protected: |
| 64 WebGLAttachment(); | 64 WebGLAttachment(); |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 virtual ~WebGLFramebuffer(); | 67 virtual ~WebGLFramebuffer(); |
| 68 | 68 |
| 69 static PassRefPtr<WebGLFramebuffer> create(WebGLRenderingContext*); | 69 static PassRefPtr<WebGLFramebuffer> create(WebGLRenderingContextBase*); |
| 70 | 70 |
| 71 void setAttachmentForBoundFramebuffer(GC3Denum attachment, GC3Denum texTarge
t, WebGLTexture*, GC3Dint level); | 71 void setAttachmentForBoundFramebuffer(GC3Denum attachment, GC3Denum texTarge
t, WebGLTexture*, GC3Dint level); |
| 72 void setAttachmentForBoundFramebuffer(GC3Denum attachment, WebGLRenderbuffer
*); | 72 void setAttachmentForBoundFramebuffer(GC3Denum attachment, WebGLRenderbuffer
*); |
| 73 // If an object is attached to the currently bound framebuffer, remove it. | 73 // If an object is attached to the currently bound framebuffer, remove it. |
| 74 void removeAttachmentFromBoundFramebuffer(WebGLSharedObject*); | 74 void removeAttachmentFromBoundFramebuffer(WebGLSharedObject*); |
| 75 // If a given attachment point for the currently bound framebuffer is not nu
ll, remove the attached object. | 75 // If a given attachment point for the currently bound framebuffer is not nu
ll, remove the attached object. |
| 76 void removeAttachmentFromBoundFramebuffer(GC3Denum); | 76 void removeAttachmentFromBoundFramebuffer(GC3Denum); |
| 77 WebGLSharedObject* getAttachmentObject(GC3Denum) const; | 77 WebGLSharedObject* getAttachmentObject(GC3Denum) const; |
| 78 | 78 |
| 79 GC3Denum getColorBufferFormat() const; | 79 GC3Denum getColorBufferFormat() const; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 99 void setHasEverBeenBound() { m_hasEverBeenBound = true; } | 99 void setHasEverBeenBound() { m_hasEverBeenBound = true; } |
| 100 | 100 |
| 101 bool hasStencilBuffer() const; | 101 bool hasStencilBuffer() const; |
| 102 | 102 |
| 103 // Wrapper for drawBuffersEXT/drawBuffersARB to work around a driver bug. | 103 // Wrapper for drawBuffersEXT/drawBuffersARB to work around a driver bug. |
| 104 void drawBuffers(const Vector<GC3Denum>& bufs); | 104 void drawBuffers(const Vector<GC3Denum>& bufs); |
| 105 | 105 |
| 106 GC3Denum getDrawBuffer(GC3Denum); | 106 GC3Denum getDrawBuffer(GC3Denum); |
| 107 | 107 |
| 108 protected: | 108 protected: |
| 109 WebGLFramebuffer(WebGLRenderingContext*); | 109 WebGLFramebuffer(WebGLRenderingContextBase*); |
| 110 | 110 |
| 111 virtual void deleteObjectImpl(GraphicsContext3D*, Platform3DObject); | 111 virtual void deleteObjectImpl(GraphicsContext3D*, Platform3DObject); |
| 112 | 112 |
| 113 private: | 113 private: |
| 114 virtual bool isFramebuffer() const { return true; } | 114 virtual bool isFramebuffer() const { return true; } |
| 115 | 115 |
| 116 WebGLAttachment* getAttachment(GC3Denum) const; | 116 WebGLAttachment* getAttachment(GC3Denum) const; |
| 117 bool isAttachmentComplete(WebGLAttachment* attachedObject, GC3Denum attachme
nt, const char** reason) const; | 117 bool isAttachmentComplete(WebGLAttachment* attachedObject, GC3Denum attachme
nt, const char** reason) const; |
| 118 | 118 |
| 119 // Check if the framebuffer is currently bound. | 119 // Check if the framebuffer is currently bound. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 131 | 131 |
| 132 bool m_hasEverBeenBound; | 132 bool m_hasEverBeenBound; |
| 133 | 133 |
| 134 Vector<GC3Denum> m_drawBuffers; | 134 Vector<GC3Denum> m_drawBuffers; |
| 135 Vector<GC3Denum> m_filteredDrawBuffers; | 135 Vector<GC3Denum> m_filteredDrawBuffers; |
| 136 }; | 136 }; |
| 137 | 137 |
| 138 } // namespace WebCore | 138 } // namespace WebCore |
| 139 | 139 |
| 140 #endif // WebGLFramebuffer_h | 140 #endif // WebGLFramebuffer_h |
| OLD | NEW |