Changeset 76814 in webkit
- Timestamp:
- Jan 27, 2011 10:58:53 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r76812 r76814 1 2011-01-26 Zhenyao Mo <zmo@google.com> 2 3 Reviewed by Kenneth Russell. 4 5 shaderSource needs to preserve original source 6 https://bugs.webkit.org/show_bug.cgi?id=52833 7 8 * fast/canvas/webgl/gl-getshadersource-expected.txt: Added. 9 * fast/canvas/webgl/gl-getshadersource.html: Added. 10 1 11 2011-01-27 Philippe Normand <pnormand@igalia.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r76802 r76814 1 2011-01-26 Zhenyao Mo <zmo@google.com> 2 3 Reviewed by Kenneth Russell. 4 5 shaderSource needs to preserve original source 6 https://bugs.webkit.org/show_bug.cgi?id=52833 7 8 Test: fast/canvas/webgl/gl-getshadersource.html 9 10 * html/canvas/WebGLRenderingContext.cpp: 11 (WebCore::WebGLRenderingContext::getShaderParameter): Intercept SHADER_SOURCE_LENGTH. 12 (WebCore::WebGLRenderingContext::getShaderSource): Intercept the call. 13 (WebCore::WebGLRenderingContext::shaderSource): Cache the source. 14 * html/canvas/WebGLShader.cpp: Cache shader source. 15 (WebCore::WebGLShader::WebGLShader): 16 * html/canvas/WebGLShader.h: Ditto. 17 (WebCore::WebGLShader::getSource): 18 (WebCore::WebGLShader::setSource): 19 1 20 2011-01-27 Patrick Gansterer <paroga@webkit.org> 2 21 -
trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp
r76603 r76814 2165 2165 return WebGLGetInfo(static_cast<unsigned int>(value)); 2166 2166 case GraphicsContext3D::INFO_LOG_LENGTH: 2167 m_context->getShaderiv(objectOrZero(shader), pname, &value); 2168 return WebGLGetInfo(value); 2167 2169 case GraphicsContext3D::SHADER_SOURCE_LENGTH: 2168 m_context->getShaderiv(objectOrZero(shader), pname, &value); 2170 value = static_cast<GC3Dint>(shader->getSource().length()); 2171 if (value > 0) 2172 value++; // Includes the null termination character. 2169 2173 return WebGLGetInfo(value); 2170 2174 default: … … 2192 2196 if (!validateWebGLObject(shader)) 2193 2197 return ""; 2194 WebGLStateRestorer(this, false); 2195 return m_context->getShaderSource(objectOrZero(shader)); 2198 return shader->getSource(); 2196 2199 } 2197 2200 … … 2773 2776 if (!validateString(stringWithoutComments)) 2774 2777 return; 2778 shader->setSource(string); 2775 2779 m_context->shaderSource(objectOrZero(shader), stringWithoutComments); 2776 2780 cleanupAfterGraphicsCall(false); -
trunk/Source/WebCore/html/canvas/WebGLShader.cpp
r76603 r76814 42 42 : WebGLObject(ctx) 43 43 , m_type(type) 44 , m_source("") 44 45 { 45 46 setObject(context()->graphicsContext3D()->createShader(type)); -
trunk/Source/WebCore/html/canvas/WebGLShader.h
r75741 r76814 41 41 42 42 GC3Denum getType() const { return m_type; } 43 const String& getSource() const { return m_source; } 44 45 void setSource(const String& source) { m_source = source; } 43 46 44 47 private: … … 50 53 51 54 GC3Denum m_type; 55 String m_source; 52 56 }; 53 57
Note: See TracChangeset
for help on using the changeset viewer.