OSDN Git Service

Merge "Shared surface texture"
authorTeng-Hui Zhu <ztenghui@google.com>
Wed, 3 Aug 2011 16:17:48 +0000 (09:17 -0700)
committerAndroid (Google) Code Review <android-gerrit@google.com>
Wed, 3 Aug 2011 16:17:48 +0000 (09:17 -0700)
1  2 
Source/WebCore/platform/graphics/android/ShaderProgram.cpp
Source/WebCore/platform/graphics/android/TilesManager.h

@@@ -342,11 -338,21 +342,22 @@@ void ShaderProgram::drawQuadInternal(Sk
                                       GLint texSampler,
                                       GLenum textureTarget,
                                       GLint position,
 -                                     GLint alpha)
 +                                     GLint alpha,
 +                                     GLint contrast)
  {
      glUseProgram(program);
-     setProjectionMatrix(geometry, projectionMatrixHandle);
+     if (!geometry.isEmpty())
+          setProjectionMatrix(geometry, projectionMatrixHandle);
+     else {
+         TransformationMatrix matrix;
+         // Map x,y from (0,1) to (-1, 1)
+         matrix.scale3d(2, 2, 1);
+         matrix.translate3d(-0.5, -0.5, 0);
+         GLfloat projectionMatrix[16];
+         GLUtils::toGLMatrix(projectionMatrix, matrix);
+         glUniformMatrix4fv(projectionMatrixHandle, 1, GL_FALSE, projectionMatrix);
+     }
  
      glActiveTexture(GL_TEXTURE0);
      glUniform1i(texSampler, 0);
@@@ -150,12 -152,7 +152,11 @@@ public
          m_invertedScreen = invert;
      }
  
 +    void setInvertedScreenContrast(float contrast) {
 +        m_shader.setContrast(contrast);
 +    }
 +
  private:
      TilesManager();
  
      void waitForGenerator()