Changeset 229895 in webkit


Ignore:
Timestamp:
Mar 23, 2018 8:29:30 AM (6 years ago)
Author:
magomez@igalia.com
Message:

[GTK][WPE] Avoid software color conversion inside BitmapTextureGL
https://bugs.webkit.org/show_bug.cgi?id=183892

Source/WebCore:

Reviewed by Žan Doberšek.

Always use RGBA format on BitmapTextureGL (when no other format is specifically requested). When
the texture is updated from BGRA content, use a flag to indicate the shader to perform a color
conversion during the painting. This way we don't need to swap the R and B components on the CPU.
Also, remove one of the lists in BitmapTexturePool as now all of them have the same format, and
remove the UpdateContentsFlag as we never need to modify the original image data.

Covered by existent tests.

  • platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:

(WebCore::MediaPlayerPrivateGStreamerBase::updateTexture):

  • platform/graphics/texmap/BitmapTexture.cpp:

(WebCore::BitmapTexture::updateContents):

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

(WebCore::BitmapTextureGL::BitmapTextureGL):
(WebCore::BitmapTextureGL::didReset):
(WebCore::BitmapTextureGL::updateContents):
(WebCore::BitmapTextureGL::applyFilters):
(WebCore::swizzleBGRAToRGBA): Deleted.
(WebCore::BitmapTextureGL::updateContentsNoSwizzle): Deleted.

  • platform/graphics/texmap/BitmapTextureGL.h:

(WebCore::BitmapTextureGL::colorConvertFlags const):

  • platform/graphics/texmap/BitmapTexturePool.cpp:

(WebCore::BitmapTexturePool::acquireTexture):
(WebCore::BitmapTexturePool::releaseUnusedTexturesTimerFired):

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

(WebCore::GraphicsLayerTextureMapper::updateBackingStoreIfNeeded):

  • platform/graphics/texmap/TextureMapperContextAttributes.cpp:

(WebCore::TextureMapperContextAttributes::get):

  • platform/graphics/texmap/TextureMapperContextAttributes.h:
  • platform/graphics/texmap/TextureMapperGL.cpp:

(WebCore::TextureMapperGL::drawNumber):
(WebCore::TextureMapperGL::drawTexture):

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

(WebCore::TextureMapperLayer::paintIntoSurface):

  • platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:

(WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):

  • platform/graphics/texmap/TextureMapperTile.cpp:

(WebCore::TextureMapperTile::updateContents):

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

(WebCore::TextureMapperTiledBackingStore::updateContentsFromImageIfNeeded):
(WebCore::TextureMapperTiledBackingStore::updateContents):

  • platform/graphics/texmap/TextureMapperTiledBackingStore.h:

Source/WebKit:

Remove the UpdateContentsFlag parameter when calling BitmapTexture::updateContents().

Reviewed by Žan Doberšek.

  • Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:

(WebKit::CoordinatedBackingStoreTile::swapBuffers):

Source/WebKitLegacy/win:

Remove the UpdateContentsFlag parameter as it's not used anymore.

Reviewed by Žan Doberšek.

  • WebCoreSupport/AcceleratedCompositingContext.cpp:

(AcceleratedCompositingContext::acceleratedCompositingAvailable):

