diff options
author | Danny Baumann <dannybaumann@web.de> | 2009-03-16 10:18:16 +0100 |
---|---|---|
committer | Danny Baumann <dannybaumann@web.de> | 2009-03-16 10:18:16 +0100 |
commit | 59666304be35773fcb4c9c7eeef40695e6203c8c (patch) | |
tree | 658e5ab592b9e7ab4870b42973be34d66dafdf4c /plugins/opengl/src | |
parent | d8971221a3d271d18879d625aaaf89cc0df9eb63 (diff) | |
download | mobileperf-59666304be35773fcb4c9c7eeef40695e6203c8c.tar.gz mobileperf-59666304be35773fcb4c9c7eeef40695e6203c8c.tar.bz2 |
Whitespace fixes.
Diffstat (limited to 'plugins/opengl/src')
-rw-r--r-- | plugins/opengl/src/fragment.cpp | 23 | ||||
-rw-r--r-- | plugins/opengl/src/matrix.cpp | 2 | ||||
-rw-r--r-- | plugins/opengl/src/paint.cpp | 39 | ||||
-rw-r--r-- | plugins/opengl/src/privates.h | 8 | ||||
-rw-r--r-- | plugins/opengl/src/screen.cpp | 6 | ||||
-rw-r--r-- | plugins/opengl/src/texture.cpp | 11 | ||||
-rw-r--r-- | plugins/opengl/src/window.cpp | 7 |
7 files changed, 48 insertions, 48 deletions
diff --git a/plugins/opengl/src/fragment.cpp b/plugins/opengl/src/fragment.cpp index 3546be3..d964478 100644 --- a/plugins/opengl/src/fragment.cpp +++ b/plugins/opengl/src/fragment.cpp @@ -84,7 +84,7 @@ namespace GLFragment { class HeaderOp { public: - HeaderOp () : type(OpTypeHeaderTemp), name ("") {}; + HeaderOp () : type (OpTypeHeaderTemp), name ("") {}; public: OpType type; CompString name; @@ -93,7 +93,7 @@ namespace GLFragment { class BodyOp { public: BodyOp () : - type(OpTypeData), + type (OpTypeData), data (""), dst (""), src (""), @@ -296,7 +296,7 @@ namespace GLFragment { offset, &colorDone, &blendDone, callBack); - if (bodyOp.dst.compare("output")) + if (bodyOp.dst.compare ("output")) { dataOp.type = OpTypeDataStore; dataOp.data = @@ -486,7 +486,7 @@ namespace GLFragment { addFetchOffsetVariables (BodyOp *op, int index, bool *indices, - CompString *data) + CompString *data) { if (op->type == OpTypeDataOffset) { @@ -780,7 +780,7 @@ namespace GLFragment { FunctionData::addColorOp (const char *dst, const char *src) { BodyOp b; - + b.type = OpTypeColor; b.dst = CompString (dst); b.src = CompString (src); @@ -793,12 +793,12 @@ namespace GLFragment { { BodyOp b; va_list ap; - + b.type = OpTypeData; va_start (ap, str); - b.data = compPrintf(str, ap); + b.data = compPrintf (str, ap); va_end (ap); - + priv->body.push_back (b); } @@ -807,12 +807,12 @@ namespace GLFragment { { BodyOp b; va_list ap; - + b.type = OpTypeDataBlend; va_start (ap, str); - b.data = compPrintf(str, ap); + b.data = compPrintf (str, ap); va_end (ap); - + priv->body.push_back (b); } @@ -824,7 +824,6 @@ namespace GLFragment { CompString validName = name; unsigned int i = 0; - while (findFragmentFunctionWithName (s, validName)) { validName = compPrintf ("%s%d", name, i++); diff --git a/plugins/opengl/src/matrix.cpp b/plugins/opengl/src/matrix.cpp index 2dc7d6f..656afef 100644 --- a/plugins/opengl/src/matrix.cpp +++ b/plugins/opengl/src/matrix.cpp @@ -113,7 +113,7 @@ GLMatrix::reset () memcpy (m, identity, sizeof (m)); } -const float * +const float * GLMatrix::getMatrix () const { return m; diff --git a/plugins/opengl/src/paint.cpp b/plugins/opengl/src/paint.cpp index 376cf4e..458fd4c 100644 --- a/plugins/opengl/src/paint.cpp +++ b/plugins/opengl/src/paint.cpp @@ -49,7 +49,7 @@ GLScreen::glApplyTransform (const GLScreenPaintAttrib &sAttrib, CompOutput *output, GLMatrix *transform) { - WRAPABLE_HND_FUNC(2, glApplyTransform, sAttrib, output, transform) + WRAPABLE_HND_FUNC (2, glApplyTransform, sAttrib, output, transform) transform->translate (sAttrib.xTranslate, sAttrib.yTranslate, @@ -119,7 +119,7 @@ PrivateGLScreen::paintBackground (const CompRegion ®ion, } glVertexPointer (2, GL_FLOAT, sizeof (GLfloat) * 2, data + 2); - + glColor4us (0, 0, 0, 0); glDrawArrays (GL_QUADS, 0, nBox * 4); glColor4usv (defaultColor); @@ -213,9 +213,7 @@ PrivateGLScreen::paintOutputRegion (const GLMatrix &transform, CompWindowList::reverse_iterator rit; unredirectFS = CompositeScreen::get (screen)-> - getOption("unredirect_fullscreen_windows")->value ().b (); - - + getOption ("unredirect_fullscreen_windows")->value ().b (); if (mask & PAINT_SCREEN_TRANSFORMED_MASK) { @@ -233,7 +231,7 @@ PrivateGLScreen::paintOutputRegion (const GLMatrix &transform, if (!(mask & PAINT_SCREEN_NO_OCCLUSION_DETECTION_MASK)) { /* detect occlusions */ - for (rit = pl.rbegin (); rit != pl.rend(); rit++) + for (rit = pl.rbegin (); rit != pl.rend (); rit++) { w = (*rit); gw = GLWindow::get (w); @@ -252,7 +250,7 @@ PrivateGLScreen::paintOutputRegion (const GLMatrix &transform, gw->priv->clip = tmpRegion; odMask = PAINT_WINDOW_OCCLUSION_DETECTION_MASK; - + if ((cScreen->windowPaintOffset ().x () != 0 || cScreen->windowPaintOffset ().x () != 0) && !w->onAllViewports ()) @@ -264,7 +262,7 @@ PrivateGLScreen::paintOutputRegion (const GLMatrix &transform, vTransform = transform; vTransform.translate (offXY.x (), offXY.y (), 0); - gw->priv->clip.translate (-offXY.x (), -offXY. y()); + gw->priv->clip.translate (-offXY.x (), -offXY. y ()); odMask |= PAINT_WINDOW_WITH_OFFSET_MASK; status = gw->glPaint (gw->paintAttrib (), vTransform, @@ -358,7 +356,7 @@ GLScreen::glEnableOutputClipping (const GLMatrix &transform, const CompRegion ®ion, CompOutput *output) { - WRAPABLE_HND_FUNC(3, glEnableOutputClipping, transform, region, output) + WRAPABLE_HND_FUNC (3, glEnableOutputClipping, transform, region, output) GLdouble h = screen->height (); @@ -397,7 +395,7 @@ GLScreen::glEnableOutputClipping (const GLMatrix &transform, void GLScreen::glDisableOutputClipping () { - WRAPABLE_HND_FUNC(4, glDisableOutputClipping) + WRAPABLE_HND_FUNC (4, glDisableOutputClipping) glDisable (GL_CLIP_PLANE0); glDisable (GL_CLIP_PLANE1); @@ -415,8 +413,8 @@ GLScreen::glPaintTransformedOutput (const GLScreenPaintAttrib &sAttrib, CompOutput *output, unsigned int mask) { - WRAPABLE_HND_FUNC(1, glPaintTransformedOutput, sAttrib, transform, - region, output, mask) + WRAPABLE_HND_FUNC (1, glPaintTransformedOutput, sAttrib, transform, + region, output, mask) GLMatrix sTransform = transform; @@ -462,8 +460,8 @@ GLScreen::glPaintOutput (const GLScreenPaintAttrib &sAttrib, CompOutput *output, unsigned int mask) { - WRAPABLE_HND_FUNC_RETURN(0, bool, glPaintOutput, sAttrib, transform, - region, output, mask) + WRAPABLE_HND_FUNC_RETURN (0, bool, glPaintOutput, sAttrib, transform, + region, output, mask) GLMatrix sTransform = transform; @@ -579,7 +577,7 @@ GLScreen::glPaintOutput (const GLScreenPaintAttrib &sAttrib, void GLWindow::glDrawGeometry () { - WRAPABLE_HND_FUNC(4, glDrawGeometry) + WRAPABLE_HND_FUNC (4, glDrawGeometry) int texUnit = priv->geometry.texUnits; int currentTexUnit = 0; @@ -624,7 +622,7 @@ GLWindow::glAddGeometry (const GLTexture::MatrixList &matrix, const CompRegion ®ion, const CompRegion &clip) { - WRAPABLE_HND_FUNC(2, glAddGeometry, matrix, region, clip) + WRAPABLE_HND_FUNC (2, glAddGeometry, matrix, region, clip) BoxRec full; int nMatrix = matrix.size (); @@ -1064,7 +1062,7 @@ GLWindow::glDrawTexture (GLTexture *texture, GLFragment::Attrib &attrib, unsigned int mask) { - WRAPABLE_HND_FUNC(3, glDrawTexture, texture, attrib, mask) + WRAPABLE_HND_FUNC (3, glDrawTexture, texture, attrib, mask) GLTexture::Filter filter; @@ -1090,7 +1088,8 @@ GLWindow::glDraw (const GLMatrix &transform, const CompRegion ®ion, unsigned int mask) { - WRAPABLE_HND_FUNC_RETURN(1, bool, glDraw, transform, fragment, region, mask) + WRAPABLE_HND_FUNC_RETURN (1, bool, glDraw, transform, + fragment, region, mask) const CompRegion reg = (mask & PAINT_WINDOW_TRANSFORMED_MASK) ? infiniteRegion : region; @@ -1108,7 +1107,7 @@ GLWindow::glDraw (const GLMatrix &transform, mask |= PAINT_WINDOW_BLEND_MASK; GLTexture::MatrixList ml (1); - + if (priv->textures.size () == 1) { ml[0] = priv->matrices[0]; @@ -1140,7 +1139,7 @@ GLWindow::glPaint (const GLWindowPaintAttrib &attrib, const CompRegion ®ion, unsigned int mask) { - WRAPABLE_HND_FUNC_RETURN(0, bool, glPaint, attrib, transform, region, mask) + WRAPABLE_HND_FUNC_RETURN (0, bool, glPaint, attrib, transform, region, mask) GLFragment::Attrib fragment (attrib); bool status; diff --git a/plugins/opengl/src/privates.h b/plugins/opengl/src/privates.h index 0d39907..3aebaf0 100644 --- a/plugins/opengl/src/privates.h +++ b/plugins/opengl/src/privates.h @@ -42,7 +42,7 @@ class GLIcon { public: GLIcon () : icon (NULL) {}; - + CompIcon *icon; GLTexture::List textures; }; @@ -135,7 +135,7 @@ class PrivateGLWindow : void resizeNotify (int dx, int dy, int dwidth, int dheight); void moveNotify (int dx, int dy, bool now); void updateFrameRegion (CompRegion ®ion); - + void setWindowMatrix (); void updateWindowRegions (); @@ -148,9 +148,9 @@ class PrivateGLWindow : GLTexture::MatrixList matrices; CompRegion::Vector regions; bool updateReg; - + CompRegion clip; - + bool bindFailed; bool overlayWindow; diff --git a/plugins/opengl/src/screen.cpp b/plugins/opengl/src/screen.cpp index e15dc84..37d1833 100644 --- a/plugins/opengl/src/screen.cpp +++ b/plugins/opengl/src/screen.cpp @@ -624,7 +624,7 @@ frustum (GLfloat *m, c = -(farval + nearval) / ( farval - nearval); d = -(2.0 * farval * nearval) / (farval - nearval); -#define M(row,col) m[col*4+row] +#define M(row,col) m[col * 4 + row] M(0,0) = x; M(0,1) = 0.0f; M(0,2) = a; M(0,3) = 0.0f; M(1,0) = 0.0f; M(1,1) = y; M(1,2) = b; M(1,3) = 0.0f; M(2,0) = 0.0f; M(2,1) = 0.0f; M(2,2) = c; M(2,3) = d; @@ -998,7 +998,7 @@ PrivateGLScreen::paintOutputs (CompOutput::ptrList &outputs, r.height = output->height (); if (lastViewport.x != r.x || - lastViewport.y != r.y || + lastViewport.y != r.y || lastViewport.width != r.width || lastViewport.height != r.height) { @@ -1154,7 +1154,7 @@ GLScreen::defaultIcon () if (!i) return NULL; - + if (!i->width () || !i->height ()) return NULL; diff --git a/plugins/opengl/src/texture.cpp b/plugins/opengl/src/texture.cpp index 3e7b015..5728caa 100644 --- a/plugins/opengl/src/texture.cpp +++ b/plugins/opengl/src/texture.cpp @@ -296,6 +296,7 @@ PrivateTexture::loadImageData (const char *image, rv[0] = t; GLTexture::Matrix matrix = _identity_matrix; + CompOption *opt; GLint internalFormat; GLenum target; bool mipmap; @@ -324,9 +325,11 @@ PrivateTexture::loadImageData (const char *image, glBindTexture (target, t->name ()); - internalFormat = - (GLScreen::get(screen)->getOption ("texture_compression")->value ().b () - && GL::textureCompression ? GL_COMPRESSED_RGBA_ARB : GL_RGBA); + opt = GLScreen::get (screen)->getOption ("texture_compression"); + if (opt->value ().b () && GL::textureCompression) + internalFormat = GL_COMPRESSED_RGBA_ARB; + else + internalFormat = GL_RGBA; glTexImage2D (target, 0, internalFormat, width, height, 0, format, type, image); @@ -482,7 +485,7 @@ TfpTexture::bindPixmapToTexture (Pixmap pixmap, else if (config->textureTargets & GLX_TEXTURE_RECTANGLE_BIT_EXT) target = GLX_TEXTURE_RECTANGLE_EXT; - /* Workaround for broken texture from pixmap implementations, + /* Workaround for broken texture from pixmap implementations, that don't advertise any texture target in the fbconfig. */ if (!target) { diff --git a/plugins/opengl/src/window.cpp b/plugins/opengl/src/window.cpp index 52a4488..c822b51 100644 --- a/plugins/opengl/src/window.cpp +++ b/plugins/opengl/src/window.cpp @@ -32,7 +32,7 @@ GLWindow::GLWindow (CompWindow *w) : priv (new PrivateGLWindow (w, this)) { CompositeWindow *cw = CompositeWindow::get (w); - + priv->paint.opacity = cw->opacity (); priv->paint.brightness = cw->brightness (); priv->paint.saturation = cw->saturation (); @@ -78,7 +78,7 @@ PrivateGLWindow::setWindowMatrix () { if (textures.size () != matrices.size ()) matrices.resize (textures.size ()); - + for (unsigned int i = 0; i < textures.size (); i++) { matrices[i] = textures[i]->matrix (); @@ -206,7 +206,6 @@ PrivateGLWindow::windowNotify (CompWindowNotify n) break; default: break; - } window->windowNotify (n); @@ -321,7 +320,7 @@ GLWindow::getIcon (int width, int height) foreach (GLIcon &icon, priv->icons) if (icon.icon == i) return icon.textures[0]; - + icon.icon = i; icon.textures = GLTexture::imageBufferToTexture ((char *) i->data (), *i); |