diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2016-05-31 18:14:41 +0300 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2016-05-31 18:15:09 +0300 |
commit | cbfc84aff44b206af76ed380cd5c6ea42bb58f61 (patch) | |
tree | 5af9d4500be1eb62eb6a33a6a671d29833df7eaa /src | |
parent | 62b4dd554ab4df891221b1e43bda5a0f5dc1741a (diff) | |
download | qtlocation-mapboxgl-cbfc84aff44b206af76ed380cd5c6ea42bb58f61.tar.gz |
[core] Use init list for shader attributes
Shader parent object has been safely created, so it is safe to
initialize the *Shader attributes via initialization list.
Diffstat (limited to 'src')
-rw-r--r-- | src/mbgl/shader/collision_box_shader.cpp | 6 | ||||
-rw-r--r-- | src/mbgl/shader/icon_shader.cpp | 8 | ||||
-rw-r--r-- | src/mbgl/shader/line_shader.cpp | 4 | ||||
-rw-r--r-- | src/mbgl/shader/linepattern_shader.cpp | 4 | ||||
-rw-r--r-- | src/mbgl/shader/linesdf_shader.cpp | 4 | ||||
-rw-r--r-- | src/mbgl/shader/sdf_shader.cpp | 8 |
6 files changed, 17 insertions, 17 deletions
diff --git a/src/mbgl/shader/collision_box_shader.cpp b/src/mbgl/shader/collision_box_shader.cpp index 9d4d37c4cd..a459729c93 100644 --- a/src/mbgl/shader/collision_box_shader.cpp +++ b/src/mbgl/shader/collision_box_shader.cpp @@ -8,9 +8,9 @@ using namespace mbgl; CollisionBoxShader::CollisionBoxShader(gl::GLObjectStore& glObjectStore) - : Shader("collisionbox", shaders::collisionbox::vertex, shaders::collisionbox::fragment, glObjectStore) { - a_extrude = MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_extrude")); - a_data = MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_data")); + : Shader("collisionbox", shaders::collisionbox::vertex, shaders::collisionbox::fragment, glObjectStore) + , a_extrude(MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_extrude"))) + , a_data(MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_data"))) { } void CollisionBoxShader::bind(GLbyte *offset) { diff --git a/src/mbgl/shader/icon_shader.cpp b/src/mbgl/shader/icon_shader.cpp index 2ff653a87c..7c60f07efa 100644 --- a/src/mbgl/shader/icon_shader.cpp +++ b/src/mbgl/shader/icon_shader.cpp @@ -8,10 +8,10 @@ using namespace mbgl; IconShader::IconShader(gl::GLObjectStore& glObjectStore) - : Shader("icon", shaders::icon::vertex, shaders::icon::fragment, glObjectStore) { - a_offset = MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_offset")); - a_data1 = MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_data1")); - a_data2 = MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_data2")); + : Shader("icon", shaders::icon::vertex, shaders::icon::fragment, glObjectStore) + , a_offset(MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_offset"))) + , a_data1(MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_data1"))) + , a_data2(MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_data2"))) { } void IconShader::bind(GLbyte* offset) { diff --git a/src/mbgl/shader/line_shader.cpp b/src/mbgl/shader/line_shader.cpp index c54b3312d8..82c36c2b49 100644 --- a/src/mbgl/shader/line_shader.cpp +++ b/src/mbgl/shader/line_shader.cpp @@ -8,8 +8,8 @@ using namespace mbgl; LineShader::LineShader(gl::GLObjectStore& glObjectStore) - : Shader("line", shaders::line::vertex, shaders::line::fragment, glObjectStore) { - a_data = MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_data")); + : Shader("line", shaders::line::vertex, shaders::line::fragment, glObjectStore) + , a_data(MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_data"))) { } void LineShader::bind(GLbyte* offset) { diff --git a/src/mbgl/shader/linepattern_shader.cpp b/src/mbgl/shader/linepattern_shader.cpp index 40f64ed139..dcb0bf2ff5 100644 --- a/src/mbgl/shader/linepattern_shader.cpp +++ b/src/mbgl/shader/linepattern_shader.cpp @@ -8,8 +8,8 @@ using namespace mbgl; LinepatternShader::LinepatternShader(gl::GLObjectStore& glObjectStore) - : Shader("linepattern", shaders::linepattern::vertex, shaders::linepattern::fragment, glObjectStore) { - a_data = MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_data")); + : Shader("linepattern", shaders::linepattern::vertex, shaders::linepattern::fragment, glObjectStore) + , a_data(MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_data"))) { } void LinepatternShader::bind(GLbyte* offset) { diff --git a/src/mbgl/shader/linesdf_shader.cpp b/src/mbgl/shader/linesdf_shader.cpp index 019634546a..ad4d43013b 100644 --- a/src/mbgl/shader/linesdf_shader.cpp +++ b/src/mbgl/shader/linesdf_shader.cpp @@ -8,8 +8,8 @@ using namespace mbgl; LineSDFShader::LineSDFShader(gl::GLObjectStore& glObjectStore) - : Shader("linesdfpattern", shaders::linesdfpattern::vertex, shaders::linesdfpattern::fragment, glObjectStore) { - a_data = MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_data")); + : Shader("linesdfpattern", shaders::linesdfpattern::vertex, shaders::linesdfpattern::fragment, glObjectStore) + , a_data(MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_data"))) { } void LineSDFShader::bind(GLbyte* offset) { diff --git a/src/mbgl/shader/sdf_shader.cpp b/src/mbgl/shader/sdf_shader.cpp index a972849d3d..25b9f764d7 100644 --- a/src/mbgl/shader/sdf_shader.cpp +++ b/src/mbgl/shader/sdf_shader.cpp @@ -8,10 +8,10 @@ using namespace mbgl; SDFShader::SDFShader(gl::GLObjectStore& glObjectStore) - : Shader("sdf", shaders::sdf::vertex, shaders::sdf::fragment, glObjectStore) { - a_offset = MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_offset")); - a_data1 = MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_data1")); - a_data2 = MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_data2")); + : Shader("sdf", shaders::sdf::vertex, shaders::sdf::fragment, glObjectStore) + , a_offset(MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_offset"))) + , a_data1(MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_data1"))) + , a_data2(MBGL_CHECK_ERROR(glGetAttribLocation(getID(), "a_data2"))) { } void SDFGlyphShader::bind(GLbyte* offset) { |