Title: [149824] trunk/Source/WebCore
Revision
149824
Author
mifen...@rim.com
Date
2013-05-09 11:13:53 -0700 (Thu, 09 May 2013)

Log Message

[BlackBerry] Style updates required based on new check-webkit-style
https://bugs.webkit.org/show_bug.cgi?id=115857

Reviewed by Rob Buis.

Update WebCore/platform/graphics BlackBerry sources
to match check-webkit-style updates.

Internally reviewed by Jakob Petsovits.

* platform/graphics/blackberry/CanvasLayerWebKitThread.cpp:
* platform/graphics/blackberry/GraphicsContext3DBlackBerry.cpp:
(WebCore::GraphicsContext3D::readPixelsIMG):
(WebCore::GraphicsContext3D::paintToCanvas):
* platform/graphics/blackberry/GraphicsLayerBlackBerry.cpp:
(WebCore::GraphicsLayerBlackBerry::updateLayerPosition):
* platform/graphics/blackberry/IntRectBlackBerry.cpp:
(WebCore::IntRect::IntRect):
* platform/graphics/blackberry/LayerCompositingThread.h:
(WTF::::deref):
* platform/graphics/blackberry/LayerFilterRenderer.cpp:
(WebCore::LayerFilterRenderer::initializeSharedGLObjects):
(WebCore::LayerFilterRenderer::actionsForOperations):
(WebCore::LayerFilterRenderer::applyActions):
* platform/graphics/blackberry/LayerRenderer.cpp:
(WebCore::LayerRenderer::setViewport):
(WebCore::LayerRenderer::compositeBuffer):
(WebCore::LayerRenderer::drawColor):
(WebCore::LayerRenderer::compositeLayersRecursive):
* platform/graphics/blackberry/LayerWebKitThread.cpp:
(WebCore::LayerWebKitThread::setFrame):
* platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp:
(WebCore::MediaPlayerPrivate::play):
(WebCore::MediaPlayerPrivate::waitMetadataTimerFired):
* platform/image-decoders/blackberry/JPEGImageDecoder.cpp:
(WebCore::JPEGImageDecoder::JPEGImageDecoder):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (149823 => 149824)


--- trunk/Source/WebCore/ChangeLog	2013-05-09 18:02:34 UTC (rev 149823)
+++ trunk/Source/WebCore/ChangeLog	2013-05-09 18:13:53 UTC (rev 149824)
@@ -5,6 +5,45 @@
 
         Reviewed by Rob Buis.
 
+        Update WebCore/platform/graphics BlackBerry sources
+        to match check-webkit-style updates.
+
+        Internally reviewed by Jakob Petsovits.
+
+        * platform/graphics/blackberry/CanvasLayerWebKitThread.cpp:
+        * platform/graphics/blackberry/GraphicsContext3DBlackBerry.cpp:
+        (WebCore::GraphicsContext3D::readPixelsIMG):
+        (WebCore::GraphicsContext3D::paintToCanvas):
+        * platform/graphics/blackberry/GraphicsLayerBlackBerry.cpp:
+        (WebCore::GraphicsLayerBlackBerry::updateLayerPosition):
+        * platform/graphics/blackberry/IntRectBlackBerry.cpp:
+        (WebCore::IntRect::IntRect):
+        * platform/graphics/blackberry/LayerCompositingThread.h:
+        (WTF::::deref):
+        * platform/graphics/blackberry/LayerFilterRenderer.cpp:
+        (WebCore::LayerFilterRenderer::initializeSharedGLObjects):
+        (WebCore::LayerFilterRenderer::actionsForOperations):
+        (WebCore::LayerFilterRenderer::applyActions):
+        * platform/graphics/blackberry/LayerRenderer.cpp:
+        (WebCore::LayerRenderer::setViewport):
+        (WebCore::LayerRenderer::compositeBuffer):
+        (WebCore::LayerRenderer::drawColor):
+        (WebCore::LayerRenderer::compositeLayersRecursive):
+        * platform/graphics/blackberry/LayerWebKitThread.cpp:
+        (WebCore::LayerWebKitThread::setFrame):
+        * platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp:
+        (WebCore::MediaPlayerPrivate::play):
+        (WebCore::MediaPlayerPrivate::waitMetadataTimerFired):
+        * platform/image-decoders/blackberry/JPEGImageDecoder.cpp:
+        (WebCore::JPEGImageDecoder::JPEGImageDecoder):
+
+2013-05-09  Mike Fenton  <mifen...@rim.com>
+
+        [BlackBerry] Style updates required based on new check-webkit-style
+        https://bugs.webkit.org/show_bug.cgi?id=115857
+
+        Reviewed by Rob Buis.
+
         Update WebCore/platform/network/blackberry
         to match check-webkit-style updates.
 

