| 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 13 matching lines...) Expand all Loading... |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #ifndef WebGLProgram_h | 26 #ifndef WebGLProgram_h |
| 27 #define WebGLProgram_h | 27 #define WebGLProgram_h |
| 28 | 28 |
| 29 #include "modules/webgl/WebGLShader.h" | 29 #include "modules/webgl/WebGLShader.h" |
| 30 #include "modules/webgl/WebGLSharedPlatform3DObject.h" | 30 #include "modules/webgl/WebGLSharedPlatform3DObject.h" |
| 31 #include "wtf/PassRefPtr.h" | 31 #include "wtf/PassRefPtr.h" |
| 32 #include "wtf/Vector.h" | 32 #include "wtf/Vector.h" |
| 33 | 33 |
| 34 namespace gpu { |
| 35 namespace gles2 { |
| 36 class GLES2Interface; |
| 37 } |
| 38 } |
| 39 |
| 34 namespace blink { | 40 namespace blink { |
| 35 | 41 |
| 36 class WebGLProgram final : public WebGLSharedPlatform3DObject { | 42 class WebGLProgram final : public WebGLSharedPlatform3DObject { |
| 37 DEFINE_WRAPPERTYPEINFO(); | 43 DEFINE_WRAPPERTYPEINFO(); |
| 38 public: | 44 public: |
| 39 ~WebGLProgram() override; | 45 ~WebGLProgram() override; |
| 40 | 46 |
| 41 static WebGLProgram* create(WebGLRenderingContextBase*); | 47 static WebGLProgram* create(WebGLRenderingContextBase*); |
| 42 | 48 |
| 43 unsigned numActiveAttribLocations(); | 49 unsigned numActiveAttribLocations(); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 66 DECLARE_VIRTUAL_TRACE(); | 72 DECLARE_VIRTUAL_TRACE(); |
| 67 | 73 |
| 68 protected: | 74 protected: |
| 69 explicit WebGLProgram(WebGLRenderingContextBase*); | 75 explicit WebGLProgram(WebGLRenderingContextBase*); |
| 70 | 76 |
| 71 void deleteObjectImpl(WebGraphicsContext3D*) override; | 77 void deleteObjectImpl(WebGraphicsContext3D*) override; |
| 72 | 78 |
| 73 private: | 79 private: |
| 74 bool isProgram() const override { return true; } | 80 bool isProgram() const override { return true; } |
| 75 | 81 |
| 76 void cacheActiveAttribLocations(WebGraphicsContext3D*); | 82 void cacheActiveAttribLocations(WebGraphicsContext3D*, gpu::gles2::GLES2Inte
rface*); |
| 77 void cacheInfoIfNeeded(); | 83 void cacheInfoIfNeeded(); |
| 78 | 84 |
| 79 Vector<GLint> m_activeAttribLocations; | 85 Vector<GLint> m_activeAttribLocations; |
| 80 | 86 |
| 81 GLint m_linkStatus; | 87 GLint m_linkStatus; |
| 82 | 88 |
| 83 // This is used to track whether a WebGLUniformLocation belongs to this | 89 // This is used to track whether a WebGLUniformLocation belongs to this |
| 84 // program or not. | 90 // program or not. |
| 85 unsigned m_linkCount; | 91 unsigned m_linkCount; |
| 86 | 92 |
| 87 // This is used to track the program being used by active transform | 93 // This is used to track the program being used by active transform |
| 88 // feedback objects. | 94 // feedback objects. |
| 89 unsigned m_activeTransformFeedbackCount; | 95 unsigned m_activeTransformFeedbackCount; |
| 90 | 96 |
| 91 Member<WebGLShader> m_vertexShader; | 97 Member<WebGLShader> m_vertexShader; |
| 92 Member<WebGLShader> m_fragmentShader; | 98 Member<WebGLShader> m_fragmentShader; |
| 93 | 99 |
| 94 bool m_infoValid; | 100 bool m_infoValid; |
| 95 }; | 101 }; |
| 96 | 102 |
| 97 } // namespace blink | 103 } // namespace blink |
| 98 | 104 |
| 99 #endif // WebGLProgram_h | 105 #endif // WebGLProgram_h |
| OLD | NEW |