[TexMap] Improve viewport array access in TextureMapperGL::bindDefaultSurface()
authorzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Apr 2016 06:11:22 +0000 (06:11 +0000)
committerzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Apr 2016 06:11:22 +0000 (06:11 +0000)
https://bugs.webkit.org/show_bug.cgi?id=156159

Reviewed by Antonio Gomes.

* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGL::bindDefaultSurface): Create a reference to the
viewport array in the TextureMapperGLData object. Inline the IntSize constructor
for the object that's passed to createProjectionMatrix(), and use the reference
to access all four elements of the array as necessary.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199045 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp

index ef77663..65a1dec 100644 (file)
@@ -1,5 +1,18 @@
 2016-04-04  Zan Dobersek  <zdobersek@igalia.com>
 
+        [TexMap] Improve viewport array access in TextureMapperGL::bindDefaultSurface()
+        https://bugs.webkit.org/show_bug.cgi?id=156159
+
+        Reviewed by Antonio Gomes.
+
+        * platform/graphics/texmap/TextureMapperGL.cpp:
+        (WebCore::TextureMapperGL::bindDefaultSurface): Create a reference to the
+        viewport array in the TextureMapperGLData object. Inline the IntSize constructor
+        for the object that's passed to createProjectionMatrix(), and use the reference
+        to access all four elements of the array as necessary.
+
+2016-04-04  Zan Dobersek  <zdobersek@igalia.com>
+
         [TexMap] resolveOverlaps() should be passed-in the first Region parameter via a reference
         https://bugs.webkit.org/show_bug.cgi?id=156158
 
index 942218c..f2e6949 100644 (file)
@@ -618,9 +618,9 @@ TextureMapperGL::~TextureMapperGL()
 void TextureMapperGL::bindDefaultSurface()
 {
     m_context3D->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, data().targetFrameBuffer);
-    IntSize viewportSize(data().viewport[2], data().viewport[3]);
-    data().projectionMatrix = createProjectionMatrix(viewportSize, data().PaintFlags & PaintingMirrored);
-    m_context3D->viewport(data().viewport[0], data().viewport[1], viewportSize.width(), viewportSize.height());
+    auto& viewport = data().viewport;
+    data().projectionMatrix = createProjectionMatrix(IntSize(viewport[2], viewport[3]), data().PaintFlags & PaintingMirrored);
+    m_context3D->viewport(viewport[0], viewport[1], viewport[2], viewport[3]);
     m_clipStack.apply(*m_context3D);
     data().currentSurface = nullptr;
 }