Title: [116834] trunk/Source/WebCore
Revision
116834
Author
commit-qu...@webkit.org
Date
2012-05-11 19:11:10 -0700 (Fri, 11 May 2012)

Log Message

[TextureMapper] Tiles are not created for large textures
https://bugs.webkit.org/show_bug.cgi?id=86245

Patch by Martin Robinson <mrobin...@igalia.com> on 2012-05-11
Reviewed by Noam Rosenthal.

No new tests. This will not produce any observable behavior changes,
unless run on a machine with a small texture size limit.

The maxTextureSize() method on TextureMapperGL was missing a "const"
keyword, meaning that it was not properly overriding the version in
the abstract base class (TextureMapper). This patch adds the const
modifier and cleans up the list of override methods in the two
TextureMapper sublcasses, adding the OVERRIDE macro for compilers that
support it and removing a couple unused methods.

* platform/graphics/texmap/TextureMapperGL.cpp:
* platform/graphics/texmap/TextureMapperGL.h:
(WebCore::TextureMapperGL::create):
* platform/graphics/texmap/TextureMapperImageBuffer.h:
(TextureMapperImageBuffer):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (116833 => 116834)


--- trunk/Source/WebCore/ChangeLog	2012-05-12 02:04:46 UTC (rev 116833)
+++ trunk/Source/WebCore/ChangeLog	2012-05-12 02:11:10 UTC (rev 116834)
@@ -1,3 +1,26 @@
+2012-05-11  Martin Robinson  <mrobin...@igalia.com>
+
+        [TextureMapper] Tiles are not created for large textures
+        https://bugs.webkit.org/show_bug.cgi?id=86245
+
+        Reviewed by Noam Rosenthal.
+
+        No new tests. This will not produce any observable behavior changes,
+        unless run on a machine with a small texture size limit.
+
+        The maxTextureSize() method on TextureMapperGL was missing a "const"
+        keyword, meaning that it was not properly overriding the version in
+        the abstract base class (TextureMapper). This patch adds the const
+        modifier and cleans up the list of override methods in the two 
+        TextureMapper sublcasses, adding the OVERRIDE macro for compilers that
+        support it and removing a couple unused methods.
+
+        * platform/graphics/texmap/TextureMapperGL.cpp:
+        * platform/graphics/texmap/TextureMapperGL.h:
+        (WebCore::TextureMapperGL::create):
+        * platform/graphics/texmap/TextureMapperImageBuffer.h:
+        (TextureMapperImageBuffer):
+
 2012-05-11  Adrienne Walker  <e...@google.com>
 
         [chromium] Prevent deadlock on CCVideoLayerImpl destruction

Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp (116833 => 116834)


--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp	2012-05-12 02:04:46 UTC (rev 116833)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp	2012-05-12 02:11:10 UTC (rev 116834)
@@ -393,11 +393,6 @@
     drawRect(targetRect, modelViewMatrix, shaderInfo.get(), GL_TRIANGLE_FAN, needsBlending);
 }
 
