Changeset 194103 in webkit


Ignore:
Timestamp:
Dec 15, 2015 3:54:13 AM (8 years ago)
Author:
zandobersek@gmail.com
Message:

[TexMap] Operate with a reference to the TextureMapper wherever possible
https://bugs.webkit.org/show_bug.cgi?id=152118

Reviewed by Martin Robinson.

Source/WebCore:

In most cases where used, the pointer to the TextureMapper is non-null, so it
should really be a reference. The pointer is still used for the
TextureMapperLayer member variable which is null until the TextureMapper object
is created and set on the root layer.

  • platform/graphics/GraphicsContext3DPrivate.cpp:

(WebCore::GraphicsContext3DPrivate::paintToTextureMapper):

  • platform/graphics/GraphicsContext3DPrivate.h:
  • platform/graphics/cairo/ImageBufferCairo.cpp:

(WebCore::ImageBufferData::paintToTextureMapper):

  • platform/graphics/cairo/ImageBufferDataCairo.h:
  • platform/graphics/efl/GraphicsContext3DPrivate.cpp:

(WebCore::GraphicsContext3DPrivate::paintToTextureMapper):

  • platform/graphics/efl/GraphicsContext3DPrivate.h:
  • platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:

(WebCore::MediaPlayerPrivateGStreamerBase::paintToTextureMapper):

  • platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
  • platform/graphics/surfaces/GraphicsSurface.cpp:

(WebCore::GraphicsSurface::paintToTextureMapper):

  • platform/graphics/surfaces/GraphicsSurface.h:
  • platform/graphics/surfaces/efl/GraphicsSurfaceCommon.cpp:

(WebCore::GraphicsSurface::platformPaintToTextureMapper):

  • platform/graphics/texmap/BitmapTexture.cpp:

(WebCore::BitmapTexture::updateContents):

  • platform/graphics/texmap/BitmapTexture.h:

(WebCore::BitmapTexture::applyFilters):

  • platform/graphics/texmap/BitmapTextureGL.cpp:

(WebCore::BitmapTextureGL::applyFilters):

  • platform/graphics/texmap/BitmapTextureGL.h:
  • platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:

(WebCore::GraphicsLayerTextureMapper::updateBackingStoreIfNeeded):

  • platform/graphics/texmap/TextureMapperBackingStore.h:

(WebCore::TextureMapperBackingStore::drawRepaintCounter):

  • platform/graphics/texmap/TextureMapperFPSCounter.cpp:

(WebCore::TextureMapperFPSCounter::updateFPSAndDisplay):

  • platform/graphics/texmap/TextureMapperFPSCounter.h:
  • platform/graphics/texmap/TextureMapperLayer.cpp:

(WebCore::TextureMapperPaintOptions::TextureMapperPaintOptions):
(WebCore::TextureMapperLayer::paint):
(WebCore::TextureMapperLayer::paintSelf):
(WebCore::TextureMapperLayer::paintSelfAndChildren):
(WebCore::TextureMapperLayer::paintUsingOverlapRegions):
(WebCore::TextureMapperLayer::applyMask):
(WebCore::TextureMapperLayer::paintIntoSurface):
(WebCore::commitSurface):
(WebCore::TextureMapperLayer::paintWithIntermediateSurface):

  • platform/graphics/texmap/TextureMapperPlatformLayer.h:

(WebCore::TextureMapperPlatformLayer::drawBorder):

  • platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:

(WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):

  • platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
  • platform/graphics/texmap/TextureMapperSurfaceBackingStore.cpp:

(WebCore::TextureMapperSurfaceBackingStore::paintToTextureMapper):

  • platform/graphics/texmap/TextureMapperSurfaceBackingStore.h:
  • platform/graphics/texmap/TextureMapperTile.cpp:

(WebCore::TextureMapperTile::updateContents):
(WebCore::TextureMapperTile::paint):

  • platform/graphics/texmap/TextureMapperTile.h:
  • platform/graphics/texmap/TextureMapperTiledBackingStore.cpp:

(WebCore::TextureMapperTiledBackingStore::updateContentsFromImageIfNeeded):
(WebCore::TextureMapperTiledBackingStore::paintToTextureMapper):
(WebCore::TextureMapperTiledBackingStore::drawBorder):
(WebCore::TextureMapperTiledBackingStore::drawRepaintCounter):
(WebCore::TextureMapperTiledBackingStore::updateContents):

  • platform/graphics/texmap/TextureMapperTiledBackingStore.h:

Source/WebKit/win:

  • WebCoreSupport/AcceleratedCompositingContext.cpp:

(AcceleratedCompositingContext::compositeLayersToContext): TextureMapper object
is now operated with through a reference.

Source/WebKit2:

Replace pointers to the TextureMapper object with references.

  • Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:

(WebKit::CoordinatedBackingStoreTile::swapBuffers):
(WebKit::CoordinatedBackingStore::paintTilesToTextureMapper):
(WebKit::CoordinatedBackingStore::paintToTextureMapper):
(WebKit::CoordinatedBackingStore::drawBorder):
(WebKit::CoordinatedBackingStore::drawRepaintCounter):
(WebKit::CoordinatedBackingStore::commitTileOperations):

  • Shared/CoordinatedGraphics/CoordinatedBackingStore.h:
  • Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:

(WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
(WebKit::CoordinatedGraphicsScene::paintToGraphicsContext):
(WebKit::CoordinatedGraphicsScene::commitPendingBackingStoreOperations):

Location:
trunk/Source
Files:
36 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r194100 r194103  
     12015-12-15  Zan Dobersek  <zdobersek@igalia.com>
     2
     3        [TexMap] Operate with a reference to the TextureMapper wherever possible
     4        https://bugs.webkit.org/show_bug.cgi?id=152118
     5
     6        Reviewed by Martin Robinson.
     7
     8        In most cases where used, the pointer to the TextureMapper is non-null, so it
     9        should really be a reference. The pointer is still used for the
     10        TextureMapperLayer member variable which is null until the TextureMapper object
     11        is created and set on the root layer.
     12
     13        * platform/graphics/GraphicsContext3DPrivate.cpp:
     14        (WebCore::GraphicsContext3DPrivate::paintToTextureMapper):
     15        * platform/graphics/GraphicsContext3DPrivate.h:
     16        * platform/graphics/cairo/ImageBufferCairo.cpp:
     17        (WebCore::ImageBufferData::paintToTextureMapper):
     18        * platform/graphics/cairo/ImageBufferDataCairo.h:
     19        * platform/graphics/efl/GraphicsContext3DPrivate.cpp:
     20        (WebCore::GraphicsContext3DPrivate::paintToTextureMapper):
     21        * platform/graphics/efl/GraphicsContext3DPrivate.h:
     22        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
     23        (WebCore::MediaPlayerPrivateGStreamerBase::paintToTextureMapper):
     24        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
     25        * platform/graphics/surfaces/GraphicsSurface.cpp:
     26        (WebCore::GraphicsSurface::paintToTextureMapper):
     27        * platform/graphics/surfaces/GraphicsSurface.h:
     28        * platform/graphics/surfaces/efl/GraphicsSurfaceCommon.cpp:
     29        (WebCore::GraphicsSurface::platformPaintToTextureMapper):
     30        * platform/graphics/texmap/BitmapTexture.cpp:
     31        (WebCore::BitmapTexture::updateContents):
     32        * platform/graphics/texmap/BitmapTexture.h:
     33        (WebCore::BitmapTexture::applyFilters):
     34        * platform/graphics/texmap/BitmapTextureGL.cpp:
     35        (WebCore::BitmapTextureGL::applyFilters):
     36        * platform/graphics/texmap/BitmapTextureGL.h:
     37        * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
     38        (WebCore::GraphicsLayerTextureMapper::updateBackingStoreIfNeeded):
     39        * platform/graphics/texmap/TextureMapperBackingStore.h:
     40        (WebCore::TextureMapperBackingStore::drawRepaintCounter):
     41        * platform/graphics/texmap/TextureMapperFPSCounter.cpp:
     42        (WebCore::TextureMapperFPSCounter::updateFPSAndDisplay):
     43        * platform/graphics/texmap/TextureMapperFPSCounter.h:
     44        * platform/graphics/texmap/TextureMapperLayer.cpp:
     45        (WebCore::TextureMapperPaintOptions::TextureMapperPaintOptions):
     46        (WebCore::TextureMapperLayer::paint):
     47        (WebCore::TextureMapperLayer::paintSelf):
     48        (WebCore::TextureMapperLayer::paintSelfAndChildren):
     49        (WebCore::TextureMapperLayer::paintUsingOverlapRegions):
     50        (WebCore::TextureMapperLayer::applyMask):
     51        (WebCore::TextureMapperLayer::paintIntoSurface):
     52        (WebCore::commitSurface):
     53        (WebCore::TextureMapperLayer::paintWithIntermediateSurface):
     54        * platform/graphics/texmap/TextureMapperPlatformLayer.h:
     55        (WebCore::TextureMapperPlatformLayer::drawBorder):
     56        * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
     57        (WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):
     58        * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
     59        * platform/graphics/texmap/TextureMapperSurfaceBackingStore.cpp:
     60        (WebCore::TextureMapperSurfaceBackingStore::paintToTextureMapper):
     61        * platform/graphics/texmap/TextureMapperSurfaceBackingStore.h:
     62        * platform/graphics/texmap/TextureMapperTile.cpp:
     63        (WebCore::TextureMapperTile::updateContents):
     64        (WebCore::TextureMapperTile::paint):
     65        * platform/graphics/texmap/TextureMapperTile.h:
     66        * platform/graphics/texmap/TextureMapperTiledBackingStore.cpp:
     67        (WebCore::TextureMapperTiledBackingStore::updateContentsFromImageIfNeeded):
     68        (WebCore::TextureMapperTiledBackingStore::paintToTextureMapper):
     69        (WebCore::TextureMapperTiledBackingStore::drawBorder):
     70        (WebCore::TextureMapperTiledBackingStore::drawRepaintCounter):
     71        (WebCore::TextureMapperTiledBackingStore::updateContents):
     72        * platform/graphics/texmap/TextureMapperTiledBackingStore.h:
     73
    1742015-12-15  Youenn Fablet  <youenn.fablet@crf.canon.fr>
    275
  • trunk/Source/WebCore/platform/graphics/GraphicsContext3DPrivate.cpp

    r193723 r194103  
    113113}
    114114#elif USE(TEXTURE_MAPPER) && !USE(COORDINATED_GRAPHICS_THREADED)
    115 void GraphicsContext3DPrivate::paintToTextureMapper(TextureMapper* textureMapper, const FloatRect& targetRect, const TransformationMatrix& matrix, float opacity)
     115void GraphicsContext3DPrivate::paintToTextureMapper(TextureMapper& textureMapper, const FloatRect& targetRect, const TransformationMatrix& matrix, float opacity)
    116116{
    117117    if (!m_glContext)
     
    135135    }
    136136
    137     TextureMapperGL* texmapGL = static_cast<TextureMapperGL*>(textureMapper);
     137    TextureMapperGL& texmapGL = static_cast<TextureMapperGL&>(textureMapper);
    138138    TextureMapperGL::Flags flags = TextureMapperGL::ShouldFlipTexture | (m_context->m_attrs.alpha ? TextureMapperGL::ShouldBlend : 0);
    139139    IntSize textureSize(m_context->m_currentWidth, m_context->m_currentHeight);
    140     texmapGL->drawTexture(m_context->m_texture, flags, textureSize, targetRect, matrix, opacity);
     140    texmapGL.drawTexture(m_context->m_texture, flags, textureSize, targetRect, matrix, opacity);
    141141#endif // USE(TEXTURE_MAPPER_GL)
    142142}
  • trunk/Source/WebCore/platform/graphics/GraphicsContext3DPrivate.h

    r193723 r194103  
    5252    virtual void swapBuffersIfNeeded() override;
    5353#elif USE(TEXTURE_MAPPER)
    54     virtual void paintToTextureMapper(TextureMapper*, const FloatRect& target, const TransformationMatrix&, float opacity);
     54    virtual void paintToTextureMapper(TextureMapper&, const FloatRect& target, const TransformationMatrix&, float opacity);
    5555#endif
    5656
  • trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp

    r194025 r194103  
    469469
    470470#if ENABLE(ACCELERATED_2D_CANVAS) && !USE(COORDINATED_GRAPHICS_THREADED)
    471 void ImageBufferData::paintToTextureMapper(TextureMapper* textureMapper, const FloatRect& targetRect, const TransformationMatrix& matrix, float opacity)
     471void ImageBufferData::paintToTextureMapper(TextureMapper& textureMapper, const FloatRect& targetRect, const TransformationMatrix& matrix, float opacity)
    472472{
    473473    ASSERT(m_texture);
     
    478478    previousActiveContext->makeContextCurrent();
    479479
    480     static_cast<TextureMapperGL*>(textureMapper)->drawTexture(m_texture, TextureMapperGL::ShouldBlend, m_size, targetRect, matrix, opacity);
     480    static_cast<TextureMapperGL&>(textureMapper).drawTexture(m_texture, TextureMapperGL::ShouldBlend, m_size, targetRect, matrix, opacity);
    481481}
    482482#endif
  • trunk/Source/WebCore/platform/graphics/cairo/ImageBufferDataCairo.h

    r193748 r194103  
    7575    RefPtr<cairo_t> m_compositorCr;
    7676#else
    77     virtual void paintToTextureMapper(TextureMapper*, const FloatRect& target, const TransformationMatrix&, float opacity);
     77    virtual void paintToTextureMapper(TextureMapper&, const FloatRect& target, const TransformationMatrix&, float opacity);
    7878#endif
    7979    uint32_t m_texture;
  • trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.cpp

    r173112 r194103  
    160160}
    161161
    162 void GraphicsContext3DPrivate::paintToTextureMapper(TextureMapper*, const FloatRect& /* target */, const TransformationMatrix&, float /* opacity */)
     162void GraphicsContext3DPrivate::paintToTextureMapper(TextureMapper&, const FloatRect& /* target */, const TransformationMatrix&, float /* opacity */)
    163163{
    164164    notImplemented();
  • trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.h

    r173112 r194103  
    3737    PlatformGraphicsContext3D platformGraphicsContext3D() const;
    3838    void setContextLostCallback(std::unique_ptr<GraphicsContext3D::ContextLostCallback>);
    39     virtual void paintToTextureMapper(TextureMapper*, const FloatRect&, const TransformationMatrix&, float) override;
     39    virtual void paintToTextureMapper(TextureMapper&, const FloatRect&, const TransformationMatrix&, float) override;
    4040    virtual IntSize platformLayerSize() const override;
    4141    virtual uint32_t copyToGraphicsSurface() override;
  • trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp

    r193836 r194103  
    627627
    628628#if USE(TEXTURE_MAPPER_GL) && !USE(COORDINATED_GRAPHICS)
    629 void MediaPlayerPrivateGStreamerBase::paintToTextureMapper(TextureMapper* textureMapper, const FloatRect& targetRect, const TransformationMatrix& matrix, float opacity)
     629void MediaPlayerPrivateGStreamerBase::paintToTextureMapper(TextureMapper& textureMapper, const FloatRect& targetRect, const TransformationMatrix& matrix, float opacity)
    630630{
    631631    if (!m_player->visible())
     
    650650
    651651            IntSize size = IntSize(GST_VIDEO_INFO_WIDTH(&videoInfo), GST_VIDEO_INFO_HEIGHT(&videoInfo));
    652             texture = textureMapper->acquireTextureFromPool(size, GST_VIDEO_INFO_HAS_ALPHA(&videoInfo) ? BitmapTexture::SupportsAlpha : BitmapTexture::NoFlag);
     652            texture = textureMapper.acquireTextureFromPool(size, GST_VIDEO_INFO_HAS_ALPHA(&videoInfo) ? BitmapTexture::SupportsAlpha : BitmapTexture::NoFlag);
    653653            updateTexture(static_cast<BitmapTextureGL&>(*texture), videoInfo);
    654654        }
    655         textureMapper->drawTexture(*texture, targetRect, matrix, opacity);
     655        textureMapper.drawTexture(*texture, targetRect, matrix, opacity);
    656656        return;
    657657    }
     
    679679
    680680    IntSize size = IntSize(GST_VIDEO_INFO_WIDTH(&videoInfo), GST_VIDEO_INFO_HEIGHT(&videoInfo));
    681     TextureMapperGL* textureMapperGL = reinterpret_cast<TextureMapperGL*>(textureMapper);
    682     textureMapperGL->drawTexture(textureID, flags, size, targetRect, matrix, opacity);
     681    TextureMapperGL& textureMapperGL = reinterpret_cast<TextureMapperGL&>(textureMapper);
     682    textureMapperGL.drawTexture(textureID, flags, size, targetRect, matrix, opacity);
    683683    gst_video_frame_unmap(&videoFrame);
    684684#endif
  • trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h

    r193836 r194103  
    111111    virtual bool supportsAcceleratedRendering() const override { return true; }
    112112#endif
    113     virtual void paintToTextureMapper(TextureMapper*, const FloatRect&, const TransformationMatrix&, float) override;
     113    virtual void paintToTextureMapper(TextureMapper&, const FloatRect&, const TransformationMatrix&, float) override;
    114114#endif
    115115
  • trunk/Source/WebCore/platform/graphics/surfaces/GraphicsSurface.cpp

    r156700 r194103  
    6464}
    6565
    66 void GraphicsSurface::paintToTextureMapper(TextureMapper* textureMapper, const FloatRect& targetRect, const TransformationMatrix& transform, float opacity)
     66void GraphicsSurface::paintToTextureMapper(TextureMapper& textureMapper, const FloatRect& targetRect, const TransformationMatrix& transform, float opacity)
    6767{
    6868    platformPaintToTextureMapper(textureMapper, targetRect, transform, opacity);
  • trunk/Source/WebCore/platform/graphics/surfaces/GraphicsSurface.h

    r177429 r194103  
    7878    void copyToGLTexture(uint32_t target, uint32_t texture, const IntRect& targetRect, const IntPoint& sourceOffset);
    7979    void copyFromTexture(uint32_t texture, const IntRect& sourceRect);
    80     void paintToTextureMapper(TextureMapper*, const FloatRect& targetRect, const TransformationMatrix&, float opacity);
     80    void paintToTextureMapper(TextureMapper&, const FloatRect& targetRect, const TransformationMatrix&, float opacity);
    8181    uint32_t frontBuffer();
    8282    uint32_t swapBuffers();
     
    9898    void platformCopyToGLTexture(uint32_t target, uint32_t texture, const IntRect&, const IntPoint&);
    9999    void platformCopyFromTexture(uint32_t texture, const IntRect& sourceRect);
    100     void platformPaintToTextureMapper(TextureMapper*, const FloatRect& targetRect, const TransformationMatrix&, float opacity);
     100    void platformPaintToTextureMapper(TextureMapper&, const FloatRect& targetRect, const TransformationMatrix&, float opacity);
    101101    uint32_t platformFrontBuffer() const;
    102102    uint32_t platformSwapBuffers();
  • trunk/Source/WebCore/platform/graphics/surfaces/efl/GraphicsSurfaceCommon.cpp

    r177429 r194103  
    176176}
    177177
    178 void GraphicsSurface::platformPaintToTextureMapper(TextureMapper* textureMapper, const FloatRect& targetRect, const TransformationMatrix& transform, float opacity)
     178void GraphicsSurface::platformPaintToTextureMapper(TextureMapper& textureMapper, const FloatRect& targetRect, const TransformationMatrix& transform, float opacity)
    179179{
    180180    uint32_t texture = platformGetTextureID();
     
    184184    TransformationMatrix adjustedTransform = transform;
    185185    adjustedTransform.multiply(TransformationMatrix::rectToRect(m_private->rect(), targetRect));
    186     static_cast<TextureMapperGL*>(textureMapper)->drawTexture(texture, m_private->flags(), m_private->size(), m_private->rect(), adjustedTransform, opacity);
     186    static_cast<TextureMapperGL&>(textureMapper).drawTexture(texture, m_private->flags(), m_private->size(), m_private->rect(), adjustedTransform, opacity);
    187187}
    188188
  • trunk/Source/WebCore/platform/graphics/texmap/BitmapTexture.cpp

    r190344 r194103  
    3434namespace WebCore {
    3535
    36 void BitmapTexture::updateContents(TextureMapper* textureMapper, GraphicsLayer* sourceLayer, const IntRect& targetRect, const IntPoint& offset, UpdateContentsFlag updateContentsFlag, float scale)
     36void BitmapTexture::updateContents(TextureMapper& textureMapper, GraphicsLayer* sourceLayer, const IntRect& targetRect, const IntPoint& offset, UpdateContentsFlag updateContentsFlag, float scale)
    3737{
    3838    // Making an unconditionally unaccelerated buffer here is OK because this code
     
    4444
    4545    GraphicsContext& context = imageBuffer->context();
    46     context.setImageInterpolationQuality(textureMapper->imageInterpolationQuality());
    47     context.setTextDrawingMode(textureMapper->textDrawingMode());
     46    context.setImageInterpolationQuality(textureMapper.imageInterpolationQuality());
     47    context.setTextDrawingMode(textureMapper.textDrawingMode());
    4848
    4949    IntRect sourceRect(targetRect);
  • trunk/Source/WebCore/platform/graphics/texmap/BitmapTexture.h

    r193893 r194103  
    6666    virtual IntSize size() const = 0;
    6767    virtual void updateContents(Image*, const IntRect&, const IntPoint& offset, UpdateContentsFlag) = 0;
    68     virtual void updateContents(TextureMapper*, GraphicsLayer*, const IntRect& target, const IntPoint& offset, UpdateContentsFlag, float scale = 1);
     68    virtual void updateContents(TextureMapper&, GraphicsLayer*, const IntRect& target, const IntPoint& offset, UpdateContentsFlag, float scale = 1);
    6969    virtual void updateContents(const void*, const IntRect& target, const IntPoint& offset, int bytesPerLine, UpdateContentsFlag) = 0;
    7070    virtual bool isValid() const = 0;
     
    8484    inline bool isOpaque() const { return !(m_flags & SupportsAlpha); }
    8585
    86     virtual PassRefPtr<BitmapTexture> applyFilters(TextureMapper*, const FilterOperations&) { return this; }
     86    virtual PassRefPtr<BitmapTexture> applyFilters(TextureMapper&, const FilterOperations&) { return this; }
    8787
    8888protected:
  • trunk/Source/WebCore/platform/graphics/texmap/BitmapTextureGL.cpp

    r193893 r194103  
    222222}
    223223
    224 PassRefPtr<BitmapTexture> BitmapTextureGL::applyFilters(TextureMapper* textureMapper, const FilterOperations& filters)
     224PassRefPtr<BitmapTexture> BitmapTextureGL::applyFilters(TextureMapper& textureMapper, const FilterOperations& filters)
    225225{
    226226    if (filters.isEmpty())
    227227        return this;
    228228
    229     TextureMapperGL* texmapGL = static_cast<TextureMapperGL*>(textureMapper);
    230     RefPtr<BitmapTexture> previousSurface = texmapGL->currentSurface();
     229    TextureMapperGL& texmapGL = static_cast<TextureMapperGL&>(textureMapper);
     230    RefPtr<BitmapTexture> previousSurface = texmapGL.currentSurface();
    231231    RefPtr<BitmapTexture> resultSurface = this;
    232232    RefPtr<BitmapTexture> intermediateSurface;
     
    244244            if (!last) {
    245245                if (!intermediateSurface)
    246                     intermediateSurface = texmapGL->acquireTextureFromPool(contentSize());
    247                 texmapGL->bindSurface(intermediateSurface.get());
     246                    intermediateSurface = texmapGL.acquireTextureFromPool(contentSize());
     247                texmapGL.bindSurface(intermediateSurface.get());
    248248            }
    249249
     
    253253            }
    254254
    255             texmapGL->drawFiltered(*resultSurface.get(), spareSurface.get(), *filter, j);
     255            texmapGL.drawFiltered(*resultSurface.get(), spareSurface.get(), *filter, j);
    256256            if (!j && filter->type() == FilterOperation::DROP_SHADOW) {
    257257                spareSurface = resultSurface;
     
    262262    }
    263263
    264     texmapGL->bindSurface(previousSurface.get());
     264    texmapGL.bindSurface(previousSurface.get());
    265265    return resultSurface;
    266266}
  • trunk/Source/WebCore/platform/graphics/texmap/BitmapTextureGL.h

    r193630 r194103  
    5555    virtual bool isBackedByOpenGL() const override { return true; }
    5656
    57     virtual PassRefPtr<BitmapTexture> applyFilters(TextureMapper*, const FilterOperations&) override;
     57    virtual PassRefPtr<BitmapTexture> applyFilters(TextureMapper&, const FilterOperations&) override;
    5858    struct FilterInfo {
    5959        RefPtr<FilterOperation> filter;
  • trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp

    r193630 r194103  
    550550
    551551    dirtyRect.scale(pageScaleFactor() * deviceScaleFactor());
    552     backingStore->updateContents(textureMapper, this, m_size, dirtyRect, BitmapTexture::UpdateCanModifyOriginalImageData);
     552    backingStore->updateContents(*textureMapper, this, m_size, dirtyRect, BitmapTexture::UpdateCanModifyOriginalImageData);
    553553
    554554    m_needsDisplay = false;
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.h

    r187002 r194103  
    4040public:
    4141    virtual RefPtr<BitmapTexture> texture() const = 0;
    42     virtual void paintToTextureMapper(TextureMapper*, const FloatRect&, const TransformationMatrix&, float) = 0;
    43     virtual void drawRepaintCounter(TextureMapper*, int /* repaintCount */, const Color&, const FloatRect&, const TransformationMatrix&) { }
     42    virtual void paintToTextureMapper(TextureMapper&, const FloatRect&, const TransformationMatrix&, float) = 0;
     43    virtual void drawRepaintCounter(TextureMapper&, int /* repaintCount */, const Color&, const FloatRect&, const TransformationMatrix&) { }
    4444    virtual ~TextureMapperBackingStore() { }
    4545
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperFPSCounter.cpp

    r163079 r194103  
    4747}
    4848
    49 void TextureMapperFPSCounter::updateFPSAndDisplay(TextureMapper* textureMapper, const FloatPoint& location, const TransformationMatrix& matrix)
     49void TextureMapperFPSCounter::updateFPSAndDisplay(TextureMapper& textureMapper, const FloatPoint& location, const TransformationMatrix& matrix)
    5050{
    5151    if (!m_isShowingFPS)
     
    6060    }
    6161
    62     textureMapper->drawNumber(m_lastFPS, Color::black, location, matrix);
     62    textureMapper.drawNumber(m_lastFPS, Color::black, location, matrix);
    6363}
    6464
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperFPSCounter.h

    r163079 r194103  
    3636public:
    3737    TextureMapperFPSCounter();
    38     void updateFPSAndDisplay(TextureMapper*, const FloatPoint& = FloatPoint::zero(), const TransformationMatrix& = TransformationMatrix());
     38    void updateFPSAndDisplay(TextureMapper&, const FloatPoint& = FloatPoint::zero(), const TransformationMatrix& = TransformationMatrix());
    3939
    4040private:
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp

    r193630 r194103  
    3232class TextureMapperPaintOptions {
    3333public:
     34    TextureMapperPaintOptions(TextureMapper& textureMapper)
     35        : textureMapper(textureMapper)
     36    { }
     37
     38    TextureMapper& textureMapper;
     39    TransformationMatrix transform;
    3440    RefPtr<BitmapTexture> surface;
    35     float opacity;
    36     TransformationMatrix transform;
     41    float opacity { 1 };
    3742    IntSize offset;
    38     TextureMapper* textureMapper;
    39     TextureMapperPaintOptions()
    40         : opacity(1)
    41         , textureMapper(0)
    42     { }
    4343};
    4444
     
    7979    computeTransformsRecursive();
    8080
    81     TextureMapperPaintOptions options;
    82     options.textureMapper = m_textureMapper;
    83     options.textureMapper->bindSurface(0);
     81    ASSERT(m_textureMapper);
     82    TextureMapperPaintOptions options(*m_textureMapper);
     83    options.textureMapper.bindSurface(0);
     84
    8485    paintRecursive(options);
    8586}
     
    117118
    118119    if (m_state.solidColor.isValid() && !m_state.contentsRect.isEmpty() && m_state.solidColor.alpha()) {
    119         options.textureMapper->drawSolidColor(m_state.contentsRect, transform, blendWithOpacity(m_state.solidColor, options.opacity));
     120        options.textureMapper.drawSolidColor(m_state.contentsRect, transform, blendWithOpacity(m_state.solidColor, options.opacity));
    120121        if (m_state.showDebugBorders)
    121             options.textureMapper->drawBorder(m_state.debugBorderColor, m_state.debugBorderWidth, layerRect(), transform);
    122         return;
    123     }
    124 
    125     options.textureMapper->setWrapMode(TextureMapper::StretchWrap);
    126     options.textureMapper->setPatternTransform(TransformationMatrix());
     122            options.textureMapper.drawBorder(m_state.debugBorderColor, m_state.debugBorderWidth, layerRect(), transform);
     123        return;
     124    }
     125
     126    options.textureMapper.setWrapMode(TextureMapper::StretchWrap);
     127    options.textureMapper.setPatternTransform(TransformationMatrix());
    127128
    128129    if (m_backingStore) {
     
    142143    if (!m_state.contentsTileSize.isEmpty()) {
    143144        computePatternTransformIfNeeded();
    144         options.textureMapper->setWrapMode(TextureMapper::RepeatWrap);
    145         options.textureMapper->setPatternTransform(m_patternTransform);
     145        options.textureMapper.setWrapMode(TextureMapper::RepeatWrap);
     146        options.textureMapper.setPatternTransform(m_patternTransform);
    146147    }
    147148
     
    173174        clipTransform.multiply(options.transform);
    174175        clipTransform.multiply(m_currentTransform.combined());
    175         options.textureMapper->beginClip(clipTransform, layerRect());
     176        options.textureMapper.beginClip(clipTransform, layerRect());
    176177    }
    177178
     
    180181
    181182    if (shouldClip)
    182         options.textureMapper->endClip();
     183        options.textureMapper.endClip();
    183184}
    184185
     
    329330
    330331    for (auto& rect : rects) {
    331         if (!rect.intersects(options.textureMapper->clipBounds()))
     332        if (!rect.intersects(options.textureMapper.clipBounds()))
    332333            continue;
    333334
    334         options.textureMapper->beginClip(TransformationMatrix(), rect);
     335        options.textureMapper.beginClip(TransformationMatrix(), rect);
    335336        paintSelfAndChildrenWithReplica(options);
    336         options.textureMapper->endClip();
     337        options.textureMapper.endClip();
    337338    }
    338339
     
    344345    }
    345346
    346     IntSize maxTextureSize = options.textureMapper->maxTextureSize();
    347     IntRect adjustedClipBounds(options.textureMapper->clipBounds());
     347    IntSize maxTextureSize = options.textureMapper.maxTextureSize();
     348    IntRect adjustedClipBounds(options.textureMapper.clipBounds());
    348349    adjustedClipBounds.move(-options.offset);
    349350    for (auto& rect : rects) {
     
    363364void TextureMapperLayer::applyMask(const TextureMapperPaintOptions& options)
    364365{
    365     options.textureMapper->setMaskMode(true);
     366    options.textureMapper.setMaskMode(true);
    366367    paintSelf(options);
    367     options.textureMapper->setMaskMode(false);
     368    options.textureMapper.setMaskMode(false);
    368369}
    369370
    370371PassRefPtr<BitmapTexture> TextureMapperLayer::paintIntoSurface(const TextureMapperPaintOptions& options, const IntSize& size)
    371372{
    372     RefPtr<BitmapTexture> surface = options.textureMapper->acquireTextureFromPool(size);
     373    RefPtr<BitmapTexture> surface = options.textureMapper.acquireTextureFromPool(size);
    373374    TextureMapperPaintOptions paintOptions(options);
    374375    paintOptions.surface = surface;
    375     options.textureMapper->bindSurface(surface.get());
     376    options.textureMapper.bindSurface(surface.get());
    376377    paintSelfAndChildren(paintOptions);
    377378    if (m_state.maskLayer)
    378379        m_state.maskLayer->applyMask(options);
    379380    surface = surface->applyFilters(options.textureMapper, m_currentFilters);
    380     options.textureMapper->bindSurface(surface.get());
     381    options.textureMapper.bindSurface(surface.get());
    381382    return surface.release();
    382383}
     
    384385static void commitSurface(const TextureMapperPaintOptions& options, PassRefPtr<BitmapTexture> surface, const IntRect& rect, float opacity)
    385386{
    386     options.textureMapper->bindSurface(options.surface.get());
     387    options.textureMapper.bindSurface(options.surface.get());
    387388    TransformationMatrix targetTransform;
    388389    targetTransform.translate(options.offset.width(), options.offset.height());
    389390    targetTransform.multiply(options.transform);
    390     options.textureMapper->drawTexture(*surface.get(), rect, targetTransform, opacity);
     391    options.textureMapper.drawTexture(*surface.get(), rect, targetTransform, opacity);
    391392}
    392393
     
    414415    mainSurface = paintIntoSurface(paintOptions, rect.size());
    415416    if (replicaSurface) {
    416         options.textureMapper->bindSurface(replicaSurface.get());
    417         options.textureMapper->drawTexture(*mainSurface.get(), FloatRect(FloatPoint::zero(), rect.size()));
     417        options.textureMapper.bindSurface(replicaSurface.get());
     418        options.textureMapper.drawTexture(*mainSurface.get(), FloatRect(FloatPoint::zero(), rect.size()));
    418419        mainSurface = replicaSurface;
    419420    }
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayer.h

    r156282 r194103  
    4040    TextureMapperPlatformLayer() : m_client(0) { }
    4141    virtual ~TextureMapperPlatformLayer() { }
    42     virtual void paintToTextureMapper(TextureMapper*, const FloatRect&, const TransformationMatrix& modelViewMatrix = TransformationMatrix(), float opacity = 1.0) = 0;
     42    virtual void paintToTextureMapper(TextureMapper&, const FloatRect&, const TransformationMatrix& modelViewMatrix = TransformationMatrix(), float opacity = 1.0) = 0;
    4343    virtual void swapBuffers() { }
    44     virtual void drawBorder(TextureMapper* textureMapper, const Color& color, float borderWidth, const FloatRect& targetRect, const TransformationMatrix& transform)
     44    virtual void drawBorder(TextureMapper& textureMapper, const Color& color, float borderWidth, const FloatRect& targetRect, const TransformationMatrix& transform)
    4545    {
    46         textureMapper->drawBorder(color, borderWidth, targetRect, transform);
     46        textureMapper.drawBorder(color, borderWidth, targetRect, transform);
    4747    }
    4848    void setClient(TextureMapperPlatformLayer::Client* client)
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp

    r193630 r194103  
    5050}
    5151
    52 void TextureMapperPlatformLayerBuffer::paintToTextureMapper(TextureMapper* textureMapper, const FloatRect& targetRect, const TransformationMatrix& modelViewMatrix, float opacity)
     52void TextureMapperPlatformLayerBuffer::paintToTextureMapper(TextureMapper& textureMapper, const FloatRect& targetRect, const TransformationMatrix& modelViewMatrix, float opacity)
    5353{
    5454    if (m_hasManagedTexture) {
    5555        ASSERT(m_texture);
    56         textureMapper->drawTexture(*m_texture, targetRect, modelViewMatrix, opacity);
     56        textureMapper.drawTexture(*m_texture, targetRect, modelViewMatrix, opacity);
    5757        return;
    5858    }
    5959
    6060    ASSERT(m_textureID);
    61     TextureMapperGL* texmapGL = static_cast<TextureMapperGL*>(textureMapper);
    62     texmapGL->drawTexture(m_textureID, m_extraFlags, m_size, targetRect, modelViewMatrix, opacity);
     61    TextureMapperGL& texmapGL = static_cast<TextureMapperGL&>(textureMapper);
     62    texmapGL.drawTexture(m_textureID, m_extraFlags, m_size, targetRect, modelViewMatrix, opacity);
    6363}
    6464
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h

    r193630 r194103  
    4343    virtual ~TextureMapperPlatformLayerBuffer() = default;
    4444
    45     virtual void paintToTextureMapper(TextureMapper*, const FloatRect&, const TransformationMatrix& modelViewMatrix = TransformationMatrix(), float opacity = 1.0) final;
     45    virtual void paintToTextureMapper(TextureMapper&, const FloatRect&, const TransformationMatrix& modelViewMatrix = TransformationMatrix(), float opacity = 1.0) final;
    4646
    4747    bool canReuseWithoutReset(const IntSize&, GC3Dint internalFormat);
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperSurfaceBackingStore.cpp

    r187002 r194103  
    4545}
    4646
    47 void TextureMapperSurfaceBackingStore::paintToTextureMapper(TextureMapper* textureMapper, const FloatRect& targetRect, const TransformationMatrix& transform, float opacity)
     47void TextureMapperSurfaceBackingStore::paintToTextureMapper(TextureMapper& textureMapper, const FloatRect& targetRect, const TransformationMatrix& transform, float opacity)
    4848{
    4949    if (m_graphicsSurface)
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperSurfaceBackingStore.h

    r187002 r194103  
    3838    void swapBuffersIfNeeded(uint32_t frontBuffer);
    3939    virtual RefPtr<BitmapTexture> texture() const;
    40     virtual void paintToTextureMapper(TextureMapper*, const FloatRect&, const TransformationMatrix&, float);
     40    virtual void paintToTextureMapper(TextureMapper&, const FloatRect&, const TransformationMatrix&, float);
    4141    virtual ~TextureMapperSurfaceBackingStore() { }
    4242
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperTile.cpp

    r190344 r194103  
    3030class GraphicsLayer;
    3131
    32 void TextureMapperTile::updateContents(TextureMapper* textureMapper, Image* image, const IntRect& dirtyRect, BitmapTexture::UpdateContentsFlag updateContentsFlag)
     32void TextureMapperTile::updateContents(TextureMapper& textureMapper, Image* image, const IntRect& dirtyRect, BitmapTexture::UpdateContentsFlag updateContentsFlag)
    3333{
    3434    IntRect targetRect = enclosingIntRect(m_rect);
     
    4444    targetRect.move(-m_rect.x(), -m_rect.y());
    4545    if (!m_texture) {
    46         m_texture = textureMapper->createTexture();
     46        m_texture = textureMapper.createTexture();
    4747        m_texture->reset(targetRect.size(), image->currentFrameKnownToBeOpaque() ? 0 : BitmapTexture::SupportsAlpha);
    4848    }
     
    5151}
    5252
    53 void TextureMapperTile::updateContents(TextureMapper* textureMapper, GraphicsLayer* sourceLayer, const IntRect& dirtyRect, BitmapTexture::UpdateContentsFlag updateContentsFlag, float scale)
     53void TextureMapperTile::updateContents(TextureMapper& textureMapper, GraphicsLayer* sourceLayer, const IntRect& dirtyRect, BitmapTexture::UpdateContentsFlag updateContentsFlag, float scale)
    5454{
    5555    IntRect targetRect = enclosingIntRect(m_rect);
     
    6363
    6464    if (!m_texture) {
    65         m_texture = textureMapper->createTexture();
     65        m_texture = textureMapper.createTexture();
    6666        m_texture->reset(targetRect.size(), BitmapTexture::SupportsAlpha);
    6767    }
     
    7070}
    7171
    72 void TextureMapperTile::paint(TextureMapper* textureMapper, const TransformationMatrix& transform, float opacity, const unsigned exposedEdges)
     72void TextureMapperTile::paint(TextureMapper& textureMapper, const TransformationMatrix& transform, float opacity, const unsigned exposedEdges)
    7373{
    7474    if (texture().get())
    75         textureMapper->drawTexture(*texture().get(), rect(), transform, opacity, exposedEdges);
     75        textureMapper.drawTexture(*texture().get(), rect(), transform, opacity, exposedEdges);
    7676}
    7777
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperTile.h

    r190344 r194103  
    4040    inline void setRect(const FloatRect& rect) { m_rect = rect; }
    4141
    42     void updateContents(TextureMapper*, Image*, const IntRect&, BitmapTexture::UpdateContentsFlag UpdateCanModifyOriginalImageData);
    43     void updateContents(TextureMapper*, GraphicsLayer*, const IntRect&, BitmapTexture::UpdateContentsFlag UpdateCanModifyOriginalImageData, float scale = 1);
    44     virtual void paint(TextureMapper*, const TransformationMatrix&, float, const unsigned exposedEdges);
     42    void updateContents(TextureMapper&, Image*, const IntRect&, BitmapTexture::UpdateContentsFlag UpdateCanModifyOriginalImageData);
     43    void updateContents(TextureMapper&, GraphicsLayer*, const IntRect&, BitmapTexture::UpdateContentsFlag UpdateCanModifyOriginalImageData, float scale = 1);
     44    virtual void paint(TextureMapper&, const TransformationMatrix&, float, const unsigned exposedEdges);
    4545    virtual ~TextureMapperTile() { }
    4646
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.cpp

    r193828 r194103  
    3131class GraphicsLayer;
    3232
    33 void TextureMapperTiledBackingStore::updateContentsFromImageIfNeeded(TextureMapper* textureMapper)
     33void TextureMapperTiledBackingStore::updateContentsFromImageIfNeeded(TextureMapper& textureMapper)
    3434{
    3535    if (!m_image)
     
    4848}
    4949
    50 void TextureMapperTiledBackingStore::paintToTextureMapper(TextureMapper* textureMapper, const FloatRect& targetRect, const TransformationMatrix& transform, float opacity)
     50void TextureMapperTiledBackingStore::paintToTextureMapper(TextureMapper& textureMapper, const FloatRect& targetRect, const TransformationMatrix& transform, float opacity)
    5151{
    5252    updateContentsFromImageIfNeeded(textureMapper);
     
    5656}
    5757
    58 void TextureMapperTiledBackingStore::drawBorder(TextureMapper* textureMapper, const Color& borderColor, float borderWidth, const FloatRect& targetRect, const TransformationMatrix& transform)
     58void TextureMapperTiledBackingStore::drawBorder(TextureMapper& textureMapper, const Color& borderColor, float borderWidth, const FloatRect& targetRect, const TransformationMatrix& transform)
    5959{
    6060    TransformationMatrix adjustedTransform = transform * adjustedTransformForRect(targetRect);
    6161    for (auto& tile : m_tiles)
    62         textureMapper->drawBorder(borderColor, borderWidth, tile.rect(), adjustedTransform);
     62        textureMapper.drawBorder(borderColor, borderWidth, tile.rect(), adjustedTransform);
    6363}
    6464
    65 void TextureMapperTiledBackingStore::drawRepaintCounter(TextureMapper* textureMapper, int repaintCount, const Color& borderColor, const FloatRect& targetRect, const TransformationMatrix& transform)
     65void TextureMapperTiledBackingStore::drawRepaintCounter(TextureMapper& textureMapper, int repaintCount, const Color& borderColor, const FloatRect& targetRect, const TransformationMatrix& transform)
    6666{
    6767    TransformationMatrix adjustedTransform = transform * adjustedTransformForRect(targetRect);
    6868    for (auto& tile : m_tiles)
    69         textureMapper->drawNumber(repaintCount, borderColor, tile.rect().location(), adjustedTransform);
     69        textureMapper.drawNumber(repaintCount, borderColor, tile.rect().location(), adjustedTransform);
    7070}
    7171
     
    151151}
    152152
    153 void TextureMapperTiledBackingStore::updateContents(TextureMapper* textureMapper, Image* image, const FloatSize& totalSize, const IntRect& dirtyRect, BitmapTexture::UpdateContentsFlag updateContentsFlag)
     153void TextureMapperTiledBackingStore::updateContents(TextureMapper& textureMapper, Image* image, const FloatSize& totalSize, const IntRect& dirtyRect, BitmapTexture::UpdateContentsFlag updateContentsFlag)
    154154{
    155     createOrDestroyTilesIfNeeded(totalSize, textureMapper->maxTextureSize(), !image->currentFrameKnownToBeOpaque());
     155    createOrDestroyTilesIfNeeded(totalSize, textureMapper.maxTextureSize(), !image->currentFrameKnownToBeOpaque());
    156156    for (auto& tile : m_tiles)
    157157        tile.updateContents(textureMapper, image, dirtyRect, updateContentsFlag);
    158158}
    159159
    160 void TextureMapperTiledBackingStore::updateContents(TextureMapper* textureMapper, GraphicsLayer* sourceLayer, const FloatSize& totalSize, const IntRect& dirtyRect, BitmapTexture::UpdateContentsFlag updateContentsFlag)
     160void TextureMapperTiledBackingStore::updateContents(TextureMapper& textureMapper, GraphicsLayer* sourceLayer, const FloatSize& totalSize, const IntRect& dirtyRect, BitmapTexture::UpdateContentsFlag updateContentsFlag)
    161161{
    162     createOrDestroyTilesIfNeeded(totalSize, textureMapper->maxTextureSize(), true);
     162    createOrDestroyTilesIfNeeded(totalSize, textureMapper.maxTextureSize(), true);
    163163    for (auto& tile : m_tiles)
    164164        tile.updateContents(textureMapper, sourceLayer, dirtyRect, updateContentsFlag, m_contentsScale);
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.h

    r190344 r194103  
    3939
    4040    virtual RefPtr<BitmapTexture> texture() const override;
    41     virtual void paintToTextureMapper(TextureMapper*, const FloatRect&, const TransformationMatrix&, float) override;
    42     virtual void drawBorder(TextureMapper*, const Color&, float borderWidth, const FloatRect&, const TransformationMatrix&) override;
    43     virtual void drawRepaintCounter(TextureMapper*, int repaintCount, const Color&, const FloatRect&, const TransformationMatrix&) override;
     41    virtual void paintToTextureMapper(TextureMapper&, const FloatRect&, const TransformationMatrix&, float) override;
     42    virtual void drawBorder(TextureMapper&, const Color&, float borderWidth, const FloatRect&, const TransformationMatrix&) override;
     43    virtual void drawRepaintCounter(TextureMapper&, int repaintCount, const Color&, const FloatRect&, const TransformationMatrix&) override;
    4444
    4545    void updateContentsScale(float);
    46     void updateContents(TextureMapper*, Image*, const FloatSize&, const IntRect&, BitmapTexture::UpdateContentsFlag);
    47     void updateContents(TextureMapper*, GraphicsLayer*, const FloatSize&, const IntRect&, BitmapTexture::UpdateContentsFlag);
     46    void updateContents(TextureMapper&, Image*, const FloatSize&, const IntRect&, BitmapTexture::UpdateContentsFlag);
     47    void updateContents(TextureMapper&, GraphicsLayer*, const FloatSize&, const IntRect&, BitmapTexture::UpdateContentsFlag);
    4848
    4949    void setContentsToImage(Image* image) { m_image = image; }
     
    5353
    5454    void createOrDestroyTilesIfNeeded(const FloatSize& backingStoreSize, const IntSize& tileSize, bool hasAlpha);
    55     void updateContentsFromImageIfNeeded(TextureMapper*);
     55    void updateContentsFromImageIfNeeded(TextureMapper&);
    5656    TransformationMatrix adjustedTransformForRect(const FloatRect&);
    5757    inline FloatRect rect() const
  • trunk/Source/WebKit/win/ChangeLog

    r192903 r194103  
     12015-12-15  Zan Dobersek  <zdobersek@igalia.com>
     2
     3        [TexMap] Operate with a reference to the TextureMapper wherever possible
     4        https://bugs.webkit.org/show_bug.cgi?id=152118
     5
     6        Reviewed by Martin Robinson.
     7
     8        * WebCoreSupport/AcceleratedCompositingContext.cpp:
     9        (AcceleratedCompositingContext::compositeLayersToContext): TextureMapper object
     10        is now operated with through a reference.
     11
    1122015-12-01  Darin Adler  <darin@apple.com>
    213
  • trunk/Source/WebKit/win/WebCoreSupport/AcceleratedCompositingContext.cpp

    r189165 r194103  
    188188    m_textureMapper->beginPainting();
    189189    downcast<GraphicsLayerTextureMapper>(*m_rootLayer).layer().paint();
    190     m_fpsCounter.updateFPSAndDisplay(m_textureMapper.get());
     190    m_fpsCounter.updateFPSAndDisplay(*m_textureMapper);
    191191    m_textureMapper->endPainting();
    192192
  • trunk/Source/WebKit2/ChangeLog

    r194095 r194103  
     12015-12-15  Zan Dobersek  <zdobersek@igalia.com>
     2
     3        [TexMap] Operate with a reference to the TextureMapper wherever possible
     4        https://bugs.webkit.org/show_bug.cgi?id=152118
     5
     6        Reviewed by Martin Robinson.
     7
     8        Replace pointers to the TextureMapper object with references.
     9
     10        * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
     11        (WebKit::CoordinatedBackingStoreTile::swapBuffers):
     12        (WebKit::CoordinatedBackingStore::paintTilesToTextureMapper):
     13        (WebKit::CoordinatedBackingStore::paintToTextureMapper):
     14        (WebKit::CoordinatedBackingStore::drawBorder):
     15        (WebKit::CoordinatedBackingStore::drawRepaintCounter):
     16        (WebKit::CoordinatedBackingStore::commitTileOperations):
     17        * Shared/CoordinatedGraphics/CoordinatedBackingStore.h:
     18        * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
     19        (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
     20        (WebKit::CoordinatedGraphicsScene::paintToGraphicsContext):
     21        (WebKit::CoordinatedGraphicsScene::commitPendingBackingStoreOperations):
     22
    1232015-12-14  YongGeol Jung  <yg48.jung@samsung.com>
    224
  • trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp

    r187002 r194103  
    3131namespace WebKit {
    3232
    33 void CoordinatedBackingStoreTile::swapBuffers(TextureMapper* textureMapper)
     33void CoordinatedBackingStoreTile::swapBuffers(TextureMapper& textureMapper)
    3434{
    3535    if (!m_surface)
     
    4545    RefPtr<BitmapTexture> texture = this->texture();
    4646    if (!texture) {
    47         texture = textureMapper->createTexture();
     47        texture = textureMapper.createTexture();
    4848        setTexture(texture.get());
    4949        shouldReset = true;
    5050    }
    5151
    52     ASSERT(textureMapper->maxTextureSize().width() >= m_tileRect.size().width());
    53     ASSERT(textureMapper->maxTextureSize().height() >= m_tileRect.size().height());
     52    ASSERT(textureMapper.maxTextureSize().width() >= m_tileRect.size().width());
     53    ASSERT(textureMapper.maxTextureSize().height() >= m_tileRect.size().height());
    5454    if (shouldReset)
    5555        texture->reset(m_tileRect.size(), m_surface->supportsAlpha());
     
    108108}
    109109
    110 void CoordinatedBackingStore::paintTilesToTextureMapper(Vector<TextureMapperTile*>& tiles, TextureMapper* textureMapper, const TransformationMatrix& transform, float opacity, const FloatRect& rect)
     110void CoordinatedBackingStore::paintTilesToTextureMapper(Vector<TextureMapperTile*>& tiles, TextureMapper& textureMapper, const TransformationMatrix& transform, float opacity, const FloatRect& rect)
    111111{
    112112    for (auto& tile : tiles)
     
    119119}
    120120
    121 void CoordinatedBackingStore::paintToTextureMapper(TextureMapper* textureMapper, const FloatRect& targetRect, const TransformationMatrix& transform, float opacity)
     121void CoordinatedBackingStore::paintToTextureMapper(TextureMapper& textureMapper, const FloatRect& targetRect, const TransformationMatrix& transform, float opacity)
    122122{
    123123    if (m_tiles.isEmpty())
     
    156156}
    157157
    158 void CoordinatedBackingStore::drawBorder(TextureMapper* textureMapper, const Color& borderColor, float borderWidth, const FloatRect& targetRect, const TransformationMatrix& transform)
     158void CoordinatedBackingStore::drawBorder(TextureMapper& textureMapper, const Color& borderColor, float borderWidth, const FloatRect& targetRect, const TransformationMatrix& transform)
    159159{
    160160    TransformationMatrix adjustedTransform = transform * adjustedTransformForRect(targetRect);
    161161    for (auto& tile : m_tiles.values())
    162         textureMapper->drawBorder(borderColor, borderWidth, tile.rect(), adjustedTransform);
     162        textureMapper.drawBorder(borderColor, borderWidth, tile.rect(), adjustedTransform);
    163163}
    164164
    165 void CoordinatedBackingStore::drawRepaintCounter(TextureMapper* textureMapper, int repaintCount, const Color& borderColor, const FloatRect& targetRect, const TransformationMatrix& transform)
     165void CoordinatedBackingStore::drawRepaintCounter(TextureMapper& textureMapper, int repaintCount, const Color& borderColor, const FloatRect& targetRect, const TransformationMatrix& transform)
    166166{
    167167    TransformationMatrix adjustedTransform = transform * adjustedTransformForRect(targetRect);
    168168    for (auto& tile : m_tiles.values())
    169         textureMapper->drawNumber(repaintCount, borderColor, tile.rect().location(), adjustedTransform);
     169        textureMapper.drawNumber(repaintCount, borderColor, tile.rect().location(), adjustedTransform);
    170170}
    171171
    172 void CoordinatedBackingStore::commitTileOperations(TextureMapper* textureMapper)
     172void CoordinatedBackingStore::commitTileOperations(TextureMapper& textureMapper)
    173173{
    174174    if (!m_pendingSize.isZero()) {
  • trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedBackingStore.h

    r192628 r194103  
    4545
    4646    inline float scale() const { return m_scale; }
    47     void swapBuffers(WebCore::TextureMapper*);
     47    void swapBuffers(WebCore::TextureMapper&);
    4848    void setBackBuffer(const WebCore::IntRect&, const WebCore::IntRect&, PassRefPtr<WebCore::CoordinatedSurface> buffer, const WebCore::IntPoint&);
    4949
     
    6363    void updateTile(uint32_t tileID, const WebCore::IntRect&, const WebCore::IntRect&, PassRefPtr<WebCore::CoordinatedSurface>, const WebCore::IntPoint&);
    6464    static Ref<CoordinatedBackingStore> create() { return adoptRef(*new CoordinatedBackingStore); }
    65     void commitTileOperations(WebCore::TextureMapper*);
     65    void commitTileOperations(WebCore::TextureMapper&);
    6666    RefPtr<WebCore::BitmapTexture> texture() const override;
    6767    void setSize(const WebCore::FloatSize&);
    68     virtual void paintToTextureMapper(WebCore::TextureMapper*, const WebCore::FloatRect&, const WebCore::TransformationMatrix&, float) override;
    69     virtual void drawBorder(WebCore::TextureMapper*, const WebCore::Color&, float borderWidth, const WebCore::FloatRect&, const WebCore::TransformationMatrix&) override;
    70     virtual void drawRepaintCounter(WebCore::TextureMapper*, int repaintCount, const WebCore::Color&, const WebCore::FloatRect&, const WebCore::TransformationMatrix&) override;
     68    virtual void paintToTextureMapper(WebCore::TextureMapper&, const WebCore::FloatRect&, const WebCore::TransformationMatrix&, float) override;
     69    virtual void drawBorder(WebCore::TextureMapper&, const WebCore::Color&, float borderWidth, const WebCore::FloatRect&, const WebCore::TransformationMatrix&) override;
     70    virtual void drawRepaintCounter(WebCore::TextureMapper&, int repaintCount, const WebCore::Color&, const WebCore::FloatRect&, const WebCore::TransformationMatrix&) override;
    7171
    7272private:
     
    7474        : m_scale(1.)
    7575    { }
    76     void paintTilesToTextureMapper(Vector<WebCore::TextureMapperTile*>&, WebCore::TextureMapper*, const WebCore::TransformationMatrix&, float, const WebCore::FloatRect&);
     76    void paintTilesToTextureMapper(Vector<WebCore::TextureMapperTile*>&, WebCore::TextureMapper&, const WebCore::TransformationMatrix&, float, const WebCore::FloatRect&);
    7777    WebCore::TransformationMatrix adjustedTransformForRect(const WebCore::FloatRect&);
    7878    WebCore::FloatRect rect() const { return WebCore::FloatRect(WebCore::FloatPoint::zero(), m_size); }
  • trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp

    r193901 r194103  
    111111
    112112    currentRootLayer->paint();
    113     m_fpsCounter.updateFPSAndDisplay(m_textureMapper.get(), clipRect.location(), matrix);
     113    m_fpsCounter.updateFPSAndDisplay(*m_textureMapper, clipRect.location(), matrix);
    114114    m_textureMapper->endClip();
    115115    m_textureMapper->endPainting();
     
    144144
    145145    layer->paint();
    146     m_fpsCounter.updateFPSAndDisplay(m_textureMapper.get(), clipRect.location());
     146    m_fpsCounter.updateFPSAndDisplay(*m_textureMapper, clipRect.location());
    147147    m_textureMapper->endPainting();
    148148    m_textureMapper->setGraphicsContext(0);
     
    585585{
    586586    for (auto& backingStore : m_backingStoresWithPendingBuffers)
    587         backingStore->commitTileOperations(m_textureMapper.get());
     587        backingStore->commitTileOperations(*m_textureMapper);
    588588
    589589    m_backingStoresWithPendingBuffers.clear();
Note: See TracChangeset for help on using the changeset viewer.