Diff
Modified: trunk/Source/WebCore/ChangeLog (194102 => 194103)
--- trunk/Source/WebCore/ChangeLog 2015-12-15 10:33:09 UTC (rev 194102)
+++ trunk/Source/WebCore/ChangeLog 2015-12-15 11:54:13 UTC (rev 194103)
@@ -1,3 +1,76 @@
+2015-12-15 Zan Dobersek <[email protected]>
+
+ [TexMap] Operate with a reference to the TextureMapper wherever possible
+ https://bugs.webkit.org/show_bug.cgi?id=152118
+
+ Reviewed by Martin Robinson.
+
+ 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:
+
2015-12-15 Youenn Fablet <[email protected]>
WebIDL generator should support the possibility for C++ classes to have a JS Builtin constructor
Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext3DPrivate.cpp (194102 => 194103)
--- trunk/Source/WebCore/platform/graphics/GraphicsContext3DPrivate.cpp 2015-12-15 10:33:09 UTC (rev 194102)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext3DPrivate.cpp 2015-12-15 11:54:13 UTC (rev 194103)
@@ -112,7 +112,7 @@
m_context->markLayerComposited();
}
#elif USE(TEXTURE_MAPPER) && !USE(COORDINATED_GRAPHICS_THREADED)
-void GraphicsContext3DPrivate::paintToTextureMapper(TextureMapper* textureMapper, const FloatRect& targetRect, const TransformationMatrix& matrix, float opacity)
+void GraphicsContext3DPrivate::paintToTextureMapper(TextureMapper& textureMapper, const FloatRect& targetRect, const TransformationMatrix& matrix, float opacity)
{
if (!m_glContext)
return;
@@ -134,10 +134,10 @@
previousActiveContext->makeContextCurrent();
}
- TextureMapperGL* texmapGL = static_cast<TextureMapperGL*>(textureMapper);
+ TextureMapperGL& texmapGL = static_cast<TextureMapperGL&>(textureMapper);
TextureMapperGL::Flags flags = TextureMapperGL::ShouldFlipTexture | (m_context->m_attrs.alpha ? TextureMapperGL::ShouldBlend : 0);
IntSize textureSize(m_context->m_currentWidth, m_context->m_currentHeight);
- texmapGL->drawTexture(m_context->m_texture, flags, textureSize, targetRect, matrix, opacity);
+ texmapGL.drawTexture(m_context->m_texture, flags, textureSize, targetRect, matrix, opacity);
#endif // USE(TEXTURE_MAPPER_GL)
}
#endif // USE(TEXTURE_MAPPER)
Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext3DPrivate.h (194102 => 194103)
--- trunk/Source/WebCore/platform/graphics/GraphicsContext3DPrivate.h 2015-12-15 10:33:09 UTC (rev 194102)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext3DPrivate.h 2015-12-15 11:54:13 UTC (rev 194103)
@@ -51,7 +51,7 @@
virtual RefPtr<TextureMapperPlatformLayerProxy> proxy() const override;
virtual void swapBuffersIfNeeded() override;
#elif USE(TEXTURE_MAPPER)
- virtual void paintToTextureMapper(TextureMapper*, const FloatRect& target, const TransformationMatrix&, float opacity);
+ virtual void paintToTextureMapper(TextureMapper&, const FloatRect& target, const TransformationMatrix&, float opacity);
#endif
private:
Modified: trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp (194102 => 194103)
--- trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp 2015-12-15 10:33:09 UTC (rev 194102)
+++ trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp 2015-12-15 11:54:13 UTC (rev 194103)
@@ -468,7 +468,7 @@
#endif
#if ENABLE(ACCELERATED_2D_CANVAS) && !USE(COORDINATED_GRAPHICS_THREADED)
-void ImageBufferData::paintToTextureMapper(TextureMapper* textureMapper, const FloatRect& targetRect, const TransformationMatrix& matrix, float opacity)
+void ImageBufferData::paintToTextureMapper(TextureMapper& textureMapper, const FloatRect& targetRect, const TransformationMatrix& matrix, float opacity)
{
ASSERT(m_texture);
@@ -477,7 +477,7 @@
cairo_surface_flush(m_surface.get());
previousActiveContext->makeContextCurrent();
- static_cast<TextureMapperGL*>(textureMapper)->drawTexture(m_texture, TextureMapperGL::ShouldBlend, m_size, targetRect, matrix, opacity);
+ static_cast<TextureMapperGL&>(textureMapper).drawTexture(m_texture, TextureMapperGL::ShouldBlend, m_size, targetRect, matrix, opacity);
}
#endif
Modified: trunk/Source/WebCore/platform/graphics/cairo/ImageBufferDataCairo.h (194102 => 194103)
--- trunk/Source/WebCore/platform/graphics/cairo/ImageBufferDataCairo.h 2015-12-15 10:33:09 UTC (rev 194102)
+++ trunk/Source/WebCore/platform/graphics/cairo/ImageBufferDataCairo.h 2015-12-15 11:54:13 UTC (rev 194103)
@@ -74,7 +74,7 @@
uint32_t m_compositorTexture;
RefPtr<cairo_t> m_compositorCr;
#else
- virtual void paintToTextureMapper(TextureMapper*, const FloatRect& target, const TransformationMatrix&, float opacity);
+ virtual void paintToTextureMapper(TextureMapper&, const FloatRect& target, const TransformationMatrix&, float opacity);
#endif
uint32_t m_texture;
#endif
Modified: trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.cpp (194102 => 194103)
--- trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.cpp 2015-12-15 10:33:09 UTC (rev 194102)
+++ trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.cpp 2015-12-15 11:54:13 UTC (rev 194103)
@@ -159,7 +159,7 @@
return true;
}
-void GraphicsContext3DPrivate::paintToTextureMapper(TextureMapper*, const FloatRect& /* target */, const TransformationMatrix&, float /* opacity */)
+void GraphicsContext3DPrivate::paintToTextureMapper(TextureMapper&, const FloatRect& /* target */, const TransformationMatrix&, float /* opacity */)
{
notImplemented();
}
Modified: trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.h (194102 => 194103)
--- trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.h 2015-12-15 10:33:09 UTC (rev 194102)
+++ trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.h 2015-12-15 11:54:13 UTC (rev 194103)
@@ -36,7 +36,7 @@
PlatformGraphicsContext3D platformGraphicsContext3D() const;
void setContextLostCallback(std::unique_ptr<GraphicsContext3D::ContextLostCallback>);
- virtual void paintToTextureMapper(TextureMapper*, const FloatRect&, const TransformationMatrix&, float) override;
+ virtual void paintToTextureMapper(TextureMapper&, const FloatRect&, const TransformationMatrix&, float) override;
virtual IntSize platformLayerSize() const override;
virtual uint32_t copyToGraphicsSurface() override;
virtual GraphicsSurfaceToken graphicsSurfaceToken() const override;
Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp (194102 => 194103)
--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp 2015-12-15 10:33:09 UTC (rev 194102)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp 2015-12-15 11:54:13 UTC (rev 194103)
@@ -626,7 +626,7 @@
}
#if USE(TEXTURE_MAPPER_GL) && !USE(COORDINATED_GRAPHICS)
-void MediaPlayerPrivateGStreamerBase::paintToTextureMapper(TextureMapper* textureMapper, const FloatRect& targetRect, const TransformationMatrix& matrix, float opacity)
+void MediaPlayerPrivateGStreamerBase::paintToTextureMapper(TextureMapper& textureMapper, const FloatRect& targetRect, const TransformationMatrix& matrix, float opacity)
{
if (!m_player->visible())
return;
@@ -649,10 +649,10 @@
return;
IntSize size = IntSize(GST_VIDEO_INFO_WIDTH(&videoInfo), GST_VIDEO_INFO_HEIGHT(&videoInfo));
- texture = textureMapper->acquireTextureFromPool(size, GST_VIDEO_INFO_HAS_ALPHA(&videoInfo) ? BitmapTexture::SupportsAlpha : BitmapTexture::NoFlag);
+ texture = textureMapper.acquireTextureFromPool(size, GST_VIDEO_INFO_HAS_ALPHA(&videoInfo) ? BitmapTexture::SupportsAlpha : BitmapTexture::NoFlag);
updateTexture(static_cast<BitmapTextureGL&>(*texture), videoInfo);
}
- textureMapper->drawTexture(*texture, targetRect, matrix, opacity);
+ textureMapper.drawTexture(*texture, targetRect, matrix, opacity);
return;
}
@@ -678,8 +678,8 @@
TextureMapperGL::Flags flags = GST_VIDEO_INFO_HAS_ALPHA(&videoInfo) ? TextureMapperGL::ShouldBlend : 0;
IntSize size = IntSize(GST_VIDEO_INFO_WIDTH(&videoInfo), GST_VIDEO_INFO_HEIGHT(&videoInfo));
- TextureMapperGL* textureMapperGL = reinterpret_cast<TextureMapperGL*>(textureMapper);
- textureMapperGL->drawTexture(textureID, flags, size, targetRect, matrix, opacity);
+ TextureMapperGL& textureMapperGL = reinterpret_cast<TextureMapperGL&>(textureMapper);
+ textureMapperGL.drawTexture(textureID, flags, size, targetRect, matrix, opacity);
gst_video_frame_unmap(&videoFrame);
#endif
}
Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h (194102 => 194103)
--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h 2015-12-15 10:33:09 UTC (rev 194102)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h 2015-12-15 11:54:13 UTC (rev 194103)
@@ -110,7 +110,7 @@
#else
virtual bool supportsAcceleratedRendering() const override { return true; }
#endif
- virtual void paintToTextureMapper(TextureMapper*, const FloatRect&, const TransformationMatrix&, float) override;
+ virtual void paintToTextureMapper(TextureMapper&, const FloatRect&, const TransformationMatrix&, float) override;
#endif
#if USE(COORDINATED_GRAPHICS_THREADED)
Modified: trunk/Source/WebCore/platform/graphics/surfaces/GraphicsSurface.cpp (194102 => 194103)
--- trunk/Source/WebCore/platform/graphics/surfaces/GraphicsSurface.cpp 2015-12-15 10:33:09 UTC (rev 194102)
+++ trunk/Source/WebCore/platform/graphics/surfaces/GraphicsSurface.cpp 2015-12-15 11:54:13 UTC (rev 194103)
@@ -63,7 +63,7 @@
platformCopyFromTexture(texture, sourceRect);
}
-void GraphicsSurface::paintToTextureMapper(TextureMapper* textureMapper, const FloatRect& targetRect, const TransformationMatrix& transform, float opacity)
+void GraphicsSurface::paintToTextureMapper(TextureMapper& textureMapper, const FloatRect& targetRect, const TransformationMatrix& transform, float opacity)
{
platformPaintToTextureMapper(textureMapper, targetRect, transform, opacity);
}
Modified: trunk/Source/WebCore/platform/graphics/surfaces/GraphicsSurface.h (194102 => 194103)
--- trunk/Source/WebCore/platform/graphics/surfaces/GraphicsSurface.h 2015-12-15 10:33:09 UTC (rev 194102)
+++ trunk/Source/WebCore/platform/graphics/surfaces/GraphicsSurface.h 2015-12-15 11:54:13 UTC (rev 194103)
@@ -77,7 +77,7 @@
static PassRefPtr<GraphicsSurface> create(const IntSize&, Flags, const GraphicsSurfaceToken&);
void copyToGLTexture(uint32_t target, uint32_t texture, const IntRect& targetRect, const IntPoint& sourceOffset);
void copyFromTexture(uint32_t texture, const IntRect& sourceRect);
- void paintToTextureMapper(TextureMapper*, const FloatRect& targetRect, const TransformationMatrix&, float opacity);
+ void paintToTextureMapper(TextureMapper&, const FloatRect& targetRect, const TransformationMatrix&, float opacity);
uint32_t frontBuffer();
uint32_t swapBuffers();
GraphicsSurfaceToken exportToken();
@@ -97,7 +97,7 @@
void platformUnlock();
void platformCopyToGLTexture(uint32_t target, uint32_t texture, const IntRect&, const IntPoint&);
void platformCopyFromTexture(uint32_t texture, const IntRect& sourceRect);
- void platformPaintToTextureMapper(TextureMapper*, const FloatRect& targetRect, const TransformationMatrix&, float opacity);
+ void platformPaintToTextureMapper(TextureMapper&, const FloatRect& targetRect, const TransformationMatrix&, float opacity);
uint32_t platformFrontBuffer() const;
uint32_t platformSwapBuffers();
IntSize platformSize() const;
Modified: trunk/Source/WebCore/platform/graphics/surfaces/efl/GraphicsSurfaceCommon.cpp (194102 => 194103)
--- trunk/Source/WebCore/platform/graphics/surfaces/efl/GraphicsSurfaceCommon.cpp 2015-12-15 10:33:09 UTC (rev 194102)
+++ trunk/Source/WebCore/platform/graphics/surfaces/efl/GraphicsSurfaceCommon.cpp 2015-12-15 11:54:13 UTC (rev 194103)
@@ -175,7 +175,7 @@
m_private->copyFromTexture(textureId);
}
-void GraphicsSurface::platformPaintToTextureMapper(TextureMapper* textureMapper, const FloatRect& targetRect, const TransformationMatrix& transform, float opacity)
+void GraphicsSurface::platformPaintToTextureMapper(TextureMapper& textureMapper, const FloatRect& targetRect, const TransformationMatrix& transform, float opacity)
{
uint32_t texture = platformGetTextureID();
if (!texture)
@@ -183,7 +183,7 @@
TransformationMatrix adjustedTransform = transform;
adjustedTransform.multiply(TransformationMatrix::rectToRect(m_private->rect(), targetRect));
- static_cast<TextureMapperGL*>(textureMapper)->drawTexture(texture, m_private->flags(), m_private->size(), m_private->rect(), adjustedTransform, opacity);
+ static_cast<TextureMapperGL&>(textureMapper).drawTexture(texture, m_private->flags(), m_private->size(), m_private->rect(), adjustedTransform, opacity);
}
uint32_t GraphicsSurface::platformFrontBuffer() const
Modified: trunk/Source/WebCore/platform/graphics/texmap/BitmapTexture.cpp (194102 => 194103)
--- trunk/Source/WebCore/platform/graphics/texmap/BitmapTexture.cpp 2015-12-15 10:33:09 UTC (rev 194102)
+++ trunk/Source/WebCore/platform/graphics/texmap/BitmapTexture.cpp 2015-12-15 11:54:13 UTC (rev 194103)
@@ -33,7 +33,7 @@
namespace WebCore {
-void BitmapTexture::updateContents(TextureMapper* textureMapper, GraphicsLayer* sourceLayer, const IntRect& targetRect, const IntPoint& offset, UpdateContentsFlag updateContentsFlag, float scale)
+void BitmapTexture::updateContents(TextureMapper& textureMapper, GraphicsLayer* sourceLayer, const IntRect& targetRect, const IntPoint& offset, UpdateContentsFlag updateContentsFlag, float scale)
{
// Making an unconditionally unaccelerated buffer here is OK because this code
// isn't used by any platforms that respect the accelerated bit.
@@ -43,8 +43,8 @@
return;
GraphicsContext& context = imageBuffer->context();
- context.setImageInterpolationQuality(textureMapper->imageInterpolationQuality());
- context.setTextDrawingMode(textureMapper->textDrawingMode());
+ context.setImageInterpolationQuality(textureMapper.imageInterpolationQuality());
+ context.setTextDrawingMode(textureMapper.textDrawingMode());
IntRect sourceRect(targetRect);
sourceRect.setLocation(offset);
Modified: trunk/Source/WebCore/platform/graphics/texmap/BitmapTexture.h (194102 => 194103)
--- trunk/Source/WebCore/platform/graphics/texmap/BitmapTexture.h 2015-12-15 10:33:09 UTC (rev 194102)
+++ trunk/Source/WebCore/platform/graphics/texmap/BitmapTexture.h 2015-12-15 11:54:13 UTC (rev 194103)
@@ -65,7 +65,7 @@
virtual IntSize size() const = 0;
virtual void updateContents(Image*, const IntRect&, const IntPoint& offset, UpdateContentsFlag) = 0;
- virtual void updateContents(TextureMapper*, GraphicsLayer*, const IntRect& target, const IntPoint& offset, UpdateContentsFlag, float scale = 1);
+ virtual void updateContents(TextureMapper&, GraphicsLayer*, const IntRect& target, const IntPoint& offset, UpdateContentsFlag, float scale = 1);
virtual void updateContents(const void*, const IntRect& target, const IntPoint& offset, int bytesPerLine, UpdateContentsFlag) = 0;
virtual bool isValid() const = 0;
inline Flags flags() const { return m_flags; }
@@ -83,7 +83,7 @@
inline int numberOfBytes() const { return size().width() * size().height() * bpp() >> 3; }
inline bool isOpaque() const { return !(m_flags & SupportsAlpha); }
- virtual PassRefPtr<BitmapTexture> applyFilters(TextureMapper*, const FilterOperations&) { return this; }
+ virtual PassRefPtr<BitmapTexture> applyFilters(TextureMapper&, const FilterOperations&) { return this; }
protected:
IntSize m_contentSize;
Modified: trunk/Source/WebCore/platform/graphics/texmap/BitmapTextureGL.cpp (194102 => 194103)
--- trunk/Source/WebCore/platform/graphics/texmap/BitmapTextureGL.cpp 2015-12-15 10:33:09 UTC (rev 194102)
+++ trunk/Source/WebCore/platform/graphics/texmap/BitmapTextureGL.cpp 2015-12-15 11:54:13 UTC (rev 194103)
@@ -221,13 +221,13 @@
}
}
-PassRefPtr<BitmapTexture> BitmapTextureGL::applyFilters(TextureMapper* textureMapper, const FilterOperations& filters)
+PassRefPtr<BitmapTexture> BitmapTextureGL::applyFilters(TextureMapper& textureMapper, const FilterOperations& filters)
{
if (filters.isEmpty())
return this;
- TextureMapperGL* texmapGL = static_cast<TextureMapperGL*>(textureMapper);
- RefPtr<BitmapTexture> previousSurface = texmapGL->currentSurface();
+ TextureMapperGL& texmapGL = static_cast<TextureMapperGL&>(textureMapper);
+ RefPtr<BitmapTexture> previousSurface = texmapGL.currentSurface();
RefPtr<BitmapTexture> resultSurface = this;
RefPtr<BitmapTexture> intermediateSurface;
RefPtr<BitmapTexture> spareSurface;
@@ -243,8 +243,8 @@
bool last = (i == filters.size() - 1) && (j == numPasses - 1);
if (!last) {
if (!intermediateSurface)
- intermediateSurface = texmapGL->acquireTextureFromPool(contentSize());
- texmapGL->bindSurface(intermediateSurface.get());
+ intermediateSurface = texmapGL.acquireTextureFromPool(contentSize());
+ texmapGL.bindSurface(intermediateSurface.get());
}
if (last) {
@@ -252,7 +252,7 @@
break;
}
- texmapGL->drawFiltered(*resultSurface.get(), spareSurface.get(), *filter, j);
+ texmapGL.drawFiltered(*resultSurface.get(), spareSurface.get(), *filter, j);
if (!j && filter->type() == FilterOperation::DROP_SHADOW) {
spareSurface = resultSurface;
resultSurface = nullptr;
@@ -261,7 +261,7 @@
}
}
- texmapGL->bindSurface(previousSurface.get());
+ texmapGL.bindSurface(previousSurface.get());
return resultSurface;
}
Modified: trunk/Source/WebCore/platform/graphics/texmap/BitmapTextureGL.h (194102 => 194103)
--- trunk/Source/WebCore/platform/graphics/texmap/BitmapTextureGL.h 2015-12-15 10:33:09 UTC (rev 194102)
+++ trunk/Source/WebCore/platform/graphics/texmap/BitmapTextureGL.h 2015-12-15 11:54:13 UTC (rev 194103)
@@ -54,7 +54,7 @@
void updateContentsNoSwizzle(const void*, const IntRect& target, const IntPoint& sourceOffset, int bytesPerLine, unsigned bytesPerPixel = 4, Platform3DObject glFormat = GraphicsContext3D::RGBA);
virtual bool isBackedByOpenGL() const override { return true; }
- virtual PassRefPtr<BitmapTexture> applyFilters(TextureMapper*, const FilterOperations&) override;
+ virtual PassRefPtr<BitmapTexture> applyFilters(TextureMapper&, const FilterOperations&) override;
struct FilterInfo {
RefPtr<FilterOperation> filter;
unsigned pass;
Modified: trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp (194102 => 194103)
--- trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp 2015-12-15 10:33:09 UTC (rev 194102)
+++ trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp 2015-12-15 11:54:13 UTC (rev 194103)
@@ -549,7 +549,7 @@
backingStore->updateContentsScale(pageScaleFactor() * deviceScaleFactor());
dirtyRect.scale(pageScaleFactor() * deviceScaleFactor());
- backingStore->updateContents(textureMapper, this, m_size, dirtyRect, BitmapTexture::UpdateCanModifyOriginalImageData);
+ backingStore->updateContents(*textureMapper, this, m_size, dirtyRect, BitmapTexture::UpdateCanModifyOriginalImageData);
m_needsDisplay = false;
m_needsDisplayRect = IntRect();
Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.h (194102 => 194103)
--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.h 2015-12-15 10:33:09 UTC (rev 194102)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.h 2015-12-15 11:54:13 UTC (rev 194103)
@@ -39,8 +39,8 @@
class TextureMapperBackingStore : public TextureMapperPlatformLayer, public RefCounted<TextureMapperBackingStore> {
public:
virtual RefPtr<BitmapTexture> texture() const = 0;
- virtual void paintToTextureMapper(TextureMapper*, const FloatRect&, const TransformationMatrix&, float) = 0;
- virtual void drawRepaintCounter(TextureMapper*, int /* repaintCount */, const Color&, const FloatRect&, const TransformationMatrix&) { }
+ virtual void paintToTextureMapper(TextureMapper&, const FloatRect&, const TransformationMatrix&, float) = 0;
+ virtual void drawRepaintCounter(TextureMapper&, int /* repaintCount */, const Color&, const FloatRect&, const TransformationMatrix&) { }
virtual ~TextureMapperBackingStore() { }
protected:
Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperFPSCounter.cpp (194102 => 194103)
--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperFPSCounter.cpp 2015-12-15 10:33:09 UTC (rev 194102)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperFPSCounter.cpp 2015-12-15 11:54:13 UTC (rev 194103)
@@ -46,7 +46,7 @@
}
}
-void TextureMapperFPSCounter::updateFPSAndDisplay(TextureMapper* textureMapper, const FloatPoint& location, const TransformationMatrix& matrix)
+void TextureMapperFPSCounter::updateFPSAndDisplay(TextureMapper& textureMapper, const FloatPoint& location, const TransformationMatrix& matrix)
{
if (!m_isShowingFPS)
return;
@@ -59,7 +59,7 @@
m_fpsTimestamp += delta;
}
- textureMapper->drawNumber(m_lastFPS, Color::black, location, matrix);
+ textureMapper.drawNumber(m_lastFPS, Color::black, location, matrix);
}
} // namespace WebCore
Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperFPSCounter.h (194102 => 194103)
--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperFPSCounter.h 2015-12-15 10:33:09 UTC (rev 194102)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperFPSCounter.h 2015-12-15 11:54:13 UTC (rev 194103)
@@ -35,7 +35,7 @@
WTF_MAKE_FAST_ALLOCATED;
public:
TextureMapperFPSCounter();
- void updateFPSAndDisplay(TextureMapper*, const FloatPoint& = FloatPoint::zero(), const TransformationMatrix& = TransformationMatrix());
+ void updateFPSAndDisplay(TextureMapper&, const FloatPoint& = FloatPoint::zero(), const TransformationMatrix& = TransformationMatrix());
private:
bool m_isShowingFPS;
Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp (194102 => 194103)
--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp 2015-12-15 10:33:09 UTC (rev 194102)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp 2015-12-15 11:54:13 UTC (rev 194103)
@@ -31,15 +31,15 @@
class TextureMapperPaintOptions {
public:
+ TextureMapperPaintOptions(TextureMapper& textureMapper)
+ : textureMapper(textureMapper)
+ { }
+
+ TextureMapper& textureMapper;
+ TransformationMatrix transform;
RefPtr<BitmapTexture> surface;
- float opacity;
- TransformationMatrix transform;
+ float opacity { 1 };
IntSize offset;
- TextureMapper* textureMapper;
- TextureMapperPaintOptions()
- : opacity(1)
- , textureMapper(0)
- { }
};
void TextureMapperLayer::computeTransformsRecursive()
@@ -78,9 +78,10 @@
{
computeTransformsRecursive();
- TextureMapperPaintOptions options;
- options.textureMapper = m_textureMapper;
- options.textureMapper->bindSurface(0);
+ ASSERT(m_textureMapper);
+ TextureMapperPaintOptions options(*m_textureMapper);
+ options.textureMapper.bindSurface(0);
+
paintRecursive(options);
}
@@ -116,14 +117,14 @@
transform.multiply(m_currentTransform.combined());
if (m_state.solidColor.isValid() && !m_state.contentsRect.isEmpty() && m_state.solidColor.alpha()) {
- options.textureMapper->drawSolidColor(m_state.contentsRect, transform, blendWithOpacity(m_state.solidColor, options.opacity));
+ options.textureMapper.drawSolidColor(m_state.contentsRect, transform, blendWithOpacity(m_state.solidColor, options.opacity));
if (m_state.showDebugBorders)
- options.textureMapper->drawBorder(m_state.debugBorderColor, m_state.debugBorderWidth, layerRect(), transform);
+ options.textureMapper.drawBorder(m_state.debugBorderColor, m_state.debugBorderWidth, layerRect(), transform);
return;
}
- options.textureMapper->setWrapMode(TextureMapper::StretchWrap);
- options.textureMapper->setPatternTransform(TransformationMatrix());
+ options.textureMapper.setWrapMode(TextureMapper::StretchWrap);
+ options.textureMapper.setPatternTransform(TransformationMatrix());
if (m_backingStore) {
FloatRect targetRect = layerRect();
@@ -141,8 +142,8 @@
if (!m_state.contentsTileSize.isEmpty()) {
computePatternTransformIfNeeded();
- options.textureMapper->setWrapMode(TextureMapper::RepeatWrap);
- options.textureMapper->setPatternTransform(m_patternTransform);
+ options.textureMapper.setWrapMode(TextureMapper::RepeatWrap);
+ options.textureMapper.setPatternTransform(m_patternTransform);
}
ASSERT(!layerRect().isEmpty());
@@ -172,14 +173,14 @@
clipTransform.translate(options.offset.width(), options.offset.height());
clipTransform.multiply(options.transform);
clipTransform.multiply(m_currentTransform.combined());
- options.textureMapper->beginClip(clipTransform, layerRect());
+ options.textureMapper.beginClip(clipTransform, layerRect());
}
for (auto* child : m_children)
child->paintRecursive(options);
if (shouldClip)
- options.textureMapper->endClip();
+ options.textureMapper.endClip();
}
bool TextureMapperLayer::shouldBlend() const
@@ -328,12 +329,12 @@
Vector<IntRect> rects = nonOverlapRegion.rects();
for (auto& rect : rects) {
- if (!rect.intersects(options.textureMapper->clipBounds()))
+ if (!rect.intersects(options.textureMapper.clipBounds()))
continue;
- options.textureMapper->beginClip(TransformationMatrix(), rect);
+ options.textureMapper.beginClip(TransformationMatrix(), rect);
paintSelfAndChildrenWithReplica(options);
- options.textureMapper->endClip();
+ options.textureMapper.endClip();
}
rects = overlapRegion.rects();
@@ -343,8 +344,8 @@
rects.append(overlapRegion.bounds());
}
- IntSize maxTextureSize = options.textureMapper->maxTextureSize();
- IntRect adjustedClipBounds(options.textureMapper->clipBounds());
+ IntSize maxTextureSize = options.textureMapper.maxTextureSize();
+ IntRect adjustedClipBounds(options.textureMapper.clipBounds());
adjustedClipBounds.move(-options.offset);
for (auto& rect : rects) {
for (int x = rect.x(); x < rect.maxX(); x += maxTextureSize.width()) {
@@ -362,32 +363,32 @@
void TextureMapperLayer::applyMask(const TextureMapperPaintOptions& options)
{
- options.textureMapper->setMaskMode(true);
+ options.textureMapper.setMaskMode(true);
paintSelf(options);
- options.textureMapper->setMaskMode(false);
+ options.textureMapper.setMaskMode(false);
}
PassRefPtr<BitmapTexture> TextureMapperLayer::paintIntoSurface(const TextureMapperPaintOptions& options, const IntSize& size)
{
- RefPtr<BitmapTexture> surface = options.textureMapper->acquireTextureFromPool(size);
+ RefPtr<BitmapTexture> surface = options.textureMapper.acquireTextureFromPool(size);
TextureMapperPaintOptions paintOptions(options);
paintOptions.surface = surface;
- options.textureMapper->bindSurface(surface.get());
+ options.textureMapper.bindSurface(surface.get());
paintSelfAndChildren(paintOptions);
if (m_state.maskLayer)
m_state.maskLayer->applyMask(options);
surface = surface->applyFilters(options.textureMapper, m_currentFilters);
- options.textureMapper->bindSurface(surface.get());
+ options.textureMapper.bindSurface(surface.get());
return surface.release();
}
static void commitSurface(const TextureMapperPaintOptions& options, PassRefPtr<BitmapTexture> surface, const IntRect& rect, float opacity)
{
- options.textureMapper->bindSurface(options.surface.get());
+ options.textureMapper.bindSurface(options.surface.get());
TransformationMatrix targetTransform;
targetTransform.translate(options.offset.width(), options.offset.height());
targetTransform.multiply(options.transform);
- options.textureMapper->drawTexture(*surface.get(), rect, targetTransform, opacity);
+ options.textureMapper.drawTexture(*surface.get(), rect, targetTransform, opacity);
}
void TextureMapperLayer::paintWithIntermediateSurface(const TextureMapperPaintOptions& options, const IntRect& rect)
@@ -413,8 +414,8 @@
mainSurface = paintIntoSurface(paintOptions, rect.size());
if (replicaSurface) {
- options.textureMapper->bindSurface(replicaSurface.get());
- options.textureMapper->drawTexture(*mainSurface.get(), FloatRect(FloatPoint::zero(), rect.size()));
+ options.textureMapper.bindSurface(replicaSurface.get());
+ options.textureMapper.drawTexture(*mainSurface.get(), FloatRect(FloatPoint::zero(), rect.size()));
mainSurface = replicaSurface;
}
Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayer.h (194102 => 194103)
--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayer.h 2015-12-15 10:33:09 UTC (rev 194102)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayer.h 2015-12-15 11:54:13 UTC (rev 194103)
@@ -39,11 +39,11 @@
TextureMapperPlatformLayer() : m_client(0) { }
virtual ~TextureMapperPlatformLayer() { }
- virtual void paintToTextureMapper(TextureMapper*, const FloatRect&, const TransformationMatrix& modelViewMatrix = TransformationMatrix(), float opacity = 1.0) = 0;
+ virtual void paintToTextureMapper(TextureMapper&, const FloatRect&, const TransformationMatrix& modelViewMatrix = TransformationMatrix(), float opacity = 1.0) = 0;
virtual void swapBuffers() { }
- virtual void drawBorder(TextureMapper* textureMapper, const Color& color, float borderWidth, const FloatRect& targetRect, const TransformationMatrix& transform)
+ virtual void drawBorder(TextureMapper& textureMapper, const Color& color, float borderWidth, const FloatRect& targetRect, const TransformationMatrix& transform)
{
- textureMapper->drawBorder(color, borderWidth, targetRect, transform);
+ textureMapper.drawBorder(color, borderWidth, targetRect, transform);
}
void setClient(TextureMapperPlatformLayer::Client* client)
{
Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp (194102 => 194103)
--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp 2015-12-15 10:33:09 UTC (rev 194102)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp 2015-12-15 11:54:13 UTC (rev 194103)
@@ -49,17 +49,17 @@
return m_texture && (m_texture->size() == size) && (static_cast<BitmapTextureGL*>(m_texture.get())->internalFormat() == internalFormat || internalFormat == GraphicsContext3D::DONT_CARE);
}
-void TextureMapperPlatformLayerBuffer::paintToTextureMapper(TextureMapper* textureMapper, const FloatRect& targetRect, const TransformationMatrix& modelViewMatrix, float opacity)
+void TextureMapperPlatformLayerBuffer::paintToTextureMapper(TextureMapper& textureMapper, const FloatRect& targetRect, const TransformationMatrix& modelViewMatrix, float opacity)
{
if (m_hasManagedTexture) {
ASSERT(m_texture);
- textureMapper->drawTexture(*m_texture, targetRect, modelViewMatrix, opacity);
+ textureMapper.drawTexture(*m_texture, targetRect, modelViewMatrix, opacity);
return;
}
ASSERT(m_textureID);
- TextureMapperGL* texmapGL = static_cast<TextureMapperGL*>(textureMapper);
- texmapGL->drawTexture(m_textureID, m_extraFlags, m_size, targetRect, modelViewMatrix, opacity);
+ TextureMapperGL& texmapGL = static_cast<TextureMapperGL&>(textureMapper);
+ texmapGL.drawTexture(m_textureID, m_extraFlags, m_size, targetRect, modelViewMatrix, opacity);
}
} // namespace WebCore
Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h (194102 => 194103)
--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h 2015-12-15 10:33:09 UTC (rev 194102)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h 2015-12-15 11:54:13 UTC (rev 194103)
@@ -42,7 +42,7 @@
virtual ~TextureMapperPlatformLayerBuffer() = default;
- virtual void paintToTextureMapper(TextureMapper*, const FloatRect&, const TransformationMatrix& modelViewMatrix = TransformationMatrix(), float opacity = 1.0) final;
+ virtual void paintToTextureMapper(TextureMapper&, const FloatRect&, const TransformationMatrix& modelViewMatrix = TransformationMatrix(), float opacity = 1.0) final;
bool canReuseWithoutReset(const IntSize&, GC3Dint internalFormat);
BitmapTextureGL& textureGL() { return static_cast<BitmapTextureGL&>(*m_texture); }
Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperSurfaceBackingStore.cpp (194102 => 194103)
--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperSurfaceBackingStore.cpp 2015-12-15 10:33:09 UTC (rev 194102)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperSurfaceBackingStore.cpp 2015-12-15 11:54:13 UTC (rev 194103)
@@ -44,7 +44,7 @@
return emptyTexture;
}
-void TextureMapperSurfaceBackingStore::paintToTextureMapper(TextureMapper* textureMapper, const FloatRect& targetRect, const TransformationMatrix& transform, float opacity)
+void TextureMapperSurfaceBackingStore::paintToTextureMapper(TextureMapper& textureMapper, const FloatRect& targetRect, const TransformationMatrix& transform, float opacity)
{
if (m_graphicsSurface)
m_graphicsSurface->paintToTextureMapper(textureMapper, targetRect, transform, opacity);
Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperSurfaceBackingStore.h (194102 => 194103)
--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperSurfaceBackingStore.h 2015-12-15 10:33:09 UTC (rev 194102)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperSurfaceBackingStore.h 2015-12-15 11:54:13 UTC (rev 194103)
@@ -37,7 +37,7 @@
void setGraphicsSurface(PassRefPtr<GraphicsSurface>);
void swapBuffersIfNeeded(uint32_t frontBuffer);
virtual RefPtr<BitmapTexture> texture() const;
- virtual void paintToTextureMapper(TextureMapper*, const FloatRect&, const TransformationMatrix&, float);
+ virtual void paintToTextureMapper(TextureMapper&, const FloatRect&, const TransformationMatrix&, float);
virtual ~TextureMapperSurfaceBackingStore() { }
private:
Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperTile.cpp (194102 => 194103)
--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperTile.cpp 2015-12-15 10:33:09 UTC (rev 194102)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperTile.cpp 2015-12-15 11:54:13 UTC (rev 194103)
@@ -29,7 +29,7 @@
class GraphicsLayer;
-void TextureMapperTile::updateContents(TextureMapper* textureMapper, Image* image, const IntRect& dirtyRect, BitmapTexture::UpdateContentsFlag updateContentsFlag)
+void TextureMapperTile::updateContents(TextureMapper& textureMapper, Image* image, const IntRect& dirtyRect, BitmapTexture::UpdateContentsFlag updateContentsFlag)
{
IntRect targetRect = enclosingIntRect(m_rect);
targetRect.intersect(dirtyRect);
@@ -43,14 +43,14 @@
// Normalize targetRect to the texture's coordinates.
targetRect.move(-m_rect.x(), -m_rect.y());
if (!m_texture) {
- m_texture = textureMapper->createTexture();
+ m_texture = textureMapper.createTexture();
m_texture->reset(targetRect.size(), image->currentFrameKnownToBeOpaque() ? 0 : BitmapTexture::SupportsAlpha);
}
m_texture->updateContents(image, targetRect, sourceOffset, updateContentsFlag);
}
-void TextureMapperTile::updateContents(TextureMapper* textureMapper, GraphicsLayer* sourceLayer, const IntRect& dirtyRect, BitmapTexture::UpdateContentsFlag updateContentsFlag, float scale)
+void TextureMapperTile::updateContents(TextureMapper& textureMapper, GraphicsLayer* sourceLayer, const IntRect& dirtyRect, BitmapTexture::UpdateContentsFlag updateContentsFlag, float scale)
{
IntRect targetRect = enclosingIntRect(m_rect);
targetRect.intersect(dirtyRect);
@@ -62,17 +62,17 @@
targetRect.move(-m_rect.x(), -m_rect.y());
if (!m_texture) {
- m_texture = textureMapper->createTexture();
+ m_texture = textureMapper.createTexture();
m_texture->reset(targetRect.size(), BitmapTexture::SupportsAlpha);
}
m_texture->updateContents(textureMapper, sourceLayer, targetRect, sourceOffset, updateContentsFlag, scale);
}
-void TextureMapperTile::paint(TextureMapper* textureMapper, const TransformationMatrix& transform, float opacity, const unsigned exposedEdges)
+void TextureMapperTile::paint(TextureMapper& textureMapper, const TransformationMatrix& transform, float opacity, const unsigned exposedEdges)
{
if (texture().get())
- textureMapper->drawTexture(*texture().get(), rect(), transform, opacity, exposedEdges);
+ textureMapper.drawTexture(*texture().get(), rect(), transform, opacity, exposedEdges);
}
} // namespace WebCore
Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperTile.h (194102 => 194103)
--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperTile.h 2015-12-15 10:33:09 UTC (rev 194102)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperTile.h 2015-12-15 11:54:13 UTC (rev 194103)
@@ -39,9 +39,9 @@
inline void setTexture(BitmapTexture* texture) { m_texture = texture; }
inline void setRect(const FloatRect& rect) { m_rect = rect; }
- void updateContents(TextureMapper*, Image*, const IntRect&, BitmapTexture::UpdateContentsFlag UpdateCanModifyOriginalImageData);
- void updateContents(TextureMapper*, GraphicsLayer*, const IntRect&, BitmapTexture::UpdateContentsFlag UpdateCanModifyOriginalImageData, float scale = 1);
- virtual void paint(TextureMapper*, const TransformationMatrix&, float, const unsigned exposedEdges);
+ void updateContents(TextureMapper&, Image*, const IntRect&, BitmapTexture::UpdateContentsFlag UpdateCanModifyOriginalImageData);
+ void updateContents(TextureMapper&, GraphicsLayer*, const IntRect&, BitmapTexture::UpdateContentsFlag UpdateCanModifyOriginalImageData, float scale = 1);
+ virtual void paint(TextureMapper&, const TransformationMatrix&, float, const unsigned exposedEdges);
virtual ~TextureMapperTile() { }
explicit TextureMapperTile(const FloatRect& rect)
Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.cpp (194102 => 194103)
--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.cpp 2015-12-15 10:33:09 UTC (rev 194102)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.cpp 2015-12-15 11:54:13 UTC (rev 194103)
@@ -30,7 +30,7 @@
class GraphicsLayer;
-void TextureMapperTiledBackingStore::updateContentsFromImageIfNeeded(TextureMapper* textureMapper)
+void TextureMapperTiledBackingStore::updateContentsFromImageIfNeeded(TextureMapper& textureMapper)
{
if (!m_image)
return;
@@ -47,7 +47,7 @@
return TransformationMatrix::rectToRect(rect(), targetRect);
}
-void TextureMapperTiledBackingStore::paintToTextureMapper(TextureMapper* textureMapper, const FloatRect& targetRect, const TransformationMatrix& transform, float opacity)
+void TextureMapperTiledBackingStore::paintToTextureMapper(TextureMapper& textureMapper, const FloatRect& targetRect, const TransformationMatrix& transform, float opacity)
{
updateContentsFromImageIfNeeded(textureMapper);
TransformationMatrix adjustedTransform = transform * adjustedTransformForRect(targetRect);
@@ -55,18 +55,18 @@
tile.paint(textureMapper, adjustedTransform, opacity, calculateExposedTileEdges(rect(), tile.rect()));
}
-void TextureMapperTiledBackingStore::drawBorder(TextureMapper* textureMapper, const Color& borderColor, float borderWidth, const FloatRect& targetRect, const TransformationMatrix& transform)
+void TextureMapperTiledBackingStore::drawBorder(TextureMapper& textureMapper, const Color& borderColor, float borderWidth, const FloatRect& targetRect, const TransformationMatrix& transform)
{
TransformationMatrix adjustedTransform = transform * adjustedTransformForRect(targetRect);
for (auto& tile : m_tiles)
- textureMapper->drawBorder(borderColor, borderWidth, tile.rect(), adjustedTransform);
+ textureMapper.drawBorder(borderColor, borderWidth, tile.rect(), adjustedTransform);
}
-void TextureMapperTiledBackingStore::drawRepaintCounter(TextureMapper* textureMapper, int repaintCount, const Color& borderColor, const FloatRect& targetRect, const TransformationMatrix& transform)
+void TextureMapperTiledBackingStore::drawRepaintCounter(TextureMapper& textureMapper, int repaintCount, const Color& borderColor, const FloatRect& targetRect, const TransformationMatrix& transform)
{
TransformationMatrix adjustedTransform = transform * adjustedTransformForRect(targetRect);
for (auto& tile : m_tiles)
- textureMapper->drawNumber(repaintCount, borderColor, tile.rect().location(), adjustedTransform);
+ textureMapper.drawNumber(repaintCount, borderColor, tile.rect().location(), adjustedTransform);
}
void TextureMapperTiledBackingStore::updateContentsScale(float scale)
@@ -150,16 +150,16 @@
}
}
-void TextureMapperTiledBackingStore::updateContents(TextureMapper* textureMapper, Image* image, const FloatSize& totalSize, const IntRect& dirtyRect, BitmapTexture::UpdateContentsFlag updateContentsFlag)
+void TextureMapperTiledBackingStore::updateContents(TextureMapper& textureMapper, Image* image, const FloatSize& totalSize, const IntRect& dirtyRect, BitmapTexture::UpdateContentsFlag updateContentsFlag)
{
- createOrDestroyTilesIfNeeded(totalSize, textureMapper->maxTextureSize(), !image->currentFrameKnownToBeOpaque());
+ createOrDestroyTilesIfNeeded(totalSize, textureMapper.maxTextureSize(), !image->currentFrameKnownToBeOpaque());
for (auto& tile : m_tiles)
tile.updateContents(textureMapper, image, dirtyRect, updateContentsFlag);
}
-void TextureMapperTiledBackingStore::updateContents(TextureMapper* textureMapper, GraphicsLayer* sourceLayer, const FloatSize& totalSize, const IntRect& dirtyRect, BitmapTexture::UpdateContentsFlag updateContentsFlag)
+void TextureMapperTiledBackingStore::updateContents(TextureMapper& textureMapper, GraphicsLayer* sourceLayer, const FloatSize& totalSize, const IntRect& dirtyRect, BitmapTexture::UpdateContentsFlag updateContentsFlag)
{
- createOrDestroyTilesIfNeeded(totalSize, textureMapper->maxTextureSize(), true);
+ createOrDestroyTilesIfNeeded(totalSize, textureMapper.maxTextureSize(), true);
for (auto& tile : m_tiles)
tile.updateContents(textureMapper, sourceLayer, dirtyRect, updateContentsFlag, m_contentsScale);
}
Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.h (194102 => 194103)
--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.h 2015-12-15 10:33:09 UTC (rev 194102)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperTiledBackingStore.h 2015-12-15 11:54:13 UTC (rev 194103)
@@ -38,13 +38,13 @@
virtual ~TextureMapperTiledBackingStore() { }
virtual RefPtr<BitmapTexture> texture() const override;
- virtual void paintToTextureMapper(TextureMapper*, const FloatRect&, const TransformationMatrix&, float) override;
- virtual void drawBorder(TextureMapper*, const Color&, float borderWidth, const FloatRect&, const TransformationMatrix&) override;
- virtual void drawRepaintCounter(TextureMapper*, int repaintCount, const Color&, const FloatRect&, const TransformationMatrix&) override;
+ virtual void paintToTextureMapper(TextureMapper&, const FloatRect&, const TransformationMatrix&, float) override;
+ virtual void drawBorder(TextureMapper&, const Color&, float borderWidth, const FloatRect&, const TransformationMatrix&) override;
+ virtual void drawRepaintCounter(TextureMapper&, int repaintCount, const Color&, const FloatRect&, const TransformationMatrix&) override;
void updateContentsScale(float);
- void updateContents(TextureMapper*, Image*, const FloatSize&, const IntRect&, BitmapTexture::UpdateContentsFlag);
- void updateContents(TextureMapper*, GraphicsLayer*, const FloatSize&, const IntRect&, BitmapTexture::UpdateContentsFlag);
+ void updateContents(TextureMapper&, Image*, const FloatSize&, const IntRect&, BitmapTexture::UpdateContentsFlag);
+ void updateContents(TextureMapper&, GraphicsLayer*, const FloatSize&, const IntRect&, BitmapTexture::UpdateContentsFlag);
void setContentsToImage(Image* image) { m_image = image; }
@@ -52,7 +52,7 @@
TextureMapperTiledBackingStore() { }
void createOrDestroyTilesIfNeeded(const FloatSize& backingStoreSize, const IntSize& tileSize, bool hasAlpha);
- void updateContentsFromImageIfNeeded(TextureMapper*);
+ void updateContentsFromImageIfNeeded(TextureMapper&);
TransformationMatrix adjustedTransformForRect(const FloatRect&);
inline FloatRect rect() const
{
Modified: trunk/Source/WebKit/win/ChangeLog (194102 => 194103)
--- trunk/Source/WebKit/win/ChangeLog 2015-12-15 10:33:09 UTC (rev 194102)
+++ trunk/Source/WebKit/win/ChangeLog 2015-12-15 11:54:13 UTC (rev 194103)
@@ -1,3 +1,14 @@
+2015-12-15 Zan Dobersek <[email protected]>
+
+ [TexMap] Operate with a reference to the TextureMapper wherever possible
+ https://bugs.webkit.org/show_bug.cgi?id=152118
+
+ Reviewed by Martin Robinson.
+
+ * WebCoreSupport/AcceleratedCompositingContext.cpp:
+ (AcceleratedCompositingContext::compositeLayersToContext): TextureMapper object
+ is now operated with through a reference.
+
2015-12-01 Darin Adler <[email protected]>
Fix anomaly where isMouseEvent returns false for wheel events
Modified: trunk/Source/WebKit/win/WebCoreSupport/AcceleratedCompositingContext.cpp (194102 => 194103)
--- trunk/Source/WebKit/win/WebCoreSupport/AcceleratedCompositingContext.cpp 2015-12-15 10:33:09 UTC (rev 194102)
+++ trunk/Source/WebKit/win/WebCoreSupport/AcceleratedCompositingContext.cpp 2015-12-15 11:54:13 UTC (rev 194103)
@@ -187,7 +187,7 @@
m_textureMapper->beginPainting();
downcast<GraphicsLayerTextureMapper>(*m_rootLayer).layer().paint();
- m_fpsCounter.updateFPSAndDisplay(m_textureMapper.get());
+ m_fpsCounter.updateFPSAndDisplay(*m_textureMapper);
m_textureMapper->endPainting();
m_context->swapBuffers();
Modified: trunk/Source/WebKit2/ChangeLog (194102 => 194103)
--- trunk/Source/WebKit2/ChangeLog 2015-12-15 10:33:09 UTC (rev 194102)
+++ trunk/Source/WebKit2/ChangeLog 2015-12-15 11:54:13 UTC (rev 194103)
@@ -1,3 +1,25 @@
+2015-12-15 Zan Dobersek <[email protected]>
+
+ [TexMap] Operate with a reference to the TextureMapper wherever possible
+ https://bugs.webkit.org/show_bug.cgi?id=152118
+
+ Reviewed by Martin Robinson.
+
+ 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):
+
2015-12-14 YongGeol Jung <[email protected]>
[Coordinated Graphics] CSS transition effect is not shown when transformed with "%" unit.
Modified: trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp (194102 => 194103)
--- trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp 2015-12-15 10:33:09 UTC (rev 194102)
+++ trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp 2015-12-15 11:54:13 UTC (rev 194103)
@@ -30,7 +30,7 @@
namespace WebKit {
-void CoordinatedBackingStoreTile::swapBuffers(TextureMapper* textureMapper)
+void CoordinatedBackingStoreTile::swapBuffers(TextureMapper& textureMapper)
{
if (!m_surface)
return;
@@ -44,13 +44,13 @@
}
RefPtr<BitmapTexture> texture = this->texture();
if (!texture) {
- texture = textureMapper->createTexture();
+ texture = textureMapper.createTexture();
setTexture(texture.get());
shouldReset = true;
}
- ASSERT(textureMapper->maxTextureSize().width() >= m_tileRect.size().width());
- ASSERT(textureMapper->maxTextureSize().height() >= m_tileRect.size().height());
+ ASSERT(textureMapper.maxTextureSize().width() >= m_tileRect.size().width());
+ ASSERT(textureMapper.maxTextureSize().height() >= m_tileRect.size().height());
if (shouldReset)
texture->reset(m_tileRect.size(), m_surface->supportsAlpha());
@@ -107,7 +107,7 @@
m_pendingSize = size;
}
-void CoordinatedBackingStore::paintTilesToTextureMapper(Vector<TextureMapperTile*>& tiles, TextureMapper* textureMapper, const TransformationMatrix& transform, float opacity, const FloatRect& rect)
+void CoordinatedBackingStore::paintTilesToTextureMapper(Vector<TextureMapperTile*>& tiles, TextureMapper& textureMapper, const TransformationMatrix& transform, float opacity, const FloatRect& rect)
{
for (auto& tile : tiles)
tile->paint(textureMapper, transform, opacity, calculateExposedTileEdges(rect, tile->rect()));
@@ -118,7 +118,7 @@
return TransformationMatrix::rectToRect(rect(), targetRect);
}
-void CoordinatedBackingStore::paintToTextureMapper(TextureMapper* textureMapper, const FloatRect& targetRect, const TransformationMatrix& transform, float opacity)
+void CoordinatedBackingStore::paintToTextureMapper(TextureMapper& textureMapper, const FloatRect& targetRect, const TransformationMatrix& transform, float opacity)
{
if (m_tiles.isEmpty())
return;
@@ -155,21 +155,21 @@
paintTilesToTextureMapper(tilesToPaint, textureMapper, adjustedTransform, opacity, rect());
}
-void CoordinatedBackingStore::drawBorder(TextureMapper* textureMapper, const Color& borderColor, float borderWidth, const FloatRect& targetRect, const TransformationMatrix& transform)
+void CoordinatedBackingStore::drawBorder(TextureMapper& textureMapper, const Color& borderColor, float borderWidth, const FloatRect& targetRect, const TransformationMatrix& transform)
{
TransformationMatrix adjustedTransform = transform * adjustedTransformForRect(targetRect);
for (auto& tile : m_tiles.values())
- textureMapper->drawBorder(borderColor, borderWidth, tile.rect(), adjustedTransform);
+ textureMapper.drawBorder(borderColor, borderWidth, tile.rect(), adjustedTransform);
}
-void CoordinatedBackingStore::drawRepaintCounter(TextureMapper* textureMapper, int repaintCount, const Color& borderColor, const FloatRect& targetRect, const TransformationMatrix& transform)
+void CoordinatedBackingStore::drawRepaintCounter(TextureMapper& textureMapper, int repaintCount, const Color& borderColor, const FloatRect& targetRect, const TransformationMatrix& transform)
{
TransformationMatrix adjustedTransform = transform * adjustedTransformForRect(targetRect);
for (auto& tile : m_tiles.values())
- textureMapper->drawNumber(repaintCount, borderColor, tile.rect().location(), adjustedTransform);
+ textureMapper.drawNumber(repaintCount, borderColor, tile.rect().location(), adjustedTransform);
}
-void CoordinatedBackingStore::commitTileOperations(TextureMapper* textureMapper)
+void CoordinatedBackingStore::commitTileOperations(TextureMapper& textureMapper)
{
if (!m_pendingSize.isZero()) {
m_size = m_pendingSize;
Modified: trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedBackingStore.h (194102 => 194103)
--- trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedBackingStore.h 2015-12-15 10:33:09 UTC (rev 194102)
+++ trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedBackingStore.h 2015-12-15 11:54:13 UTC (rev 194103)
@@ -44,7 +44,7 @@
}
inline float scale() const { return m_scale; }
- void swapBuffers(WebCore::TextureMapper*);
+ void swapBuffers(WebCore::TextureMapper&);
void setBackBuffer(const WebCore::IntRect&, const WebCore::IntRect&, PassRefPtr<WebCore::CoordinatedSurface> buffer, const WebCore::IntPoint&);
private:
@@ -62,18 +62,18 @@
void removeAllTiles();
void updateTile(uint32_t tileID, const WebCore::IntRect&, const WebCore::IntRect&, PassRefPtr<WebCore::CoordinatedSurface>, const WebCore::IntPoint&);
static Ref<CoordinatedBackingStore> create() { return adoptRef(*new CoordinatedBackingStore); }
- void commitTileOperations(WebCore::TextureMapper*);
+ void commitTileOperations(WebCore::TextureMapper&);
RefPtr<WebCore::BitmapTexture> texture() const override;
void setSize(const WebCore::FloatSize&);
- virtual void paintToTextureMapper(WebCore::TextureMapper*, const WebCore::FloatRect&, const WebCore::TransformationMatrix&, float) override;
- virtual void drawBorder(WebCore::TextureMapper*, const WebCore::Color&, float borderWidth, const WebCore::FloatRect&, const WebCore::TransformationMatrix&) override;
- virtual void drawRepaintCounter(WebCore::TextureMapper*, int repaintCount, const WebCore::Color&, const WebCore::FloatRect&, const WebCore::TransformationMatrix&) override;
+ virtual void paintToTextureMapper(WebCore::TextureMapper&, const WebCore::FloatRect&, const WebCore::TransformationMatrix&, float) override;
+ virtual void drawBorder(WebCore::TextureMapper&, const WebCore::Color&, float borderWidth, const WebCore::FloatRect&, const WebCore::TransformationMatrix&) override;
+ virtual void drawRepaintCounter(WebCore::TextureMapper&, int repaintCount, const WebCore::Color&, const WebCore::FloatRect&, const WebCore::TransformationMatrix&) override;
private:
CoordinatedBackingStore()
: m_scale(1.)
{ }
- void paintTilesToTextureMapper(Vector<WebCore::TextureMapperTile*>&, WebCore::TextureMapper*, const WebCore::TransformationMatrix&, float, const WebCore::FloatRect&);
+ void paintTilesToTextureMapper(Vector<WebCore::TextureMapperTile*>&, WebCore::TextureMapper&, const WebCore::TransformationMatrix&, float, const WebCore::FloatRect&);
WebCore::TransformationMatrix adjustedTransformForRect(const WebCore::FloatRect&);
WebCore::FloatRect rect() const { return WebCore::FloatRect(WebCore::FloatPoint::zero(), m_size); }
Modified: trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp (194102 => 194103)
--- trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp 2015-12-15 10:33:09 UTC (rev 194102)
+++ trunk/Source/WebKit2/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp 2015-12-15 11:54:13 UTC (rev 194103)
@@ -110,7 +110,7 @@
}
currentRootLayer->paint();
- m_fpsCounter.updateFPSAndDisplay(m_textureMapper.get(), clipRect.location(), matrix);
+ m_fpsCounter.updateFPSAndDisplay(*m_textureMapper, clipRect.location(), matrix);
m_textureMapper->endClip();
m_textureMapper->endPainting();
@@ -143,7 +143,7 @@
m_textureMapper->drawSolidColor(clipRect, TransformationMatrix(), m_viewBackgroundColor);
layer->paint();
- m_fpsCounter.updateFPSAndDisplay(m_textureMapper.get(), clipRect.location());
+ m_fpsCounter.updateFPSAndDisplay(*m_textureMapper, clipRect.location());
m_textureMapper->endPainting();
m_textureMapper->setGraphicsContext(0);
}
@@ -584,7 +584,7 @@
void CoordinatedGraphicsScene::commitPendingBackingStoreOperations()
{
for (auto& backingStore : m_backingStoresWithPendingBuffers)
- backingStore->commitTileOperations(m_textureMapper.get());
+ backingStore->commitTileOperations(*m_textureMapper);
m_backingStoresWithPendingBuffers.clear();
}