[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

senorblanco at chromium.org senorblanco at chromium.org
Wed Dec 22 14:58:27 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit c1db9c8be2aa2f79aa27f17652020d91cf09e6d1
Author: senorblanco at chromium.org <senorblanco at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Oct 26 19:01:19 2010 +0000

    2010-10-22  Stephen White  <senorblanco at chromium.org>
    
            Reviewed by Kenneth Russell.
    
            Implement copy-texture-to-parent-texture API for WebGraphicsContext3DDefaultImpl.
            https://bugs.webkit.org/show_bug.cgi?id=48152
    
            This allows the in-process implementation to do accelerated canvas and
            accelerated compositing together.  It requires some changes landed
            in chromium 63528, so this patch also rolls chromium DEPS to 63722
            (current LKGR).
    
            Covered by fast/canvas/arc360.html, and many more when run with
            --accelerated-compositing and --accelerated-2d-canvas.
    
            * src/WebGraphicsContext3DDefaultImpl.cpp:
            (WebKit::WebGraphicsContext3DDefaultImpl::WebGraphicsContext3DDefaultImpl):
            Add member vars to save the currently-bound texture and for the
            texture-to-texture FBO.
            (WebKit::WebGraphicsContext3DDefaultImpl::~WebGraphicsContext3DDefaultImpl):
            Delete the texture-to-texture FBO on destruction.
    
            (WebKit::WebGraphicsContext3DDefaultImpl::initialize):
            Generate the texture-to-texture FBO.
            (WebKit::WebGraphicsContext3DDefaultImpl::supportsCopyTextureToParentTextureCHROMIUM):
            Check for support of the glGetTexLevelParameteriv function (required
            for this implementation).
            (WebKit::WebGraphicsContext3DDefaultImpl::copyTextureToParentTextureCHROMIUM):
            Implement the extension:  bind the FBO, bind the child texture, then
            do a glCopyTexImage2D() into the parent texture.
            (WebKit::WebGraphicsContext3DDefaultImpl::bindTexture):
            Record the newly-bound texture in m_boundTexture.
            * src/WebGraphicsContext3DDefaultImpl.h:
            Add the two new member variables.
            * src/WebViewImpl.cpp:
            (WebKit::WebViewImpl::graphicsContext3D):
            Make sure the graphics context is reshaped to the correct size on all
            platforms.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70552 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index b610602..1574029 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,42 @@
+2010-10-22  Stephen White  <senorblanco at chromium.org>
+
+        Reviewed by Kenneth Russell.
+
+        Implement copy-texture-to-parent-texture API for WebGraphicsContext3DDefaultImpl.
+        https://bugs.webkit.org/show_bug.cgi?id=48152
+        
+        This allows the in-process implementation to do accelerated canvas and
+        accelerated compositing together.  It requires some changes landed
+        in chromium 63528, so this patch also rolls chromium DEPS to 63722
+        (current LKGR).
+
+        Covered by fast/canvas/arc360.html, and many more when run with
+        --accelerated-compositing and --accelerated-2d-canvas.
+
+        * src/WebGraphicsContext3DDefaultImpl.cpp:
+        (WebKit::WebGraphicsContext3DDefaultImpl::WebGraphicsContext3DDefaultImpl):
+        Add member vars to save the currently-bound texture and for the
+        texture-to-texture FBO.
+        (WebKit::WebGraphicsContext3DDefaultImpl::~WebGraphicsContext3DDefaultImpl):
+        Delete the texture-to-texture FBO on destruction.
+
+        (WebKit::WebGraphicsContext3DDefaultImpl::initialize):
+        Generate the texture-to-texture FBO.
+        (WebKit::WebGraphicsContext3DDefaultImpl::supportsCopyTextureToParentTextureCHROMIUM):
+        Check for support of the glGetTexLevelParameteriv function (required
+        for this implementation).
+        (WebKit::WebGraphicsContext3DDefaultImpl::copyTextureToParentTextureCHROMIUM):
+        Implement the extension:  bind the FBO, bind the child texture, then
+        do a glCopyTexImage2D() into the parent texture.
+        (WebKit::WebGraphicsContext3DDefaultImpl::bindTexture):
+        Record the newly-bound texture in m_boundTexture.
+        * src/WebGraphicsContext3DDefaultImpl.h:
+        Add the two new member variables.
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::graphicsContext3D):
+        Make sure the graphics context is reshaped to the correct size on all
+        platforms.
+
 2010-10-26  Alexey Marinichev  <amarinichev at chromium.org>
 
         Reviewed by Kenneth Russell.
