Bug 1060121 - Make WebGLContext::TexImage2D avoid readback for video elements on Windows. r=jgilbert
authorchiajung hung <chung@mozilla.com>
Sun, 31 Aug 2014 21:00:00 +0200
changeset 224501 e7cd03cbdb5fec89e4a0ddd0c922fee62e6b957b
parent 224500 7fb36560d80c61627e61054fbced90fc30569184
child 224502 e3092e36afb00b285e37e6585e12e24457330925
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert
bugs1060121
milestone34.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1060121 - Make WebGLContext::TexImage2D avoid readback for video elements on Windows. r=jgilbert
gfx/gl/GLBlitHelper.cpp
--- a/gfx/gl/GLBlitHelper.cpp
+++ b/gfx/gl/GLBlitHelper.cpp
@@ -182,16 +182,19 @@ GLBlitHelper::~GLBlitHelper()
     mFBO = 0;
 }
 
 // Allowed to be destructive of state we restore in functions below.
 bool
 GLBlitHelper::InitTexQuadProgram(BlitType target)
 {
     const char kTexBlit_VertShaderSource[] = "\
+        #ifdef GL_ES                                  \n\
+        precision mediump float;                      \n\
+        #endif                                        \n\
         attribute vec2 aPosition;                     \n\
                                                       \n\
         uniform float uYflip;                         \n\
         varying vec2 vTexCoord;                       \n\
                                                       \n\
         void main(void)                               \n\
         {                                             \n\
             vTexCoord = aPosition;                    \n\
@@ -258,16 +261,19 @@ GLBlitHelper::InitTexQuadProgram(BlitTyp
     [B] [1.1643835616438356, 2.017232142857143, 8.862867620416422e-17] [Cr - 128]
 
     For [0,1] instead of [0,255], and to 5 places:
     [R] [1.16438, 0.00000, 1.59603] [ Y - 0.06275]
     [G] = [1.16438, -0.39176, -0.81297] x [Cb - 0.50196]
     [B] [1.16438, 2.01723, 0.00000] [Cr - 0.50196]
     */
     const char kTexYUVPlanarBlit_FragShaderSource[] = "\
+        #ifdef GL_ES                                                        \n\
+        precision mediump float                                             \n\
+        #endif                                                              \n\
         varying vec2 vTexCoord;                                             \n\
         uniform sampler2D uYTexture;                                        \n\
         uniform sampler2D uCbTexture;                                       \n\
         uniform sampler2D uCrTexture;                                       \n\
         uniform vec2 uYTexScale;                                            \n\
         uniform vec2 uCbCrTexScale;                                         \n\
         void main()                                                         \n\
         {                                                                   \n\