Location:
trunk/Source
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r229893 r229895  
     12018-03-23  Miguel Gomez  <magomez@igalia.com>
     2
     3        [GTK][WPE] Avoid software color conversion inside BitmapTextureGL
     4        https://bugs.webkit.org/show_bug.cgi?id=183892
     5
     6        Reviewed by Žan Doberšek.
     7
     8        Always use RGBA format on BitmapTextureGL (when no other format is specifically requested). When
     9        the texture is updated from BGRA content, use a flag to indicate the shader to perform a color
     10        conversion during the painting. This way we don't need to swap the R and B components on the CPU.
     11        Also, remove one of the lists in BitmapTexturePool as now all of them have the same format, and
     12        remove the UpdateContentsFlag as we never need to modify the original image data.
     13
     14        Covered by existent tests.
     15
     16        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
     17        (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture):
     18        * platform/graphics/texmap/BitmapTexture.cpp:
     19        (WebCore::BitmapTexture::updateContents):
     20        * platform/graphics/texmap/BitmapTexture.h:
     21        * platform/graphics/texmap/BitmapTextureGL.cpp:
     22        (WebCore::BitmapTextureGL::BitmapTextureGL):
     23        (WebCore::BitmapTextureGL::didReset):
     24        (WebCore::BitmapTextureGL::updateContents):
     25        (WebCore::BitmapTextureGL::applyFilters):
     26        (WebCore::swizzleBGRAToRGBA): Deleted.
     27        (WebCore::BitmapTextureGL::updateContentsNoSwizzle): Deleted.
     28        * platform/graphics/texmap/BitmapTextureGL.h:
     29        (WebCore::BitmapTextureGL::colorConvertFlags const):
     30        * platform/graphics/texmap/BitmapTexturePool.cpp:
     31        (WebCore::BitmapTexturePool::acquireTexture):
     32        (WebCore::BitmapTexturePool::releaseUnusedTexturesTimerFired):
     33        * platform/graphics/texmap/BitmapTexturePool.h:
     34        * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
     35        (WebCore::GraphicsLayerTextureMapper::updateBackingStoreIfNeeded):
     36        * platform/graphics/texmap/TextureMapperContextAttributes.cpp:
     37        (WebCore::TextureMapperContextAttributes::get):
     38        * platform/graphics/texmap/TextureMapperContextAttributes.h:
     39        * platform/graphics/texmap/TextureMapperGL.cpp:
     40        (WebCore::TextureMapperGL::drawNumber):
     41        (WebCore::TextureMapperGL::drawTexture):
     42        * platform/graphics/texmap/TextureMapperGL.h:
     43        * platform/graphics/texmap/TextureMapperLayer.cpp:
     44        (WebCore::TextureMapperLayer::paintIntoSurface):
     45        * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
     46        (WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):
     47        * platform/graphics/texmap/TextureMapperTile.cpp:
     48        (WebCore::TextureMapperTile::updateContents):
     49        * platform/graphics/texmap/TextureMapperTile.h:
     50        * platform/graphics/texmap/TextureMapperTiledBackingStore.cpp:
     51        (WebCore::TextureMapperTiledBackingStore::updateContentsFromImageIfNeeded):
     52        (WebCore::TextureMapperTiledBackingStore::updateContents):
     53        * platform/graphics/texmap/TextureMapperTiledBackingStore.h:
     54
    1552018-03-23  Yusuke Suzuki  <utatane.tea@gmail.com>
    256
  • trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp

    r229857 r229895  
    707707    int stride = GST_VIDEO_FRAME_PLANE_STRIDE(&videoFrame, 0);
    708708    const void* srcData = GST_VIDEO_FRAME_PLANE_DATA(&videoFrame, 0);
    709     texture.updateContents(srcData, WebCore::IntRect(0, 0, GST_VIDEO_INFO_WIDTH(&videoInfo), GST_VIDEO_INFO_HEIGHT(&videoInfo)), WebCore::IntPoint(0, 0), stride, BitmapTexture::UpdateCannotModifyOriginalImageData);
     709    texture.updateContents(srcData, WebCore::IntRect(0, 0, GST_VIDEO_INFO_WIDTH(&videoInfo), GST_VIDEO_INFO_HEIGHT(&videoInfo)), WebCore::IntPoint(0, 0), stride);
    710710    gst_video_frame_unmap(&videoFrame);
    711711}
  • trunk/Source/WebCore/platform/graphics/texmap/BitmapTexture.cpp

    r213043 r229895  
    3434namespace WebCore {
    3535
    36 void BitmapTexture::updateContents(TextureMapper&, GraphicsLayer* sourceLayer, const IntRect& targetRect, const IntPoint& offset, UpdateContentsFlag updateContentsFlag, float scale)
     36void BitmapTexture::updateContents(TextureMapper&, GraphicsLayer* sourceLayer, const IntRect& targetRect, const IntPoint& offset, float scale)
    3737{
    3838    // Making an unconditionally unaccelerated buffer here is OK because this code
     
    5959        return;
    6060
    61     updateContents(image.get(), targetRect, IntPoint(), updateContentsFlag);
     61    updateContents(image.get(), targetRect, IntPoint());
    6262}
    6363
  • trunk/Source/WebCore/platform/graphics/texmap/BitmapTexture.h

    r223728 r229895  
    4747        NoFlag = 0,
    4848        SupportsAlpha = 0x01,
    49         FBOAttachment = 0x02
    50     };
    51 
    52     enum UpdateContentsFlag {
    53         UpdateCanModifyOriginalImageData,
    54         UpdateCannotModifyOriginalImageData
    5549    };
    5650
     
    6660
    6761    virtual IntSize size() const = 0;
    68     virtual void updateContents(Image*, const IntRect&, const IntPoint& offset, UpdateContentsFlag) = 0;
    69     virtual void updateContents(TextureMapper&, GraphicsLayer*, const IntRect& target, const IntPoint& offset, UpdateContentsFlag, float scale = 1);
    70     virtual void updateContents(const void*, const IntRect& target, const IntPoint& offset, int bytesPerLine, UpdateContentsFlag) = 0;
     62    virtual void updateContents(Image*, const IntRect&, const IntPoint& offset) = 0;
     63    virtual void updateContents(TextureMapper&, GraphicsLayer*, const IntRect& target, const IntPoint& offset, float scale = 1);
     64    virtual void updateContents(const void*, const IntRect& target, const IntPoint& offset, int bytesPerLine) = 0;
    7165    virtual bool isValid() const = 0;
    7266    inline Flags flags() const { return m_flags; }
  • trunk/Source/WebCore/platform/graphics/texmap/BitmapTextureGL.cpp

    r224340 r229895  
    5757}
    5858
    59 BitmapTextureGL::BitmapTextureGL(const TextureMapperContextAttributes& contextAttributes, const Flags flags, GLint internalFormat)
     59BitmapTextureGL::BitmapTextureGL(const TextureMapperContextAttributes& contextAttributes, const Flags, GLint internalFormat)
    6060    : m_contextAttributes(contextAttributes)
    6161{
     
    6565    }
    6666
    67     if (flags & FBOAttachment)
    68         m_internalFormat = m_format = GL_RGBA;
    69     else {
    70         // If GL_EXT_texture_format_BGRA8888 is supported in the OpenGLES
    71         // internal and external formats need to be BGRA
    72         m_internalFormat = GL_RGBA;
    73         m_format = GL_BGRA;
    74         if (m_contextAttributes.isGLES2Compliant) {
    75             if (m_contextAttributes.supportsBGRA8888)
    76                 m_internalFormat = GL_BGRA;
    77             else
    78                 m_format = GL_RGBA;
    79         }
    80     }
    81 }
    82 
    83 static void swizzleBGRAToRGBA(uint32_t* data, const IntRect& rect, int stride = 0)
    84 {
    85     stride = stride ? stride : rect.width();
    86     for (int y = rect.y(); y < rect.maxY(); ++y) {
    87         uint32_t* p = data + y * stride;
    88         for (int x = rect.x(); x < rect.maxX(); ++x)
    89             p[x] = ((p[x] << 16) & 0xff0000) | ((p[x] >> 16) & 0xff) | (p[x] & 0xff00ff00);
    90     }
     67    m_internalFormat = m_format = GL_RGBA;
    9168}
    9269
     
    9774
    9875    m_shouldClear = true;
     76    m_colorConvertFlags = TextureMapperGL::NoFlag;
    9977    if (m_textureSize == contentSize())
    10078        return;
     
    11088}
    11189
    112 void BitmapTextureGL::updateContentsNoSwizzle(const void* srcData, const IntRect& targetRect, const IntPoint& sourceOffset, int bytesPerLine, unsigned bytesPerPixel, GLuint glFormat)
    113 {
    114     // For ES drivers that don't support sub-images.
    115     bool contextSupportsUnpackSubimage = m_contextAttributes.supportsUnpackSubimage;
    116 
    117     glBindTexture(GL_TEXTURE_2D, m_id);
    118 
    119     if (contextSupportsUnpackSubimage) {
    120         // Use the OpenGL sub-image extension, now that we know it's available.
    121         glPixelStorei(GL_UNPACK_ROW_LENGTH, bytesPerLine / bytesPerPixel);
    122         glPixelStorei(GL_UNPACK_SKIP_ROWS, sourceOffset.y());
    123         glPixelStorei(GL_UNPACK_SKIP_PIXELS, sourceOffset.x());
    124     }
    125 
    126     glTexSubImage2D(GL_TEXTURE_2D, 0, targetRect.x(), targetRect.y(), targetRect.width(), targetRect.height(), glFormat, m_type, srcData);
    127 
    128     if (contextSupportsUnpackSubimage) {
    129         glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
    130         glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
    131         glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
    132     }
    133 }
    134 
    135 void BitmapTextureGL::updateContents(const void* srcData, const IntRect& targetRect, const IntPoint& sourceOffset, int bytesPerLine, UpdateContentsFlag updateContentsFlag)
    136 {
     90void BitmapTextureGL::updateContents(const void* srcData, const IntRect& targetRect, const IntPoint& sourceOffset, int bytesPerLine)
     91{
     92    // We are updating a texture with format RGBA with content from a buffer that has BGRA format. Instead of turning BGRA
     93    // into RGBA and then uploading it, we upload it as is. This causes the texture format to be RGBA but the content to be BGRA,
     94    // so we mark the texture to convert the colors when painting the texture.
     95    m_colorConvertFlags = TextureMapperGL::ShouldConvertTextureBGRAToRGBA;
     96
    13797    glBindTexture(GL_TEXTURE_2D, m_id);
    13898
     
    147107
    148108    // prepare temporaryData if necessary
    149     if ((m_format == GL_RGBA && updateContentsFlag == UpdateCannotModifyOriginalImageData) || requireSubImageBuffer) {
     109    if (requireSubImageBuffer) {
    150110        temporaryData.resize(targetRect.width() * targetRect.height() * bytesPerPixel);
    151111        data = temporaryData.data();
     
    164124    }
    165125
    166     if (m_format == GL_RGBA)
    167         swizzleBGRAToRGBA(reinterpret_cast_ptr<uint32_t*>(data), IntRect(adjustedSourceOffset, targetRect.size()), bytesPerLine / bytesPerPixel);
    168 
    169     updateContentsNoSwizzle(data, targetRect, adjustedSourceOffset, bytesPerLine, bytesPerPixel, m_format);
    170 }
    171 
    172 void BitmapTextureGL::updateContents(Image* image, const IntRect& targetRect, const IntPoint& offset, UpdateContentsFlag updateContentsFlag)
     126    glBindTexture(GL_TEXTURE_2D, m_id);
     127
     128    if (m_contextAttributes.supportsUnpackSubimage) {
     129        // Use the OpenGL sub-image extension, now that we know it's available.
     130        glPixelStorei(GL_UNPACK_ROW_LENGTH, bytesPerLine / bytesPerPixel);
     131        glPixelStorei(GL_UNPACK_SKIP_ROWS, adjustedSourceOffset.y());
     132        glPixelStorei(GL_UNPACK_SKIP_PIXELS, adjustedSourceOffset.x());
     133    }
     134
     135    glTexSubImage2D(GL_TEXTURE_2D, 0, targetRect.x(), targetRect.y(), targetRect.width(), targetRect.height(), m_format, m_type, srcData);
     136
     137    if (m_contextAttributes.supportsUnpackSubimage) {
     138        glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
     139        glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
     140        glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
     141    }
     142}
     143
     144void BitmapTextureGL::updateContents(Image* image, const IntRect& targetRect, const IntPoint& offset)
    173145{
    174146    if (!image)
     
    187159#endif
    188160
    189     updateContents(imageData, targetRect, offset, bytesPerLine, updateContentsFlag);
     161    updateContents(imageData, targetRect, offset, bytesPerLine);
    190162}
    191163
     
    233205            if (!last) {
    234206                if (!intermediateSurface)
    235                     intermediateSurface = texmapGL.acquireTextureFromPool(contentSize(), BitmapTexture::SupportsAlpha | BitmapTexture::FBOAttachment);
     207                    intermediateSurface = texmapGL.acquireTextureFromPool(contentSize(), BitmapTexture::SupportsAlpha);
    236208                texmapGL.bindSurface(intermediateSurface.get());
    237209            }
  • trunk/Source/WebCore/platform/graphics/texmap/BitmapTextureGL.h

    r220519 r229895  
    5656    uint32_t textureTarget() const { return GL_TEXTURE_2D; }
    5757    IntSize textureSize() const { return m_textureSize; }
    58     void updateContents(Image*, const IntRect&, const IntPoint&, UpdateContentsFlag) override;
    59     void updateContents(const void*, const IntRect& target, const IntPoint& sourceOffset, int bytesPerLine, UpdateContentsFlag) override;
    60     void updateContentsNoSwizzle(const void*, const IntRect& target, const IntPoint& sourceOffset, int bytesPerLine, unsigned bytesPerPixel = 4, GLuint glFormat = GL_RGBA);
     58    void updateContents(Image*, const IntRect&, const IntPoint&) override;
     59    void updateContents(const void*, const IntRect& target, const IntPoint& sourceOffset, int bytesPerLine) override;
    6160    bool isBackedByOpenGL() const override { return true; }
    6261
     
    8079    void copyFromExternalTexture(GLuint textureID);
    8180
     81    TextureMapperGL::Flags colorConvertFlags() const { return m_colorConvertFlags; }
     82
    8283private:
    8384    BitmapTextureGL(const TextureMapperContextAttributes&, const Flags, GLint internalFormat);
     
    9293    ClipStack m_clipStack;
    9394    TextureMapperContextAttributes m_contextAttributes;
     95    TextureMapperGL::Flags m_colorConvertFlags { TextureMapperGL::NoFlag };
    9496
    9597    void clearIfNeeded();
  • trunk/Source/WebCore/platform/graphics/texmap/BitmapTexturePool.cpp

    r229174 r229895  
    4747RefPtr<BitmapTexture> BitmapTexturePool::acquireTexture(const IntSize& size, const BitmapTexture::Flags flags)
    4848{
    49     Vector<Entry>& list = flags & BitmapTexture::FBOAttachment ? m_attachmentTextures : m_textures;
    50 
    51     Entry* selectedEntry = std::find_if(list.begin(), list.end(),
     49    Entry* selectedEntry = std::find_if(m_textures.begin(), m_textures.end(),
    5250        [&size](Entry& entry) { return entry.m_texture->refCount() == 1 && entry.m_texture->size() == size; });
    5351
    54     if (selectedEntry == list.end()) {
    55         list.append(Entry(createTexture(flags)));
    56         selectedEntry = &list.last();
     52    if (selectedEntry == m_textures.end()) {
     53        m_textures.append(Entry(createTexture(flags)));
     54        selectedEntry = &m_textures.last();
    5755    }
    5856
     
    7270void BitmapTexturePool::releaseUnusedTexturesTimerFired()
    7371{
     72    if (m_textures.isEmpty())
     73        return;
     74
    7475    // Delete entries, which have been unused in releaseUnusedSecondsTolerance.
    7576    MonotonicTime minUsedTime = MonotonicTime::now() - releaseUnusedSecondsTolerance;
    7677
    77     if (!m_textures.isEmpty()) {
    78         m_textures.removeAllMatching([&minUsedTime](const Entry& entry) {
    79             return entry.canBeReleased(minUsedTime);
    80         });
    81     }
     78    m_textures.removeAllMatching([&minUsedTime](const Entry& entry) {
     79        return entry.canBeReleased(minUsedTime);
     80    });
    8281
    83     if (!m_attachmentTextures.isEmpty()) {
    84         m_attachmentTextures.removeAllMatching([&minUsedTime](const Entry& entry) {
    85             return entry.canBeReleased(minUsedTime);
    86         });
    87     }
    88 
    89     if (!m_textures.isEmpty() || !m_attachmentTextures.isEmpty())
     82    if (!m_textures.isEmpty())
    9083        scheduleReleaseUnusedTextures();
    9184}
  • trunk/Source/WebCore/platform/graphics/texmap/BitmapTexturePool.h

    r229209 r229895  
    6868
    6969    Vector<Entry> m_textures;
    70     Vector<Entry> m_attachmentTextures;
    7170    RunLoop::Timer<BitmapTexturePool> m_releaseUnusedTexturesTimer;
    7271};
  • trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp

    r229318 r229895  
    523523
    524524    dirtyRect.scale(pageScaleFactor() * deviceScaleFactor());
    525     backingStore->updateContents(*textureMapper, this, m_size, dirtyRect, BitmapTexture::UpdateCanModifyOriginalImageData);
     525    backingStore->updateContents(*textureMapper, this, m_size, dirtyRect);
    526526
    527527    m_needsDisplay = false;
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperContextAttributes.cpp

    r229857 r229895  
    5757        String extensionsString(reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS)));
    5858        attributes.supportsNPOTTextures = extensionsString.contains(ASCIILiteral("GL_OES_texture_npot"));
    59         attributes.supportsBGRA8888 = extensionsString.contains(ASCIILiteral("GL_EXT_texture_format_BGRA8888"));
    6059        attributes.supportsUnpackSubimage = extensionsString.contains(ASCIILiteral("GL_EXT_unpack_subimage"));
    6160#else
    6261        attributes.isGLES2Compliant = false;
    6362        attributes.supportsNPOTTextures = true;
    64         attributes.supportsBGRA8888 = true;
    6563        attributes.supportsUnpackSubimage = true;
    6664#endif
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperContextAttributes.h

    r229857 r229895  
    3636    bool isGLES2Compliant { false };
    3737    bool supportsNPOTTextures { false };
    38     bool supportsBGRA8888 { false };
    3938    bool supportsUnpackSubimage { false };
    4039};
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp

    r229857 r229895  
    301301    const unsigned char* bits = cairo_image_surface_get_data(surface);
    302302    int stride = cairo_image_surface_get_stride(surface);
    303     static_cast<BitmapTextureGL*>(texture.get())->updateContentsNoSwizzle(bits, sourceRect, IntPoint::zero(), stride);
     303    static_cast<BitmapTextureGL*>(texture.get())->updateContents(bits, sourceRect, IntPoint::zero(), stride);
    304304    drawTexture(*texture, targetRect, modelViewMatrix, 1.0f, AllEdges);
    305305
     
    461461    SetForScope<const BitmapTextureGL::FilterInfo*> filterInfo(data().filterInfo, textureGL.filterInfo());
    462462
    463     drawTexture(textureGL.id(), textureGL.isOpaque() ? 0 : ShouldBlend, textureGL.size(), targetRect, matrix, opacity, exposedEdges);
     463    drawTexture(textureGL.id(), textureGL.colorConvertFlags() | (textureGL.isOpaque() ? 0 : ShouldBlend), textureGL.size(), targetRect, matrix, opacity, exposedEdges);
    464464}
    465465
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.h

    r224912 r229895  
    4545
    4646    enum Flag {
     47        NoFlag = 0x00,
    4748        ShouldBlend = 0x01,
    4849        ShouldFlipTexture = 0x02,
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp

    r229794 r229895  
    369369RefPtr<BitmapTexture> TextureMapperLayer::paintIntoSurface(const TextureMapperPaintOptions& options, const IntSize& size)
    370370{
    371     RefPtr<BitmapTexture> surface = options.textureMapper.acquireTextureFromPool(size, BitmapTexture::SupportsAlpha | BitmapTexture::FBOAttachment);
     371    RefPtr<BitmapTexture> surface = options.textureMapper.acquireTextureFromPool(size, BitmapTexture::SupportsAlpha);
    372372    TextureMapperPaintOptions paintOptions(options);
    373373    paintOptions.surface = surface;
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp

    r229857 r229895  
    7272        ASSERT(m_texture);
    7373        BitmapTextureGL* textureGL = static_cast<BitmapTextureGL*>(m_texture.get());
    74         texmapGL.drawTexture(textureGL->id(), m_extraFlags, textureGL->size(), targetRect, modelViewMatrix, opacity);
     74        texmapGL.drawTexture(textureGL->id(), m_extraFlags | textureGL->colorConvertFlags(), textureGL->size(), targetRect, modelViewMatrix, opacity);
    7575        return;
    7676    }
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperTile.cpp

    r204466 r229895  
    2828class GraphicsLayer;
    2929
    30 void TextureMapperTile::updateContents(TextureMapper& textureMapper, Image* image, const IntRect& dirtyRect, BitmapTexture::UpdateContentsFlag updateContentsFlag)
     30void TextureMapperTile::updateContents(TextureMapper& textureMapper, Image* image, const IntRect& dirtyRect)
    3131{
    3232    IntRect targetRect = enclosingIntRect(m_rect);
     
    4646    }
    4747
    48     m_texture->updateContents(image, targetRect, sourceOffset, updateContentsFlag);
     48    m_texture->updateContents(image, targetRect, sourceOffset);
    4949}
    5050
    51 void TextureMapperTile::updateContents(TextureMapper& textureMapper, GraphicsLayer* sourceLayer, const IntRect& dirtyRect, BitmapTexture::UpdateContentsFlag updateContentsFlag, float scale)
     51void TextureMapperTile::updateContents(TextureMapper& textureMapper, GraphicsLayer* sourceLayer, const IntRect& dirtyRect, float scale)
    5252{
    5353    IntRect targetRect = enclosingIntRect(m_rect);
     
    6565    }
    6666
    67     m_texture->updateContents(textureMapper, sourceLayer, targetRect, sourceOffset, updateContentsFlag, scale);
     67    m_texture->updateContents(textureMapper, sourceLayer, targetRect, sourceOffset, scale);
    6868}
    6969
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperTile.h

    r226657 r229895  
    3737    inline void setRect(const FloatRect& rect) { m_rect = rect; }
    3838
    39     void updateContents(TextureMapper&, Image*, const IntRect&, BitmapTexture::UpdateContentsFlag UpdateCanModifyOriginalImageData);
    40     void updateContents(TextureMapper&, GraphicsLayer*, const IntRect&, BitmapTexture::UpdateContentsFlag UpdateCanModifyOriginalImageData, float scale = 1);
     39    void updateContents(TextureMapper&, Image*, const IntRect&);
     40    void updateContents(TextureMapper&, GraphicsLayer*, const IntRect&, float scale = 1);
    4141    WEBCORE_EXPORT virtual void paint(TextureMapper&, const TransformationMatrix&, float, const unsigned exposedEdges);
    4242    virtual ~TextureMapperTile() = default;
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.cpp

    r229622 r229895  
    3535        return;
    3636
    37     updateContents(textureMapper, m_image.get(), m_image->size(), enclosingIntRect(m_image->rect()), BitmapTexture::UpdateCannotModifyOriginalImageData);
     37    updateContents(textureMapper, m_image.get(), m_image->size(), enclosingIntRect(m_image->rect()));
    3838
    3939    if (m_image->imageObserver())
     
    150150}
    151151
    152 void TextureMapperTiledBackingStore::updateContents(TextureMapper& textureMapper, Image* image, const FloatSize& totalSize, const IntRect& dirtyRect, BitmapTexture::UpdateContentsFlag updateContentsFlag)
     152void TextureMapperTiledBackingStore::updateContents(TextureMapper& textureMapper, Image* image, const FloatSize& totalSize, const IntRect& dirtyRect)
    153153{
    154154    createOrDestroyTilesIfNeeded(totalSize, textureMapper.maxTextureSize(), !image->currentFrameKnownToBeOpaque());
    155155    for (auto& tile : m_tiles)
    156         tile.updateContents(textureMapper, image, dirtyRect, updateContentsFlag);
     156        tile.updateContents(textureMapper, image, dirtyRect);
    157157}
    158158
    159 void TextureMapperTiledBackingStore::updateContents(TextureMapper& textureMapper, GraphicsLayer* sourceLayer, const FloatSize& totalSize, const IntRect& dirtyRect, BitmapTexture::UpdateContentsFlag updateContentsFlag)
     159void TextureMapperTiledBackingStore::updateContents(TextureMapper& textureMapper, GraphicsLayer* sourceLayer, const FloatSize& totalSize, const IntRect& dirtyRect)
    160160{
    161161    createOrDestroyTilesIfNeeded(totalSize, textureMapper.maxTextureSize(), true);
    162162    for (auto& tile : m_tiles)
    163         tile.updateContents(textureMapper, sourceLayer, dirtyRect, updateContentsFlag, m_contentsScale);
     163        tile.updateContents(textureMapper, sourceLayer, dirtyRect, m_contentsScale);
    164164}
    165165
  • trunk/Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.h

    r229622 r229895  
    4141
    4242    void updateContentsScale(float);
    43     void updateContents(TextureMapper&, Image*, const FloatSize&, const IntRect&, BitmapTexture::UpdateContentsFlag);
    44     void updateContents(TextureMapper&, GraphicsLayer*, const FloatSize&, const IntRect&, BitmapTexture::UpdateContentsFlag);
     43    void updateContents(TextureMapper&, Image*, const FloatSize&, const IntRect&);
     44    void updateContents(TextureMapper&, GraphicsLayer*, const FloatSize&, const IntRect&);
    4545
    4646    void setContentsToImage(Image* image) { m_image = image; }
  • trunk/Source/WebKit/ChangeLog

    r229885 r229895  
     12018-03-23  Miguel Gomez  <magomez@igalia.com>
     2
     3        [GTK][WPE] Avoid software color conversion inside BitmapTextureGL
     4        https://bugs.webkit.org/show_bug.cgi?id=183892
     5
     6        Remove the UpdateContentsFlag parameter when calling BitmapTexture::updateContents().
     7
     8        Reviewed by Žan Doberšek.
     9
     10        * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
     11        (WebKit::CoordinatedBackingStoreTile::swapBuffers):
     12
    1132018-03-23  Michael Catanzaro  <mcatanzaro@igalia.com>
    214
  • trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp

    r229622 r229895  
    4848        m_texture->reset(m_tileRect.size(), m_buffer->supportsAlpha());
    4949
    50     m_texture->updateContents(m_buffer->data(), m_sourceRect, m_bufferOffset, m_buffer->stride(), BitmapTexture::UpdateCanModifyOriginalImageData);
     50    m_texture->updateContents(m_buffer->data(), m_sourceRect, m_bufferOffset, m_buffer->stride());
    5151    m_buffer = nullptr;
    5252}
  • trunk/Source/WebKitLegacy/win/ChangeLog

    r229640 r229895  
     12018-03-23  Miguel Gomez  <magomez@igalia.com>
     2
     3        [GTK][WPE] Avoid software color conversion inside BitmapTextureGL
     4        https://bugs.webkit.org/show_bug.cgi?id=183892
     5
     6        Remove the UpdateContentsFlag parameter as it's not used anymore.
     7
     8        Reviewed by Žan Doberšek.
     9
     10        * WebCoreSupport/AcceleratedCompositingContext.cpp:
     11        (AcceleratedCompositingContext::acceleratedCompositingAvailable):
     12
    1132018-03-15  Yousuke Kimoto  <yousuke.kimoto@sony.com>
    214
  • trunk/Source/WebKitLegacy/win/WebCoreSupport/AcceleratedCompositingContext.cpp

    r228590 r229895  
    320320    IntPoint offset(0, 0);
    321321    int bytesPerLine = width * 4;
    322     BitmapTexture::UpdateContentsFlag flags = BitmapTexture::UpdateCanModifyOriginalImageData;
    323     texture->updateContents(data, targetRect, offset, bytesPerLine, flags);
     322    texture->updateContents(data, targetRect, offset, bytesPerLine);
    324323
    325324    // Render texture.
Note: See TracChangeset for help on using the changeset viewer.