Chromium Code Reviews| 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 22 matching lines...) Expand all Loading... | |
| 33 | 33 |
| 34 namespace blink { | 34 namespace blink { |
| 35 | 35 |
| 36 class WebGLProgram final : public WebGLSharedPlatform3DObject { | 36 class WebGLProgram final : public WebGLSharedPlatform3DObject { |
| 37 DEFINE_WRAPPERTYPEINFO(); | 37 DEFINE_WRAPPERTYPEINFO(); |
| 38 public: | 38 public: |
| 39 ~WebGLProgram() override; | 39 ~WebGLProgram() override; |
| 40 | 40 |
| 41 static WebGLProgram* create(WebGLRenderingContextBase*); | 41 static WebGLProgram* create(WebGLRenderingContextBase*); |
| 42 | 42 |
| 43 unsigned numActiveAttribLocations(); | |
| 44 GLint getActiveAttribLocation(GLuint index); | |
| 45 | |
| 46 bool isUsingVertexAttrib0(); | |
| 47 | |
| 48 bool linkStatus(); | 43 bool linkStatus(); |
| 49 | 44 |
| 50 unsigned linkCount() const { return m_linkCount; } | 45 unsigned linkCount() const { return m_linkCount; } |
| 51 | 46 |
| 52 // This is to be called everytime after the program is successfully linked. | 47 // This is to be called everytime after the program is successfully linked. |
| 53 // We don't deal with integer overflow here, assuming in reality a program | 48 // We don't deal with integer overflow here, assuming in reality a program |
| 54 // will never be linked so many times. | 49 // will never be linked so many times. |
| 55 // Also, we invalidate the cached program info. | 50 // Also, we invalidate the cached program info. |
| 56 void increaseLinkCount(); | 51 void increaseLinkCount(); |
| 57 | 52 |
| 58 unsigned activeTransformFeedbackCount() const { return m_activeTransformFeed backCount; } | 53 unsigned activeTransformFeedbackCount() const { return m_activeTransformFeed backCount; } |
| 59 void increaseActiveTransformFeedbackCount(); | 54 void increaseActiveTransformFeedbackCount(); |
| 60 void decreaseActiveTransformFeedbackCount(); | 55 void decreaseActiveTransformFeedbackCount(); |
| 61 | 56 |
| 62 WebGLShader* getAttachedShader(GLenum); | 57 WebGLShader* getAttachedShader(GLenum); |
| 63 bool attachShader(WebGLShader*); | 58 bool attachShader(WebGLShader*); |
| 64 bool detachShader(WebGLShader*); | 59 bool detachShader(WebGLShader*); |
| 65 | 60 |
| 66 DECLARE_VIRTUAL_TRACE(); | 61 DECLARE_VIRTUAL_TRACE(); |
| 67 | 62 |
| 68 protected: | 63 protected: |
| 69 explicit WebGLProgram(WebGLRenderingContextBase*); | 64 explicit WebGLProgram(WebGLRenderingContextBase*); |
| 70 | 65 |
| 71 void deleteObjectImpl(WebGraphicsContext3D*, gpu::gles2::GLES2Interface*) ov erride; | 66 void deleteObjectImpl(WebGraphicsContext3D*, gpu::gles2::GLES2Interface*) ov erride; |
| 72 | 67 |
| 73 private: | 68 private: |
| 74 bool isProgram() const override { return true; } | 69 bool isProgram() const override { return true; } |
| 75 | 70 |
| 76 void cacheActiveAttribLocations(WebGraphicsContext3D*, gpu::gles2::GLES2Inte rface*); | 71 void cacheActiveAttribLocations(WebGraphicsContext3D*, gpu::gles2::GLES2Inte rface*); |
|
Ken Russell (switch to Gerrit)
2016/03/19 04:36:04
Should be deleted from header.
danakj
2016/03/21 22:45:13
Done.
| |
| 77 void cacheInfoIfNeeded(); | 72 void cacheInfoIfNeeded(); |
| 78 | 73 |
| 79 Vector<GLint> m_activeAttribLocations; | |
| 80 | |
| 81 GLint m_linkStatus; | 74 GLint m_linkStatus; |
| 82 | 75 |
| 83 // This is used to track whether a WebGLUniformLocation belongs to this | 76 // This is used to track whether a WebGLUniformLocation belongs to this |
| 84 // program or not. | 77 // program or not. |
| 85 unsigned m_linkCount; | 78 unsigned m_linkCount; |
| 86 | 79 |
| 87 // This is used to track the program being used by active transform | 80 // This is used to track the program being used by active transform |
| 88 // feedback objects. | 81 // feedback objects. |
| 89 unsigned m_activeTransformFeedbackCount; | 82 unsigned m_activeTransformFeedbackCount; |
| 90 | 83 |
| 91 Member<WebGLShader> m_vertexShader; | 84 Member<WebGLShader> m_vertexShader; |
| 92 Member<WebGLShader> m_fragmentShader; | 85 Member<WebGLShader> m_fragmentShader; |
| 93 | 86 |
| 94 bool m_infoValid; | 87 bool m_infoValid; |
| 95 }; | 88 }; |
| 96 | 89 |
| 97 } // namespace blink | 90 } // namespace blink |
| 98 | 91 |
| 99 #endif // WebGLProgram_h | 92 #endif // WebGLProgram_h |
| OLD | NEW |