~thomas-voss/unity-system-compositor/fallback-gracefully-if-hw-api-is-missing-take-2

« back to all changes in this revision

Viewing changes to spinner/eglspinner.cpp

  • Committer: CI Train Bot
  • Author(s): CI Train Bot, Kevin DuBois, Alexandros Frantzis
  • Date: 2016-01-21 17:58:56 UTC
  • mfrom: (200.45.12 0.3)
  • Revision ID: ci-train-bot@canonical.com-20160121175856-m9rosowob03a105o
ReleaseĀ 0.3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
150
150
void uploadTexture (GLuint id, Image& image)
151
151
{
152
152
    glBindTexture(GL_TEXTURE_2D, id);
 
153
    GLint format = GL_RGBA;
 
154
    if (image.bytes_per_pixel == 3)
 
155
        format = GL_RGB;
153
156
 
154
157
    glTexImage2D(GL_TEXTURE_2D,
155
158
                 0,
156
 
                 GL_RGBA,
 
159
                 format,
157
160
                 image.width,
158
161
                 image.height,
159
162
                 0,
160
 
                 GL_RGBA,
 
163
                 format,
161
164
                 GL_UNSIGNED_BYTE,
162
165
                 image.pixel_data);
163
166
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);