Remove TextureMapperImageBuffer
authorossy@webkit.org <ossy@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 May 2015 15:48:29 +0000 (15:48 +0000)
committerossy@webkit.org <ossy@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 May 2015 15:48:29 +0000 (15:48 +0000)
https://bugs.webkit.org/show_bug.cgi?id=143561

Reviewed by Žan Doberšek.

Source/WebCore:

* CMakeLists.txt:
* PlatformEfl.cmake:
* PlatformGTK.cmake:
* PlatformWinCairo.cmake:
* platform/graphics/GraphicsContext3DPrivate.cpp:
(WebCore::GraphicsContext3DPrivate::paintToTextureMapper):
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBufferData::paintToTextureMapper):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::paintToTextureMapper):
* platform/graphics/texmap/BitmapTextureImageBuffer.cpp: Removed.
* platform/graphics/texmap/BitmapTextureImageBuffer.h: Removed.
* platform/graphics/texmap/BitmapTexturePool.cpp:
(WebCore::BitmapTexturePool::createTexture):
* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayerTextureMapper::setFilters):
* platform/graphics/texmap/TextureMapper.cpp:
(WebCore::TextureMapper::create):
(WebCore::TextureMapper::TextureMapper):
* platform/graphics/texmap/TextureMapper.h:
(WebCore::TextureMapper::accelerationMode): Deleted.
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGL::TextureMapperGL):
* platform/graphics/texmap/TextureMapperImageBuffer.cpp: Removed.
* platform/graphics/texmap/TextureMapperImageBuffer.h: Removed.
* platform/graphics/texmap/coordinated/CompositingCoordinator.cpp:
(WebCore::CompositingCoordinator::CompositingCoordinator):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::GraphicsLayer::supportsContentsTiling):
(WebCore::CoordinatedGraphicsLayer::setShouldSupportContentsTiling): Deleted.
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:

Source/WebKit2:

* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
* WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
(WebKit::LayerTreeHostGtk::setNativeSurfaceHandleForCompositing):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183807 268f45cc-cd09-0410-ab3c-d52691b4dbfc

23 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/PlatformEfl.cmake
Source/WebCore/PlatformGTK.cmake
Source/WebCore/PlatformWinCairo.cmake
Source/WebCore/platform/graphics/GraphicsContext3DPrivate.cpp
Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp
Source/WebCore/platform/graphics/texmap/BitmapTextureImageBuffer.cpp [deleted file]
Source/WebCore/platform/graphics/texmap/BitmapTextureImageBuffer.h [deleted file]
Source/WebCore/platform/graphics/texmap/BitmapTexturePool.cpp
Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
Source/WebCore/platform/graphics/texmap/TextureMapper.cpp
Source/WebCore/platform/graphics/texmap/TextureMapper.h
Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp
Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.cpp [deleted file]
Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.h [deleted file]
Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.cpp
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp
Source/WebKit2/WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp

