From 7fd08efe7237a9e96146311c9b588ece90a1ae8f Mon Sep 17 00:00:00 2001 From: Jonathan Kew Date: Wed, 1 May 2024 21:05:05 +0000 Subject: [PATCH] Bug 1894498 - Remove unused method gfxASurface::CopyToARGB32ImageSurface. r=gfx-reviewers,lsalzman According to searchfox, there are no callers. Differential Revision: https://phabricator.services.mozilla.com/D209142 --- gfx/thebes/gfxASurface.cpp | 19 ------------------- gfx/thebes/gfxASurface.h | 6 ------ 2 files changed, 25 deletions(-) diff --git a/gfx/thebes/gfxASurface.cpp b/gfx/thebes/gfxASurface.cpp index f77c836fb95f..d5c78d093890 100644 --- a/gfx/thebes/gfxASurface.cpp +++ b/gfx/thebes/gfxASurface.cpp @@ -248,25 +248,6 @@ void gfxASurface::Finish() { cairo_surface_finish(mSurface); } -already_AddRefed gfxASurface::CopyToARGB32ImageSurface() { - if (!mSurface || !mSurfaceValid) { - return nullptr; - } - - const IntSize size = GetSize(); - RefPtr imgSurface = - new gfxImageSurface(size, SurfaceFormat::A8R8G8B8_UINT32); - - RefPtr dt = gfxPlatform::CreateDrawTargetForSurface( - imgSurface, IntSize(size.width, size.height)); - RefPtr source = - gfxPlatform::GetSourceSurfaceForSurface(dt, this); - - dt->CopySurface(source, IntRect(0, 0, size.width, size.height), IntPoint()); - - return imgSurface.forget(); -} - int gfxASurface::CairoStatus() { if (!mSurfaceValid) return -1; diff --git a/gfx/thebes/gfxASurface.h b/gfx/thebes/gfxASurface.h index d2e6daf77145..ee63f01aa20d 100644 --- a/gfx/thebes/gfxASurface.h +++ b/gfx/thebes/gfxASurface.h @@ -80,12 +80,6 @@ class gfxASurface { */ virtual already_AddRefed GetAsImageSurface(); - /** - * Creates a new ARGB32 image surface with the same contents as this surface. - * Returns null on error. - */ - already_AddRefed CopyToARGB32ImageSurface(); - int CairoStatus(); static gfxContentType ContentFromFormat(gfxImageFormat format);