diff --git a/WebKit/chromium/DEPS b/WebKit/chromium/DEPS
index 1a1377d..d797478 100644
--- a/WebKit/chromium/DEPS
+++ b/WebKit/chromium/DEPS
@@ -32,7 +32,7 @@
 
 vars = {
   'chromium_svn': 'http://src.chromium.org/svn/trunk/src',
-  'chromium_rev': '63439'
+  'chromium_rev': '63722'
 }
 
 deps = {
diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp
index cb69d1f..3065c92 100644
--- a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp
+++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp
@@ -79,6 +79,8 @@ WebGraphicsContext3DDefaultImpl::WebGraphicsContext3DDefaultImpl()
     , m_multisampleDepthStencilBuffer(0)
     , m_multisampleColorBuffer(0)
     , m_boundFBO(0)
+    , m_boundTexture(0)
+    , m_copyTextureToParentTextureFBO(0)
 #ifdef FLIP_FRAMEBUFFER_VERTICALLY
     , m_scanline(0)
 #endif
@@ -103,6 +105,7 @@ WebGraphicsContext3DDefaultImpl::~WebGraphicsContext3DDefaultImpl()
                 glDeleteRenderbuffersEXT(1, &m_depthStencilBuffer);
         }
         glDeleteTextures(1, &m_texture);
+        glDeleteFramebuffersEXT(1, &m_copyTextureToParentTextureFBO);
 #ifdef FLIP_FRAMEBUFFER_VERTICALLY
         if (m_scanline)
             delete[] m_scanline;
@@ -173,6 +176,8 @@ bool WebGraphicsContext3DDefaultImpl::initialize(WebGraphicsContext3D::Attribute
         return false;
     }
 
+    glGenFramebuffersEXT(1, &m_copyTextureToParentTextureFBO);
+
     m_initialized = true;
     return true;
 }
@@ -560,12 +565,33 @@ void WebGraphicsContext3DDefaultImpl::unmapTexSubImage2DCHROMIUM(const void* mem
 
 bool WebGraphicsContext3DDefaultImpl::supportsCopyTextureToParentTextureCHROMIUM()
 {
-    // We don't claim support for this extension at this time
-    return false;
+    // This extension requires this desktopGL-only function (GLES2 doesn't
+    // support it), so check for its existence here.
+    return glGetTexLevelParameteriv;
 }
 
 void WebGraphicsContext3DDefaultImpl::copyTextureToParentTextureCHROMIUM(unsigned id, unsigned id2)
 {
+    makeContextCurrent();
+    glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_copyTextureToParentTextureFBO);
+    glFramebufferTexture2DEXT(GL_FRAMEBUFFER,
+                              GL_COLOR_ATTACHMENT0,
+                              GL_TEXTURE_2D,
+                              id,
+                              0); // level
+    glBindTexture(GL_TEXTURE_2D, id2);
+    GLsizei width, height;
+    glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &width);
+    glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &height);
+    glCopyTexImage2D(GL_TEXTURE_2D,
+                     0, // level
+                     GL_RGBA,
+                     0, 0, // x, y
+                     width,
+                     height,
+                     0); // border
+    glBindTexture(GL_TEXTURE_2D, m_boundTexture);
+    glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_boundFBO);
 }
 
 // Helper macros to reduce the amount of code.
@@ -690,7 +716,12 @@ void WebGraphicsContext3DDefaultImpl::bindFramebuffer(unsigned long target, WebG
 
 DELEGATE_TO_GL_2(bindRenderbuffer, BindRenderbufferEXT, unsigned long, WebGLId)
 
-DELEGATE_TO_GL_2(bindTexture, BindTexture, unsigned long, WebGLId)
+void WebGraphicsContext3DDefaultImpl::bindTexture(unsigned long target, WebGLId texture)
+{
+    makeContextCurrent();
+    glBindTexture(target, texture);
+    m_boundTexture = texture;
+}
 
 DELEGATE_TO_GL_4(blendColor, BlendColor, double, double, double, double)
 
diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h
index 124ceac..5eebf12 100644
--- a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h
+++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h
@@ -288,6 +288,12 @@ private:
     // For tracking which FBO is bound
     unsigned int m_boundFBO;
 
+    // For tracking which texture is bound
+    unsigned int m_boundTexture;
+    
+    // FBO used for copying child texture to parent texture.
+    unsigned m_copyTextureToParentTextureFBO;
+
 #ifdef FLIP_FRAMEBUFFER_VERTICALLY
     unsigned char* m_scanline;
     void flipVertically(unsigned char* framebuffer,
diff --git a/WebKit/chromium/src/WebViewImpl.cpp b/WebKit/chromium/src/WebViewImpl.cpp
index a062bd3..9faedac 100644
--- a/WebKit/chromium/src/WebViewImpl.cpp
+++ b/WebKit/chromium/src/WebViewImpl.cpp
@@ -2523,10 +2523,8 @@ WebGraphicsContext3D* WebViewImpl::graphicsContext3D()
         else {
             GraphicsContext3D::Attributes attributes;
             m_temporaryOnscreenGraphicsContext3D = GraphicsContext3D::create(GraphicsContext3D::Attributes(), m_page->chrome(), GraphicsContext3D::RenderDirectlyToHostWindow);
-#if OS(DARWIN)
             if (m_temporaryOnscreenGraphicsContext3D)
                 m_temporaryOnscreenGraphicsContext3D->reshape(std::max(1, m_size.width), std::max(1, m_size.height));
-#endif
             context = m_temporaryOnscreenGraphicsContext3D.get();
         }
         return GraphicsContext3DInternal::extractWebGraphicsContext3D(context);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list