| 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 18 matching lines...) Expand all Loading... |
| 29 #include "bindings/core/v8/ScriptWrappable.h" | 29 #include "bindings/core/v8/ScriptWrappable.h" |
| 30 #include "core/html/canvas/WebGLSharedObject.h" | 30 #include "core/html/canvas/WebGLSharedObject.h" |
| 31 #include "wtf/PassRefPtr.h" | 31 #include "wtf/PassRefPtr.h" |
| 32 | 32 |
| 33 namespace blink { | 33 namespace blink { |
| 34 | 34 |
| 35 class WebGLRenderbuffer FINAL : public WebGLSharedObject, public ScriptWrappable
{ | 35 class WebGLRenderbuffer FINAL : public WebGLSharedObject, public ScriptWrappable
{ |
| 36 public: | 36 public: |
| 37 virtual ~WebGLRenderbuffer(); | 37 virtual ~WebGLRenderbuffer(); |
| 38 | 38 |
| 39 static PassRefPtr<WebGLRenderbuffer> create(WebGLRenderingContextBase*); | 39 static PassRefPtrWillBeRawPtr<WebGLRenderbuffer> create(WebGLRenderingContex
tBase*); |
| 40 | 40 |
| 41 void setInternalFormat(GLenum internalformat) | 41 void setInternalFormat(GLenum internalformat) |
| 42 { | 42 { |
| 43 m_internalFormat = internalformat; | 43 m_internalFormat = internalformat; |
| 44 } | 44 } |
| 45 GLenum internalFormat() const { return m_internalFormat; } | 45 GLenum internalFormat() const { return m_internalFormat; } |
| 46 | 46 |
| 47 void setSize(GLsizei width, GLsizei height) | 47 void setSize(GLsizei width, GLsizei height) |
| 48 { | 48 { |
| 49 m_width = width; | 49 m_width = width; |
| 50 m_height = height; | 50 m_height = height; |
| 51 } | 51 } |
| 52 GLsizei width() const { return m_width; } | 52 GLsizei width() const { return m_width; } |
| 53 GLsizei height() const { return m_height; } | 53 GLsizei height() const { return m_height; } |
| 54 | 54 |
| 55 bool hasEverBeenBound() const { return object() && m_hasEverBeenBound; } | 55 bool hasEverBeenBound() const { return object() && m_hasEverBeenBound; } |
| 56 | 56 |
| 57 void setHasEverBeenBound() { m_hasEverBeenBound = true; } | 57 void setHasEverBeenBound() { m_hasEverBeenBound = true; } |
| 58 | 58 |
| 59 void setEmulatedStencilBuffer(PassRefPtr<WebGLRenderbuffer> buffer) { m_emul
atedStencilBuffer = buffer; } | 59 void setEmulatedStencilBuffer(PassRefPtrWillBeRawPtr<WebGLRenderbuffer> buff
er) { m_emulatedStencilBuffer = buffer; } |
| 60 WebGLRenderbuffer* emulatedStencilBuffer() const { return m_emulatedStencilB
uffer.get(); } | 60 WebGLRenderbuffer* emulatedStencilBuffer() const { return m_emulatedStencilB
uffer.get(); } |
| 61 void deleteEmulatedStencilBuffer(blink::WebGraphicsContext3D* context3d); | 61 void deleteEmulatedStencilBuffer(blink::WebGraphicsContext3D* context3d); |
| 62 | 62 |
| 63 virtual void trace(Visitor*) OVERRIDE; |
| 64 |
| 63 protected: | 65 protected: |
| 64 WebGLRenderbuffer(WebGLRenderingContextBase*); | 66 explicit WebGLRenderbuffer(WebGLRenderingContextBase*); |
| 65 | 67 |
| 66 virtual void deleteObjectImpl(blink::WebGraphicsContext3D*, Platform3DObject
) OVERRIDE; | 68 virtual void deleteObjectImpl(blink::WebGraphicsContext3D*, Platform3DObject
) OVERRIDE; |
| 67 | 69 |
| 68 private: | 70 private: |
| 69 virtual bool isRenderbuffer() const OVERRIDE { return true; } | 71 virtual bool isRenderbuffer() const OVERRIDE { return true; } |
| 70 | 72 |
| 71 GLenum m_internalFormat; | 73 GLenum m_internalFormat; |
| 72 GLsizei m_width, m_height; | 74 GLsizei m_width, m_height; |
| 73 | 75 |
| 74 bool m_hasEverBeenBound; | 76 bool m_hasEverBeenBound; |
| 75 | 77 |
| 76 RefPtr<WebGLRenderbuffer> m_emulatedStencilBuffer; | 78 RefPtrWillBeMember<WebGLRenderbuffer> m_emulatedStencilBuffer; |
| 77 }; | 79 }; |
| 78 | 80 |
| 79 } // namespace blink | 81 } // namespace blink |
| 80 | 82 |
| 81 #endif // WebGLRenderbuffer_h | 83 #endif // WebGLRenderbuffer_h |
| OLD | NEW |