mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Back out bug 991812 for bustage on a CLOSED TREE. r=me
This commit is contained in:
parent
f2ff291368
commit
39e8ea0778
@ -5,6 +5,7 @@
|
||||
#ifndef MEDIAENGINE_H_
|
||||
#define MEDIAENGINE_H_
|
||||
|
||||
#include "mozilla/RefPtr.h"
|
||||
#include "nsIDOMFile.h"
|
||||
#include "DOMMediaStream.h"
|
||||
#include "MediaStreamGraph.h"
|
||||
@ -35,13 +36,11 @@ enum {
|
||||
kAudioTrack = 2
|
||||
};
|
||||
|
||||
class MediaEngine
|
||||
class MediaEngine : public RefCounted<MediaEngine>
|
||||
{
|
||||
protected:
|
||||
virtual ~MediaEngine() {}
|
||||
|
||||
public:
|
||||
NS_INLINE_DECL_REFCOUNTING(MediaEngine)
|
||||
MOZ_DECLARE_REFCOUNTED_TYPENAME(MediaEngine)
|
||||
virtual ~MediaEngine() {}
|
||||
|
||||
static const int DEFAULT_VIDEO_FPS = 30;
|
||||
static const int DEFAULT_VIDEO_MIN_FPS = 10;
|
||||
|
@ -278,11 +278,10 @@ MediaEngineDefaultVideoSource::NotifyPull(MediaStreamGraph* aGraph,
|
||||
}
|
||||
|
||||
// generate 1k sine wave per second
|
||||
class SineWaveGenerator
|
||||
class SineWaveGenerator : public RefCounted<SineWaveGenerator>
|
||||
{
|
||||
public:
|
||||
NS_INLINE_DECL_REFCOUNTING(SineWaveGenerator)
|
||||
|
||||
MOZ_DECLARE_REFCOUNTED_TYPENAME(SineWaveGenerator)
|
||||
static const int bytesPerSample = 2;
|
||||
static const int millisecondsPerSecond = 1000;
|
||||
static const int frequency = 1000;
|
||||
|
@ -189,10 +189,10 @@ DeviceStorageUsedSpaceCache::SetUsedSizes(const nsAString& aStorageName,
|
||||
cacheEntry->mDirty = false;
|
||||
}
|
||||
|
||||
class GlobalDirs
|
||||
class GlobalDirs : public RefCounted<GlobalDirs>
|
||||
{
|
||||
public:
|
||||
NS_INLINE_DECL_REFCOUNTING(GlobalDirs)
|
||||
MOZ_DECLARE_REFCOUNTED_TYPENAME(GlobalDirs)
|
||||
#if !defined(MOZ_WIDGET_GONK)
|
||||
nsCOMPtr<nsIFile> pictures;
|
||||
nsCOMPtr<nsIFile> videos;
|
||||
|
@ -137,12 +137,18 @@ enum SurfaceInitMode
|
||||
/**
|
||||
* A base class for a platform-dependent helper for use by TextureHost.
|
||||
*/
|
||||
class CompositorBackendSpecificData
|
||||
class CompositorBackendSpecificData : public RefCounted<CompositorBackendSpecificData>
|
||||
{
|
||||
NS_INLINE_DECL_REFCOUNTING(CompositorBackendSpecificData)
|
||||
|
||||
protected:
|
||||
virtual ~CompositorBackendSpecificData() {}
|
||||
public:
|
||||
MOZ_DECLARE_REFCOUNTED_TYPENAME(CompositorBackendSpecificData)
|
||||
CompositorBackendSpecificData()
|
||||
{
|
||||
MOZ_COUNT_CTOR(CompositorBackendSpecificData);
|
||||
}
|
||||
virtual ~CompositorBackendSpecificData()
|
||||
{
|
||||
MOZ_COUNT_DTOR(CompositorBackendSpecificData);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
@ -189,20 +195,21 @@ protected:
|
||||
* The target and viewport methods can be called before any DrawQuad call and
|
||||
* affect any subsequent DrawQuad calls.
|
||||
*/
|
||||
class Compositor
|
||||
class Compositor : public RefCounted<Compositor>
|
||||
{
|
||||
protected:
|
||||
virtual ~Compositor() {}
|
||||
|
||||
public:
|
||||
NS_INLINE_DECL_REFCOUNTING(Compositor)
|
||||
|
||||
MOZ_DECLARE_REFCOUNTED_TYPENAME(Compositor)
|
||||
Compositor(PCompositorParent* aParent = nullptr)
|
||||
: mCompositorID(0)
|
||||
, mDiagnosticTypes(DIAGNOSTIC_NONE)
|
||||
, mParent(aParent)
|
||||
, mScreenRotation(ROTATION_0)
|
||||
{
|
||||
MOZ_COUNT_CTOR(Compositor);
|
||||
}
|
||||
virtual ~Compositor()
|
||||
{
|
||||
MOZ_COUNT_DTOR(Compositor);
|
||||
}
|
||||
|
||||
virtual TemporaryRef<DataTextureSource> CreateDataTextureSource(TextureFlags aFlags = 0) = 0;
|
||||
|
@ -19,8 +19,14 @@ namespace layers {
|
||||
|
||||
class ISurfaceAllocator;
|
||||
|
||||
class SimpleTextureClientPool
|
||||
class SimpleTextureClientPool : public RefCounted<SimpleTextureClientPool>
|
||||
{
|
||||
public:
|
||||
MOZ_DECLARE_REFCOUNTED_TYPENAME(SimpleTextureClientPool)
|
||||
|
||||
SimpleTextureClientPool(gfx::SurfaceFormat aFormat, gfx::IntSize aSize,
|
||||
ISurfaceAllocator *aAllocator);
|
||||
|
||||
~SimpleTextureClientPool()
|
||||
{
|
||||
for (auto it = mOutstandingTextureClients.begin(); it != mOutstandingTextureClients.end(); ++it) {
|
||||
@ -28,12 +34,6 @@ class SimpleTextureClientPool
|
||||
}
|
||||
}
|
||||
|
||||
public:
|
||||
NS_INLINE_DECL_REFCOUNTING(SimpleTextureClientPool)
|
||||
|
||||
SimpleTextureClientPool(gfx::SurfaceFormat aFormat, gfx::IntSize aSize,
|
||||
ISurfaceAllocator *aAllocator);
|
||||
|
||||
/**
|
||||
* If a TextureClient is AutoRecycled, when the last reference is
|
||||
* released this object will be automatically return to the pool as
|
||||
|
@ -18,15 +18,13 @@ namespace layers {
|
||||
|
||||
class ISurfaceAllocator;
|
||||
|
||||
class TextureClientPool MOZ_FINAL
|
||||
class TextureClientPool : public RefCounted<TextureClientPool>
|
||||
{
|
||||
~TextureClientPool();
|
||||
|
||||
public:
|
||||
NS_INLINE_DECL_REFCOUNTING(TextureClientPool)
|
||||
|
||||
MOZ_DECLARE_REFCOUNTED_TYPENAME(TextureClientPool)
|
||||
TextureClientPool(gfx::SurfaceFormat aFormat, gfx::IntSize aSize,
|
||||
ISurfaceAllocator *aAllocator);
|
||||
~TextureClientPool();
|
||||
|
||||
/**
|
||||
* Gets an allocated TextureClient of size and format that are determined
|
||||
|
@ -61,21 +61,22 @@ struct ViewTransform {
|
||||
* short circuit that stuff to directly affect layers as they are composited,
|
||||
* for example, off-main thread animation, async video, async pan/zoom.
|
||||
*/
|
||||
class AsyncCompositionManager MOZ_FINAL
|
||||
class AsyncCompositionManager MOZ_FINAL : public RefCounted<AsyncCompositionManager>
|
||||
{
|
||||
friend class AutoResolveRefLayers;
|
||||
public:
|
||||
NS_INLINE_DECL_REFCOUNTING(AsyncCompositionManager)
|
||||
|
||||
MOZ_DECLARE_REFCOUNTED_TYPENAME(AsyncCompositionManager)
|
||||
AsyncCompositionManager(LayerManagerComposite* aManager)
|
||||
: mLayerManager(aManager)
|
||||
, mIsFirstPaint(false)
|
||||
, mLayersUpdated(false)
|
||||
, mReadyForCompose(true)
|
||||
{
|
||||
MOZ_COUNT_CTOR(AsyncCompositionManager);
|
||||
}
|
||||
~AsyncCompositionManager()
|
||||
{
|
||||
MOZ_COUNT_DTOR(AsyncCompositionManager);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -56,18 +56,18 @@ struct EffectChain;
|
||||
/**
|
||||
* A base class for doing CompositableHost and platform dependent task on TextureHost.
|
||||
*/
|
||||
class CompositableBackendSpecificData
|
||||
class CompositableBackendSpecificData : public RefCounted<CompositableBackendSpecificData>
|
||||
{
|
||||
protected:
|
||||
virtual ~CompositableBackendSpecificData() { }
|
||||
|
||||
public:
|
||||
NS_INLINE_DECL_REFCOUNTING(CompositableBackendSpecificData)
|
||||
|
||||
MOZ_DECLARE_REFCOUNTED_TYPENAME(CompositableBackendSpecificData)
|
||||
CompositableBackendSpecificData()
|
||||
{
|
||||
MOZ_COUNT_CTOR(CompositableBackendSpecificData);
|
||||
}
|
||||
virtual ~CompositableBackendSpecificData()
|
||||
{
|
||||
MOZ_COUNT_DTOR(CompositableBackendSpecificData);
|
||||
}
|
||||
|
||||
virtual void SetCompositor(Compositor* aCompositor) {}
|
||||
virtual void ClearData()
|
||||
{
|
||||
@ -124,15 +124,14 @@ protected:
|
||||
* will use its TextureHost(s) and call Compositor::DrawQuad to do the actual
|
||||
* rendering.
|
||||
*/
|
||||
class CompositableHost
|
||||
class CompositableHost : public RefCounted<CompositableHost>
|
||||
{
|
||||
protected:
|
||||
virtual ~CompositableHost();
|
||||
|
||||
public:
|
||||
NS_INLINE_DECL_REFCOUNTING(CompositableHost)
|
||||
MOZ_DECLARE_REFCOUNTED_TYPENAME(CompositableHost)
|
||||
CompositableHost(const TextureInfo& aTextureInfo);
|
||||
|
||||
virtual ~CompositableHost();
|
||||
|
||||
static TemporaryRef<CompositableHost> Create(const TextureInfo& aTextureInfo);
|
||||
|
||||
virtual CompositableType GetType() = 0;
|
||||
|
@ -14,11 +14,10 @@ namespace layers {
|
||||
|
||||
class Compositor;
|
||||
|
||||
class TextRenderer
|
||||
class TextRenderer : public RefCounted<TextRenderer>
|
||||
{
|
||||
public:
|
||||
NS_INLINE_DECL_REFCOUNTING(TextRenderer)
|
||||
|
||||
MOZ_DECLARE_REFCOUNTED_TYPENAME(TextRenderer)
|
||||
TextRenderer(Compositor *aCompositor)
|
||||
: mCompositor(aCompositor)
|
||||
{
|
||||
|
@ -80,15 +80,12 @@ public:
|
||||
*
|
||||
* This class is used on the compositor side.
|
||||
*/
|
||||
class TextureSource
|
||||
class TextureSource : public RefCounted<TextureSource>
|
||||
{
|
||||
protected:
|
||||
virtual ~TextureSource();
|
||||
|
||||
public:
|
||||
NS_INLINE_DECL_REFCOUNTING(TextureSource)
|
||||
|
||||
MOZ_DECLARE_REFCOUNTED_TYPENAME(TextureSource)
|
||||
TextureSource();
|
||||
virtual ~TextureSource();
|
||||
|
||||
/**
|
||||
* Return the size of the texture in texels.
|
||||
|
@ -64,13 +64,12 @@ struct EffectChain;
|
||||
* This is primarily intended for direct texturing APIs that need to attach
|
||||
* shared objects (such as an EGLImage) to a gl texture.
|
||||
*/
|
||||
class CompositorTexturePoolOGL
|
||||
class CompositorTexturePoolOGL : public RefCounted<CompositorTexturePoolOGL>
|
||||
{
|
||||
protected:
|
||||
virtual ~CompositorTexturePoolOGL() {}
|
||||
|
||||
public:
|
||||
NS_INLINE_DECL_REFCOUNTING(CompositorTexturePoolOGL)
|
||||
MOZ_DECLARE_REFCOUNTED_TYPENAME(CompositorTexturePoolOGL)
|
||||
|
||||
virtual ~CompositorTexturePoolOGL() {}
|
||||
|
||||
virtual void Clear() = 0;
|
||||
|
||||
|
@ -230,10 +230,10 @@ namespace FilterWrappers {
|
||||
// Internally, this is achieved by wrapping the original FilterNode with
|
||||
// conversion FilterNodes. These filter nodes are cached in such a way that no
|
||||
// repeated or back-and-forth conversions happen.
|
||||
class FilterCachedColorModels
|
||||
class FilterCachedColorModels : public RefCounted<FilterCachedColorModels>
|
||||
{
|
||||
public:
|
||||
NS_INLINE_DECL_REFCOUNTING(FilterCachedColorModels)
|
||||
MOZ_DECLARE_REFCOUNTED_TYPENAME(FilterCachedColorModels)
|
||||
// aFilter can be null. In that case, ForColorModel will return a non-null
|
||||
// completely transparent filter for all color models.
|
||||
FilterCachedColorModels(DrawTarget* aDT,
|
||||
|
@ -110,11 +110,10 @@ private:
|
||||
* A CachedSurface associates a surface with a key that uniquely identifies that
|
||||
* surface.
|
||||
*/
|
||||
class CachedSurface
|
||||
class CachedSurface : public RefCounted<CachedSurface>
|
||||
{
|
||||
public:
|
||||
NS_INLINE_DECL_REFCOUNTING(CachedSurface)
|
||||
|
||||
MOZ_DECLARE_REFCOUNTED_TYPENAME(CachedSurface)
|
||||
CachedSurface(DrawTarget* aTarget,
|
||||
const IntSize aTargetSize,
|
||||
const Cost aCost,
|
||||
@ -157,11 +156,10 @@ private:
|
||||
* destroyed or invalidated. Since this will happen frequently, it makes sense
|
||||
* to make it cheap by storing the surfaces for each image separately.
|
||||
*/
|
||||
class ImageSurfaceCache
|
||||
class ImageSurfaceCache : public RefCounted<ImageSurfaceCache>
|
||||
{
|
||||
public:
|
||||
NS_INLINE_DECL_REFCOUNTING(ImageSurfaceCache)
|
||||
|
||||
MOZ_DECLARE_REFCOUNTED_TYPENAME(ImageSurfaceCache)
|
||||
typedef nsRefPtrHashtable<nsGenericHashKey<SurfaceKey>, CachedSurface> SurfaceTable;
|
||||
|
||||
bool IsEmpty() const { return mSurfaces.Count() == 0; }
|
||||
|
@ -46,10 +46,9 @@ enum LayerState {
|
||||
LAYER_SVG_EFFECTS
|
||||
};
|
||||
|
||||
class RefCountedRegion {
|
||||
class RefCountedRegion : public RefCounted<RefCountedRegion> {
|
||||
public:
|
||||
NS_INLINE_DECL_REFCOUNTING(RefCountedRegion)
|
||||
|
||||
MOZ_DECLARE_REFCOUNTED_TYPENAME(RefCountedRegion)
|
||||
RefCountedRegion() : mIsInfinite(false) {}
|
||||
nsRegion mRegion;
|
||||
bool mIsInfinite;
|
||||
|
Loading…
Reference in New Issue
Block a user