Modified: trunk/Source/WebCore/platform/graphics/blackberry/CanvasLayerWebKitThread.cpp (149823 => 149824)


--- trunk/Source/WebCore/platform/graphics/blackberry/CanvasLayerWebKitThread.cpp	2013-05-09 18:02:34 UTC (rev 149823)
+++ trunk/Source/WebCore/platform/graphics/blackberry/CanvasLayerWebKitThread.cpp	2013-05-09 18:13:53 UTC (rev 149824)
@@ -18,6 +18,7 @@
 
 #include "config.h"
 #include "CanvasLayerWebKitThread.h"
+
 #include "LayerCompositingThread.h"
 
 #if USE(ACCELERATED_COMPOSITING) && ENABLE(ACCELERATED_2D_CANVAS)

Modified: trunk/Source/WebCore/platform/graphics/blackberry/GraphicsContext3DBlackBerry.cpp (149823 => 149824)


--- trunk/Source/WebCore/platform/graphics/blackberry/GraphicsContext3DBlackBerry.cpp	2013-05-09 18:02:34 UTC (rev 149823)
+++ trunk/Source/WebCore/platform/graphics/blackberry/GraphicsContext3DBlackBerry.cpp	2013-05-09 18:13:53 UTC (rev 149824)
@@ -279,9 +279,9 @@
     // If this ever changes, this code will need to be updated.
 
     // Calculate the strides of our data and canvas
-    unsigned int formatSize = 4; // RGBA UNSIGNED_BYTE
-    unsigned int dataStride = width * formatSize;
-    unsigned int canvasStride = m_currentWidth * formatSize;
+    unsigned formatSize = 4; // RGBA UNSIGNED_BYTE
+    unsigned dataStride = width * formatSize;
+    unsigned canvasStride = m_currentWidth * formatSize;
 
     // If we are using a pack alignment of 8, then we need to align our strides to 8 byte boundaries
     // See: http://en.wikipedia.org/wiki/Data_structure_alignment (computing padding)
@@ -311,10 +311,10 @@
     IntRect canvasRect(0, 0, m_currentWidth, m_currentHeight);
     IntRect nonZeroDataRect = intersection(dataRect, canvasRect);
 
