mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 959154 - Part 6: Move away from DeprecatedDirectUpdate and remove them. r=nical
This commit is contained in:
parent
43e9ea8f99
commit
920f9c11d5
@ -90,14 +90,9 @@ TextureImage::UpdateFromDataSource(gfx::DataSourceSurface *aSurface,
|
||||
: nsIntRect(0, 0,
|
||||
aSurface->GetSize().width,
|
||||
aSurface->GetSize().height);
|
||||
nsIntPoint thebesSrcPoint = aSrcPoint ? nsIntPoint(aSrcPoint->x, aSrcPoint->y)
|
||||
: nsIntPoint(0, 0);
|
||||
RefPtr<gfxASurface> thebesSurf
|
||||
= new gfxImageSurface(aSurface->GetData(),
|
||||
ThebesIntSize(aSurface->GetSize()),
|
||||
aSurface->Stride(),
|
||||
SurfaceFormatToImageFormat(aSurface->GetFormat()));
|
||||
return DeprecatedDirectUpdate(thebesSurf, destRegion, thebesSrcPoint);
|
||||
gfx::IntPoint srcPoint = aSrcPoint ? *aSrcPoint
|
||||
: gfx::IntPoint(0, 0);
|
||||
return DirectUpdate(aSurface, destRegion, srcPoint);
|
||||
}
|
||||
|
||||
gfx::IntRect TextureImage::GetTileRect() {
|
||||
@ -224,20 +219,6 @@ BasicTextureImage::FinishedSurfaceUpload()
|
||||
{
|
||||
}
|
||||
|
||||
bool
|
||||
BasicTextureImage::DeprecatedDirectUpdate(gfxASurface* aSurf, const nsIntRegion& aRegion, const nsIntPoint& aFrom /* = nsIntPoint(0, 0) */)
|
||||
{
|
||||
nsRefPtr<gfxImageSurface> imageSurf = aSurf->GetAsImageSurface();
|
||||
NS_ASSERTION(imageSurf, "surface is not an image surface");
|
||||
|
||||
RefPtr<gfx::DataSourceSurface> wrappedSurf =
|
||||
gfx::Factory::CreateWrappingDataSourceSurface(imageSurf->Data(),
|
||||
imageSurf->Stride(),
|
||||
gfx::ToIntSize(imageSurf->GetSize()),
|
||||
gfx::ImageFormatToSurfaceFormat(imageSurf->Format()));
|
||||
return DirectUpdate(wrappedSurf, aRegion, gfx::IntPoint(aFrom.x, aFrom.y));
|
||||
}
|
||||
|
||||
bool
|
||||
BasicTextureImage::DirectUpdate(gfx::DataSourceSurface* aSurf, const nsIntRegion& aRegion, const gfx::IntPoint& aFrom /* = gfx::IntPoint(0, 0) */)
|
||||
{
|
||||
@ -373,20 +354,6 @@ TiledTextureImage::~TiledTextureImage()
|
||||
{
|
||||
}
|
||||
|
||||
bool
|
||||
TiledTextureImage::DeprecatedDirectUpdate(gfxASurface* aSurf, const nsIntRegion& aRegion, const nsIntPoint& aFrom /* = nsIntPoint(0, 0) */)
|
||||
{
|
||||
nsRefPtr<gfxImageSurface> imageSurf = aSurf->GetAsImageSurface();
|
||||
NS_ASSERTION(imageSurf, "surface is not an image surface");
|
||||
|
||||
RefPtr<gfx::DataSourceSurface> wrappedSurf =
|
||||
gfx::Factory::CreateWrappingDataSourceSurface(imageSurf->Data(),
|
||||
imageSurf->Stride(),
|
||||
gfx::ToIntSize(imageSurf->GetSize()),
|
||||
gfx::ImageFormatToSurfaceFormat(imageSurf->Format()));
|
||||
return DirectUpdate(wrappedSurf, aRegion, gfx::IntPoint(aFrom.x, aFrom.y));
|
||||
}
|
||||
|
||||
bool
|
||||
TiledTextureImage::DirectUpdate(gfx::DataSourceSurface* aSurf, const nsIntRegion& aRegion, const gfx::IntPoint& aFrom /* = gfx::IntPoint(0, 0) */)
|
||||
{
|
||||
|
@ -176,8 +176,6 @@ public:
|
||||
* aRegion - the region in this image to update
|
||||
* aFrom - offset in the source to update from
|
||||
*/
|
||||
virtual bool DeprecatedDirectUpdate(gfxASurface* aSurf, const nsIntRegion& aRegion, const nsIntPoint& aFrom = nsIntPoint(0,0)) = 0;
|
||||
// Moz2D equivalent
|
||||
virtual bool DirectUpdate(gfx::DataSourceSurface* aSurf, const nsIntRegion& aRegion, const gfx::IntPoint& aFrom = gfx::IntPoint(0,0)) = 0;
|
||||
bool UpdateFromDataSource(gfx::DataSourceSurface *aSurf,
|
||||
const nsIntRegion* aDstRegion = nullptr,
|
||||
@ -283,7 +281,6 @@ public:
|
||||
virtual gfxASurface* BeginUpdate(nsIntRegion& aRegion);
|
||||
virtual void GetUpdateRegion(nsIntRegion& aForRegion);
|
||||
virtual void EndUpdate();
|
||||
virtual bool DeprecatedDirectUpdate(gfxASurface* aSurf, const nsIntRegion& aRegion, const nsIntPoint& aFrom = nsIntPoint(0,0));
|
||||
virtual bool DirectUpdate(gfx::DataSourceSurface* aSurf, const nsIntRegion& aRegion, const gfx::IntPoint& aFrom = gfx::IntPoint(0,0));
|
||||
virtual GLuint GetTextureID() { return mTexture; }
|
||||
// Returns a surface to draw into
|
||||
@ -344,7 +341,6 @@ public:
|
||||
virtual GLuint GetTextureID() {
|
||||
return mImages[mCurrentImage]->GetTextureID();
|
||||
}
|
||||
virtual bool DeprecatedDirectUpdate(gfxASurface* aSurf, const nsIntRegion& aRegion, const nsIntPoint& aFrom = nsIntPoint(0,0));
|
||||
virtual bool DirectUpdate(gfx::DataSourceSurface* aSurf, const nsIntRegion& aRegion, const gfx::IntPoint& aFrom = gfx::IntPoint(0,0));
|
||||
virtual bool InUpdate() const { return mInUpdate; }
|
||||
virtual void BindTexture(GLenum);
|
||||
|
@ -203,20 +203,6 @@ TextureImageEGL::EndUpdate()
|
||||
return; // mTexture is bound
|
||||
}
|
||||
|
||||
bool
|
||||
TextureImageEGL::DeprecatedDirectUpdate(gfxASurface* aSurf, const nsIntRegion& aRegion, const nsIntPoint& aFrom /* = nsIntPoint(0, 0) */)
|
||||
{
|
||||
nsRefPtr<gfxImageSurface> imageSurf = aSurf->GetAsImageSurface();
|
||||
NS_ASSERTION(imageSurf, "surface is not an image surface");
|
||||
|
||||
RefPtr<gfx::DataSourceSurface> wrappedSurf =
|
||||
gfx::Factory::CreateWrappingDataSourceSurface(imageSurf->Data(),
|
||||
imageSurf->Stride(),
|
||||
gfx::ToIntSize(imageSurf->GetSize()),
|
||||
gfx::ImageFormatToSurfaceFormat(imageSurf->Format()));
|
||||
return DirectUpdate(wrappedSurf, aRegion, gfx::IntPoint(aFrom.x, aFrom.y));
|
||||
}
|
||||
|
||||
bool
|
||||
TextureImageEGL::DirectUpdate(gfx::DataSourceSurface* aSurf, const nsIntRegion& aRegion, const gfx::IntPoint& aFrom /* = gfx::IntPoint(0,0) */)
|
||||
{
|
||||
|
@ -32,8 +32,6 @@ public:
|
||||
|
||||
virtual void EndUpdate();
|
||||
|
||||
virtual bool DeprecatedDirectUpdate(gfxASurface* aSurf, const nsIntRegion& aRegion, const nsIntPoint& aFrom /* = nsIntPoint(0, 0) */);
|
||||
|
||||
virtual bool DirectUpdate(gfx::DataSourceSurface* aSurf, const nsIntRegion& aRegion, const gfx::IntPoint& aFrom = gfx::IntPoint(0,0));
|
||||
|
||||
virtual void BindTexture(GLenum aTextureUnit);
|
||||
|
@ -740,11 +740,18 @@ TextureImageDeprecatedTextureHostOGL::UpdateImpl(const SurfaceDescriptor& aImage
|
||||
} else {
|
||||
updateRegion = *aRegion;
|
||||
}
|
||||
nsIntPoint offset;
|
||||
gfx::IntPoint offset;
|
||||
if (aOffset) {
|
||||
offset = *aOffset;
|
||||
offset.x = aOffset->x;
|
||||
offset.y = aOffset->y;
|
||||
}
|
||||
mTexture->DeprecatedDirectUpdate(surf.Get(), updateRegion, offset);
|
||||
nsRefPtr<gfxImageSurface> thebesSurf = surf.GetAsImage();
|
||||
RefPtr<DataSourceSurface> sourceSurf =
|
||||
gfx::Factory::CreateWrappingDataSourceSurface(thebesSurf->Data(),
|
||||
thebesSurf->Stride(),
|
||||
ToIntSize(thebesSurf->GetSize()),
|
||||
ImageFormatToSurfaceFormat(thebesSurf->Format()));
|
||||
mTexture->DirectUpdate(sourceSurf, updateRegion, offset);
|
||||
mFormat = mTexture->GetTextureFormat();
|
||||
|
||||
if (mTexture->InUpdate()) {
|
||||
|
Loading…
Reference in New Issue
Block a user