Changeset 104192 in webkit
- Timestamp:
- Jan 5, 2012 12:02:19 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r104183 r104192 1 2012-01-05 ChangSeok Oh <shivamidow@gmail.com> 2 3 Remove style warning in GraphicsContext3DOpenGL.cpp 4 https://bugs.webkit.org/show_bug.cgi?id=75466 5 6 Reviewed by Kenneth Russell. 7 8 Relocated some headers according to alphabetical order & modified indentation. 9 And used OwnArrayPtr to deal with character array. 10 11 No new tests required. 12 13 * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp: 14 (WebCore::GraphicsContext3D::getString): 15 (WebCore::GraphicsContext3D::releaseShaderCompiler): 16 (WebCore::GraphicsContext3D::getProgramInfoLog): 17 (WebCore::GraphicsContext3D::getShaderiv): 18 (WebCore::GraphicsContext3D::getShaderInfoLog): 19 (WebCore::GraphicsContext3D::getShaderSource): 20 1 21 2012-01-05 Ken Buchanan <kenrb@chromium.org> 2 22 -
trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp
r101578 r104192 26 26 #include "config.h" 27 27 28 #if PLATFORM(QT)29 #include <QtGlobal>30 #endif31 32 28 #if ENABLE(WEBGL) 33 29 34 30 #include "GraphicsContext3D.h" 35 31 36 #include "WebGLObject.h"37 32 #include "CanvasRenderingContext.h" 38 33 #include "Extensions3DOpenGL.h" … … 42 37 #include "ImageData.h" 43 38 #include "NotImplemented.h" 39 #include "WebGLObject.h" 44 40 #include <cstring> 45 41 #include <wtf/ArrayBuffer.h> … … 56 52 #include "OpenGLShims.h" 57 53 #elif PLATFORM(QT) 54 #include <QtGlobal> 58 55 #include <cairo/OpenGLShims.h> 59 56 #endif … … 774 771 { 775 772 makeContextCurrent(); 776 return String( (const char*) ::glGetString(name));773 return String(reinterpret_cast<const char*>(::glGetString(name))); 777 774 } 778 775 … … 888 885 void GraphicsContext3D::releaseShaderCompiler() 889 886 { 890 // FIXME: This is not implemented on desktop OpenGL. We need to have ifdefs for the different GL variants 891 makeContextCurrent(); 892 //::glReleaseShaderCompiler();887 // FIXME: This is not implemented on desktop OpenGL. We need to have ifdefs for the different GL variants. 888 makeContextCurrent(); 889 notImplemented(); 893 890 } 894 891 … … 1246 1243 1247 1244 makeContextCurrent(); 1248 GLint length ;1245 GLint length = 0; 1249 1246 ::glGetProgramiv(program, GL_INFO_LOG_LENGTH, &length); 1250 1247 if (!length) 1251 return ""; 1252 1253 GLsizei size; 1254 GLchar* info = (GLchar*) fastMalloc(length); 1255 1256 ::glGetProgramInfoLog(program, length, &size, info); 1257 String s(info); 1258 fastFree(info); 1259 return s; 1248 return String(); 1249 1250 GLsizei size = 0; 1251 OwnArrayPtr<GLchar> info = adoptArrayPtr(static_cast<GLchar*>(fastMalloc(length))); 1252 ::glGetProgramInfoLog(program, length, &size, info.get()); 1253 1254 return String(info.get()); 1260 1255 } 1261 1256 … … 1275 1270 1276 1271 switch (pname) { 1277 case DELETE_STATUS: 1278 case SHADER_TYPE: 1279 // Let OpenGL handle these. 1280 1281 ::glGetShaderiv(shader, pname, value); 1282 break; 1283 1284 case COMPILE_STATUS: 1285 if (result == m_shaderSourceMap.end()) { 1286 (*value) = static_cast<int>(false); 1287 return; 1288 } 1289 1290 (*value) = static_cast<int>(result->second.isValid); 1291 break; 1292 1293 case INFO_LOG_LENGTH: 1294 if (result == m_shaderSourceMap.end()) { 1295 (*value) = 0; 1296 return; 1297 } 1298 1299 (*value) = getShaderInfoLog(shader).length(); 1300 break; 1301 1302 case SHADER_SOURCE_LENGTH: 1303 (*value) = getShaderSource(shader).length(); 1304 break; 1305 1306 default: 1307 synthesizeGLError(INVALID_ENUM); 1272 case DELETE_STATUS: 1273 case SHADER_TYPE: 1274 ::glGetShaderiv(shader, pname, value); 1275 break; 1276 case COMPILE_STATUS: 1277 if (result == m_shaderSourceMap.end()) { 1278 *value = static_cast<int>(false); 1279 return; 1280 } 1281 *value = static_cast<int>(result->second.isValid); 1282 break; 1283 case INFO_LOG_LENGTH: 1284 if (result == m_shaderSourceMap.end()) { 1285 *value = 0; 1286 return; 1287 } 1288 *value = getShaderInfoLog(shader).length(); 1289 break; 1290 case SHADER_SOURCE_LENGTH: 1291 *value = getShaderSource(shader).length(); 1292 break; 1293 default: 1294 synthesizeGLError(INVALID_ENUM); 1308 1295 } 1309 1296 } … … 1316 1303 1317 1304 HashMap<Platform3DObject, ShaderSourceEntry>::iterator result = m_shaderSourceMap.find(shader); 1318 1319 1305 if (result == m_shaderSourceMap.end()) 1320 return ""; 1321 1322 ShaderSourceEntry entry = result->second; 1323 1324 if (entry.isValid) { 1325 GLint length; 1326 ::glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &length); 1327 if (!length) 1328 return ""; 1329 1330 GLsizei size; 1331 GLchar* info = (GLchar*) fastMalloc(length); 1332 1333 ::glGetShaderInfoLog(shader, length, &size, info); 1334 1335 String s(info); 1336 fastFree(info); 1337 return s; 1338 } else 1339 return entry.log; 1306 return String(); 1307 1308 ShaderSourceEntry entry = result->second; 1309 if (!entry.isValid) 1310 return entry.log; 1311 1312 GLint length = 0; 1313 ::glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &length); 1314 if (!length) 1315 return String(); 1316 1317 GLsizei size = 0; 1318 OwnArrayPtr<GLchar> info = adoptArrayPtr(static_cast<GLchar*>(fastMalloc(length))); 1319 ::glGetShaderInfoLog(shader, length, &size, info.get()); 1320 1321 return String(info.get()); 1340 1322 } 1341 1323 … … 1347 1329 1348 1330 HashMap<Platform3DObject, ShaderSourceEntry>::iterator result = m_shaderSourceMap.find(shader); 1349 1350 1331 if (result == m_shaderSourceMap.end()) 1351 return "";1332 return String(); 1352 1333 1353 1334 return result->second.source;
Note: See TracChangeset
for help on using the changeset viewer.