-    unsigned int xDataOffset = x < 0 ? -x * formatSize : 0;
-    unsigned int yDataOffset = y < 0 ? -y * dataStride : 0;
-    unsigned int xCanvasOffset = nonZeroDataRect.x() * formatSize;
-    unsigned int yCanvasOffset = nonZeroDataRect.y() * canvasStride;
+    unsigned xDataOffset = x < 0 ? -x * formatSize : 0;
+    unsigned yDataOffset = y < 0 ? -y * dataStride : 0;
+    unsigned xCanvasOffset = nonZeroDataRect.x() * formatSize;
+    unsigned yCanvasOffset = nonZeroDataRect.y() * canvasStride;
     unsigned char* dst = static_cast<unsigned char*>(data) + xDataOffset + yDataOffset;
     unsigned char* src = "" + xCanvasOffset + yCanvasOffset;
     for (int row = 0; row < nonZeroDataRect.height(); row++) {
@@ -360,7 +360,7 @@
 #endif
 
 void GraphicsContext3D::paintToCanvas(const unsigned char* imagePixels, int imageWidth, int imageHeight, int canvasWidth, int canvasHeight,
-       GraphicsContext* context)
+    GraphicsContext* context)
 {
     FloatRect src(0, 0, canvasWidth, canvasHeight);
     FloatRect dst(0, 0, imageWidth, imageHeight);

Modified: trunk/Source/WebCore/platform/graphics/blackberry/GraphicsLayerBlackBerry.cpp (149823 => 149824)


--- trunk/Source/WebCore/platform/graphics/blackberry/GraphicsLayerBlackBerry.cpp	2013-05-09 18:02:34 UTC (rev 149823)
+++ trunk/Source/WebCore/platform/graphics/blackberry/GraphicsLayerBlackBerry.cpp	2013-05-09 18:13:53 UTC (rev 149824)
@@ -661,8 +661,9 @@
 void GraphicsLayerBlackBerry::updateLayerPosition()
 {
     // Position is offset on the layer by the layer anchor point.
-    FloatPoint layerPosition(m_position.x() + m_anchorPoint.x() * m_size.width(),
-                             m_position.y() + m_anchorPoint.y() * m_size.height());
+    FloatPoint layerPosition(
+        m_position.x() + m_anchorPoint.x() * m_size.width(),
+        m_position.y() + m_anchorPoint.y() * m_size.height());
 
     primaryLayer()->setPosition(layerPosition);
 }

Modified: trunk/Source/WebCore/platform/graphics/blackberry/IntRectBlackBerry.cpp (149823 => 149824)


--- trunk/Source/WebCore/platform/graphics/blackberry/IntRectBlackBerry.cpp	2013-05-09 18:02:34 UTC (rev 149823)
+++ trunk/Source/WebCore/platform/graphics/blackberry/IntRectBlackBerry.cpp	2013-05-09 18:13:53 UTC (rev 149824)
@@ -24,7 +24,7 @@
 namespace WebCore {
 
 IntRect::IntRect(const BlackBerry::Platform::IntRect& rect)
-        : m_location(rect.x(), rect.y()), m_size(rect.width(), rect.height())
+    : m_location(rect.x(), rect.y()), m_size(rect.width(), rect.height())
 {
 }
 

Modified: trunk/Source/WebCore/platform/graphics/blackberry/LayerCompositingThread.h (149823 => 149824)


--- trunk/Source/WebCore/platform/graphics/blackberry/LayerCompositingThread.h	2013-05-09 18:02:34 UTC (rev 149823)
+++ trunk/Source/WebCore/platform/graphics/blackberry/LayerCompositingThread.h	2013-05-09 18:13:53 UTC (rev 149824)
@@ -290,8 +290,8 @@
     if (derefBase()) {
         // Delete on the compositing thread.
         BlackBerry::Platform::GuardedPointerDeleter::deleteOnThread(
-                BlackBerry::Platform::userInterfaceThreadMessageClient(),
-                static_cast<WebCore::LayerCompositingThread*>(this));
+            BlackBerry::Platform::userInterfaceThreadMessageClient(),
+            static_cast<WebCore::LayerCompositingThread*>(this));
     }
 }
 

Modified: trunk/Source/WebCore/platform/graphics/blackberry/LayerFilterRenderer.cpp (149823 => 149824)


--- trunk/Source/WebCore/platform/graphics/blackberry/LayerFilterRenderer.cpp	2013-05-09 18:02:34 UTC (rev 149823)
+++ trunk/Source/WebCore/platform/graphics/blackberry/LayerFilterRenderer.cpp	2013-05-09 18:13:53 UTC (rev 149824)
@@ -353,7 +353,7 @@
         "varying mediump vec2 v_texCoord;\n"\
         "uniform lowp sampler2D s_texture;\n"\
         "uniform highp float u_amount;\n"\
-        #x\
+#x\
         "void main(void)\n { gl_FragColor = shade(texture2D(s_texture, v_texCoord)); }"
 
 #define BLUR_FILTER(x...) \
@@ -364,7 +364,7 @@
         "uniform highp float u_amount;\n"\
         "uniform highp float u_blurSize;\n"\
         "const float pi = 3.1415927;\n"\
