From 5958abcf36986175bbd901d4661c0bcbe5038dd9 Mon Sep 17 00:00:00 2001 From: Jonathan Watt Date: Mon, 13 Jun 2016 09:27:22 +0100 Subject: [PATCH] Bug 1279395 - Remove gfxTeeSurface. r=eflores --- gfx/layers/client/ContentClient.cpp | 1 - gfx/thebes/gfxContext.cpp | 1 - gfx/thebes/gfxTeeSurface.cpp | 46 ----------------------------- gfx/thebes/gfxTeeSurface.h | 35 ---------------------- gfx/thebes/moz.build | 2 -- 5 files changed, 85 deletions(-) delete mode 100644 gfx/thebes/gfxTeeSurface.cpp delete mode 100644 gfx/thebes/gfxTeeSurface.h diff --git a/gfx/layers/client/ContentClient.cpp b/gfx/layers/client/ContentClient.cpp index 624a983f0f69..82530e6fa919 100644 --- a/gfx/layers/client/ContentClient.cpp +++ b/gfx/layers/client/ContentClient.cpp @@ -10,7 +10,6 @@ #include "gfxEnv.h" // for gfxEnv #include "gfxPrefs.h" // for gfxPrefs #include "gfxPoint.h" // for IntSize, gfxPoint -#include "gfxTeeSurface.h" // for gfxTeeSurface #include "gfxUtils.h" // for gfxUtils #include "ipc/ShadowLayers.h" // for ShadowLayerForwarder #include "mozilla/ArrayUtils.h" // for ArrayLength diff --git a/gfx/thebes/gfxContext.cpp b/gfx/thebes/gfxContext.cpp index bb4c1b663694..7f2f73673dde 100644 --- a/gfx/thebes/gfxContext.cpp +++ b/gfx/thebes/gfxContext.cpp @@ -17,7 +17,6 @@ #include "gfxASurface.h" #include "gfxPattern.h" #include "gfxPlatform.h" -#include "gfxTeeSurface.h" #include "gfxPrefs.h" #include "GeckoProfiler.h" #include "gfx2DGlue.h" diff --git a/gfx/thebes/gfxTeeSurface.cpp b/gfx/thebes/gfxTeeSurface.cpp deleted file mode 100644 index 20598badb046..000000000000 --- a/gfx/thebes/gfxTeeSurface.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include "gfxTeeSurface.h" -#include "nsTArray.h" - -#include "cairo-tee.h" - -gfxTeeSurface::gfxTeeSurface(cairo_surface_t *csurf) -{ - Init(csurf, true); -} - -gfxTeeSurface::gfxTeeSurface(gfxASurface **aSurfaces, int32_t aSurfaceCount) -{ - NS_ASSERTION(aSurfaceCount > 0, "Must have a least one surface"); - cairo_surface_t *csurf = cairo_tee_surface_create(aSurfaces[0]->CairoSurface()); - Init(csurf, false); - - for (int32_t i = 1; i < aSurfaceCount; ++i) { - cairo_tee_surface_add(csurf, aSurfaces[i]->CairoSurface()); - } -} - -const mozilla::gfx::IntSize -gfxTeeSurface::GetSize() const -{ - RefPtr master = Wrap(cairo_tee_surface_index(mSurface, 0)); - return master->GetSize(); -} - -void -gfxTeeSurface::GetSurfaces(nsTArray >* aSurfaces) -{ - for (int32_t i = 0; ; ++i) { - cairo_surface_t *csurf = cairo_tee_surface_index(mSurface, i); - if (cairo_surface_status(csurf)) - break; - RefPtr *elem = aSurfaces->AppendElement(); - if (!elem) - return; - *elem = Wrap(csurf); - } -} diff --git a/gfx/thebes/gfxTeeSurface.h b/gfx/thebes/gfxTeeSurface.h deleted file mode 100644 index 59148c26f857..000000000000 --- a/gfx/thebes/gfxTeeSurface.h +++ /dev/null @@ -1,35 +0,0 @@ -/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#ifndef GFX_TEESURFACE_H -#define GFX_TEESURFACE_H - -#include "gfxASurface.h" -#include "nsTArrayForwardDeclare.h" -#include "nsSize.h" - -/** - * Wraps a cairo_tee_surface. The first surface in the surface list is the - * primary surface, which answers all surface queries (including size). - * All drawing is performed on all the surfaces. - * - * The device transform of a tee surface is applied before drawing to the - * underlying surfaces --- which also applies the device transforms of the - * underlying surfaces. - */ -class gfxTeeSurface : public gfxASurface { -public: - explicit gfxTeeSurface(cairo_surface_t *csurf); - gfxTeeSurface(gfxASurface **aSurfaces, int32_t aSurfaceCount); - - virtual const mozilla::gfx::IntSize GetSize() const; - - /** - * Returns the list of underlying surfaces. - */ - void GetSurfaces(nsTArray > *aSurfaces); -}; - -#endif /* GFX_TEESURFACE_H */ diff --git a/gfx/thebes/moz.build b/gfx/thebes/moz.build index 0ff6800eced5..9adb5991db0c 100644 --- a/gfx/thebes/moz.build +++ b/gfx/thebes/moz.build @@ -42,7 +42,6 @@ EXPORTS += [ 'gfxSharedQuartzSurface.h', 'gfxSkipChars.h', 'gfxSVGGlyphs.h', - 'gfxTeeSurface.h', 'gfxTextRun.h', 'gfxTypes.h', 'gfxUserFontSet.h', @@ -250,7 +249,6 @@ UNIFIED_SOURCES += [ 'gfxScriptItemizer.cpp', 'gfxSkipChars.cpp', 'gfxSVGGlyphs.cpp', - 'gfxTeeSurface.cpp', 'gfxTextRun.cpp', 'gfxUserFontSet.cpp', 'gfxUtils.cpp',