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

vangelis at chromium.org vangelis at chromium.org
Wed Dec 22 14:46:02 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 7899395e6901bbb147c11e5d13788aabd34d81e3
Author: vangelis at chromium.org <vangelis at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Oct 19 19:38:37 2010 +0000

    2010-10-19  Vangelis Kokkevis  <vangelis at chromium.org>
    
            Reviewed by Kenneth Russell.
    
            [chromium] Disable mipmapping for ImageLayer's to prevent memory use and
            performance regression.
            https://bugs.webkit.org/show_bug.cgi?id=47913
    
            This patch is a straight revert of the patch committed with issue 46493
    
            * platform/graphics/chromium/ContentLayerChromium.cpp:
            (WebCore::ContentLayerChromium::SharedValues::SharedValues):
            (WebCore::ContentLayerChromium::updateTextureRect):
            * platform/graphics/chromium/ContentLayerChromium.h:
            (WebCore::ContentLayerChromium::SharedValues::initialized):
            * platform/graphics/chromium/ImageLayerChromium.cpp:
            (WebCore::ImageLayerChromium::updateContents):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70075 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 2699756..82bb0b8 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2010-10-19  Vangelis Kokkevis  <vangelis at chromium.org>
+
+        Reviewed by Kenneth Russell.
+
+        [chromium] Disable mipmapping for ImageLayer's to prevent memory use and
+        performance regression.
+        https://bugs.webkit.org/show_bug.cgi?id=47913
+        
+        This patch is a straight revert of the patch committed with issue 46493
+
+        * platform/graphics/chromium/ContentLayerChromium.cpp:
+        (WebCore::ContentLayerChromium::SharedValues::SharedValues):
+        (WebCore::ContentLayerChromium::updateTextureRect):
+        * platform/graphics/chromium/ContentLayerChromium.h:
+        (WebCore::ContentLayerChromium::SharedValues::initialized):
+        * platform/graphics/chromium/ImageLayerChromium.cpp:
+        (WebCore::ImageLayerChromium::updateContents):
+
 2010-10-18  Zhenyao Mo  <zmo at google.com>
 
         Reviewed by Kenneth Russell.
diff --git a/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp b/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp
index 18c70cc..eba5349 100644
--- a/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp
+++ b/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp
@@ -55,7 +55,6 @@ ContentLayerChromium::SharedValues::SharedValues(GraphicsContext3D* context)
     , m_shaderMatrixLocation(-1)
     , m_shaderAlphaLocation(-1)
     , m_initialized(false)
-    , m_npotSupported(false)
 {
     // Shaders for drawing the layer contents.
     char vertexShaderString[] =
@@ -102,8 +101,6 @@ ContentLayerChromium::SharedValues::SharedValues(GraphicsContext3D* context)
     ASSERT(m_shaderMatrixLocation != -1);
     ASSERT(m_shaderAlphaLocation != -1);
 
-    m_npotSupported = GLC(context, context->getString(GraphicsContext3D::EXTENSIONS).contains("GL_OES_texture_npot"));
-
     m_initialized = true;
 }
 
@@ -294,14 +291,7 @@ void ContentLayerChromium::updateContents()
         updateTextureRect(pixels, bitmapSize, requiredTextureSize, updateRect, textureId);
 }
 