-        #x\
+#x\
         "void main(void)\n"\
         "{\n"\
         "vec3 incr;\n"\
@@ -396,9 +396,9 @@
         {
             lowp float amount = 1.0 - u_amount;
             return vec4((0.2126 + 0.7874 * amount) * color.r + (0.7152 - 0.7152 * amount) * color.g + (0.0722 - 0.0722 * amount) * color.b,
-                        (0.2126 - 0.2126 * amount) * color.r + (0.7152 + 0.2848 * amount) * color.g + (0.0722 - 0.0722 * amount) * color.b,
-                        (0.2126 - 0.2126 * amount) * color.r + (0.7152 - 0.7152 * amount) * color.g + (0.0722 + 0.9278 * amount) * color.b,
-                        color.a);
+                (0.2126 - 0.2126 * amount) * color.r + (0.7152 + 0.2848 * amount) * color.g + (0.0722 - 0.0722 * amount) * color.b,
+                (0.2126 - 0.2126 * amount) * color.r + (0.7152 - 0.7152 * amount) * color.g + (0.0722 + 0.9278 * amount) * color.b,
+                color.a);
         }
     );
 
@@ -407,19 +407,19 @@
         {
             lowp float amount = 1.0 - u_amount;
             return vec4((0.393 + 0.607 * amount) * color.r + (0.769 - 0.769 * amount) * color.g + (0.189 - 0.189 * amount) * color.b,
-                        (0.349 - 0.349 * amount) * color.r + (0.686 + 0.314 * amount) * color.g + (0.168 - 0.168 * amount) * color.b,
-                        (0.272 - 0.272 * amount) * color.r + (0.534 - 0.534 * amount) * color.g + (0.131 + 0.869 * amount) * color.b,
-                        color.a);
-         }
+                (0.349 - 0.349 * amount) * color.r + (0.686 + 0.314 * amount) * color.g + (0.168 - 0.168 * amount) * color.b,
+                (0.272 - 0.272 * amount) * color.r + (0.534 - 0.534 * amount) * color.g + (0.131 + 0.869 * amount) * color.b,
+                color.a);
+        }
     );
 
     shaderStrs[LayerData::CSSFilterShaderSaturate] = STANDARD_FILTER(
         lowp vec4 shade(lowp vec4 color)
         {
             return vec4((0.213 + 0.787 * u_amount) * color.r + (0.715 - 0.715 * u_amount) * color.g + (0.072 - 0.072 * u_amount) * color.b,
-                        (0.213 - 0.213 * u_amount) * color.r + (0.715 + 0.285 * u_amount) * color.g + (0.072 - 0.072 * u_amount) * color.b,
-                        (0.213 - 0.213 * u_amount) * color.r + (0.715 - 0.715 * u_amount) * color.g + (0.072 + 0.928 * u_amount) * color.b,
-                        color.a);
+                (0.213 - 0.213 * u_amount) * color.r + (0.715 + 0.285 * u_amount) * color.g + (0.072 - 0.072 * u_amount) * color.b,
+                (0.213 - 0.213 * u_amount) * color.r + (0.715 - 0.715 * u_amount) * color.g + (0.072 + 0.928 * u_amount) * color.b,
+                color.a);
         }
     );
 
@@ -430,9 +430,9 @@
             highp float c = cos(u_amount * pi / 180.0);
             highp float s = sin(u_amount * pi / 180.0);
             return vec4(color.r * (0.213 + c * 0.787 - s * 0.213) + color.g * (0.715 - c * 0.715 - s * 0.715) + color.b * (0.072 - c * 0.072 + s * 0.928),
-                        color.r * (0.213 - c * 0.213 + s * 0.143) + color.g * (0.715 + c * 0.285 + s * 0.140) + color.b * (0.072 - c * 0.072 - s * 0.283),
-                        color.r * (0.213 - c * 0.213 - s * 0.787) +  color.g * (0.715 - c * 0.715 + s * 0.715) + color.b * (0.072 + c * 0.928 + s * 0.072),
-                        color.a);
+                color.r * (0.213 - c * 0.213 + s * 0.143) + color.g * (0.715 + c * 0.285 + s * 0.140) + color.b * (0.072 - c * 0.072 - s * 0.283),
+                color.r * (0.213 - c * 0.213 - s * 0.787) +  color.g * (0.715 - c * 0.715 + s * 0.715) + color.b * (0.072 + c * 0.928 + s * 0.072),
+                color.a);
         }
     );
 
