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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 static PassRefPtr<WebGLFramebuffer> create(WebGLRenderingContext*); | 64 static PassRefPtr<WebGLFramebuffer> create(WebGLRenderingContext*); |
65 | 65 |
66 void setAttachmentForBoundFramebuffer(GC3Denum attachment, GC3Denum texTarge
t, WebGLTexture*, GC3Dint level); | 66 void setAttachmentForBoundFramebuffer(GC3Denum attachment, GC3Denum texTarge
t, WebGLTexture*, GC3Dint level); |
67 void setAttachmentForBoundFramebuffer(GC3Denum attachment, WebGLRenderbuffer
*); | 67 void setAttachmentForBoundFramebuffer(GC3Denum attachment, WebGLRenderbuffer
*); |
68 // If an object is attached to the currently bound framebuffer, remove it. | 68 // If an object is attached to the currently bound framebuffer, remove it. |
69 void removeAttachmentFromBoundFramebuffer(WebGLSharedObject*); | 69 void removeAttachmentFromBoundFramebuffer(WebGLSharedObject*); |
70 // If a given attachment point for the currently bound framebuffer is not nu
ll, remove the attached object. | 70 // If a given attachment point for the currently bound framebuffer is not nu
ll, remove the attached object. |
71 void removeAttachmentFromBoundFramebuffer(GC3Denum); | 71 void removeAttachmentFromBoundFramebuffer(GC3Denum); |
72 WebGLSharedObject* getAttachmentObject(GC3Denum) const; | 72 WebGLSharedObject* getAttachmentObject(GC3Denum) const; |
73 | 73 |
74 // attach 'attachment' at 'attachmentPoint'. | |
75 void attach(GC3Denum attachment, GC3Denum attachmentPoint); | |
76 | |
77 GC3Denum getColorBufferFormat() const; | 74 GC3Denum getColorBufferFormat() const; |
78 GC3Dsizei getColorBufferWidth() const; | 75 GC3Dsizei getColorBufferWidth() const; |
79 GC3Dsizei getColorBufferHeight() const; | 76 GC3Dsizei getColorBufferHeight() const; |
80 | 77 |
81 // This should always be called before drawArray, drawElements, clear, | 78 // This should always be called before drawArray, drawElements, clear, |
82 // readPixels, copyTexImage2D, copyTexSubImage2D if this framebuffer is | 79 // readPixels, copyTexImage2D, copyTexSubImage2D if this framebuffer is |
83 // currently bound. | 80 // currently bound. |
84 // Return false if the framebuffer is incomplete; otherwise initialize | 81 // Return false if the framebuffer is incomplete; otherwise initialize |
85 // the buffers if they haven't been initialized and | 82 // the buffers if they haven't been initialized and |
86 // needToInitializeAttachments is true. | 83 // needToInitializeAttachments is true. |
(...skipping 20 matching lines...) Expand all Loading... |
107 virtual bool isFramebuffer() const { return true; } | 104 virtual bool isFramebuffer() const { return true; } |
108 | 105 |
109 WebGLAttachment* getAttachment(GC3Denum) const; | 106 WebGLAttachment* getAttachment(GC3Denum) const; |
110 | 107 |
111 // Return false if framebuffer is incomplete. | 108 // Return false if framebuffer is incomplete. |
112 bool initializeAttachments(GraphicsContext3D*, const char** reason); | 109 bool initializeAttachments(GraphicsContext3D*, const char** reason); |
113 | 110 |
114 // Check if the framebuffer is currently bound. | 111 // Check if the framebuffer is currently bound. |
115 bool isBound() const; | 112 bool isBound() const; |
116 | 113 |
| 114 // attach 'attachment' at 'attachmentPoint'. |
| 115 void attach(GC3Denum attachment, GC3Denum attachmentPoint); |
| 116 |
117 typedef WTF::HashMap<GC3Denum, RefPtr<WebGLAttachment> > AttachmentMap; | 117 typedef WTF::HashMap<GC3Denum, RefPtr<WebGLAttachment> > AttachmentMap; |
118 | 118 |
119 AttachmentMap m_attachments; | 119 AttachmentMap m_attachments; |
120 | 120 |
121 bool m_hasEverBeenBound; | 121 bool m_hasEverBeenBound; |
122 }; | 122 }; |
123 | 123 |
124 } // namespace WebCore | 124 } // namespace WebCore |
125 | 125 |
126 #endif // WebGLFramebuffer_h | 126 #endif // WebGLFramebuffer_h |
OLD | NEW |