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 21 matching lines...) Expand all Loading... |
32 | 32 |
33 namespace WebCore { | 33 namespace WebCore { |
34 | 34 |
35 namespace { | 35 namespace { |
36 | 36 |
37 Platform3DObject objectOrZero(WebGLObject* object) | 37 Platform3DObject objectOrZero(WebGLObject* object) |
38 { | 38 { |
39 return object ? object->object() : 0; | 39 return object ? object->object() : 0; |
40 } | 40 } |
41 | 41 |
42 class WebGLRenderbufferAttachment : public WebGLFramebuffer::WebGLAttachment
{ | 42 class WebGLRenderbufferAttachment FINAL : public WebGLFramebuffer::WebGLAtta
chment { |
43 public: | 43 public: |
44 static PassRefPtr<WebGLFramebuffer::WebGLAttachment> create(WebGLRenderb
uffer*); | 44 static PassRefPtr<WebGLFramebuffer::WebGLAttachment> create(WebGLRenderb
uffer*); |
45 | 45 |
46 private: | 46 private: |
47 WebGLRenderbufferAttachment(WebGLRenderbuffer*); | 47 WebGLRenderbufferAttachment(WebGLRenderbuffer*); |
48 virtual GLsizei width() const; | 48 virtual GLsizei width() const OVERRIDE; |
49 virtual GLsizei height() const; | 49 virtual GLsizei height() const OVERRIDE; |
50 virtual GLenum format() const; | 50 virtual GLenum format() const OVERRIDE; |
51 virtual GLenum type() const; | 51 virtual GLenum type() const OVERRIDE; |
52 virtual WebGLSharedObject* object() const; | 52 virtual WebGLSharedObject* object() const OVERRIDE; |
53 virtual bool isSharedObject(WebGLSharedObject*) const; | 53 virtual bool isSharedObject(WebGLSharedObject*) const OVERRIDE; |
54 virtual bool valid() const; | 54 virtual bool valid() const OVERRIDE; |
55 virtual bool initialized() const; | 55 virtual bool initialized() const OVERRIDE; |
56 virtual void setInitialized(); | 56 virtual void setInitialized() OVERRIDE; |
57 virtual void onDetached(GraphicsContext3D*); | 57 virtual void onDetached(GraphicsContext3D*) OVERRIDE; |
58 virtual void attach(GraphicsContext3D*, GLenum attachment); | 58 virtual void attach(GraphicsContext3D*, GLenum attachment) OVERRIDE; |
59 virtual void unattach(GraphicsContext3D*, GLenum attachment); | 59 virtual void unattach(GraphicsContext3D*, GLenum attachment) OVERRIDE; |
60 | 60 |
61 WebGLRenderbufferAttachment() { }; | 61 WebGLRenderbufferAttachment() { }; |
62 | 62 |
63 RefPtr<WebGLRenderbuffer> m_renderbuffer; | 63 RefPtr<WebGLRenderbuffer> m_renderbuffer; |
64 }; | 64 }; |
65 | 65 |
66 PassRefPtr<WebGLFramebuffer::WebGLAttachment> WebGLRenderbufferAttachment::c
reate(WebGLRenderbuffer* renderbuffer) | 66 PassRefPtr<WebGLFramebuffer::WebGLAttachment> WebGLRenderbufferAttachment::c
reate(WebGLRenderbuffer* renderbuffer) |
67 { | 67 { |
68 return adoptRef(new WebGLRenderbufferAttachment(renderbuffer)); | 68 return adoptRef(new WebGLRenderbufferAttachment(renderbuffer)); |
69 } | 69 } |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 context->framebufferRenderbuffer(GL_FRAMEBUFFER, attachment, GL_REND
ERBUFFER, 0); | 145 context->framebufferRenderbuffer(GL_FRAMEBUFFER, attachment, GL_REND
ERBUFFER, 0); |
146 } | 146 } |
147 } | 147 } |
148 | 148 |
149 GLenum WebGLRenderbufferAttachment::type() const | 149 GLenum WebGLRenderbufferAttachment::type() const |
150 { | 150 { |
151 notImplemented(); | 151 notImplemented(); |
152 return 0; | 152 return 0; |
153 } | 153 } |
154 | 154 |
155 class WebGLTextureAttachment : public WebGLFramebuffer::WebGLAttachment { | 155 class WebGLTextureAttachment FINAL : public WebGLFramebuffer::WebGLAttachmen
t { |
156 public: | 156 public: |
157 static PassRefPtr<WebGLFramebuffer::WebGLAttachment> create(WebGLTexture
*, GLenum target, GLint level); | 157 static PassRefPtr<WebGLFramebuffer::WebGLAttachment> create(WebGLTexture
*, GLenum target, GLint level); |
158 | 158 |
159 private: | 159 private: |
160 WebGLTextureAttachment(WebGLTexture*, GLenum target, GLint level); | 160 WebGLTextureAttachment(WebGLTexture*, GLenum target, GLint level); |
161 virtual GLsizei width() const; | 161 virtual GLsizei width() const OVERRIDE; |
162 virtual GLsizei height() const; | 162 virtual GLsizei height() const OVERRIDE; |
163 virtual GLenum format() const; | 163 virtual GLenum format() const OVERRIDE; |
164 virtual GLenum type() const; | 164 virtual GLenum type() const OVERRIDE; |
165 virtual WebGLSharedObject* object() const; | 165 virtual WebGLSharedObject* object() const OVERRIDE; |
166 virtual bool isSharedObject(WebGLSharedObject*) const; | 166 virtual bool isSharedObject(WebGLSharedObject*) const OVERRIDE; |
167 virtual bool valid() const; | 167 virtual bool valid() const OVERRIDE; |
168 virtual bool initialized() const; | 168 virtual bool initialized() const OVERRIDE; |
169 virtual void setInitialized(); | 169 virtual void setInitialized() OVERRIDE; |
170 virtual void onDetached(GraphicsContext3D*); | 170 virtual void onDetached(GraphicsContext3D*) OVERRIDE; |
171 virtual void attach(GraphicsContext3D*, GLenum attachment); | 171 virtual void attach(GraphicsContext3D*, GLenum attachment) OVERRIDE; |
172 virtual void unattach(GraphicsContext3D*, GLenum attachment); | 172 virtual void unattach(GraphicsContext3D*, GLenum attachment) OVERRIDE; |
173 | 173 |
174 WebGLTextureAttachment() { }; | 174 WebGLTextureAttachment() { }; |
175 | 175 |
176 RefPtr<WebGLTexture> m_texture; | 176 RefPtr<WebGLTexture> m_texture; |
177 GLenum m_target; | 177 GLenum m_target; |
178 GLint m_level; | 178 GLint m_level; |
179 }; | 179 }; |
180 | 180 |
181 PassRefPtr<WebGLFramebuffer::WebGLAttachment> WebGLTextureAttachment::create
(WebGLTexture* texture, GLenum target, GLint level) | 181 PassRefPtr<WebGLFramebuffer::WebGLAttachment> WebGLTextureAttachment::create
(WebGLTexture* texture, GLenum target, GLint level) |
182 { | 182 { |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
637 int index = static_cast<int>(drawBuffer - GL_DRAW_BUFFER0_EXT); | 637 int index = static_cast<int>(drawBuffer - GL_DRAW_BUFFER0_EXT); |
638 ASSERT(index >= 0); | 638 ASSERT(index >= 0); |
639 if (index < static_cast<int>(m_drawBuffers.size())) | 639 if (index < static_cast<int>(m_drawBuffers.size())) |
640 return m_drawBuffers[index]; | 640 return m_drawBuffers[index]; |
641 if (drawBuffer == GL_DRAW_BUFFER0_EXT) | 641 if (drawBuffer == GL_DRAW_BUFFER0_EXT) |
642 return GL_COLOR_ATTACHMENT0; | 642 return GL_COLOR_ATTACHMENT0; |
643 return GL_NONE; | 643 return GL_NONE; |
644 } | 644 } |
645 | 645 |
646 } | 646 } |
OLD | NEW |