-static inline bool isPowerOfTwo(int x)
-{
-    ASSERT(x >= 0);
-    return !(x & (x-1));
-}
-
-void ContentLayerChromium::updateTextureRect(void* pixels, const IntSize& bitmapSize,
-    const IntSize& requiredTextureSize, const IntRect& updateRect, unsigned textureId, MipmapUse requestMipmap)
+void ContentLayerChromium::updateTextureRect(void* pixels, const IntSize& bitmapSize, const IntSize& requiredTextureSize, const IntRect& updateRect, unsigned textureId)
 {
     if (!pixels)
         return;
@@ -309,26 +299,11 @@ void ContentLayerChromium::updateTextureRect(void* pixels, const IntSize& bitmap
     GraphicsContext3D* context = layerRendererContext();
     context->bindTexture(GraphicsContext3D::TEXTURE_2D, textureId);
 
-    bool generateMipmap = (requestMipmap == useMipmap)
-                          && (layerRenderer()->contentLayerSharedValues()->npotSupported()
-                              || (isPowerOfTwo(updateRect.width()) && isPowerOfTwo(updateRect.height())));
-
     // If the texture id or size changed since last time then we need to tell GL
     // to re-allocate a texture.
     if (m_contentsTexture != textureId || requiredTextureSize != m_allocatedTextureSize) {
         ASSERT(bitmapSize == requiredTextureSize);
         GLC(context, context->texImage2D(GraphicsContext3D::TEXTURE_2D, 0, GraphicsContext3D::RGBA, requiredTextureSize.width(), requiredTextureSize.height(), 0, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, pixels));
-        if (generateMipmap) {
-            GLC(context, context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MIN_FILTER,
-                GraphicsContext3D::LINEAR_MIPMAP_LINEAR));
-            GLC(context, context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MAG_FILTER,
-                GraphicsContext3D::LINEAR));
-        } else {
-            GLC(context, context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MIN_FILTER,
-                 GraphicsContext3D::LINEAR));
-            GLC(context, context->texParameteri(GraphicsContext3D::TEXTURE_2D, GraphicsContext3D::TEXTURE_MAG_FILTER,
-                GraphicsContext3D::LINEAR));
-        }
 
         m_contentsTexture = textureId;
         m_allocatedTextureSize = requiredTextureSize;
@@ -338,9 +313,6 @@ void ContentLayerChromium::updateTextureRect(void* pixels, const IntSize& bitmap
         GLC(context, context->texSubImage2D(GraphicsContext3D::TEXTURE_2D, 0, updateRect.x(), updateRect.y(), updateRect.width(), updateRect.height(), GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, pixels));
     }
 
-    if (generateMipmap)
-        GLC(context, context->generateMipmap(GraphicsContext3D::TEXTURE_2D));
-
     m_dirtyRect.setSize(FloatSize());
     // Large layers always stay dirty, because they need to update when the content rect changes.
     m_contentsDirty = requiresClippedUpdateRect();
diff --git a/WebCore/platform/graphics/chromium/ContentLayerChromium.h b/WebCore/platform/graphics/chromium/ContentLayerChromium.h
index 239c479..32c2c49 100644
--- a/WebCore/platform/graphics/chromium/ContentLayerChromium.h
+++ b/WebCore/platform/graphics/chromium/ContentLayerChromium.h
@@ -63,7 +63,6 @@ public:
         int shaderMatrixLocation() const { return m_shaderMatrixLocation; }
         int shaderAlphaLocation() const { return m_shaderAlphaLocation; }
         int initialized() const { return m_initialized; }
-        bool npotSupported() const { return m_npotSupported; }
 
     private:
         GraphicsContext3D* m_context;
@@ -72,16 +71,13 @@ public:
         int m_shaderMatrixLocation;
         int m_shaderAlphaLocation;
         int m_initialized;
-        bool m_npotSupported;
     };
 
 protected:
     ContentLayerChromium(GraphicsLayerChromium* owner);
 
-    enum MipmapUse {noMipmap, useMipmap};
-
     void updateTextureRect(void* pixels, const IntSize& bitmapSize, const IntSize& requiredTextureSize,
-                           const IntRect& updateRect, unsigned textureId, MipmapUse generateMipmap = noMipmap);
+                           const IntRect& updateRect, unsigned textureId);
 
     virtual void cleanupResources();
     bool requiresClippedUpdateRect() const;
diff --git a/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp b/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp
index 9a5fdd8..afcc98c 100644
--- a/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp
+++ b/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp
@@ -154,7 +154,7 @@ void ImageLayerChromium::updateContents()
     dirtyRect.intersect(IntRect(IntPoint(0, 0), bitmapSize));
 
     if (pixels)
-        updateTextureRect(pixels, bitmapSize, requiredTextureSize,  dirtyRect, textureId, useMipmap);
+        updateTextureRect(pixels, bitmapSize, requiredTextureSize,  dirtyRect, textureId);
 }
 
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list