index fc9df1b..d6deb1d 100644 (file)
@@ -2194,7 +2194,6 @@ set(WebCore_SOURCES
     platform/graphics/texmap/TextureMapperAnimation.cpp
     platform/graphics/texmap/TextureMapperBackingStore.cpp
     platform/graphics/texmap/TextureMapperFPSCounter.cpp
-    platform/graphics/texmap/TextureMapperImageBuffer.cpp
     platform/graphics/texmap/TextureMapperLayer.cpp
     platform/graphics/texmap/TextureMapperSurfaceBackingStore.cpp
     platform/graphics/texmap/TextureMapperTile.cpp
index 06eb166..b200bd6 100644 (file)
@@ -1,3 +1,42 @@
+2015-05-05  Csaba Osztrogonác  <ossy@webkit.org>
+
+        Remove TextureMapperImageBuffer
+        https://bugs.webkit.org/show_bug.cgi?id=143561
+
+        Reviewed by Žan Doberšek.
+
+        * CMakeLists.txt:
+        * PlatformEfl.cmake:
+        * PlatformGTK.cmake:
+        * PlatformWinCairo.cmake:
+        * platform/graphics/GraphicsContext3DPrivate.cpp:
+        (WebCore::GraphicsContext3DPrivate::paintToTextureMapper):
+        * platform/graphics/cairo/ImageBufferCairo.cpp:
+        (WebCore::ImageBufferData::paintToTextureMapper):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
+        (WebCore::MediaPlayerPrivateGStreamerBase::paintToTextureMapper):
+        * platform/graphics/texmap/BitmapTextureImageBuffer.cpp: Removed.
+        * platform/graphics/texmap/BitmapTextureImageBuffer.h: Removed.
+        * platform/graphics/texmap/BitmapTexturePool.cpp:
+        (WebCore::BitmapTexturePool::createTexture):
+        * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
+        (WebCore::GraphicsLayerTextureMapper::setFilters):
+        * platform/graphics/texmap/TextureMapper.cpp:
+        (WebCore::TextureMapper::create):
+        (WebCore::TextureMapper::TextureMapper):
+        * platform/graphics/texmap/TextureMapper.h:
+        (WebCore::TextureMapper::accelerationMode): Deleted.
+        * platform/graphics/texmap/TextureMapperGL.cpp:
+        (WebCore::TextureMapperGL::TextureMapperGL):
+        * platform/graphics/texmap/TextureMapperImageBuffer.cpp: Removed.
+        * platform/graphics/texmap/TextureMapperImageBuffer.h: Removed.
+        * platform/graphics/texmap/coordinated/CompositingCoordinator.cpp:
+        (WebCore::CompositingCoordinator::CompositingCoordinator):
+        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
+        (WebCore::GraphicsLayer::supportsContentsTiling):
+        (WebCore::CoordinatedGraphicsLayer::setShouldSupportContentsTiling): Deleted.
+        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
+
 2015-05-05  Javier Fernandez  <jfernandez@igalia.com>
 
         [CSS Box Alignment] Upgrade align-content parsing to CSS3 Box Alignment spec
index e6330c5..764b336 100644 (file)
@@ -182,7 +182,6 @@ list(APPEND WebCore_SOURCES
 
     platform/graphics/texmap/BitmapTexture.cpp
     platform/graphics/texmap/BitmapTextureGL.cpp
-    platform/graphics/texmap/BitmapTextureImageBuffer.cpp
     platform/graphics/texmap/BitmapTexturePool.cpp
     platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
     platform/graphics/texmap/TextureMapperGL.cpp
index 819f5bb..b5d09b7 100644 (file)
@@ -383,11 +383,9 @@ if (USE_TEXTURE_MAPPER)
     list(APPEND WebCore_SOURCES
         platform/graphics/texmap/BitmapTexture.cpp
         platform/graphics/texmap/BitmapTextureGL.cpp
-        platform/graphics/texmap/BitmapTextureImageBuffer.cpp
         platform/graphics/texmap/BitmapTexturePool.cpp
         platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
         platform/graphics/texmap/TextureMapperGL.cpp
-        platform/graphics/texmap/TextureMapperImageBuffer.cpp
         platform/graphics/texmap/TextureMapperShaderProgram.cpp
     )
 endif ()
index 78bb01a..f0ad8ad 100644 (file)
@@ -59,7 +59,6 @@ list(APPEND WebCore_SOURCES
 
     platform/graphics/texmap/BitmapTexture.cpp
     platform/graphics/texmap/BitmapTextureGL.cpp
-    platform/graphics/texmap/BitmapTextureImageBuffer.cpp
     platform/graphics/texmap/BitmapTexturePool.cpp
     platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
     platform/graphics/texmap/TextureMapper.cpp
@@ -67,7 +66,6 @@ list(APPEND WebCore_SOURCES
     platform/graphics/texmap/TextureMapperBackingStore.cpp
     platform/graphics/texmap/TextureMapperFPSCounter.cpp
     platform/graphics/texmap/TextureMapperGL.cpp
-    platform/graphics/texmap/TextureMapperImageBuffer.cpp
     platform/graphics/texmap/TextureMapperLayer.cpp
     platform/graphics/texmap/TextureMapperShaderProgram.cpp
     platform/graphics/texmap/TextureMapperSurfaceBackingStore.cpp
index 16f0bf6..b1cdccc 100644 (file)
@@ -89,45 +89,6 @@ void GraphicsContext3DPrivate::paintToTextureMapper(TextureMapper* textureMapper
 
     m_context->markLayerComposited();
 
-    // FIXME: We do not support mask for the moment with TextureMapperImageBuffer.
-    if (textureMapper->accelerationMode() != TextureMapper::OpenGLMode) {
-        GraphicsContext* context = textureMapper->graphicsContext();
-        context->save();
-        context->platformContext()->setGlobalAlpha(opacity);
-
-        const int height = m_context->m_currentHeight;
-        const int width = m_context->m_currentWidth;
-        int totalBytes = width * height * 4;
-
-        auto pixels = std::make_unique<unsigned char[]>(totalBytes);
-        if (!pixels)
-            return;
-
-        // OpenGL keeps the pixels stored bottom up, so we need to flip the image here.
-        context->translate(0, height);
-        context->scale(FloatSize(1, -1));
-
-        context->concatCTM(matrix.toAffineTransform());
-
-        m_context->readRenderingResults(pixels.get(), totalBytes);
-
-        // Premultiply alpha.
-        for (int i = 0; i < totalBytes; i += 4)
-            if (pixels[i + 3] != 255) {
-                pixels[i + 0] = min(255, pixels[i + 0] * pixels[i + 3] / 255);
-                pixels[i + 1] = min(255, pixels[i + 1] * pixels[i + 3] / 255);
-                pixels[i + 2] = min(255, pixels[i + 2] * pixels[i + 3] / 255);
-            }
-
-        RefPtr<cairo_surface_t> imageSurface = adoptRef(cairo_image_surface_create_for_data(
-            const_cast<unsigned char*>(pixels.get()), CAIRO_FORMAT_ARGB32, width, height, width * 4));
-
-        context->platformContext()->drawSurfaceToContext(imageSurface.get(), targetRect, IntRect(0, 0, width, height), context);
-
-        context->restore();
-        return;
-    }
-
 #if USE(TEXTURE_MAPPER_GL)
     if (m_context->m_attrs.antialias && m_context->m_state.boundFBO == m_context->m_multisampleFBO) {
         GLContext* previousActiveContext = GLContext::getCurrent();
index a335b05..d61a343 100644 (file)
@@ -396,11 +396,6 @@ String ImageBuffer::toDataURL(const String& mimeType, const double*, CoordinateS
 #if ENABLE(ACCELERATED_2D_CANVAS)
 void ImageBufferData::paintToTextureMapper(TextureMapper* textureMapper, const FloatRect& targetRect, const TransformationMatrix& matrix, float opacity)
 {
-    if (textureMapper->accelerationMode() != TextureMapper::OpenGLMode) {
-        notImplemented();
-        return;
-    }
-
     ASSERT(m_texture);
 
     // Cairo may change the active context, so we make sure to change it back after flushing.
index b00b7f8..318a4f5 100644 (file)
@@ -530,9 +530,6 @@ void MediaPlayerPrivateGStreamerBase::paint(GraphicsContext* context, const Floa
 #if USE(TEXTURE_MAPPER_GL) && !USE(COORDINATED_GRAPHICS)
 void MediaPlayerPrivateGStreamerBase::paintToTextureMapper(TextureMapper* textureMapper, const FloatRect& targetRect, const TransformationMatrix& matrix, float opacity)
 {
-    if (textureMapper->accelerationMode() != TextureMapper::OpenGLMode)
-        return;
-
     if (!m_player->visible())
         return;
 
diff --git a/Source/WebCore/platform/graphics/texmap/BitmapTextureImageBuffer.cpp b/Source/WebCore/platform/graphics/texmap/BitmapTextureImageBuffer.cpp
deleted file mode 100644 (file)
index 3641ac8..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
- * Copyright (C) 2014 Igalia S.L.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "BitmapTextureImageBuffer.h"
-
-#include "GraphicsLayer.h"
-
-namespace WebCore {
-
-void BitmapTextureImageBuffer::updateContents(const void* data, const IntRect& targetRect, const IntPoint& sourceOffset, int bytesPerLine, UpdateContentsFlag)
-{
-#if PLATFORM(CAIRO)
-    RefPtr<cairo_surface_t> surface = adoptRef(cairo_image_surface_create_for_data(static_cast<unsigned char*>(data()),
-        CAIRO_FORMAT_ARGB32, targetRect.width(), targetRect.height(), bytesPerLine));
-    m_image->context()->platformContext()->drawSurfaceToContext(surface.get(), targetRect,
-        IntRect(sourceOffset, targetRect.size()), m_image->context());
-#else
-    UNUSED_PARAM(data);
-    UNUSED_PARAM(targetRect);
-    UNUSED_PARAM(sourceOffset);
-    UNUSED_PARAM(bytesPerLine);
-#endif
-}
-
-void BitmapTextureImageBuffer::updateContents(TextureMapper*, GraphicsLayer* sourceLayer, const IntRect& targetRect, const IntPoint& sourceOffset, UpdateContentsFlag)
-{
-    GraphicsContext* context = m_image->context();
-
-    context->clearRect(targetRect);
-
-    IntRect sourceRect(targetRect);
-    sourceRect.setLocation(sourceOffset);
-    context->save();
-    context->clip(targetRect);
-    context->translate(targetRect.x() - sourceOffset.x(), targetRect.y() - sourceOffset.y());
-    sourceLayer->paintGraphicsLayerContents(*context, sourceRect);
-    context->restore();
-}
-
-void BitmapTextureImageBuffer::didReset()
-{
-    m_image = ImageBuffer::create(contentSize());
-}
-
-void BitmapTextureImageBuffer::updateContents(Image* image, const IntRect& targetRect, const IntPoint& offset, UpdateContentsFlag)
-{
-    m_image->context()->drawImage(image, ColorSpaceDeviceRGB, targetRect, IntRect(offset, targetRect.size()), CompositeCopy);
-}
-
-} // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/texmap/BitmapTextureImageBuffer.h b/Source/WebCore/platform/graphics/texmap/BitmapTextureImageBuffer.h
deleted file mode 100644 (file)
index 648d2de..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
- * Copyright (C) 2014 Igalia S.L.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef BitmapTextureImageBuffer_h
-#define BitmapTextureImageBuffer_h
-
-#include "BitmapTexture.h"
-#include "ImageBuffer.h"
-#include "IntRect.h"
-#include "IntSize.h"
-
-namespace WebCore {
-
-class GraphicsContext;
-
-class BitmapTextureImageBuffer : public BitmapTexture {
-public:
-    static PassRefPtr<BitmapTexture> create() { return adoptRef(new BitmapTextureImageBuffer); }
-    virtual IntSize size() const { return m_image->internalSize(); }
-    virtual void didReset();
-    virtual bool isValid() const { return m_image.get(); }
-    inline GraphicsContext* graphicsContext() { return m_image ? m_image->context() : 0; }
-    virtual void updateContents(Image*, const IntRect&, const IntPoint&, UpdateContentsFlag);
-    virtual void updateContents(TextureMapper*, GraphicsLayer*, const IntRect& target, const IntPoint& offset, UpdateContentsFlag);
-    virtual void updateContents(const void*, const IntRect& target, const IntPoint& sourceOffset, int bytesPerLine, UpdateContentsFlag);
-    PassRefPtr<BitmapTexture> applyFilters(TextureMapper*, const FilterOperations&);
-    ImageBuffer* image() const { return m_image.get(); }
-
-private:
-    BitmapTextureImageBuffer() { }
-    std::unique_ptr<ImageBuffer> m_image;
-};
-
-}
-
-#endif // BitmapTextureImageBuffer_h
index a444280..edb4ccf 100644 (file)
@@ -106,8 +106,6 @@ PassRefPtr<BitmapTexture> BitmapTexturePool::createTexture()
 #if USE(TEXTURE_MAPPER_GL)
     BitmapTextureGL* texture = new BitmapTextureGL(m_context3D);
     return adoptRef(texture);
-#else
-    return BitmapTextureImageBuffer::create();
 #endif
 }
 
index 2e7fc5d..5a80720 100644 (file)
@@ -602,8 +602,7 @@ void GraphicsLayerTextureMapper::removeAnimation(const String& animationName)
 bool GraphicsLayerTextureMapper::setFilters(const FilterOperations& filters)
 {
     TextureMapper* textureMapper = m_layer.textureMapper();
-    // TextureMapperImageBuffer does not support CSS filters.
-    if (!textureMapper || textureMapper->accelerationMode() == TextureMapper::SoftwareMode)
+    if (!textureMapper)
         return false;
     notifyChange(FilterChange);
     return GraphicsLayer::setFilters(filters);
index 033a61e..4ce7859 100644 (file)
@@ -23,7 +23,6 @@
 #include "BitmapTexturePool.h"
 #include "FilterOperations.h"
 #include "GraphicsLayer.h"
-#include "TextureMapperImageBuffer.h"
 #include "Timer.h"
 #include <wtf/CurrentTime.h>
 
@@ -38,18 +37,15 @@ PassRefPtr<BitmapTexture> TextureMapper::acquireTextureFromPool(const IntSize& s
     return selectedTexture.release();
 }
 
-std::unique_ptr<TextureMapper> TextureMapper::create(AccelerationMode mode)
+std::unique_ptr<TextureMapper> TextureMapper::create()
 {
-    if (mode == SoftwareMode)
-        return std::make_unique<TextureMapperImageBuffer>();
     return platformCreateAccelerated();
 }
 
-TextureMapper::TextureMapper(AccelerationMode accelerationMode)
+TextureMapper::TextureMapper()
     : m_context(0)
     , m_interpolationQuality(InterpolationDefault)
     , m_textDrawingMode(TextModeFill)
-    , m_accelerationMode(accelerationMode)
     , m_isMaskMode(false)
     , m_wrapMode(StretchWrap)
 { }
index 97e23e5..65c9872 100644 (file)
@@ -47,7 +47,6 @@ class FilterOperations;
 class TextureMapper {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    enum AccelerationMode { SoftwareMode, OpenGLMode };
     enum PaintFlag {
         PaintingMirrored = 1 << 0,
     };
@@ -59,9 +58,9 @@ public:
 
     typedef unsigned PaintFlags;
 
-    static std::unique_ptr<TextureMapper> create(AccelerationMode newMode = SoftwareMode);
+    static std::unique_ptr<TextureMapper> create();
 
-    explicit TextureMapper(AccelerationMode);
+    explicit TextureMapper();
     virtual ~TextureMapper();
 
     enum ExposedEdges {
@@ -93,7 +92,6 @@ public:
 
     InterpolationQuality imageInterpolationQuality() const { return m_interpolationQuality; }
     TextDrawingModeFlags textDrawingMode() const { return m_textDrawingMode; }
-    AccelerationMode accelerationMode() const { return m_accelerationMode; }
 
     virtual void beginPainting(PaintFlags = 0) { }
     virtual void endPainting() { }
@@ -126,7 +124,6 @@ private:
 #endif
     InterpolationQuality m_interpolationQuality;
     TextDrawingModeFlags m_textDrawingMode;
-    AccelerationMode m_accelerationMode;
     bool m_isMaskMode;
     TransformationMatrix m_patternTransform;
     WrapMode m_wrapMode;
index 60f9948..0bce8c7 100644 (file)
@@ -241,8 +241,7 @@ void TextureMapperGLData::initializeStencil()
 }
 
 TextureMapperGL::TextureMapperGL()
-    : TextureMapper(OpenGLMode)
-    , m_enableEdgeDistanceAntialiasing(false)
+    : m_enableEdgeDistanceAntialiasing(false)
 {
     m_context3D = GraphicsContext3D::createForCurrentGLContext();
     m_data = new TextureMapperGLData(m_context3D.get());
diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.cpp b/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.cpp
deleted file mode 100644 (file)
index d6f87e1..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB.  If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-#include "TextureMapperImageBuffer.h"
-
-#include "BitmapTexturePool.h"
-#include "GraphicsLayer.h"
-#include "NotImplemented.h"
-
-#if USE(TEXTURE_MAPPER)
-namespace WebCore {
-
-static const int s_maximumAllowedImageBufferDimension = 4096;
-
-TextureMapperImageBuffer::TextureMapperImageBuffer()
-    : TextureMapper(SoftwareMode)
-{
-    m_texturePool = std::make_unique<BitmapTexturePool>();
-}
-
-IntSize TextureMapperImageBuffer::maxTextureSize() const
-{
-    return IntSize(s_maximumAllowedImageBufferDimension, s_maximumAllowedImageBufferDimension);
-}
-
-void TextureMapperImageBuffer::beginClip(const TransformationMatrix& matrix, const FloatRect& rect)
-{
-    GraphicsContext* context = currentContext();
-    if (!context)
-        return;
-#if ENABLE(3D_TRANSFORMS)
-    TransformationMatrix previousTransform = context->get3DTransform();
-#else
-    AffineTransform previousTransform = context->getCTM();
-#endif
-    context->save();
-
-#if ENABLE(3D_TRANSFORMS)
-    context->concat3DTransform(matrix);
-#else
-    context->concatCTM(matrix.toAffineTransform());
-#endif
-
-    context->clip(rect);
-
-#if ENABLE(3D_TRANSFORMS)
-    context->set3DTransform(previousTransform);
-#else
-    context->setCTM(previousTransform);
-#endif
-}
-
-void TextureMapperImageBuffer::drawTexture(const BitmapTexture& texture, const FloatRect& targetRect, const TransformationMatrix& matrix, float opacity, unsigned /* exposedEdges */)
-{
-    GraphicsContext* context = currentContext();
-    if (!context)
-        return;
-
-    const BitmapTextureImageBuffer& textureImageBuffer = static_cast<const BitmapTextureImageBuffer&>(texture);
-    ImageBuffer* image = textureImageBuffer.image();
-    context->save();
-    context->setCompositeOperation(isInMaskMode() ? CompositeDestinationIn : CompositeSourceOver);
-    context->setAlpha(opacity);
-#if ENABLE(3D_TRANSFORMS)
-    context->concat3DTransform(matrix);
-#else
-    context->concatCTM(matrix.toAffineTransform());
-#endif
-    context->drawImageBuffer(image, ColorSpaceDeviceRGB, targetRect);
-    context->restore();
-}
-
-void TextureMapperImageBuffer::drawSolidColor(const FloatRect& rect, const TransformationMatrix& matrix, const Color& color)
-{
-    GraphicsContext* context = currentContext();
-    if (!context)
-        return;
-
-    context->save();
-    context->setCompositeOperation(isInMaskMode() ? CompositeDestinationIn : CompositeSourceOver);
-#if ENABLE(3D_TRANSFORMS)
-    context->concat3DTransform(matrix);
-#else
-    context->concatCTM(matrix.toAffineTransform());
-#endif
-
-    context->fillRect(rect, color, ColorSpaceDeviceRGB);
-    context->restore();
-}
-
-void TextureMapperImageBuffer::drawBorder(const Color&, float /* borderWidth */, const FloatRect&, const TransformationMatrix&)
-{
-    notImplemented();
-}
-
-void TextureMapperImageBuffer::drawNumber(int /* number */, const Color&, const FloatPoint&, const TransformationMatrix&)
-{
-    notImplemented();
-}
-
-PassRefPtr<BitmapTexture> BitmapTextureImageBuffer::applyFilters(TextureMapper*, const FilterOperations&)
-{
-    ASSERT_NOT_REACHED();
-    return this;
-}
-
-}
-#endif
diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.h b/Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.h
deleted file mode 100644 (file)
index dd17193..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public
- License as published by the Free Software Foundation; either
- version 2 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB.  If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
- */
-
-#ifndef TextureMapperImageBuffer_h
-#define TextureMapperImageBuffer_h
-
-#include "BitmapTextureImageBuffer.h"
-#include "ImageBuffer.h"
-#include "TextureMapper.h"
-
-#if USE(TEXTURE_MAPPER)
-namespace WebCore {
-
-class TextureMapperImageBuffer : public TextureMapper {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    TextureMapperImageBuffer();
-
-    // TextureMapper implementation
-    virtual void drawBorder(const Color&, float borderWidth, const FloatRect&, const TransformationMatrix&) override;
-    virtual void drawNumber(int number, const Color&, const FloatPoint&, const TransformationMatrix&) override;
-    virtual void drawTexture(const BitmapTexture&, const FloatRect& targetRect, const TransformationMatrix&, float opacity, unsigned exposedEdges) override;
-    virtual void drawSolidColor(const FloatRect&, const TransformationMatrix&, const Color&) 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 IntRect clipBounds() override { return currentContext()->clipBounds(); }
-    virtual IntSize maxTextureSize() const;
-    virtual PassRefPtr<BitmapTexture> createTexture() override { return BitmapTextureImageBuffer::create(); }
-
-    inline GraphicsContext* currentContext()
-    {
-        return m_currentSurface ? static_cast<BitmapTextureImageBuffer*>(m_currentSurface.get())->graphicsContext() : graphicsContext();
-    }
-
-private:
-    RefPtr<BitmapTexture> m_currentSurface;
-};
-
-}
-#endif // USE(TEXTURE_MAPPER)
-
-#endif // TextureMapperImageBuffer_h
index 1a1c267..3694521 100644 (file)
@@ -65,10 +65,6 @@ CompositingCoordinator::CompositingCoordinator(Page* page, CompositingCoordinato
 #endif
 {
     m_page->settings().setApplyDeviceScaleFactorInCompositor(true);
-
-    // This is a temporary way to enable this only in the GL case, until TextureMapperImageBuffer is removed.
-    // See https://bugs.webkit.org/show_bug.cgi?id=114869
-    CoordinatedGraphicsLayer::setShouldSupportContentsTiling(true);
 }
 
 void CompositingCoordinator::setRootCompositingLayer(GraphicsLayer* compositingLayer, GraphicsLayer* overlayLayer)
index bac207c..799e2c7 100644 (file)
@@ -366,16 +366,9 @@ void CoordinatedGraphicsLayer::setContentsTilePhase(const FloatSize& p)
     didChangeLayerState();
 }
 
-static bool s_shouldSupportContentsTiling = false;
-
-void CoordinatedGraphicsLayer::setShouldSupportContentsTiling(bool s)
-{
-    s_shouldSupportContentsTiling = s;
-}
-
 bool GraphicsLayer::supportsContentsTiling()
 {
-    return s_shouldSupportContentsTiling;
+    return true;
 }
 
 void CoordinatedGraphicsLayer::setContentsNeedsDisplay()
index a216ad5..1091ed3 100644 (file)
@@ -147,7 +147,6 @@ public:
     void setNeedsVisibleRectAdjustment();
     void purgeBackingStores();
 
-    static void setShouldSupportContentsTiling(bool);
     CoordinatedGraphicsLayer* findFirstDescendantWithContentsRecursively();
 
 private:
index a6d56ae..9fcc40d 100644 (file)
@@ -1,3 +1,15 @@
+2015-05-05  Csaba Osztrogonác  <ossy@webkit.org>
+
+        Remove TextureMapperImageBuffer
+        https://bugs.webkit.org/show_bug.cgi?id=143561
+
+        Reviewed by Žan Doberšek.
+
+        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
+        (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
+        * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
+        (WebKit::LayerTreeHostGtk::setNativeSurfaceHandleForCompositing):
+
 2015-05-05  Carlos Garcia Campos  <cgarcia@igalia.com>
 
         [SOUP] Network Cache: IOChannel operations are not sent to the right thread
index e67932f..aeb1223 100644 (file)
@@ -72,7 +72,7 @@ CoordinatedGraphicsScene::~CoordinatedGraphicsScene()
 void CoordinatedGraphicsScene::paintToCurrentGLContext(const TransformationMatrix& matrix, float opacity, const FloatRect& clipRect, const Color& backgroundColor, bool drawsBackground, const FloatPoint& contentPosition, TextureMapper::PaintFlags PaintFlags)
 {
     if (!m_textureMapper) {
-        m_textureMapper = TextureMapper::create(TextureMapper::OpenGLMode);
+        m_textureMapper = TextureMapper::create();
         static_cast<TextureMapperGL*>(m_textureMapper.get())->setEnableEdgeDistanceAntialiasing(true);
     }
 
index fa2c693..bb72ed2 100644 (file)
@@ -375,7 +375,7 @@ void LayerTreeHostGtk::setNativeSurfaceHandleForCompositing(uint64_t handle)
 
     ASSERT(m_isValid);
     ASSERT(!m_textureMapper);
-    m_textureMapper = TextureMapper::create(TextureMapper::OpenGLMode);
+    m_textureMapper = TextureMapper::create();
     static_cast<TextureMapperGL*>(m_textureMapper.get())->setEnableEdgeDistanceAntialiasing(true);
     downcast<GraphicsLayerTextureMapper>(*m_rootLayer).layer().setTextureMapper(m_textureMapper.get());