-const char* TextureMapperGL::type() const
-{
-    return "OpenGL";
-}
-
 bool BitmapTextureGL::canReuseWith(const IntSize& contentsSize, Flags)
 {
     return contentsSize == m_textureSize;

Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.h (116833 => 116834)


--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.h	2012-05-12 02:04:46 UTC (rev 116833)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.h	2012-05-12 02:11:10 UTC (rev 116834)
@@ -37,6 +37,7 @@
 // An OpenGL-ES2 implementation of TextureMapper.
 class TextureMapperGL : public TextureMapper {
 public:
+    static PassOwnPtr<TextureMapperGL> create() { return adoptPtr(new TextureMapperGL); }
     TextureMapperGL();
     virtual ~TextureMapperGL();
 
@@ -47,24 +48,20 @@
 
     typedef int Flags;
 
-    // reimps from TextureMapper
-    virtual void drawBorder(const Color&, float borderWidth, const FloatRect& targetRect, const TransformationMatrix& modelViewMatrix = TransformationMatrix());
-    virtual void drawTexture(const BitmapTexture&, const FloatRect&, const TransformationMatrix&, float opacity, const BitmapTexture* maskTexture);
-    virtual void drawTexture(uint32_t texture, Flags, const IntSize& textureSize, const FloatRect& targetRect, const TransformationMatrix& modelViewMatrix, float opacity, const BitmapTexture* maskTexture);
-    virtual void bindSurface(BitmapTexture* surface);
-    virtual void beginClip(const TransformationMatrix&, const FloatRect&);
-    virtual void beginPainting(PaintFlags = 0);
-    virtual void endPainting();
-    virtual void endClip();
-    virtual IntSize maxTextureSize() { return IntSize(2000, 2000); }
-    virtual PassRefPtr<BitmapTexture> createTexture();
-    virtual const char* type() const;
-    static PassOwnPtr<TextureMapperGL> create() { return adoptPtr(new TextureMapperGL); }
-    void setGraphicsContext(GraphicsContext* context) { m_context = context; }
-    GraphicsContext* graphicsContext() { return m_context; }
-    virtual bool isOpenGLBacked() const { return true; }
-    void platformUpdateContents(NativeImagePtr, const IntRect&, const IntRect&);
-    virtual AccelerationMode accelerationMode() const { return OpenGLMode; }
+    // TextureMapper implementation
+    virtual void drawBorder(const Color&, float borderWidth, const FloatRect& targetRect, const TransformationMatrix& modelViewMatrix = TransformationMatrix()) OVERRIDE;
+    virtual void drawTexture(const BitmapTexture&, const FloatRect&, const TransformationMatrix&, float opacity, const BitmapTexture* maskTexture) OVERRIDE;
+    virtual void drawTexture(uint32_t texture, Flags, const IntSize& textureSize, const FloatRect& targetRect, const TransformationMatrix& modelViewMatrix, float opacity, const BitmapTexture* maskTexture) OVERRIDE;
+    virtual void bindSurface(BitmapTexture* surface) OVERRIDE;
+    virtual void beginClip(const TransformationMatrix&, const FloatRect&) OVERRIDE;
+    virtual void beginPainting(PaintFlags = 0) OVERRIDE;
+    virtual void endPainting() OVERRIDE;
+    virtual void endClip() OVERRIDE;
+    virtual IntSize maxTextureSize() const OVERRIDE { return IntSize(2000, 2000); }
+    virtual PassRefPtr<BitmapTexture> createTexture() OVERRIDE;
+    virtual GraphicsContext* graphicsContext() OVERRIDE { return m_context; }
+    virtual AccelerationMode accelerationMode() const OVERRIDE { return OpenGLMode; }
+    virtual void setGraphicsContext(GraphicsContext* context) OVERRIDE { m_context = context; }
 
 #if ENABLE(CSS_FILTERS)
     void drawFiltered(const BitmapTexture& sourceTexture, const BitmapTexture& contentTexture, const FilterOperation&);

Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.h (116833 => 116834)


--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.h	2012-05-12 02:04:46 UTC (rev 116833)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.h	2012-05-12 02:11:10 UTC (rev 116834)
@@ -48,20 +48,22 @@
 
 class TextureMapperImageBuffer : public TextureMapper {
 public:
-    virtual void drawBorder(const Color& color, float borderWidth, const FloatRect& targetRect, const TransformationMatrix& modelViewMatrix = TransformationMatrix()) { };
-    virtual void drawTexture(const BitmapTexture&, const FloatRect& targetRect, const TransformationMatrix&, float opacity, const BitmapTexture* maskTexture);
-    virtual void beginClip(const TransformationMatrix&, const FloatRect&);
-    virtual void bindSurface(BitmapTexture* surface) { m_currentSurface = surface;}
-    virtual void endClip() { graphicsContext()->restore(); }
     static PassOwnPtr<TextureMapper> create() { return adoptPtr(new TextureMapperImageBuffer); }
-    PassRefPtr<BitmapTexture> createTexture() { return BitmapTextureImageBuffer::create(); }
+
+    // TextureMapper implementation
+    virtual void drawBorder(const Color& color, float borderWidth, const FloatRect& targetRect, const TransformationMatrix& modelViewMatrix = TransformationMatrix()) OVERRIDE { };
+    virtual void drawTexture(const BitmapTexture&, const FloatRect& targetRect, const TransformationMatrix&, float opacity, const BitmapTexture* maskTexture) OVERRIDE;
+    virtual void beginClip(const TransformationMatrix&, const FloatRect&) OVERRIDE;
+    virtual void bindSurface(BitmapTexture* surface) OVERRIDE { m_currentSurface = surface;}
+    virtual void endClip() OVERRIDE { graphicsContext()->restore(); }
+    virtual PassRefPtr<BitmapTexture> createTexture() OVERRIDE { return BitmapTextureImageBuffer::create(); }
+    virtual AccelerationMode accelerationMode() const OVERRIDE { return SoftwareMode; }
+
     inline GraphicsContext* currentContext()
     {
         return m_currentSurface ? static_cast<BitmapTextureImageBuffer*>(m_currentSurface.get())->graphicsContext() : graphicsContext();
     }
 
-    virtual AccelerationMode accelerationMode() const { return SoftwareMode; }
-
 private:
     RefPtr<BitmapTexture> m_currentSurface;
 };
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to