Skip to content

Commit

Permalink
Bug 1728205 - Remove DrawTargetDual. r=jrmuizel
Browse files Browse the repository at this point in the history
  • Loading branch information
aosmond committed Aug 30, 2021
1 parent 45dbaa8 commit 82c2f97
Show file tree
Hide file tree
Showing 13 changed files with 5 additions and 612 deletions.
15 changes: 0 additions & 15 deletions gfx/2d/2D.h
Original file line number Diff line number Diff line change
Expand Up @@ -1600,7 +1600,6 @@ class DrawTarget : public external::AtomicRefCounted<DrawTarget> {
*/
virtual void* GetNativeSurface(NativeSurfaceType aType) { return nullptr; }

virtual bool IsDualDrawTarget() const { return false; }
virtual bool IsTiledDrawTarget() const { return false; }
virtual bool SupportsRegionClipping() const { return true; }

Expand Down Expand Up @@ -1857,20 +1856,6 @@ class GFX2D_API Factory {
public:
static void PurgeAllCaches();

static already_AddRefed<DrawTarget> CreateDualDrawTarget(DrawTarget* targetA,
DrawTarget* targetB);

static already_AddRefed<SourceSurface> CreateDualSourceSurface(
SourceSurface* sourceA, SourceSurface* sourceB);

/*
* This creates a new tiled DrawTarget. When a tiled drawtarget is used the
* drawing is distributed over number of tiles which may each hold an
* individual offset. The tiles in the set must each have the same backend
* and format.
*/
static already_AddRefed<DrawTarget> CreateTiledDrawTarget(
const TileSet& aTileSet);
static already_AddRefed<DrawTarget> CreateOffsetDrawTarget(
DrawTarget* aDrawTarget, IntPoint aTileOrigin);

Expand Down
3 changes: 1 addition & 2 deletions gfx/2d/DrawTargetCairo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2148,8 +2148,7 @@ bool BorrowedXlibDrawable::Init(DrawTarget* aDT) {
mDrawable = X11None;

# ifdef CAIRO_HAS_XLIB_SURFACE
if (aDT->GetBackendType() != BackendType::CAIRO || aDT->IsDualDrawTarget() ||
aDT->IsTiledDrawTarget()) {
if (aDT->GetBackendType() != BackendType::CAIRO || aDT->IsTiledDrawTarget()) {
return false;
}

Expand Down
16 changes: 0 additions & 16 deletions gfx/2d/DrawTargetD2D1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "FilterNodeSoftware.h"
#include "GradientStopsD2D.h"
#include "SourceSurfaceD2D1.h"
#include "SourceSurfaceDual.h"
#include "ConicGradientEffectD2D1.h"
#include "RadialGradientEffectD2D1.h"

Expand Down Expand Up @@ -2222,21 +2221,6 @@ already_AddRefed<ID2D1Image> DrawTargetD2D1::GetImageForSurface(
image = surf->GetImage();
AddDependencyOnSource(surf);
} break;
case SurfaceType::DUAL_DT: {
// Sometimes we have a dual drawtarget but the underlying targets
// are d2d surfaces. Let's not readback and reupload in those cases.
SourceSurfaceDual* dualSurface =
static_cast<SourceSurfaceDual*>(surface.get());
SourceSurface* first = dualSurface->GetFirstSurface();
if (first->GetType() == SurfaceType::D2D1_1_IMAGE) {
MOZ_ASSERT(dualSurface->SameSurfaceTypes());
SourceSurfaceD2D1* d2dSurface = static_cast<SourceSurfaceD2D1*>(first);
image = d2dSurface->GetImage();
AddDependencyOnSource(d2dSurface);
break;
}
// Otherwise fall through
}
default: {
RefPtr<DataSourceSurface> dataSurf = surface->GetDataSurface();
if (!dataSurf) {
Expand Down
215 changes: 0 additions & 215 deletions gfx/2d/DrawTargetDual.cpp

This file was deleted.

Loading

0 comments on commit 82c2f97

Please sign in to comment.