Changeset 229895 in webkit
- Timestamp:
- Mar 23, 2018 8:29:30 AM (6 years ago)
- Location:
- trunk/Source
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r229893 r229895 1 2018-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 1 55 2018-03-23 Yusuke Suzuki <utatane.tea@gmail.com> 2 56 -
trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp
r229857 r229895 707 707 int stride = GST_VIDEO_FRAME_PLANE_STRIDE(&videoFrame, 0); 708 708 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); 710 710 gst_video_frame_unmap(&videoFrame); 711 711 } -
trunk/Source/WebCore/platform/graphics/texmap/BitmapTexture.cpp
r213043 r229895 34 34 namespace WebCore { 35 35 36 void BitmapTexture::updateContents(TextureMapper&, GraphicsLayer* sourceLayer, const IntRect& targetRect, const IntPoint& offset, UpdateContentsFlag updateContentsFlag,float scale)36 void BitmapTexture::updateContents(TextureMapper&, GraphicsLayer* sourceLayer, const IntRect& targetRect, const IntPoint& offset, float scale) 37 37 { 38 38 // Making an unconditionally unaccelerated buffer here is OK because this code … … 59 59 return; 60 60 61 updateContents(image.get(), targetRect, IntPoint() , updateContentsFlag);61 updateContents(image.get(), targetRect, IntPoint()); 62 62 } 63 63 -
trunk/Source/WebCore/platform/graphics/texmap/BitmapTexture.h
r223728 r229895 47 47 NoFlag = 0, 48 48 SupportsAlpha = 0x01, 49 FBOAttachment = 0x0250 };51 52 enum UpdateContentsFlag {53 UpdateCanModifyOriginalImageData,54 UpdateCannotModifyOriginalImageData55 49 }; 56 50 … … 66 60 67 61 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; 71 65 virtual bool isValid() const = 0; 72 66 inline Flags flags() const { return m_flags; } -
trunk/Source/WebCore/platform/graphics/texmap/BitmapTextureGL.cpp
r224340 r229895 57 57 } 58 58 59 BitmapTextureGL::BitmapTextureGL(const TextureMapperContextAttributes& contextAttributes, const Flags flags, GLint internalFormat)59 BitmapTextureGL::BitmapTextureGL(const TextureMapperContextAttributes& contextAttributes, const Flags, GLint internalFormat) 60 60 : m_contextAttributes(contextAttributes) 61 61 { … … 65 65 } 66 66 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; 91 68 } 92 69 … … 97 74 98 75 m_shouldClear = true; 76 m_colorConvertFlags = TextureMapperGL::NoFlag; 99 77 if (m_textureSize == contentSize()) 100 78 return; … … 110 88 } 111 89 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 { 90 void 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 137 97 glBindTexture(GL_TEXTURE_2D, m_id); 138 98 … … 147 107 148 108 // prepare temporaryData if necessary 149 if ( (m_format == GL_RGBA && updateContentsFlag == UpdateCannotModifyOriginalImageData) ||requireSubImageBuffer) {109 if (requireSubImageBuffer) { 150 110 temporaryData.resize(targetRect.width() * targetRect.height() * bytesPerPixel); 151 111 data = temporaryData.data(); … … 164 124 } 165 125 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 144 void BitmapTextureGL::updateContents(Image* image, const IntRect& targetRect, const IntPoint& offset) 173 145 { 174 146 if (!image) … … 187 159 #endif 188 160 189 updateContents(imageData, targetRect, offset, bytesPerLine , updateContentsFlag);161 updateContents(imageData, targetRect, offset, bytesPerLine); 190 162 } 191 163 … … 233 205 if (!last) { 234 206 if (!intermediateSurface) 235 intermediateSurface = texmapGL.acquireTextureFromPool(contentSize(), BitmapTexture::SupportsAlpha | BitmapTexture::FBOAttachment);207 intermediateSurface = texmapGL.acquireTextureFromPool(contentSize(), BitmapTexture::SupportsAlpha); 236 208 texmapGL.bindSurface(intermediateSurface.get()); 237 209 } -
trunk/Source/WebCore/platform/graphics/texmap/BitmapTextureGL.h
r220519 r229895 56 56 uint32_t textureTarget() const { return GL_TEXTURE_2D; } 57 57 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; 61 60 bool isBackedByOpenGL() const override { return true; } 62 61 … … 80 79 void copyFromExternalTexture(GLuint textureID); 81 80 81 TextureMapperGL::Flags colorConvertFlags() const { return m_colorConvertFlags; } 82 82 83 private: 83 84 BitmapTextureGL(const TextureMapperContextAttributes&, const Flags, GLint internalFormat); … … 92 93 ClipStack m_clipStack; 93 94 TextureMapperContextAttributes m_contextAttributes; 95 TextureMapperGL::Flags m_colorConvertFlags { TextureMapperGL::NoFlag }; 94 96 95 97 void clearIfNeeded(); -
trunk/Source/WebCore/platform/graphics/texmap/BitmapTexturePool.cpp
r229174 r229895 47 47 RefPtr<BitmapTexture> BitmapTexturePool::acquireTexture(const IntSize& size, const BitmapTexture::Flags flags) 48 48 { 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(), 52 50 [&size](Entry& entry) { return entry.m_texture->refCount() == 1 && entry.m_texture->size() == size; }); 53 51 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(); 57 55 } 58 56 … … 72 70 void BitmapTexturePool::releaseUnusedTexturesTimerFired() 73 71 { 72 if (m_textures.isEmpty()) 73 return; 74 74 75 // Delete entries, which have been unused in releaseUnusedSecondsTolerance. 75 76 MonotonicTime minUsedTime = MonotonicTime::now() - releaseUnusedSecondsTolerance; 76 77 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 }); 82 81 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()) 90 83 scheduleReleaseUnusedTextures(); 91 84 } -
trunk/Source/WebCore/platform/graphics/texmap/BitmapTexturePool.h
r229209 r229895 68 68 69 69 Vector<Entry> m_textures; 70 Vector<Entry> m_attachmentTextures;71 70 RunLoop::Timer<BitmapTexturePool> m_releaseUnusedTexturesTimer; 72 71 }; -
trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
r229318 r229895 523 523 524 524 dirtyRect.scale(pageScaleFactor() * deviceScaleFactor()); 525 backingStore->updateContents(*textureMapper, this, m_size, dirtyRect , BitmapTexture::UpdateCanModifyOriginalImageData);525 backingStore->updateContents(*textureMapper, this, m_size, dirtyRect); 526 526 527 527 m_needsDisplay = false; -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperContextAttributes.cpp
r229857 r229895 57 57 String extensionsString(reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS))); 58 58 attributes.supportsNPOTTextures = extensionsString.contains(ASCIILiteral("GL_OES_texture_npot")); 59 attributes.supportsBGRA8888 = extensionsString.contains(ASCIILiteral("GL_EXT_texture_format_BGRA8888"));60 59 attributes.supportsUnpackSubimage = extensionsString.contains(ASCIILiteral("GL_EXT_unpack_subimage")); 61 60 #else 62 61 attributes.isGLES2Compliant = false; 63 62 attributes.supportsNPOTTextures = true; 64 attributes.supportsBGRA8888 = true;65 63 attributes.supportsUnpackSubimage = true; 66 64 #endif -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperContextAttributes.h
r229857 r229895 36 36 bool isGLES2Compliant { false }; 37 37 bool supportsNPOTTextures { false }; 38 bool supportsBGRA8888 { false };39 38 bool supportsUnpackSubimage { false }; 40 39 }; -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp
r229857 r229895 301 301 const unsigned char* bits = cairo_image_surface_get_data(surface); 302 302 int stride = cairo_image_surface_get_stride(surface); 303 static_cast<BitmapTextureGL*>(texture.get())->updateContents NoSwizzle(bits, sourceRect, IntPoint::zero(), stride);303 static_cast<BitmapTextureGL*>(texture.get())->updateContents(bits, sourceRect, IntPoint::zero(), stride); 304 304 drawTexture(*texture, targetRect, modelViewMatrix, 1.0f, AllEdges); 305 305 … … 461 461 SetForScope<const BitmapTextureGL::FilterInfo*> filterInfo(data().filterInfo, textureGL.filterInfo()); 462 462 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); 464 464 } 465 465 -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperGL.h
r224912 r229895 45 45 46 46 enum Flag { 47 NoFlag = 0x00, 47 48 ShouldBlend = 0x01, 48 49 ShouldFlipTexture = 0x02, -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp
r229794 r229895 369 369 RefPtr<BitmapTexture> TextureMapperLayer::paintIntoSurface(const TextureMapperPaintOptions& options, const IntSize& size) 370 370 { 371 RefPtr<BitmapTexture> surface = options.textureMapper.acquireTextureFromPool(size, BitmapTexture::SupportsAlpha | BitmapTexture::FBOAttachment);371 RefPtr<BitmapTexture> surface = options.textureMapper.acquireTextureFromPool(size, BitmapTexture::SupportsAlpha); 372 372 TextureMapperPaintOptions paintOptions(options); 373 373 paintOptions.surface = surface; -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp
r229857 r229895 72 72 ASSERT(m_texture); 73 73 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); 75 75 return; 76 76 } -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperTile.cpp
r204466 r229895 28 28 class GraphicsLayer; 29 29 30 void TextureMapperTile::updateContents(TextureMapper& textureMapper, Image* image, const IntRect& dirtyRect , BitmapTexture::UpdateContentsFlag updateContentsFlag)30 void TextureMapperTile::updateContents(TextureMapper& textureMapper, Image* image, const IntRect& dirtyRect) 31 31 { 32 32 IntRect targetRect = enclosingIntRect(m_rect); … … 46 46 } 47 47 48 m_texture->updateContents(image, targetRect, sourceOffset , updateContentsFlag);48 m_texture->updateContents(image, targetRect, sourceOffset); 49 49 } 50 50 51 void TextureMapperTile::updateContents(TextureMapper& textureMapper, GraphicsLayer* sourceLayer, const IntRect& dirtyRect, BitmapTexture::UpdateContentsFlag updateContentsFlag,float scale)51 void TextureMapperTile::updateContents(TextureMapper& textureMapper, GraphicsLayer* sourceLayer, const IntRect& dirtyRect, float scale) 52 52 { 53 53 IntRect targetRect = enclosingIntRect(m_rect); … … 65 65 } 66 66 67 m_texture->updateContents(textureMapper, sourceLayer, targetRect, sourceOffset, updateContentsFlag,scale);67 m_texture->updateContents(textureMapper, sourceLayer, targetRect, sourceOffset, scale); 68 68 } 69 69 -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperTile.h
r226657 r229895 37 37 inline void setRect(const FloatRect& rect) { m_rect = rect; } 38 38 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); 41 41 WEBCORE_EXPORT virtual void paint(TextureMapper&, const TransformationMatrix&, float, const unsigned exposedEdges); 42 42 virtual ~TextureMapperTile() = default; -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.cpp
r229622 r229895 35 35 return; 36 36 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())); 38 38 39 39 if (m_image->imageObserver()) … … 150 150 } 151 151 152 void TextureMapperTiledBackingStore::updateContents(TextureMapper& textureMapper, Image* image, const FloatSize& totalSize, const IntRect& dirtyRect , BitmapTexture::UpdateContentsFlag updateContentsFlag)152 void TextureMapperTiledBackingStore::updateContents(TextureMapper& textureMapper, Image* image, const FloatSize& totalSize, const IntRect& dirtyRect) 153 153 { 154 154 createOrDestroyTilesIfNeeded(totalSize, textureMapper.maxTextureSize(), !image->currentFrameKnownToBeOpaque()); 155 155 for (auto& tile : m_tiles) 156 tile.updateContents(textureMapper, image, dirtyRect , updateContentsFlag);156 tile.updateContents(textureMapper, image, dirtyRect); 157 157 } 158 158 159 void TextureMapperTiledBackingStore::updateContents(TextureMapper& textureMapper, GraphicsLayer* sourceLayer, const FloatSize& totalSize, const IntRect& dirtyRect , BitmapTexture::UpdateContentsFlag updateContentsFlag)159 void TextureMapperTiledBackingStore::updateContents(TextureMapper& textureMapper, GraphicsLayer* sourceLayer, const FloatSize& totalSize, const IntRect& dirtyRect) 160 160 { 161 161 createOrDestroyTilesIfNeeded(totalSize, textureMapper.maxTextureSize(), true); 162 162 for (auto& tile : m_tiles) 163 tile.updateContents(textureMapper, sourceLayer, dirtyRect, updateContentsFlag,m_contentsScale);163 tile.updateContents(textureMapper, sourceLayer, dirtyRect, m_contentsScale); 164 164 } 165 165 -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.h
r229622 r229895 41 41 42 42 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&); 45 45 46 46 void setContentsToImage(Image* image) { m_image = image; } -
trunk/Source/WebKit/ChangeLog
r229885 r229895 1 2018-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 1 13 2018-03-23 Michael Catanzaro <mcatanzaro@igalia.com> 2 14 -
trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp
r229622 r229895 48 48 m_texture->reset(m_tileRect.size(), m_buffer->supportsAlpha()); 49 49 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()); 51 51 m_buffer = nullptr; 52 52 } -
trunk/Source/WebKitLegacy/win/ChangeLog
r229640 r229895 1 2018-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 1 13 2018-03-15 Yousuke Kimoto <yousuke.kimoto@sony.com> 2 14 -
trunk/Source/WebKitLegacy/win/WebCoreSupport/AcceleratedCompositingContext.cpp
r228590 r229895 320 320 IntPoint offset(0, 0); 321 321 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); 324 323 325 324 // Render texture.
Note: See TracChangeset
for help on using the changeset viewer.