Changeset 106630 in webkit


Ignore:
Timestamp:
Feb 2, 2012 10:59:53 PM (12 years ago)
Author:
Csaba Osztrogonác
Message:

Unreviewed, rolling out r106620.
http://trac.webkit.org/changeset/106620
https://bugs.webkit.org/show_bug.cgi?id=77716

It broke non ENABLE(3D_RENDERING) builds (Requested by
Ossy_morning on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-02-02

Source/WebCore:

  • GNUmakefile.list.am:
  • Target.pri:
  • WebCore.gypi:
  • platform/graphics/GraphicsContext.h:

(WebCore):
(GraphicsContext):

  • platform/graphics/cairo/TextureMapperCairo.cpp:

(WebCore::TextureMapper::create):
(WebCore):

  • platform/graphics/opengl/TextureMapperGL.cpp:

(Entry):
(DirectlyCompositedImageRepository):
(WebCore::TextureMapperGLData::DirectlyCompositedImageRepository::findOrCreate):
(WebCore::TextureMapperGLData::DirectlyCompositedImageRepository::deref):
(WebCore::TextureMapperGLData::DirectlyCompositedImageRepository::DirectlyCompositedImageRepository):
(WebCore::TextureMapperGLData::DirectlyCompositedImageRepository::~DirectlyCompositedImageRepository):
(TextureMapperGLData):
(BitmapTextureGL):
(WebCore::BitmapTextureGL::isOpaque):
(WebCore::BitmapTextureGL::pack):
(WebCore::BitmapTextureGL::unpack):
(WebCore::BitmapTextureGL::isPacked):
(WebCore::BitmapTextureGL::BitmapTextureGL):
(WebCore::TextureMapperGL::beginPainting):
(WebCore::BitmapTextureGL::reset):
(WebCore::BitmapTextureGL::beginPaint):
(WebCore::BitmapTextureGL::endPaint):
(WebCore):
(WebCore::BitmapTextureGL::updateContents):
(WebCore::BitmapTextureGL::updateRawContents):
(WebCore::BitmapTextureGL::setContentsToImage):
(WebCore::BitmapTextureGL::destroy):
(WebCore::TextureMapperGL::bindSurface):

  • platform/graphics/opengl/TextureMapperGL.h:

(TextureMapperGL):
(WebCore::TextureMapperGL::allowSurfaceForRoot):
(BGRA32PremultimpliedBuffer):
(WebCore::BGRA32PremultimpliedBuffer::~BGRA32PremultimpliedBuffer):
(WebCore):

  • platform/graphics/qt/GraphicsContext3DQt.cpp:

(WebCore::GraphicsContext3DPrivate::paintToTextureMapper):

  • platform/graphics/qt/GraphicsContextQt.cpp:
  • platform/graphics/qt/TextureMapperQt.cpp: Added.

(WebCore):
(WebCore::BitmapTextureQt::destroy):
(WebCore::BitmapTextureQt::reset):
(WebCore::BitmapTextureQt::beginPaint):
(WebCore::BitmapTextureQt::endPaint):
(WebCore::BitmapTextureQt::updateContents):
(WebCore::BitmapTextureQt::save):
(WebCore::BitmapTextureQt::setContentsToImage):
(WebCore::BitmapTextureQt::pack):
(WebCore::BitmapTextureQt::unpack):
(WebCore::TextureMapperQt::beginClip):
(WebCore::TextureMapperQt::endClip):
(WebCore::TextureMapperQt::viewportSize):
(WebCore::TextureMapperQt::TextureMapperQt):
(WebCore::TextureMapperQt::setGraphicsContext):
(WebCore::TextureMapperQt::graphicsContext):
(WebCore::TextureMapperQt::bindSurface):
(WebCore::TextureMapperQt::drawTexture):
(WebCore::TextureMapper::create):
(WebCore::TextureMapperQt::createTexture):
(WebCore::BitmapTextureQt::BitmapTextureQt):
(WebCore::TextureMapperQt::beginPainting):
(WebCore::TextureMapperQt::endPainting):
(BGRA32PremultimpliedBufferQt):
(WebCore::BGRA32PremultimpliedBufferQt::beginPaint):
(WebCore::BGRA32PremultimpliedBufferQt::endPaint):
(WebCore::BGRA32PremultimpliedBufferQt::data):
(WebCore::BGRA32PremultimpliedBuffer::create):
(WebCore::uidForImage):

  • platform/graphics/qt/TextureMapperQt.h: Added.

(WebCore):
(BitmapTextureQt):
(WebCore::BitmapTextureQt::~BitmapTextureQt):
(WebCore::BitmapTextureQt::size):
(WebCore::BitmapTextureQt::isValid):
(WebCore::BitmapTextureQt::sourceRect):
(WebCore::BitmapTextureQt::isPacked):
(WebCore::BitmapTextureQt::painter):
(TextureMapperQt):
(WebCore::TextureMapperQt::allowSurfaceForRoot):
(WebCore::TextureMapperQt::initialize):
(WebCore::TextureMapperQt::create):
(WebCore::TextureMapperQt::currentPainter):

  • platform/graphics/texmap/TextureMapper.cpp:
  • platform/graphics/texmap/TextureMapper.h:

(WebCore::BitmapTexture::BitmapTexture):
(WebCore::BitmapTexture::allowOfflineTextureUpload):
(BitmapTexture):
(WebCore::BitmapTexture::pack):
(WebCore::BitmapTexture::unpack):
(WebCore::BitmapTexture::isPacked):
(WebCore::BitmapTexture::updateRawContents):
(WebCore::BitmapTexture::beginPaintMedia):
(WebCore::BitmapTexture::save):
(WebCore::BitmapTexture::lock):
(WebCore::BitmapTexture::unlock):
(WebCore::BitmapTexture::isLocked):
(TextureMapper):
(WebCore::TextureMapper::viewportSize):
(WebCore::TextureMapper::setViewportSize):
(WebCore::TextureMapper::allowPartialUpdates):
(WebCore::TextureMapper::isOpenGLBacked):
(WebCore::TextureMapper::setTransform):
(WebCore::TextureMapper::transform):

  • platform/graphics/texmap/TextureMapperImageBuffer.cpp: Removed.
  • platform/graphics/texmap/TextureMapperImageBuffer.h: Removed.
  • platform/graphics/texmap/TextureMapperNode.cpp:

(WebCore::TextureMapperNode::renderContent):
(WebCore::TextureMapperNode::setContentsTileBackBuffer):

  • platform/graphics/texmap/TextureMapperNode.h:

(TextureMapperNode):

Source/WebKit/qt:

  • Api/qwebframe.cpp:

(QWebFramePrivate::renderCompositedLayers):

  • WebCoreSupport/PageClientQt.cpp:

(WebCore::PageClientQWidget::setRootGraphicsLayer):
(WebCore::PageClientQGraphicsWidget::setRootGraphicsLayer):

Source/WebKit2:

  • UIProcess/qt/LayerTreeHostProxyQt.cpp:

(WebKit::LayerTreeHostProxy::paintToCurrentGLContext):
(WebKit::LayerTreeHostProxy::paintToGraphicsContext):
(WebKit::LayerTreeHostProxy::createImage):
(WebKit::LayerTreeHostProxy::ensureRootLayer):

Location:
trunk/Source
Files:
2 added
2 deleted
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r106628 r106630  
     12012-02-02  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r106620.
     4        http://trac.webkit.org/changeset/106620
     5        https://bugs.webkit.org/show_bug.cgi?id=77716
     6
     7        It broke non ENABLE(3D_RENDERING) builds (Requested by
     8        Ossy_morning on #webkit).
     9
     10        * GNUmakefile.list.am:
     11        * Target.pri:
     12        * WebCore.gypi:
     13        * platform/graphics/GraphicsContext.h:
     14        (WebCore):
     15        (GraphicsContext):
     16        * platform/graphics/cairo/TextureMapperCairo.cpp:
     17        (WebCore::TextureMapper::create):
     18        (WebCore):
     19        * platform/graphics/opengl/TextureMapperGL.cpp:
     20        (Entry):
     21        (DirectlyCompositedImageRepository):
     22        (WebCore::TextureMapperGLData::DirectlyCompositedImageRepository::findOrCreate):
     23        (WebCore::TextureMapperGLData::DirectlyCompositedImageRepository::deref):
     24        (WebCore::TextureMapperGLData::DirectlyCompositedImageRepository::DirectlyCompositedImageRepository):
     25        (WebCore::TextureMapperGLData::DirectlyCompositedImageRepository::~DirectlyCompositedImageRepository):
     26        (TextureMapperGLData):
     27        (BitmapTextureGL):
     28        (WebCore::BitmapTextureGL::isOpaque):
     29        (WebCore::BitmapTextureGL::pack):
     30        (WebCore::BitmapTextureGL::unpack):
     31        (WebCore::BitmapTextureGL::isPacked):
     32        (WebCore::BitmapTextureGL::BitmapTextureGL):
     33        (WebCore::TextureMapperGL::beginPainting):
     34        (WebCore::BitmapTextureGL::reset):
     35        (WebCore::BitmapTextureGL::beginPaint):
     36        (WebCore::BitmapTextureGL::endPaint):
     37        (WebCore):
     38        (WebCore::BitmapTextureGL::updateContents):
     39        (WebCore::BitmapTextureGL::updateRawContents):
     40        (WebCore::BitmapTextureGL::setContentsToImage):
     41        (WebCore::BitmapTextureGL::destroy):
     42        (WebCore::TextureMapperGL::bindSurface):
     43        * platform/graphics/opengl/TextureMapperGL.h:
     44        (TextureMapperGL):
     45        (WebCore::TextureMapperGL::allowSurfaceForRoot):
     46        (BGRA32PremultimpliedBuffer):
     47        (WebCore::BGRA32PremultimpliedBuffer::~BGRA32PremultimpliedBuffer):
     48        (WebCore):
     49        * platform/graphics/qt/GraphicsContext3DQt.cpp:
     50        (WebCore::GraphicsContext3DPrivate::paintToTextureMapper):
     51        * platform/graphics/qt/GraphicsContextQt.cpp:
     52        * platform/graphics/qt/TextureMapperQt.cpp: Added.
     53        (WebCore):
     54        (WebCore::BitmapTextureQt::destroy):
     55        (WebCore::BitmapTextureQt::reset):
     56        (WebCore::BitmapTextureQt::beginPaint):
     57        (WebCore::BitmapTextureQt::endPaint):
     58        (WebCore::BitmapTextureQt::updateContents):
     59        (WebCore::BitmapTextureQt::save):
     60        (WebCore::BitmapTextureQt::setContentsToImage):
     61        (WebCore::BitmapTextureQt::pack):
     62        (WebCore::BitmapTextureQt::unpack):
     63        (WebCore::TextureMapperQt::beginClip):
     64        (WebCore::TextureMapperQt::endClip):
     65        (WebCore::TextureMapperQt::viewportSize):
     66        (WebCore::TextureMapperQt::TextureMapperQt):
     67        (WebCore::TextureMapperQt::setGraphicsContext):
     68        (WebCore::TextureMapperQt::graphicsContext):
     69        (WebCore::TextureMapperQt::bindSurface):
     70        (WebCore::TextureMapperQt::drawTexture):
     71        (WebCore::TextureMapper::create):
     72        (WebCore::TextureMapperQt::createTexture):
     73        (WebCore::BitmapTextureQt::BitmapTextureQt):
     74        (WebCore::TextureMapperQt::beginPainting):
     75        (WebCore::TextureMapperQt::endPainting):
     76        (BGRA32PremultimpliedBufferQt):
     77        (WebCore::BGRA32PremultimpliedBufferQt::beginPaint):
     78        (WebCore::BGRA32PremultimpliedBufferQt::endPaint):
     79        (WebCore::BGRA32PremultimpliedBufferQt::data):
     80        (WebCore::BGRA32PremultimpliedBuffer::create):
     81        (WebCore::uidForImage):
     82        * platform/graphics/qt/TextureMapperQt.h: Added.
     83        (WebCore):
     84        (BitmapTextureQt):
     85        (WebCore::BitmapTextureQt::~BitmapTextureQt):
     86        (WebCore::BitmapTextureQt::size):
     87        (WebCore::BitmapTextureQt::isValid):
     88        (WebCore::BitmapTextureQt::sourceRect):
     89        (WebCore::BitmapTextureQt::isPacked):
     90        (WebCore::BitmapTextureQt::painter):
     91        (TextureMapperQt):
     92        (WebCore::TextureMapperQt::allowSurfaceForRoot):
     93        (WebCore::TextureMapperQt::initialize):
     94        (WebCore::TextureMapperQt::create):
     95        (WebCore::TextureMapperQt::currentPainter):
     96        * platform/graphics/texmap/TextureMapper.cpp:
     97        * platform/graphics/texmap/TextureMapper.h:
     98        (WebCore::BitmapTexture::BitmapTexture):
     99        (WebCore::BitmapTexture::allowOfflineTextureUpload):
     100        (BitmapTexture):
     101        (WebCore::BitmapTexture::pack):
     102        (WebCore::BitmapTexture::unpack):
     103        (WebCore::BitmapTexture::isPacked):
     104        (WebCore::BitmapTexture::updateRawContents):
     105        (WebCore::BitmapTexture::beginPaintMedia):
     106        (WebCore::BitmapTexture::save):
     107        (WebCore::BitmapTexture::lock):
     108        (WebCore::BitmapTexture::unlock):
     109        (WebCore::BitmapTexture::isLocked):
     110        (TextureMapper):
     111        (WebCore::TextureMapper::viewportSize):
     112        (WebCore::TextureMapper::setViewportSize):
     113        (WebCore::TextureMapper::allowPartialUpdates):
     114        (WebCore::TextureMapper::isOpenGLBacked):
     115        (WebCore::TextureMapper::setTransform):
     116        (WebCore::TextureMapper::transform):
     117        * platform/graphics/texmap/TextureMapperImageBuffer.cpp: Removed.
     118        * platform/graphics/texmap/TextureMapperImageBuffer.h: Removed.
     119        * platform/graphics/texmap/TextureMapperNode.cpp:
     120        (WebCore::TextureMapperNode::renderContent):
     121        (WebCore::TextureMapperNode::setContentsTileBackBuffer):
     122        * platform/graphics/texmap/TextureMapperNode.h:
     123        (TextureMapperNode):
     124
    11252012-02-02  Keishi Hattori  <keishi@webkit.org>
    2126
  • trunk/Source/WebCore/GNUmakefile.list.am

    r106620 r106630  
    57345734        Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.cpp \
    57355735        Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.h \
    5736         Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.cpp \
    5737         Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.h \
    5738         Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp \
    5739         Source/WebCore/platform/graphics/texmap/TextureMapperNode.h \
    5740         Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayer.h
     5736        Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp \
     5737        Source/WebCore/platform/graphics/texmap/TextureMapperNode.h \
     5738        Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayer.h
    57415739webcoregtk_sources += \
    57425740        Source/WebCore/platform/graphics/cairo/TextureMapperCairo.cpp \
     
    57565754        Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.cpp \
    57575755        Source/WebCore/platform/graphics/texmap/TextureMapperAnimation.h \
    5758         Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.cpp \
    5759         Source/WebCore/platform/graphics/texmap/TextureMapperImageBuffer.h \
    5760         Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp \
    5761         Source/WebCore/platform/graphics/texmap/TextureMapperNode.h \
     5756        Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp \
     5757        Source/WebCore/platform/graphics/texmap/TextureMapperNode.h \
    57625758        Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayer.h
    57635759webcoregtk_sources += \
  • trunk/Source/WebCore/Target.pri

    r106620 r106630  
    39403940contains(CONFIG, texmap) {
    39413941    HEADERS += \
     3942        platform/graphics/qt/TextureMapperQt.h \
    39423943        platform/graphics/texmap/GraphicsLayerTextureMapper.h \
    39433944        platform/graphics/texmap/LayerTransform.h \
    39443945        platform/graphics/texmap/TextureMapper.h \
    39453946        platform/graphics/texmap/TextureMapperAnimation.h \
    3946         platform/graphics/texmap/TextureMapperImageBuffer.h \
    39473947        platform/graphics/texmap/TextureMapperNode.h \
    39483948        platform/graphics/texmap/TextureMapperPlatformLayer.h
    39493949
    39503950    SOURCES += \
     3951        platform/graphics/qt/TextureMapperQt.cpp \
    39513952        platform/graphics/texmap/LayerTransform.cpp \
    39523953        platform/graphics/texmap/TextureMapper.cpp \
    39533954        platform/graphics/texmap/TextureMapperAnimation.cpp \
    3954         platform/graphics/texmap/TextureMapperImageBuffer.cpp \
    39553955        platform/graphics/texmap/TextureMapperNode.cpp \
    39563956        platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
     
    39603960        SOURCES += platform/graphics/opengl/TextureMapperGL.cpp
    39613961        CONFIG += opengl-shims
    3962         DEFINES += WTF_USE_TEXTURE_MAPPER_GL
    39633962    }
    39643963} else {
  • trunk/Source/WebCore/WebCore.gypi

    r106620 r106630  
    35813581            'platform/graphics/texmap/TextureMapperAnimation.cpp',
    35823582            'platform/graphics/texmap/TextureMapperAnimation.h',
    3583             'platform/graphics/texmap/TextureMapperImageBuffer.cpp',
    3584             'platform/graphics/texmap/TextureMapperImageBuffer.h',
    35853583            'platform/graphics/texmap/TextureMapperNode.cpp',
    35863584            'platform/graphics/texmap/TextureMapperNode.h',
  • trunk/Source/WebCore/platform/graphics/GraphicsContext.h

    r106620 r106630  
    125125    class GraphicsContext3D;
    126126    class TextRun;
    127     class TransformationMatrix;
    128127
    129128    enum TextDrawingMode {
     
    411410        AffineTransform getCTM() const;
    412411
    413 #if ENABLE(3D_RENDERING) && USE(TEXTURE_MAPPER)
    414         // This is needed when using accelerated-compositing in software mode, like in TextureMapper.
    415         void concat3DTransform(const TransformationMatrix&);
    416         void set3DTransform(const TransformationMatrix&);
    417         TransformationMatrix get3DTransform() const;
    418 #endif
    419412        // Create an image buffer compatible with this context, with suitable resolution
    420413        // for drawing into the buffer and then into this context.
  • trunk/Source/WebCore/platform/graphics/cairo/TextureMapperCairo.cpp

    r106620 r106630  
    116116}
    117117
     118PassOwnPtr<TextureMapper> TextureMapper::create(GraphicsContext* context)
     119{
     120    return adoptPtr(new TextureMapperCairo);
     121}
     122
    118123PassRefPtr<BitmapTexture> TextureMapperCairo::createTexture()
    119124{
  • trunk/Source/WebCore/platform/graphics/opengl/TextureMapperGL.cpp

    r106620 r106630  
    266266    };
    267267
     268    struct DirectlyCompositedImageRepository {
     269        struct Entry {
     270            GLuint texture;
     271            int refCount;
     272        };
     273        typedef HashMap<ImageUID, Entry> ImageTextureMap;
     274        ImageTextureMap imageToTexture;
     275
     276        GLuint findOrCreate(ImageUID image, bool& found)
     277        {
     278            ImageTextureMap::iterator it = imageToTexture.find(image);
     279            found = false;
     280            if (it != imageToTexture.end()) {
     281                it->second.refCount++;
     282                found = true;
     283                return it->second.texture;
     284            }
     285            Entry entry;
     286            GL_CMD(glGenTextures(1, &entry.texture));
     287            entry.refCount = 1;
     288            imageToTexture.add(image, entry);
     289            return entry.texture;
     290        }
     291
     292        bool deref(ImageUID image)
     293        {
     294            HashMap<ImageUID, Entry>::iterator it = imageToTexture.find(image);
     295            if (it != imageToTexture.end()) {
     296                if (it->second.refCount < 2) {
     297                    imageToTexture.remove(it);
     298                    return false;
     299                }
     300            }
     301            return true;
     302        }
     303
     304        DirectlyCompositedImageRepository()
     305        {
     306        }
     307
     308        ~DirectlyCompositedImageRepository()
     309        {
     310            for (ImageTextureMap::iterator it = imageToTexture.begin(); it != imageToTexture.end(); ++it) {
     311                GLuint texture = it->second.texture;
     312                if (texture)
     313                    GL_CMD(glDeleteTextures(1, &texture));
     314            }
     315
     316        }
     317    } directlyCompositedImages;
     318
    268319    SharedGLData& sharedGLData() const
    269320    {
     
    282333    GLint previousProgram;
    283334    GLint previousScissorState;
    284     GLint viewport[4];
    285335    RefPtr<SharedGLData> m_sharedGLData;
    286336};
     
    293343    virtual void reset(const IntSize&, bool opaque);
    294344    void bind();
     345    virtual PlatformGraphicsContext* beginPaint(const IntRect& dirtyRect);
     346    virtual void endPaint();
     347    virtual void setContentsToImage(Image*);
    295348    ~BitmapTextureGL() { destroy(); }
    296349    virtual uint32_t id() const { return m_id; }
     350    inline bool isOpaque() const { return m_opaque; }
    297351    inline FloatSize relativeSize() const { return m_relativeSize; }
    298352    void setTextureMapper(TextureMapperGL* texmap) { m_textureMapper = texmap; }
    299     void updateContents(Image*, const IntRect&, const IntRect&, PixelFormat);
    300     void updateContents(const void*, const IntRect&);
     353
     354    void updateContents(PixelFormat, const IntRect&, void*);
     355    void updateRawContents(const IntRect&, const void*);
     356    void pack()
     357    {
     358        // This is currently a stub.
     359        if (isPacked())
     360            return;
     361        m_isPacked = true;
     362    }
     363
     364    void unpack()
     365    {
     366        // This is currently a stub.
     367        if (!isPacked())
     368            return;
     369        m_isPacked = false;
     370    }
     371
     372    bool isPacked() const
     373    {
     374        return m_isPacked;
     375    }
    301376
    302377private:
    303378    GLuint m_id;
     379    ImageUID m_imageUID;
    304380    FloatSize m_relativeSize;
     381    bool m_opaque;
    305382    IntSize m_textureSize;
     383    OwnPtr<BGRA32PremultimpliedBuffer> m_buffer;
    306384    IntRect m_dirtyRect;
    307385    GLuint m_fbo;
     
    309387    IntSize m_actualSize;
    310388    bool m_surfaceNeedsReset;
     389    bool m_isPacked;
    311390    TextureMapperGL* m_textureMapper;
    312391    BitmapTextureGL()
    313392        : m_id(0)
     393        , m_imageUID(0)
     394        , m_opaque(false)
    314395        , m_fbo(0)
    315396        , m_rbo(0)
     
    464545    glClearStencil(0);
    465546    glClear(GL_STENCIL_BUFFER_BIT);
    466     glGetIntegerv(GL_VIEWPORT, data().viewport);
    467547    bindSurface(0);
    468548}
     
    584664{
    585665    BitmapTexture::reset(newSize, opaque);
     666    m_imageUID = 0;
    586667    IntSize newTextureSize = nextPowerOfTwo(newSize);
    587668    bool justCreated = false;
     
    602683    m_actualSize = newSize;
    603684    m_relativeSize = FloatSize(float(newSize.width()) / m_textureSize.width(), float(newSize.height()) / m_textureSize.height());
     685    m_opaque = opaque;
    604686    m_surfaceNeedsReset = true;
    605687}
    606688
    607 
     689PlatformGraphicsContext* BitmapTextureGL::beginPaint(const IntRect& dirtyRect)
     690{
     691    m_buffer = BGRA32PremultimpliedBuffer::create();
     692    m_dirtyRect = dirtyRect;
     693    return m_buffer->beginPaint(dirtyRect, m_opaque);
     694}
     695
     696void BitmapTextureGL::endPaint()
     697{
     698    if (!m_buffer)
     699        return;
     700    m_buffer->endPaint();
     701    updateContents(BGRAFormat, m_dirtyRect, m_buffer->data());
     702    GL_CMD(glBindTexture(GL_TEXTURE_2D, m_id))
     703    m_buffer.clear();
     704}
     705
     706#ifdef TEXMAP_OPENGL_ES_2
    608707static void swizzleBGRAToRGBA(uint32_t* data, const IntSize& size)
    609708{
     
    616715    }
    617716}
    618 
    619 void BitmapTextureGL::updateContents(const void* data, const IntRect& targetRect)
     717#endif
     718
     719void BitmapTextureGL::updateContents(PixelFormat pixelFormat, const IntRect& rect, void* bits)
    620720{
    621721    GL_CMD(glBindTexture(GL_TEXTURE_2D, m_id))
    622     GL_CMD(glTexSubImage2D(GL_TEXTURE_2D, 0, targetRect.x(), targetRect.y(), targetRect.width(), targetRect.height(), GL_RGBA, GL_UNSIGNED_BYTE, data))
    623 }
    624 
    625 void BitmapTextureGL::updateContents(Image* image, const IntRect& targetRect, const IntRect& sourceRect, BitmapTexture::PixelFormat format)
    626 {
    627     if (!image)
    628         return;
     722#ifdef TEXMAP_OPENGL_ES_2
     723    bool shouldSwizzle = false;
     724#endif
     725
     726    GLint glFormat = GL_RGBA;
     727    switch (pixelFormat) {
     728    case RGBAFormat:
     729        glFormat = GL_RGBA;
     730        break;
     731    case RGBFormat:
     732        glFormat = GL_RGB;
     733        break;
     734    case BGRAFormat:
     735#ifdef TEXMAP_OPENGL_ES_2
     736        shouldSwizzle = true;
     737        glFormat = GL_RGBA;
     738#else
     739        glFormat = GL_BGRA;
     740#endif
     741        break;
     742    case BGRFormat:
     743#ifdef TEXMAP_OPENGL_ES_2
     744        shouldSwizzle = true;
     745        glFormat = GL_RGB;
     746#else
     747        glFormat = GL_BGR;
     748#endif
     749         break;
     750    }
     751
     752#ifdef TEXMAP_OPENGL_ES_2
     753    if (shouldSwizzle)
     754        swizzleBGRAToRGBA(static_cast<uint32_t*>(bits), rect.size());
     755#endif
     756    GL_CMD(glTexSubImage2D(GL_TEXTURE_2D, 0, rect.x(), rect.y(), rect.width(), rect.height(), glFormat, GL_UNSIGNED_BYTE, bits))
     757}
     758
     759void BitmapTextureGL::updateRawContents(const IntRect& rect, const void* bits)
     760{
    629761    GL_CMD(glBindTexture(GL_TEXTURE_2D, m_id))
    630762    GLuint glFormat = isOpaque() ? GL_RGB : GL_RGBA;
    631     NativeImagePtr frameImage = image->nativeImageForCurrentFrame();
    632     if (!frameImage)
    633         return;
    634 
    635 #if PLATFORM(QT)
    636     QImage qtImage = frameImage->toImage();
    637     if (IntSize(qtImage.size()) != sourceRect.size())
    638         qtImage = qtImage.copy(sourceRect);
    639     if (format == BGRAFormat || format == BGRFormat)
    640         swizzleBGRAToRGBA(reinterpret_cast<uint32_t*>(qtImage.bits()), qtImage.size());
    641     GL_CMD(glTexSubImage2D(GL_TEXTURE_2D, 0, targetRect.x(), targetRect.y(), targetRect.width(), targetRect.height(), glFormat, GL_UNSIGNED_BYTE, qtImage.constBits()))
    642 #endif
     763    GL_CMD(glTexSubImage2D(GL_TEXTURE_2D, 0, rect.x(), rect.y(), rect.width(), rect.height(), glFormat, GL_UNSIGNED_BYTE, bits))
     764}
     765
     766void BitmapTextureGL::setContentsToImage(Image* image)
     767{
     768    ImageUID uid = image ? uidForImage(image) : 0;
     769    if (!image || !uid) {
     770        if (m_imageUID)
     771            destroy();
     772        return;
     773    }
     774
     775    if (uid == m_imageUID)
     776        return;
     777    bool found = false;
     778    GLuint newTextureID = m_textureMapper->data().directlyCompositedImages.findOrCreate(uid, found);
     779    if (newTextureID != m_id) {
     780        m_imageUID = uid;
     781        destroy();
     782        m_id = newTextureID;
     783        reset(image->size(), false);
     784        if (!found) {
     785            GraphicsContext context(beginPaint(IntRect(0, 0, m_textureSize.width(), m_textureSize.height())));
     786            context.drawImage(image, ColorSpaceDeviceRGB, IntPoint(0, 0), CompositeCopy);
     787            endPaint();
     788        }
     789    }
    643790}
    644791
     
    691838void BitmapTextureGL::destroy()
    692839{
    693     if (m_id)
     840    if (m_id && (!m_imageUID || !m_textureMapper->data().directlyCompositedImages.deref(m_imageUID)))
    694841        GL_CMD(glDeleteTextures(1, &m_id))
    695842
     
    726873
    727874    if (!surface) {
    728         IntSize viewportSize(data().viewport[2], data().viewport[3]);
    729875        GL_CMD(glBindFramebuffer(GL_FRAMEBUFFER, 0))
    730         data().projectionMatrix = createProjectionMatrix(viewportSize, true);
     876        data().projectionMatrix = createProjectionMatrix(viewportSize(), true).multiply(transform());
    731877        GL_CMD(glStencilFunc(data().sharedGLData().stencilIndex > 1 ? GL_EQUAL : GL_ALWAYS, data().sharedGLData().stencilIndex - 1, data().sharedGLData().stencilIndex - 1))
    732878        GL_CMD(glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP))
    733         GL_CMD(glViewport(0, 0, viewportSize.width(), viewportSize.height()))
    734         data().sharedGLData().clipStack.append(IntRect(data().viewport[0], data().viewport[1], data().viewport[2], data().viewport[3]));
     879        GL_CMD(glViewport(0, 0, viewportSize().width(), viewportSize().height()))
     880        data().sharedGLData().clipStack.append(IntRect(IntPoint::zero(), viewportSize()));
    735881        return;
    736882    }
     
    840986}
    841987
    842 PassOwnPtr<TextureMapper> TextureMapper::platformCreateAccelerated()
    843 {
    844     return TextureMapperGL::create();
    845 }
    846 
    847988};
  • trunk/Source/WebCore/platform/graphics/opengl/TextureMapperGL.h

    r106620 r106630  
    4444    virtual void bindSurface(BitmapTexture* surface);
    4545    virtual void beginClip(const TransformationMatrix&, const FloatRect&);
    46     virtual void beginPainting();
    47     virtual void endPainting();
    4846    virtual void endClip();
     47    virtual bool allowSurfaceForRoot() const { return false; }
    4948    virtual PassRefPtr<BitmapTexture> createTexture();
    5049    virtual const char* type() const;
    5150    static PassOwnPtr<TextureMapperGL> create() { return adoptPtr(new TextureMapperGL); }
     51    void beginPainting();
     52    void endPainting();
    5253    void setGraphicsContext(GraphicsContext* context) { m_context = context; }
    5354    GraphicsContext* graphicsContext() { return m_context; }
    5455    virtual bool isOpenGLBacked() const { return true; }
    55     void platformUpdateContents(NativeImagePtr, const IntRect&, const IntRect&, BitmapTexture::PixelFormat);
    56     virtual AccelerationMode accelerationMode() const { return OpenGLMode; }
    5756
    5857private:
     
    6665
    6766// An offscreen buffer to be rendered by software.
     67class BGRA32PremultimpliedBuffer {
     68    WTF_MAKE_FAST_ALLOCATED;
     69public:
     70    virtual ~BGRA32PremultimpliedBuffer() { }
     71    virtual PlatformGraphicsContext* beginPaint(const IntRect& dirtyRect, bool opaque) = 0;
     72    virtual void endPaint() = 0;
     73    virtual void* data() = 0;
     74    static PassOwnPtr<BGRA32PremultimpliedBuffer> create();
     75};
     76
    6877static inline int nextPowerOfTwo(int num)
    6978{
  • trunk/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp

    r106620 r106630  
    147147    blitMultisampleFramebufferAndRestoreContext();
    148148
    149     if (textureMapper->accelerationMode() == TextureMapper::OpenGLMode) {
     149    if (textureMapper->isOpenGLBacked()) {
    150150        TextureMapperGL* texmapGL = static_cast<TextureMapperGL*>(textureMapper);
    151151        texmapGL->drawTexture(m_context->m_texture, !m_context->m_attrs.alpha, FloatSize(1, 1), targetRect, matrix, opacity, mask, true /* flip */);
  • trunk/Source/WebCore/platform/graphics/qt/GraphicsContextQt.cpp

    r106620 r106630  
    13361336}
    13371337
    1338 #if ENABLE(3D_RENDERING) && USE(TEXTURE_MAPPER)
    1339 TransformationMatrix GraphicsContext::get3DTransform() const
    1340 {
    1341     if (paintingDisabled())
    1342         return TransformationMatrix();
    1343 
    1344     return platformContext()->combinedTransform();
    1345 }
    1346 
    1347 void GraphicsContext::concat3DTransform(const TransformationMatrix& transform)
    1348 {
    1349     if (paintingDisabled())
    1350         return;
    1351 
    1352     m_data->p()->setWorldTransform(transform, true);
    1353 }
    1354 
    1355 void GraphicsContext::set3DTransform(const TransformationMatrix& transform)
    1356 {
    1357     if (paintingDisabled())
    1358         return;
    1359 
    1360     m_data->p()->setWorldTransform(transform, false);
    1361 }
    1362 #endif
    1363 
    13641338void GraphicsContext::setURLForRect(const KURL&, const IntRect&)
    13651339{
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapper.cpp

    r106620 r106630  
    2020#include "config.h"
    2121#include "TextureMapper.h"
    22 
    23 #include "TextureMapperImageBuffer.h"
    2422
    2523#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER)
     
    7472}
    7573
    76 
    77 PassOwnPtr<TextureMapper> TextureMapper::create(AccelerationMode mode)
    78 {
    79     if (mode == SoftwareMode)
    80         return TextureMapperImageBuffer::create();
    81     return platformCreateAccelerated();
    82 }
    83 
    8474}
    8575#endif
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapper.h

    r106620 r106630  
    4848public:
    4949    enum PixelFormat { BGRAFormat, RGBAFormat, BGRFormat, RGBFormat };
    50     BitmapTexture()
    51         : m_isOpaque(true)
    52     {
    53     }
    54 
     50    BitmapTexture() : m_lockCount(0) {}
    5551    virtual ~BitmapTexture() { }
    5652    virtual void destroy() { }
    5753
     54    virtual bool allowOfflineTextureUpload() const { return false; }
    5855    virtual IntSize size() const = 0;
    59     virtual void updateContents(Image*, const IntRect&, const IntRect&, BitmapTexture::PixelFormat) = 0;
    60     virtual void updateContents(const void*, const IntRect&) = 0;
     56    virtual int bpp() const { return 32; }
    6157    virtual bool isValid() const = 0;
    62 
    63     virtual int bpp() const { return 32; }
    6458    virtual void reset(const IntSize& size, bool opaque = false)
    6559    {
     
    6862    }
    6963
     64    virtual void pack() { }
     65    virtual void unpack() { }
     66    virtual bool isPacked() const { return false; }
     67
     68    virtual PlatformGraphicsContext* beginPaint(const IntRect& dirtyRect) = 0;
     69    virtual void endPaint() = 0;
     70
     71    // For performance reasons, BitmapTexture might modify the bits directly (swizzle).
     72    // Thus, this method is only recommended for buffer update, such as used by WebKit2.
     73    virtual void updateContents(PixelFormat, const IntRect&, void* bits) = 0;
     74    virtual void updateRawContents(const IntRect&, const void* bits) { }
     75    virtual PlatformGraphicsContext* beginPaintMedia()
     76    {
     77        return beginPaint(IntRect(0, 0, size().width(), size().height()));
     78    }
     79    virtual void setContentsToImage(Image*) = 0;
     80    virtual bool save(const String&) { return false; }
     81
     82    inline void lock() { ++m_lockCount; }
     83    inline void unlock() { --m_lockCount; }
     84    inline bool isLocked() { return m_lockCount; }
    7085    inline IntSize contentSize() const { return m_contentSize; }
    7186    inline int numberOfBytes() const { return size().width() * size().height() * bpp() >> 3; }
    72     inline bool isOpaque() const { return m_isOpaque; }
    7387
    7488protected:
     89    int m_lockCount;
    7590    IntSize m_contentSize;
    7691    bool m_isOpaque;
     
    8398
    8499public:
    85     enum AccelerationMode { SoftwareMode, OpenGLMode };
    86     static PassOwnPtr<TextureMapper> create(AccelerationMode newMode = SoftwareMode);
     100    static PassOwnPtr<TextureMapper> create(GraphicsContext* graphicsContext = 0);
    87101    virtual ~TextureMapper() { }
    88102
     
    91105    // makes a surface the target for the following drawTexture calls.
    92106    virtual void bindSurface(BitmapTexture* surface) = 0;
    93     virtual void setGraphicsContext(GraphicsContext* context) { m_context = context; }
    94     virtual GraphicsContext* graphicsContext() { return m_context; }
     107    virtual void setGraphicsContext(GraphicsContext*) = 0;
     108    virtual GraphicsContext* graphicsContext() = 0;
    95109    virtual void beginClip(const TransformationMatrix&, const FloatRect&) = 0;
    96110    virtual void endClip() = 0;
     111    virtual bool allowSurfaceForRoot() const = 0;
    97112    virtual PassRefPtr<BitmapTexture> createTexture() = 0;
     113    IntSize viewportSize() const { return m_viewportSize; }
     114    void setViewportSize(const IntSize& s) { m_viewportSize = s; }
    98115
    99116    void setImageInterpolationQuality(InterpolationQuality quality) { m_interpolationQuality = quality; }
     
    102119    InterpolationQuality imageInterpolationQuality() const { return m_interpolationQuality; }
    103120    TextDrawingModeFlags textDrawingMode() const { return m_textDrawingMode; }
    104     virtual AccelerationMode accelerationMode() const = 0;
     121    virtual bool allowPartialUpdates() const { return false; }
     122    virtual bool isOpenGLBacked() const { return false; }
     123
     124    void setTransform(const TransformationMatrix& matrix) { m_transform = matrix; }
     125    TransformationMatrix transform() const { return m_transform; }
    105126
    106127    virtual void beginPainting() { }
     
    109130    // A surface is released implicitly when dereferenced.
    110131    virtual PassRefPtr<BitmapTexture> acquireTextureFromPool(const IntSize&);
     132
    111133
    112134protected:
     
    117139
    118140private:
    119 #if USE(TEXTURE_MAPPER_GL)
    120     static PassOwnPtr<TextureMapper> platformCreateAccelerated();
    121 #else
    122     static PassOwnPtr<TextureMapper> platformCreateAccelerated()
    123     {
    124         return 0;
    125     }
    126 #endif
    127141    InterpolationQuality m_interpolationQuality;
    128142    TextDrawingModeFlags m_textDrawingMode;
     143    TransformationMatrix m_transform;
     144    IntSize m_viewportSize;
    129145    Vector<RefPtr<BitmapTexture> > m_texturePool;
    130     GraphicsContext* m_context;
    131146};
    132147
    133 }
     148};
    134149
    135150#endif
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp

    r106620 r106630  
    2424
    2525#include "GraphicsLayerTextureMapper.h"
    26 #include "ImageBuffer.h"
    2726#include "MathExtras.h"
    2827
     
    158157        return;
    159158
    160     IntRect dirtyRect = enclosingIntRect(m_currentContent.needsDisplay ? entireRect() : m_currentContent.needsDisplayRect);
     159    // FIXME: Add directly composited images.
     160    FloatRect dirtyRect = m_currentContent.needsDisplay ? entireRect() : m_currentContent.needsDisplayRect;
    161161
    162162    for (size_t tileIndex = 0; tileIndex < m_ownedTiles.size(); ++tileIndex) {
    163163        OwnedTile& tile = m_ownedTiles[tileIndex];
     164        FloatRect rect = dirtyRect;
    164165        if (!tile.texture)
    165166            tile.texture = textureMapper->createTexture();
     
    169170        if (tile.needsReset || texture->contentSize() != tileSize || !texture->isValid()) {
    170171            tile.needsReset = false;
    171             texture->reset(tileSize, m_state.contentsOpaque);
    172             dirtyRect.unite(enclosingIntRect(tile.rect));
    173         }
    174     }
    175 
    176     if (dirtyRect.isEmpty())
    177         return;
    178 
    179     // Paint the entire dirty rect into an image buffer. This ensures we only paint once.
    180     OwnPtr<ImageBuffer> imageBuffer = ImageBuffer::create(dirtyRect.size());
    181     GraphicsContext* context = imageBuffer->context();
    182     context->setImageInterpolationQuality(textureMapper->imageInterpolationQuality());
    183     context->setTextDrawingMode(textureMapper->textDrawingMode());
    184     context->translate(-dirtyRect.x(), -dirtyRect.y());
    185     layer->paintGraphicsLayerContents(*context, dirtyRect);
    186     if (m_currentContent.contentType == DirectImageContentType)
    187         context->drawImage(m_currentContent.image.get(), ColorSpaceDeviceRGB, m_state.contentsRect);
    188 
    189     // FIXME: Implement ImageBuffer::DontCopyBackingStore in Qt/GTK ports, and then change this.
    190     // See https://bugs.webkit.org/show_bug.cgi?id=77689
    191     RefPtr<Image> image = imageBuffer->copyImage(CopyBackingStore);
    192 
    193     // Divide the image to tiles.
    194     for (size_t tileIndex = 0; tileIndex < m_ownedTiles.size(); ++tileIndex) {
    195         OwnedTile& tile = m_ownedTiles[tileIndex];
    196         IntRect targetRect = enclosingIntRect(tile.rect);
    197         targetRect.intersect(dirtyRect);
    198         if (targetRect.isEmpty())
     172            texture->reset(tileSize, m_currentContent.contentType == DirectImageContentType ? false : m_state.contentsOpaque);
     173            rect = tile.rect;
     174        }
     175
     176        IntRect contentRect = enclosingIntRect(tile.rect);
     177        contentRect.intersect(enclosingIntRect(rect));
     178        if (contentRect.isEmpty())
    199179            continue;
    200         IntRect sourceRect = targetRect;
    201 
    202         // Normalize sourceRect to the buffer's coordinates.
    203         sourceRect.move(-dirtyRect.x(), -dirtyRect.y());
    204 
    205         // Normalize targetRect to the texture's coordinqates.
    206         targetRect.move(-tile.rect.x(), -tile.rect.y());
    207         tile.texture->updateContents(image.get(), targetRect, sourceRect, BitmapTexture::RGBAFormat);
     180
     181        FloatRect contentRectInTileCoordinates = contentRect;
     182        FloatPoint offset(-tile.rect.x(), -tile.rect.y());
     183        contentRectInTileCoordinates.move(offset.x(), offset.y());
     184
     185        {
     186            GraphicsContext context(texture->beginPaint(enclosingIntRect(contentRectInTileCoordinates)));
     187            context.setImageInterpolationQuality(textureMapper->imageInterpolationQuality());
     188            context.setTextDrawingMode(textureMapper->textDrawingMode());
     189            context.translate(offset.x(), offset.y());
     190            FloatRect scaledContentRect(contentRect);
     191            if (m_currentContent.contentType == DirectImageContentType)
     192                context.drawImage(m_currentContent.image.get(), ColorSpaceDeviceRGB, IntPoint(0, 0));
     193            else
     194                layer->paintGraphicsLayerContents(context, enclosingIntRect(scaledContentRect));
     195            texture->endPaint();
     196        }
    208197    }
    209198
     
    493482}
    494483
    495 void TextureMapperNode::setContentsTileBackBuffer(int id, const IntRect& sourceRect, const IntRect& targetRect, const void* data)
     484void TextureMapperNode::setContentsTileBackBuffer(int id, const IntRect& sourceRect, const IntRect& targetRect, const void* bits)
    496485{
    497486    ASSERT(m_textureMapper);
     
    510499        tile.backBuffer.texture = m_textureMapper->createTexture();
    511500    tile.backBuffer.texture->reset(sourceRect.size(), false);
    512     tile.backBuffer.texture->updateContents(data, sourceRect);
     501    tile.backBuffer.texture->updateRawContents(sourceRect, bits);
    513502    tile.isBackBufferUpdated = true;
    514503}
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperNode.h

    r106620 r106630  
    149149    int createContentsTile(float scale);
    150150    void removeContentsTile(int id);
    151     void setContentsTileBackBuffer(int id, const IntRect& sourceRect, const IntRect& targetRect, const void*);
     151    void setContentsTileBackBuffer(int id, const IntRect& sourceRect, const IntRect& targetRect, const void* bits);
    152152    void setTileBackBufferTextureForDirectlyCompositedImage(int id, const IntRect& sourceRect, const FloatRect& targetRect, BitmapTexture*);
    153153    void clearAllDirectlyCompositedImageTiles();
  • trunk/Source/WebKit/qt/Api/qwebframe.cpp

    r106620 r106630  
    337337    textureMapper->setImageInterpolationQuality(context->imageInterpolationQuality());
    338338    textureMapper->setTextDrawingMode(context->textDrawingMode());
     339    textureMapper->setViewportSize(frame->view()->frameRect().size());
    339340    QPainter* painter = context->platformContext();
    340341    const QTransform transform = painter->worldTransform();
  • trunk/Source/WebKit/qt/ChangeLog

    r106620 r106630  
     12012-02-02  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r106620.
     4        http://trac.webkit.org/changeset/106620
     5        https://bugs.webkit.org/show_bug.cgi?id=77716
     6
     7        It broke non ENABLE(3D_RENDERING) builds (Requested by
     8        Ossy_morning on #webkit).
     9
     10        * Api/qwebframe.cpp:
     11        (QWebFramePrivate::renderCompositedLayers):
     12        * WebCoreSupport/PageClientQt.cpp:
     13        (WebCore::PageClientQWidget::setRootGraphicsLayer):
     14        (WebCore::PageClientQGraphicsWidget::setRootGraphicsLayer):
     15
    1162012-02-02  No'am Rosenthal  <noam.rosenthal@nokia.com>
    217
  • trunk/Source/WebKit/qt/WebCoreSupport/PageClientQt.cpp

    r106620 r106630  
    2929
    3030#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER)
    31 #include "TextureMapper.h"
     31#include "TextureMapperQt.h"
    3232#include "texmap/TextureMapperNode.h"
     33
     34#if USE(TEXTURE_MAPPER_GL)
     35#include "opengl/TextureMapperGL.h"
     36#endif
    3337#endif
    3438
     
    7377    if (layer) {
    7478        textureMapperNodeClient = adoptPtr(new TextureMapperNodeClientQt(page->mainFrame(), layer));
    75         textureMapperNodeClient->setTextureMapper(TextureMapper::create());
     79        textureMapperNodeClient->setTextureMapper(adoptPtr(new TextureMapperQt));
    7680        textureMapperNodeClient->syncRootLayer();
    7781        return;
     
    264268        QGraphicsView* graphicsView = view->scene()->views()[0];
    265269        if (graphicsView && graphicsView->viewport() && graphicsView->viewport()->inherits("QGLWidget")) {
    266             textureMapperNodeClient->setTextureMapper(TextureMapper::create(TextureMapper::OpenGLMode));
     270            textureMapperNodeClient->setTextureMapper(TextureMapperGL::create());
    267271            return;
    268272        }
    269273#endif
    270         textureMapperNodeClient->setTextureMapper(TextureMapper::create());
     274        textureMapperNodeClient->setTextureMapper(TextureMapperQt::create());
    271275        return;
    272276    }
  • trunk/Source/WebKit2/ChangeLog

    r106620 r106630  
     12012-02-02  Sheriff Bot  <webkit.review.bot@gmail.com>
     2
     3        Unreviewed, rolling out r106620.
     4        http://trac.webkit.org/changeset/106620
     5        https://bugs.webkit.org/show_bug.cgi?id=77716
     6
     7        It broke non ENABLE(3D_RENDERING) builds (Requested by
     8        Ossy_morning on #webkit).
     9
     10        * UIProcess/qt/LayerTreeHostProxyQt.cpp:
     11        (WebKit::LayerTreeHostProxy::paintToCurrentGLContext):
     12        (WebKit::LayerTreeHostProxy::paintToGraphicsContext):
     13        (WebKit::LayerTreeHostProxy::createImage):
     14        (WebKit::LayerTreeHostProxy::ensureRootLayer):
     15
    1162012-02-02  No'am Rosenthal  <noam.rosenthal@nokia.com>
    217
  • trunk/Source/WebKit2/UIProcess/qt/LayerTreeHostProxyQt.cpp

    r106620 r106630  
    2727#include "MessageID.h"
    2828#include "ShareableBitmap.h"
    29 #include "TextureMapper.h"
     29#include "TextureMapperGL.h"
     30#include "TextureMapperQt.h"
    3031#include "UpdateInfo.h"
    3132#include "WebCoreArgumentCoders.h"
     
    171172{
    172173    if (!m_textureMapper)
    173         m_textureMapper = TextureMapper::create(TextureMapper::OpenGLMode);
    174     ASSERT(m_textureMapper->accelerationMode() == TextureMapper::OpenGLMode);
     174        m_textureMapper = TextureMapperGL::create();
     175    ASSERT(dynamic_cast<TextureMapperGL*>(m_textureMapper.get()));
    175176
    176177    syncRemoteContent();
     
    184185        return;
    185186
     187    GLint viewport[4];
     188    glGetIntegerv(GL_VIEWPORT, viewport);
     189    m_textureMapper->setViewportSize(IntSize(viewport[2], viewport[3]));
    186190    node->setTextureMapper(m_textureMapper.get());
    187191    m_textureMapper->beginPainting();
     
    208212{
    209213    if (!m_textureMapper)
    210         m_textureMapper = TextureMapper::create();
    211     ASSERT(m_textureMapper->accelerationMode() == TextureMapper::SoftwareMode);
     214        m_textureMapper = TextureMapperQt::create();
     215    ASSERT(dynamic_cast<TextureMapperQt*>(m_textureMapper.get()));
     216
    212217    syncRemoteContent();
    213218    TextureMapperNode* node = toTextureMapperNode(rootLayer());
     
    406411            RefPtr<BitmapTexture> texture = m_textureMapper->createTexture();
    407412            texture->reset(rect.size(), !imageHasAlpha);
    408             texture->updateContents(subImage.constBits(), IntRect(IntPoint::zero(), rect.size()));
     413            texture->updateRawContents(IntRect(IntPoint::zero(), rect.size()), subImage.constBits());
    409414            tiledImage.add(rect.location(), texture);
    410415        }
     
    469474    m_rootLayer->setSize(FloatSize(1.0, 1.0));
    470475    if (!m_textureMapper)
    471         m_textureMapper = TextureMapper::create(TextureMapper::OpenGLMode);
     476        m_textureMapper = TextureMapperGL::create();
    472477    toTextureMapperNode(m_rootLayer.get())->setTextureMapper(m_textureMapper.get());
    473478}
Note: See TracChangeset for help on using the changeset viewer.