@@ -592,7 +592,7 @@
 Vector<RefPtr<LayerFilterRendererAction> > LayerFilterRenderer::actionsForOperations(LayerRendererSurface* surface, const Vector<RefPtr<FilterOperation> >& ops)
 {
     Vector<RefPtr<LayerFilterRendererAction> > ret;
-    for (unsigned int i = 0; i < ops.size(); ++i) {
+    for (unsigned i = 0; i < ops.size(); ++i) {
         const FilterOperation& operation = *ops[i].get();
         if (operation.getOperationType() == FilterOperation::BLUR && static_cast<const BlurFilterOperation&>(operation).stdDeviation().value() < 0.1)
             continue;
@@ -723,7 +723,7 @@
 
     glBindFramebuffer(GL_FRAMEBUFFER, fbo);
 
-    for (unsigned int i = 0; i < actions.size(); ++i) {
+    for (unsigned i = 0; i < actions.size(); ++i) {
         // NOTE ABOUT PING-PONGING
         // =======================
         // Under OpenGL ES 2.0, we cannot use the fbo we are writting to as a texture, so we need to play ping-pong:

Modified: trunk/Source/WebCore/platform/graphics/blackberry/LayerRenderer.cpp (149823 => 149824)


--- trunk/Source/WebCore/platform/graphics/blackberry/LayerRenderer.cpp	2013-05-09 18:02:34 UTC (rev 149823)
+++ trunk/Source/WebCore/platform/graphics/blackberry/LayerRenderer.cpp	2013-05-09 18:13:53 UTC (rev 149824)
@@ -33,12 +33,11 @@
 #include "config.h"
 
 #if USE(ACCELERATED_COMPOSITING)
-
 #include "LayerRenderer.h"
-#include "LayerRendererClient.h"
 
 #include "LayerCompositingThread.h"
 #include "LayerFilterRenderer.h"
+#include "LayerRendererClient.h"
 #include "TextureCacheCompositingThread.h"
 
 #include <BlackBerryPlatformGraphics.h>
@@ -242,9 +241,9 @@
     m_clipRect = clipRect;
     m_clipRect.intersect(targetRect);
     m_clipRect = FloatRect(-1 + 2 * (m_clipRect.x() - targetRect.x()) / targetRect.width(),
-                           -1 + 2 * (m_clipRect.y() - targetRect.y()) / targetRect.height(),
-                           2 * m_clipRect.width() / targetRect.width(),
-                           2 * m_clipRect.height() / targetRect.height());
+        -1 + 2 * (m_clipRect.y() - targetRect.y()) / targetRect.height(),
+        2 * m_clipRect.width() / targetRect.width(),
+        2 * m_clipRect.height() / targetRect.height());
 
 #if DEBUG_CLIPPING
     printf("LayerRenderer::setViewport() m_visibleRect=(%.2f,%.2f %.2fx%.2f), m_layoutRect=(%d,%d %dx%d), m_contentsSize=(%dx%d), m_viewport=(%d,%d %dx%d), m_scissorRect=(%d,%d %dx%d), m_clipRect=(%.2f,%.2f %.2fx%.2f)\n",
@@ -381,9 +380,9 @@
         return;
 
     FloatQuad vertices(transform.mapPoint(contents.minXMinYCorner()),
-                       transform.mapPoint(contents.minXMaxYCorner()),
-                       transform.mapPoint(contents.maxXMaxYCorner()),
-                       transform.mapPoint(contents.maxXMinYCorner()));
+        transform.mapPoint(contents.minXMaxYCorner()),
+        transform.mapPoint(contents.maxXMaxYCorner()),
+        transform.mapPoint(contents.maxXMinYCorner()));
 
     if (!vertices.boundingBox().intersects(m_clipRect))
         return;
@@ -391,9 +390,8 @@
     if (!contentsOpaque || opacity < 1.0f) {
         glEnable(GL_BLEND);
         glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
-    } else {
+    } else
         glDisable(GL_BLEND);
-    }
 
     if (BlackBerry::Platform::Graphics::lockAndBindBufferGLTexture(buffer, GL_TEXTURE_2D)) {
         const GLES2Program& program = useProgram(LayerProgramRGBA);
@@ -410,9 +408,9 @@
 void LayerRenderer::drawColor(const TransformationMatrix& transform, const FloatRect& contents, const Color& color)
 {
     FloatQuad vertices(transform.mapPoint(contents.minXMinYCorner()),
-                       transform.mapPoint(contents.minXMaxYCorner()),
-                       transform.mapPoint(contents.maxXMaxYCorner()),
-                       transform.mapPoint(contents.maxXMinYCorner()));
+        transform.mapPoint(contents.minXMaxYCorner()),
+        transform.mapPoint(contents.maxXMaxYCorner()),
+        transform.mapPoint(contents.maxXMinYCorner()));
 
     if (!vertices.boundingBox().intersects(m_clipRect))
         return;
@@ -994,7 +992,7 @@
         if (preserves3D && superlayerPreserves3D)
             continue;
 
-         compositeLayersRecursive(sublayer, newStencilValue, clipRect);
+        compositeLayersRecursive(sublayer, newStencilValue, clipRect);
     }
 
     if (stencilClip) {

Modified: trunk/Source/WebCore/platform/graphics/blackberry/LayerWebKitThread.cpp (149823 => 149824)


--- trunk/Source/WebCore/platform/graphics/blackberry/LayerWebKitThread.cpp	2013-05-09 18:02:34 UTC (rev 149823)
+++ trunk/Source/WebCore/platform/graphics/blackberry/LayerWebKitThread.cpp	2013-05-09 18:13:53 UTC (rev 149824)
@@ -393,7 +393,7 @@
 void LayerWebKitThread::setFrame(const FloatRect& rect)
 {
     if (rect == m_frame)
-      return;
+        return;
 
     m_frame = rect;
     setNeedsDisplay();

Modified: trunk/Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp (149823 => 149824)


--- trunk/Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp	2013-05-09 18:02:34 UTC (rev 149823)
+++ trunk/Source/WebCore/platform/graphics/blackberry/MediaPlayerPrivateBlackBerry.cpp	2013-05-09 18:13:53 UTC (rev 149824)
@@ -219,9 +219,8 @@
 
 void MediaPlayerPrivate::play()
 {
-    if (m_platformPlayer) {
+    if (m_platformPlayer)
         m_platformPlayer->play();
-    }
 }
 
 void MediaPlayerPrivate::pause()
@@ -713,9 +712,9 @@
     if (wait == PlatformPlayer::DialogResponse0)
         onPauseNotified();
     else {
-        if (m_platformPlayer->isMetadataReady()) {
+        if (m_platformPlayer->isMetadataReady())
             m_platformPlayer->playWithMetadataReady();
-        } else
+        else
             m_waitMetadataTimer.startOneShot(checkMetadataReadyInterval);
     }
 }

Modified: trunk/Source/WebCore/platform/image-decoders/blackberry/JPEGImageDecoder.cpp (149823 => 149824)


--- trunk/Source/WebCore/platform/image-decoders/blackberry/JPEGImageDecoder.cpp	2013-05-09 18:02:34 UTC (rev 149823)
+++ trunk/Source/WebCore/platform/image-decoders/blackberry/JPEGImageDecoder.cpp	2013-05-09 18:13:53 UTC (rev 149824)
@@ -162,7 +162,7 @@
 }
 
 JPEGImageDecoder::JPEGImageDecoder(ImageSource::AlphaOption alphaOption,
-                                   ImageSource::GammaAndColorProfileOption gammaAndColorProfileOption)
+    ImageSource::GammaAndColorProfileOption gammaAndColorProfileOption)
     : ImageDecoder(alphaOption, gammaAndColorProfileOption)
 {
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to