Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(639)

Side by Side Diff: Source/modules/webgl/WebGLFramebuffer.h

Issue 1234883002: [Oilpan] Migrate classes under module/webgl onto oilpan heap (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase & fix webkit test Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 10 matching lines...) Expand all
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #ifndef WebGLFramebuffer_h 26 #ifndef WebGLFramebuffer_h
27 #define WebGLFramebuffer_h 27 #define WebGLFramebuffer_h
28 28
29 #include "modules/webgl/WebGLContextObject.h" 29 #include "modules/webgl/WebGLContextObject.h"
30 #include "modules/webgl/WebGLSharedObject.h" 30 #include "modules/webgl/WebGLSharedObject.h"
31 #include "wtf/PassRefPtr.h"
32 #include "wtf/RefCounted.h"
33 31
34 namespace blink { 32 namespace blink {
35 33
36 class WebGLRenderbuffer; 34 class WebGLRenderbuffer;
37 class WebGLTexture; 35 class WebGLTexture;
38 36
39 class WebGLFramebuffer final : public WebGLContextObject { 37 class WebGLFramebuffer final : public WebGLContextObject {
40 DEFINE_WRAPPERTYPEINFO(); 38 DEFINE_WRAPPERTYPEINFO();
41 public: 39 public:
42 class WebGLAttachment : public RefCountedWillBeGarbageCollectedFinalized<Web GLAttachment> { 40 class WebGLAttachment : public GarbageCollectedFinalized<WebGLAttachment> {
43 public: 41 public:
44 virtual ~WebGLAttachment(); 42 virtual ~WebGLAttachment();
45 43
46 virtual GLsizei width() const = 0; 44 virtual GLsizei width() const = 0;
47 virtual GLsizei height() const = 0; 45 virtual GLsizei height() const = 0;
48 virtual GLenum format() const = 0; 46 virtual GLenum format() const = 0;
49 // For texture attachment, type() returns the type of the attached textu re. 47 // For texture attachment, type() returns the type of the attached textu re.
50 // For renderbuffer attachment, the type of the renderbuffer may vary wi th GL implementation. 48 // For renderbuffer attachment, the type of the renderbuffer may vary wi th GL implementation.
51 // To avoid confusion, it would be better to not implement type() for re nderbuffer attachment and 49 // To avoid confusion, it would be better to not implement type() for re nderbuffer attachment and
52 // we should always use the internalformat of the renderbuffer and avoid using type() API. 50 // we should always use the internalformat of the renderbuffer and avoid using type() API.
53 virtual GLenum type() const = 0; 51 virtual GLenum type() const = 0;
54 virtual WebGLSharedObject* object() const = 0; 52 virtual WebGLSharedObject* object() const = 0;
55 virtual bool isSharedObject(WebGLSharedObject*) const = 0; 53 virtual bool isSharedObject(WebGLSharedObject*) const = 0;
56 virtual bool valid() const = 0; 54 virtual bool valid() const = 0;
57 virtual void onDetached(WebGraphicsContext3D*) = 0; 55 virtual void onDetached(WebGraphicsContext3D*) = 0;
58 virtual void attach(WebGraphicsContext3D*, GLenum target, GLenum attachm ent) = 0; 56 virtual void attach(WebGraphicsContext3D*, GLenum target, GLenum attachm ent) = 0;
59 virtual void unattach(WebGraphicsContext3D*, GLenum target, GLenum attac hment) = 0; 57 virtual void unattach(WebGraphicsContext3D*, GLenum target, GLenum attac hment) = 0;
60 58
61 DEFINE_INLINE_VIRTUAL_TRACE() { } 59 DEFINE_INLINE_VIRTUAL_TRACE() { }
62 60
63 protected: 61 protected:
64 WebGLAttachment(); 62 WebGLAttachment();
65 }; 63 };
66 64
67 ~WebGLFramebuffer() override; 65 ~WebGLFramebuffer() override;
68 66
69 static PassRefPtrWillBeRawPtr<WebGLFramebuffer> create(WebGLRenderingContext Base*); 67 static WebGLFramebuffer* create(WebGLRenderingContextBase*);
70 68
71 Platform3DObject object() const { return m_object; } 69 Platform3DObject object() const { return m_object; }
72 70
73 void setAttachmentForBoundFramebuffer(GLenum target, GLenum attachment, GLen um texTarget, WebGLTexture*, GLint level); 71 void setAttachmentForBoundFramebuffer(GLenum target, GLenum attachment, GLen um texTarget, WebGLTexture*, GLint level);
74 void setAttachmentForBoundFramebuffer(GLenum target, GLenum attachment, WebG LRenderbuffer*); 72 void setAttachmentForBoundFramebuffer(GLenum target, GLenum attachment, WebG LRenderbuffer*);
75 // 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.
76 void removeAttachmentFromBoundFramebuffer(GLenum target, WebGLSharedObject*) ; 74 void removeAttachmentFromBoundFramebuffer(GLenum target, WebGLSharedObject*) ;
77 // 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.
78 void removeAttachmentFromBoundFramebuffer(GLenum target, GLenum attachment); 76 void removeAttachmentFromBoundFramebuffer(GLenum target, GLenum attachment);
79 WebGLSharedObject* getAttachmentObject(GLenum) const; 77 WebGLSharedObject* getAttachmentObject(GLenum) const;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 bool isBound(GLenum target) const; 125 bool isBound(GLenum target) const;
128 126
129 // attach 'attachment' at 'attachmentPoint'. 127 // attach 'attachment' at 'attachmentPoint'.
130 void attach(GLenum target, GLenum attachment, GLenum attachmentPoint); 128 void attach(GLenum target, GLenum attachment, GLenum attachmentPoint);
131 129
132 // Check if a new drawBuffers call should be issued. This is called when we add or remove an attachment. 130 // Check if a new drawBuffers call should be issued. This is called when we add or remove an attachment.
133 void drawBuffersIfNecessary(bool force); 131 void drawBuffersIfNecessary(bool force);
134 132
135 Platform3DObject m_object; 133 Platform3DObject m_object;
136 134
137 typedef WillBeHeapHashMap<GLenum, RefPtrWillBeMember<WebGLAttachment>> Attac hmentMap; 135 typedef HeapHashMap<GLenum, Member<WebGLAttachment>> AttachmentMap;
138 136
139 AttachmentMap m_attachments; 137 AttachmentMap m_attachments;
140 138
141 bool m_hasEverBeenBound; 139 bool m_hasEverBeenBound;
142 140
143 Vector<GLenum> m_drawBuffers; 141 Vector<GLenum> m_drawBuffers;
144 Vector<GLenum> m_filteredDrawBuffers; 142 Vector<GLenum> m_filteredDrawBuffers;
145 143
146 GLenum m_readBuffer; 144 GLenum m_readBuffer;
147 }; 145 };
148 146
149 } // namespace blink 147 } // namespace blink
150 148
151 #endif // WebGLFramebuffer_h 149 #endif // WebGLFramebuffer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698