Changeset 104192 in webkit


Ignore:
Timestamp:
Jan 5, 2012 12:02:19 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Remove style warning in GraphicsContext3DOpenGL.cpp
https://bugs.webkit.org/show_bug.cgi?id=75466

Patch by ChangSeok Oh <ChangSeok Oh> on 2012-01-05
Reviewed by Kenneth Russell.

Relocated some headers according to alphabetical order & modified indentation.
And used OwnArrayPtr to deal with character array.

No new tests required.

  • platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:

(WebCore::GraphicsContext3D::getString):
(WebCore::GraphicsContext3D::releaseShaderCompiler):
(WebCore::GraphicsContext3D::getProgramInfoLog):
(WebCore::GraphicsContext3D::getShaderiv):
(WebCore::GraphicsContext3D::getShaderInfoLog):
(WebCore::GraphicsContext3D::getShaderSource):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r104183 r104192  
     12012-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
    1212012-01-05  Ken Buchanan <kenrb@chromium.org>
    222
  • trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp

    r101578 r104192  
    2626#include "config.h"
    2727
    28 #if PLATFORM(QT)
    29 #include <QtGlobal>
    30 #endif
    31 
    3228#if ENABLE(WEBGL)
    3329
    3430#include "GraphicsContext3D.h"
    3531
    36 #include "WebGLObject.h"
    3732#include "CanvasRenderingContext.h"
    3833#include "Extensions3DOpenGL.h"
     
    4237#include "ImageData.h"
    4338#include "NotImplemented.h"
     39#include "WebGLObject.h"
    4440#include <cstring>
    4541#include <wtf/ArrayBuffer.h>
     
    5652#include "OpenGLShims.h"
    5753#elif PLATFORM(QT)
     54#include <QtGlobal>
    5855#include <cairo/OpenGLShims.h>
    5956#endif
     
    774771{
    775772    makeContextCurrent();
    776     return String((const char*) ::glGetString(name));
     773    return String(reinterpret_cast<const char*>(::glGetString(name)));
    777774}
    778775
     
    888885void GraphicsContext3D::releaseShaderCompiler()
    889886{
    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();
    893890}
    894891
     
    12461243
    12471244    makeContextCurrent();
    1248     GLint length;
     1245    GLint length = 0;
    12491246    ::glGetProgramiv(program, GL_INFO_LOG_LENGTH, &length);
    12501247    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());
    12601255}
    12611256
     
    12751270   
    12761271    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);
    13081295    }
    13091296}
     
    13161303
    13171304    HashMap<Platform3DObject, ShaderSourceEntry>::iterator result = m_shaderSourceMap.find(shader);
    1318 
    13191305    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());
    13401322}
    13411323
     
    13471329
    13481330    HashMap<Platform3DObject, ShaderSourceEntry>::iterator result = m_shaderSourceMap.find(shader);
    1349 
    13501331    if (result == m_shaderSourceMap.end())
    1351         return "";
     1332        return String();
    13521333
    13531334    return result->second.source;
Note: See TracChangeset for help on using the changeset viewer.