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

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

Issue 2389363002: Move special DEPTH_STENCIL attachment logic from command buffers to WebGL1 (Closed)
Patch Set: Created 4 years, 2 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 GLenum attachment, 75 GLenum attachment,
76 GLenum texTarget, 76 GLenum texTarget,
77 WebGLTexture*, 77 WebGLTexture*,
78 GLint level, 78 GLint level,
79 GLint layer); 79 GLint layer);
80 void setAttachmentForBoundFramebuffer(GLenum target, 80 void setAttachmentForBoundFramebuffer(GLenum target,
81 GLenum attachment, 81 GLenum attachment,
82 WebGLRenderbuffer*); 82 WebGLRenderbuffer*);
83 // If an object is attached to the currently bound framebuffer, remove it. 83 // If an object is attached to the currently bound framebuffer, remove it.
84 void removeAttachmentFromBoundFramebuffer(GLenum target, WebGLSharedObject*); 84 void removeAttachmentFromBoundFramebuffer(GLenum target, WebGLSharedObject*);
85 // If a given attachment point for the currently bound framebuffer is not
86 // null, remove the attached object.
87 void removeAttachmentFromBoundFramebuffer(GLenum target, GLenum attachment);
88 WebGLSharedObject* getAttachmentObject(GLenum) const; 85 WebGLSharedObject* getAttachmentObject(GLenum) const;
89 86
90 // WebGL 1 specific: 87 // WebGL 1 specific:
91 // 1) can't allow depth_stencil for depth/stencil attachments, and vice 88 // 1) can't allow depth_stencil for depth/stencil attachments, and vice
92 // versa. 89 // versa.
93 // 2) no conflicting DEPTH/STENCIL/DEPTH_STENCIL attachments. 90 // 2) no conflicting DEPTH/STENCIL/DEPTH_STENCIL attachments.
94 GLenum checkDepthStencilStatus(const char** reason) const; 91 GLenum checkDepthStencilStatus(const char** reason) const;
95 92
96 bool hasEverBeenBound() const { return object() && m_hasEverBeenBound; } 93 bool hasEverBeenBound() const { return object() && m_hasEverBeenBound; }
97 94
(...skipping 20 matching lines...) Expand all
118 115
119 bool hasObject() const override { return m_object != 0; } 116 bool hasObject() const override { return m_object != 0; }
120 void deleteObjectImpl(gpu::gles2::GLES2Interface*) override; 117 void deleteObjectImpl(gpu::gles2::GLES2Interface*) override;
121 118
122 private: 119 private:
123 WebGLAttachment* getAttachment(GLenum attachment) const; 120 WebGLAttachment* getAttachment(GLenum attachment) const;
124 121
125 // Check if the framebuffer is currently bound. 122 // Check if the framebuffer is currently bound.
126 bool isBound(GLenum target) const; 123 bool isBound(GLenum target) const;
127 124
128 // attach 'attachment' at 'attachmentPoint'. 125 // Check if a new drawBuffers call should be issued. This is called when we ad d or remove an attachment.
129 void attach(GLenum target, GLenum attachment, GLenum attachmentPoint); 126 void drawBuffersIfNecessary(bool force);
130 127
131 // Check if a new drawBuffers call should be issued. This is called when we 128 void setAttachmentInternal(GLenum target,
132 // add or remove an attachment. 129 GLenum attachment,
133 void drawBuffersIfNecessary(bool force); 130 GLenum texTarget,
131 WebGLTexture*,
132 GLint level,
133 GLint layer);
134 void setAttachmentInternal(GLenum target,
135 GLenum attachment,
136 WebGLRenderbuffer*);
137 // If a given attachment point for the currently bound framebuffer is not null , remove the attached object.
138 void removeAttachmentInternal(GLenum target, GLenum attachment);
139
140 void commitWebGL1DepthStencilIfConsistent(GLenum target);
134 141
135 GLuint m_object; 142 GLuint m_object;
136 143
137 typedef HeapHashMap<GLenum, Member<WebGLAttachment>> AttachmentMap; 144 typedef HeapHashMap<GLenum, Member<WebGLAttachment>> AttachmentMap;
138 145
139 AttachmentMap m_attachments; 146 AttachmentMap m_attachments;
140 bool m_destructionInProgress; 147 bool m_destructionInProgress;
141 148
142 bool m_hasEverBeenBound; 149 bool m_hasEverBeenBound;
150 bool m_webGL1DepthStencilConsistent;
143 151
144 Vector<GLenum> m_drawBuffers; 152 Vector<GLenum> m_drawBuffers;
145 Vector<GLenum> m_filteredDrawBuffers; 153 Vector<GLenum> m_filteredDrawBuffers;
146 154
147 GLenum m_readBuffer; 155 GLenum m_readBuffer;
148 }; 156 };
149 157
150 } // namespace blink 158 } // namespace blink
151 159
152 #endif // WebGLFramebuffer_h 160 #endif // WebGLFramebuffer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698