diff --git a/dom/base/ImageEncoder.cpp b/dom/base/ImageEncoder.cpp index ed44121f12c..5910d82eb63 100644 --- a/dom/base/ImageEncoder.cpp +++ b/dom/base/ImageEncoder.cpp @@ -22,7 +22,7 @@ namespace dom { // template parameter, we need to move this class outside. class SurfaceHelper : public nsRunnable { public: - explicit SurfaceHelper(TemporaryRef aImage) : mImage(aImage) {} + explicit SurfaceHelper(already_AddRefed aImage) : mImage(aImage) {} // It retrieves a SourceSurface reference and convert color format on main // thread and passes DataSourceSurface to caller thread. @@ -41,7 +41,7 @@ public: return NS_OK; } - TemporaryRef GetDataSurfaceSafe() { + already_AddRefed GetDataSurfaceSafe() { nsCOMPtr mainThread = do_GetMainThread(); MOZ_ASSERT(mainThread); SyncRunnable::DispatchToThread(mainThread, this, false); @@ -59,10 +59,10 @@ private: // image formats should be referenced or dereferenced on main thread, it uses a // sync class SurfaceHelper to retrieve SourceSurface and convert to B8G8R8A8 on // main thread. -TemporaryRef -GetBRGADataSourceSurfaceSync(TemporaryRef aImage) +already_AddRefed +GetBRGADataSourceSurfaceSync(already_AddRefed aImage) { - nsRefPtr helper = new SurfaceHelper(aImage); + nsRefPtr helper = new SurfaceHelper(Move(aImage)); return helper->GetDataSurfaceSafe(); } diff --git a/dom/base/nsDOMWindowUtils.cpp b/dom/base/nsDOMWindowUtils.cpp index 90a12d386c7..9b8d1bcf61a 100644 --- a/dom/base/nsDOMWindowUtils.cpp +++ b/dom/base/nsDOMWindowUtils.cpp @@ -1478,7 +1478,7 @@ nsDOMWindowUtils::GetTranslationNodes(nsIDOMNode* aRoot, return NS_OK; } -static TemporaryRef +static already_AddRefed CanvasToDataSourceSurface(nsIDOMHTMLCanvasElement* aCanvas) { nsCOMPtr node = do_QueryInterface(aCanvas); diff --git a/dom/canvas/CanvasPath.h b/dom/canvas/CanvasPath.h index 3fde36412bc..1734bfba673 100644 --- a/dom/canvas/CanvasPath.h +++ b/dom/canvas/CanvasPath.h @@ -57,14 +57,14 @@ public: const gfx::Point& aCP2, const gfx::Point& aCP3); - TemporaryRef GetPath(const CanvasWindingRule& aWinding, + already_AddRefed GetPath(const CanvasWindingRule& aWinding, const gfx::DrawTarget* aTarget) const; explicit CanvasPath(nsISupports* aParent); - // TemporaryRef arg because the return value from Path::CopyToBuilder() is - // passed directly and we can't drop the only ref to have a raw pointer. + // already_AddRefed arg because the return value from Path::CopyToBuilder() + // is passed directly and we can't drop the only ref to have a raw pointer. CanvasPath(nsISupports* aParent, - TemporaryRef aPathBuilder); + already_AddRefed aPathBuilder); void AddPath(CanvasPath& aCanvasPath, const Optional>& aMatrix); diff --git a/dom/canvas/CanvasRenderingContext2D.cpp b/dom/canvas/CanvasRenderingContext2D.cpp index c2d6886e595..2176f2e8547 100644 --- a/dom/canvas/CanvasRenderingContext2D.cpp +++ b/dom/canvas/CanvasRenderingContext2D.cpp @@ -342,7 +342,7 @@ public: } // Return a SourceSurface that contains the FillPaint or StrokePaint source. - TemporaryRef + already_AddRefed DoSourcePaint(mgfx::IntRect& aRect, CanvasRenderingContext2D::Style aStyle) { if (aRect.IsEmpty()) { @@ -4132,7 +4132,7 @@ bool CanvasRenderingContext2D::IsPointInStroke(const CanvasPath& mPath, double x // Returns a surface that contains only the part needed to draw aSourceRect. // On entry, aSourceRect is relative to aSurface, and on return aSourceRect is // relative to the returned surface. -static TemporaryRef +static already_AddRefed ExtractSubrect(SourceSurface* aSurface, mgfx::Rect* aSourceRect, DrawTarget* aTargetDT) { mgfx::Rect roundedOutSourceRect = *aSourceRect; @@ -5551,7 +5551,7 @@ CanvasPath::CanvasPath(nsISupports* aParent) mPathBuilder = gfxPlatform::GetPlatform()->ScreenReferenceDrawTarget()->CreatePathBuilder(); } -CanvasPath::CanvasPath(nsISupports* aParent, TemporaryRef aPathBuilder) +CanvasPath::CanvasPath(nsISupports* aParent, already_AddRefed aPathBuilder) : mParent(aParent), mPathBuilder(aPathBuilder) { if (!mPathBuilder) { @@ -5766,7 +5766,7 @@ CanvasPath::AddPath(CanvasPath& aCanvasPath, const Optional>& tempPath->StreamToSink(mPathBuilder); } -TemporaryRef +already_AddRefed CanvasPath::GetPath(const CanvasWindingRule& winding, const DrawTarget* aTarget) const { FillRule fillRule = FillRule::FILL_WINDING; diff --git a/dom/canvas/CanvasRenderingContext2D.h b/dom/canvas/CanvasRenderingContext2D.h index 8ebc7417c89..14a594f1090 100644 --- a/dom/canvas/CanvasRenderingContext2D.h +++ b/dom/canvas/CanvasRenderingContext2D.h @@ -445,7 +445,7 @@ public: const char16_t* aEncoderOptions, nsIInputStream **aStream) override; - mozilla::TemporaryRef GetSurfaceSnapshot(bool* aPremultAlpha = nullptr) override + already_AddRefed GetSurfaceSnapshot(bool* aPremultAlpha = nullptr) override { EnsureTarget(); if (aPremultAlpha) { diff --git a/dom/canvas/WebGLContext.cpp b/dom/canvas/WebGLContext.cpp index 3a97edf3b89..a1d8caffef3 100644 --- a/dom/canvas/WebGLContext.cpp +++ b/dom/canvas/WebGLContext.cpp @@ -1752,7 +1752,7 @@ WebGLContext::MakeContextCurrent() const gl->MakeCurrent(); } -mozilla::TemporaryRef +already_AddRefed WebGLContext::GetSurfaceSnapshot(bool* out_premultAlpha) { if (!gl) diff --git a/dom/canvas/WebGLContext.h b/dom/canvas/WebGLContext.h index 1354c2eafcd..ec9650aee73 100644 --- a/dom/canvas/WebGLContext.h +++ b/dom/canvas/WebGLContext.h @@ -234,7 +234,7 @@ public: const char16_t* encoderOptions, nsIInputStream** out_stream) override; - mozilla::TemporaryRef + already_AddRefed GetSurfaceSnapshot(bool* out_premultAlpha) override; NS_IMETHOD SetIsOpaque(bool) override { return NS_OK; }; diff --git a/dom/canvas/WebGLContextLossHandler.cpp b/dom/canvas/WebGLContextLossHandler.cpp index b15b3368e4a..bf19b1ddd23 100644 --- a/dom/canvas/WebGLContextLossHandler.cpp +++ b/dom/canvas/WebGLContextLossHandler.cpp @@ -31,7 +31,7 @@ WebGLContextLossHandler::~WebGLContextLossHandler() void WebGLContextLossHandler::StartTimer(unsigned long delayMS) { - // We can't pass a TemporaryRef through InitWithFuncCallback, so we + // We can't pass an already_AddRefed through InitWithFuncCallback, so we // should do the AddRef/Release manually. this->AddRef(); diff --git a/dom/canvas/WebGLProgram.cpp b/dom/canvas/WebGLProgram.cpp index 244cf2d7ff0..709978b620d 100644 --- a/dom/canvas/WebGLProgram.cpp +++ b/dom/canvas/WebGLProgram.cpp @@ -90,7 +90,7 @@ AddActiveBlockInfo(const nsACString& baseUserName, //#define DUMP_SHADERVAR_MAPPINGS -static TemporaryRef +static already_AddRefed QueryProgramInfo(WebGLProgram* prog, gl::GLContext* gl) { RefPtr info(new webgl::LinkedProgramInfo(prog)); diff --git a/dom/canvas/nsICanvasRenderingContextInternal.h b/dom/canvas/nsICanvasRenderingContextInternal.h index 5134172e1c8..7301fa80630 100644 --- a/dom/canvas/nsICanvasRenderingContextInternal.h +++ b/dom/canvas/nsICanvasRenderingContextInternal.h @@ -110,7 +110,7 @@ public: // If aPremultAlpha is provided, then it assumed the callee can handle // un-premultiplied surfaces, and *aPremultAlpha will be set to false // if one is returned. - virtual mozilla::TemporaryRef GetSurfaceSnapshot(bool* aPremultAlpha = nullptr) = 0; + virtual already_AddRefed GetSurfaceSnapshot(bool* aPremultAlpha = nullptr) = 0; // If this context is opaque, the backing store of the canvas should // be created as opaque; all compositing operators should assume the diff --git a/dom/html/HTMLCanvasElement.cpp b/dom/html/HTMLCanvasElement.cpp index bf445ff0979..95b744685a1 100644 --- a/dom/html/HTMLCanvasElement.cpp +++ b/dom/html/HTMLCanvasElement.cpp @@ -1034,7 +1034,7 @@ HTMLCanvasElement::MarkContextClean() mCurrentContext->MarkContextClean(); } -TemporaryRef +already_AddRefed HTMLCanvasElement::GetSurfaceSnapshot(bool* aPremultAlpha) { if (!mCurrentContext) diff --git a/dom/html/HTMLCanvasElement.h b/dom/html/HTMLCanvasElement.h index fa28265f155..1ff207ecc3e 100644 --- a/dom/html/HTMLCanvasElement.h +++ b/dom/html/HTMLCanvasElement.h @@ -168,7 +168,7 @@ public: */ bool GetIsOpaque(); - virtual TemporaryRef GetSurfaceSnapshot(bool* aPremultAlpha = nullptr); + virtual already_AddRefed GetSurfaceSnapshot(bool* aPremultAlpha = nullptr); virtual bool ParseAttribute(int32_t aNamespaceID, nsIAtom* aAttribute, diff --git a/dom/media/MediaManager.cpp b/dom/media/MediaManager.cpp index 7ec4e4f1908..593d821eed0 100644 --- a/dom/media/MediaManager.cpp +++ b/dom/media/MediaManager.cpp @@ -2135,7 +2135,7 @@ MediaManager::Observe(nsISupports* aSubject, const char* aTopic, class ShutdownTask : public Task { public: - ShutdownTask(TemporaryRef aBackend, + ShutdownTask(already_AddRefed aBackend, nsRunnable* aReply) : mReply(aReply) , mBackend(aBackend) {} diff --git a/dom/media/MediaTaskQueue.cpp b/dom/media/MediaTaskQueue.cpp index 3a39d4e5ed8..eabd0b97d19 100644 --- a/dom/media/MediaTaskQueue.cpp +++ b/dom/media/MediaTaskQueue.cpp @@ -10,7 +10,7 @@ namespace mozilla { -MediaTaskQueue::MediaTaskQueue(TemporaryRef aPool, +MediaTaskQueue::MediaTaskQueue(already_AddRefed aPool, bool aRequireTailDispatch) : AbstractThread(aRequireTailDispatch) , mPool(aPool) @@ -74,7 +74,7 @@ MediaTaskQueue::DispatchLocked(already_AddRefed aRunnable, class MediaTaskQueueSyncRunnable : public nsRunnable { public: - explicit MediaTaskQueueSyncRunnable(TemporaryRef aRunnable) + explicit MediaTaskQueueSyncRunnable(already_AddRefed aRunnable) : mRunnable(aRunnable) , mMonitor("MediaTaskQueueSyncRunnable") , mDone(false) @@ -104,9 +104,9 @@ private: }; void -MediaTaskQueue::SyncDispatch(TemporaryRef aRunnable) { +MediaTaskQueue::SyncDispatch(already_AddRefed aRunnable) { NS_WARNING("MediaTaskQueue::SyncDispatch is dangerous and deprecated. Stop using this!"); - nsRefPtr task(new MediaTaskQueueSyncRunnable(aRunnable)); + nsRefPtr task(new MediaTaskQueueSyncRunnable(Move(aRunnable))); // Tail dispatchers don't interact nicely with sync dispatch. We require that // nothing is already in the tail dispatcher, and then sidestep it for this @@ -183,7 +183,7 @@ FlushableMediaTaskQueue::Flush() } nsresult -FlushableMediaTaskQueue::FlushAndDispatch(TemporaryRef aRunnable) +FlushableMediaTaskQueue::FlushAndDispatch(already_AddRefed aRunnable) { MonitorAutoLock mon(mQueueMonitor); AutoSetFlushing autoFlush(this); diff --git a/dom/media/MediaTaskQueue.h b/dom/media/MediaTaskQueue.h index 51027aa166b..25a641e92c4 100644 --- a/dom/media/MediaTaskQueue.h +++ b/dom/media/MediaTaskQueue.h @@ -31,14 +31,7 @@ typedef MediaPromise ShutdownPromise; // to make this threadsafe for objects that aren't already threadsafe. class MediaTaskQueue : public AbstractThread { public: - explicit MediaTaskQueue(TemporaryRef aPool, bool aSupportsTailDispatch = false); - - void Dispatch(TemporaryRef aRunnable, - DispatchFailureHandling aFailureHandling = AssertDispatchSuccess) - { - nsCOMPtr r = dont_AddRef(aRunnable.take()); - return Dispatch(r.forget(), aFailureHandling); - } + explicit MediaTaskQueue(already_AddRefed aPool, bool aSupportsTailDispatch = false); TaskDispatcher& TailDispatcher() override; @@ -56,7 +49,7 @@ public: // DEPRECATED! Do not us, if a flush happens at the same time, this function // can hang and block forever! - void SyncDispatch(TemporaryRef aRunnable); + void SyncDispatch(already_AddRefed aRunnable); // Puts the queue in a shutdown state and returns immediately. The queue will // remain alive at least until all the events are drained, because the Runners @@ -183,8 +176,8 @@ protected: class FlushableMediaTaskQueue : public MediaTaskQueue { public: - explicit FlushableMediaTaskQueue(TemporaryRef aPool) : MediaTaskQueue(aPool) {} - nsresult FlushAndDispatch(TemporaryRef aRunnable); + explicit FlushableMediaTaskQueue(already_AddRefed aPool) : MediaTaskQueue(Move(aPool)) {} + nsresult FlushAndDispatch(already_AddRefed aRunnable); void Flush(); bool IsDispatchReliable() override { return false; } diff --git a/dom/media/SharedThreadPool.cpp b/dom/media/SharedThreadPool.cpp index 5ea29b56ea9..4098d9e7111 100644 --- a/dom/media/SharedThreadPool.cpp +++ b/dom/media/SharedThreadPool.cpp @@ -58,7 +58,7 @@ SharedThreadPool::SpinUntilEmpty() } } -TemporaryRef +already_AddRefed SharedThreadPool::Get(const nsCString& aName, uint32_t aThreadLimit) { MOZ_ASSERT(sMonitor && sPools); diff --git a/dom/media/SharedThreadPool.h b/dom/media/SharedThreadPool.h index fcf40689d6a..ff457438dce 100644 --- a/dom/media/SharedThreadPool.h +++ b/dom/media/SharedThreadPool.h @@ -32,7 +32,7 @@ public: // Gets (possibly creating) the shared thread pool singleton instance with // thread pool named aName. // *Must* be called on the main thread. - static TemporaryRef Get(const nsCString& aName, + static already_AddRefed Get(const nsCString& aName, uint32_t aThreadLimit = 4); // We implement custom threadsafe AddRef/Release pair, that destroys the diff --git a/dom/media/VideoUtils.cpp b/dom/media/VideoUtils.cpp index 3b2bf9a2d5c..fd3c11f6428 100644 --- a/dom/media/VideoUtils.cpp +++ b/dom/media/VideoUtils.cpp @@ -201,7 +201,7 @@ IsValidVideoRegion(const nsIntSize& aFrame, const nsIntRect& aPicture, aDisplay.width * aDisplay.height != 0; } -TemporaryRef GetMediaThreadPool(MediaThreadType aType) +already_AddRefed GetMediaThreadPool(MediaThreadType aType) { const char *name; switch (aType) { diff --git a/dom/media/VideoUtils.h b/dom/media/VideoUtils.h index 80ae7e9aff2..8bcb1e928a2 100644 --- a/dom/media/VideoUtils.h +++ b/dom/media/VideoUtils.h @@ -221,7 +221,7 @@ enum class MediaThreadType { }; // Returns the thread pool that is shared amongst all decoder state machines // for decoding streams. -TemporaryRef GetMediaThreadPool(MediaThreadType aType); +already_AddRefed GetMediaThreadPool(MediaThreadType aType); enum H264_PROFILE { H264_PROFILE_UNKNOWN = 0, diff --git a/dom/media/directshow/AudioSinkInputPin.cpp b/dom/media/directshow/AudioSinkInputPin.cpp index a313ed35e4f..76d9d227962 100644 --- a/dom/media/directshow/AudioSinkInputPin.cpp +++ b/dom/media/directshow/AudioSinkInputPin.cpp @@ -131,7 +131,7 @@ AudioSinkInputPin::Receive(IMediaSample* aSample ) return S_OK; } -TemporaryRef +already_AddRefed AudioSinkInputPin::GetConnectedPinSeeking() { RefPtr peer = GetConnected(); diff --git a/dom/media/directshow/AudioSinkInputPin.h b/dom/media/directshow/AudioSinkInputPin.h index 041c11ff785..aa565772cd9 100644 --- a/dom/media/directshow/AudioSinkInputPin.h +++ b/dom/media/directshow/AudioSinkInputPin.h @@ -54,7 +54,7 @@ public: // Returns the IMediaSeeking interface of the connected output pin. // We forward seeking requests upstream from the sink to the source // filters. - TemporaryRef GetConnectedPinSeeking(); + already_AddRefed GetConnectedPinSeeking(); SampleSink* GetSampleSink(); diff --git a/dom/media/directshow/DirectShowUtils.cpp b/dom/media/directshow/DirectShowUtils.cpp index 06f6f7b3056..3878b9f944f 100644 --- a/dom/media/directshow/DirectShowUtils.cpp +++ b/dom/media/directshow/DirectShowUtils.cpp @@ -284,7 +284,7 @@ MatchUnconnectedPin(IPin* aPin, } // Return the first unconnected input pin or output pin. -TemporaryRef +already_AddRefed GetUnconnectedPin(IBaseFilter* aFilter, PIN_DIRECTION aPinDir) { RefPtr enumPins; diff --git a/dom/media/platforms/wmf/MFTDecoder.cpp b/dom/media/platforms/wmf/MFTDecoder.cpp index 9a3a6f4ba32..7a433fd7d3a 100644 --- a/dom/media/platforms/wmf/MFTDecoder.cpp +++ b/dom/media/platforms/wmf/MFTDecoder.cpp @@ -68,7 +68,7 @@ MFTDecoder::SetMediaTypes(IMFMediaType* aInputType, return S_OK; } -TemporaryRef +already_AddRefed MFTDecoder::GetAttributes() { RefPtr attr; diff --git a/dom/media/platforms/wmf/MFTDecoder.h b/dom/media/platforms/wmf/MFTDecoder.h index b53257431fd..65e5d74d54f 100644 --- a/dom/media/platforms/wmf/MFTDecoder.h +++ b/dom/media/platforms/wmf/MFTDecoder.h @@ -43,7 +43,7 @@ public: void* aData = nullptr); // Returns the MFT's IMFAttributes object. - TemporaryRef GetAttributes(); + already_AddRefed GetAttributes(); // Retrieves the media type being output. This may not be valid until // the first sample is decoded. diff --git a/dom/media/platforms/wmf/WMFAudioMFTManager.cpp b/dom/media/platforms/wmf/WMFAudioMFTManager.cpp index f98219dd22f..9a4c50ab834 100644 --- a/dom/media/platforms/wmf/WMFAudioMFTManager.cpp +++ b/dom/media/platforms/wmf/WMFAudioMFTManager.cpp @@ -113,7 +113,7 @@ WMFAudioMFTManager::GetMediaSubtypeGUID() }; } -TemporaryRef +already_AddRefed WMFAudioMFTManager::Init() { NS_ENSURE_TRUE(mStreamType != Unknown, nullptr); diff --git a/dom/media/platforms/wmf/WMFAudioMFTManager.h b/dom/media/platforms/wmf/WMFAudioMFTManager.h index cbd1a6f62eb..82abf4d24b9 100644 --- a/dom/media/platforms/wmf/WMFAudioMFTManager.h +++ b/dom/media/platforms/wmf/WMFAudioMFTManager.h @@ -20,7 +20,7 @@ public: WMFAudioMFTManager(const AudioInfo& aConfig); ~WMFAudioMFTManager(); - virtual TemporaryRef Init() override; + virtual already_AddRefed Init() override; virtual HRESULT Input(MediaRawData* aSample) override; diff --git a/dom/media/platforms/wmf/WMFMediaDataDecoder.h b/dom/media/platforms/wmf/WMFMediaDataDecoder.h index f97c46a7ec1..93d18a9fa7f 100644 --- a/dom/media/platforms/wmf/WMFMediaDataDecoder.h +++ b/dom/media/platforms/wmf/WMFMediaDataDecoder.h @@ -24,7 +24,7 @@ public: // Creates an initializs the MFTDecoder. // Returns nullptr on failure. - virtual TemporaryRef Init() = 0; + virtual already_AddRefed Init() = 0; // Submit a compressed sample for decoding. // This should forward to the MFTDecoder after performing diff --git a/dom/media/platforms/wmf/WMFVideoMFTManager.cpp b/dom/media/platforms/wmf/WMFVideoMFTManager.cpp index f76a7846503..c09e35d31e4 100644 --- a/dom/media/platforms/wmf/WMFVideoMFTManager.cpp +++ b/dom/media/platforms/wmf/WMFVideoMFTManager.cpp @@ -172,7 +172,7 @@ WMFVideoMFTManager::InitializeDXVA(bool aForceD3D9) return mDXVA2Manager != nullptr; } -TemporaryRef +already_AddRefed WMFVideoMFTManager::Init() { RefPtr decoder = InitInternal(/* aForceD3D9 = */ false); @@ -187,7 +187,7 @@ WMFVideoMFTManager::Init() return decoder.forget(); } -TemporaryRef +already_AddRefed WMFVideoMFTManager::InitInternal(bool aForceD3D9) { mUseHwAccel = false; // default value; changed if D3D setup succeeds. diff --git a/dom/media/platforms/wmf/WMFVideoMFTManager.h b/dom/media/platforms/wmf/WMFVideoMFTManager.h index 992dd6a61bd..1477467b4b3 100644 --- a/dom/media/platforms/wmf/WMFVideoMFTManager.h +++ b/dom/media/platforms/wmf/WMFVideoMFTManager.h @@ -26,7 +26,7 @@ public: bool aDXVAEnabled); ~WMFVideoMFTManager(); - virtual TemporaryRef Init() override; + virtual already_AddRefed Init() override; virtual HRESULT Input(MediaRawData* aSample) override; @@ -41,7 +41,7 @@ private: bool InitializeDXVA(bool aForceD3D9); - TemporaryRef InitInternal(bool aForceD3D9); + already_AddRefed InitInternal(bool aForceD3D9); HRESULT ConfigureVideoFrameGeometry(); diff --git a/dom/media/webaudio/PannerNode.cpp b/dom/media/webaudio/PannerNode.cpp index 187c0eb3ef7..b52319f3feb 100644 --- a/dom/media/webaudio/PannerNode.cpp +++ b/dom/media/webaudio/PannerNode.cpp @@ -63,9 +63,9 @@ public: , mLeftOverData(INT_MIN) { // HRTFDatabaseLoader needs to be fetched on the main thread. - TemporaryRef loader = + already_AddRefed loader = HRTFDatabaseLoader::createAndLoadAsynchronouslyIfNecessary(aNode->Context()->SampleRate()); - mHRTFPanner = new HRTFPanner(aNode->Context()->SampleRate(), loader); + mHRTFPanner = new HRTFPanner(aNode->Context()->SampleRate(), Move(loader)); } virtual void SetInt32Parameter(uint32_t aIndex, int32_t aParam) override diff --git a/dom/media/webaudio/blink/HRTFDatabaseLoader.cpp b/dom/media/webaudio/blink/HRTFDatabaseLoader.cpp index 0c027282947..1ef34036d97 100644 --- a/dom/media/webaudio/blink/HRTFDatabaseLoader.cpp +++ b/dom/media/webaudio/blink/HRTFDatabaseLoader.cpp @@ -42,7 +42,7 @@ size_t HRTFDatabaseLoader::sizeOfLoaders(mozilla::MallocSizeOf aMallocSizeOf) return s_loaderMap ? s_loaderMap->SizeOfIncludingThis(aMallocSizeOf) : 0; } -TemporaryRef HRTFDatabaseLoader::createAndLoadAsynchronouslyIfNecessary(float sampleRate) +already_AddRefed HRTFDatabaseLoader::createAndLoadAsynchronouslyIfNecessary(float sampleRate) { MOZ_ASSERT(NS_IsMainThread()); diff --git a/dom/media/webaudio/blink/HRTFDatabaseLoader.h b/dom/media/webaudio/blink/HRTFDatabaseLoader.h index 239e7fba5c8..637cbb21965 100644 --- a/dom/media/webaudio/blink/HRTFDatabaseLoader.h +++ b/dom/media/webaudio/blink/HRTFDatabaseLoader.h @@ -48,7 +48,7 @@ public: // and starts loading asynchronously (when created the first time). // Returns the HRTFDatabaseLoader. // Must be called from the main thread. - static mozilla::TemporaryRef createAndLoadAsynchronouslyIfNecessary(float sampleRate); + static already_AddRefed createAndLoadAsynchronouslyIfNecessary(float sampleRate); // AddRef and Release may be called from any thread. void AddRef() diff --git a/dom/media/webaudio/blink/HRTFPanner.cpp b/dom/media/webaudio/blink/HRTFPanner.cpp index 5a63408d480..7107e56cfd3 100644 --- a/dom/media/webaudio/blink/HRTFPanner.cpp +++ b/dom/media/webaudio/blink/HRTFPanner.cpp @@ -41,7 +41,7 @@ const double MaxDelayTimeSeconds = 0.002; const int UninitializedAzimuth = -1; const unsigned RenderingQuantum = WEBAUDIO_BLOCK_SIZE; -HRTFPanner::HRTFPanner(float sampleRate, mozilla::TemporaryRef databaseLoader) +HRTFPanner::HRTFPanner(float sampleRate, already_AddRefed databaseLoader) : m_databaseLoader(databaseLoader) , m_sampleRate(sampleRate) , m_crossfadeSelection(CrossfadeSelection1) diff --git a/dom/media/webaudio/blink/HRTFPanner.h b/dom/media/webaudio/blink/HRTFPanner.h index 14785bdd208..cf52bbd4dda 100644 --- a/dom/media/webaudio/blink/HRTFPanner.h +++ b/dom/media/webaudio/blink/HRTFPanner.h @@ -43,7 +43,7 @@ using mozilla::AudioChunk; class HRTFPanner { public: - HRTFPanner(float sampleRate, mozilla::TemporaryRef databaseLoader); + HRTFPanner(float sampleRate, already_AddRefed databaseLoader); ~HRTFPanner(); // chunk durations must be 128 diff --git a/dom/plugins/base/nsNPAPIPluginInstance.cpp b/dom/plugins/base/nsNPAPIPluginInstance.cpp index 3b5442991c8..56c524e7ca6 100644 --- a/dom/plugins/base/nsNPAPIPluginInstance.cpp +++ b/dom/plugins/base/nsNPAPIPluginInstance.cpp @@ -955,7 +955,7 @@ void nsNPAPIPluginInstance::ReleaseContentTexture(nsNPAPIPluginInstance::Texture mContentTexture->Release(aTextureInfo); } -TemporaryRef nsNPAPIPluginInstance::CreateSurfaceTexture() +already_AddRefed nsNPAPIPluginInstance::CreateSurfaceTexture() { if (!EnsureGLContext()) return nullptr; diff --git a/dom/plugins/base/nsNPAPIPluginInstance.h b/dom/plugins/base/nsNPAPIPluginInstance.h index bba7463b68b..21d4f312039 100644 --- a/dom/plugins/base/nsNPAPIPluginInstance.h +++ b/dom/plugins/base/nsNPAPIPluginInstance.h @@ -386,7 +386,7 @@ private: #ifdef MOZ_WIDGET_ANDROID void EnsureSharedTexture(); - mozilla::TemporaryRef CreateSurfaceTexture(); + already_AddRefed CreateSurfaceTexture(); std::map mVideos; bool mOnScreen; diff --git a/dom/svg/SVGCircleElement.cpp b/dom/svg/SVGCircleElement.cpp index e01378ab30e..9a39f213acb 100644 --- a/dom/svg/SVGCircleElement.cpp +++ b/dom/svg/SVGCircleElement.cpp @@ -109,7 +109,7 @@ SVGCircleElement::GetGeometryBounds( return false; } -TemporaryRef +already_AddRefed SVGCircleElement::BuildPath(PathBuilder* aBuilder) { float x, y, r; diff --git a/dom/svg/SVGCircleElement.h b/dom/svg/SVGCircleElement.h index f4c4c5e5a7d..d0968a7eca8 100644 --- a/dom/svg/SVGCircleElement.h +++ b/dom/svg/SVGCircleElement.h @@ -33,7 +33,7 @@ public: // nsSVGPathGeometryElement methods: virtual bool GetGeometryBounds(Rect* aBounds, const StrokeOptions& aStrokeOptions, const Matrix& aTransform) override; - virtual TemporaryRef BuildPath(PathBuilder* aBuilder) override; + virtual already_AddRefed BuildPath(PathBuilder* aBuilder) override; virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override; diff --git a/dom/svg/SVGContentUtils.cpp b/dom/svg/SVGContentUtils.cpp index a7bfc2eae7f..0689e4798a0 100644 --- a/dom/svg/SVGContentUtils.cpp +++ b/dom/svg/SVGContentUtils.cpp @@ -797,7 +797,7 @@ SVGContentUtils::CoordToFloat(nsSVGElement *aContent, } } -TemporaryRef +already_AddRefed SVGContentUtils::GetPath(const nsAString& aPathString) { SVGPathData pathData; diff --git a/dom/svg/SVGContentUtils.h b/dom/svg/SVGContentUtils.h index 0333b121430..2a613d4899c 100644 --- a/dom/svg/SVGContentUtils.h +++ b/dom/svg/SVGContentUtils.h @@ -321,7 +321,7 @@ public: * Returns a path * string formatted as an SVG path */ - static mozilla::TemporaryRef + static already_AddRefed GetPath(const nsAString& aPathString); /** diff --git a/dom/svg/SVGEllipseElement.cpp b/dom/svg/SVGEllipseElement.cpp index aeee9e59cff..e0e5c9bb552 100644 --- a/dom/svg/SVGEllipseElement.cpp +++ b/dom/svg/SVGEllipseElement.cpp @@ -121,7 +121,7 @@ SVGEllipseElement::GetGeometryBounds( return false; } -TemporaryRef +already_AddRefed SVGEllipseElement::BuildPath(PathBuilder* aBuilder) { float x, y, rx, ry; diff --git a/dom/svg/SVGEllipseElement.h b/dom/svg/SVGEllipseElement.h index ec31bd15c1e..b9efe7f9bf8 100644 --- a/dom/svg/SVGEllipseElement.h +++ b/dom/svg/SVGEllipseElement.h @@ -33,7 +33,7 @@ public: // nsSVGPathGeometryElement methods: virtual bool GetGeometryBounds(Rect* aBounds, const StrokeOptions& aStrokeOptions, const Matrix& aTransform) override; - virtual TemporaryRef BuildPath(PathBuilder* aBuilder) override; + virtual already_AddRefed BuildPath(PathBuilder* aBuilder) override; virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override; diff --git a/dom/svg/SVGImageElement.cpp b/dom/svg/SVGImageElement.cpp index 644c94f02ec..b05a756703d 100644 --- a/dom/svg/SVGImageElement.cpp +++ b/dom/svg/SVGImageElement.cpp @@ -242,7 +242,7 @@ SVGImageElement::GetGeometryBounds( return true; } -TemporaryRef +already_AddRefed SVGImageElement::BuildPath(PathBuilder* aBuilder) { // We get called in order to get bounds for this element, and for diff --git a/dom/svg/SVGImageElement.h b/dom/svg/SVGImageElement.h index 8bc842bc6b4..f8e2882da3a 100644 --- a/dom/svg/SVGImageElement.h +++ b/dom/svg/SVGImageElement.h @@ -56,7 +56,7 @@ public: // nsSVGPathGeometryElement methods: virtual bool GetGeometryBounds(Rect* aBounds, const StrokeOptions& aStrokeOptions, const Matrix& aTransform) override; - virtual TemporaryRef BuildPath(PathBuilder* aBuilder) override; + virtual already_AddRefed BuildPath(PathBuilder* aBuilder) override; // nsSVGSVGElement methods: virtual bool HasValidDimensions() const override; diff --git a/dom/svg/SVGLineElement.cpp b/dom/svg/SVGLineElement.cpp index a742c9c8fb8..7fc6a879ee4 100644 --- a/dom/svg/SVGLineElement.cpp +++ b/dom/svg/SVGLineElement.cpp @@ -115,7 +115,7 @@ SVGLineElement::GetAsSimplePath(SimplePath* aSimplePath) aSimplePath->SetLine(x1, y1, x2, y2); } -TemporaryRef +already_AddRefed SVGLineElement::BuildPath(PathBuilder* aBuilder) { float x1, y1, x2, y2; diff --git a/dom/svg/SVGLineElement.h b/dom/svg/SVGLineElement.h index 4223c35b9a6..f80cd5cb57f 100644 --- a/dom/svg/SVGLineElement.h +++ b/dom/svg/SVGLineElement.h @@ -34,7 +34,7 @@ public: virtual bool IsMarkable() override { return true; } virtual void GetMarkPoints(nsTArray *aMarks) override; virtual void GetAsSimplePath(SimplePath* aSimplePath) override; - virtual TemporaryRef BuildPath(PathBuilder* aBuilder) override; + virtual already_AddRefed BuildPath(PathBuilder* aBuilder) override; virtual bool GetGeometryBounds(Rect* aBounds, const StrokeOptions& aStrokeOptions, const Matrix& aTransform) override; diff --git a/dom/svg/SVGMotionSMILPathUtils.cpp b/dom/svg/SVGMotionSMILPathUtils.cpp index c87251c6b16..e31c6a38624 100644 --- a/dom/svg/SVGMotionSMILPathUtils.cpp +++ b/dom/svg/SVGMotionSMILPathUtils.cpp @@ -80,7 +80,7 @@ SVGMotionSMILPathUtils::PathGenerator:: return true; } -TemporaryRef +already_AddRefed SVGMotionSMILPathUtils::PathGenerator::GetResultingPath() { return mPathBuilder->Finish(); diff --git a/dom/svg/SVGMotionSMILPathUtils.h b/dom/svg/SVGMotionSMILPathUtils.h index fef3227fe0a..8616d1dae65 100644 --- a/dom/svg/SVGMotionSMILPathUtils.h +++ b/dom/svg/SVGMotionSMILPathUtils.h @@ -62,7 +62,7 @@ public: // Accessor to let clients check if we've received any commands yet. inline bool HaveReceivedCommands() { return mHaveReceivedCommands; } // Accessor to get the finalized path - mozilla::TemporaryRef GetResultingPath(); + already_AddRefed GetResultingPath(); protected: // Helper methods diff --git a/dom/svg/SVGPathData.cpp b/dom/svg/SVGPathData.cpp index 3b593e5ad46..39edc17351a 100644 --- a/dom/svg/SVGPathData.cpp +++ b/dom/svg/SVGPathData.cpp @@ -273,7 +273,7 @@ ApproximateZeroLengthSubpathSquareCaps(PathBuilder* aPB, } \ } while(0) -TemporaryRef +already_AddRefed SVGPathData::BuildPath(PathBuilder* builder, uint8_t aStrokeLineCap, Float aStrokeWidth) const @@ -507,7 +507,7 @@ SVGPathData::BuildPath(PathBuilder* builder, return builder->Finish(); } -TemporaryRef +already_AddRefed SVGPathData::BuildPathForMeasuring() const { // Since the path that we return will not be used for painting it doesn't diff --git a/dom/svg/SVGPathData.h b/dom/svg/SVGPathData.h index 15ac4c4b2b8..60dffc25333 100644 --- a/dom/svg/SVGPathData.h +++ b/dom/svg/SVGPathData.h @@ -164,9 +164,9 @@ public: * ApproximateZeroLengthSubpathSquareCaps can insert if we have square-caps. * See the comment for that function for more info on that. */ - TemporaryRef BuildPathForMeasuring() const; + already_AddRefed BuildPathForMeasuring() const; - TemporaryRef BuildPath(PathBuilder* aBuilder, + already_AddRefed BuildPath(PathBuilder* aBuilder, uint8_t aCapStyle, Float aStrokeWidth) const; diff --git a/dom/svg/SVGPathElement.cpp b/dom/svg/SVGPathElement.cpp index 7984784a118..939a61a001c 100644 --- a/dom/svg/SVGPathElement.cpp +++ b/dom/svg/SVGPathElement.cpp @@ -305,7 +305,7 @@ SVGPathElement::IsAttributeMapped(const nsIAtom* name) const SVGPathElementBase::IsAttributeMapped(name); } -TemporaryRef +already_AddRefed SVGPathElement::GetOrBuildPathForMeasuring() { return mD.GetAnimValue().BuildPathForMeasuring(); @@ -364,7 +364,7 @@ SVGPathElement::GetPathLengthScale(PathLengthScaleForType aFor) return 1.0; } -TemporaryRef +already_AddRefed SVGPathElement::BuildPath(PathBuilder* aBuilder) { // The Moz2D PathBuilder that our SVGPathData will be using only cares about diff --git a/dom/svg/SVGPathElement.h b/dom/svg/SVGPathElement.h index f6e14cf8ae9..20af44905f9 100644 --- a/dom/svg/SVGPathElement.h +++ b/dom/svg/SVGPathElement.h @@ -51,14 +51,14 @@ public: virtual bool AttributeDefinesGeometry(const nsIAtom *aName) override; virtual bool IsMarkable() override; virtual void GetMarkPoints(nsTArray *aMarks) override; - virtual TemporaryRef BuildPath(PathBuilder* aBuilder) override; + virtual already_AddRefed BuildPath(PathBuilder* aBuilder) override; /** * This returns a path without the extra little line segments that * ApproximateZeroLengthSubpathSquareCaps can insert if we have square-caps. * See the comment for that function for more info on that. */ - virtual TemporaryRef GetOrBuildPathForMeasuring() override; + virtual already_AddRefed GetOrBuildPathForMeasuring() override; // nsIContent interface virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override; diff --git a/dom/svg/SVGPolygonElement.cpp b/dom/svg/SVGPolygonElement.cpp index 199437369bb..a3feaff6f5e 100644 --- a/dom/svg/SVGPolygonElement.cpp +++ b/dom/svg/SVGPolygonElement.cpp @@ -62,7 +62,7 @@ SVGPolygonElement::GetMarkPoints(nsTArray *aMarks) nsSVGMark::eEnd)); } -TemporaryRef +already_AddRefed SVGPolygonElement::BuildPath(PathBuilder* aBuilder) { const SVGPointList &points = mPoints.GetAnimValue(); diff --git a/dom/svg/SVGPolygonElement.h b/dom/svg/SVGPolygonElement.h index add6710ce35..113ff5820d6 100644 --- a/dom/svg/SVGPolygonElement.h +++ b/dom/svg/SVGPolygonElement.h @@ -29,7 +29,7 @@ protected: public: // nsSVGPathGeometryElement methods: virtual void GetMarkPoints(nsTArray *aMarks) override; - virtual mozilla::TemporaryRef BuildPath(PathBuilder* aBuilder) override; + virtual already_AddRefed BuildPath(PathBuilder* aBuilder) override; virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override; }; diff --git a/dom/svg/SVGPolylineElement.cpp b/dom/svg/SVGPolylineElement.cpp index 826551fb8cb..df8d49fec91 100644 --- a/dom/svg/SVGPolylineElement.cpp +++ b/dom/svg/SVGPolylineElement.cpp @@ -38,7 +38,7 @@ NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGPolylineElement) //---------------------------------------------------------------------- // nsSVGPathGeometryElement methods -TemporaryRef +already_AddRefed SVGPolylineElement::BuildPath(PathBuilder* aBuilder) { const SVGPointList &points = mPoints.GetAnimValue(); diff --git a/dom/svg/SVGPolylineElement.h b/dom/svg/SVGPolylineElement.h index 66d2f6de30b..f12737c863c 100644 --- a/dom/svg/SVGPolylineElement.h +++ b/dom/svg/SVGPolylineElement.h @@ -26,7 +26,7 @@ protected: already_AddRefed&& aNodeInfo)); // nsSVGPathGeometryElement methods: - virtual mozilla::TemporaryRef BuildPath(PathBuilder* aBuilder) override; + virtual already_AddRefed BuildPath(PathBuilder* aBuilder) override; public: // nsIContent interface diff --git a/dom/svg/SVGRectElement.cpp b/dom/svg/SVGRectElement.cpp index 9a5ec82b9bf..923ecbfbcf7 100644 --- a/dom/svg/SVGRectElement.cpp +++ b/dom/svg/SVGRectElement.cpp @@ -168,7 +168,7 @@ SVGRectElement::GetAsSimplePath(SimplePath* aSimplePath) aSimplePath->SetRect(x, y, width, height); } -TemporaryRef +already_AddRefed SVGRectElement::BuildPath(PathBuilder* aBuilder) { float x, y, width, height, rx, ry; diff --git a/dom/svg/SVGRectElement.h b/dom/svg/SVGRectElement.h index 0b37af33c91..67d5c1384e5 100644 --- a/dom/svg/SVGRectElement.h +++ b/dom/svg/SVGRectElement.h @@ -34,7 +34,7 @@ public: virtual bool GetGeometryBounds(Rect* aBounds, const StrokeOptions& aStrokeOptions, const Matrix& aTransform) override; virtual void GetAsSimplePath(SimplePath* aSimplePath) override; - virtual TemporaryRef BuildPath(PathBuilder* aBuilder = nullptr) override; + virtual already_AddRefed BuildPath(PathBuilder* aBuilder = nullptr) override; virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override; diff --git a/dom/svg/nsSVGPathGeometryElement.cpp b/dom/svg/nsSVGPathGeometryElement.cpp index d2d97ab0b7c..76e12b0aed0 100644 --- a/dom/svg/nsSVGPathGeometryElement.cpp +++ b/dom/svg/nsSVGPathGeometryElement.cpp @@ -75,7 +75,7 @@ nsSVGPathGeometryElement::GetMarkPoints(nsTArray *aMarks) { } -TemporaryRef +already_AddRefed nsSVGPathGeometryElement::GetOrBuildPath(const DrawTarget& aDrawTarget, FillRule aFillRule) { @@ -101,7 +101,7 @@ nsSVGPathGeometryElement::GetOrBuildPath(const DrawTarget& aDrawTarget, return path.forget(); } -TemporaryRef +already_AddRefed nsSVGPathGeometryElement::GetOrBuildPathForMeasuring() { return nullptr; diff --git a/dom/svg/nsSVGPathGeometryElement.h b/dom/svg/nsSVGPathGeometryElement.h index 595e8898c2c..e112b108613 100644 --- a/dom/svg/nsSVGPathGeometryElement.h +++ b/dom/svg/nsSVGPathGeometryElement.h @@ -146,7 +146,7 @@ public: * this element. May return nullptr if there is no [valid] path. The path * that is created may be cached and returned on subsequent calls. */ - virtual mozilla::TemporaryRef GetOrBuildPath(const DrawTarget& aDrawTarget, + virtual already_AddRefed GetOrBuildPath(const DrawTarget& aDrawTarget, FillRule fillRule); /** @@ -154,7 +154,7 @@ public: * previously cached Path, nor caches the Path that in does return). * this element. May return nullptr if there is no [valid] path. */ - virtual mozilla::TemporaryRef BuildPath(PathBuilder* aBuilder) = 0; + virtual already_AddRefed BuildPath(PathBuilder* aBuilder) = 0; /** * Returns a Path that can be used to measure the length of this elements @@ -171,7 +171,7 @@ public: * run into problems with the inserted lines negatively affecting measuring * for content. */ - virtual mozilla::TemporaryRef GetOrBuildPathForMeasuring(); + virtual already_AddRefed GetOrBuildPathForMeasuring(); /** * Returns the current computed value of the CSS property 'fill-rule' for diff --git a/dom/system/gonk/MozMtpDatabase.cpp b/dom/system/gonk/MozMtpDatabase.cpp index 7e9a219fdbe..d4d7af2837b 100644 --- a/dom/system/gonk/MozMtpDatabase.cpp +++ b/dom/system/gonk/MozMtpDatabase.cpp @@ -154,7 +154,7 @@ MozMtpDatabase::FindEntryByPath(const nsACString& aPath) return 0; } -TemporaryRef +already_AddRefed MozMtpDatabase::GetEntry(MtpObjectHandle aHandle) { MutexAutoLock lock(mMutex); diff --git a/dom/system/gonk/MozMtpDatabase.h b/dom/system/gonk/MozMtpDatabase.h index c3af425c1df..c25d44aa73c 100644 --- a/dom/system/gonk/MozMtpDatabase.h +++ b/dom/system/gonk/MozMtpDatabase.h @@ -243,7 +243,7 @@ private: void AddEntryAndNotify(DbEntry* aEntr, RefCountedMtpServer* aMtpServer); void DumpEntries(const char* aLabel); MtpObjectHandle FindEntryByPath(const nsACString& aPath); - mozilla::TemporaryRef GetEntry(MtpObjectHandle aHandle); + already_AddRefed GetEntry(MtpObjectHandle aHandle); void RemoveEntry(MtpObjectHandle aHandle); void RemoveEntryAndNotify(MtpObjectHandle aHandle, RefCountedMtpServer* aMtpServer); void UpdateEntry(MtpObjectHandle aHandle, DeviceStorageFile* aFile); diff --git a/dom/system/gonk/VolumeManager.cpp b/dom/system/gonk/VolumeManager.cpp index a822089e326..4b99c3acd10 100644 --- a/dom/system/gonk/VolumeManager.cpp +++ b/dom/system/gonk/VolumeManager.cpp @@ -71,7 +71,7 @@ VolumeManager::NumVolumes() } //static -TemporaryRef +already_AddRefed VolumeManager::GetVolume(size_t aIndex) { MOZ_ASSERT(aIndex < NumVolumes()); @@ -125,7 +125,7 @@ void VolumeManager::UnregisterStateObserver(StateObserver* aObserver) } //static -TemporaryRef +already_AddRefed VolumeManager::FindVolumeByName(const nsCSubstring& aName) { if (!sVolumeManager) { @@ -143,7 +143,7 @@ VolumeManager::FindVolumeByName(const nsCSubstring& aName) } //static -TemporaryRef +already_AddRefed VolumeManager::FindAddVolumeByName(const nsCSubstring& aName) { RefPtr vol = FindVolumeByName(aName); diff --git a/dom/system/gonk/VolumeManager.h b/dom/system/gonk/VolumeManager.h index 9fbf53003ec..882ae77c4f0 100644 --- a/dom/system/gonk/VolumeManager.h +++ b/dom/system/gonk/VolumeManager.h @@ -125,9 +125,9 @@ public: static void Dump(const char* aLabel); static VolumeArray::size_type NumVolumes(); - static TemporaryRef GetVolume(VolumeArray::index_type aIndex); - static TemporaryRef FindVolumeByName(const nsCSubstring& aName); - static TemporaryRef FindAddVolumeByName(const nsCSubstring& aName); + static already_AddRefed GetVolume(VolumeArray::index_type aIndex); + static already_AddRefed FindVolumeByName(const nsCSubstring& aName); + static already_AddRefed FindAddVolumeByName(const nsCSubstring& aName); static void InitConfig(); static void PostCommand(VolumeCommand* aCommand); diff --git a/gfx/2d/2D.h b/gfx/2d/2D.h index 3605f12253e..5b96282cbc7 100644 --- a/gfx/2d/2D.h +++ b/gfx/2d/2D.h @@ -339,7 +339,7 @@ public: * This function will get a DataSourceSurface for this surface, a * DataSourceSurface's data can be accessed directly. */ - virtual TemporaryRef GetDataSurface() = 0; + virtual already_AddRefed GetDataSurface() = 0; /** Tries to get this SourceSurface's native surface. This will fail if aType * is not the type of this SourceSurface's native surface. @@ -476,7 +476,7 @@ public: * Returns a DataSourceSurface with the same data as this one, but * guaranteed to have surface->GetType() == SurfaceType::DATA. */ - virtual TemporaryRef GetDataSurface() override; + virtual already_AddRefed GetDataSurface() override; protected: bool mIsMapped; @@ -533,8 +533,8 @@ public: /** This returns a PathBuilder object that contains a copy of the contents of * this path and is still writable. */ - virtual TemporaryRef CopyToBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const = 0; - virtual TemporaryRef TransformedCopyToBuilder(const Matrix &aTransform, + virtual already_AddRefed CopyToBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const = 0; + virtual already_AddRefed TransformedCopyToBuilder(const Matrix &aTransform, FillRule aFillRule = FillRule::FILL_WINDING) const = 0; /** This function checks if a point lies within a path. It allows passing a @@ -598,7 +598,7 @@ public: /** Finish writing to the path and return a Path object that can be used for * drawing. Future use of the builder results in a crash! */ - virtual TemporaryRef Finish() = 0; + virtual already_AddRefed Finish() = 0; virtual BackendType GetBackendType() const = 0; }; @@ -638,7 +638,7 @@ public: * can be used with any DrawTarget that has the same backend as the one * passed in. */ - virtual TemporaryRef GetPathForGlyphs(const GlyphBuffer &aBuffer, const DrawTarget *aTarget) = 0; + virtual already_AddRefed GetPathForGlyphs(const GlyphBuffer &aBuffer, const DrawTarget *aTarget) = 0; /** This copies the path describing the glyphs into a PathBuilder. We use this * API rather than a generic API to append paths because it allows easier @@ -702,7 +702,7 @@ public: * Multiple calls to Snapshot() without any drawing operations in between will * normally return the same SourceSurface object. */ - virtual TemporaryRef Snapshot() = 0; + virtual already_AddRefed Snapshot() = 0; virtual IntSize GetSize() = 0; /** @@ -938,7 +938,7 @@ public: * * The SourceSurface does not take ownership of aData, and may be freed at any time. */ - virtual TemporaryRef CreateSourceSurfaceFromData(unsigned char *aData, + virtual already_AddRefed CreateSourceSurfaceFromData(unsigned char *aData, const IntSize &aSize, int32_t aStride, SurfaceFormat aFormat) const = 0; @@ -948,20 +948,20 @@ public: * arbitrary SourceSurface type supported by this backend. This may return * aSourceSurface or some other existing surface. */ - virtual TemporaryRef OptimizeSourceSurface(SourceSurface *aSurface) const = 0; + virtual already_AddRefed OptimizeSourceSurface(SourceSurface *aSurface) const = 0; /** * Create a SourceSurface for a type of NativeSurface. This may fail if the * draw target does not know how to deal with the type of NativeSurface passed * in. */ - virtual TemporaryRef + virtual already_AddRefed CreateSourceSurfaceFromNativeSurface(const NativeSurface &aSurface) const = 0; /** * Create a DrawTarget whose snapshot is optimized for use with this DrawTarget. */ - virtual TemporaryRef + virtual already_AddRefed CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aFormat) const = 0; /** @@ -970,7 +970,7 @@ public: * * @param aSize Size of the area this DT will capture. */ - virtual TemporaryRef CreateCaptureDT(const IntSize& aSize); + virtual already_AddRefed CreateCaptureDT(const IntSize& aSize); /** * Create a draw target optimized for drawing a shadow. @@ -980,7 +980,7 @@ public: * surface, the caller is still responsible for including the shadow area in * its size. */ - virtual TemporaryRef + virtual already_AddRefed CreateShadowDrawTarget(const IntSize &aSize, SurfaceFormat aFormat, float aSigma) const { @@ -994,7 +994,7 @@ public: * ID2D1SimplifiedGeometrySink requires the fill mode * to be set before calling BeginFigure(). */ - virtual TemporaryRef CreatePathBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const = 0; + virtual already_AddRefed CreatePathBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const = 0; /** * Create a GradientStops object that holds information about a set of @@ -1006,7 +1006,7 @@ public: * @param aExtendNone This describes how to extend the stop color outside of the * gradient area. */ - virtual TemporaryRef + virtual already_AddRefed CreateGradientStops(GradientStop *aStops, uint32_t aNumStops, ExtendMode aExtendMode = ExtendMode::CLAMP) const = 0; @@ -1017,7 +1017,7 @@ public: * * @param aType Type of filter node to be created. */ - virtual TemporaryRef CreateFilter(FilterType aType) = 0; + virtual already_AddRefed CreateFilter(FilterType aType) = 0; Matrix GetTransform() const { return mTransform; } @@ -1144,18 +1144,18 @@ public: */ static bool ReasonableSurfaceSize(const IntSize &aSize); - static TemporaryRef CreateDrawTargetForCairoSurface(cairo_surface_t* aSurface, const IntSize& aSize, SurfaceFormat* aFormat = nullptr); + static already_AddRefed CreateDrawTargetForCairoSurface(cairo_surface_t* aSurface, const IntSize& aSize, SurfaceFormat* aFormat = nullptr); - static TemporaryRef + static already_AddRefed CreateDrawTarget(BackendType aBackend, const IntSize &aSize, SurfaceFormat aFormat); - static TemporaryRef + static already_AddRefed CreateRecordingDrawTarget(DrawEventRecorder *aRecorder, DrawTarget *aDT); - static TemporaryRef + static already_AddRefed CreateDrawTargetForData(BackendType aBackend, unsigned char* aData, const IntSize &aSize, int32_t aStride, SurfaceFormat aFormat); - static TemporaryRef + static already_AddRefed CreateScaledFontForNativeFont(const NativeFont &aNativeFont, Float aSize); /** @@ -1167,7 +1167,7 @@ public: * @param aGlyphSize Size of the glyphs in this ScaledFont * @param aType Type of ScaledFont that should be created. */ - static TemporaryRef + static already_AddRefed CreateScaledFontForTrueTypeData(uint8_t *aData, uint32_t aSize, uint32_t aFaceIndex, Float aGlyphSize, FontType aType); /** @@ -1175,7 +1175,7 @@ public: * must be used when using the Cairo backend. The NativeFont and * cairo_scaled_font_t* parameters must correspond to the same font. */ - static TemporaryRef + static already_AddRefed CreateScaledFontWithCairo(const NativeFont &aNativeFont, Float aSize, cairo_scaled_font_t* aScaledFont); /** @@ -1184,7 +1184,7 @@ public: * destroyed. The caller is responsible for handing the case where nullptr * is returned. The surface is not zeroed unless requested. */ - static TemporaryRef + static already_AddRefed CreateDataSourceSurface(const IntSize &aSize, SurfaceFormat aFormat, bool aZero = false); /** @@ -1194,7 +1194,7 @@ public: * the surface is destroyed. The caller is responsible for handling the case * where nullptr is returned. The surface is not zeroed unless requested. */ - static TemporaryRef + static already_AddRefed CreateDataSourceSurfaceWithStride(const IntSize &aSize, SurfaceFormat aFormat, int32_t aStride, bool aZero = false); /** @@ -1203,11 +1203,11 @@ public: * responsible for deallocating the memory only after destruction of the * surface. */ - static TemporaryRef + static already_AddRefed CreateWrappingDataSourceSurface(uint8_t *aData, int32_t aStride, const IntSize &aSize, SurfaceFormat aFormat); - static TemporaryRef + static already_AddRefed CreateEventRecorderForFile(const char *aFilename); static void SetGlobalEventRecorder(DrawEventRecorder *aRecorder); @@ -1224,7 +1224,7 @@ private: public: #ifdef USE_SKIA_GPU - static TemporaryRef + static already_AddRefed CreateDrawTargetSkiaWithGrContext(GrContext* aGrContext, const IntSize &aSize, SurfaceFormat aFormat); @@ -1233,10 +1233,10 @@ public: static void PurgeAllCaches(); #if defined(USE_SKIA) && defined(MOZ_ENABLE_FREETYPE) - static TemporaryRef + static already_AddRefed CreateCairoGlyphRenderingOptions(FontHinting aHinting, bool aAutoHinting); #endif - static TemporaryRef + static already_AddRefed CreateDualDrawTarget(DrawTarget *targetA, DrawTarget *targetB); /* @@ -1245,33 +1245,33 @@ public: * individual offset. The tiles in the set must each have the same backend * and format. */ - static TemporaryRef CreateTiledDrawTarget(const TileSet& aTileSet); + static already_AddRefed CreateTiledDrawTarget(const TileSet& aTileSet); static bool DoesBackendSupportDataDrawtarget(BackendType aType); #ifdef XP_MACOSX - static TemporaryRef CreateDrawTargetForCairoCGContext(CGContextRef cg, const IntSize& aSize); - static TemporaryRef + static already_AddRefed CreateDrawTargetForCairoCGContext(CGContextRef cg, const IntSize& aSize); + static already_AddRefed CreateCGGlyphRenderingOptions(const Color &aFontSmoothingBackgroundColor); #endif #ifdef WIN32 - static TemporaryRef CreateDrawTargetForD3D10Texture(ID3D10Texture2D *aTexture, SurfaceFormat aFormat); - static TemporaryRef + static already_AddRefed CreateDrawTargetForD3D10Texture(ID3D10Texture2D *aTexture, SurfaceFormat aFormat); + static already_AddRefed CreateDualDrawTargetForD3D10Textures(ID3D10Texture2D *aTextureA, ID3D10Texture2D *aTextureB, SurfaceFormat aFormat); static void SetDirect3D10Device(ID3D10Device1 *aDevice); static ID3D10Device1 *GetDirect3D10Device(); - static TemporaryRef CreateDrawTargetForD3D11Texture(ID3D11Texture2D *aTexture, SurfaceFormat aFormat); + static already_AddRefed CreateDrawTargetForD3D11Texture(ID3D11Texture2D *aTexture, SurfaceFormat aFormat); static void SetDirect3D11Device(ID3D11Device *aDevice); static ID3D11Device *GetDirect3D11Device(); static ID2D1Device *GetD2D1Device(); static bool SupportsD2D1(); - static TemporaryRef + static already_AddRefed CreateDWriteGlyphRenderingOptions(IDWriteRenderingParams *aParams); static uint64_t GetD2DVRAMUsageDrawTarget(); diff --git a/gfx/2d/DataSourceSurface.cpp b/gfx/2d/DataSourceSurface.cpp index b9a63d45ba7..c3a837f9968 100644 --- a/gfx/2d/DataSourceSurface.cpp +++ b/gfx/2d/DataSourceSurface.cpp @@ -9,7 +9,7 @@ namespace mozilla { namespace gfx { -TemporaryRef +already_AddRefed DataSourceSurface::GetDataSurface() { RefPtr surface = diff --git a/gfx/2d/DataSurfaceHelpers.cpp b/gfx/2d/DataSurfaceHelpers.cpp index e80792f2b9a..6ca71b3c4f4 100644 --- a/gfx/2d/DataSurfaceHelpers.cpp +++ b/gfx/2d/DataSurfaceHelpers.cpp @@ -278,7 +278,7 @@ CopyRect(DataSourceSurface* aSrc, DataSourceSurface* aDest, } } -TemporaryRef +already_AddRefed CreateDataSourceSurfaceByCloning(DataSourceSurface* aSource) { RefPtr copy = diff --git a/gfx/2d/DataSurfaceHelpers.h b/gfx/2d/DataSurfaceHelpers.h index 4444f747c0c..4327f71b453 100644 --- a/gfx/2d/DataSurfaceHelpers.h +++ b/gfx/2d/DataSurfaceHelpers.h @@ -83,7 +83,7 @@ CopyRect(DataSourceSurface* aSrc, DataSourceSurface* aDest, * * @return a dss allocated by Factory that contains a copy a aSource. */ -TemporaryRef +already_AddRefed CreateDataSourceSurfaceByCloning(DataSourceSurface* aSource); /** diff --git a/gfx/2d/DrawTarget.cpp b/gfx/2d/DrawTarget.cpp index 21b85125629..f2a46681be1 100644 --- a/gfx/2d/DrawTarget.cpp +++ b/gfx/2d/DrawTarget.cpp @@ -11,7 +11,7 @@ namespace mozilla { namespace gfx { -TemporaryRef +already_AddRefed DrawTarget::CreateCaptureDT(const IntSize& aSize) { RefPtr dt = new DrawTargetCaptureImpl(); diff --git a/gfx/2d/DrawTargetCG.cpp b/gfx/2d/DrawTargetCG.cpp index 91386d02cb9..3db021fcc78 100644 --- a/gfx/2d/DrawTargetCG.cpp +++ b/gfx/2d/DrawTargetCG.cpp @@ -186,7 +186,7 @@ DrawTargetCG::GetBackendType() const } } -TemporaryRef +already_AddRefed DrawTargetCG::Snapshot() { if (!mSnapshot) { @@ -201,7 +201,7 @@ DrawTargetCG::Snapshot() return snapshot.forget(); } -TemporaryRef +already_AddRefed DrawTargetCG::CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aFormat) const { // XXX: in thebes we use CGLayers to do this kind of thing. It probably makes sense @@ -213,7 +213,7 @@ DrawTargetCG::CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aForma return nullptr; } -TemporaryRef +already_AddRefed DrawTargetCG::CreateSourceSurfaceFromData(unsigned char *aData, const IntSize &aSize, int32_t aStride, @@ -260,7 +260,7 @@ GetRetainedImageFromSourceSurface(SourceSurface *aSurface) } } -TemporaryRef +already_AddRefed DrawTargetCG::OptimizeSourceSurface(SourceSurface *aSurface) const { RefPtr surface(aSurface); @@ -392,7 +392,7 @@ DrawTargetCG::DrawSurface(SourceSurface *aSurface, CGContextRestoreGState(mCg); } -TemporaryRef +already_AddRefed DrawTargetCG::CreateFilter(FilterType aType) { return FilterNodeSoftware::Create(aType); @@ -468,7 +468,7 @@ class GradientStopsCG : public GradientStops ExtendMode mExtend; }; -TemporaryRef +already_AddRefed DrawTargetCG::CreateGradientStops(GradientStop *aStops, uint32_t aNumStops, ExtendMode aExtendMode) const { @@ -1897,7 +1897,7 @@ DrawTargetCG::Init(BackendType aType, const IntSize &aSize, SurfaceFormat &aForm return Init(aType, nullptr, aSize, stride, aFormat); } -TemporaryRef +already_AddRefed DrawTargetCG::CreatePathBuilder(FillRule aFillRule) const { return MakeAndAddRef(aFillRule); diff --git a/gfx/2d/DrawTargetCG.h b/gfx/2d/DrawTargetCG.h index a32713c2fc4..ba3250fe3df 100644 --- a/gfx/2d/DrawTargetCG.h +++ b/gfx/2d/DrawTargetCG.h @@ -120,7 +120,7 @@ public: virtual DrawTargetType GetType() const override; virtual BackendType GetBackendType() const override; - virtual TemporaryRef Snapshot() override; + virtual already_AddRefed Snapshot() override; virtual void DrawSurface(SourceSurface *aSurface, const Rect &aDest, @@ -163,12 +163,12 @@ public: virtual void PushClip(const Path *) override; virtual void PushClipRect(const Rect &aRect) override; virtual void PopClip() override; - virtual TemporaryRef CreateSourceSurfaceFromNativeSurface(const NativeSurface&) const override { return nullptr;} - virtual TemporaryRef CreateSimilarDrawTarget(const IntSize &, SurfaceFormat) const override; - virtual TemporaryRef CreatePathBuilder(FillRule) const override; - virtual TemporaryRef CreateGradientStops(GradientStop *, uint32_t, + virtual already_AddRefed CreateSourceSurfaceFromNativeSurface(const NativeSurface&) const override { return nullptr;} + virtual already_AddRefed CreateSimilarDrawTarget(const IntSize &, SurfaceFormat) const override; + virtual already_AddRefed CreatePathBuilder(FillRule) const override; + virtual already_AddRefed CreateGradientStops(GradientStop *, uint32_t, ExtendMode aExtendMode = ExtendMode::CLAMP) const override; - virtual TemporaryRef CreateFilter(FilterType aType) override; + virtual already_AddRefed CreateFilter(FilterType aType) override; virtual void *GetNativeSurface(NativeSurfaceType) override; @@ -177,11 +177,11 @@ public: virtual void SetTransform(const Matrix &aTransform) override; /* This is for creating good compatible surfaces */ - virtual TemporaryRef CreateSourceSurfaceFromData(unsigned char *aData, + virtual already_AddRefed CreateSourceSurfaceFromData(unsigned char *aData, const IntSize &aSize, int32_t aStride, SurfaceFormat aFormat) const override; - virtual TemporaryRef OptimizeSourceSurface(SourceSurface *aSurface) const override; + virtual already_AddRefed OptimizeSourceSurface(SourceSurface *aSurface) const override; CGContextRef GetCGContext() { return mCg; } diff --git a/gfx/2d/DrawTargetCairo.cpp b/gfx/2d/DrawTargetCairo.cpp index 2aefda46819..affb2bf530d 100644 --- a/gfx/2d/DrawTargetCairo.cpp +++ b/gfx/2d/DrawTargetCairo.cpp @@ -678,7 +678,7 @@ DrawTargetCairo::GetSize() return mSize; } -TemporaryRef +already_AddRefed DrawTargetCairo::Snapshot() { if (mSnapshot) { @@ -1369,7 +1369,7 @@ DrawTargetCairo::PopClip() "Transforms are out of sync"); } -TemporaryRef +already_AddRefed DrawTargetCairo::CreatePathBuilder(FillRule aFillRule /* = FillRule::FILL_WINDING */) const { return MakeAndAddRef(aFillRule); @@ -1388,20 +1388,20 @@ DrawTargetCairo::ClearSurfaceForUnboundedSource(const CompositionOp &aOperator) } -TemporaryRef +already_AddRefed DrawTargetCairo::CreateGradientStops(GradientStop *aStops, uint32_t aNumStops, ExtendMode aExtendMode) const { return MakeAndAddRef(aStops, aNumStops, aExtendMode); } -TemporaryRef +already_AddRefed DrawTargetCairo::CreateFilter(FilterType aType) { return FilterNodeSoftware::Create(aType); } -TemporaryRef +already_AddRefed DrawTargetCairo::CreateSourceSurfaceFromData(unsigned char *aData, const IntSize &aSize, int32_t aStride, @@ -1443,7 +1443,7 @@ DestroyPixmap(void *data) } #endif -TemporaryRef +already_AddRefed DrawTargetCairo::OptimizeSourceSurface(SourceSurface *aSurface) const { RefPtr surface(aSurface); @@ -1532,7 +1532,7 @@ DrawTargetCairo::OptimizeSourceSurface(SourceSurface *aSurface) const return surface.forget(); } -TemporaryRef +already_AddRefed DrawTargetCairo::CreateSourceSurfaceFromNativeSurface(const NativeSurface &aSurface) const { if (aSurface.mType == NativeSurfaceType::CAIRO_SURFACE) { @@ -1548,7 +1548,7 @@ DrawTargetCairo::CreateSourceSurfaceFromNativeSurface(const NativeSurface &aSurf return nullptr; } -TemporaryRef +already_AddRefed DrawTargetCairo::CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aFormat) const { cairo_surface_t* similar = cairo_surface_create_similar(mSurface, @@ -1600,7 +1600,7 @@ DrawTargetCairo::InitAlreadyReferenced(cairo_surface_t* aSurface, const IntSize& return true; } -TemporaryRef +already_AddRefed DrawTargetCairo::CreateShadowDrawTarget(const IntSize &aSize, SurfaceFormat aFormat, float aSigma) const { diff --git a/gfx/2d/DrawTargetCairo.h b/gfx/2d/DrawTargetCairo.h index 292a9072b65..7d2d649e22a 100644 --- a/gfx/2d/DrawTargetCairo.h +++ b/gfx/2d/DrawTargetCairo.h @@ -61,7 +61,7 @@ public: virtual DrawTargetType GetType() const override; virtual BackendType GetBackendType() const override { return BackendType::CAIRO; } - virtual TemporaryRef Snapshot() override; + virtual already_AddRefed Snapshot() override; virtual IntSize GetSize() override; virtual void SetPermitSubpixelAA(bool aPermitSubpixelAA) override; @@ -134,27 +134,27 @@ public: virtual void PushClipRect(const Rect &aRect) override; virtual void PopClip() override; - virtual TemporaryRef CreatePathBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const override; + virtual already_AddRefed CreatePathBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const override; - virtual TemporaryRef CreateSourceSurfaceFromData(unsigned char *aData, + virtual already_AddRefed CreateSourceSurfaceFromData(unsigned char *aData, const IntSize &aSize, int32_t aStride, SurfaceFormat aFormat) const override; - virtual TemporaryRef OptimizeSourceSurface(SourceSurface *aSurface) const override; - virtual TemporaryRef + virtual already_AddRefed OptimizeSourceSurface(SourceSurface *aSurface) const override; + virtual already_AddRefed CreateSourceSurfaceFromNativeSurface(const NativeSurface &aSurface) const override; - virtual TemporaryRef + virtual already_AddRefed CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aFormat) const override; - virtual TemporaryRef + virtual already_AddRefed CreateShadowDrawTarget(const IntSize &aSize, SurfaceFormat aFormat, float aSigma) const override; - virtual TemporaryRef + virtual already_AddRefed CreateGradientStops(GradientStop *aStops, uint32_t aNumStops, ExtendMode aExtendMode = ExtendMode::CLAMP) const override; - virtual TemporaryRef CreateFilter(FilterType aType) override; + virtual already_AddRefed CreateFilter(FilterType aType) override; virtual void *GetNativeSurface(NativeSurfaceType aType) override; diff --git a/gfx/2d/DrawTargetCapture.cpp b/gfx/2d/DrawTargetCapture.cpp index d53a98ec770..69c118c640e 100644 --- a/gfx/2d/DrawTargetCapture.cpp +++ b/gfx/2d/DrawTargetCapture.cpp @@ -35,7 +35,7 @@ DrawTargetCaptureImpl::Init(const IntSize& aSize, DrawTarget* aRefDT) return true; } -TemporaryRef +already_AddRefed DrawTargetCaptureImpl::Snapshot() { RefPtr dt = mRefDT->CreateSimilarDrawTarget(mSize, mRefDT->GetFormat()); diff --git a/gfx/2d/DrawTargetCapture.h b/gfx/2d/DrawTargetCapture.h index 2ef8f0e6255..3d2d56ce213 100644 --- a/gfx/2d/DrawTargetCapture.h +++ b/gfx/2d/DrawTargetCapture.h @@ -27,7 +27,7 @@ public: virtual BackendType GetBackendType() const { return mRefDT->GetBackendType(); } virtual DrawTargetType GetType() const { return mRefDT->GetType(); } - virtual TemporaryRef Snapshot(); + virtual already_AddRefed Snapshot(); virtual IntSize GetSize() { return mSize; } virtual void Flush() {} @@ -90,43 +90,43 @@ public: virtual void SetTransform(const Matrix &aTransform); - virtual TemporaryRef CreateSourceSurfaceFromData(unsigned char *aData, + virtual already_AddRefed CreateSourceSurfaceFromData(unsigned char *aData, const IntSize &aSize, int32_t aStride, SurfaceFormat aFormat) const { return mRefDT->CreateSourceSurfaceFromData(aData, aSize, aStride, aFormat); } - virtual TemporaryRef OptimizeSourceSurface(SourceSurface *aSurface) const + virtual already_AddRefed OptimizeSourceSurface(SourceSurface *aSurface) const { return mRefDT->OptimizeSourceSurface(aSurface); } - virtual TemporaryRef + virtual already_AddRefed CreateSourceSurfaceFromNativeSurface(const NativeSurface &aSurface) const { return mRefDT->CreateSourceSurfaceFromNativeSurface(aSurface); } - virtual TemporaryRef + virtual already_AddRefed CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aFormat) const { return mRefDT->CreateSimilarDrawTarget(aSize, aFormat); } - virtual TemporaryRef CreatePathBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const + virtual already_AddRefed CreatePathBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const { return mRefDT->CreatePathBuilder(aFillRule); } - virtual TemporaryRef + virtual already_AddRefed CreateGradientStops(GradientStop *aStops, uint32_t aNumStops, ExtendMode aExtendMode = ExtendMode::CLAMP) const { return mRefDT->CreateGradientStops(aStops, aNumStops, aExtendMode); } - virtual TemporaryRef CreateFilter(FilterType aType) + virtual already_AddRefed CreateFilter(FilterType aType) { return mRefDT->CreateFilter(aType); } diff --git a/gfx/2d/DrawTargetD2D.cpp b/gfx/2d/DrawTargetD2D.cpp index 98bee747cf7..c40d05e8cf8 100644 --- a/gfx/2d/DrawTargetD2D.cpp +++ b/gfx/2d/DrawTargetD2D.cpp @@ -219,7 +219,7 @@ DrawTargetD2D::~DrawTargetD2D() /* * DrawTarget Implementation */ -TemporaryRef +already_AddRefed DrawTargetD2D::Snapshot() { if (!mSnapshot) { @@ -259,7 +259,7 @@ DrawTargetD2D::AddDependencyOnSource(SourceSurfaceD2DTarget* aSource) } } -TemporaryRef +already_AddRefed DrawTargetD2D::GetBitmapForSurface(SourceSurface *aSurface, Rect &aSource) { @@ -337,7 +337,7 @@ DrawTargetD2D::GetBitmapForSurface(SourceSurface *aSurface, return bitmap.forget(); } -TemporaryRef +already_AddRefed DrawTargetD2D::GetImageForSurface(SourceSurface *aSurface) { RefPtr image; @@ -1195,7 +1195,7 @@ DrawTargetD2D::PopClip() mPushedClips.pop_back(); } -TemporaryRef +already_AddRefed DrawTargetD2D::CreateSourceSurfaceFromData(unsigned char *aData, const IntSize &aSize, int32_t aStride, @@ -1210,7 +1210,7 @@ DrawTargetD2D::CreateSourceSurfaceFromData(unsigned char *aData, return newSurf.forget(); } -TemporaryRef +already_AddRefed DrawTargetD2D::OptimizeSourceSurface(SourceSurface *aSurface) const { if (aSurface->GetType() == SurfaceType::D2D1_BITMAP || @@ -1237,7 +1237,7 @@ DrawTargetD2D::OptimizeSourceSurface(SourceSurface *aSurface) const return newSurf.forget(); } -TemporaryRef +already_AddRefed DrawTargetD2D::CreateSourceSurfaceFromNativeSurface(const NativeSurface &aSurface) const { if (aSurface.mType != NativeSurfaceType::D3D10_TEXTURE) { @@ -1257,7 +1257,7 @@ DrawTargetD2D::CreateSourceSurfaceFromNativeSurface(const NativeSurface &aSurfac return newSurf.forget(); } -TemporaryRef +already_AddRefed DrawTargetD2D::CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aFormat) const { RefPtr newTarget = @@ -1271,7 +1271,7 @@ DrawTargetD2D::CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aForm return newTarget.forget(); } -TemporaryRef +already_AddRefed DrawTargetD2D::CreatePathBuilder(FillRule aFillRule) const { RefPtr path; @@ -1296,7 +1296,7 @@ DrawTargetD2D::CreatePathBuilder(FillRule aFillRule) const return MakeAndAddRef(sink, path, aFillRule, BackendType::DIRECT2D); } -TemporaryRef +already_AddRefed DrawTargetD2D::CreateGradientStops(GradientStop *rawStops, uint32_t aNumStops, ExtendMode aExtendMode) const { D2D1_GRADIENT_STOP *stops = new D2D1_GRADIENT_STOP[aNumStops]; @@ -1322,7 +1322,7 @@ DrawTargetD2D::CreateGradientStops(GradientStop *rawStops, uint32_t aNumStops, E return MakeAndAddRef(stopCollection, Factory::GetDirect3D11Device()); } -TemporaryRef +already_AddRefed DrawTargetD2D::CreateFilter(FilterType aType) { RefPtr dc; @@ -1490,7 +1490,7 @@ DrawTargetD2D::GetByteSize() const return mSize.width * mSize.height * BytesPerPixel(mFormat); } -TemporaryRef +already_AddRefed DrawTargetD2D::GetCachedLayer() { RefPtr layer; @@ -1871,7 +1871,7 @@ DrawTargetD2D::GetDeviceSpaceClipRect(D2D1_RECT_F& aClipRect, bool& aIsPixelAlig return true; } -TemporaryRef +already_AddRefed DrawTargetD2D::GetClippedGeometry(IntRect *aClipBounds) { if (mCurrentClippedGeometry) { @@ -1960,7 +1960,7 @@ DrawTargetD2D::GetClippedGeometry(IntRect *aClipBounds) return clippedGeometry.forget(); } -TemporaryRef +already_AddRefed DrawTargetD2D::CreateRTForTexture(ID3D10Texture2D *aTexture, SurfaceFormat aFormat) { HRESULT hr; @@ -2288,7 +2288,7 @@ DrawTargetD2D::FillGlyphsManual(ScaledFontDWrite *aFont, return true; } -TemporaryRef +already_AddRefed DrawTargetD2D::CreateBrushForPattern(const Pattern &aPattern, Float aAlpha) { if (!IsPatternSupportedByD2D(aPattern)) { @@ -2454,7 +2454,7 @@ DrawTargetD2D::CreateBrushForPattern(const Pattern &aPattern, Float aAlpha) return nullptr; } -TemporaryRef +already_AddRefed DrawTargetD2D::CreateGradientTexture(const GradientStopsD2D *aStops) { CD3D10_TEXTURE2D_DESC desc(DXGI_FORMAT_B8G8R8A8_UNORM, 4096, 1, 1, 1); @@ -2526,7 +2526,7 @@ DrawTargetD2D::CreateGradientTexture(const GradientStopsD2D *aStops) return tex.forget(); } -TemporaryRef +already_AddRefed DrawTargetD2D::CreateTextureForAnalysis(IDWriteGlyphRunAnalysis *aAnalysis, const IntRect &aBounds) { HRESULT hr; diff --git a/gfx/2d/DrawTargetD2D.h b/gfx/2d/DrawTargetD2D.h index 5eea0a132be..eae24d73f4d 100644 --- a/gfx/2d/DrawTargetD2D.h +++ b/gfx/2d/DrawTargetD2D.h @@ -45,7 +45,7 @@ public: virtual DrawTargetType GetType() const override { return DrawTargetType::HARDWARE_RASTER; } virtual BackendType GetBackendType() const { return BackendType::DIRECT2D; } - virtual TemporaryRef Snapshot(); + virtual already_AddRefed Snapshot(); virtual IntSize GetSize() { return mSize; } virtual void Flush(); @@ -106,26 +106,26 @@ public: virtual void PushClipRect(const Rect &aRect); virtual void PopClip(); - virtual TemporaryRef CreateSourceSurfaceFromData(unsigned char *aData, + virtual already_AddRefed CreateSourceSurfaceFromData(unsigned char *aData, const IntSize &aSize, int32_t aStride, SurfaceFormat aFormat) const; - virtual TemporaryRef OptimizeSourceSurface(SourceSurface *aSurface) const; + virtual already_AddRefed OptimizeSourceSurface(SourceSurface *aSurface) const; - virtual TemporaryRef + virtual already_AddRefed CreateSourceSurfaceFromNativeSurface(const NativeSurface &aSurface) const; - virtual TemporaryRef + virtual already_AddRefed CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aFormat) const; - virtual TemporaryRef CreatePathBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const; + virtual already_AddRefed CreatePathBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const; - virtual TemporaryRef + virtual already_AddRefed CreateGradientStops(GradientStop *aStops, uint32_t aNumStops, ExtendMode aExtendMode = ExtendMode::CLAMP) const; - virtual TemporaryRef CreateFilter(FilterType aType); + virtual already_AddRefed CreateFilter(FilterType aType); virtual bool SupportsRegionClipping() const { return false; } @@ -135,10 +135,10 @@ public: bool Init(ID3D10Texture2D *aTexture, SurfaceFormat aFormat); bool InitD3D10Data(); uint32_t GetByteSize() const; - TemporaryRef GetCachedLayer(); + already_AddRefed GetCachedLayer(); void PopCachedLayer(ID2D1RenderTarget *aRT); - TemporaryRef GetImageForSurface(SourceSurface *aSurface); + already_AddRefed GetImageForSurface(SourceSurface *aSurface); static ID2D1Factory *factory(); static void CleanupD2D(); @@ -159,7 +159,7 @@ public: static uint64_t mVRAMUsageSS; private: - TemporaryRef + already_AddRefed GetBitmapForSurface(SourceSurface *aSurface, Rect &aSource); friend class AutoSaveRestoreClippedOut; @@ -199,20 +199,20 @@ private: IDWriteRenderingParams *aParams, const DrawOptions &aOptions = DrawOptions()); - TemporaryRef CreateRTForTexture(ID3D10Texture2D *aTexture, SurfaceFormat aFormat); + already_AddRefed CreateRTForTexture(ID3D10Texture2D *aTexture, SurfaceFormat aFormat); // This returns the clipped geometry, in addition it returns aClipBounds which // represents the intersection of all pixel-aligned rectangular clips that // are currently set. The returned clipped geometry must be clipped by these // bounds to correctly reflect the total clip. This is in device space. - TemporaryRef GetClippedGeometry(IntRect *aClipBounds); + already_AddRefed GetClippedGeometry(IntRect *aClipBounds); bool GetDeviceSpaceClipRect(D2D1_RECT_F& aClipRect, bool& aIsPixelAligned); - TemporaryRef CreateBrushForPattern(const Pattern &aPattern, Float aAlpha = 1.0f); + already_AddRefed CreateBrushForPattern(const Pattern &aPattern, Float aAlpha = 1.0f); - TemporaryRef CreateGradientTexture(const GradientStopsD2D *aStops); - TemporaryRef CreateTextureForAnalysis(IDWriteGlyphRunAnalysis *aAnalysis, const IntRect &aBounds); + already_AddRefed CreateGradientTexture(const GradientStopsD2D *aStops); + already_AddRefed CreateTextureForAnalysis(IDWriteGlyphRunAnalysis *aAnalysis, const IntRect &aBounds); void SetupEffectForRadialGradient(const RadialGradientPattern *aPattern); void SetupStateForRendering(); diff --git a/gfx/2d/DrawTargetD2D1.cpp b/gfx/2d/DrawTargetD2D1.cpp index b543bb0f94f..e4db8d33d76 100644 --- a/gfx/2d/DrawTargetD2D1.cpp +++ b/gfx/2d/DrawTargetD2D1.cpp @@ -65,7 +65,7 @@ DrawTargetD2D1::~DrawTargetD2D1() } } -TemporaryRef +already_AddRefed DrawTargetD2D1::Snapshot() { if (mSnapshot) { @@ -705,7 +705,7 @@ DrawTargetD2D1::PopClip() mPushedClips.pop_back(); } -TemporaryRef +already_AddRefed DrawTargetD2D1::CreateSourceSurfaceFromData(unsigned char *aData, const IntSize &aSize, int32_t aStride, @@ -725,7 +725,7 @@ DrawTargetD2D1::CreateSourceSurfaceFromData(unsigned char *aData, return MakeAndAddRef(bitmap.get(), mDC, aFormat, aSize); } -TemporaryRef +already_AddRefed DrawTargetD2D1::CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aFormat) const { RefPtr dt = new DrawTargetD2D1(); @@ -737,7 +737,7 @@ DrawTargetD2D1::CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aFor return dt.forget(); } -TemporaryRef +already_AddRefed DrawTargetD2D1::CreatePathBuilder(FillRule aFillRule) const { RefPtr path; @@ -762,7 +762,7 @@ DrawTargetD2D1::CreatePathBuilder(FillRule aFillRule) const return MakeAndAddRef(sink, path, aFillRule, BackendType::DIRECT2D1_1); } -TemporaryRef +already_AddRefed DrawTargetD2D1::CreateGradientStops(GradientStop *rawStops, uint32_t aNumStops, ExtendMode aExtendMode) const { if (aNumStops == 0) { @@ -793,7 +793,7 @@ DrawTargetD2D1::CreateGradientStops(GradientStop *rawStops, uint32_t aNumStops, return MakeAndAddRef(stopCollection, Factory::GetDirect3D11Device()); } -TemporaryRef +already_AddRefed DrawTargetD2D1::CreateFilter(FilterType aType) { return FilterNodeD2D1::Create(mDC, aType); @@ -1198,7 +1198,7 @@ DrawTargetD2D1::GetDeviceSpaceClipRect(D2D1_RECT_F& aClipRect, bool& aIsPixelAli return true; } -TemporaryRef +already_AddRefed DrawTargetD2D1::GetClippedGeometry(IntRect *aClipBounds) { if (mCurrentClippedGeometry) { @@ -1289,7 +1289,7 @@ DrawTargetD2D1::GetClippedGeometry(IntRect *aClipBounds) return clippedGeometry.forget(); } -TemporaryRef +already_AddRefed DrawTargetD2D1::GetInverseClippedGeometry() { IntRect bounds; @@ -1355,13 +1355,13 @@ DrawTargetD2D1::PopClipsFromDC(ID2D1DeviceContext *aDC) } } -TemporaryRef +already_AddRefed DrawTargetD2D1::CreateTransparentBlackBrush() { return GetSolidColorBrush(D2D1::ColorF(0, 0)); } -TemporaryRef +already_AddRefed DrawTargetD2D1::GetSolidColorBrush(const D2D_COLOR_F& aColor) { RefPtr brush = mSolidColorBrush; @@ -1369,7 +1369,7 @@ DrawTargetD2D1::GetSolidColorBrush(const D2D_COLOR_F& aColor) return brush.forget(); } -TemporaryRef +already_AddRefed DrawTargetD2D1::CreateBrushForPattern(const Pattern &aPattern, Float aAlpha) { if (!IsPatternSupportedByD2D(aPattern)) { @@ -1513,7 +1513,7 @@ DrawTargetD2D1::CreateBrushForPattern(const Pattern &aPattern, Float aAlpha) return CreateTransparentBlackBrush(); } -TemporaryRef +already_AddRefed DrawTargetD2D1::GetImageForSurface(SourceSurface *aSurface, Matrix &aSourceTransform, ExtendMode aExtendMode, const IntRect* aSourceRect) { @@ -1543,7 +1543,7 @@ DrawTargetD2D1::GetImageForSurface(SourceSurface *aSurface, Matrix &aSourceTrans return image.forget(); } -TemporaryRef +already_AddRefed DrawTargetD2D1::OptimizeSourceSurface(SourceSurface* aSurface) const { if (aSurface->GetType() == SurfaceType::D2D1_1_IMAGE) { diff --git a/gfx/2d/DrawTargetD2D1.h b/gfx/2d/DrawTargetD2D1.h index 751eb40dd48..f0793c8e02d 100644 --- a/gfx/2d/DrawTargetD2D1.h +++ b/gfx/2d/DrawTargetD2D1.h @@ -35,7 +35,7 @@ public: virtual DrawTargetType GetType() const override { return DrawTargetType::HARDWARE_RASTER; } virtual BackendType GetBackendType() const { return BackendType::DIRECT2D1_1; } - virtual TemporaryRef Snapshot(); + virtual already_AddRefed Snapshot(); virtual IntSize GetSize() { return mSize; } virtual void Flush(); @@ -95,26 +95,26 @@ public: virtual void PushClipRect(const Rect &aRect); virtual void PopClip(); - virtual TemporaryRef CreateSourceSurfaceFromData(unsigned char *aData, + virtual already_AddRefed CreateSourceSurfaceFromData(unsigned char *aData, const IntSize &aSize, int32_t aStride, SurfaceFormat aFormat) const; - virtual TemporaryRef OptimizeSourceSurface(SourceSurface *aSurface) const; + virtual already_AddRefed OptimizeSourceSurface(SourceSurface *aSurface) const; - virtual TemporaryRef + virtual already_AddRefed CreateSourceSurfaceFromNativeSurface(const NativeSurface &aSurface) const { return nullptr; } - virtual TemporaryRef + virtual already_AddRefed CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aFormat) const; - virtual TemporaryRef CreatePathBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const; + virtual already_AddRefed CreatePathBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const; - virtual TemporaryRef + virtual already_AddRefed CreateGradientStops(GradientStop *aStops, uint32_t aNumStops, ExtendMode aExtendMode = ExtendMode::CLAMP) const; - virtual TemporaryRef CreateFilter(FilterType aType); + virtual already_AddRefed CreateFilter(FilterType aType); virtual bool SupportsRegionClipping() const { return false; } @@ -124,10 +124,10 @@ public: bool Init(ID3D11Texture2D* aTexture, SurfaceFormat aFormat); uint32_t GetByteSize() const; - TemporaryRef GetImageForSurface(SourceSurface *aSurface, Matrix &aSourceTransform, + already_AddRefed GetImageForSurface(SourceSurface *aSurface, Matrix &aSourceTransform, ExtendMode aExtendMode, const IntRect* aSourceRect = nullptr); - TemporaryRef GetImageForSurface(SourceSurface *aSurface, ExtendMode aExtendMode) { + already_AddRefed GetImageForSurface(SourceSurface *aSurface, ExtendMode aExtendMode) { Matrix mat; return GetImageForSurface(aSurface, mat, aExtendMode, nullptr); } @@ -171,9 +171,9 @@ private: // represents the intersection of all pixel-aligned rectangular clips that // are currently set. The returned clipped geometry must be clipped by these // bounds to correctly reflect the total clip. This is in device space. - TemporaryRef GetClippedGeometry(IntRect *aClipBounds); + already_AddRefed GetClippedGeometry(IntRect *aClipBounds); - TemporaryRef GetInverseClippedGeometry(); + already_AddRefed GetInverseClippedGeometry(); bool GetDeviceSpaceClipRect(D2D1_RECT_F& aClipRect, bool& aIsPixelAligned); @@ -182,9 +182,9 @@ private: void PushClipsToDC(ID2D1DeviceContext *aDC, bool aForceIgnoreAlpha = false, const D2D1_RECT_F& aMaxRect = D2D1::InfiniteRect()); void PopClipsFromDC(ID2D1DeviceContext *aDC); - TemporaryRef CreateTransparentBlackBrush(); - TemporaryRef GetSolidColorBrush(const D2D_COLOR_F& aColor); - TemporaryRef CreateBrushForPattern(const Pattern &aPattern, Float aAlpha = 1.0f); + already_AddRefed CreateTransparentBlackBrush(); + already_AddRefed GetSolidColorBrush(const D2D_COLOR_F& aColor); + already_AddRefed CreateBrushForPattern(const Pattern &aPattern, Float aAlpha = 1.0f); void PushD2DLayer(ID2D1DeviceContext *aDC, ID2D1Geometry *aGeometry, const D2D1_MATRIX_3X2_F &aTransform, bool aForceIgnoreAlpha = false, const D2D1_RECT_F& aLayerRect = D2D1::InfiniteRect()); diff --git a/gfx/2d/DrawTargetDual.cpp b/gfx/2d/DrawTargetDual.cpp index 86ad04d7f36..d5ed632a280 100644 --- a/gfx/2d/DrawTargetDual.cpp +++ b/gfx/2d/DrawTargetDual.cpp @@ -181,7 +181,7 @@ DrawTargetDual::Mask(const Pattern &aSource, const Pattern &aMask, const DrawOpt mB->Mask(*source.mB, *mask.mB, aOptions); } -TemporaryRef +already_AddRefed DrawTargetDual::CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aFormat) const { RefPtr dtA = mA->CreateSimilarDrawTarget(aSize, aFormat); diff --git a/gfx/2d/DrawTargetDual.h b/gfx/2d/DrawTargetDual.h index 591b7da755f..6c8a05abe5f 100644 --- a/gfx/2d/DrawTargetDual.h +++ b/gfx/2d/DrawTargetDual.h @@ -45,7 +45,7 @@ public: virtual DrawTargetType GetType() const override { return mA->GetType(); } virtual BackendType GetBackendType() const override { return mA->GetBackendType(); } - virtual TemporaryRef Snapshot() override { + virtual already_AddRefed Snapshot() override { return MakeAndAddRef(mA, mB); } virtual IntSize GetSize() override { return mA->GetSize(); } @@ -105,7 +105,7 @@ public: virtual void Mask(const Pattern &aSource, const Pattern &aMask, const DrawOptions &aOptions) override; - virtual TemporaryRef + virtual already_AddRefed CreateSourceSurfaceFromData(unsigned char *aData, const IntSize &aSize, int32_t aStride, @@ -114,26 +114,26 @@ public: return mA->CreateSourceSurfaceFromData(aData, aSize, aStride, aFormat); } - virtual TemporaryRef OptimizeSourceSurface(SourceSurface *aSurface) const override + virtual already_AddRefed OptimizeSourceSurface(SourceSurface *aSurface) const override { return mA->OptimizeSourceSurface(aSurface); } - virtual TemporaryRef + virtual already_AddRefed CreateSourceSurfaceFromNativeSurface(const NativeSurface &aSurface) const override { return mA->CreateSourceSurfaceFromNativeSurface(aSurface); } - virtual TemporaryRef + virtual already_AddRefed CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aFormat) const override; - virtual TemporaryRef CreatePathBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const override + virtual already_AddRefed CreatePathBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const override { return mA->CreatePathBuilder(aFillRule); } - virtual TemporaryRef + virtual already_AddRefed CreateGradientStops(GradientStop *aStops, uint32_t aNumStops, ExtendMode aExtendMode = ExtendMode::CLAMP) const override @@ -141,7 +141,7 @@ public: return mA->CreateGradientStops(aStops, aNumStops, aExtendMode); } - virtual TemporaryRef CreateFilter(FilterType aType) override + virtual already_AddRefed CreateFilter(FilterType aType) override { return mA->CreateFilter(aType); } diff --git a/gfx/2d/DrawTargetRecording.cpp b/gfx/2d/DrawTargetRecording.cpp index b437229fa93..e541e07ef64 100644 --- a/gfx/2d/DrawTargetRecording.cpp +++ b/gfx/2d/DrawTargetRecording.cpp @@ -31,7 +31,7 @@ public: virtual SurfaceType GetType() const { return SurfaceType::RECORDING; } virtual IntSize GetSize() const { return mFinalSurface->GetSize(); } virtual SurfaceFormat GetFormat() const { return mFinalSurface->GetFormat(); } - virtual TemporaryRef GetDataSurface() { return mFinalSurface->GetDataSurface(); } + virtual already_AddRefed GetDataSurface() { return mFinalSurface->GetDataSurface(); } RefPtr mFinalSurface; RefPtr mRecorder; @@ -365,7 +365,7 @@ DrawTargetRecording::Stroke(const Path *aPath, mFinalDT->Stroke(GetPathForPathRecording(aPath), *AdjustedPattern(aPattern), aStrokeOptions, aOptions); } -TemporaryRef +already_AddRefed DrawTargetRecording::Snapshot() { RefPtr surf = mFinalDT->Snapshot(); @@ -410,7 +410,7 @@ DrawTargetRecording::DrawFilter(FilterNode *aNode, mFinalDT->DrawFilter(GetFilterNode(aNode), aSourceRect, aDestPoint, aOptions); } -TemporaryRef +already_AddRefed DrawTargetRecording::CreateFilter(FilterType aType) { RefPtr node = mFinalDT->CreateFilter(aType); @@ -461,7 +461,7 @@ DrawTargetRecording::PopClip() mFinalDT->PopClip(); } -TemporaryRef +already_AddRefed DrawTargetRecording::CreateSourceSurfaceFromData(unsigned char *aData, const IntSize &aSize, int32_t aStride, @@ -476,7 +476,7 @@ DrawTargetRecording::CreateSourceSurfaceFromData(unsigned char *aData, return retSurf.forget(); } -TemporaryRef +already_AddRefed DrawTargetRecording::OptimizeSourceSurface(SourceSurface *aSurface) const { RefPtr surf = mFinalDT->OptimizeSourceSurface(aSurface); @@ -509,7 +509,7 @@ DrawTargetRecording::OptimizeSourceSurface(SourceSurface *aSurface) const return retSurf.forget(); } -TemporaryRef +already_AddRefed DrawTargetRecording::CreateSourceSurfaceFromNativeSurface(const NativeSurface &aSurface) const { RefPtr surf = mFinalDT->CreateSourceSurfaceFromNativeSurface(aSurface); @@ -537,21 +537,21 @@ DrawTargetRecording::CreateSourceSurfaceFromNativeSurface(const NativeSurface &a return retSurf.forget(); } -TemporaryRef +already_AddRefed DrawTargetRecording::CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aFormat) const { RefPtr dt = mFinalDT->CreateSimilarDrawTarget(aSize, aFormat); return MakeAndAddRef(mRecorder.get(), dt); } -TemporaryRef +already_AddRefed DrawTargetRecording::CreatePathBuilder(FillRule aFillRule) const { RefPtr builder = mFinalDT->CreatePathBuilder(aFillRule); return MakeAndAddRef(builder, aFillRule); } -TemporaryRef +already_AddRefed DrawTargetRecording::CreateGradientStops(GradientStop *aStops, uint32_t aNumStops, ExtendMode aExtendMode) const diff --git a/gfx/2d/DrawTargetRecording.h b/gfx/2d/DrawTargetRecording.h index ba89769c24b..0e2b3fee7fd 100644 --- a/gfx/2d/DrawTargetRecording.h +++ b/gfx/2d/DrawTargetRecording.h @@ -22,7 +22,7 @@ public: virtual DrawTargetType GetType() const override { return mFinalDT->GetType(); } virtual BackendType GetBackendType() const override { return mFinalDT->GetBackendType(); } - virtual TemporaryRef Snapshot() override; + virtual already_AddRefed Snapshot() override; virtual IntSize GetSize() override { return mFinalDT->GetSize(); } @@ -210,7 +210,7 @@ public: * * The SourceSurface does not take ownership of aData, and may be freed at any time. */ - virtual TemporaryRef CreateSourceSurfaceFromData(unsigned char *aData, + virtual already_AddRefed CreateSourceSurfaceFromData(unsigned char *aData, const IntSize &aSize, int32_t aStride, SurfaceFormat aFormat) const override; @@ -220,20 +220,20 @@ public: * an arbitrary other SourceSurface. This may return aSourceSurface or some * other existing surface. */ - virtual TemporaryRef OptimizeSourceSurface(SourceSurface *aSurface) const override; + virtual already_AddRefed OptimizeSourceSurface(SourceSurface *aSurface) const override; /* * Create a SourceSurface for a type of NativeSurface. This may fail if the * draw target does not know how to deal with the type of NativeSurface passed * in. */ - virtual TemporaryRef + virtual already_AddRefed CreateSourceSurfaceFromNativeSurface(const NativeSurface &aSurface) const override; /* * Create a DrawTarget whose snapshot is optimized for use with this DrawTarget. */ - virtual TemporaryRef + virtual already_AddRefed CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aFormat) const override; /* @@ -243,7 +243,7 @@ public: * ID2D1SimplifiedGeometrySink requires the fill mode * to be set before calling BeginFigure(). */ - virtual TemporaryRef CreatePathBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const override; + virtual already_AddRefed CreatePathBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const override; /* * Create a GradientStops object that holds information about a set of @@ -255,12 +255,12 @@ public: * aExtendNone This describes how to extend the stop color outside of the * gradient area. */ - virtual TemporaryRef + virtual already_AddRefed CreateGradientStops(GradientStop *aStops, uint32_t aNumStops, ExtendMode aExtendMode = ExtendMode::CLAMP) const override; - virtual TemporaryRef CreateFilter(FilterType aType) override; + virtual already_AddRefed CreateFilter(FilterType aType) override; /* * Set a transform on the surface, this transform is applied at drawing time diff --git a/gfx/2d/DrawTargetSkia.cpp b/gfx/2d/DrawTargetSkia.cpp index 8acad3bbd9e..87da2f0722b 100644 --- a/gfx/2d/DrawTargetSkia.cpp +++ b/gfx/2d/DrawTargetSkia.cpp @@ -134,7 +134,7 @@ DrawTargetSkia::~DrawTargetSkia() { } -TemporaryRef +already_AddRefed DrawTargetSkia::Snapshot() { RefPtr snapshot = mSnapshot; @@ -664,7 +664,7 @@ DrawTargetSkia::MaskSurface(const Pattern &aSource, } } -TemporaryRef +already_AddRefed DrawTargetSkia::CreateSourceSurfaceFromData(unsigned char *aData, const IntSize &aSize, int32_t aStride, @@ -680,7 +680,7 @@ DrawTargetSkia::CreateSourceSurfaceFromData(unsigned char *aData, return newSurf.forget(); } -TemporaryRef +already_AddRefed DrawTargetSkia::CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aFormat) const { RefPtr target = new DrawTargetSkia(); @@ -700,7 +700,7 @@ DrawTargetSkia::UsingSkiaGPU() const #endif } -TemporaryRef +already_AddRefed DrawTargetSkia::OptimizeSourceSurface(SourceSurface *aSurface) const { if (aSurface->GetType() == SurfaceType::SKIA) { @@ -732,7 +732,7 @@ DrawTargetSkia::OptimizeSourceSurface(SourceSurface *aSurface) const return result.forget(); } -TemporaryRef +already_AddRefed DrawTargetSkia::CreateSourceSurfaceFromNativeSurface(const NativeSurface &aSurface) const { if (aSurface.mType == NativeSurfaceType::CAIRO_SURFACE) { @@ -926,7 +926,7 @@ DrawTargetSkia::GetNativeSurface(NativeSurfaceType aType) } -TemporaryRef +already_AddRefed DrawTargetSkia::CreatePathBuilder(FillRule aFillRule) const { return MakeAndAddRef(aFillRule); @@ -972,7 +972,7 @@ DrawTargetSkia::PopClip() mCanvas->restore(); } -TemporaryRef +already_AddRefed DrawTargetSkia::CreateGradientStops(GradientStop *aStops, uint32_t aNumStops, ExtendMode aExtendMode) const { std::vector stops; @@ -985,7 +985,7 @@ DrawTargetSkia::CreateGradientStops(GradientStop *aStops, uint32_t aNumStops, Ex return MakeAndAddRef(stops, aNumStops, aExtendMode); } -TemporaryRef +already_AddRefed DrawTargetSkia::CreateFilter(FilterType aType) { return FilterNodeSoftware::Create(aType); diff --git a/gfx/2d/DrawTargetSkia.h b/gfx/2d/DrawTargetSkia.h index c15a179848b..5f55c02bc7a 100644 --- a/gfx/2d/DrawTargetSkia.h +++ b/gfx/2d/DrawTargetSkia.h @@ -34,7 +34,7 @@ public: virtual DrawTargetType GetType() const override; virtual BackendType GetBackendType() const override { return BackendType::SKIA; } - virtual TemporaryRef Snapshot() override; + virtual already_AddRefed Snapshot() override; virtual IntSize GetSize() override { return mSize; } virtual bool LockBits(uint8_t** aData, IntSize* aSize, int32_t* aStride, SurfaceFormat* aFormat) override; @@ -93,18 +93,18 @@ public: virtual void PushClip(const Path *aPath) override; virtual void PushClipRect(const Rect& aRect) override; virtual void PopClip() override; - virtual TemporaryRef CreateSourceSurfaceFromData(unsigned char *aData, + virtual already_AddRefed CreateSourceSurfaceFromData(unsigned char *aData, const IntSize &aSize, int32_t aStride, SurfaceFormat aFormat) const override; - virtual TemporaryRef OptimizeSourceSurface(SourceSurface *aSurface) const override; - virtual TemporaryRef + virtual already_AddRefed OptimizeSourceSurface(SourceSurface *aSurface) const override; + virtual already_AddRefed CreateSourceSurfaceFromNativeSurface(const NativeSurface &aSurface) const override; - virtual TemporaryRef + virtual already_AddRefed CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aFormat) const override; - virtual TemporaryRef CreatePathBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const override; - virtual TemporaryRef CreateGradientStops(GradientStop *aStops, uint32_t aNumStops, ExtendMode aExtendMode = ExtendMode::CLAMP) const override; - virtual TemporaryRef CreateFilter(FilterType aType) override; + virtual already_AddRefed CreatePathBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const override; + virtual already_AddRefed CreateGradientStops(GradientStop *aStops, uint32_t aNumStops, ExtendMode aExtendMode = ExtendMode::CLAMP) const override; + virtual already_AddRefed CreateFilter(FilterType aType) override; virtual void SetTransform(const Matrix &aTransform) override; virtual void *GetNativeSurface(NativeSurfaceType aType) override; diff --git a/gfx/2d/DrawTargetTiled.cpp b/gfx/2d/DrawTargetTiled.cpp index 8c523a39685..31717577bd7 100644 --- a/gfx/2d/DrawTargetTiled.cpp +++ b/gfx/2d/DrawTargetTiled.cpp @@ -48,7 +48,7 @@ DrawTargetTiled::Init(const TileSet& aTiles) return true; } -TemporaryRef +already_AddRefed DrawTargetTiled::Snapshot() { return MakeAndAddRef(mTiles, mRect); diff --git a/gfx/2d/DrawTargetTiled.h b/gfx/2d/DrawTargetTiled.h index 934237632ce..aa9af05f16b 100644 --- a/gfx/2d/DrawTargetTiled.h +++ b/gfx/2d/DrawTargetTiled.h @@ -40,7 +40,7 @@ public: virtual DrawTargetType GetType() const override { return mTiles[0].mDrawTarget->GetType(); } virtual BackendType GetBackendType() const override { return mTiles[0].mDrawTarget->GetBackendType(); } - virtual TemporaryRef Snapshot() override; + virtual already_AddRefed Snapshot() override; virtual IntSize GetSize() override { MOZ_ASSERT(mRect.width > 0 && mRect.height > 0); return IntSize(mRect.XMost(), mRect.YMost()); @@ -106,43 +106,43 @@ public: virtual void SetTransform(const Matrix &aTransform) override; - virtual TemporaryRef CreateSourceSurfaceFromData(unsigned char *aData, + virtual already_AddRefed CreateSourceSurfaceFromData(unsigned char *aData, const IntSize &aSize, int32_t aStride, SurfaceFormat aFormat) const override { return mTiles[0].mDrawTarget->CreateSourceSurfaceFromData(aData, aSize, aStride, aFormat); } - virtual TemporaryRef OptimizeSourceSurface(SourceSurface *aSurface) const override + virtual already_AddRefed OptimizeSourceSurface(SourceSurface *aSurface) const override { return mTiles[0].mDrawTarget->OptimizeSourceSurface(aSurface); } - virtual TemporaryRef + virtual already_AddRefed CreateSourceSurfaceFromNativeSurface(const NativeSurface &aSurface) const override { return mTiles[0].mDrawTarget->CreateSourceSurfaceFromNativeSurface(aSurface); } - virtual TemporaryRef + virtual already_AddRefed CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aFormat) const override { return mTiles[0].mDrawTarget->CreateSimilarDrawTarget(aSize, aFormat); } - virtual TemporaryRef CreatePathBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const override + virtual already_AddRefed CreatePathBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const override { return mTiles[0].mDrawTarget->CreatePathBuilder(aFillRule); } - virtual TemporaryRef + virtual already_AddRefed CreateGradientStops(GradientStop *aStops, uint32_t aNumStops, ExtendMode aExtendMode = ExtendMode::CLAMP) const override { return mTiles[0].mDrawTarget->CreateGradientStops(aStops, aNumStops, aExtendMode); } - virtual TemporaryRef CreateFilter(FilterType aType) override + virtual already_AddRefed CreateFilter(FilterType aType) override { return mTiles[0].mDrawTarget->CreateFilter(aType); } @@ -172,7 +172,7 @@ public: } virtual SurfaceFormat GetFormat() const { return mSnapshots[0]->GetFormat(); } - virtual TemporaryRef GetDataSurface() + virtual already_AddRefed GetDataSurface() { RefPtr surf = Factory::CreateDataSourceSurface(GetSize(), GetFormat()); diff --git a/gfx/2d/Factory.cpp b/gfx/2d/Factory.cpp index f439d842fb6..d9098235e01 100644 --- a/gfx/2d/Factory.cpp +++ b/gfx/2d/Factory.cpp @@ -268,7 +268,7 @@ Factory::CheckSurfaceSize(const IntSize &sz, int32_t limit) return true; } -TemporaryRef +already_AddRefed Factory::CreateDrawTarget(BackendType aBackend, const IntSize &aSize, SurfaceFormat aFormat) { if (!CheckSurfaceSize(aSize)) { @@ -348,13 +348,13 @@ Factory::CreateDrawTarget(BackendType aBackend, const IntSize &aSize, SurfaceFor return retVal.forget(); } -TemporaryRef +already_AddRefed Factory::CreateRecordingDrawTarget(DrawEventRecorder *aRecorder, DrawTarget *aDT) { return MakeAndAddRef(aRecorder, aDT); } -TemporaryRef +already_AddRefed Factory::CreateDrawTargetForData(BackendType aBackend, unsigned char *aData, const IntSize &aSize, @@ -416,7 +416,7 @@ Factory::CreateDrawTargetForData(BackendType aBackend, return retVal.forget(); } -TemporaryRef +already_AddRefed Factory::CreateTiledDrawTarget(const TileSet& aTileSet) { RefPtr dt = new DrawTargetTiled(); @@ -471,7 +471,7 @@ Factory::GetMaxSurfaceSize(BackendType aType) } } -TemporaryRef +already_AddRefed Factory::CreateScaledFontForNativeFont(const NativeFont &aNativeFont, Float aSize) { switch (aNativeFont.mType) { @@ -505,7 +505,7 @@ Factory::CreateScaledFontForNativeFont(const NativeFont &aNativeFont, Float aSiz } } -TemporaryRef +already_AddRefed Factory::CreateScaledFontForTrueTypeData(uint8_t *aData, uint32_t aSize, uint32_t aFaceIndex, Float aGlyphSize, FontType aType) @@ -523,7 +523,7 @@ Factory::CreateScaledFontForTrueTypeData(uint8_t *aData, uint32_t aSize, } } -TemporaryRef +already_AddRefed Factory::CreateScaledFontWithCairo(const NativeFont& aNativeFont, Float aSize, cairo_scaled_font_t* aScaledFont) { #ifdef USE_CAIRO @@ -539,7 +539,7 @@ Factory::CreateScaledFontWithCairo(const NativeFont& aNativeFont, Float aSize, c #endif } -TemporaryRef +already_AddRefed Factory::CreateDualDrawTarget(DrawTarget *targetA, DrawTarget *targetB) { MOZ_ASSERT(targetA && targetB); @@ -558,7 +558,7 @@ Factory::CreateDualDrawTarget(DrawTarget *targetA, DrawTarget *targetB) #ifdef WIN32 -TemporaryRef +already_AddRefed Factory::CreateDrawTargetForD3D10Texture(ID3D10Texture2D *aTexture, SurfaceFormat aFormat) { MOZ_ASSERT(aTexture); @@ -582,7 +582,7 @@ Factory::CreateDrawTargetForD3D10Texture(ID3D10Texture2D *aTexture, SurfaceForma return nullptr; } -TemporaryRef +already_AddRefed Factory::CreateDualDrawTargetForD3D10Textures(ID3D10Texture2D *aTextureA, ID3D10Texture2D *aTextureB, SurfaceFormat aFormat) @@ -637,7 +637,7 @@ Factory::GetDirect3D10Device() return mD3D10Device; } -TemporaryRef +already_AddRefed Factory::CreateDrawTargetForD3D11Texture(ID3D11Texture2D *aTexture, SurfaceFormat aFormat) { MOZ_ASSERT(aTexture); @@ -703,7 +703,7 @@ Factory::SupportsD2D1() return !!D2DFactory1(); } -TemporaryRef +already_AddRefed Factory::CreateDWriteGlyphRenderingOptions(IDWriteRenderingParams *aParams) { return MakeAndAddRef(aParams); @@ -735,7 +735,7 @@ Factory::D2DCleanup() #endif // XP_WIN #ifdef USE_SKIA_GPU -TemporaryRef +already_AddRefed Factory::CreateDrawTargetSkiaWithGrContext(GrContext* aGrContext, const IntSize &aSize, SurfaceFormat aFormat) @@ -755,7 +755,7 @@ Factory::PurgeAllCaches() } #ifdef USE_SKIA_FREETYPE -TemporaryRef +already_AddRefed Factory::CreateCairoGlyphRenderingOptions(FontHinting aHinting, bool aAutoHinting) { RefPtr options = @@ -767,7 +767,7 @@ Factory::CreateCairoGlyphRenderingOptions(FontHinting aHinting, bool aAutoHintin } #endif -TemporaryRef +already_AddRefed Factory::CreateDrawTargetForCairoSurface(cairo_surface_t* aSurface, const IntSize& aSize, SurfaceFormat* aFormat) { RefPtr retVal; @@ -787,7 +787,7 @@ Factory::CreateDrawTargetForCairoSurface(cairo_surface_t* aSurface, const IntSiz } #ifdef XP_MACOSX -TemporaryRef +already_AddRefed Factory::CreateDrawTargetForCairoCGContext(CGContextRef cg, const IntSize& aSize) { RefPtr retVal; @@ -804,14 +804,14 @@ Factory::CreateDrawTargetForCairoCGContext(CGContextRef cg, const IntSize& aSize return retVal.forget(); } -TemporaryRef +already_AddRefed Factory::CreateCGGlyphRenderingOptions(const Color &aFontSmoothingBackgroundColor) { return MakeAndAddRef(aFontSmoothingBackgroundColor); } #endif -TemporaryRef +already_AddRefed Factory::CreateWrappingDataSourceSurface(uint8_t *aData, int32_t aStride, const IntSize &aSize, SurfaceFormat aFormat) @@ -830,7 +830,7 @@ Factory::CreateWrappingDataSourceSurface(uint8_t *aData, int32_t aStride, return nullptr; } -TemporaryRef +already_AddRefed Factory::CreateDataSourceSurface(const IntSize &aSize, SurfaceFormat aFormat, bool aZero) @@ -849,7 +849,7 @@ Factory::CreateDataSourceSurface(const IntSize &aSize, return nullptr; } -TemporaryRef +already_AddRefed Factory::CreateDataSourceSurfaceWithStride(const IntSize &aSize, SurfaceFormat aFormat, int32_t aStride, @@ -869,7 +869,7 @@ Factory::CreateDataSourceSurfaceWithStride(const IntSize &aSize, return nullptr; } -TemporaryRef +already_AddRefed Factory::CreateEventRecorderForFile(const char *aFilename) { return MakeAndAddRef(aFilename); diff --git a/gfx/2d/FilterNodeD2D1.cpp b/gfx/2d/FilterNodeD2D1.cpp index 3d3ca4c3c6c..364460a06fe 100644 --- a/gfx/2d/FilterNodeD2D1.cpp +++ b/gfx/2d/FilterNodeD2D1.cpp @@ -150,7 +150,7 @@ D2D1_CHANNEL_SELECTOR D2DChannelSelector(uint32_t aMode) return D2D1_CHANNEL_SELECTOR_R; } -TemporaryRef GetImageForSourceSurface(DrawTarget *aDT, SourceSurface *aSurface) +already_AddRefed GetImageForSourceSurface(DrawTarget *aDT, SourceSurface *aSurface) { if (aDT->IsTiledDrawTarget() || aDT->IsDualDrawTarget()) { MOZ_CRASH("Incompatible draw target type!"); @@ -537,7 +537,7 @@ IsTransferFilterType(FilterType aType) } /* static */ -TemporaryRef +already_AddRefed FilterNodeD2D1::Create(ID2D1DeviceContext *aDC, FilterType aType) { if (aType == FilterType::CONVOLVE_MATRIX) { diff --git a/gfx/2d/FilterNodeD2D1.h b/gfx/2d/FilterNodeD2D1.h index 612dbfbef77..1f06dda6f52 100644 --- a/gfx/2d/FilterNodeD2D1.h +++ b/gfx/2d/FilterNodeD2D1.h @@ -19,7 +19,7 @@ class FilterNodeD2D1 : public FilterNode { public: MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeD2D1) - static TemporaryRef Create(ID2D1DeviceContext *aDC, FilterType aType); + static already_AddRefed Create(ID2D1DeviceContext *aDC, FilterType aType); FilterNodeD2D1(ID2D1Effect *aEffect, FilterType aType) : mEffect(aEffect) diff --git a/gfx/2d/FilterNodeSoftware.cpp b/gfx/2d/FilterNodeSoftware.cpp index 6b8611b84e4..bec1ad9648a 100644 --- a/gfx/2d/FilterNodeSoftware.cpp +++ b/gfx/2d/FilterNodeSoftware.cpp @@ -180,7 +180,7 @@ NS_lround(double x) return x >= 0.0 ? int32_t(x + 0.5) : int32_t(x - 0.5); } -TemporaryRef +already_AddRefed CloneAligned(DataSourceSurface* aSource) { return CreateDataSourceSurfaceByCloning(aSource); @@ -393,7 +393,7 @@ TileSurface(DataSourceSurface* aSource, DataSourceSurface* aTarget, const IntPoi } } -static TemporaryRef +static already_AddRefed GetDataSurfaceInRect(SourceSurface *aSurface, const IntRect &aSurfaceRect, const IntRect &aDestRect, @@ -446,7 +446,7 @@ GetDataSurfaceInRect(SourceSurface *aSurface, return target.forget(); } -/* static */ TemporaryRef +/* static */ already_AddRefed FilterNodeSoftware::Create(FilterType aType) { RefPtr filter; @@ -601,7 +601,7 @@ FilterNodeSoftware::Draw(DrawTarget* aDrawTarget, } } -TemporaryRef +already_AddRefed FilterNodeSoftware::GetOutput(const IntRect &aRect) { MOZ_ASSERT(GetOutputRectInRect(aRect).Contains(aRect)); @@ -662,7 +662,7 @@ FilterNodeSoftware::DesiredFormat(SurfaceFormat aCurrentFormat, return SurfaceFormat::B8G8R8A8; } -TemporaryRef +already_AddRefed FilterNodeSoftware::GetInputDataSourceSurface(uint32_t aInputEnumIndex, const IntRect& aRect, FormatHint aFormatHint, @@ -961,7 +961,7 @@ static CompositionOp ToBlendOp(BlendMode aOp) return CompositionOp::OP_OVER; } -TemporaryRef +already_AddRefed FilterNodeBlendSoftware::Render(const IntRect& aRect) { RefPtr input1 = @@ -1086,7 +1086,7 @@ FilterNodeTransformSoftware::SourceRectForOutputRect(const IntRect &aRect) return GetInputRectInRect(IN_TRANSFORM_IN, neededIntRect); } -TemporaryRef +already_AddRefed FilterNodeTransformSoftware::Render(const IntRect& aRect) { IntRect srcRect = SourceRectForOutputRect(aRect); @@ -1192,7 +1192,7 @@ FilterNodeMorphologySoftware::SetAttribute(uint32_t aIndex, Invalidate(); } -static TemporaryRef +static already_AddRefed ApplyMorphology(const IntRect& aSourceRect, DataSourceSurface* aInput, const IntRect& aDestRect, int32_t rx, int32_t ry, MorphologyOperator aOperator) @@ -1256,7 +1256,7 @@ ApplyMorphology(const IntRect& aSourceRect, DataSourceSurface* aInput, return dest.forget(); } -TemporaryRef +already_AddRefed FilterNodeMorphologySoftware::Render(const IntRect& aRect) { IntRect srcRect = aRect; @@ -1327,7 +1327,7 @@ FilterNodeColorMatrixSoftware::SetAttribute(uint32_t aIndex, Invalidate(); } -static TemporaryRef +static already_AddRefed Premultiply(DataSourceSurface* aSurface) { if (aSurface->GetFormat() == SurfaceFormat::A8) { @@ -1359,7 +1359,7 @@ Premultiply(DataSourceSurface* aSurface) return target.forget(); } -static TemporaryRef +static already_AddRefed Unpremultiply(DataSourceSurface* aSurface) { if (aSurface->GetFormat() == SurfaceFormat::A8) { @@ -1391,7 +1391,7 @@ Unpremultiply(DataSourceSurface* aSurface) return target.forget(); } -TemporaryRef +already_AddRefed FilterNodeColorMatrixSoftware::Render(const IntRect& aRect) { RefPtr input = @@ -1460,7 +1460,7 @@ FormatForColor(Color aColor) return SurfaceFormat::B8G8R8A8; } -TemporaryRef +already_AddRefed FilterNodeFloodSoftware::Render(const IntRect& aRect) { SurfaceFormat format = FormatForColor(mColor); @@ -1503,7 +1503,7 @@ FilterNodeFloodSoftware::Render(const IntRect& aRect) // Override GetOutput to get around caching. Rendering simple floods is // comparatively fast. -TemporaryRef +already_AddRefed FilterNodeFloodSoftware::GetOutput(const IntRect& aRect) { return Render(aRect); @@ -1556,7 +1556,7 @@ struct CompareIntRects }; } -TemporaryRef +already_AddRefed FilterNodeTileSoftware::Render(const IntRect& aRect) { if (mSourceRect.IsEmpty()) { @@ -1728,7 +1728,7 @@ IsAllZero(uint8_t aLookupTable[256]) return true; } -TemporaryRef +already_AddRefed FilterNodeComponentTransferSoftware::Render(const IntRect& aRect) { if (mDisableR && mDisableG && mDisableB && mDisableA) { @@ -2342,7 +2342,7 @@ ConvolvePixel(const uint8_t *aSourceData, } } -TemporaryRef +already_AddRefed FilterNodeConvolveMatrixSoftware::Render(const IntRect& aRect) { if (mKernelUnitLength.width == floor(mKernelUnitLength.width) && @@ -2409,7 +2409,7 @@ TranslateDoubleToShifts(double aDouble, int32_t &aShiftL, int32_t &aShiftR) } template -TemporaryRef +already_AddRefed FilterNodeConvolveMatrixSoftware::DoRender(const IntRect& aRect, CoordType aKernelUnitLengthX, CoordType aKernelUnitLengthY) @@ -2580,7 +2580,7 @@ FilterNodeDisplacementMapSoftware::SetAttribute(uint32_t aIndex, uint32_t aValue Invalidate(); } -TemporaryRef +already_AddRefed FilterNodeDisplacementMapSoftware::Render(const IntRect& aRect) { IntRect srcRect = InflatedSourceOrDestRect(aRect); @@ -2729,7 +2729,7 @@ FilterNodeTurbulenceSoftware::SetAttribute(uint32_t aIndex, uint32_t aValue) Invalidate(); } -TemporaryRef +already_AddRefed FilterNodeTurbulenceSoftware::Render(const IntRect& aRect) { return FilterProcessing::RenderTurbulence( @@ -2774,7 +2774,7 @@ FilterNodeArithmeticCombineSoftware::SetAttribute(uint32_t aIndex, Invalidate(); } -TemporaryRef +already_AddRefed FilterNodeArithmeticCombineSoftware::Render(const IntRect& aRect) { RefPtr input1 = @@ -2848,7 +2848,7 @@ FilterNodeCompositeSoftware::SetAttribute(uint32_t aIndex, uint32_t aCompositeOp Invalidate(); } -TemporaryRef +already_AddRefed FilterNodeCompositeSoftware::Render(const IntRect& aRect) { RefPtr start = @@ -2924,7 +2924,7 @@ FilterNodeBlurXYSoftware::InputIndex(uint32_t aInputEnumIndex) } } -TemporaryRef +already_AddRefed FilterNodeBlurXYSoftware::Render(const IntRect& aRect) { Size sigmaXY = StdDeviationXY(); @@ -3102,7 +3102,7 @@ FilterNodeCropSoftware::SetAttribute(uint32_t aIndex, Invalidate(); } -TemporaryRef +already_AddRefed FilterNodeCropSoftware::Render(const IntRect& aRect) { return GetInputDataSourceSurface(IN_CROP_IN, aRect.Intersect(mCropRect)); @@ -3129,7 +3129,7 @@ FilterNodePremultiplySoftware::InputIndex(uint32_t aInputEnumIndex) } } -TemporaryRef +already_AddRefed FilterNodePremultiplySoftware::Render(const IntRect& aRect) { RefPtr input = @@ -3158,7 +3158,7 @@ FilterNodeUnpremultiplySoftware::InputIndex(uint32_t aInputEnumIndex) } } -TemporaryRef +already_AddRefed FilterNodeUnpremultiplySoftware::Render(const IntRect& aRect) { RefPtr input = @@ -3438,7 +3438,7 @@ GenerateNormal(const uint8_t *data, int32_t stride, } template -TemporaryRef +already_AddRefed FilterNodeLightingSoftware::Render(const IntRect& aRect) { if (mKernelUnitLength.width == floor(mKernelUnitLength.width) && @@ -3459,7 +3459,7 @@ FilterNodeLightingSoftware::RequestFromInputsForRect(co } template template -TemporaryRef +already_AddRefed FilterNodeLightingSoftware::DoRender(const IntRect& aRect, CoordType aKernelUnitLengthX, CoordType aKernelUnitLengthY) diff --git a/gfx/2d/FilterNodeSoftware.h b/gfx/2d/FilterNodeSoftware.h index dfef8ba0170..74a6026998d 100644 --- a/gfx/2d/FilterNodeSoftware.h +++ b/gfx/2d/FilterNodeSoftware.h @@ -42,7 +42,7 @@ public: virtual ~FilterNodeSoftware(); // Factory method, intended to be called from DrawTarget*::CreateFilter. - static TemporaryRef Create(FilterType aType); + static already_AddRefed Create(FilterType aType); // Draw the filter, intended to be called by DrawTarget*::DrawFilter. void Draw(DrawTarget* aDrawTarget, const Rect &aSourceRect, @@ -90,7 +90,7 @@ protected: * pass through input surfaces unchanged. * Callers need to treat the returned surface as immutable. */ - virtual TemporaryRef Render(const IntRect& aRect) = 0; + virtual already_AddRefed Render(const IntRect& aRect) = 0; /** * Call RequestRect (see below) on any input filters with the desired input @@ -104,7 +104,7 @@ protected: * by subclasses that don't want to cache their output. Those classes should * call Render(aRect) directly from here. */ - virtual TemporaryRef GetOutput(const IntRect &aRect); + virtual already_AddRefed GetOutput(const IntRect &aRect); // The following methods are non-virtual helper methods. @@ -139,7 +139,7 @@ protected: * surface is guaranteed to be of SurfaceFormat::B8G8R8A8 always. * Each pixel row of the returned surface is guaranteed to be 16-byte aligned. */ - TemporaryRef + already_AddRefed GetInputDataSourceSurface(uint32_t aInputEnumIndex, const IntRect& aRect, FormatHint aFormatHint = CAN_HANDLE_A8, ConvolveMatrixEdgeMode aEdgeMode = EDGE_MODE_NONE, @@ -226,7 +226,7 @@ public: virtual void SetAttribute(uint32_t aIndex, const Matrix &aMatrix) override; protected: - virtual TemporaryRef Render(const IntRect& aRect) override; + virtual already_AddRefed Render(const IntRect& aRect) override; virtual IntRect GetOutputRectInRect(const IntRect& aRect) override; virtual int32_t InputIndex(uint32_t aInputEnumIndex) override; virtual void RequestFromInputsForRect(const IntRect &aRect) override; @@ -247,7 +247,7 @@ public: virtual void SetAttribute(uint32_t aIndex, uint32_t aBlendMode) override; protected: - virtual TemporaryRef Render(const IntRect& aRect) override; + virtual already_AddRefed Render(const IntRect& aRect) override; virtual IntRect GetOutputRectInRect(const IntRect& aRect) override; virtual int32_t InputIndex(uint32_t aInputEnumIndex) override; virtual void RequestFromInputsForRect(const IntRect &aRect) override; @@ -267,7 +267,7 @@ public: virtual void SetAttribute(uint32_t aIndex, uint32_t aOperator) override; protected: - virtual TemporaryRef Render(const IntRect& aRect) override; + virtual already_AddRefed Render(const IntRect& aRect) override; virtual IntRect GetOutputRectInRect(const IntRect& aRect) override; virtual int32_t InputIndex(uint32_t aInputEnumIndex) override; virtual void RequestFromInputsForRect(const IntRect &aRect) override; @@ -287,7 +287,7 @@ public: virtual void SetAttribute(uint32_t aIndex, uint32_t aAlphaMode) override; protected: - virtual TemporaryRef Render(const IntRect& aRect) override; + virtual already_AddRefed Render(const IntRect& aRect) override; virtual IntRect GetOutputRectInRect(const IntRect& aRect) override; virtual int32_t InputIndex(uint32_t aInputEnumIndex) override; virtual void RequestFromInputsForRect(const IntRect &aRect) override; @@ -306,8 +306,8 @@ public: virtual void SetAttribute(uint32_t aIndex, const Color &aColor) override; protected: - virtual TemporaryRef GetOutput(const IntRect &aRect) override; - virtual TemporaryRef Render(const IntRect& aRect) override; + virtual already_AddRefed GetOutput(const IntRect &aRect) override; + virtual already_AddRefed Render(const IntRect& aRect) override; virtual IntRect GetOutputRectInRect(const IntRect& aRect) override; private: @@ -323,7 +323,7 @@ public: virtual void SetAttribute(uint32_t aIndex, const IntRect &aSourceRect) override; protected: - virtual TemporaryRef Render(const IntRect& aRect) override; + virtual already_AddRefed Render(const IntRect& aRect) override; virtual IntRect GetOutputRectInRect(const IntRect& aRect) override; virtual int32_t InputIndex(uint32_t aInputEnumIndex) override; virtual void RequestFromInputsForRect(const IntRect &aRect) override; @@ -345,7 +345,7 @@ public: virtual void SetAttribute(uint32_t aIndex, bool aDisable) override; protected: - virtual TemporaryRef Render(const IntRect& aRect) override; + virtual already_AddRefed Render(const IntRect& aRect) override; virtual IntRect GetOutputRectInRect(const IntRect& aRect) override; virtual int32_t InputIndex(uint32_t aInputEnumIndex) override; virtual void RequestFromInputsForRect(const IntRect &aRect) override; @@ -470,14 +470,14 @@ public: virtual void SetAttribute(uint32_t aIndex, bool aPreserveAlpha) override; protected: - virtual TemporaryRef Render(const IntRect& aRect) override; + virtual already_AddRefed Render(const IntRect& aRect) override; virtual IntRect GetOutputRectInRect(const IntRect& aRect) override; virtual int32_t InputIndex(uint32_t aInputEnumIndex) override; virtual void RequestFromInputsForRect(const IntRect &aRect) override; private: template - TemporaryRef DoRender(const IntRect& aRect, + already_AddRefed DoRender(const IntRect& aRect, CoordType aKernelUnitLengthX, CoordType aKernelUnitLengthY); @@ -506,7 +506,7 @@ public: virtual void SetAttribute(uint32_t aIndex, uint32_t aValue) override; protected: - virtual TemporaryRef Render(const IntRect& aRect) override; + virtual already_AddRefed Render(const IntRect& aRect) override; virtual IntRect GetOutputRectInRect(const IntRect& aRect) override; virtual int32_t InputIndex(uint32_t aInputEnumIndex) override; virtual void RequestFromInputsForRect(const IntRect &aRect) override; @@ -532,7 +532,7 @@ public: virtual void SetAttribute(uint32_t aIndex, uint32_t aValue) override; protected: - virtual TemporaryRef Render(const IntRect& aRect) override; + virtual already_AddRefed Render(const IntRect& aRect) override; virtual IntRect GetOutputRectInRect(const IntRect& aRect) override; virtual int32_t InputIndex(uint32_t aInputEnumIndex) override; @@ -555,7 +555,7 @@ public: virtual void SetAttribute(uint32_t aIndex, const Float* aFloat, uint32_t aSize) override; protected: - virtual TemporaryRef Render(const IntRect& aRect) override; + virtual already_AddRefed Render(const IntRect& aRect) override; virtual IntRect GetOutputRectInRect(const IntRect& aRect) override; virtual int32_t InputIndex(uint32_t aInputEnumIndex) override; virtual void RequestFromInputsForRect(const IntRect &aRect) override; @@ -577,7 +577,7 @@ public: virtual void SetAttribute(uint32_t aIndex, uint32_t aOperator) override; protected: - virtual TemporaryRef Render(const IntRect& aRect) override; + virtual already_AddRefed Render(const IntRect& aRect) override; virtual IntRect GetOutputRectInRect(const IntRect& aRect) override; virtual int32_t InputIndex(uint32_t aInputEnumIndex) override; virtual void RequestFromInputsForRect(const IntRect &aRect) override; @@ -593,7 +593,7 @@ class FilterNodeBlurXYSoftware : public FilterNodeSoftware public: MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeBlurXYSoftware, override) protected: - virtual TemporaryRef Render(const IntRect& aRect) override; + virtual already_AddRefed Render(const IntRect& aRect) override; virtual IntRect GetOutputRectInRect(const IntRect& aRect) override; virtual int32_t InputIndex(uint32_t aInputEnumIndex) override; IntRect InflatedSourceOrDestRect(const IntRect &aDestRect); @@ -646,7 +646,7 @@ public: virtual void SetAttribute(uint32_t aIndex, const Rect &aSourceRect) override; protected: - virtual TemporaryRef Render(const IntRect& aRect) override; + virtual already_AddRefed Render(const IntRect& aRect) override; virtual IntRect GetOutputRectInRect(const IntRect& aRect) override; virtual int32_t InputIndex(uint32_t aInputEnumIndex) override; virtual void RequestFromInputsForRect(const IntRect &aRect) override; @@ -661,7 +661,7 @@ public: MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodePremultiplySoftware, override) virtual const char* GetName() override { return "Premultiply"; } protected: - virtual TemporaryRef Render(const IntRect& aRect) override; + virtual already_AddRefed Render(const IntRect& aRect) override; virtual IntRect GetOutputRectInRect(const IntRect& aRect) override; virtual int32_t InputIndex(uint32_t aInputEnumIndex) override; virtual void RequestFromInputsForRect(const IntRect &aRect) override; @@ -673,7 +673,7 @@ public: MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeUnpremultiplySoftware, override) virtual const char* GetName() override { return "Unpremultiply"; } protected: - virtual TemporaryRef Render(const IntRect& aRect) override; + virtual already_AddRefed Render(const IntRect& aRect) override; virtual IntRect GetOutputRectInRect(const IntRect& aRect) override; virtual int32_t InputIndex(uint32_t aInputEnumIndex) override; virtual void RequestFromInputsForRect(const IntRect &aRect) override; @@ -697,14 +697,14 @@ public: virtual void SetAttribute(uint32_t aIndex, const Color &) override; protected: - virtual TemporaryRef Render(const IntRect& aRect) override; + virtual already_AddRefed Render(const IntRect& aRect) override; virtual IntRect GetOutputRectInRect(const IntRect& aRect) override; virtual int32_t InputIndex(uint32_t aInputEnumIndex) override; virtual void RequestFromInputsForRect(const IntRect &aRect) override; private: template - TemporaryRef DoRender(const IntRect& aRect, + already_AddRefed DoRender(const IntRect& aRect, CoordType aKernelUnitLengthX, CoordType aKernelUnitLengthY); diff --git a/gfx/2d/FilterProcessing.cpp b/gfx/2d/FilterProcessing.cpp index 5d03f2da214..da734c01a63 100644 --- a/gfx/2d/FilterProcessing.cpp +++ b/gfx/2d/FilterProcessing.cpp @@ -9,7 +9,7 @@ namespace mozilla { namespace gfx { -TemporaryRef +already_AddRefed FilterProcessing::ExtractAlpha(DataSourceSurface* aSource) { IntSize size = aSource->GetSize(); @@ -40,7 +40,7 @@ FilterProcessing::ExtractAlpha(DataSourceSurface* aSource) return alpha.forget(); } -TemporaryRef +already_AddRefed FilterProcessing::ConvertToB8G8R8A8(SourceSurface* aSurface) { if (Factory::HasSSE2()) { @@ -51,7 +51,7 @@ FilterProcessing::ConvertToB8G8R8A8(SourceSurface* aSurface) return ConvertToB8G8R8A8_Scalar(aSurface); } -TemporaryRef +already_AddRefed FilterProcessing::ApplyBlending(DataSourceSurface* aInput1, DataSourceSurface* aInput2, BlendMode aBlendMode) { @@ -97,7 +97,7 @@ FilterProcessing::ApplyMorphologyVertical(uint8_t* aSourceData, int32_t aSourceS } } -TemporaryRef +already_AddRefed FilterProcessing::ApplyColorMatrix(DataSourceSurface* aInput, const Matrix5x4 &aMatrix) { if (Factory::HasSSE2()) { @@ -164,7 +164,7 @@ FilterProcessing::SeparateColorChannels(DataSourceSurface* aSource, } } -TemporaryRef +already_AddRefed FilterProcessing::CombineColorChannels(DataSourceSurface* aChannel0, DataSourceSurface* aChannel1, DataSourceSurface* aChannel2, DataSourceSurface* aChannel3) { @@ -235,7 +235,7 @@ FilterProcessing::DoUnpremultiplicationCalculation(const IntSize& aSize, } } -TemporaryRef +already_AddRefed FilterProcessing::RenderTurbulence(const IntSize &aSize, const Point &aOffset, const Size &aBaseFrequency, int32_t aSeed, int aNumOctaves, TurbulenceType aType, bool aStitch, const Rect &aTileRect) { @@ -247,7 +247,7 @@ FilterProcessing::RenderTurbulence(const IntSize &aSize, const Point &aOffset, c return RenderTurbulence_Scalar(aSize, aOffset, aBaseFrequency, aSeed, aNumOctaves, aType, aStitch, aTileRect); } -TemporaryRef +already_AddRefed FilterProcessing::ApplyArithmeticCombine(DataSourceSurface* aInput1, DataSourceSurface* aInput2, Float aK1, Float aK2, Float aK3, Float aK4) { if (Factory::HasSSE2()) { diff --git a/gfx/2d/FilterProcessing.h b/gfx/2d/FilterProcessing.h index 253d16543af..802d791a07a 100644 --- a/gfx/2d/FilterProcessing.h +++ b/gfx/2d/FilterProcessing.h @@ -31,9 +31,9 @@ public: return ((v << 8) + v + 255) >> 16; } - static TemporaryRef ExtractAlpha(DataSourceSurface* aSource); - static TemporaryRef ConvertToB8G8R8A8(SourceSurface* aSurface); - static TemporaryRef ApplyBlending(DataSourceSurface* aInput1, DataSourceSurface* aInput2, BlendMode aBlendMode); + static already_AddRefed ExtractAlpha(DataSourceSurface* aSource); + static already_AddRefed ConvertToB8G8R8A8(SourceSurface* aSurface); + static already_AddRefed ApplyBlending(DataSourceSurface* aInput1, DataSourceSurface* aInput2, BlendMode aBlendMode); static void ApplyMorphologyHorizontal(uint8_t* aSourceData, int32_t aSourceStride, uint8_t* aDestData, int32_t aDestStride, const IntRect& aDestRect, int32_t aRadius, @@ -42,14 +42,14 @@ public: uint8_t* aDestData, int32_t aDestStride, const IntRect& aDestRect, int32_t aRadius, MorphologyOperator aOperator); - static TemporaryRef ApplyColorMatrix(DataSourceSurface* aInput, const Matrix5x4 &aMatrix); + static already_AddRefed ApplyColorMatrix(DataSourceSurface* aInput, const Matrix5x4 &aMatrix); static void ApplyComposition(DataSourceSurface* aSource, DataSourceSurface* aDest, CompositeOperator aOperator); static void SeparateColorChannels(DataSourceSurface* aSource, RefPtr& aChannel0, RefPtr& aChannel1, RefPtr& aChannel2, RefPtr& aChannel3); - static TemporaryRef + static already_AddRefed CombineColorChannels(DataSourceSurface* aChannel0, DataSourceSurface* aChannel1, DataSourceSurface* aChannel2, DataSourceSurface* aChannel3); static void DoPremultiplicationCalculation(const IntSize& aSize, @@ -58,15 +58,15 @@ public: static void DoUnpremultiplicationCalculation(const IntSize& aSize, uint8_t* aTargetData, int32_t aTargetStride, uint8_t* aSourceData, int32_t aSourceStride); - static TemporaryRef + static already_AddRefed RenderTurbulence(const IntSize &aSize, const Point &aOffset, const Size &aBaseFrequency, int32_t aSeed, int aNumOctaves, TurbulenceType aType, bool aStitch, const Rect &aTileRect); - static TemporaryRef + static already_AddRefed ApplyArithmeticCombine(DataSourceSurface* aInput1, DataSourceSurface* aInput2, Float aK1, Float aK2, Float aK3, Float aK4); protected: static void ExtractAlpha_Scalar(const IntSize& size, uint8_t* sourceData, int32_t sourceStride, uint8_t* alphaData, int32_t alphaStride); - static TemporaryRef ConvertToB8G8R8A8_Scalar(SourceSurface* aSurface); + static already_AddRefed ConvertToB8G8R8A8_Scalar(SourceSurface* aSurface); static void ApplyMorphologyHorizontal_Scalar(uint8_t* aSourceData, int32_t aSourceStride, uint8_t* aDestData, int32_t aDestStride, const IntRect& aDestRect, int32_t aRadius, @@ -75,7 +75,7 @@ protected: uint8_t* aDestData, int32_t aDestStride, const IntRect& aDestRect, int32_t aRadius, MorphologyOperator aOperator); - static TemporaryRef ApplyColorMatrix_Scalar(DataSourceSurface* aInput, const Matrix5x4 &aMatrix); + static already_AddRefed ApplyColorMatrix_Scalar(DataSourceSurface* aInput, const Matrix5x4 &aMatrix); static void ApplyComposition_Scalar(DataSourceSurface* aSource, DataSourceSurface* aDest, CompositeOperator aOperator); static void SeparateColorChannels_Scalar(const IntSize &size, uint8_t* sourceData, int32_t sourceStride, uint8_t* channel0Data, uint8_t* channel1Data, uint8_t* channel2Data, uint8_t* channel3Data, int32_t channelStride); @@ -86,16 +86,16 @@ protected: static void DoUnpremultiplicationCalculation_Scalar(const IntSize& aSize, uint8_t* aTargetData, int32_t aTargetStride, uint8_t* aSourceData, int32_t aSourceStride); - static TemporaryRef + static already_AddRefed RenderTurbulence_Scalar(const IntSize &aSize, const Point &aOffset, const Size &aBaseFrequency, int32_t aSeed, int aNumOctaves, TurbulenceType aType, bool aStitch, const Rect &aTileRect); - static TemporaryRef + static already_AddRefed ApplyArithmeticCombine_Scalar(DataSourceSurface* aInput1, DataSourceSurface* aInput2, Float aK1, Float aK2, Float aK3, Float aK4); #ifdef USE_SSE2 static void ExtractAlpha_SSE2(const IntSize& size, uint8_t* sourceData, int32_t sourceStride, uint8_t* alphaData, int32_t alphaStride); - static TemporaryRef ConvertToB8G8R8A8_SSE2(SourceSurface* aSurface); - static TemporaryRef ApplyBlending_SSE2(DataSourceSurface* aInput1, DataSourceSurface* aInput2, BlendMode aBlendMode); + static already_AddRefed ConvertToB8G8R8A8_SSE2(SourceSurface* aSurface); + static already_AddRefed ApplyBlending_SSE2(DataSourceSurface* aInput1, DataSourceSurface* aInput2, BlendMode aBlendMode); static void ApplyMorphologyHorizontal_SSE2(uint8_t* aSourceData, int32_t aSourceStride, uint8_t* aDestData, int32_t aDestStride, const IntRect& aDestRect, int32_t aRadius, @@ -104,7 +104,7 @@ protected: uint8_t* aDestData, int32_t aDestStride, const IntRect& aDestRect, int32_t aRadius, MorphologyOperator aOperator); - static TemporaryRef ApplyColorMatrix_SSE2(DataSourceSurface* aInput, const Matrix5x4 &aMatrix); + static already_AddRefed ApplyColorMatrix_SSE2(DataSourceSurface* aInput, const Matrix5x4 &aMatrix); static void ApplyComposition_SSE2(DataSourceSurface* aSource, DataSourceSurface* aDest, CompositeOperator aOperator); static void SeparateColorChannels_SSE2(const IntSize &size, uint8_t* sourceData, int32_t sourceStride, uint8_t* channel0Data, uint8_t* channel1Data, uint8_t* channel2Data, uint8_t* channel3Data, int32_t channelStride); static void CombineColorChannels_SSE2(const IntSize &size, int32_t resultStride, uint8_t* resultData, int32_t channelStride, uint8_t* channel0Data, uint8_t* channel1Data, uint8_t* channel2Data, uint8_t* channel3Data); @@ -114,10 +114,10 @@ protected: static void DoUnpremultiplicationCalculation_SSE2(const IntSize& aSize, uint8_t* aTargetData, int32_t aTargetStride, uint8_t* aSourceData, int32_t aSourceStride); - static TemporaryRef + static already_AddRefed RenderTurbulence_SSE2(const IntSize &aSize, const Point &aOffset, const Size &aBaseFrequency, int32_t aSeed, int aNumOctaves, TurbulenceType aType, bool aStitch, const Rect &aTileRect); - static TemporaryRef + static already_AddRefed ApplyArithmeticCombine_SSE2(DataSourceSurface* aInput1, DataSourceSurface* aInput2, Float aK1, Float aK2, Float aK3, Float aK4); #endif }; diff --git a/gfx/2d/FilterProcessingSIMD-inl.h b/gfx/2d/FilterProcessingSIMD-inl.h index 48646b40e48..40d8189260a 100644 --- a/gfx/2d/FilterProcessingSIMD-inl.h +++ b/gfx/2d/FilterProcessingSIMD-inl.h @@ -12,7 +12,7 @@ namespace mozilla { namespace gfx { template -inline TemporaryRef +inline already_AddRefed ConvertToB8G8R8A8_SIMD(SourceSurface* aSurface) { IntSize size = aSurface->GetSize(); @@ -284,7 +284,7 @@ ShuffleAndPackComponents(i32x4_t bbbb1234, i32x4_t gggg1234, } template -inline TemporaryRef +inline already_AddRefed ApplyBlending_SIMD(DataSourceSurface* aInput1, DataSourceSurface* aInput2) { IntSize size = aInput1->GetSize(); @@ -338,7 +338,7 @@ ApplyBlending_SIMD(DataSourceSurface* aInput1, DataSourceSurface* aInput2) } template -static TemporaryRef +static already_AddRefed ApplyBlending_SIMD(DataSourceSurface* aInput1, DataSourceSurface* aInput2, BlendMode aBlendMode) { @@ -509,7 +509,7 @@ ColorMatrixMultiply(i16x8_t p, i16x8_t rows_bg, i16x8_t rows_ra, const i32x4_t& } template -static TemporaryRef +static already_AddRefed ApplyColorMatrix_SIMD(DataSourceSurface* aInput, const Matrix5x4 &aMatrix) { IntSize size = aInput->GetSize(); @@ -953,7 +953,7 @@ DoUnpremultiplicationCalculation_SIMD(const IntSize& aSize, } template -static TemporaryRef +static already_AddRefed RenderTurbulence_SIMD(const IntSize &aSize, const Point &aOffset, const Size &aBaseFrequency, int32_t aSeed, int aNumOctaves, TurbulenceType aType, bool aStitch, const Rect &aTileRect) { @@ -1013,7 +1013,7 @@ ArithmeticCombineTwoPixels(i16x8_t in1, i16x8_t in2, } template -static TemporaryRef +static already_AddRefed ApplyArithmeticCombine_SIMD(DataSourceSurface* aInput1, DataSourceSurface* aInput2, Float aK1, Float aK2, Float aK3, Float aK4) { diff --git a/gfx/2d/FilterProcessingSSE2.cpp b/gfx/2d/FilterProcessingSSE2.cpp index ca1d2dbef77..9cd0e7bc7dd 100644 --- a/gfx/2d/FilterProcessingSSE2.cpp +++ b/gfx/2d/FilterProcessingSSE2.cpp @@ -20,13 +20,13 @@ FilterProcessing::ExtractAlpha_SSE2(const IntSize& size, uint8_t* sourceData, in ExtractAlpha_SIMD<__m128i>(size, sourceData, sourceStride, alphaData, alphaStride); } -TemporaryRef +already_AddRefed FilterProcessing::ConvertToB8G8R8A8_SSE2(SourceSurface* aSurface) { return ConvertToB8G8R8A8_SIMD<__m128i>(aSurface); } -TemporaryRef +already_AddRefed FilterProcessing::ApplyBlending_SSE2(DataSourceSurface* aInput1, DataSourceSurface* aInput2, BlendMode aBlendMode) { @@ -53,7 +53,7 @@ FilterProcessing::ApplyMorphologyVertical_SSE2(uint8_t* aSourceData, int32_t aSo aSourceData, aSourceStride, aDestData, aDestStride, aDestRect, aRadius, aOp); } -TemporaryRef +already_AddRefed FilterProcessing::ApplyColorMatrix_SSE2(DataSourceSurface* aInput, const Matrix5x4 &aMatrix) { return ApplyColorMatrix_SIMD<__m128i,__m128i,__m128i>(aInput, aMatrix); @@ -95,14 +95,14 @@ FilterProcessing::DoUnpremultiplicationCalculation_SSE2( DoUnpremultiplicationCalculation_SIMD<__m128i,__m128i>(aSize, aTargetData, aTargetStride, aSourceData, aSourceStride); } -TemporaryRef +already_AddRefed FilterProcessing::RenderTurbulence_SSE2(const IntSize &aSize, const Point &aOffset, const Size &aBaseFrequency, int32_t aSeed, int aNumOctaves, TurbulenceType aType, bool aStitch, const Rect &aTileRect) { return RenderTurbulence_SIMD<__m128,__m128i,__m128i>(aSize, aOffset, aBaseFrequency, aSeed, aNumOctaves, aType, aStitch, aTileRect); } -TemporaryRef +already_AddRefed FilterProcessing::ApplyArithmeticCombine_SSE2(DataSourceSurface* aInput1, DataSourceSurface* aInput2, Float aK1, Float aK2, Float aK3, Float aK4) { return ApplyArithmeticCombine_SIMD<__m128i,__m128i,__m128i>(aInput1, aInput2, aK1, aK2, aK3, aK4); diff --git a/gfx/2d/FilterProcessingScalar.cpp b/gfx/2d/FilterProcessingScalar.cpp index 3a38118eedd..ca8074bd943 100644 --- a/gfx/2d/FilterProcessingScalar.cpp +++ b/gfx/2d/FilterProcessingScalar.cpp @@ -23,7 +23,7 @@ FilterProcessing::ExtractAlpha_Scalar(const IntSize& size, uint8_t* sourceData, } } -TemporaryRef +already_AddRefed FilterProcessing::ConvertToB8G8R8A8_Scalar(SourceSurface* aSurface) { return ConvertToB8G8R8A8_SIMD(aSurface); @@ -134,7 +134,7 @@ FilterProcessing::ApplyMorphologyVertical_Scalar(uint8_t* aSourceData, int32_t a } } -TemporaryRef +already_AddRefed FilterProcessing::ApplyColorMatrix_Scalar(DataSourceSurface* aInput, const Matrix5x4 &aMatrix) { return ApplyColorMatrix_SIMD(aInput, aMatrix); @@ -226,7 +226,7 @@ FilterProcessing::DoUnpremultiplicationCalculation_Scalar( } } -TemporaryRef +already_AddRefed FilterProcessing::RenderTurbulence_Scalar(const IntSize &aSize, const Point &aOffset, const Size &aBaseFrequency, int32_t aSeed, int aNumOctaves, TurbulenceType aType, bool aStitch, const Rect &aTileRect) { @@ -234,7 +234,7 @@ FilterProcessing::RenderTurbulence_Scalar(const IntSize &aSize, const Point &aOf aSize, aOffset, aBaseFrequency, aSeed, aNumOctaves, aType, aStitch, aTileRect); } -TemporaryRef +already_AddRefed FilterProcessing::ApplyArithmeticCombine_Scalar(DataSourceSurface* aInput1, DataSourceSurface* aInput2, Float aK1, Float aK2, Float aK3, Float aK4) { return ApplyArithmeticCombine_SIMD(aInput1, aInput2, aK1, aK2, aK3, aK4); diff --git a/gfx/2d/HelpersD2D.h b/gfx/2d/HelpersD2D.h index 683f5f8859b..45de61aa82d 100644 --- a/gfx/2d/HelpersD2D.h +++ b/gfx/2d/HelpersD2D.h @@ -422,7 +422,7 @@ DWriteGlyphRunFromGlyphs(const GlyphBuffer &aGlyphs, ScaledFontDWrite *aFont, Au run->isSideways = FALSE; } -static inline TemporaryRef +static inline already_AddRefed ConvertRectToGeometry(const D2D1_RECT_F& aRect) { RefPtr rectGeom; @@ -430,7 +430,7 @@ ConvertRectToGeometry(const D2D1_RECT_F& aRect) return rectGeom.forget(); } -static inline TemporaryRef +static inline already_AddRefed GetTransformedGeometry(ID2D1Geometry *aGeometry, const D2D1_MATRIX_3X2_F &aTransform) { RefPtr tmpGeometry; @@ -443,7 +443,7 @@ GetTransformedGeometry(ID2D1Geometry *aGeometry, const D2D1_MATRIX_3X2_F &aTrans return tmpGeometry.forget(); } -static inline TemporaryRef +static inline already_AddRefed IntersectGeometry(ID2D1Geometry *aGeometryA, ID2D1Geometry *aGeometryB) { RefPtr pathGeom; @@ -456,7 +456,7 @@ IntersectGeometry(ID2D1Geometry *aGeometryA, ID2D1Geometry *aGeometryB) return pathGeom.forget(); } -static inline TemporaryRef +static inline already_AddRefed CreateStrokeStyleForOptions(const StrokeOptions &aStrokeOptions) { RefPtr style; @@ -536,7 +536,7 @@ CreateStrokeStyleForOptions(const StrokeOptions &aStrokeOptions) // This creates a (partially) uploaded bitmap for a DataSourceSurface. It // uploads the minimum requirement and possibly downscales. It adjusts the // input Matrix to compensate. -static inline TemporaryRef +static inline already_AddRefed CreatePartialBitmapForSurface(DataSourceSurface *aSurface, const Matrix &aDestinationTransform, const IntSize &aDestinationSize, ExtendMode aExtendMode, Matrix &aSourceTransform, ID2D1RenderTarget *aRT, diff --git a/gfx/2d/MacIOSurface.cpp b/gfx/2d/MacIOSurface.cpp index 8d0696685c7..8badcf6e359 100644 --- a/gfx/2d/MacIOSurface.cpp +++ b/gfx/2d/MacIOSurface.cpp @@ -285,7 +285,7 @@ MacIOSurface::~MacIOSurface() { CFRelease(mIOSurfacePtr); } -TemporaryRef MacIOSurface::CreateIOSurface(int aWidth, int aHeight, +already_AddRefed MacIOSurface::CreateIOSurface(int aWidth, int aHeight, double aContentsScaleFactor, bool aHasAlpha) { if (!MacIOSurfaceLib::isInit() || aContentsScaleFactor <= 0) @@ -338,7 +338,7 @@ TemporaryRef MacIOSurface::CreateIOSurface(int aWidth, int aHeight return ioSurface.forget(); } -TemporaryRef MacIOSurface::LookupSurface(IOSurfaceID aIOSurfaceID, +already_AddRefed MacIOSurface::LookupSurface(IOSurfaceID aIOSurfaceID, double aContentsScaleFactor, bool aHasAlpha) { if (!MacIOSurfaceLib::isInit() || aContentsScaleFactor <= 0) @@ -435,7 +435,7 @@ using mozilla::gfx::SourceSurfaceRawData; using mozilla::gfx::IntSize; using mozilla::gfx::SurfaceFormat; -TemporaryRef +already_AddRefed MacIOSurface::GetAsSurface() { Lock(); size_t bytesPerRow = GetBytesPerRow(); @@ -499,7 +499,7 @@ CGImageRef MacIOSurface::CreateImageFromIOSurfaceContext(CGContextRef aContext) return MacIOSurfaceLib::IOSurfaceContextCreateImage(aContext); } -TemporaryRef MacIOSurface::IOSurfaceContextGetSurface(CGContextRef aContext, +already_AddRefed MacIOSurface::IOSurfaceContextGetSurface(CGContextRef aContext, double aContentsScaleFactor, bool aHasAlpha) { if (!MacIOSurfaceLib::isInit() || aContentsScaleFactor <= 0) diff --git a/gfx/2d/MacIOSurface.h b/gfx/2d/MacIOSurface.h index 62ddcd73481..8a7105bc7f6 100644 --- a/gfx/2d/MacIOSurface.h +++ b/gfx/2d/MacIOSurface.h @@ -69,11 +69,11 @@ public: // of the MacIOSurface instance. // MacIOSurface holds a reference to the corresponding IOSurface. - static mozilla::TemporaryRef CreateIOSurface(int aWidth, int aHeight, + static already_AddRefed CreateIOSurface(int aWidth, int aHeight, double aContentsScaleFactor = 1.0, bool aHasAlpha = true); static void ReleaseIOSurface(MacIOSurface *aIOSurface); - static mozilla::TemporaryRef LookupSurface(IOSurfaceID aSurfaceID, + static already_AddRefed LookupSurface(IOSurfaceID aSurfaceID, double aContentsScaleFactor = 1.0, bool aHasAlpha = true); @@ -103,12 +103,12 @@ public: // We would like to forward declare NSOpenGLContext, but it is an @interface // and this file is also used from c++, so we use a void *. CGLError CGLTexImageIOSurface2D(CGLContextObj ctxt); - mozilla::TemporaryRef GetAsSurface(); + already_AddRefed GetAsSurface(); CGContextRef CreateIOSurfaceContext(); // FIXME This doesn't really belong here static CGImageRef CreateImageFromIOSurfaceContext(CGContextRef aContext); - static mozilla::TemporaryRef IOSurfaceContextGetSurface(CGContextRef aContext, + static already_AddRefed IOSurfaceContextGetSurface(CGContextRef aContext, double aContentsScaleFactor = 1.0, bool aHasAlpha = true); static size_t GetMaxWidth(); diff --git a/gfx/2d/PathCG.cpp b/gfx/2d/PathCG.cpp index 6d5dfa36e66..1b917837492 100644 --- a/gfx/2d/PathCG.cpp +++ b/gfx/2d/PathCG.cpp @@ -127,13 +127,13 @@ PathBuilderCG::EnsureActive(const Point &aPoint) { } -TemporaryRef +already_AddRefed PathBuilderCG::Finish() { return MakeAndAddRef(mCGPath, mFillRule); } -TemporaryRef +already_AddRefed PathCG::CopyToBuilder(FillRule aFillRule) const { CGMutablePathRef path = CGPathCreateMutableCopy(mPath); @@ -142,7 +142,7 @@ PathCG::CopyToBuilder(FillRule aFillRule) const -TemporaryRef +already_AddRefed PathCG::TransformedCopyToBuilder(const Matrix &aTransform, FillRule aFillRule) const { // 10.7 adds CGPathCreateMutableCopyByTransformingPath it might be faster than doing diff --git a/gfx/2d/PathCG.h b/gfx/2d/PathCG.h index 9598edb8752..fc0ce7b7254 100644 --- a/gfx/2d/PathCG.h +++ b/gfx/2d/PathCG.h @@ -45,7 +45,7 @@ public: Float aEndAngle, bool aAntiClockwise = false); virtual Point CurrentPoint() const; - virtual TemporaryRef Finish(); + virtual already_AddRefed Finish(); virtual BackendType GetBackendType() const { return BackendType::COREGRAPHICS; } @@ -77,8 +77,8 @@ public: // are compatible with BackendType::COREGRAPHICS_ACCELERATED backend. virtual BackendType GetBackendType() const { return BackendType::COREGRAPHICS; } - virtual TemporaryRef CopyToBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const; - virtual TemporaryRef TransformedCopyToBuilder(const Matrix &aTransform, + virtual already_AddRefed CopyToBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const; + virtual already_AddRefed TransformedCopyToBuilder(const Matrix &aTransform, FillRule aFillRule = FillRule::FILL_WINDING) const; virtual bool ContainsPoint(const Point &aPoint, const Matrix &aTransform) const; diff --git a/gfx/2d/PathCairo.cpp b/gfx/2d/PathCairo.cpp index b0c9f8b41b3..d85119f684f 100644 --- a/gfx/2d/PathCairo.cpp +++ b/gfx/2d/PathCairo.cpp @@ -122,7 +122,7 @@ PathBuilderCairo::CurrentPoint() const return mCurrentPoint; } -TemporaryRef +already_AddRefed PathBuilderCairo::Finish() { return MakeAndAddRef(mFillRule, mPathData, mCurrentPoint); @@ -159,7 +159,7 @@ PathCairo::~PathCairo() } } -TemporaryRef +already_AddRefed PathCairo::CopyToBuilder(FillRule aFillRule) const { RefPtr builder = new PathBuilderCairo(aFillRule); @@ -170,7 +170,7 @@ PathCairo::CopyToBuilder(FillRule aFillRule) const return builder.forget(); } -TemporaryRef +already_AddRefed PathCairo::TransformedCopyToBuilder(const Matrix &aTransform, FillRule aFillRule) const { RefPtr builder = new PathBuilderCairo(aFillRule); diff --git a/gfx/2d/PathCairo.h b/gfx/2d/PathCairo.h index 0f315bb3cff..01538a1c39c 100644 --- a/gfx/2d/PathCairo.h +++ b/gfx/2d/PathCairo.h @@ -32,7 +32,7 @@ public: virtual void Arc(const Point &aOrigin, float aRadius, float aStartAngle, float aEndAngle, bool aAntiClockwise = false); virtual Point CurrentPoint() const; - virtual TemporaryRef Finish(); + virtual already_AddRefed Finish(); virtual BackendType GetBackendType() const { return BackendType::CAIRO; } @@ -57,8 +57,8 @@ public: virtual BackendType GetBackendType() const { return BackendType::CAIRO; } - virtual TemporaryRef CopyToBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const; - virtual TemporaryRef TransformedCopyToBuilder(const Matrix &aTransform, + virtual already_AddRefed CopyToBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const; + virtual already_AddRefed TransformedCopyToBuilder(const Matrix &aTransform, FillRule aFillRule = FillRule::FILL_WINDING) const; virtual bool ContainsPoint(const Point &aPoint, const Matrix &aTransform) const; diff --git a/gfx/2d/PathD2D.cpp b/gfx/2d/PathD2D.cpp index bd20d31899d..8cb802b3916 100644 --- a/gfx/2d/PathD2D.cpp +++ b/gfx/2d/PathD2D.cpp @@ -290,7 +290,7 @@ PathBuilderD2D::EnsureActive(const Point &aPoint) } } -TemporaryRef +already_AddRefed PathBuilderD2D::Finish() { if (mFigureActive) { @@ -306,13 +306,13 @@ PathBuilderD2D::Finish() return MakeAndAddRef(mGeometry, mFigureActive, mCurrentPoint, mFillRule, mBackendType); } -TemporaryRef +already_AddRefed PathD2D::CopyToBuilder(FillRule aFillRule) const { return TransformedCopyToBuilder(Matrix(), aFillRule); } -TemporaryRef +already_AddRefed PathD2D::TransformedCopyToBuilder(const Matrix &aTransform, FillRule aFillRule) const { RefPtr path; diff --git a/gfx/2d/PathD2D.h b/gfx/2d/PathD2D.h index 3afd82783a1..31977bc50bd 100644 --- a/gfx/2d/PathD2D.h +++ b/gfx/2d/PathD2D.h @@ -41,7 +41,7 @@ public: Float aEndAngle, bool aAntiClockwise = false); virtual Point CurrentPoint() const; - virtual TemporaryRef Finish(); + virtual already_AddRefed Finish(); virtual BackendType GetBackendType() const { return mBackendType; } @@ -77,8 +77,8 @@ public: virtual BackendType GetBackendType() const { return mBackendType; } - virtual TemporaryRef CopyToBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const; - virtual TemporaryRef TransformedCopyToBuilder(const Matrix &aTransform, + virtual already_AddRefed CopyToBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const; + virtual already_AddRefed TransformedCopyToBuilder(const Matrix &aTransform, FillRule aFillRule = FillRule::FILL_WINDING) const; virtual bool ContainsPoint(const Point &aPoint, const Matrix &aTransform) const; diff --git a/gfx/2d/PathHelpers.h b/gfx/2d/PathHelpers.h index 9fe88298406..43baf1d6315 100644 --- a/gfx/2d/PathHelpers.h +++ b/gfx/2d/PathHelpers.h @@ -143,7 +143,7 @@ GFX2D_API void AppendRectToPath(PathBuilder* aPathBuilder, const Rect& aRect, bool aDrawClockwise = true); -inline TemporaryRef MakePathForRect(const DrawTarget& aDrawTarget, +inline already_AddRefed MakePathForRect(const DrawTarget& aDrawTarget, const Rect& aRect, bool aDrawClockwise = true) { @@ -235,7 +235,7 @@ GFX2D_API void AppendRoundedRectToPath(PathBuilder* aPathBuilder, const RectCornerRadii& aRadii, bool aDrawClockwise = true); -inline TemporaryRef MakePathForRoundedRect(const DrawTarget& aDrawTarget, +inline already_AddRefed MakePathForRoundedRect(const DrawTarget& aDrawTarget, const Rect& aRect, const RectCornerRadii& aRadii, bool aDrawClockwise = true) @@ -256,7 +256,7 @@ GFX2D_API void AppendEllipseToPath(PathBuilder* aPathBuilder, const Point& aCenter, const Size& aDimensions); -inline TemporaryRef MakePathForEllipse(const DrawTarget& aDrawTarget, +inline already_AddRefed MakePathForEllipse(const DrawTarget& aDrawTarget, const Point& aCenter, const Size& aDimensions) { diff --git a/gfx/2d/PathRecording.cpp b/gfx/2d/PathRecording.cpp index ad6700db331..243941be397 100644 --- a/gfx/2d/PathRecording.cpp +++ b/gfx/2d/PathRecording.cpp @@ -69,7 +69,7 @@ PathBuilderRecording::CurrentPoint() const return mPathBuilder->CurrentPoint(); } -TemporaryRef +already_AddRefed PathBuilderRecording::Finish() { RefPtr path = mPathBuilder->Finish(); @@ -84,7 +84,7 @@ PathRecording::~PathRecording() } } -TemporaryRef +already_AddRefed PathRecording::CopyToBuilder(FillRule aFillRule) const { RefPtr pathBuilder = mPath->CopyToBuilder(aFillRule); @@ -93,7 +93,7 @@ PathRecording::CopyToBuilder(FillRule aFillRule) const return recording.forget(); } -TemporaryRef +already_AddRefed PathRecording::TransformedCopyToBuilder(const Matrix &aTransform, FillRule aFillRule) const { RefPtr pathBuilder = mPath->TransformedCopyToBuilder(aTransform, aFillRule); diff --git a/gfx/2d/PathRecording.h b/gfx/2d/PathRecording.h index 7fde43ea96f..7df80399f99 100644 --- a/gfx/2d/PathRecording.h +++ b/gfx/2d/PathRecording.h @@ -70,7 +70,7 @@ public: */ virtual Point CurrentPoint() const; - virtual TemporaryRef Finish(); + virtual already_AddRefed Finish(); virtual BackendType GetBackendType() const { return BackendType::RECORDING; } @@ -94,8 +94,8 @@ public: ~PathRecording(); virtual BackendType GetBackendType() const { return BackendType::RECORDING; } - virtual TemporaryRef CopyToBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const; - virtual TemporaryRef TransformedCopyToBuilder(const Matrix &aTransform, + virtual already_AddRefed CopyToBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const; + virtual already_AddRefed TransformedCopyToBuilder(const Matrix &aTransform, FillRule aFillRule = FillRule::FILL_WINDING) const; virtual bool ContainsPoint(const Point &aPoint, const Matrix &aTransform) const { return mPath->ContainsPoint(aPoint, aTransform); } diff --git a/gfx/2d/PathSkia.cpp b/gfx/2d/PathSkia.cpp index a3345881a73..e01d452a4be 100644 --- a/gfx/2d/PathSkia.cpp +++ b/gfx/2d/PathSkia.cpp @@ -102,7 +102,7 @@ PathBuilderSkia::CurrentPoint() const return Point(SkScalarToFloat(point.fX), SkScalarToFloat(point.fY)); } -TemporaryRef +already_AddRefed PathBuilderSkia::Finish() { return MakeAndAddRef(mPath, mFillRule); @@ -114,13 +114,13 @@ PathBuilderSkia::AppendPath(const SkPath &aPath) mPath.addPath(aPath); } -TemporaryRef +already_AddRefed PathSkia::CopyToBuilder(FillRule aFillRule) const { return TransformedCopyToBuilder(Matrix(), aFillRule); } -TemporaryRef +already_AddRefed PathSkia::TransformedCopyToBuilder(const Matrix &aTransform, FillRule aFillRule) const { return MakeAndAddRef(aTransform, mPath, aFillRule); diff --git a/gfx/2d/PathSkia.h b/gfx/2d/PathSkia.h index 57fd709b0b3..14144dbc1c9 100644 --- a/gfx/2d/PathSkia.h +++ b/gfx/2d/PathSkia.h @@ -32,7 +32,7 @@ public: virtual void Arc(const Point &aOrigin, float aRadius, float aStartAngle, float aEndAngle, bool aAntiClockwise = false); virtual Point CurrentPoint() const; - virtual TemporaryRef Finish(); + virtual already_AddRefed Finish(); void AppendPath(const SkPath &aPath); @@ -58,8 +58,8 @@ public: virtual BackendType GetBackendType() const { return BackendType::SKIA; } - virtual TemporaryRef CopyToBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const; - virtual TemporaryRef TransformedCopyToBuilder(const Matrix &aTransform, + virtual already_AddRefed CopyToBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const; + virtual already_AddRefed TransformedCopyToBuilder(const Matrix &aTransform, FillRule aFillRule = FillRule::FILL_WINDING) const; virtual bool ContainsPoint(const Point &aPoint, const Matrix &aTransform) const; diff --git a/gfx/2d/QuartzSupport.mm b/gfx/2d/QuartzSupport.mm index cdefa0557c2..74589d93d30 100644 --- a/gfx/2d/QuartzSupport.mm +++ b/gfx/2d/QuartzSupport.mm @@ -26,7 +26,6 @@ @end using mozilla::RefPtr; -using mozilla::TemporaryRef; CGColorSpaceRef CreateSystemColorSpace() { CGColorSpaceRef cspace = ::CGDisplayCopyColorSpace(::CGMainDisplayID()); diff --git a/gfx/2d/RadialGradientEffectD2D1.cpp b/gfx/2d/RadialGradientEffectD2D1.cpp index 03945af24e9..403bdb2ddf1 100644 --- a/gfx/2d/RadialGradientEffectD2D1.cpp +++ b/gfx/2d/RadialGradientEffectD2D1.cpp @@ -309,7 +309,7 @@ RadialGradientEffectD2D1::SetStopCollection(IUnknown *aStopCollection) return E_INVALIDARG; } -TemporaryRef +already_AddRefed RadialGradientEffectD2D1::CreateGradientTexture() { std::vector rawStops; diff --git a/gfx/2d/RadialGradientEffectD2D1.h b/gfx/2d/RadialGradientEffectD2D1.h index a902588d110..baa02aafb7e 100644 --- a/gfx/2d/RadialGradientEffectD2D1.h +++ b/gfx/2d/RadialGradientEffectD2D1.h @@ -79,7 +79,7 @@ public: IUnknown *GetStopCollection() const { return mStopCollection; } private: - TemporaryRef CreateGradientTexture(); + already_AddRefed CreateGradientTexture(); RadialGradientEffectD2D1(); diff --git a/gfx/2d/SVGTurbulenceRenderer-inl.h b/gfx/2d/SVGTurbulenceRenderer-inl.h index 2ea92c60196..7b18903e86e 100644 --- a/gfx/2d/SVGTurbulenceRenderer-inl.h +++ b/gfx/2d/SVGTurbulenceRenderer-inl.h @@ -17,7 +17,7 @@ public: SVGTurbulenceRenderer(const Size &aBaseFrequency, int32_t aSeed, int aNumOctaves, const Rect &aTileRect); - TemporaryRef Render(const IntSize &aSize, const Point &aOffset) const; + already_AddRefed Render(const IntSize &aSize, const Point &aOffset) const; private: /* The turbulence calculation code is an adapted version of what @@ -327,7 +327,7 @@ SVGTurbulenceRenderer::EquivalentNonNegativ } template -TemporaryRef +already_AddRefed SVGTurbulenceRenderer::Render(const IntSize &aSize, const Point &aOffset) const { RefPtr target = diff --git a/gfx/2d/ScaledFontBase.cpp b/gfx/2d/ScaledFontBase.cpp index a81d6e55745..d0faed14710 100644 --- a/gfx/2d/ScaledFontBase.cpp +++ b/gfx/2d/ScaledFontBase.cpp @@ -74,7 +74,7 @@ ScaledFontBase::GetSkiaPathForGlyphs(const GlyphBuffer &aBuffer) } #endif -TemporaryRef +already_AddRefed ScaledFontBase::GetPathForGlyphs(const GlyphBuffer &aBuffer, const DrawTarget *aTarget) { #ifdef USE_SKIA diff --git a/gfx/2d/ScaledFontBase.h b/gfx/2d/ScaledFontBase.h index 4251828b0ad..74e13ad20b6 100644 --- a/gfx/2d/ScaledFontBase.h +++ b/gfx/2d/ScaledFontBase.h @@ -31,7 +31,7 @@ public: explicit ScaledFontBase(Float aSize); virtual ~ScaledFontBase(); - virtual TemporaryRef GetPathForGlyphs(const GlyphBuffer &aBuffer, const DrawTarget *aTarget); + virtual already_AddRefed GetPathForGlyphs(const GlyphBuffer &aBuffer, const DrawTarget *aTarget); virtual void CopyGlyphsToBuilder(const GlyphBuffer &aBuffer, PathBuilder *aBuilder, BackendType aBackendType, const Matrix *aTransformHint); diff --git a/gfx/2d/ScaledFontDWrite.cpp b/gfx/2d/ScaledFontDWrite.cpp index e1e1b7137f7..85873da933a 100644 --- a/gfx/2d/ScaledFontDWrite.cpp +++ b/gfx/2d/ScaledFontDWrite.cpp @@ -306,7 +306,7 @@ ScaledFontDWrite::ScaledFontDWrite(uint8_t *aData, uint32_t aSize, } } -TemporaryRef +already_AddRefed ScaledFontDWrite::GetPathForGlyphs(const GlyphBuffer &aBuffer, const DrawTarget *aTarget) { if (aTarget->GetBackendType() != BackendType::DIRECT2D && aTarget->GetBackendType() != BackendType::DIRECT2D1_1) { diff --git a/gfx/2d/ScaledFontDWrite.h b/gfx/2d/ScaledFontDWrite.h index 941babed17b..a517ab55db0 100644 --- a/gfx/2d/ScaledFontDWrite.h +++ b/gfx/2d/ScaledFontDWrite.h @@ -26,7 +26,7 @@ public: virtual FontType GetType() const { return FontType::DWRITE; } - virtual TemporaryRef GetPathForGlyphs(const GlyphBuffer &aBuffer, const DrawTarget *aTarget); + virtual already_AddRefed GetPathForGlyphs(const GlyphBuffer &aBuffer, const DrawTarget *aTarget); virtual void CopyGlyphsToBuilder(const GlyphBuffer &aBuffer, PathBuilder *aBuilder, BackendType aBackendType, const Matrix *aTransformHint); void CopyGlyphsToSink(const GlyphBuffer &aBuffer, ID2D1GeometrySink *aSink); diff --git a/gfx/2d/ScaledFontMac.cpp b/gfx/2d/ScaledFontMac.cpp index 4679cf59700..6bc1509434f 100644 --- a/gfx/2d/ScaledFontMac.cpp +++ b/gfx/2d/ScaledFontMac.cpp @@ -76,7 +76,7 @@ SkTypeface* ScaledFontMac::GetSkTypeface() // Note: cairo dlsyms it. We could do that but maybe it's // safe just to use? -TemporaryRef +already_AddRefed ScaledFontMac::GetPathForGlyphs(const GlyphBuffer &aBuffer, const DrawTarget *aTarget) { if (aTarget->GetBackendType() == BackendType::COREGRAPHICS || diff --git a/gfx/2d/ScaledFontMac.h b/gfx/2d/ScaledFontMac.h index 03c68add663..98fd2c1d496 100644 --- a/gfx/2d/ScaledFontMac.h +++ b/gfx/2d/ScaledFontMac.h @@ -25,7 +25,7 @@ public: #ifdef USE_SKIA virtual SkTypeface* GetSkTypeface(); #endif - virtual TemporaryRef GetPathForGlyphs(const GlyphBuffer &aBuffer, const DrawTarget *aTarget); + virtual already_AddRefed GetPathForGlyphs(const GlyphBuffer &aBuffer, const DrawTarget *aTarget); virtual void CopyGlyphsToBuilder(const GlyphBuffer &aBuffer, PathBuilder *aBuilder, BackendType aBackendType, const Matrix *aTransformHint); virtual bool GetFontFileData(FontFileDataOutput aDataCallback, void *aBaton); diff --git a/gfx/2d/SourceSurfaceCG.cpp b/gfx/2d/SourceSurfaceCG.cpp index d2f785ab57d..2a2c73402fa 100644 --- a/gfx/2d/SourceSurfaceCG.cpp +++ b/gfx/2d/SourceSurfaceCG.cpp @@ -36,7 +36,7 @@ SourceSurfaceCG::GetFormat() const return mFormat; } -TemporaryRef +already_AddRefed SourceSurfaceCG::GetDataSurface() { //XXX: we should be more disciplined about who takes a reference and where diff --git a/gfx/2d/SourceSurfaceCG.h b/gfx/2d/SourceSurfaceCG.h index fccf57c383e..f9b2a658ef7 100644 --- a/gfx/2d/SourceSurfaceCG.h +++ b/gfx/2d/SourceSurfaceCG.h @@ -43,7 +43,7 @@ public: virtual SurfaceType GetType() const { return SurfaceType::COREGRAPHICS_IMAGE; } virtual IntSize GetSize() const; virtual SurfaceFormat GetFormat() const; - virtual TemporaryRef GetDataSurface(); + virtual already_AddRefed GetDataSurface(); CGImageRef GetImage() { return mImage; } @@ -115,7 +115,7 @@ public: virtual SurfaceType GetType() const { return SurfaceType::COREGRAPHICS_CGCONTEXT; } virtual IntSize GetSize() const; virtual SurfaceFormat GetFormat() const { return mFormat; } - virtual TemporaryRef GetDataSurface() + virtual already_AddRefed GetDataSurface() { // This call to DrawTargetWillChange() is needed to make a local copy of // the data from mDrawTarget. If we don't do that, the data can end up diff --git a/gfx/2d/SourceSurfaceCairo.cpp b/gfx/2d/SourceSurfaceCairo.cpp index 93bdc9f27ba..2afae57ad0c 100644 --- a/gfx/2d/SourceSurfaceCairo.cpp +++ b/gfx/2d/SourceSurfaceCairo.cpp @@ -58,7 +58,7 @@ SourceSurfaceCairo::GetFormat() const return mFormat; } -TemporaryRef +already_AddRefed SourceSurfaceCairo::GetDataSurface() { RefPtr dataSurf; diff --git a/gfx/2d/SourceSurfaceCairo.h b/gfx/2d/SourceSurfaceCairo.h index a9390e7598b..1466e9ac81f 100644 --- a/gfx/2d/SourceSurfaceCairo.h +++ b/gfx/2d/SourceSurfaceCairo.h @@ -30,7 +30,7 @@ public: virtual SurfaceType GetType() const { return SurfaceType::CAIRO; } virtual IntSize GetSize() const; virtual SurfaceFormat GetFormat() const; - virtual TemporaryRef GetDataSurface(); + virtual already_AddRefed GetDataSurface(); cairo_surface_t* GetSurface() const; diff --git a/gfx/2d/SourceSurfaceD2D.cpp b/gfx/2d/SourceSurfaceD2D.cpp index 538f0d2bd8f..438cdace2cd 100644 --- a/gfx/2d/SourceSurfaceD2D.cpp +++ b/gfx/2d/SourceSurfaceD2D.cpp @@ -40,7 +40,7 @@ SourceSurfaceD2D::IsValid() const return mDevice == Factory::GetDirect3D10Device(); } -TemporaryRef +already_AddRefed SourceSurfaceD2D::GetDataSurface() { RefPtr result = new DataSourceSurfaceD2D(this); diff --git a/gfx/2d/SourceSurfaceD2D.h b/gfx/2d/SourceSurfaceD2D.h index c2622d76c3a..22ee5f125f9 100644 --- a/gfx/2d/SourceSurfaceD2D.h +++ b/gfx/2d/SourceSurfaceD2D.h @@ -27,7 +27,7 @@ public: virtual SurfaceFormat GetFormat() const; virtual bool IsValid() const; - virtual TemporaryRef GetDataSurface(); + virtual already_AddRefed GetDataSurface(); ID2D1Bitmap *GetBitmap() { return mBitmap; } diff --git a/gfx/2d/SourceSurfaceD2D1.cpp b/gfx/2d/SourceSurfaceD2D1.cpp index 1f26d26b756..f8f108c2172 100644 --- a/gfx/2d/SourceSurfaceD2D1.cpp +++ b/gfx/2d/SourceSurfaceD2D1.cpp @@ -34,7 +34,7 @@ SourceSurfaceD2D1::IsValid() const return mDevice == Factory::GetD2D1Device(); } -TemporaryRef +already_AddRefed SourceSurfaceD2D1::GetDataSurface() { HRESULT hr; diff --git a/gfx/2d/SourceSurfaceD2D1.h b/gfx/2d/SourceSurfaceD2D1.h index 1ecf3144992..8cb4c7c8782 100644 --- a/gfx/2d/SourceSurfaceD2D1.h +++ b/gfx/2d/SourceSurfaceD2D1.h @@ -30,7 +30,7 @@ public: virtual IntSize GetSize() const { return mSize; } virtual SurfaceFormat GetFormat() const { return mFormat; } virtual bool IsValid() const; - virtual TemporaryRef GetDataSurface(); + virtual already_AddRefed GetDataSurface(); ID2D1Image *GetImage() { return mImage; } diff --git a/gfx/2d/SourceSurfaceD2DTarget.cpp b/gfx/2d/SourceSurfaceD2DTarget.cpp index 3cc3bbecbc8..b2145747cd4 100644 --- a/gfx/2d/SourceSurfaceD2DTarget.cpp +++ b/gfx/2d/SourceSurfaceD2DTarget.cpp @@ -50,7 +50,7 @@ SourceSurfaceD2DTarget::GetFormat() const return mFormat; } -TemporaryRef +already_AddRefed SourceSurfaceD2DTarget::GetDataSurface() { RefPtr dataSurf = diff --git a/gfx/2d/SourceSurfaceD2DTarget.h b/gfx/2d/SourceSurfaceD2DTarget.h index a66505047a4..82b5b20778c 100644 --- a/gfx/2d/SourceSurfaceD2DTarget.h +++ b/gfx/2d/SourceSurfaceD2DTarget.h @@ -27,7 +27,7 @@ public: virtual SurfaceType GetType() const { return SurfaceType::D2D1_DRAWTARGET; } virtual IntSize GetSize() const; virtual SurfaceFormat GetFormat() const; - virtual TemporaryRef GetDataSurface(); + virtual already_AddRefed GetDataSurface(); virtual void *GetNativeSurface(NativeSurfaceType aType); DrawTargetD2D* GetDT() { return mDrawTarget; } diff --git a/gfx/2d/SourceSurfaceDual.h b/gfx/2d/SourceSurfaceDual.h index aaa85dcc868..7c44bbc0b63 100644 --- a/gfx/2d/SourceSurfaceDual.h +++ b/gfx/2d/SourceSurfaceDual.h @@ -28,7 +28,7 @@ public: virtual SurfaceFormat GetFormat() const { return mA->GetFormat(); } /* Readback from this surface type is not supported! */ - virtual TemporaryRef GetDataSurface() { return nullptr; } + virtual already_AddRefed GetDataSurface() { return nullptr; } private: friend class DualSurface; friend class DualPattern; diff --git a/gfx/gl/AndroidSurfaceTexture.cpp b/gfx/gl/AndroidSurfaceTexture.cpp index 696b01ad359..8ed7350b05a 100644 --- a/gfx/gl/AndroidSurfaceTexture.cpp +++ b/gfx/gl/AndroidSurfaceTexture.cpp @@ -36,13 +36,13 @@ IsSTSupported() return AndroidBridge::Bridge()->GetAPIVersion() >= 14; /* ICS */ } -TemporaryRef +already_AddRefed AndroidSurfaceTexture::Create() { return Create(nullptr, 0); } -TemporaryRef +already_AddRefed AndroidSurfaceTexture::Create(GLContext* aContext, GLuint aTexture) { if (!IsSTSupported()) { diff --git a/gfx/gl/AndroidSurfaceTexture.h b/gfx/gl/AndroidSurfaceTexture.h index 3b1ca1a1fbd..3099a6e259f 100644 --- a/gfx/gl/AndroidSurfaceTexture.h +++ b/gfx/gl/AndroidSurfaceTexture.h @@ -41,13 +41,13 @@ public: // The SurfaceTexture is created in an attached state. This method requires // Android Ice Cream Sandwich. - static TemporaryRef Create(GLContext* aGLContext, GLuint aTexture); + static already_AddRefed Create(GLContext* aGLContext, GLuint aTexture); // Here the SurfaceTexture will be created in a detached state. You must call // Attach() with the GLContext you wish to composite with. It must be done // on the thread where that GLContext is current. This method requires // Android Jelly Bean. - static TemporaryRef Create(); + static already_AddRefed Create(); static AndroidSurfaceTexture* Find(int id); diff --git a/gfx/gl/GLReadTexImageHelper.cpp b/gfx/gl/GLReadTexImageHelper.cpp index 48705a5949c..31fe011a65e 100644 --- a/gfx/gl/GLReadTexImageHelper.cpp +++ b/gfx/gl/GLReadTexImageHelper.cpp @@ -532,7 +532,7 @@ ReadPixelsIntoDataSurface(GLContext* gl, DataSourceSurface* dest) #endif } -static TemporaryRef +static already_AddRefed YInvertImageSurface(DataSourceSurface* aSurf) { RefPtr temp = @@ -568,7 +568,7 @@ YInvertImageSurface(DataSourceSurface* aSurf) return temp.forget(); } -TemporaryRef +already_AddRefed ReadBackSurface(GLContext* gl, GLuint aTexture, bool aYInvert, SurfaceFormat aFormat) { gl->MakeCurrent(); @@ -617,7 +617,7 @@ ReadBackSurface(GLContext* gl, GLuint aTexture, bool aYInvert, SurfaceFormat aFo break; \ } -TemporaryRef +already_AddRefed GLReadTexImageHelper::ReadTexImage(GLuint aTextureId, GLenum aTextureTarget, const gfx::IntSize& aSize, diff --git a/gfx/gl/GLReadTexImageHelper.h b/gfx/gl/GLReadTexImageHelper.h index 53ce4118932..12f8fe7cba1 100644 --- a/gfx/gl/GLReadTexImageHelper.h +++ b/gfx/gl/GLReadTexImageHelper.h @@ -31,7 +31,7 @@ bool GetActualReadFormats(GLContext* gl, void ReadPixelsIntoDataSurface(GLContext* aGL, gfx::DataSourceSurface* aSurface); -TemporaryRef +already_AddRefed ReadBackSurface(GLContext* gl, GLuint aTexture, bool aYInvert, gfx::SurfaceFormat aFormat); class GLReadTexImageHelper final @@ -64,7 +64,7 @@ public: * NOTE: aShaderProgram is really mozilla::layers::ShaderProgramType. It is * passed as int to eliminate including LayerManagerOGLProgram.h here. */ - TemporaryRef ReadTexImage(GLuint aTextureId, + already_AddRefed ReadTexImage(GLuint aTextureId, GLenum aTextureTarget, const gfx::IntSize& aSize, /* ShaderProgramType */ int aShaderProgram, diff --git a/gfx/gl/GLTextureImage.cpp b/gfx/gl/GLTextureImage.cpp index be729f3963f..6256474897e 100644 --- a/gfx/gl/GLTextureImage.cpp +++ b/gfx/gl/GLTextureImage.cpp @@ -185,7 +185,7 @@ BasicTextureImage::BindTexture(GLenum aTextureUnit) mGLContext->fActiveTexture(LOCAL_GL_TEXTURE0); } -TemporaryRef +already_AddRefed BasicTextureImage::GetDrawTargetForUpdate(const gfx::IntSize& aSize, gfx::SurfaceFormat aFmt) { return gfx::Factory::CreateDrawTarget(gfx::BackendType::CAIRO, aSize, aFmt); diff --git a/gfx/gl/GLTextureImage.h b/gfx/gl/GLTextureImage.h index ea1bb245549..2ed2c901aa1 100644 --- a/gfx/gl/GLTextureImage.h +++ b/gfx/gl/GLTextureImage.h @@ -258,7 +258,7 @@ public: virtual void EndUpdate(); virtual bool DirectUpdate(gfx::DataSourceSurface* aSurf, const nsIntRegion& aRegion, const gfx::IntPoint& aFrom = gfx::IntPoint(0,0)); virtual GLuint GetTextureID() { return mTexture; } - virtual TemporaryRef + virtual already_AddRefed GetDrawTargetForUpdate(const gfx::IntSize& aSize, gfx::SurfaceFormat aFmt); virtual void MarkValid() { mTextureState = Valid; } diff --git a/gfx/gl/SharedSurface.cpp b/gfx/gl/SharedSurface.cpp index e0b9cbc93ec..58fcbfde911 100644 --- a/gfx/gl/SharedSurface.cpp +++ b/gfx/gl/SharedSurface.cpp @@ -327,7 +327,7 @@ SurfaceFactory::~SurfaceFactory() mRecycleFreePool.clear(); } -TemporaryRef +already_AddRefed SurfaceFactory::NewTexClient(const gfx::IntSize& size) { while (!mRecycleFreePool.empty()) { diff --git a/gfx/gl/SharedSurface.h b/gfx/gl/SharedSurface.h index a01b5e73c71..75cbf60bd64 100644 --- a/gfx/gl/SharedSurface.h +++ b/gfx/gl/SharedSurface.h @@ -328,8 +328,8 @@ protected: public: UniquePtr NewSharedSurface(const gfx::IntSize& size); - //TemporaryRef NewShSurfHandle(const gfx::IntSize& size); - TemporaryRef NewTexClient(const gfx::IntSize& size); + //already_AddRefed NewShSurfHandle(const gfx::IntSize& size); + already_AddRefed NewTexClient(const gfx::IntSize& size); static void RecycleCallback(layers::TextureClient* tc, void* /*closure*/); diff --git a/gfx/layers/AtomicRefCountedWithFinalize.h b/gfx/layers/AtomicRefCountedWithFinalize.h index bd88aaa1a3f..3e843fdfcd2 100644 --- a/gfx/layers/AtomicRefCountedWithFinalize.h +++ b/gfx/layers/AtomicRefCountedWithFinalize.h @@ -68,9 +68,6 @@ public: template friend class ::mozilla::StaticRefPtr; - template - friend class TemporaryRef; - template friend class ::nsRefPtr; diff --git a/gfx/layers/Compositor.h b/gfx/layers/Compositor.h index 96adf2cef41..8771076d9dd 100644 --- a/gfx/layers/Compositor.h +++ b/gfx/layers/Compositor.h @@ -8,7 +8,7 @@ #include "Units.h" // for ScreenPoint #include "mozilla/Assertions.h" // for MOZ_ASSERT, etc -#include "mozilla/RefPtr.h" // for TemporaryRef, RefCounted +#include "mozilla/RefPtr.h" // for already_AddRefed, RefCounted #include "mozilla/gfx/Point.h" // for IntSize, Point #include "mozilla/gfx/Rect.h" // for Rect, IntRect #include "mozilla/gfx/Types.h" // for Float @@ -191,7 +191,7 @@ public: { } - virtual TemporaryRef CreateDataTextureSource(TextureFlags aFlags = TextureFlags::NO_FLAGS) = 0; + virtual already_AddRefed CreateDataTextureSource(TextureFlags aFlags = TextureFlags::NO_FLAGS) = 0; virtual bool Initialize() = 0; virtual void Destroy() = 0; @@ -253,7 +253,7 @@ public: * Creates a Surface that can be used as a rendering target by this * compositor. */ - virtual TemporaryRef + virtual already_AddRefed CreateRenderTarget(const gfx::IntRect& aRect, SurfaceInitMode aInit) = 0; /** @@ -263,7 +263,7 @@ public: * * aSourcePoint specifies the point in aSource to copy data from. */ - virtual TemporaryRef + virtual already_AddRefed CreateRenderTargetFromSource(const gfx::IntRect& aRect, const CompositingRenderTarget* aSource, const gfx::IntPoint& aSourcePoint) = 0; diff --git a/gfx/layers/D3D11ShareHandleImage.cpp b/gfx/layers/D3D11ShareHandleImage.cpp index fc8e6945391..bfc342acc1a 100644 --- a/gfx/layers/D3D11ShareHandleImage.cpp +++ b/gfx/layers/D3D11ShareHandleImage.cpp @@ -52,7 +52,7 @@ D3D11ShareHandleImage::GetTextureClient(CompositableClient* aClient) return mTextureClient; } -TemporaryRef +already_AddRefed D3D11ShareHandleImage::GetAsSourceSurface() { if (!mTexture) { diff --git a/gfx/layers/D3D11ShareHandleImage.h b/gfx/layers/D3D11ShareHandleImage.h index b512d4f5396..e756802a172 100644 --- a/gfx/layers/D3D11ShareHandleImage.h +++ b/gfx/layers/D3D11ShareHandleImage.h @@ -46,7 +46,7 @@ public: gfx::IntSize GetSize() override; - virtual TemporaryRef GetAsSourceSurface() override; + virtual already_AddRefed GetAsSourceSurface() override; virtual TextureClient* GetTextureClient(CompositableClient* aClient) override; diff --git a/gfx/layers/D3D9SurfaceImage.cpp b/gfx/layers/D3D9SurfaceImage.cpp index e8975bd69f0..947023949f9 100644 --- a/gfx/layers/D3D9SurfaceImage.cpp +++ b/gfx/layers/D3D9SurfaceImage.cpp @@ -212,7 +212,7 @@ D3D9SurfaceImage::GetTextureClient(CompositableClient* aClient) return mTextureClient; } -TemporaryRef +already_AddRefed D3D9SurfaceImage::GetAsSourceSurface() { NS_ENSURE_TRUE(mTexture, nullptr); diff --git a/gfx/layers/D3D9SurfaceImage.h b/gfx/layers/D3D9SurfaceImage.h index cbdfec4be08..73319c7afde 100644 --- a/gfx/layers/D3D9SurfaceImage.h +++ b/gfx/layers/D3D9SurfaceImage.h @@ -40,7 +40,7 @@ public: gfx::IntSize GetSize() override; - virtual TemporaryRef GetAsSourceSurface() override; + virtual already_AddRefed GetAsSourceSurface() override; virtual TextureClient* GetTextureClient(CompositableClient* aClient) override; diff --git a/gfx/layers/Effects.h b/gfx/layers/Effects.h index 04c7882a7f2..7fb206b49ea 100644 --- a/gfx/layers/Effects.h +++ b/gfx/layers/Effects.h @@ -7,7 +7,7 @@ #define MOZILLA_LAYERS_EFFECTS_H #include "mozilla/Assertions.h" // for MOZ_ASSERT, etc -#include "mozilla/RefPtr.h" // for RefPtr, TemporaryRef, etc +#include "mozilla/RefPtr.h" // for RefPtr, already_AddRefed, etc #include "mozilla/gfx/Matrix.h" // for Matrix4x4 #include "mozilla/gfx/Point.h" // for IntSize #include "mozilla/gfx/Rect.h" // for Rect @@ -245,7 +245,7 @@ struct EffectChain * where aFormat would be FOMRAT_YCBCR and each texture source would be * a one-channel A8 texture) */ -inline TemporaryRef +inline already_AddRefed CreateTexturedEffect(gfx::SurfaceFormat aFormat, TextureSource* aSource, const gfx::Filter& aFilter, @@ -281,7 +281,7 @@ CreateTexturedEffect(gfx::SurfaceFormat aFormat, * * aSourceOnWhite can be null. */ -inline TemporaryRef +inline already_AddRefed CreateTexturedEffect(TextureSource* aSource, TextureSource* aSourceOnWhite, const gfx::Filter& aFilter, @@ -308,7 +308,7 @@ CreateTexturedEffect(TextureSource* aSource, * * This version excudes the possibility of component alpha. */ -inline TemporaryRef +inline already_AddRefed CreateTexturedEffect(TextureSource *aTexture, const gfx::Filter& aFilter, const LayerRenderState &state = LayerRenderState()) diff --git a/gfx/layers/GLImages.cpp b/gfx/layers/GLImages.cpp index f11c7069c91..37117816ee1 100644 --- a/gfx/layers/GLImages.cpp +++ b/gfx/layers/GLImages.cpp @@ -33,7 +33,7 @@ EGLImageImage::~EGLImageImage() } } -TemporaryRef +already_AddRefed GLImage::GetAsSourceSurface() { MOZ_ASSERT(NS_IsMainThread(), "Should be on the main thread"); diff --git a/gfx/layers/GLImages.h b/gfx/layers/GLImages.h index e0a6c670571..c47d0f13221 100644 --- a/gfx/layers/GLImages.h +++ b/gfx/layers/GLImages.h @@ -23,7 +23,7 @@ class GLImage : public Image { public: explicit GLImage(ImageFormat aFormat) : Image(nullptr, aFormat){} - virtual TemporaryRef GetAsSourceSurface() override; + virtual already_AddRefed GetAsSourceSurface() override; }; class EGLImageImage : public GLImage { diff --git a/gfx/layers/GrallocImages.cpp b/gfx/layers/GrallocImages.cpp index 8230f99f9ee..3bd4fef9c4d 100644 --- a/gfx/layers/GrallocImages.cpp +++ b/gfx/layers/GrallocImages.cpp @@ -381,7 +381,7 @@ ConvertOmxYUVFormatToRGB565(android::sp& aBuffer, return OK; } -TemporaryRef +already_AddRefed GrallocImage::GetAsSourceSurface() { if (!mTextureClient) { diff --git a/gfx/layers/GrallocImages.h b/gfx/layers/GrallocImages.h index b0614a5a0f5..14b52e8d8cd 100644 --- a/gfx/layers/GrallocImages.h +++ b/gfx/layers/GrallocImages.h @@ -84,7 +84,7 @@ public: GRALLOC_SW_UAGE = android::GraphicBuffer::USAGE_SOFTWARE_MASK, }; - virtual TemporaryRef GetAsSourceSurface() override; + virtual already_AddRefed GetAsSourceSurface() override; android::sp GetGraphicBuffer() const; diff --git a/gfx/layers/IMFYCbCrImage.cpp b/gfx/layers/IMFYCbCrImage.cpp index c28f4cd8ed3..73aafcc840d 100644 --- a/gfx/layers/IMFYCbCrImage.cpp +++ b/gfx/layers/IMFYCbCrImage.cpp @@ -56,7 +56,7 @@ struct AutoLockTexture RefPtr mMutex; }; -static TemporaryRef +static already_AddRefed InitTextures(IDirect3DDevice9* aDevice, const IntSize &aSize, _D3DFORMAT aFormat, diff --git a/gfx/layers/ImageContainer.cpp b/gfx/layers/ImageContainer.cpp index f6d10446b19..39090b44628 100644 --- a/gfx/layers/ImageContainer.cpp +++ b/gfx/layers/ImageContainer.cpp @@ -10,7 +10,7 @@ #include "gfx2DGlue.h" #include "gfxPlatform.h" // for gfxPlatform #include "gfxUtils.h" // for gfxUtils -#include "mozilla/RefPtr.h" // for TemporaryRef +#include "mozilla/RefPtr.h" // for already_AddRefed #include "mozilla/ipc/CrossProcessMutex.h" // for CrossProcessMutex, etc #include "mozilla/layers/CompositorTypes.h" #include "mozilla/layers/ImageBridgeChild.h" // for ImageBridgeChild @@ -293,7 +293,7 @@ ImageContainer::LockCurrentImage() return retval.forget(); } -TemporaryRef +already_AddRefed ImageContainer::LockCurrentAsSourceSurface(gfx::IntSize *aSize, Image** aCurrentImage) { ReentrantMonitorAutoEnter mon(mReentrantMonitor); @@ -316,7 +316,7 @@ ImageContainer::UnlockCurrentImage() { } -TemporaryRef +already_AddRefed ImageContainer::GetCurrentAsSourceSurface(gfx::IntSize *aSize) { ReentrantMonitorAutoEnter mon(mReentrantMonitor); @@ -467,7 +467,7 @@ PlanarYCbCrImage::AllocateAndGetNewBuffer(uint32_t aSize) return mBuffer; } -TemporaryRef +already_AddRefed PlanarYCbCrImage::GetAsSourceSurface() { if (mSourceSurface) { diff --git a/gfx/layers/ImageContainer.h b/gfx/layers/ImageContainer.h index 90d4158b443..6f8f2b7ac34 100644 --- a/gfx/layers/ImageContainer.h +++ b/gfx/layers/ImageContainer.h @@ -148,7 +148,7 @@ public: void MarkSent() { mSent = true; } bool IsSentToCompositor() { return mSent; } - virtual TemporaryRef GetAsSourceSurface() = 0; + virtual already_AddRefed GetAsSourceSurface() = 0; virtual GrallocImage* AsGrallocImage() { @@ -423,12 +423,12 @@ public: * the lock methods should be used to avoid the copy, however this should be * avoided if the surface is required for a long period of time. */ - TemporaryRef GetCurrentAsSourceSurface(gfx::IntSize* aSizeResult); + already_AddRefed GetCurrentAsSourceSurface(gfx::IntSize* aSizeResult); /** * Same as LockCurrentAsSurface but for Moz2D */ - TemporaryRef LockCurrentAsSourceSurface(gfx::IntSize* aSizeResult, + already_AddRefed LockCurrentAsSourceSurface(gfx::IntSize* aSizeResult, Image** aCurrentImage = nullptr); /** @@ -764,7 +764,7 @@ protected: */ virtual uint8_t* AllocateBuffer(uint32_t aSize); - TemporaryRef GetAsSourceSurface(); + already_AddRefed GetAsSourceSurface(); void SetOffscreenFormat(gfxImageFormat aFormat) { mOffscreenFormat = aFormat; } gfxImageFormat GetOffscreenFormat(); @@ -801,7 +801,7 @@ public: mSourceSurface = aData.mSourceSurface; } - virtual TemporaryRef GetAsSourceSurface() override + virtual already_AddRefed GetAsSourceSurface() override { RefPtr surface(mSourceSurface); return surface.forget(); @@ -842,7 +842,7 @@ public: mSize = aData.mSize; } - TemporaryRef GetAsSourceSurface() { return nullptr; } ; + already_AddRefed GetAsSourceSurface() { return nullptr; } ; int32_t GetOverlayId() { return mOverlayId; } gfx::IntSize GetSize() { return mSize; } diff --git a/gfx/layers/ImageDataSerializer.cpp b/gfx/layers/ImageDataSerializer.cpp index b4de7ec69a7..89a8158c093 100644 --- a/gfx/layers/ImageDataSerializer.cpp +++ b/gfx/layers/ImageDataSerializer.cpp @@ -147,7 +147,7 @@ ImageDataSerializerBase::GetFormat() const return GetBufferInfo(mData, mDataSize)->format; } -TemporaryRef +already_AddRefed ImageDataSerializerBase::GetAsDrawTarget(gfx::BackendType aBackend) { MOZ_ASSERT(IsValid()); @@ -156,7 +156,7 @@ ImageDataSerializerBase::GetAsDrawTarget(gfx::BackendType aBackend) GetStride(), GetFormat()); } -TemporaryRef +already_AddRefed ImageDataSerializerBase::GetAsSurface() { MOZ_ASSERT(IsValid()); diff --git a/gfx/layers/ImageDataSerializer.h b/gfx/layers/ImageDataSerializer.h index 33f8e261678..e2752f25735 100644 --- a/gfx/layers/ImageDataSerializer.h +++ b/gfx/layers/ImageDataSerializer.h @@ -10,7 +10,7 @@ #include // for uint8_t, uint32_t #include "mozilla/Attributes.h" // for MOZ_STACK_CLASS -#include "mozilla/RefPtr.h" // for TemporaryRef +#include "mozilla/RefPtr.h" // for already_AddRefed #include "mozilla/gfx/Point.h" // for IntSize #include "mozilla/gfx/Types.h" // for SurfaceFormat @@ -33,8 +33,8 @@ public: uint32_t GetStride() const; gfx::IntSize GetSize() const; gfx::SurfaceFormat GetFormat() const; - TemporaryRef GetAsSurface(); - TemporaryRef GetAsDrawTarget(gfx::BackendType aBackend); + already_AddRefed GetAsSurface(); + already_AddRefed GetAsDrawTarget(gfx::BackendType aBackend); static uint32_t ComputeMinBufferSize(gfx::IntSize aSize, gfx::SurfaceFormat aFormat); diff --git a/gfx/layers/Layers.cpp b/gfx/layers/Layers.cpp index dd9b8b9d10d..9e5a77fe30a 100644 --- a/gfx/layers/Layers.cpp +++ b/gfx/layers/Layers.cpp @@ -138,7 +138,7 @@ LayerManager::GetScrollableLayers(nsTArray& aArray) } } -TemporaryRef +already_AddRefed LayerManager::CreateOptimalDrawTarget(const gfx::IntSize &aSize, SurfaceFormat aFormat) { @@ -146,13 +146,13 @@ LayerManager::CreateOptimalDrawTarget(const gfx::IntSize &aSize, aFormat); } -TemporaryRef +already_AddRefed LayerManager::CreateOptimalMaskDrawTarget(const gfx::IntSize &aSize) { return CreateOptimalDrawTarget(aSize, SurfaceFormat::A8); } -TemporaryRef +already_AddRefed LayerManager::CreateDrawTarget(const IntSize &aSize, SurfaceFormat aFormat) { @@ -160,7 +160,7 @@ LayerManager::CreateDrawTarget(const IntSize &aSize, CreateOffscreenCanvasDrawTarget(aSize, aFormat); } -TemporaryRef +already_AddRefed LayerManager::CreatePersistentBufferProvider(const mozilla::gfx::IntSize &aSize, mozilla::gfx::SurfaceFormat aFormat) { diff --git a/gfx/layers/Layers.h b/gfx/layers/Layers.h index 31a4b7bf553..db72e254f55 100644 --- a/gfx/layers/Layers.h +++ b/gfx/layers/Layers.h @@ -22,7 +22,7 @@ #include "mozilla/DebugOnly.h" // for DebugOnly #include "mozilla/EventForwards.h" // for nsPaintEvent #include "mozilla/Maybe.h" // for Maybe -#include "mozilla/RefPtr.h" // for TemporaryRef +#include "mozilla/RefPtr.h" // for already_AddRefed #include "mozilla/StyleAnimationValue.h" // for StyleAnimationValue, etc #include "mozilla/TimeStamp.h" // for TimeStamp, TimeDuration #include "mozilla/gfx/BaseMargin.h" // for BaseMargin @@ -461,7 +461,7 @@ public: * Creates a DrawTarget which is optimized for inter-operating with this * layer manager. */ - virtual TemporaryRef + virtual already_AddRefed CreateOptimalDrawTarget(const IntSize &aSize, SurfaceFormat imageFormat); @@ -471,14 +471,14 @@ public: * this surface is optimised for drawing alpha only and we assume that * drawing the mask is fairly simple. */ - virtual TemporaryRef + virtual already_AddRefed CreateOptimalMaskDrawTarget(const IntSize &aSize); /** * Creates a DrawTarget for use with canvas which is optimized for * inter-operating with this layermanager. */ - virtual TemporaryRef + virtual already_AddRefed CreateDrawTarget(const mozilla::gfx::IntSize &aSize, mozilla::gfx::SurfaceFormat aFormat); @@ -486,7 +486,7 @@ public: * Creates a PersistentBufferProvider for use with canvas which is optimized for * inter-operating with this layermanager. */ - virtual TemporaryRef + virtual already_AddRefed CreatePersistentBufferProvider(const mozilla::gfx::IntSize &aSize, mozilla::gfx::SurfaceFormat aFormat); diff --git a/gfx/layers/MacIOSurfaceImage.cpp b/gfx/layers/MacIOSurfaceImage.cpp index c6559dbf3ca..c7b8c0ee8f5 100644 --- a/gfx/layers/MacIOSurfaceImage.cpp +++ b/gfx/layers/MacIOSurfaceImage.cpp @@ -22,7 +22,7 @@ MacIOSurfaceImage::GetTextureClient(CompositableClient* aClient) return mTextureClient; } -TemporaryRef +already_AddRefed MacIOSurfaceImage::GetAsSourceSurface() { mSurface->Lock(); diff --git a/gfx/layers/MacIOSurfaceImage.h b/gfx/layers/MacIOSurfaceImage.h index 74c00429892..53569ba9363 100644 --- a/gfx/layers/MacIOSurfaceImage.h +++ b/gfx/layers/MacIOSurfaceImage.h @@ -24,7 +24,7 @@ public: return gfx::IntSize(mSurface->GetDevicePixelWidth(), mSurface->GetDevicePixelHeight()); } - virtual TemporaryRef GetAsSourceSurface() override; + virtual already_AddRefed GetAsSourceSurface() override; virtual TextureClient* GetTextureClient(CompositableClient* aClient) override; diff --git a/gfx/layers/PersistentBufferProvider.h b/gfx/layers/PersistentBufferProvider.h index 2eb7dde9dee..72b88b75ea0 100644 --- a/gfx/layers/PersistentBufferProvider.h +++ b/gfx/layers/PersistentBufferProvider.h @@ -7,7 +7,7 @@ #define MOZILLA_GFX_PersistentBUFFERPROVIDER_H #include "mozilla/Assertions.h" // for MOZ_ASSERT, etc -#include "mozilla/RefPtr.h" // for RefPtr, TemporaryRef, etc +#include "mozilla/RefPtr.h" // for RefPtr, already_AddRefed, etc #include "mozilla/layers/LayersTypes.h" #include "mozilla/layers/CompositableForwarder.h" #include "mozilla/gfx/Types.h" @@ -48,7 +48,7 @@ public: */ virtual bool ReturnAndUseDT(gfx::DrawTarget* aDT) = 0; - virtual TemporaryRef GetSnapshot() = 0; + virtual already_AddRefed GetSnapshot() = 0; protected: }; @@ -64,7 +64,7 @@ public: virtual LayersBackend GetType() { return LayersBackend::LAYERS_BASIC; } gfx::DrawTarget* GetDT(const gfx::IntRect& aPersistedRect) { return mDrawTarget; } bool ReturnAndUseDT(gfx::DrawTarget* aDT) { MOZ_ASSERT(mDrawTarget == aDT); return true; } - virtual TemporaryRef GetSnapshot() { return mDrawTarget->Snapshot(); } + virtual already_AddRefed GetSnapshot() { return mDrawTarget->Snapshot(); } private: RefPtr mDrawTarget; }; diff --git a/gfx/layers/RotatedBuffer.cpp b/gfx/layers/RotatedBuffer.cpp index 21aadffd49d..871e735cc82 100644 --- a/gfx/layers/RotatedBuffer.cpp +++ b/gfx/layers/RotatedBuffer.cpp @@ -177,7 +177,7 @@ RotatedBuffer::DrawBufferWithRotation(gfx::DrawTarget *aTarget, ContextSource aS DrawBufferQuadrant(aTarget, RIGHT, BOTTOM, aSource, aOpacity, aOperator,aMask, aMaskTransform); } -TemporaryRef +already_AddRefed SourceRotatedBuffer::GetSourceSurface(ContextSource aSource) const { RefPtr surf; @@ -773,7 +773,7 @@ RotatedContentBuffer::BorrowDrawTargetForPainting(PaintState& aPaintState, return result; } -TemporaryRef +already_AddRefed RotatedContentBuffer::GetSourceSurface(ContextSource aSource) const { MOZ_ASSERT(mDTBuffer); diff --git a/gfx/layers/RotatedBuffer.h b/gfx/layers/RotatedBuffer.h index 3dab3d349be..d19913478e5 100644 --- a/gfx/layers/RotatedBuffer.h +++ b/gfx/layers/RotatedBuffer.h @@ -9,7 +9,7 @@ #include "gfxTypes.h" #include // for uint32_t #include "mozilla/Assertions.h" // for MOZ_ASSERT, etc -#include "mozilla/RefPtr.h" // for RefPtr, TemporaryRef +#include "mozilla/RefPtr.h" // for RefPtr, already_AddRefed #include "mozilla/gfx/2D.h" // for DrawTarget, etc #include "mozilla/mozalloc.h" // for operator delete #include "nsAutoPtr.h" // for nsRefPtr @@ -85,7 +85,7 @@ public: virtual bool HaveBuffer() const = 0; virtual bool HaveBufferOnWhite() const = 0; - virtual TemporaryRef GetSourceSurface(ContextSource aSource) const = 0; + virtual already_AddRefed GetSourceSurface(ContextSource aSource) const = 0; protected: @@ -140,7 +140,7 @@ public: , mSourceOnWhite(aSourceOnWhite) { } - virtual TemporaryRef GetSourceSurface(ContextSource aSource) const; + virtual already_AddRefed GetSourceSurface(ContextSource aSource) const; virtual bool HaveBuffer() const { return !!mSource; } virtual bool HaveBufferOnWhite() const { return !!mSourceOnWhite; } @@ -319,7 +319,7 @@ public: gfx::DrawTarget* GetDTBuffer() { return mDTBuffer; } gfx::DrawTarget* GetDTBufferOnWhite() { return mDTBufferOnWhite; } - virtual TemporaryRef GetSourceSurface(ContextSource aSource) const; + virtual already_AddRefed GetSourceSurface(ContextSource aSource) const; /** * Complete the drawing operation. The region to draw must have been diff --git a/gfx/layers/TextureDIB.cpp b/gfx/layers/TextureDIB.cpp index 107c1ecce2f..8b39fcefb56 100644 --- a/gfx/layers/TextureDIB.cpp +++ b/gfx/layers/TextureDIB.cpp @@ -69,7 +69,7 @@ TextureClientMemoryDIB::~TextureClientMemoryDIB() MOZ_COUNT_DTOR(TextureClientMemoryDIB); } -TemporaryRef +already_AddRefed TextureClientMemoryDIB::CreateSimilar(TextureFlags aFlags, TextureAllocationFlags aAllocFlags) const { @@ -137,7 +137,7 @@ TextureClientShmemDIB::~TextureClientShmemDIB() ::CloseHandle(mFileMapping); } -TemporaryRef +already_AddRefed TextureClientShmemDIB::CreateSimilar(TextureFlags aFlags, TextureAllocationFlags aAllocFlags) const { diff --git a/gfx/layers/TextureDIB.h b/gfx/layers/TextureDIB.h index bab44da131e..59ff3a920f6 100644 --- a/gfx/layers/TextureDIB.h +++ b/gfx/layers/TextureDIB.h @@ -71,7 +71,7 @@ public: virtual bool AllocateForSurface(gfx::IntSize aSize, TextureAllocationFlags aFlags = ALLOC_DEFAULT) override; - virtual TemporaryRef + virtual already_AddRefed CreateSimilar(TextureFlags aFlags = TextureFlags::DEFAULT, TextureAllocationFlags aAllocFlags = ALLOC_DEFAULT) const override; @@ -99,7 +99,7 @@ public: virtual bool AllocateForSurface(gfx::IntSize aSize, TextureAllocationFlags aFlags = ALLOC_DEFAULT) override; - virtual TemporaryRef + virtual already_AddRefed CreateSimilar(TextureFlags aFlags = TextureFlags::DEFAULT, TextureAllocationFlags aAllocFlags = ALLOC_DEFAULT) const override; @@ -157,7 +157,7 @@ public: DIBTextureHost(TextureFlags aFlags, const SurfaceDescriptorDIB& aDescriptor); - virtual TemporaryRef GetAsSurface() override + virtual already_AddRefed GetAsSurface() override { return nullptr; // TODO: cf bug 872568 } @@ -175,7 +175,7 @@ public: const SurfaceDescriptorFileMapping& aDescriptor); ~TextureHostFileMapping(); - virtual TemporaryRef GetAsSurface() override + virtual already_AddRefed GetAsSurface() override { MOZ_CRASH(); // Not implemented! It would be tricky to keep track of the // scope of the file mapping. We could do this through UserData diff --git a/gfx/layers/YCbCrImageDataSerializer.cpp b/gfx/layers/YCbCrImageDataSerializer.cpp index 7553bb126a3..c5b4043f3f3 100644 --- a/gfx/layers/YCbCrImageDataSerializer.cpp +++ b/gfx/layers/YCbCrImageDataSerializer.cpp @@ -277,7 +277,7 @@ YCbCrImageDataSerializer::CopyData(const uint8_t* aYData, return true; } -TemporaryRef +already_AddRefed YCbCrImageDataDeserializer::ToDataSourceSurface() { RefPtr result = diff --git a/gfx/layers/YCbCrImageDataSerializer.h b/gfx/layers/YCbCrImageDataSerializer.h index 5534251e5f3..0fd7b507eb6 100644 --- a/gfx/layers/YCbCrImageDataSerializer.h +++ b/gfx/layers/YCbCrImageDataSerializer.h @@ -10,7 +10,7 @@ #include // for uint8_t, uint32_t #include "ImageTypes.h" // for StereoMode #include "mozilla/Attributes.h" // for MOZ_STACK_CLASS -#include "mozilla/RefPtr.h" // for TemporaryRef +#include "mozilla/RefPtr.h" // for already_AddRefed #include "mozilla/gfx/Point.h" // for IntSize namespace mozilla { @@ -177,7 +177,7 @@ public: * This is a costly operation, so use it only when YCbCr compositing is * not supported. */ - TemporaryRef ToDataSourceSurface(); + already_AddRefed ToDataSourceSurface(); }; } // namespace diff --git a/gfx/layers/basic/BasicCompositor.cpp b/gfx/layers/basic/BasicCompositor.cpp index febd74e698e..b37b045cbbd 100644 --- a/gfx/layers/basic/BasicCompositor.cpp +++ b/gfx/layers/basic/BasicCompositor.cpp @@ -103,7 +103,7 @@ void BasicCompositor::Destroy() mWidget = nullptr; } -TemporaryRef +already_AddRefed BasicCompositor::CreateRenderTarget(const IntRect& aRect, SurfaceInitMode aInit) { MOZ_ASSERT(aRect.width != 0 && aRect.height != 0, "Trying to create a render target of invalid size"); @@ -123,7 +123,7 @@ BasicCompositor::CreateRenderTarget(const IntRect& aRect, SurfaceInitMode aInit) return rt.forget(); } -TemporaryRef +already_AddRefed BasicCompositor::CreateRenderTargetFromSource(const IntRect &aRect, const CompositingRenderTarget *aSource, const IntPoint &aSourcePoint) @@ -132,7 +132,7 @@ BasicCompositor::CreateRenderTargetFromSource(const IntRect &aRect, return nullptr; } -TemporaryRef +already_AddRefed BasicCompositor::CreateDataTextureSource(TextureFlags aFlags) { RefPtr result = new DataTextureSourceBasic(); diff --git a/gfx/layers/basic/BasicCompositor.h b/gfx/layers/basic/BasicCompositor.h index 80a43fe744a..7a7caf0f564 100644 --- a/gfx/layers/basic/BasicCompositor.h +++ b/gfx/layers/basic/BasicCompositor.h @@ -57,15 +57,15 @@ public: GetMaxTextureSize()); } - virtual TemporaryRef + virtual already_AddRefed CreateRenderTarget(const gfx::IntRect &aRect, SurfaceInitMode aInit) override; - virtual TemporaryRef + virtual already_AddRefed CreateRenderTargetFromSource(const gfx::IntRect &aRect, const CompositingRenderTarget *aSource, const gfx::IntPoint &aSourcePoint) override; - virtual TemporaryRef + virtual already_AddRefed CreateDataTextureSource(TextureFlags aFlags = TextureFlags::NO_FLAGS) override; virtual bool SupportsEffect(EffectTypes aEffect) override; diff --git a/gfx/layers/basic/BasicImageLayer.cpp b/gfx/layers/basic/BasicImageLayer.cpp index 376a8ba4214..5a48ceb56d2 100644 --- a/gfx/layers/basic/BasicImageLayer.cpp +++ b/gfx/layers/basic/BasicImageLayer.cpp @@ -49,7 +49,7 @@ public: const gfx::Point& aDeviceOffset, Layer* aMaskLayer) override; - virtual TemporaryRef GetAsSourceSurface() override; + virtual already_AddRefed GetAsSourceSurface() override; protected: BasicLayerManager* BasicManager() @@ -91,7 +91,7 @@ BasicImageLayer::Paint(DrawTarget* aDT, GetContainer()->NotifyPaintedImage(image); } -TemporaryRef +already_AddRefed BasicImageLayer::GetAsSourceSurface() { if (!mContainer) { diff --git a/gfx/layers/basic/BasicImages.cpp b/gfx/layers/basic/BasicImages.cpp index bcf0cd2978b..6289e4b5e1b 100644 --- a/gfx/layers/basic/BasicImages.cpp +++ b/gfx/layers/basic/BasicImages.cpp @@ -51,7 +51,7 @@ public: virtual void SetData(const Data& aData) override; virtual void SetDelayedConversion(bool aDelayed) override { mDelayedConversion = aDelayed; } - TemporaryRef GetAsSourceSurface() override; + already_AddRefed GetAsSourceSurface() override; virtual size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const override { @@ -130,7 +130,7 @@ BasicPlanarYCbCrImage::SetData(const Data& aData) mSize = size; } -TemporaryRef +already_AddRefed BasicPlanarYCbCrImage::GetAsSourceSurface() { NS_ASSERTION(NS_IsMainThread(), "Must be main thread"); diff --git a/gfx/layers/basic/BasicImplData.h b/gfx/layers/basic/BasicImplData.h index 202ba1b8fb0..2ae747f7119 100644 --- a/gfx/layers/basic/BasicImplData.h +++ b/gfx/layers/basic/BasicImplData.h @@ -116,7 +116,7 @@ public: * return false if a surface cannot be created. If true is * returned, only one of |aSurface| or |aDescriptor| is valid. */ - virtual TemporaryRef GetAsSourceSurface() { return nullptr; } + virtual already_AddRefed GetAsSourceSurface() { return nullptr; } bool GetClipToVisibleRegion() { return mClipToVisibleRegion; } void SetClipToVisibleRegion(bool aClip) { mClipToVisibleRegion = aClip; } diff --git a/gfx/layers/basic/MacIOSurfaceTextureHostBasic.h b/gfx/layers/basic/MacIOSurfaceTextureHostBasic.h index 9ae9bce935a..83f452ff0e4 100644 --- a/gfx/layers/basic/MacIOSurfaceTextureHostBasic.h +++ b/gfx/layers/basic/MacIOSurfaceTextureHostBasic.h @@ -70,7 +70,7 @@ public: return !!aTexture; } - virtual TemporaryRef GetAsSurface() override + virtual already_AddRefed GetAsSurface() override { return nullptr; // XXX - implement this (for MOZ_DUMP_PAINTING) } diff --git a/gfx/layers/basic/TextureClientX11.cpp b/gfx/layers/basic/TextureClientX11.cpp index ef7c069aef3..ab9446daa2a 100644 --- a/gfx/layers/basic/TextureClientX11.cpp +++ b/gfx/layers/basic/TextureClientX11.cpp @@ -34,7 +34,7 @@ TextureClientX11::~TextureClientX11() MOZ_COUNT_DTOR(TextureClientX11); } -TemporaryRef +already_AddRefed TextureClientX11::CreateSimilar(TextureFlags aFlags, TextureAllocationFlags aAllocFlags) const { diff --git a/gfx/layers/basic/TextureClientX11.h b/gfx/layers/basic/TextureClientX11.h index e3499e6f4a8..30b4d528c52 100644 --- a/gfx/layers/basic/TextureClientX11.h +++ b/gfx/layers/basic/TextureClientX11.h @@ -47,7 +47,7 @@ class TextureClientX11 : public TextureClient virtual bool HasInternalBuffer() const override { return false; } - virtual TemporaryRef + virtual already_AddRefed CreateSimilar(TextureFlags aFlags = TextureFlags::DEFAULT, TextureAllocationFlags aAllocFlags = ALLOC_DEFAULT) const override; diff --git a/gfx/layers/basic/TextureHostBasic.cpp b/gfx/layers/basic/TextureHostBasic.cpp index b5aeab5d14c..b75ad83d732 100644 --- a/gfx/layers/basic/TextureHostBasic.cpp +++ b/gfx/layers/basic/TextureHostBasic.cpp @@ -14,7 +14,7 @@ using namespace mozilla::gfx; namespace mozilla { namespace layers { -TemporaryRef +already_AddRefed CreateTextureHostBasic(const SurfaceDescriptor& aDesc, ISurfaceAllocator* aDeallocator, TextureFlags aFlags) diff --git a/gfx/layers/basic/X11BasicCompositor.cpp b/gfx/layers/basic/X11BasicCompositor.cpp index 01b86854f1f..b3e98e62602 100644 --- a/gfx/layers/basic/X11BasicCompositor.cpp +++ b/gfx/layers/basic/X11BasicCompositor.cpp @@ -117,7 +117,7 @@ X11DataTextureSourceBasic::DeallocateDeviceData() mBufferDrawTarget = nullptr; } -TemporaryRef +already_AddRefed X11BasicCompositor::CreateDataTextureSource(TextureFlags aFlags) { RefPtr result = diff --git a/gfx/layers/basic/X11BasicCompositor.h b/gfx/layers/basic/X11BasicCompositor.h index daeb8d15750..4e3cf037d8f 100644 --- a/gfx/layers/basic/X11BasicCompositor.h +++ b/gfx/layers/basic/X11BasicCompositor.h @@ -47,7 +47,7 @@ public: explicit X11BasicCompositor(nsIWidget *aWidget) : BasicCompositor(aWidget) {} - virtual TemporaryRef + virtual already_AddRefed CreateDataTextureSource(TextureFlags aFlags = TextureFlags::NO_FLAGS) override; virtual void EndFrame() override; diff --git a/gfx/layers/client/CanvasClient.cpp b/gfx/layers/client/CanvasClient.cpp index b17a25013b9..27216961073 100644 --- a/gfx/layers/client/CanvasClient.cpp +++ b/gfx/layers/client/CanvasClient.cpp @@ -30,7 +30,7 @@ using namespace mozilla::gl; namespace mozilla { namespace layers { -/* static */ TemporaryRef +/* static */ already_AddRefed CanvasClient::CreateCanvasClient(CanvasClientType aType, CompositableForwarder* aForwarder, TextureFlags aFlags) @@ -108,7 +108,7 @@ CanvasClient2D::Update(gfx::IntSize aSize, ClientCanvasLayer* aLayer) } } -TemporaryRef +already_AddRefed CanvasClient2D::CreateTextureClientForCanvas(gfx::SurfaceFormat aFormat, gfx::IntSize aSize, TextureFlags aFlags, @@ -179,20 +179,20 @@ public: } protected: - TemporaryRef Create(gfx::SurfaceFormat format) { + already_AddRefed Create(gfx::SurfaceFormat format) { return TextureClient::CreateForRawBufferAccess(mAllocator, format, mSize, mBackendType, mBaseTexFlags); } public: - TemporaryRef CreateB8G8R8AX8() { + already_AddRefed CreateB8G8R8AX8() { gfx::SurfaceFormat format = mHasAlpha ? gfx::SurfaceFormat::B8G8R8A8 : gfx::SurfaceFormat::B8G8R8X8; return Create(format); } - TemporaryRef CreateR8G8B8AX8() { + already_AddRefed CreateR8G8B8AX8() { RefPtr ret; bool areRGBAFormatsBroken = mLayersBackend == LayersBackend::LAYERS_BASIC; @@ -213,7 +213,7 @@ public: } }; -static TemporaryRef +static already_AddRefed TexClientFromReadback(SharedSurface* src, ISurfaceAllocator* allocator, TextureFlags baseFlags, LayersBackend layersBackend) { @@ -304,7 +304,7 @@ TexClientFromReadback(SharedSurface* src, ISurfaceAllocator* allocator, //////////////////////////////////////// -static TemporaryRef +static already_AddRefed CloneSurface(gl::SharedSurface* src, gl::SurfaceFactory* factory) { RefPtr dest = factory->NewTexClient(src->mSize); diff --git a/gfx/layers/client/CanvasClient.h b/gfx/layers/client/CanvasClient.h index a96d1e7f23e..14b08a7d32d 100644 --- a/gfx/layers/client/CanvasClient.h +++ b/gfx/layers/client/CanvasClient.h @@ -8,7 +8,7 @@ #include "mozilla/Assertions.h" // for MOZ_ASSERT, etc #include "mozilla/Attributes.h" // for override -#include "mozilla/RefPtr.h" // for RefPtr, TemporaryRef +#include "mozilla/RefPtr.h" // for RefPtr, already_AddRefed #include "mozilla/layers/CompositableClient.h" // for CompositableClient #include "mozilla/layers/CompositorTypes.h" // for TextureInfo, etc #include "mozilla/layers/LayersSurfaces.h" // for SurfaceDescriptor @@ -41,7 +41,7 @@ public: CanvasClientGLContext, CanvasClientTypeShSurf, }; - static TemporaryRef CreateCanvasClient(CanvasClientType aType, + static already_AddRefed CreateCanvasClient(CanvasClientType aType, CompositableForwarder* aFwd, TextureFlags aFlags); @@ -94,7 +94,7 @@ public: } private: - TemporaryRef + already_AddRefed CreateTextureClientForCanvas(gfx::SurfaceFormat aFormat, gfx::IntSize aSize, TextureFlags aFlags, diff --git a/gfx/layers/client/CompositableClient.cpp b/gfx/layers/client/CompositableClient.cpp index 342eee6dc11..3bfd6e951cb 100644 --- a/gfx/layers/client/CompositableClient.cpp +++ b/gfx/layers/client/CompositableClient.cpp @@ -193,7 +193,7 @@ CompositableClient::GetAsyncID() const return 0; // zero is always an invalid async ID } -TemporaryRef +already_AddRefed CompositableClient::CreateBufferTextureClient(gfx::SurfaceFormat aFormat, gfx::IntSize aSize, gfx::BackendType aMoz2DBackend, @@ -204,7 +204,7 @@ CompositableClient::CreateBufferTextureClient(gfx::SurfaceFormat aFormat, aTextureFlags | mTextureFlags); } -TemporaryRef +already_AddRefed CompositableClient::CreateTextureClientForDrawing(gfx::SurfaceFormat aFormat, gfx::IntSize aSize, gfx::BackendType aMoz2DBackend, diff --git a/gfx/layers/client/CompositableClient.h b/gfx/layers/client/CompositableClient.h index ba50fa9b301..3becbcc32a2 100644 --- a/gfx/layers/client/CompositableClient.h +++ b/gfx/layers/client/CompositableClient.h @@ -10,7 +10,7 @@ #include // for vector #include // for map #include "mozilla/Assertions.h" // for MOZ_CRASH -#include "mozilla/RefPtr.h" // for TemporaryRef, RefCounted +#include "mozilla/RefPtr.h" // for already_AddRefed, RefCounted #include "mozilla/gfx/Types.h" // for SurfaceFormat #include "mozilla/layers/AsyncTransactionTracker.h" // for AsyncTransactionTracker #include "mozilla/layers/CompositorTypes.h" @@ -129,13 +129,13 @@ public: LayersBackend GetCompositorBackendType() const; - TemporaryRef + already_AddRefed CreateBufferTextureClient(gfx::SurfaceFormat aFormat, gfx::IntSize aSize, gfx::BackendType aMoz2dBackend = gfx::BackendType::NONE, TextureFlags aFlags = TextureFlags::DEFAULT); - TemporaryRef + already_AddRefed CreateTextureClientForDrawing(gfx::SurfaceFormat aFormat, gfx::IntSize aSize, gfx::BackendType aMoz2DBackend, diff --git a/gfx/layers/client/ContentClient.cpp b/gfx/layers/client/ContentClient.cpp index 41644361db4..1a8853fccd9 100644 --- a/gfx/layers/client/ContentClient.cpp +++ b/gfx/layers/client/ContentClient.cpp @@ -59,7 +59,7 @@ static TextureFlags TextureFlagsForRotatedContentBufferFlags(uint32_t aBufferFla return result; } -/* static */ TemporaryRef +/* static */ already_AddRefed ContentClient::CreateContentClient(CompositableForwarder* aForwarder) { LayersBackend backend = aForwarder->GetCompositorBackendType(); diff --git a/gfx/layers/client/ContentClient.h b/gfx/layers/client/ContentClient.h index 4b432d638d3..60cf329f444 100644 --- a/gfx/layers/client/ContentClient.h +++ b/gfx/layers/client/ContentClient.h @@ -12,7 +12,7 @@ #include "gfxPlatform.h" // for gfxPlatform #include "mozilla/Assertions.h" // for MOZ_CRASH #include "mozilla/Attributes.h" // for override -#include "mozilla/RefPtr.h" // for RefPtr, TemporaryRef +#include "mozilla/RefPtr.h" // for RefPtr, already_AddRefed #include "mozilla/gfx/Point.h" // for IntSize #include "mozilla/layers/CompositableClient.h" // for CompositableClient #include "mozilla/layers/CompositableForwarder.h" @@ -78,7 +78,7 @@ public: * message will be sent to the compositor to create a corresponding content * host. */ - static TemporaryRef CreateContentClient(CompositableForwarder* aFwd); + static already_AddRefed CreateContentClient(CompositableForwarder* aFwd); explicit ContentClient(CompositableForwarder* aForwarder) : CompositableClient(aForwarder) diff --git a/gfx/layers/client/ImageClient.cpp b/gfx/layers/client/ImageClient.cpp index 10d91c2c1f8..454b3cf7162 100644 --- a/gfx/layers/client/ImageClient.cpp +++ b/gfx/layers/client/ImageClient.cpp @@ -11,7 +11,7 @@ #include "gfx2DGlue.h" // for ImageFormatToSurfaceFormat #include "gfxPlatform.h" // for gfxPlatform #include "mozilla/Assertions.h" // for MOZ_ASSERT, etc -#include "mozilla/RefPtr.h" // for RefPtr, TemporaryRef +#include "mozilla/RefPtr.h" // for RefPtr, already_AddRefed #include "mozilla/gfx/BaseSize.h" // for BaseSize #include "mozilla/gfx/Point.h" // for IntSize #include "mozilla/gfx/Types.h" // for SurfaceFormat, etc @@ -41,7 +41,7 @@ namespace layers { using namespace mozilla::gfx; -/* static */ TemporaryRef +/* static */ already_AddRefed ImageClient::CreateImageClient(CompositableType aCompositableHostType, CompositableForwarder* aForwarder, TextureFlags aFlags) @@ -117,7 +117,7 @@ TextureInfo ImageClientSingle::GetTextureInfo() const return TextureInfo(CompositableType::IMAGE); } -TemporaryRef +already_AddRefed ImageClientSingle::PrepareFlushAllImages() { return MakeAndAddRef(); diff --git a/gfx/layers/client/ImageClient.h b/gfx/layers/client/ImageClient.h index 1d665d8ef25..889acdddf72 100644 --- a/gfx/layers/client/ImageClient.h +++ b/gfx/layers/client/ImageClient.h @@ -9,7 +9,7 @@ #include // for uint32_t, uint64_t #include // for int32_t #include "mozilla/Attributes.h" // for override -#include "mozilla/RefPtr.h" // for RefPtr, TemporaryRef +#include "mozilla/RefPtr.h" // for RefPtr, already_AddRefed #include "mozilla/gfx/Types.h" // for SurfaceFormat #include "mozilla/layers/AsyncTransactionTracker.h" // for AsyncTransactionTracker #include "mozilla/layers/CompositableClient.h" // for CompositableClient @@ -42,7 +42,7 @@ public: * message will be sent to the compositor to create a corresponding image * host. */ - static TemporaryRef CreateImageClient(CompositableType aImageHostType, + static already_AddRefed CreateImageClient(CompositableType aImageHostType, CompositableForwarder* aFwd, TextureFlags aFlags); @@ -66,7 +66,7 @@ public: /** * Create AsyncTransactionTracker that is used for FlushAllImagesAsync(). */ - virtual TemporaryRef PrepareFlushAllImages() { return nullptr; } + virtual already_AddRefed PrepareFlushAllImages() { return nullptr; } /** * asynchronously remove all the textures used by the image client. @@ -109,7 +109,7 @@ public: virtual already_AddRefed CreateImage(ImageFormat aFormat) override; - virtual TemporaryRef PrepareFlushAllImages() override; + virtual already_AddRefed PrepareFlushAllImages() override; virtual void FlushAllImages(bool aExceptFront, AsyncTransactionTracker* aAsyncTransactionTracker) override; diff --git a/gfx/layers/client/TextureClient.cpp b/gfx/layers/client/TextureClient.cpp index 50de9d1f917..4478b4adb59 100644 --- a/gfx/layers/client/TextureClient.cpp +++ b/gfx/layers/client/TextureClient.cpp @@ -302,7 +302,7 @@ DisableGralloc(SurfaceFormat aFormat, const gfx::IntSize& aSizeHint) #endif static -TemporaryRef +already_AddRefed CreateBufferTextureClient(ISurfaceAllocator* aAllocator, SurfaceFormat aFormat, TextureFlags aTextureFlags, @@ -321,7 +321,7 @@ CreateBufferTextureClient(ISurfaceAllocator* aAllocator, } // static -TemporaryRef +already_AddRefed TextureClient::CreateForDrawing(ISurfaceAllocator* aAllocator, gfx::SurfaceFormat aFormat, gfx::IntSize aSize, @@ -428,7 +428,7 @@ TextureClient::CreateForDrawing(ISurfaceAllocator* aAllocator, } // static -TemporaryRef +already_AddRefed TextureClient::CreateForRawBufferAccess(ISurfaceAllocator* aAllocator, gfx::SurfaceFormat aFormat, gfx::IntSize aSize, @@ -448,7 +448,7 @@ TextureClient::CreateForRawBufferAccess(ISurfaceAllocator* aAllocator, } // static -TemporaryRef +already_AddRefed TextureClient::CreateForYCbCr(ISurfaceAllocator* aAllocator, gfx::IntSize aYSize, gfx::IntSize aCbCrSize, @@ -474,7 +474,7 @@ TextureClient::CreateForYCbCr(ISurfaceAllocator* aAllocator, } // static -TemporaryRef +already_AddRefed TextureClient::CreateWithBufferSize(ISurfaceAllocator* aAllocator, gfx::SurfaceFormat aFormat, size_t aSize, @@ -755,7 +755,7 @@ BufferTextureClient::BufferTextureClient(ISurfaceAllocator* aAllocator, BufferTextureClient::~BufferTextureClient() {} -TemporaryRef +already_AddRefed BufferTextureClient::CreateSimilar(TextureFlags aFlags, TextureAllocationFlags aAllocFlags) const { @@ -917,7 +917,7 @@ BufferTextureClient::GetLockedData() const return serializer.GetData(); } -TemporaryRef +already_AddRefed SyncObject::CreateSyncObject(SyncHandle aHandle) { if (!aHandle) { diff --git a/gfx/layers/client/TextureClient.h b/gfx/layers/client/TextureClient.h index 44c606e3657..e481f0455d3 100644 --- a/gfx/layers/client/TextureClient.h +++ b/gfx/layers/client/TextureClient.h @@ -79,7 +79,7 @@ public: MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(SyncObject) virtual ~SyncObject() { } - static TemporaryRef CreateSyncObject(SyncHandle aHandle); + static already_AddRefed CreateSyncObject(SyncHandle aHandle); enum class SyncType { D3D11, @@ -170,7 +170,7 @@ public: virtual ~TextureClient(); // Creates and allocates a TextureClient usable with Moz2D. - static TemporaryRef + static already_AddRefed CreateForDrawing(ISurfaceAllocator* aAllocator, gfx::SurfaceFormat aFormat, gfx::IntSize aSize, @@ -179,7 +179,7 @@ public: TextureAllocationFlags flags = ALLOC_DEFAULT); // Creates and allocates a BufferTextureClient supporting the YCbCr format. - static TemporaryRef + static already_AddRefed CreateForYCbCr(ISurfaceAllocator* aAllocator, gfx::IntSize aYSize, gfx::IntSize aCbCrSize, @@ -188,7 +188,7 @@ public: // Creates and allocates a BufferTextureClient (can beaccessed through raw // pointers). - static TemporaryRef + static already_AddRefed CreateForRawBufferAccess(ISurfaceAllocator* aAllocator, gfx::SurfaceFormat aFormat, gfx::IntSize aSize, @@ -199,14 +199,14 @@ public: // Creates and allocates a BufferTextureClient (can beaccessed through raw // pointers) with a certain buffer size. It's unfortunate that we need this. // providing format and sizes could let us do more optimization. - static TemporaryRef + static already_AddRefed CreateWithBufferSize(ISurfaceAllocator* aAllocator, gfx::SurfaceFormat aFormat, size_t aSize, TextureFlags aTextureFlags); // Creates and allocates a TextureClient of the same type. - virtual TemporaryRef + virtual already_AddRefed CreateSimilar(TextureFlags aFlags = TextureFlags::DEFAULT, TextureAllocationFlags aAllocFlags = ALLOC_DEFAULT) const = 0; @@ -278,7 +278,7 @@ public: * This method is strictly for debugging. It causes locking and * needless copies. */ - virtual TemporaryRef GetAsSurface() { + virtual already_AddRefed GetAsSurface() { Lock(OpenMode::OPEN_READ); RefPtr surf = BorrowDrawTarget()->Snapshot(); RefPtr data = surf->GetDataSurface(); @@ -611,7 +611,7 @@ public: virtual bool HasInternalBuffer() const override { return true; } - virtual TemporaryRef + virtual already_AddRefed CreateSimilar(TextureFlags aFlags = TextureFlags::DEFAULT, TextureAllocationFlags aAllocFlags = ALLOC_DEFAULT) const override; diff --git a/gfx/layers/client/TextureClientPool.cpp b/gfx/layers/client/TextureClientPool.cpp index 1ca3399fb12..16308eb0be0 100644 --- a/gfx/layers/client/TextureClientPool.cpp +++ b/gfx/layers/client/TextureClientPool.cpp @@ -81,7 +81,7 @@ static bool TestClientPool(const char* what, } #endif -TemporaryRef +already_AddRefed TextureClientPool::GetTextureClient() { // Try to fetch a client from the pool diff --git a/gfx/layers/client/TextureClientPool.h b/gfx/layers/client/TextureClientPool.h index b491b45c884..23fcbe861cf 100644 --- a/gfx/layers/client/TextureClientPool.h +++ b/gfx/layers/client/TextureClientPool.h @@ -39,7 +39,7 @@ public: * All clients retrieved by this method should be returned using the return * functions, or reported lost so that the pool can manage its size correctly. */ - TemporaryRef GetTextureClient(); + already_AddRefed GetTextureClient(); /** * Return a TextureClient that is no longer being used and is ready for diff --git a/gfx/layers/client/TextureClientRecycleAllocator.cpp b/gfx/layers/client/TextureClientRecycleAllocator.cpp index 4bda47aa730..ec9b04a1ded 100644 --- a/gfx/layers/client/TextureClientRecycleAllocator.cpp +++ b/gfx/layers/client/TextureClientRecycleAllocator.cpp @@ -31,7 +31,7 @@ public: } // Creates and allocates a TextureClient. - TemporaryRef + already_AddRefed CreateOrRecycleForDrawing(gfx::SurfaceFormat aFormat, gfx::IntSize aSize, gfx::BackendType aMoz2dBackend, @@ -137,7 +137,7 @@ TextureClientRecycleAllocatorImp::~TextureClientRecycleAllocatorImp() MOZ_ASSERT(mInUseClients.empty()); } -TemporaryRef +already_AddRefed TextureClientRecycleAllocatorImp::CreateOrRecycleForDrawing( gfx::SurfaceFormat aFormat, gfx::IntSize aSize, @@ -257,7 +257,7 @@ TextureClientRecycleAllocator::SetMaxPoolSize(uint32_t aMax) mAllocator->SetMaxPoolSize(aMax); } -TemporaryRef +already_AddRefed TextureClientRecycleAllocator::CreateOrRecycleForDrawing( gfx::SurfaceFormat aFormat, gfx::IntSize aSize, diff --git a/gfx/layers/client/TextureClientRecycleAllocator.h b/gfx/layers/client/TextureClientRecycleAllocator.h index 41747e98d44..59e252e9898 100644 --- a/gfx/layers/client/TextureClientRecycleAllocator.h +++ b/gfx/layers/client/TextureClientRecycleAllocator.h @@ -35,7 +35,7 @@ public: void SetMaxPoolSize(uint32_t aMax); // Creates and allocates a TextureClient. - TemporaryRef + already_AddRefed CreateOrRecycleForDrawing(gfx::SurfaceFormat aFormat, gfx::IntSize aSize, gfx::BackendType aMoz2dBackend, diff --git a/gfx/layers/client/TextureClientSharedSurface.h b/gfx/layers/client/TextureClientSharedSurface.h index 3bdc1d2d5b9..c65543a2706 100644 --- a/gfx/layers/client/TextureClientSharedSurface.h +++ b/gfx/layers/client/TextureClientSharedSurface.h @@ -49,7 +49,7 @@ public: return gfx::SurfaceFormat::UNKNOWN; } - virtual TemporaryRef + virtual already_AddRefed CreateSimilar(TextureFlags, TextureAllocationFlags) const override { return nullptr; } diff --git a/gfx/layers/composite/CompositableHost.cpp b/gfx/layers/composite/CompositableHost.cpp index 21eb3b5e125..4ec60dda583 100644 --- a/gfx/layers/composite/CompositableHost.cpp +++ b/gfx/layers/composite/CompositableHost.cpp @@ -178,7 +178,7 @@ CompositableHost::RemoveMaskEffect() } } -/* static */ TemporaryRef +/* static */ already_AddRefed CompositableHost::Create(const TextureInfo& aTextureInfo) { RefPtr result; diff --git a/gfx/layers/composite/CompositableHost.h b/gfx/layers/composite/CompositableHost.h index 52e1e1cec2a..7f342827fe0 100644 --- a/gfx/layers/composite/CompositableHost.h +++ b/gfx/layers/composite/CompositableHost.h @@ -67,7 +67,7 @@ public: NS_INLINE_DECL_REFCOUNTING(CompositableHost) explicit CompositableHost(const TextureInfo& aTextureInfo); - static TemporaryRef Create(const TextureInfo& aTextureInfo); + static already_AddRefed Create(const TextureInfo& aTextureInfo); virtual CompositableType GetType() = 0; @@ -183,7 +183,7 @@ public: bool aDumpHtml=false) { } static void DumpTextureHost(std::stringstream& aStream, TextureHost* aTexture); - virtual TemporaryRef GetAsSurface() { return nullptr; } + virtual already_AddRefed GetAsSurface() { return nullptr; } virtual void PrintInfo(std::stringstream& aStream, const char* aPrefix) = 0; @@ -221,7 +221,7 @@ public: virtual void Unlock() { } - virtual TemporaryRef GenEffect(const gfx::Filter& aFilter) { + virtual already_AddRefed GenEffect(const gfx::Filter& aFilter) { return nullptr; } diff --git a/gfx/layers/composite/ContentHost.cpp b/gfx/layers/composite/ContentHost.cpp index a3bd8433b6f..16841d518ae 100644 --- a/gfx/layers/composite/ContentHost.cpp +++ b/gfx/layers/composite/ContentHost.cpp @@ -444,7 +444,7 @@ ContentHostTexture::GetRenderState() return result; } -TemporaryRef +already_AddRefed ContentHostTexture::GenEffect(const gfx::Filter& aFilter) { if (!mTextureHost) { @@ -465,7 +465,7 @@ ContentHostTexture::GenEffect(const gfx::Filter& aFilter) GetRenderState()); } -TemporaryRef +already_AddRefed ContentHostTexture::GetAsSurface() { if (!mTextureHost) { diff --git a/gfx/layers/composite/ContentHost.h b/gfx/layers/composite/ContentHost.h index a717c297f23..2d9ef1ad575 100644 --- a/gfx/layers/composite/ContentHost.h +++ b/gfx/layers/composite/ContentHost.h @@ -128,7 +128,7 @@ public: virtual void SetCompositor(Compositor* aCompositor) override; - virtual TemporaryRef GetAsSurface() override; + virtual already_AddRefed GetAsSurface() override; virtual void Dump(std::stringstream& aStream, const char* aPrefix="", @@ -167,7 +167,7 @@ public: LayerRenderState GetRenderState() override; - virtual TemporaryRef GenEffect(const gfx::Filter& aFilter) override; + virtual already_AddRefed GenEffect(const gfx::Filter& aFilter) override; protected: CompositableTextureHostRef mTextureHost; diff --git a/gfx/layers/composite/FPSCounter.h b/gfx/layers/composite/FPSCounter.h index f1a3cd58610..c3a243a22a8 100644 --- a/gfx/layers/composite/FPSCounter.h +++ b/gfx/layers/composite/FPSCounter.h @@ -10,7 +10,7 @@ #include // for size_t #include // for std::map #include "GLDefs.h" // for GLuint -#include "mozilla/RefPtr.h" // for TemporaryRef, RefCounted +#include "mozilla/RefPtr.h" // for already_AddRefed, RefCounted #include "mozilla/TimeStamp.h" // for TimeStamp, TimeDuration #include "nsTArray.h" // for nsAutoTArray, nsTArray_Impl, etc #include "prio.h" // for NSPR file i/o diff --git a/gfx/layers/composite/ImageHost.cpp b/gfx/layers/composite/ImageHost.cpp index 8664ec5339a..932936e4062 100644 --- a/gfx/layers/composite/ImageHost.cpp +++ b/gfx/layers/composite/ImageHost.cpp @@ -241,7 +241,7 @@ ImageHost::GetRenderState() return LayerRenderState(); } -TemporaryRef +already_AddRefed ImageHost::GetAsSurface() { return mFrontBuffer->GetAsSurface(); @@ -285,7 +285,7 @@ ImageHost::GetImageSize() const return IntSize(); } -TemporaryRef +already_AddRefed ImageHost::GenEffect(const gfx::Filter& aFilter) { if (!mFrontBuffer->BindTextureSource(mTextureSource)) { diff --git a/gfx/layers/composite/ImageHost.h b/gfx/layers/composite/ImageHost.h index 5ed3e78bfbb..f276d731774 100644 --- a/gfx/layers/composite/ImageHost.h +++ b/gfx/layers/composite/ImageHost.h @@ -75,13 +75,13 @@ public: const char* aPrefix = "", bool aDumpHtml = false) override; - virtual TemporaryRef GetAsSurface() override; + virtual already_AddRefed GetAsSurface() override; virtual bool Lock() override; virtual void Unlock() override; - virtual TemporaryRef GenEffect(const gfx::Filter& aFilter) override; + virtual already_AddRefed GenEffect(const gfx::Filter& aFilter) override; protected: diff --git a/gfx/layers/composite/LayerManagerComposite.cpp b/gfx/layers/composite/LayerManagerComposite.cpp index 99331ca8b69..f713dd4a567 100644 --- a/gfx/layers/composite/LayerManagerComposite.cpp +++ b/gfx/layers/composite/LayerManagerComposite.cpp @@ -30,7 +30,7 @@ #include "gfxRect.h" // for gfxRect #include "gfxUtils.h" // for frame color util #include "mozilla/Assertions.h" // for MOZ_ASSERT, etc -#include "mozilla/RefPtr.h" // for RefPtr, TemporaryRef +#include "mozilla/RefPtr.h" // for RefPtr, already_AddRefed #include "mozilla/gfx/2D.h" // for DrawTarget #include "mozilla/gfx/Matrix.h" // for Matrix4x4 #include "mozilla/gfx/Point.h" // for IntSize, Point @@ -330,7 +330,7 @@ LayerManagerComposite::EndTransaction(DrawPaintedLayerCallback aCallback, #endif } -TemporaryRef +already_AddRefed LayerManagerComposite::CreateOptimalMaskDrawTarget(const IntSize &aSize) { NS_RUNTIMEABORT("Should only be called on the drawing side"); @@ -1254,7 +1254,7 @@ LayerManagerComposite::AutoAddMaskEffect::~AutoAddMaskEffect() mCompositable->RemoveMaskEffect(); } -TemporaryRef +already_AddRefed LayerManagerComposite::CreateDrawTarget(const IntSize &aSize, SurfaceFormat aFormat) { diff --git a/gfx/layers/composite/LayerManagerComposite.h b/gfx/layers/composite/LayerManagerComposite.h index 5cfbe7c4244..e82a417805a 100644 --- a/gfx/layers/composite/LayerManagerComposite.h +++ b/gfx/layers/composite/LayerManagerComposite.h @@ -12,7 +12,7 @@ #include "Units.h" // for ParentLayerIntRect #include "mozilla/Assertions.h" // for MOZ_ASSERT, etc #include "mozilla/Attributes.h" // for override -#include "mozilla/RefPtr.h" // for RefPtr, TemporaryRef +#include "mozilla/RefPtr.h" // for RefPtr, already_AddRefed #include "mozilla/gfx/2D.h" #include "mozilla/gfx/Point.h" // for IntSize #include "mozilla/gfx/Rect.h" // for Rect @@ -152,7 +152,7 @@ public: virtual bool AreComponentAlphaLayersEnabled() override; - virtual TemporaryRef + virtual already_AddRefed CreateOptimalMaskDrawTarget(const IntSize &aSize) override; virtual const char* Name() const override { return ""; } @@ -186,7 +186,7 @@ public: * Creates a DrawTarget which is optimized for inter-operating with this * layermanager. */ - virtual TemporaryRef + virtual already_AddRefed CreateDrawTarget(const mozilla::gfx::IntSize& aSize, mozilla::gfx::SurfaceFormat aFormat) override; diff --git a/gfx/layers/composite/TextureHost.cpp b/gfx/layers/composite/TextureHost.cpp index 6337494c5d9..88afad11756 100644 --- a/gfx/layers/composite/TextureHost.cpp +++ b/gfx/layers/composite/TextureHost.cpp @@ -176,27 +176,27 @@ TextureHost::GetAndResetAcquireFenceHandle() } // implemented in TextureHostOGL.cpp -TemporaryRef CreateTextureHostOGL(const SurfaceDescriptor& aDesc, +already_AddRefed CreateTextureHostOGL(const SurfaceDescriptor& aDesc, ISurfaceAllocator* aDeallocator, TextureFlags aFlags); // implemented in TextureHostBasic.cpp -TemporaryRef CreateTextureHostBasic(const SurfaceDescriptor& aDesc, +already_AddRefed CreateTextureHostBasic(const SurfaceDescriptor& aDesc, ISurfaceAllocator* aDeallocator, TextureFlags aFlags); // implemented in TextureD3D11.cpp -TemporaryRef CreateTextureHostD3D11(const SurfaceDescriptor& aDesc, +already_AddRefed CreateTextureHostD3D11(const SurfaceDescriptor& aDesc, ISurfaceAllocator* aDeallocator, TextureFlags aFlags); // implemented in TextureD3D9.cpp -TemporaryRef CreateTextureHostD3D9(const SurfaceDescriptor& aDesc, +already_AddRefed CreateTextureHostD3D9(const SurfaceDescriptor& aDesc, ISurfaceAllocator* aDeallocator, TextureFlags aFlags); // static -TemporaryRef +already_AddRefed TextureHost::Create(const SurfaceDescriptor& aDesc, ISurfaceAllocator* aDeallocator, TextureFlags aFlags) @@ -244,7 +244,7 @@ TextureHost::Create(const SurfaceDescriptor& aDesc, } } -TemporaryRef +already_AddRefed CreateBackendIndependentTextureHost(const SurfaceDescriptor& aDesc, ISurfaceAllocator* aDeallocator, TextureFlags aFlags) @@ -613,7 +613,7 @@ BufferTextureHost::Upload(nsIntRegion *aRegion) return true; } -TemporaryRef +already_AddRefed BufferTextureHost::GetAsSurface() { RefPtr result; diff --git a/gfx/layers/composite/TextureHost.h b/gfx/layers/composite/TextureHost.h index 0596913bfbc..4a691dfe50e 100644 --- a/gfx/layers/composite/TextureHost.h +++ b/gfx/layers/composite/TextureHost.h @@ -11,7 +11,7 @@ #include "gfxTypes.h" #include "mozilla/Assertions.h" // for MOZ_ASSERT, etc #include "mozilla/Attributes.h" // for override -#include "mozilla/RefPtr.h" // for RefPtr, TemporaryRef, etc +#include "mozilla/RefPtr.h" // for RefPtr, already_AddRefed, etc #include "mozilla/gfx/2D.h" // for DataSourceSurface #include "mozilla/gfx/Point.h" // for IntSize, IntPoint #include "mozilla/gfx/Types.h" // for SurfaceFormat, etc @@ -268,7 +268,7 @@ public: * This is expected to be very slow and should be used for mostly debugging. * XXX - implement everywhere and make it pure virtual. */ - virtual TemporaryRef ReadBack() { return nullptr; }; + virtual already_AddRefed ReadBack() { return nullptr; }; #endif private: @@ -325,7 +325,7 @@ public: /** * Factory method. */ - static TemporaryRef Create(const SurfaceDescriptor& aDesc, + static already_AddRefed Create(const SurfaceDescriptor& aDesc, ISurfaceAllocator* aDeallocator, TextureFlags aFlags); @@ -421,7 +421,7 @@ public: * Debug facility. * XXX - cool kids use Moz2D. See bug 882113. */ - virtual TemporaryRef GetAsSurface() = 0; + virtual already_AddRefed GetAsSurface() = 0; /** * XXX - Flags should only be set at creation time, this will be removed. @@ -589,7 +589,7 @@ public: virtual gfx::IntSize GetSize() const override { return mSize; } - virtual TemporaryRef GetAsSurface() override; + virtual already_AddRefed GetAsSurface() override; virtual bool HasInternalBuffer() const override { return true; } @@ -715,7 +715,7 @@ public: virtual ~CompositingRenderTarget() {} #ifdef MOZ_DUMP_PAINTING - virtual TemporaryRef Dump(Compositor* aCompositor) { return nullptr; } + virtual already_AddRefed Dump(Compositor* aCompositor) { return nullptr; } #endif /** @@ -740,7 +740,7 @@ private: * Creates a TextureHost that can be used with any of the existing backends * Not all SurfaceDescriptor types are supported */ -TemporaryRef +already_AddRefed CreateBackendIndependentTextureHost(const SurfaceDescriptor& aDesc, ISurfaceAllocator* aDeallocator, TextureFlags aFlags); diff --git a/gfx/layers/composite/X11TextureHost.cpp b/gfx/layers/composite/X11TextureHost.cpp index 306782e8494..614510740e0 100644 --- a/gfx/layers/composite/X11TextureHost.cpp +++ b/gfx/layers/composite/X11TextureHost.cpp @@ -86,7 +86,7 @@ X11TextureHost::GetSize() const return mSurface->GetSize(); } -TemporaryRef +already_AddRefed X11TextureHost::GetAsSurface() { if (!mTextureSource || !mTextureSource->AsSourceBasic()) { diff --git a/gfx/layers/composite/X11TextureHost.h b/gfx/layers/composite/X11TextureHost.h index 91fc5d436ab..a57fb08e45d 100644 --- a/gfx/layers/composite/X11TextureHost.h +++ b/gfx/layers/composite/X11TextureHost.h @@ -36,7 +36,7 @@ public: return !!aTexture; } - virtual TemporaryRef GetAsSurface() override; + virtual already_AddRefed GetAsSurface() override; #ifdef MOZ_LAYERS_HAVE_LOG virtual const char* Name() override { return "X11TextureHost"; } diff --git a/gfx/layers/d3d11/CompositorD3D11.cpp b/gfx/layers/d3d11/CompositorD3D11.cpp index e85296f3cd5..3c2c5604365 100644 --- a/gfx/layers/d3d11/CompositorD3D11.cpp +++ b/gfx/layers/d3d11/CompositorD3D11.cpp @@ -395,7 +395,7 @@ CompositorD3D11::Initialize() return true; } -TemporaryRef +already_AddRefed CompositorD3D11::CreateDataTextureSource(TextureFlags aFlags) { RefPtr result = new DataTextureSourceD3D11(gfx::SurfaceFormat::UNKNOWN, @@ -439,7 +439,7 @@ CompositorD3D11::GetMaxTextureSize() const return GetMaxTextureSizeForFeatureLevel(mFeatureLevel); } -TemporaryRef +already_AddRefed CompositorD3D11::CreateRenderTarget(const gfx::IntRect& aRect, SurfaceInitMode aInit) { @@ -470,7 +470,7 @@ CompositorD3D11::CreateRenderTarget(const gfx::IntRect& aRect, return rt.forget(); } -TemporaryRef +already_AddRefed CompositorD3D11::CreateRenderTargetFromSource(const gfx::IntRect &aRect, const CompositingRenderTarget* aSource, const gfx::IntPoint &aSourcePoint) diff --git a/gfx/layers/d3d11/CompositorD3D11.h b/gfx/layers/d3d11/CompositorD3D11.h index 88141ca85a5..394560381ae 100644 --- a/gfx/layers/d3d11/CompositorD3D11.h +++ b/gfx/layers/d3d11/CompositorD3D11.h @@ -51,7 +51,7 @@ public: virtual TextureFactoryIdentifier GetTextureFactoryIdentifier() override; - virtual TemporaryRef + virtual already_AddRefed CreateDataTextureSource(TextureFlags aFlags = TextureFlags::NO_FLAGS) override; virtual bool CanUseCanvasLayerForSize(const gfx::IntSize& aSize) override; @@ -59,11 +59,11 @@ public: virtual void MakeCurrent(MakeCurrentFlags aFlags = 0) override {} - virtual TemporaryRef + virtual already_AddRefed CreateRenderTarget(const gfx::IntRect &aRect, SurfaceInitMode aInit) override; - virtual TemporaryRef + virtual already_AddRefed CreateRenderTargetFromSource(const gfx::IntRect& aRect, const CompositingRenderTarget* aSource, const gfx::IntPoint& aSourcePoint) override; diff --git a/gfx/layers/d3d11/TextureD3D11.cpp b/gfx/layers/d3d11/TextureD3D11.cpp index 309186bf8c3..4f3bcf1de2f 100644 --- a/gfx/layers/d3d11/TextureD3D11.cpp +++ b/gfx/layers/d3d11/TextureD3D11.cpp @@ -141,7 +141,7 @@ static void UnlockD3DTexture(T* aTexture) } } -TemporaryRef +already_AddRefed CreateTextureHostD3D11(const SurfaceDescriptor& aDesc, ISurfaceAllocator* aDeallocator, TextureFlags aFlags) @@ -213,7 +213,7 @@ TextureClientD3D11::~TextureClientD3D11() } // static -TemporaryRef +already_AddRefed TextureClientD3D11::Create(ISurfaceAllocator* aAllocator, gfx::SurfaceFormat aFormat, TextureFlags aFlags, @@ -228,7 +228,7 @@ TextureClientD3D11::Create(ISurfaceAllocator* aAllocator, return texture.forget(); } -TemporaryRef +already_AddRefed TextureClientD3D11::CreateSimilar(TextureFlags aFlags, TextureAllocationFlags aAllocFlags) const { @@ -554,7 +554,7 @@ DXGIYCbCrTextureClient::~DXGIYCbCrTextureClient() } // static -TemporaryRef +already_AddRefed DXGIYCbCrTextureClient::Create(ISurfaceAllocator* aAllocator, TextureFlags aFlags, IUnknown* aTextureY, diff --git a/gfx/layers/d3d11/TextureD3D11.h b/gfx/layers/d3d11/TextureD3D11.h index 1125d3efab6..c8e998c7bbb 100644 --- a/gfx/layers/d3d11/TextureD3D11.h +++ b/gfx/layers/d3d11/TextureD3D11.h @@ -33,7 +33,7 @@ public: virtual ~TextureClientD3D11(); // Creates a TextureClient and init width. - static TemporaryRef + static already_AddRefed Create(ISurfaceAllocator* aAllocator, gfx::SurfaceFormat aFormat, TextureFlags aFlags, @@ -67,7 +67,7 @@ public: virtual bool AllocateForSurface(gfx::IntSize aSize, TextureAllocationFlags aFlags = ALLOC_DEFAULT) override; - virtual TemporaryRef + virtual already_AddRefed CreateSimilar(TextureFlags aFlags = TextureFlags::DEFAULT, TextureAllocationFlags aAllocFlags = ALLOC_DEFAULT) const override; @@ -93,7 +93,7 @@ public: virtual ~DXGIYCbCrTextureClient(); // Creates a TextureClient and init width. - static TemporaryRef + static already_AddRefed Create(ISurfaceAllocator* aAllocator, TextureFlags aFlags, IUnknown* aTextureY, @@ -128,7 +128,7 @@ public: // This TextureClient should not be used in a context where we use CreateSimilar // (ex. component alpha) because the underlying texture data is always created by // an external producer. - virtual TemporaryRef + virtual already_AddRefed CreateSimilar(TextureFlags, TextureAllocationFlags) const override{ return nullptr; } private: @@ -257,7 +257,7 @@ public: virtual gfx::IntSize GetSize() const override { return mSize; } - virtual TemporaryRef GetAsSurface() override + virtual already_AddRefed GetAsSurface() override { return nullptr; } @@ -296,7 +296,7 @@ public: virtual gfx::IntSize GetSize() const override{ return mSize; } - virtual TemporaryRef GetAsSurface() override + virtual already_AddRefed GetAsSurface() override { return nullptr; } diff --git a/gfx/layers/d3d9/CompositorD3D9.cpp b/gfx/layers/d3d9/CompositorD3D9.cpp index f291f4c9255..514606adaa7 100644 --- a/gfx/layers/d3d9/CompositorD3D9.cpp +++ b/gfx/layers/d3d9/CompositorD3D9.cpp @@ -94,13 +94,13 @@ CompositorD3D9::GetMaxTextureSize() const return mDeviceManager ? mDeviceManager->GetMaxTextureSize() : INT32_MAX; } -TemporaryRef +already_AddRefed CompositorD3D9::CreateDataTextureSource(TextureFlags aFlags) { return MakeAndAddRef(SurfaceFormat::UNKNOWN, this, aFlags); } -TemporaryRef +already_AddRefed CompositorD3D9::CreateRenderTarget(const gfx::IntRect &aRect, SurfaceInitMode aInit) { @@ -128,7 +128,7 @@ CompositorD3D9::CreateRenderTarget(const gfx::IntRect &aRect, return MakeAndAddRef(texture, aInit, aRect); } -TemporaryRef +already_AddRefed CompositorD3D9::CreateRenderTargetFromSource(const gfx::IntRect &aRect, const CompositingRenderTarget *aSource, const gfx::IntPoint &aSourcePoint) diff --git a/gfx/layers/d3d9/CompositorD3D9.h b/gfx/layers/d3d9/CompositorD3D9.h index f754e7e804f..306165a1037 100644 --- a/gfx/layers/d3d9/CompositorD3D9.h +++ b/gfx/layers/d3d9/CompositorD3D9.h @@ -35,11 +35,11 @@ public: virtual void MakeCurrent(MakeCurrentFlags aFlags = 0) override {} - virtual TemporaryRef + virtual already_AddRefed CreateRenderTarget(const gfx::IntRect &aRect, SurfaceInitMode aInit) override; - virtual TemporaryRef + virtual already_AddRefed CreateRenderTargetFromSource(const gfx::IntRect &aRect, const CompositingRenderTarget *aSource, const gfx::IntPoint &aSourcePoint) override; @@ -118,7 +118,7 @@ public: // If the offset is 0, 0 that's okay. } - virtual TemporaryRef + virtual already_AddRefed CreateDataTextureSource(TextureFlags aFlags = TextureFlags::NO_FLAGS) override; private: // ensure mSize is up to date with respect to mWidget diff --git a/gfx/layers/d3d9/DeviceManagerD3D9.cpp b/gfx/layers/d3d9/DeviceManagerD3D9.cpp index f7140a8ad96..adeb7fe49fe 100644 --- a/gfx/layers/d3d9/DeviceManagerD3D9.cpp +++ b/gfx/layers/d3d9/DeviceManagerD3D9.cpp @@ -821,7 +821,7 @@ DeviceManagerD3D9::CreateVertexBuffer() return true; } -TemporaryRef +already_AddRefed DeviceManagerD3D9::CreateTexture(const IntSize &aSize, _D3DFORMAT aFormat, D3DPOOL aPool, diff --git a/gfx/layers/d3d9/DeviceManagerD3D9.h b/gfx/layers/d3d9/DeviceManagerD3D9.h index b773e2195a6..6b8cb7c5263 100644 --- a/gfx/layers/d3d9/DeviceManagerD3D9.h +++ b/gfx/layers/d3d9/DeviceManagerD3D9.h @@ -194,7 +194,7 @@ public: * If needed, we keep a record of the new texture, so the texture can be * released. In this case, aTextureHostIDirect3DTexture9 must be non-null. */ - TemporaryRef CreateTexture(const gfx::IntSize &aSize, + already_AddRefed CreateTexture(const gfx::IntSize &aSize, _D3DFORMAT aFormat, D3DPOOL aPool, TextureSourceD3D9* aTextureHostIDirect3DTexture9); diff --git a/gfx/layers/d3d9/TextureD3D9.cpp b/gfx/layers/d3d9/TextureD3D9.cpp index 454015bbd91..af2d019e163 100644 --- a/gfx/layers/d3d9/TextureD3D9.cpp +++ b/gfx/layers/d3d9/TextureD3D9.cpp @@ -46,7 +46,7 @@ TextureSourceD3D9::~TextureSourceD3D9() } } -TemporaryRef +already_AddRefed CreateTextureHostD3D9(const SurfaceDescriptor& aDesc, ISurfaceAllocator* aDeallocator, TextureFlags aFlags) @@ -165,7 +165,7 @@ CompositingRenderTargetD3D9::GetSize() const * The last three params are out params. * Returns the created texture, or null if we fail. */ -TemporaryRef +already_AddRefed TextureSourceD3D9::InitTextures(DeviceManagerD3D9* aDeviceManager, const IntSize &aSize, _D3DFORMAT aFormat, @@ -221,7 +221,7 @@ FinishTextures(DeviceManagerD3D9* aDeviceManager, nullptr); } -TemporaryRef +already_AddRefed TextureSourceD3D9::DataToTexture(DeviceManagerD3D9* aDeviceManager, unsigned char *aData, int aStride, @@ -250,7 +250,7 @@ TextureSourceD3D9::DataToTexture(DeviceManagerD3D9* aDeviceManager, return texture.forget(); } -TemporaryRef +already_AddRefed TextureSourceD3D9::TextureToTexture(DeviceManagerD3D9* aDeviceManager, IDirect3DTexture9* aTexture, const IntSize& aSize, @@ -274,7 +274,7 @@ TextureSourceD3D9::TextureToTexture(DeviceManagerD3D9* aDeviceManager, return texture.forget(); } -TemporaryRef +already_AddRefed TextureSourceD3D9::SurfaceToTexture(DeviceManagerD3D9* aDeviceManager, gfxWindowsSurface* aSurface, const IntSize& aSize, @@ -576,7 +576,7 @@ CairoTextureClientD3D9::~CairoTextureClientD3D9() MOZ_COUNT_DTOR(CairoTextureClientD3D9); } -TemporaryRef +already_AddRefed CairoTextureClientD3D9::CreateSimilar(TextureFlags aFlags, TextureAllocationFlags aAllocFlags) const { RefPtr tex = new CairoTextureClientD3D9(mAllocator, mFormat, @@ -768,7 +768,7 @@ SharedTextureClientD3D9::~SharedTextureClientD3D9() } // static -TemporaryRef +already_AddRefed SharedTextureClientD3D9::Create(ISurfaceAllocator* aAllocator, gfx::SurfaceFormat aFormat, TextureFlags aFlags, diff --git a/gfx/layers/d3d9/TextureD3D9.h b/gfx/layers/d3d9/TextureD3D9.h index 101551a321c..cc01a498257 100644 --- a/gfx/layers/d3d9/TextureD3D9.h +++ b/gfx/layers/d3d9/TextureD3D9.h @@ -53,14 +53,14 @@ protected: void SetSize(const gfx::IntSize& aSize) { mSize = aSize; } // Helper methods for creating and copying textures. - TemporaryRef InitTextures( + already_AddRefed InitTextures( DeviceManagerD3D9* aDeviceManager, const gfx::IntSize &aSize, _D3DFORMAT aFormat, RefPtr& aSurface, D3DLOCKED_RECT& aLockedRect); - TemporaryRef DataToTexture( + already_AddRefed DataToTexture( DeviceManagerD3D9* aDeviceManager, unsigned char *aData, int aStride, @@ -70,13 +70,13 @@ protected: // aTexture should be in SYSTEMMEM, returns a texture in the default // pool (that is, in video memory). - TemporaryRef TextureToTexture( + already_AddRefed TextureToTexture( DeviceManagerD3D9* aDeviceManager, IDirect3DTexture9* aTexture, const gfx::IntSize& aSize, _D3DFORMAT aFormat); - TemporaryRef SurfaceToTexture( + already_AddRefed SurfaceToTexture( DeviceManagerD3D9* aDeviceManager, gfxWindowsSurface* aSurface, const gfx::IntSize& aSize, @@ -217,7 +217,7 @@ public: virtual bool HasInternalBuffer() const override { return true; } - virtual TemporaryRef + virtual already_AddRefed CreateSimilar(TextureFlags aFlags = TextureFlags::DEFAULT, TextureAllocationFlags aAllocFlags = ALLOC_DEFAULT) const override; @@ -249,7 +249,7 @@ public: virtual ~SharedTextureClientD3D9(); // Creates a TextureClient and init width. - static TemporaryRef + static already_AddRefed Create(ISurfaceAllocator* aAllocator, gfx::SurfaceFormat aFormat, TextureFlags aFlags, @@ -279,7 +279,7 @@ public: // This TextureClient should not be used in a context where we use CreateSimilar // (ex. component alpha) because the underlying texture data is always created by // an external producer. - virtual TemporaryRef + virtual already_AddRefed CreateSimilar(TextureFlags, TextureAllocationFlags) const override { return nullptr; } private: @@ -310,7 +310,7 @@ public: virtual gfx::IntSize GetSize() const override { return mSize; } - virtual TemporaryRef GetAsSurface() override + virtual already_AddRefed GetAsSurface() override { return nullptr; } @@ -351,7 +351,7 @@ public: virtual void Unlock() override; - virtual TemporaryRef GetAsSurface() override + virtual already_AddRefed GetAsSurface() override { return nullptr; // TODO: cf bug 872568 } @@ -386,7 +386,7 @@ public: virtual void Unlock() override; virtual gfx::IntSize GetSize() const override { return mSize; } - virtual TemporaryRef GetAsSurface() override + virtual already_AddRefed GetAsSurface() override { return nullptr; } diff --git a/gfx/layers/ipc/CompositorBench.cpp b/gfx/layers/ipc/CompositorBench.cpp index 14cafcb28af..47f591ebf44 100644 --- a/gfx/layers/ipc/CompositorBench.cpp +++ b/gfx/layers/ipc/CompositorBench.cpp @@ -129,7 +129,7 @@ public: DrawFrameTrivialQuad(aCompositor, aScreenRect, aStep, effects); } - TemporaryRef CreateEffect(size_t i) { + already_AddRefed CreateEffect(size_t i) { float red; float tmp; red = modf(i * 0.03f, &tmp); @@ -155,7 +155,7 @@ public: DrawFrameStressQuad(aCompositor, aScreenRect, aStep, effects); } - TemporaryRef CreateEffect(size_t i) { + already_AddRefed CreateEffect(size_t i) { float red; float tmp; red = modf(i * 0.03f, &tmp); @@ -240,7 +240,7 @@ public: free(mBuf); } - TemporaryRef CreateEffect(size_t i) { + already_AddRefed CreateEffect(size_t i) { return CreateTexturedEffect(SurfaceFormat::B8G8R8A8, mTexture, Filter::POINT, true); } }; @@ -283,7 +283,7 @@ public: free(mBuf); } - virtual TemporaryRef CreateEffect(size_t i) { + virtual already_AddRefed CreateEffect(size_t i) { return CreateTexturedEffect(SurfaceFormat::B8G8R8A8, mTexture, Filter::POINT, true); } }; @@ -325,7 +325,7 @@ public: free(mBuf); } - virtual TemporaryRef CreateEffect(size_t i) { + virtual already_AddRefed CreateEffect(size_t i) { return CreateTexturedEffect(SurfaceFormat::B8G8R8A8, mTexture, Filter::POINT); } }; @@ -366,7 +366,7 @@ public: free(mBuf); } - virtual TemporaryRef CreateEffect(size_t i) { + virtual already_AddRefed CreateEffect(size_t i) { return CreateTexturedEffect(SurfaceFormat::B8G8R8A8, mTexture, Filter::POINT); } }; diff --git a/gfx/layers/ipc/ISurfaceAllocator.cpp b/gfx/layers/ipc/ISurfaceAllocator.cpp index c6cabea0bbc..dbc07fbd8a9 100644 --- a/gfx/layers/ipc/ISurfaceAllocator.cpp +++ b/gfx/layers/ipc/ISurfaceAllocator.cpp @@ -76,7 +76,7 @@ GetAddressFromDescriptor(const SurfaceDescriptor& aDescriptor, size_t& aSize) } } -TemporaryRef +already_AddRefed GetDrawTargetForDescriptor(const SurfaceDescriptor& aDescriptor, gfx::BackendType aBackend) { size_t size; @@ -85,7 +85,7 @@ GetDrawTargetForDescriptor(const SurfaceDescriptor& aDescriptor, gfx::BackendTyp return image.GetAsDrawTarget(aBackend); } -TemporaryRef +already_AddRefed GetSurfaceForDescriptor(const SurfaceDescriptor& aDescriptor) { size_t size; diff --git a/gfx/layers/ipc/ISurfaceAllocator.h b/gfx/layers/ipc/ISurfaceAllocator.h index a40f4b9aaa9..c2a414936c7 100644 --- a/gfx/layers/ipc/ISurfaceAllocator.h +++ b/gfx/layers/ipc/ISurfaceAllocator.h @@ -62,8 +62,8 @@ bool IsSurfaceDescriptorValid(const SurfaceDescriptor& aSurface); bool IsSurfaceDescriptorOwned(const SurfaceDescriptor& aDescriptor); bool ReleaseOwnedSurfaceDescriptor(const SurfaceDescriptor& aDescriptor); -TemporaryRef GetDrawTargetForDescriptor(const SurfaceDescriptor& aDescriptor, gfx::BackendType aBackend); -TemporaryRef GetSurfaceForDescriptor(const SurfaceDescriptor& aDescriptor); +already_AddRefed GetDrawTargetForDescriptor(const SurfaceDescriptor& aDescriptor, gfx::BackendType aBackend); +already_AddRefed GetSurfaceForDescriptor(const SurfaceDescriptor& aDescriptor); /** * An interface used to create and destroy surfaces that are shared with the * Compositor process (using shmem, or gralloc, or other platform specific memory) diff --git a/gfx/layers/ipc/ImageBridgeChild.cpp b/gfx/layers/ipc/ImageBridgeChild.cpp index 42aacc0b819..1cdf17f44c7 100644 --- a/gfx/layers/ipc/ImageBridgeChild.cpp +++ b/gfx/layers/ipc/ImageBridgeChild.cpp @@ -650,7 +650,7 @@ ImageBridgeChild::IdentifyCompositorTextureHost(const TextureFactoryIdentifier& } } -TemporaryRef +already_AddRefed ImageBridgeChild::CreateImageClient(CompositableType aType) { if (InImageBridgeChildThread()) { @@ -671,7 +671,7 @@ ImageBridgeChild::CreateImageClient(CompositableType aType) return result.forget(); } -TemporaryRef +already_AddRefed ImageBridgeChild::CreateImageClientNow(CompositableType aType) { MOZ_ASSERT(!sImageBridgeChildSingleton->mShuttingDown); diff --git a/gfx/layers/ipc/ImageBridgeChild.h b/gfx/layers/ipc/ImageBridgeChild.h index a63144e89f8..caf80e2fb72 100644 --- a/gfx/layers/ipc/ImageBridgeChild.h +++ b/gfx/layers/ipc/ImageBridgeChild.h @@ -9,7 +9,7 @@ #include // for size_t #include // for uint32_t, uint64_t #include "mozilla/Attributes.h" // for override -#include "mozilla/RefPtr.h" // for TemporaryRef +#include "mozilla/RefPtr.h" // for already_AddRefed #include "mozilla/ipc/SharedMemory.h" // for SharedMemory, etc #include "mozilla/layers/AsyncTransactionTracker.h" // for AsyncTransactionTrackerHolder #include "mozilla/layers/CompositableForwarder.h" @@ -192,8 +192,8 @@ public: virtual bool RecvParentAsyncMessages(InfallibleTArray&& aMessages) override; - TemporaryRef CreateImageClient(CompositableType aType); - TemporaryRef CreateImageClientNow(CompositableType aType); + already_AddRefed CreateImageClient(CompositableType aType); + already_AddRefed CreateImageClientNow(CompositableType aType); static void DispatchReleaseImageClient(ImageClient* aClient); static void DispatchReleaseTextureClient(TextureClient* aClient); diff --git a/gfx/layers/ipc/SharedPlanarYCbCrImage.cpp b/gfx/layers/ipc/SharedPlanarYCbCrImage.cpp index b0b76b84093..6365d0102c6 100644 --- a/gfx/layers/ipc/SharedPlanarYCbCrImage.cpp +++ b/gfx/layers/ipc/SharedPlanarYCbCrImage.cpp @@ -68,7 +68,7 @@ SharedPlanarYCbCrImage::GetBuffer() return mTextureClient->GetBuffer(); } -TemporaryRef +already_AddRefed SharedPlanarYCbCrImage::GetAsSourceSurface() { if (!mTextureClient) { diff --git a/gfx/layers/ipc/SharedPlanarYCbCrImage.h b/gfx/layers/ipc/SharedPlanarYCbCrImage.h index 8c3d39cda6e..b91ad5a35e6 100644 --- a/gfx/layers/ipc/SharedPlanarYCbCrImage.h +++ b/gfx/layers/ipc/SharedPlanarYCbCrImage.h @@ -34,7 +34,7 @@ public: virtual TextureClient* GetTextureClient(CompositableClient* aClient) override; virtual uint8_t* GetBuffer() override; - virtual TemporaryRef GetAsSourceSurface() override; + virtual already_AddRefed GetAsSourceSurface() override; virtual void SetData(const PlanarYCbCrData& aData) override; virtual void SetDataNoCopy(const Data &aData) override; diff --git a/gfx/layers/ipc/SharedRGBImage.cpp b/gfx/layers/ipc/SharedRGBImage.cpp index 43198b545d6..5338fab2901 100644 --- a/gfx/layers/ipc/SharedRGBImage.cpp +++ b/gfx/layers/ipc/SharedRGBImage.cpp @@ -117,7 +117,7 @@ SharedRGBImage::GetTextureClient(CompositableClient* aClient) return mTextureClient.get(); } -TemporaryRef +already_AddRefed SharedRGBImage::GetAsSourceSurface() { return nullptr; diff --git a/gfx/layers/ipc/SharedRGBImage.h b/gfx/layers/ipc/SharedRGBImage.h index bac33f12eba..9bb0b03f258 100644 --- a/gfx/layers/ipc/SharedRGBImage.h +++ b/gfx/layers/ipc/SharedRGBImage.h @@ -47,7 +47,7 @@ public: size_t GetBufferSize(); - TemporaryRef GetAsSourceSurface() override; + already_AddRefed GetAsSourceSurface() override; bool Allocate(gfx::IntSize aSize, gfx::SurfaceFormat aFormat); private: diff --git a/gfx/layers/opengl/CompositingRenderTargetOGL.cpp b/gfx/layers/opengl/CompositingRenderTargetOGL.cpp index 0bca6b5b47a..09cd4d181e8 100644 --- a/gfx/layers/opengl/CompositingRenderTargetOGL.cpp +++ b/gfx/layers/opengl/CompositingRenderTargetOGL.cpp @@ -69,7 +69,7 @@ CompositingRenderTargetOGL::BindRenderTarget() } #ifdef MOZ_DUMP_PAINTING -TemporaryRef +already_AddRefed CompositingRenderTargetOGL::Dump(Compositor* aCompositor) { MOZ_ASSERT(mInitParams.mStatus == InitParams::INITIALIZED); diff --git a/gfx/layers/opengl/CompositingRenderTargetOGL.h b/gfx/layers/opengl/CompositingRenderTargetOGL.h index bc6f9190fc6..e293d076a3f 100644 --- a/gfx/layers/opengl/CompositingRenderTargetOGL.h +++ b/gfx/layers/opengl/CompositingRenderTargetOGL.h @@ -10,7 +10,7 @@ #include "GLDefs.h" // for GLenum, LOCAL_GL_FRAMEBUFFER, etc #include "mozilla/Assertions.h" // for MOZ_ASSERT, etc #include "mozilla/Attributes.h" // for override -#include "mozilla/RefPtr.h" // for RefPtr, TemporaryRef +#include "mozilla/RefPtr.h" // for RefPtr, already_AddRefed #include "mozilla/gfx/Point.h" // for IntSize, IntSizeTyped #include "mozilla/gfx/Types.h" // for SurfaceFormat, etc #include "mozilla/layers/Compositor.h" // for SurfaceInitMode, etc @@ -79,7 +79,7 @@ public: * Create a render target around the default FBO, for rendering straight to * the window. */ - static TemporaryRef + static already_AddRefed RenderTargetForWindow(CompositorOGL* aCompositor, const gfx::IntSize& aSize) { @@ -146,7 +146,7 @@ public: } #ifdef MOZ_DUMP_PAINTING - virtual TemporaryRef Dump(Compositor* aCompositor) override; + virtual already_AddRefed Dump(Compositor* aCompositor) override; #endif const gfx::IntSize& GetInitSize() const { diff --git a/gfx/layers/opengl/CompositorOGL.cpp b/gfx/layers/opengl/CompositorOGL.cpp index d3f54dfe273..49975329832 100644 --- a/gfx/layers/opengl/CompositorOGL.cpp +++ b/gfx/layers/opengl/CompositorOGL.cpp @@ -477,7 +477,7 @@ CompositorOGL::PrepareViewport(const gfx::IntSize& aSize) mProjMatrix = matrix3d; } -TemporaryRef +already_AddRefed CompositorOGL::CreateRenderTarget(const IntRect &aRect, SurfaceInitMode aInit) { MOZ_ASSERT(aRect.width != 0 && aRect.height != 0, "Trying to create a render target of invalid size"); @@ -495,7 +495,7 @@ CompositorOGL::CreateRenderTarget(const IntRect &aRect, SurfaceInitMode aInit) return surface.forget(); } -TemporaryRef +already_AddRefed CompositorOGL::CreateRenderTargetFromSource(const IntRect &aRect, const CompositingRenderTarget *aSource, const IntPoint &aSourcePoint) @@ -1537,7 +1537,7 @@ CompositorOGL::Resume() return true; } -TemporaryRef +already_AddRefed CompositorOGL::CreateDataTextureSource(TextureFlags aFlags) { return MakeAndAddRef(this, aFlags); diff --git a/gfx/layers/opengl/CompositorOGL.h b/gfx/layers/opengl/CompositorOGL.h index 30efce7fb84..80fba5e7a8f 100644 --- a/gfx/layers/opengl/CompositorOGL.h +++ b/gfx/layers/opengl/CompositorOGL.h @@ -14,7 +14,7 @@ #include "Units.h" // for ScreenPoint #include "mozilla/Assertions.h" // for MOZ_ASSERT, etc #include "mozilla/Attributes.h" // for override, final -#include "mozilla/RefPtr.h" // for TemporaryRef, RefPtr +#include "mozilla/RefPtr.h" // for already_AddRefed, RefPtr #include "mozilla/gfx/2D.h" // for DrawTarget #include "mozilla/gfx/BaseSize.h" // for BaseSize #include "mozilla/gfx/Point.h" // for IntSize, Point @@ -193,7 +193,7 @@ protected: virtual ~CompositorOGL(); public: - virtual TemporaryRef + virtual already_AddRefed CreateDataTextureSource(TextureFlags aFlags = TextureFlags::NO_FLAGS) override; virtual bool Initialize() override; @@ -214,10 +214,10 @@ public: return result; } - virtual TemporaryRef + virtual already_AddRefed CreateRenderTarget(const gfx::IntRect &aRect, SurfaceInitMode aInit) override; - virtual TemporaryRef + virtual already_AddRefed CreateRenderTargetFromSource(const gfx::IntRect &aRect, const CompositingRenderTarget *aSource, const gfx::IntPoint &aSourcePoint) override; diff --git a/gfx/layers/opengl/GrallocTextureClient.cpp b/gfx/layers/opengl/GrallocTextureClient.cpp index 0a45f40e4c9..f7791329e68 100644 --- a/gfx/layers/opengl/GrallocTextureClient.cpp +++ b/gfx/layers/opengl/GrallocTextureClient.cpp @@ -48,7 +48,7 @@ GrallocTextureClientOGL::~GrallocTextureClientOGL() } } -TemporaryRef +already_AddRefed GrallocTextureClientOGL::CreateSimilar(TextureFlags aFlags, TextureAllocationFlags aAllocFlags) const { @@ -351,7 +351,7 @@ GrallocTextureClientOGL::GetBufferSize() const return 0; } -/*static*/ TemporaryRef +/*static*/ already_AddRefed GrallocTextureClientOGL::FromSharedSurface(gl::SharedSurface* abstractSurf, TextureFlags flags) { diff --git a/gfx/layers/opengl/GrallocTextureClient.h b/gfx/layers/opengl/GrallocTextureClient.h index a67450628a4..ea9379f4966 100644 --- a/gfx/layers/opengl/GrallocTextureClient.h +++ b/gfx/layers/opengl/GrallocTextureClient.h @@ -114,11 +114,11 @@ public: return mMediaBuffer; } - virtual TemporaryRef + virtual already_AddRefed CreateSimilar(TextureFlags aFlags = TextureFlags::DEFAULT, TextureAllocationFlags aAllocFlags = ALLOC_DEFAULT) const override; - static TemporaryRef FromSharedSurface(gl::SharedSurface* surf, + static already_AddRefed FromSharedSurface(gl::SharedSurface* surf, TextureFlags flags); protected: diff --git a/gfx/layers/opengl/GrallocTextureHost.cpp b/gfx/layers/opengl/GrallocTextureHost.cpp index 6affb8024d3..6caad935d8d 100644 --- a/gfx/layers/opengl/GrallocTextureHost.cpp +++ b/gfx/layers/opengl/GrallocTextureHost.cpp @@ -230,7 +230,7 @@ GrallocTextureHostOGL::GetRenderState() return LayerRenderState(); } -TemporaryRef +already_AddRefed GrallocTextureHostOGL::GetAsSurface() { android::GraphicBuffer* graphicBuffer = GetGraphicBufferFromDesc(mGrallocHandle).get(); if (!graphicBuffer) { diff --git a/gfx/layers/opengl/GrallocTextureHost.h b/gfx/layers/opengl/GrallocTextureHost.h index 76f26894e65..0e9d1062edd 100644 --- a/gfx/layers/opengl/GrallocTextureHost.h +++ b/gfx/layers/opengl/GrallocTextureHost.h @@ -48,7 +48,7 @@ public: virtual void UnbindTextureSource() override; - virtual TemporaryRef GetAsSurface() override; + virtual already_AddRefed GetAsSurface() override; virtual void WaitAcquireFenceHandleSyncComplete() override; diff --git a/gfx/layers/opengl/MacIOSurfaceTextureClientOGL.cpp b/gfx/layers/opengl/MacIOSurfaceTextureClientOGL.cpp index 344df167555..a2b41d9ccd1 100644 --- a/gfx/layers/opengl/MacIOSurfaceTextureClientOGL.cpp +++ b/gfx/layers/opengl/MacIOSurfaceTextureClientOGL.cpp @@ -23,7 +23,7 @@ MacIOSurfaceTextureClientOGL::~MacIOSurfaceTextureClientOGL() } // static -TemporaryRef +already_AddRefed MacIOSurfaceTextureClientOGL::Create(ISurfaceAllocator* aAllocator, TextureFlags aFlags, MacIOSurface* aSurface) @@ -76,7 +76,7 @@ MacIOSurfaceTextureClientOGL::GetSize() const return gfx::IntSize(mSurface->GetDevicePixelWidth(), mSurface->GetDevicePixelHeight()); } -TemporaryRef +already_AddRefed MacIOSurfaceTextureClientOGL::GetAsSurface() { RefPtr surf = mSurface->GetAsSurface(); diff --git a/gfx/layers/opengl/MacIOSurfaceTextureClientOGL.h b/gfx/layers/opengl/MacIOSurfaceTextureClientOGL.h index b7e2fa0550a..e7ab59a00a3 100644 --- a/gfx/layers/opengl/MacIOSurfaceTextureClientOGL.h +++ b/gfx/layers/opengl/MacIOSurfaceTextureClientOGL.h @@ -22,7 +22,7 @@ public: virtual ~MacIOSurfaceTextureClientOGL(); // Creates a TextureClient and init width. - static TemporaryRef + static already_AddRefed Create(ISurfaceAllocator* aAllocator, TextureFlags aFlags, MacIOSurface* aSurface); @@ -41,12 +41,12 @@ public: virtual bool HasInternalBuffer() const override { return false; } - virtual TemporaryRef GetAsSurface() override; + virtual already_AddRefed GetAsSurface() override; // This TextureClient should not be used in a context where we use CreateSimilar // (ex. component alpha) because the underlying texture data is always created by // an external producer. - virtual TemporaryRef + virtual already_AddRefed CreateSimilar(TextureFlags, TextureAllocationFlags) const override { return nullptr; } protected: diff --git a/gfx/layers/opengl/MacIOSurfaceTextureHostOGL.h b/gfx/layers/opengl/MacIOSurfaceTextureHostOGL.h index ba9c5b222c9..574dfe5d9bc 100644 --- a/gfx/layers/opengl/MacIOSurfaceTextureHostOGL.h +++ b/gfx/layers/opengl/MacIOSurfaceTextureHostOGL.h @@ -80,7 +80,7 @@ public: return !!aTexture; } - virtual TemporaryRef GetAsSurface() override + virtual already_AddRefed GetAsSurface() override { return nullptr; // XXX - implement this (for MOZ_DUMP_PAINTING) } diff --git a/gfx/layers/opengl/TextureClientOGL.h b/gfx/layers/opengl/TextureClientOGL.h index 55d2e5e5ae2..42fe46d8cae 100644 --- a/gfx/layers/opengl/TextureClientOGL.h +++ b/gfx/layers/opengl/TextureClientOGL.h @@ -48,7 +48,7 @@ public: return gfx::SurfaceFormat::UNKNOWN; } - virtual TemporaryRef + virtual already_AddRefed CreateSimilar(TextureFlags aFlags = TextureFlags::DEFAULT, TextureAllocationFlags aAllocFlags = ALLOC_DEFAULT) const override { @@ -99,7 +99,7 @@ public: return gfx::SurfaceFormat::UNKNOWN; } - virtual TemporaryRef + virtual already_AddRefed CreateSimilar(TextureFlags aFlags = TextureFlags::DEFAULT, TextureAllocationFlags aAllocFlags = ALLOC_DEFAULT) const override { diff --git a/gfx/layers/opengl/TextureHostOGL.cpp b/gfx/layers/opengl/TextureHostOGL.cpp index 6aad179f53e..98ac68b5eb4 100644 --- a/gfx/layers/opengl/TextureHostOGL.cpp +++ b/gfx/layers/opengl/TextureHostOGL.cpp @@ -42,7 +42,7 @@ namespace layers { class Compositor; -TemporaryRef +already_AddRefed CreateTextureHostOGL(const SurfaceDescriptor& aDesc, ISurfaceAllocator* aDeallocator, TextureFlags aFlags) diff --git a/gfx/layers/opengl/TextureHostOGL.h b/gfx/layers/opengl/TextureHostOGL.h index 4de7c464133..5813f945f0d 100644 --- a/gfx/layers/opengl/TextureHostOGL.h +++ b/gfx/layers/opengl/TextureHostOGL.h @@ -353,7 +353,7 @@ public: return !!aTexture; } - virtual TemporaryRef GetAsSurface() override + virtual already_AddRefed GetAsSurface() override { return nullptr; // XXX - implement this (for MOZ_DUMP_PAINTING) } @@ -447,7 +447,7 @@ public: return !!aTexture; } - virtual TemporaryRef GetAsSurface() override + virtual already_AddRefed GetAsSurface() override { return nullptr; // XXX - implement this (for MOZ_DUMP_PAINTING) } diff --git a/gfx/src/FilterSupport.cpp b/gfx/src/FilterSupport.cpp index 60b8b07e68b..bce9c3a629b 100644 --- a/gfx/src/FilterSupport.cpp +++ b/gfx/src/FilterSupport.cpp @@ -98,7 +98,7 @@ namespace gfx { namespace FilterWrappers { - static TemporaryRef + static already_AddRefed Unpremultiply(DrawTarget* aDT, FilterNode* aInput) { RefPtr filter = aDT->CreateFilter(FilterType::UNPREMULTIPLY); @@ -109,7 +109,7 @@ namespace FilterWrappers { return nullptr; } - static TemporaryRef + static already_AddRefed Premultiply(DrawTarget* aDT, FilterNode* aInput) { RefPtr filter = aDT->CreateFilter(FilterType::PREMULTIPLY); @@ -120,7 +120,7 @@ namespace FilterWrappers { return nullptr; } - static TemporaryRef + static already_AddRefed LinearRGBToSRGB(DrawTarget* aDT, FilterNode* aInput) { RefPtr transfer = aDT->CreateFilter(FilterType::DISCRETE_TRANSFER); @@ -138,7 +138,7 @@ namespace FilterWrappers { return nullptr; } - static TemporaryRef + static already_AddRefed SRGBToLinearRGB(DrawTarget* aDT, FilterNode* aInput) { RefPtr transfer = aDT->CreateFilter(FilterType::DISCRETE_TRANSFER); @@ -156,7 +156,7 @@ namespace FilterWrappers { return nullptr; } - static TemporaryRef + static already_AddRefed Crop(DrawTarget* aDT, FilterNode* aInputFilter, const IntRect& aRect) { RefPtr filter = aDT->CreateFilter(FilterType::CROP); @@ -168,7 +168,7 @@ namespace FilterWrappers { return nullptr; } - static TemporaryRef + static already_AddRefed Offset(DrawTarget* aDT, FilterNode* aInputFilter, const IntPoint& aOffset) { RefPtr filter = aDT->CreateFilter(FilterType::TRANSFORM); @@ -180,7 +180,7 @@ namespace FilterWrappers { return nullptr; } - static TemporaryRef + static already_AddRefed GaussianBlur(DrawTarget* aDT, FilterNode* aInputFilter, const Size& aStdDeviation) { float stdX = float(std::min(aStdDeviation.width, kMaxStdDeviation)); @@ -208,7 +208,7 @@ namespace FilterWrappers { return nullptr; } - static TemporaryRef + static already_AddRefed Clear(DrawTarget* aDT) { RefPtr filter = aDT->CreateFilter(FilterType::FLOOD); @@ -219,7 +219,7 @@ namespace FilterWrappers { return nullptr; } - static TemporaryRef + static already_AddRefed ForSurface(DrawTarget* aDT, SourceSurface* aSurface, const IntPoint& aSurfacePosition) { @@ -233,7 +233,7 @@ namespace FilterWrappers { return nullptr; } - static TemporaryRef + static already_AddRefed ToAlpha(DrawTarget* aDT, FilterNode* aInput) { float zero = 0.0f; @@ -273,13 +273,13 @@ public: ColorModel aOriginalColorModel); // Get a FilterNode for the specified color model, guaranteed to be non-null. - TemporaryRef ForColorModel(ColorModel aColorModel); + already_AddRefed ForColorModel(ColorModel aColorModel); AlphaModel OriginalAlphaModel() const { return mOriginalColorModel.mAlphaModel; } private: // Create the required FilterNode that will be cached by ForColorModel. - TemporaryRef WrapForColorModel(ColorModel aColorModel); + already_AddRefed WrapForColorModel(ColorModel aColorModel); RefPtr mDT; ColorModel mOriginalColorModel; @@ -307,7 +307,7 @@ FilterCachedColorModels::FilterCachedColorModels(DrawTarget* aDT, } } -TemporaryRef +already_AddRefed FilterCachedColorModels::ForColorModel(ColorModel aColorModel) { if (!mFilterForColorModel[aColorModel.ToIndex()]) { @@ -317,7 +317,7 @@ FilterCachedColorModels::ForColorModel(ColorModel aColorModel) return filter.forget(); } -TemporaryRef +already_AddRefed FilterCachedColorModels::WrapForColorModel(ColorModel aColorModel) { // Convert one aspect at a time and recurse. @@ -695,7 +695,7 @@ const int32_t kMorphologyMaxRadius = 100000; // aSourceRegions contains the filter primitive subregions of the source // primitives; only needed for eTile primitives. // aInputImages carries additional surfaces that are used by eImage primitives. -static TemporaryRef +static already_AddRefed FilterNodeFromPrimitiveDescription(const FilterPrimitiveDescription& aDescription, DrawTarget* aDT, nsTArray >& aSources, @@ -1217,7 +1217,7 @@ OutputAlphaModelForPrimitive(const FilterPrimitiveDescription& aDescr, } // Returns the output FilterNode, in premultiplied sRGB space. -static TemporaryRef +static already_AddRefed FilterNodeGraphFromDescription(DrawTarget* aDT, const FilterDescription& aFilter, const Rect& aResultNeededRect, diff --git a/gfx/tests/gtest/TestCompositor.cpp b/gfx/tests/gtest/TestCompositor.cpp index 5572b5a58ad..b8c452af646 100644 --- a/gfx/tests/gtest/TestCompositor.cpp +++ b/gfx/tests/gtest/TestCompositor.cpp @@ -96,7 +96,7 @@ struct LayerManagerData { {} }; -static TemporaryRef CreateTestCompositor(LayersBackend backend, MockWidget* widget) +static already_AddRefed CreateTestCompositor(LayersBackend backend, MockWidget* widget) { gfxPrefs::GetSingleton(); @@ -170,7 +170,7 @@ static std::vector GetPlatformBackends() return backends; } -static TemporaryRef CreateDT() +static already_AddRefed CreateDT() { return gfxPlatform::GetPlatform()->CreateOffscreenContentDrawTarget( IntSize(gCompWidth, gCompHeight), SurfaceFormat::B8G8R8A8); diff --git a/gfx/thebes/gfxAndroidPlatform.cpp b/gfx/thebes/gfxAndroidPlatform.cpp index bf889c0f2e8..de9e663fe3b 100644 --- a/gfx/thebes/gfxAndroidPlatform.cpp +++ b/gfx/thebes/gfxAndroidPlatform.cpp @@ -340,7 +340,7 @@ gfxAndroidPlatform::MakePlatformFont(const nsAString& aFontName, aLength); } -TemporaryRef +already_AddRefed gfxAndroidPlatform::GetScaledFontForFont(DrawTarget* aTarget, gfxFont *aFont) { return GetScaledFontForFontWithCairoSkia(aTarget, aFont); diff --git a/gfx/thebes/gfxAndroidPlatform.h b/gfx/thebes/gfxAndroidPlatform.h index 8845d145925..a71fbe50173 100644 --- a/gfx/thebes/gfxAndroidPlatform.h +++ b/gfx/thebes/gfxAndroidPlatform.h @@ -36,7 +36,7 @@ public: virtual gfxImageFormat GetOffscreenFormat() { return mOffscreenFormat; } - mozilla::TemporaryRef + already_AddRefed GetScaledFontForFont(mozilla::gfx::DrawTarget* aTarget, gfxFont *aFont); // to support IPC font list (sharing between chrome and content) diff --git a/gfx/thebes/gfxBlur.cpp b/gfx/thebes/gfxBlur.cpp index 205600cf004..31ba5da3565 100644 --- a/gfx/thebes/gfxBlur.cpp +++ b/gfx/thebes/gfxBlur.cpp @@ -116,7 +116,7 @@ DrawBlur(gfxContext* aDestinationCtx, } } -TemporaryRef +already_AddRefed gfxAlphaBoxBlur::DoBlur(DrawTarget* aDT, IntPoint* aTopLeft) { mBlur->Blur(mData); @@ -382,7 +382,7 @@ CacheBlur(DrawTarget& aDT, } // Blurs a small surface and creates the mask. -static TemporaryRef +static already_AddRefed CreateBlurMask(const IntSize& aRectSize, RectCornerRadii* aCornerRadii, gfxIntSize aBlurRadius, @@ -427,7 +427,7 @@ CreateBlurMask(const IntSize& aRectSize, return result.forget(); } -static TemporaryRef +static already_AddRefed CreateBoxShadow(DrawTarget& aDT, SourceSurface* aBlurMask, const gfxRGBA& aShadowColor) { IntSize blurredSize = aBlurMask->GetSize(); diff --git a/gfx/thebes/gfxBlur.h b/gfx/thebes/gfxBlur.h index 74ede1b52a8..c170e8ad644 100644 --- a/gfx/thebes/gfxBlur.h +++ b/gfx/thebes/gfxBlur.h @@ -88,7 +88,7 @@ public: return mContext; } - mozilla::TemporaryRef DoBlur(mozilla::gfx::DrawTarget* aDT, mozilla::gfx::IntPoint* aTopLeft); + already_AddRefed DoBlur(mozilla::gfx::DrawTarget* aDT, mozilla::gfx::IntPoint* aTopLeft); /** * Does the actual blurring/spreading and mask applying. Users of this diff --git a/gfx/thebes/gfxContext.cpp b/gfx/thebes/gfxContext.cpp index c17c20c7c24..0b61a559fbe 100644 --- a/gfx/thebes/gfxContext.cpp +++ b/gfx/thebes/gfxContext.cpp @@ -201,7 +201,7 @@ gfxContext::ClosePath() mPathBuilder->Close(); } -TemporaryRef gfxContext::GetPath() +already_AddRefed gfxContext::GetPath() { EnsurePath(); RefPtr path(mPath); @@ -969,7 +969,7 @@ gfxContext::PopGroup() return pat.forget(); } -TemporaryRef +already_AddRefed gfxContext::PopGroupToSurface(Matrix* aTransform) { RefPtr src = mDT->Snapshot(); diff --git a/gfx/thebes/gfxContext.h b/gfx/thebes/gfxContext.h index 268a59fd422..998b1f73bf9 100644 --- a/gfx/thebes/gfxContext.h +++ b/gfx/thebes/gfxContext.h @@ -125,7 +125,7 @@ public: /** * Returns the current path. */ - mozilla::TemporaryRef GetPath(); + already_AddRefed GetPath(); /** * Sets the given path as the current path. @@ -483,7 +483,7 @@ public: already_AddRefed PopGroup(); void PopGroupToSource(); - mozilla::TemporaryRef + already_AddRefed PopGroupToSurface(mozilla::gfx::Matrix* aMatrix); mozilla::gfx::Point GetDeviceOffset() const; diff --git a/gfx/thebes/gfxDWriteFonts.cpp b/gfx/thebes/gfxDWriteFonts.cpp index 7fcfab86027..2c7bc0f2a75 100644 --- a/gfx/thebes/gfxDWriteFonts.cpp +++ b/gfx/thebes/gfxDWriteFonts.cpp @@ -597,7 +597,7 @@ gfxDWriteFont::GetGlyphWidth(DrawTarget& aDrawTarget, uint16_t aGID) return width; } -TemporaryRef +already_AddRefed gfxDWriteFont::GetGlyphRenderingOptions(const TextRunDrawParams* aRunParams) { if (UsingClearType()) { @@ -669,7 +669,7 @@ gfxDWriteFont::AddSizeOfIncludingThis(MallocSizeOf aMallocSizeOf, AddSizeOfExcludingThis(aMallocSizeOf, aSizes); } -TemporaryRef +already_AddRefed gfxDWriteFont::GetScaledFont(mozilla::gfx::DrawTarget *aTarget) { bool wantCairo = aTarget->GetBackendType() == BackendType::CAIRO; diff --git a/gfx/thebes/gfxDWriteFonts.h b/gfx/thebes/gfxDWriteFonts.h index 2d45c4ed775..834913548f0 100644 --- a/gfx/thebes/gfxDWriteFonts.h +++ b/gfx/thebes/gfxDWriteFonts.h @@ -59,7 +59,7 @@ public: virtual int32_t GetGlyphWidth(DrawTarget& aDrawTarget, uint16_t aGID) override; - virtual mozilla::TemporaryRef + virtual already_AddRefed GetGlyphRenderingOptions(const TextRunDrawParams* aRunParams = nullptr) override; virtual void AddSizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf, @@ -69,7 +69,7 @@ public: virtual FontType GetType() const { return FONT_TYPE_DWRITE; } - virtual mozilla::TemporaryRef + virtual already_AddRefed GetScaledFont(mozilla::gfx::DrawTarget *aTarget) override; virtual cairo_scaled_font_t *GetCairoScaledFont() override; diff --git a/gfx/thebes/gfxFT2Fonts.cpp b/gfx/thebes/gfxFT2Fonts.cpp index 6fa799ec045..0141b1505d7 100644 --- a/gfx/thebes/gfxFT2Fonts.cpp +++ b/gfx/thebes/gfxFT2Fonts.cpp @@ -230,7 +230,7 @@ gfxFT2Font::AddSizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf, } #ifdef USE_SKIA -mozilla::TemporaryRef +already_AddRefed gfxFT2Font::GetGlyphRenderingOptions(const TextRunDrawParams* aRunParams) { mozilla::gfx::FontHinting hinting; diff --git a/gfx/thebes/gfxFT2Fonts.h b/gfx/thebes/gfxFT2Fonts.h index 7309d6c5ccb..ca00bf44e61 100644 --- a/gfx/thebes/gfxFT2Fonts.h +++ b/gfx/thebes/gfxFT2Fonts.h @@ -60,7 +60,7 @@ public: // new functions FontCacheSizes* aSizes) const; #ifdef USE_SKIA - virtual mozilla::TemporaryRef + virtual already_AddRefed GetGlyphRenderingOptions(const TextRunDrawParams* aRunParams = nullptr) override; #endif diff --git a/gfx/thebes/gfxFcPlatformFontList.cpp b/gfx/thebes/gfxFcPlatformFontList.cpp index 986a1095cb2..6c47b41461a 100644 --- a/gfx/thebes/gfxFcPlatformFontList.cpp +++ b/gfx/thebes/gfxFcPlatformFontList.cpp @@ -877,7 +877,7 @@ gfxFontconfigFont::~gfxFontconfigFont() } #ifdef USE_SKIA -mozilla::TemporaryRef +already_AddRefed gfxFontconfigFont::GetGlyphRenderingOptions(const TextRunDrawParams* aRunParams) { cairo_scaled_font_t *scaled_font = CairoScaledFont(); diff --git a/gfx/thebes/gfxFcPlatformFontList.h b/gfx/thebes/gfxFcPlatformFontList.h index 6ff39ee24ba..bcb3e03c50b 100644 --- a/gfx/thebes/gfxFcPlatformFontList.h +++ b/gfx/thebes/gfxFcPlatformFontList.h @@ -184,7 +184,7 @@ public: bool aNeedsBold); #ifdef USE_SKIA - virtual mozilla::TemporaryRef + virtual already_AddRefed GetGlyphRenderingOptions(const TextRunDrawParams* aRunParams = nullptr) override; #endif diff --git a/gfx/thebes/gfxFont.h b/gfx/thebes/gfxFont.h index 0ce99f99432..de452256665 100644 --- a/gfx/thebes/gfxFont.h +++ b/gfx/thebes/gfxFont.h @@ -1459,7 +1459,7 @@ public: gfxFloat GetGlyphHAdvance(gfxContext *aCtx, uint16_t aGID); // Return Azure GlyphRenderingOptions for drawing this font. - virtual mozilla::TemporaryRef + virtual already_AddRefed GetGlyphRenderingOptions(const TextRunDrawParams* aRunParams = nullptr) { return nullptr; } @@ -1747,7 +1747,7 @@ public: virtual FontType GetType() const = 0; - virtual mozilla::TemporaryRef GetScaledFont(DrawTarget* aTarget) + virtual already_AddRefed GetScaledFont(DrawTarget* aTarget) { return gfxPlatform::GetPlatform()->GetScaledFontForFont(aTarget, this); } bool KerningDisabled() { diff --git a/gfx/thebes/gfxFontconfigFonts.cpp b/gfx/thebes/gfxFontconfigFonts.cpp index 3a577021e2a..cc19b03aaf8 100644 --- a/gfx/thebes/gfxFontconfigFonts.cpp +++ b/gfx/thebes/gfxFontconfigFonts.cpp @@ -669,7 +669,7 @@ public: const gfxFontStyle *aFontStyle); #ifdef USE_SKIA - virtual mozilla::TemporaryRef + virtual already_AddRefed GetGlyphRenderingOptions(const TextRunDrawParams* aRunParams = nullptr) override; #endif @@ -2136,7 +2136,7 @@ ApplyGdkScreenFontOptions(FcPattern *aPattern) #endif // MOZ_WIDGET_GTK2 #ifdef USE_SKIA -mozilla::TemporaryRef +already_AddRefed gfxFcFont::GetGlyphRenderingOptions(const TextRunDrawParams* aRunParams) { cairo_scaled_font_t *scaled_font = CairoScaledFont(); diff --git a/gfx/thebes/gfxImageSurface.cpp b/gfx/thebes/gfxImageSurface.cpp index 6d699acda1e..7c431977277 100644 --- a/gfx/thebes/gfxImageSurface.cpp +++ b/gfx/thebes/gfxImageSurface.cpp @@ -318,7 +318,7 @@ gfxImageSurface::CopyTo(SourceSurface *aSurface) { return true; } -TemporaryRef +already_AddRefed gfxImageSurface::CopyToB8G8R8A8DataSourceSurface() { RefPtr dataSurface = diff --git a/gfx/thebes/gfxImageSurface.h b/gfx/thebes/gfxImageSurface.h index 24be12ecba8..26193cd41a8 100644 --- a/gfx/thebes/gfxImageSurface.h +++ b/gfx/thebes/gfxImageSurface.h @@ -114,7 +114,7 @@ public: * Copy to a Moz2D DataSourceSurface. * Marked as virtual so that browsercomps can access this method. */ - virtual mozilla::TemporaryRef CopyToB8G8R8A8DataSourceSurface(); + virtual already_AddRefed CopyToB8G8R8A8DataSourceSurface(); /* return new Subimage with pointing to original image starting from aRect.pos * and size of aRect.size. New subimage keeping current image reference diff --git a/gfx/thebes/gfxMacFont.cpp b/gfx/thebes/gfxMacFont.cpp index 06f92281c03..1e0600c891c 100644 --- a/gfx/thebes/gfxMacFont.cpp +++ b/gfx/thebes/gfxMacFont.cpp @@ -427,7 +427,7 @@ gfxMacFont::InitMetricsFromPlatform() mIsValid = true; } -TemporaryRef +already_AddRefed gfxMacFont::GetScaledFont(DrawTarget *aTarget) { if (!mAzureScaledFont) { @@ -441,7 +441,7 @@ gfxMacFont::GetScaledFont(DrawTarget *aTarget) return scaledFont.forget(); } -TemporaryRef +already_AddRefed gfxMacFont::GetGlyphRenderingOptions(const TextRunDrawParams* aRunParams) { if (aRunParams) { diff --git a/gfx/thebes/gfxMacFont.h b/gfx/thebes/gfxMacFont.h index a05f65bc8a2..62e0ded27e5 100644 --- a/gfx/thebes/gfxMacFont.h +++ b/gfx/thebes/gfxMacFont.h @@ -48,10 +48,10 @@ public: virtual int32_t GetGlyphWidth(DrawTarget& aDrawTarget, uint16_t aGID) override; - virtual mozilla::TemporaryRef + virtual already_AddRefed GetScaledFont(mozilla::gfx::DrawTarget *aTarget) override; - virtual mozilla::TemporaryRef + virtual already_AddRefed GetGlyphRenderingOptions(const TextRunDrawParams* aRunParams = nullptr) override; virtual void AddSizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf, diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp index a570bbe7f65..0c9379d26ec 100644 --- a/gfx/thebes/gfxPlatform.cpp +++ b/gfx/thebes/gfxPlatform.cpp @@ -778,7 +778,7 @@ gfxPlatform::~gfxPlatform() cairo_user_data_key_t kDrawTarget; -TemporaryRef +already_AddRefed gfxPlatform::CreateDrawTargetForSurface(gfxASurface *aSurface, const IntSize& aSize) { SurfaceFormat format = Optimal2DFormatForContent(aSurface->GetContentType()); @@ -794,7 +794,7 @@ gfxPlatform::CreateDrawTargetForSurface(gfxASurface *aSurface, const IntSize& aS // This is a temporary function used by ContentClient to build a DrawTarget // around the gfxASurface. This should eventually be replaced by plumbing // the DrawTarget through directly -TemporaryRef +already_AddRefed gfxPlatform::CreateDrawTargetForUpdateSurface(gfxASurface *aSurface, const IntSize& aSize) { #ifdef XP_MACOSX @@ -847,7 +847,7 @@ gfxPlatform::ClearSourceSurfaceForSurface(gfxASurface *aSurface) aSurface->SetData(&kSourceSurface, nullptr, nullptr); } -/* static */ TemporaryRef +/* static */ already_AddRefed gfxPlatform::GetSourceSurfaceForSurface(DrawTarget *aTarget, gfxASurface *aSurface) { if (!aSurface->CairoSurface() || aSurface->CairoStatus()) { @@ -1003,7 +1003,7 @@ gfxPlatform::GetSourceSurfaceForSurface(DrawTarget *aTarget, gfxASurface *aSurfa return srcBuffer.forget(); } -TemporaryRef +already_AddRefed gfxPlatform::GetWrappedDataSourceSurface(gfxASurface* aSurface) { nsRefPtr image = aSurface->GetAsImageSurface(); @@ -1029,7 +1029,7 @@ gfxPlatform::GetWrappedDataSourceSurface(gfxASurface* aSurface) return result.forget(); } -TemporaryRef +already_AddRefed gfxPlatform::GetScaledFontForFont(DrawTarget* aTarget, gfxFont *aFont) { NativeFont nativeFont; @@ -1202,7 +1202,7 @@ gfxPlatform::HasEnoughTotalSystemMemoryForSkiaGL() return true; } -TemporaryRef +already_AddRefed gfxPlatform::CreateDrawTargetForBackend(BackendType aBackend, const IntSize& aSize, SurfaceFormat aFormat) { // There is a bunch of knowledge in the gfxPlatform heirarchy about how to @@ -1226,7 +1226,7 @@ gfxPlatform::CreateDrawTargetForBackend(BackendType aBackend, const IntSize& aSi } } -TemporaryRef +already_AddRefed gfxPlatform::CreateOffscreenCanvasDrawTarget(const IntSize& aSize, SurfaceFormat aFormat) { NS_ASSERTION(mPreferredCanvasBackend != BackendType::NONE, "No backend."); @@ -1244,14 +1244,14 @@ gfxPlatform::CreateOffscreenCanvasDrawTarget(const IntSize& aSize, SurfaceFormat #endif } -TemporaryRef +already_AddRefed gfxPlatform::CreateOffscreenContentDrawTarget(const IntSize& aSize, SurfaceFormat aFormat) { NS_ASSERTION(mPreferredCanvasBackend != BackendType::NONE, "No backend."); return CreateDrawTargetForBackend(mContentBackend, aSize, aFormat); } -TemporaryRef +already_AddRefed gfxPlatform::CreateDrawTargetForData(unsigned char* aData, const IntSize& aSize, int32_t aStride, SurfaceFormat aFormat) { NS_ASSERTION(mContentBackend != BackendType::NONE, "No backend."); @@ -2367,7 +2367,7 @@ gfxPlatform::DisableBufferRotation() sBufferRotationCheckPref = false; } -TemporaryRef +already_AddRefed gfxPlatform::GetScaledFontForFontWithCairoSkia(DrawTarget* aTarget, gfxFont* aFont) { NativeFont nativeFont; diff --git a/gfx/thebes/gfxPlatform.h b/gfx/thebes/gfxPlatform.h index 0f4ffe4741b..9b3308cdfe8 100644 --- a/gfx/thebes/gfxPlatform.h +++ b/gfx/thebes/gfxPlatform.h @@ -214,10 +214,10 @@ public: * support the DrawTarget we get back. * See SupportsAzureContentForDrawTarget. */ - virtual mozilla::TemporaryRef + virtual already_AddRefed CreateDrawTargetForSurface(gfxASurface *aSurface, const mozilla::gfx::IntSize& aSize); - virtual mozilla::TemporaryRef + virtual already_AddRefed CreateDrawTargetForUpdateSurface(gfxASurface *aSurface, const mozilla::gfx::IntSize& aSize); /* @@ -232,24 +232,24 @@ public: * PluginInstanceChild (where we can't call gfxPlatform::GetPlatform() * because the prefs service can only be accessed from the main process). */ - static mozilla::TemporaryRef + static already_AddRefed GetSourceSurfaceForSurface(mozilla::gfx::DrawTarget *aTarget, gfxASurface *aSurface); static void ClearSourceSurfaceForSurface(gfxASurface *aSurface); - static mozilla::TemporaryRef + static already_AddRefed GetWrappedDataSourceSurface(gfxASurface *aSurface); - virtual mozilla::TemporaryRef + virtual already_AddRefed GetScaledFontForFont(mozilla::gfx::DrawTarget* aTarget, gfxFont *aFont); - mozilla::TemporaryRef + already_AddRefed CreateOffscreenContentDrawTarget(const mozilla::gfx::IntSize& aSize, mozilla::gfx::SurfaceFormat aFormat); - mozilla::TemporaryRef + already_AddRefed CreateOffscreenCanvasDrawTarget(const mozilla::gfx::IntSize& aSize, mozilla::gfx::SurfaceFormat aFormat); - virtual mozilla::TemporaryRef + virtual already_AddRefed CreateDrawTargetForData(unsigned char* aData, const mozilla::gfx::IntSize& aSize, int32_t aStride, mozilla::gfx::SurfaceFormat aFormat); @@ -645,7 +645,7 @@ public: * Helper method, creates a draw target for a specific Azure backend. * Used by CreateOffscreenDrawTarget. */ - mozilla::TemporaryRef + already_AddRefed CreateDrawTargetForBackend(mozilla::gfx::BackendType aBackend, const mozilla::gfx::IntSize& aSize, mozilla::gfx::SurfaceFormat aFormat); @@ -696,7 +696,7 @@ protected: */ static mozilla::gfx::BackendType BackendTypeForName(const nsCString& aName); - static mozilla::TemporaryRef + static already_AddRefed GetScaledFontForFontWithCairoSkia(mozilla::gfx::DrawTarget* aTarget, gfxFont* aFont); int8_t mAllowDownloadableFonts; diff --git a/gfx/thebes/gfxPlatformGtk.cpp b/gfx/thebes/gfxPlatformGtk.cpp index 91fcc7db84a..bda072ff182 100644 --- a/gfx/thebes/gfxPlatformGtk.cpp +++ b/gfx/thebes/gfxPlatformGtk.cpp @@ -541,7 +541,7 @@ gfxPlatformGtk::GetGdkDrawable(cairo_surface_t *target) } #endif -TemporaryRef +already_AddRefed gfxPlatformGtk::GetScaledFontForFont(DrawTarget* aTarget, gfxFont *aFont) { return GetScaledFontForFontWithCairoSkia(aTarget, aFont); diff --git a/gfx/thebes/gfxPlatformGtk.h b/gfx/thebes/gfxPlatformGtk.h index e0544cc3816..5dc9378f14a 100644 --- a/gfx/thebes/gfxPlatformGtk.h +++ b/gfx/thebes/gfxPlatformGtk.h @@ -32,7 +32,7 @@ public: CreateOffscreenSurface(const IntSize& size, gfxContentType contentType) override; - virtual mozilla::TemporaryRef + virtual already_AddRefed GetScaledFontForFont(mozilla::gfx::DrawTarget* aTarget, gfxFont *aFont) override; virtual nsresult GetFontList(nsIAtom *aLangGroup, diff --git a/gfx/thebes/gfxPlatformMac.cpp b/gfx/thebes/gfxPlatformMac.cpp index 45a905c0d7d..0cdb2318e86 100644 --- a/gfx/thebes/gfxPlatformMac.cpp +++ b/gfx/thebes/gfxPlatformMac.cpp @@ -124,7 +124,7 @@ gfxPlatformMac::CreateOffscreenSurface(const IntSize& size, return newSurface.forget(); } -TemporaryRef +already_AddRefed gfxPlatformMac::GetScaledFontForFont(DrawTarget* aTarget, gfxFont *aFont) { gfxMacFont *font = static_cast(aFont); diff --git a/gfx/thebes/gfxPlatformMac.h b/gfx/thebes/gfxPlatformMac.h index 2335a54f35d..efd790ef1d7 100644 --- a/gfx/thebes/gfxPlatformMac.h +++ b/gfx/thebes/gfxPlatformMac.h @@ -29,7 +29,7 @@ public: CreateOffscreenSurface(const IntSize& size, gfxContentType contentType) override; - mozilla::TemporaryRef + already_AddRefed GetScaledFontForFont(mozilla::gfx::DrawTarget* aTarget, gfxFont *aFont) override; nsresult GetStandardFamilyName(const nsAString& aFontName, nsAString& aFamilyName) override; diff --git a/gfx/thebes/gfxQtPlatform.cpp b/gfx/thebes/gfxQtPlatform.cpp index 9730c5a6ce0..81b83eda26c 100644 --- a/gfx/thebes/gfxQtPlatform.cpp +++ b/gfx/thebes/gfxQtPlatform.cpp @@ -202,7 +202,7 @@ gfxQtPlatform::GetScreenDepth() const return mScreenDepth; } -TemporaryRef +already_AddRefed gfxQtPlatform::GetScaledFontForFont(DrawTarget* aTarget, gfxFont* aFont) { return GetScaledFontForFontWithCairoSkia(aTarget, aFont); diff --git a/gfx/thebes/gfxQtPlatform.h b/gfx/thebes/gfxQtPlatform.h index 27d0ea474eb..4322bf228bd 100644 --- a/gfx/thebes/gfxQtPlatform.h +++ b/gfx/thebes/gfxQtPlatform.h @@ -30,7 +30,7 @@ public: CreateOffscreenSurface(const IntSize& size, gfxContentType contentType) override; - virtual mozilla::TemporaryRef + virtual already_AddRefed GetScaledFontForFont(mozilla::gfx::DrawTarget* aTarget, gfxFont *aFont) override; virtual nsresult GetFontList(nsIAtom *aLangGroup, diff --git a/gfx/thebes/gfxUtils.cpp b/gfx/thebes/gfxUtils.cpp index e9cd0d984c0..179fa82132e 100644 --- a/gfx/thebes/gfxUtils.cpp +++ b/gfx/thebes/gfxUtils.cpp @@ -323,7 +323,7 @@ MapSrcAndCreateMappedDest(DataSourceSurface* srcSurf, return true; } -TemporaryRef +already_AddRefed gfxUtils::CreatePremultipliedDataSurface(DataSourceSurface* srcSurf) { RefPtr destSurf; @@ -344,7 +344,7 @@ gfxUtils::CreatePremultipliedDataSurface(DataSourceSurface* srcSurf) return destSurf.forget(); } -TemporaryRef +already_AddRefed gfxUtils::CreateUnpremultipliedDataSurface(DataSourceSurface* srcSurf) { RefPtr destSurf; @@ -705,7 +705,7 @@ ClipToRegionInternal(gfxContext* aContext, const nsIntRegion& aRegion) aContext->Clip(); } -static TemporaryRef +static already_AddRefed PathFromRegionInternal(DrawTarget* aTarget, const nsIntRegion& aRegion) { RefPtr pb = aTarget->CreatePathBuilder(); @@ -1020,7 +1020,7 @@ gfxUtils::ConvertYCbCrToRGB(const PlanarYCbCrData& aData, cairo_destroy(ctx); } -/* static */ TemporaryRef +/* static */ already_AddRefed gfxUtils::CopySurfaceToDataSourceSurfaceWithFormat(SourceSurface* aSurface, SurfaceFormat aFormat) { diff --git a/gfx/thebes/gfxUtils.h b/gfx/thebes/gfxUtils.h index 74ab99a92bf..68d9772f86e 100644 --- a/gfx/thebes/gfxUtils.h +++ b/gfx/thebes/gfxUtils.h @@ -55,9 +55,9 @@ public: static bool UnpremultiplyDataSurface(DataSourceSurface* srcSurf, DataSourceSurface* destSurf); - static mozilla::TemporaryRef + static already_AddRefed CreatePremultipliedDataSurface(DataSourceSurface* srcSurf); - static mozilla::TemporaryRef + static already_AddRefed CreateUnpremultipliedDataSurface(DataSourceSurface* srcSurf); static void ConvertBGRAtoRGBA(uint8_t* aData, uint32_t aLength); @@ -206,7 +206,7 @@ public: * realize format conversion may involve expensive copying/uploading/ * readback.) */ - static mozilla::TemporaryRef + static already_AddRefed CopySurfaceToDataSourceSurfaceWithFormat(SourceSurface* aSurface, SurfaceFormat aFormat); diff --git a/gfx/thebes/gfxWindowsPlatform.cpp b/gfx/thebes/gfxWindowsPlatform.cpp index 7fe89d915f2..967e5a50b2f 100644 --- a/gfx/thebes/gfxWindowsPlatform.cpp +++ b/gfx/thebes/gfxWindowsPlatform.cpp @@ -798,7 +798,7 @@ gfxWindowsPlatform::CreateOffscreenSurface(const IntSize& size, return surf.forget(); } -TemporaryRef +already_AddRefed gfxWindowsPlatform::GetScaledFontForFont(DrawTarget* aTarget, gfxFont *aFont) { if (aFont->GetType() == gfxFont::FONT_TYPE_DWRITE) { @@ -2058,7 +2058,7 @@ gfxWindowsPlatform::InitD3D11Devices() d3d11Module.disown(); } -TemporaryRef +already_AddRefed gfxWindowsPlatform::CreateD3D11DecoderDevice() { nsModuleHandle d3d11Module(LoadLibrarySystem32(L"d3d11.dll")); diff --git a/gfx/thebes/gfxWindowsPlatform.h b/gfx/thebes/gfxWindowsPlatform.h index 910b2d0abc1..10ec11ca006 100644 --- a/gfx/thebes/gfxWindowsPlatform.h +++ b/gfx/thebes/gfxWindowsPlatform.h @@ -118,7 +118,7 @@ public: CreateOffscreenSurface(const IntSize& size, gfxContentType contentType) override; - virtual mozilla::TemporaryRef + virtual already_AddRefed GetScaledFontForFont(mozilla::gfx::DrawTarget* aTarget, gfxFont *aFont); enum RenderMode { @@ -250,7 +250,7 @@ public: ID3D11Device *GetD3D11ImageBridgeDevice(); // Create a D3D11 device to be used for DXVA decoding. - mozilla::TemporaryRef CreateD3D11DecoderDevice(); + already_AddRefed CreateD3D11DecoderDevice(); mozilla::layers::ReadbackManagerD3D11* GetReadbackManager(); diff --git a/image/ClippedImage.cpp b/image/ClippedImage.cpp index e40c77e7b7d..eeb71263f70 100644 --- a/image/ClippedImage.cpp +++ b/image/ClippedImage.cpp @@ -33,7 +33,7 @@ namespace image { class ClippedImageCachedSurface { public: - ClippedImageCachedSurface(TemporaryRef aSurface, + ClippedImageCachedSurface(already_AddRefed aSurface, const nsIntSize& aSize, const Maybe& aSVGContext, float aFrame, @@ -60,7 +60,7 @@ public: mFlags == aFlags; } - TemporaryRef Surface() { + already_AddRefed Surface() { RefPtr surf(mSurface); return surf.forget(); } @@ -213,14 +213,14 @@ ClippedImage::GetIntrinsicRatio(nsSize* aRatio) return NS_OK; } -NS_IMETHODIMP_(TemporaryRef) +NS_IMETHODIMP_(already_AddRefed) ClippedImage::GetFrame(uint32_t aWhichFrame, uint32_t aFlags) { return GetFrameInternal(mClip.Size(), Nothing(), aWhichFrame, aFlags); } -TemporaryRef +already_AddRefed ClippedImage::GetFrameInternal(const nsIntSize& aSize, const Maybe& aSVGContext, uint32_t aWhichFrame, diff --git a/image/ClippedImage.h b/image/ClippedImage.h index febf421f9d7..88f7d476f33 100644 --- a/image/ClippedImage.h +++ b/image/ClippedImage.h @@ -35,7 +35,7 @@ public: NS_IMETHOD GetHeight(int32_t* aHeight) override; NS_IMETHOD GetIntrinsicSize(nsSize* aSize) override; NS_IMETHOD GetIntrinsicRatio(nsSize* aRatio) override; - NS_IMETHOD_(TemporaryRef) + NS_IMETHOD_(already_AddRefed) GetFrame(uint32_t aWhichFrame, uint32_t aFlags) override; NS_IMETHOD_(bool) IsImageContainerAvailable(layers::LayerManager* aManager, uint32_t aFlags) override; @@ -64,7 +64,7 @@ protected: virtual ~ClippedImage(); private: - TemporaryRef + already_AddRefed GetFrameInternal(const nsIntSize& aSize, const Maybe& aSVGContext, uint32_t aWhichFrame, diff --git a/image/DynamicImage.cpp b/image/DynamicImage.cpp index 991a14d7ce6..a8dca62f9ea 100644 --- a/image/DynamicImage.cpp +++ b/image/DynamicImage.cpp @@ -163,7 +163,7 @@ DynamicImage::GetAnimated(bool* aAnimated) return NS_OK; } -NS_IMETHODIMP_(TemporaryRef) +NS_IMETHODIMP_(already_AddRefed) DynamicImage::GetFrame(uint32_t aWhichFrame, uint32_t aFlags) { diff --git a/image/FrozenImage.cpp b/image/FrozenImage.cpp index 2213fab7583..628e33d74d1 100644 --- a/image/FrozenImage.cpp +++ b/image/FrozenImage.cpp @@ -37,7 +37,7 @@ FrozenImage::GetAnimated(bool* aAnimated) return rv; } -NS_IMETHODIMP_(TemporaryRef) +NS_IMETHODIMP_(already_AddRefed) FrozenImage::GetFrame(uint32_t aWhichFrame, uint32_t aFlags) { diff --git a/image/FrozenImage.h b/image/FrozenImage.h index 9366ae57271..ee6e4bd6315 100644 --- a/image/FrozenImage.h +++ b/image/FrozenImage.h @@ -35,7 +35,7 @@ public: virtual void DecrementAnimationConsumers() override; NS_IMETHOD GetAnimated(bool* aAnimated) override; - NS_IMETHOD_(TemporaryRef) + NS_IMETHOD_(already_AddRefed) GetFrame(uint32_t aWhichFrame, uint32_t aFlags) override; NS_IMETHOD_(bool) IsImageContainerAvailable(layers::LayerManager* aManager, uint32_t aFlags) override; diff --git a/image/ImageWrapper.cpp b/image/ImageWrapper.cpp index fdecbe04026..2aa5b25a7ee 100644 --- a/image/ImageWrapper.cpp +++ b/image/ImageWrapper.cpp @@ -167,7 +167,7 @@ ImageWrapper::GetAnimated(bool* aAnimated) return mInnerImage->GetAnimated(aAnimated); } -NS_IMETHODIMP_(TemporaryRef) +NS_IMETHODIMP_(already_AddRefed) ImageWrapper::GetFrame(uint32_t aWhichFrame, uint32_t aFlags) { diff --git a/image/OrientedImage.cpp b/image/OrientedImage.cpp index c8ef703d9b8..b2d13bee384 100644 --- a/image/OrientedImage.cpp +++ b/image/OrientedImage.cpp @@ -70,7 +70,7 @@ OrientedImage::GetIntrinsicRatio(nsSize* aRatio) return rv; } -NS_IMETHODIMP_(TemporaryRef) +NS_IMETHODIMP_(already_AddRefed) OrientedImage::GetFrame(uint32_t aWhichFrame, uint32_t aFlags) { diff --git a/image/OrientedImage.h b/image/OrientedImage.h index 1796f3125d6..e1f321fc15f 100644 --- a/image/OrientedImage.h +++ b/image/OrientedImage.h @@ -32,7 +32,7 @@ public: NS_IMETHOD GetHeight(int32_t* aHeight) override; NS_IMETHOD GetIntrinsicSize(nsSize* aSize) override; NS_IMETHOD GetIntrinsicRatio(nsSize* aRatio) override; - NS_IMETHOD_(TemporaryRef) + NS_IMETHOD_(already_AddRefed) GetFrame(uint32_t aWhichFrame, uint32_t aFlags) override; NS_IMETHOD_(bool) IsImageContainerAvailable(layers::LayerManager* aManager, uint32_t aFlags) override; diff --git a/image/RasterImage.cpp b/image/RasterImage.cpp index 6a46e6f74b6..06bf5e9395d 100644 --- a/image/RasterImage.cpp +++ b/image/RasterImage.cpp @@ -664,7 +664,7 @@ RasterImage::GetFirstFrameDelay() return mAnim->GetTimeoutForFrame(0); } -TemporaryRef +already_AddRefed RasterImage::CopyFrame(uint32_t aWhichFrame, uint32_t aFlags) { if (aWhichFrame > FRAME_MAX_VALUE) { @@ -740,7 +740,7 @@ RasterImage::CopyFrame(uint32_t aWhichFrame, uint32_t aFlags) //****************************************************************************** /* [noscript] SourceSurface getFrame(in uint32_t aWhichFrame, * in uint32_t aFlags); */ -NS_IMETHODIMP_(TemporaryRef) +NS_IMETHODIMP_(already_AddRefed) RasterImage::GetFrame(uint32_t aWhichFrame, uint32_t aFlags) { diff --git a/image/RasterImage.h b/image/RasterImage.h index 96f8443cb6d..b579f05df22 100644 --- a/image/RasterImage.h +++ b/image/RasterImage.h @@ -295,7 +295,7 @@ private: GraphicsFilter aFilter, uint32_t aFlags); - TemporaryRef CopyFrame(uint32_t aWhichFrame, + already_AddRefed CopyFrame(uint32_t aWhichFrame, uint32_t aFlags); Pair> diff --git a/image/VectorImage.cpp b/image/VectorImage.cpp index 824b2dfc6d4..469ea1b9fcc 100644 --- a/image/VectorImage.cpp +++ b/image/VectorImage.cpp @@ -668,7 +668,7 @@ VectorImage::IsOpaque() //****************************************************************************** /* [noscript] SourceSurface getFrame(in uint32_t aWhichFrame, * in uint32_t aFlags; */ -NS_IMETHODIMP_(TemporaryRef) +NS_IMETHODIMP_(already_AddRefed) VectorImage::GetFrame(uint32_t aWhichFrame, uint32_t aFlags) { diff --git a/image/imgFrame.cpp b/image/imgFrame.cpp index 2b033e74885..1e0546f17f3 100644 --- a/image/imgFrame.cpp +++ b/image/imgFrame.cpp @@ -48,7 +48,7 @@ VolatileSurfaceStride(const IntSize& size, SurfaceFormat format) return (size.width * BytesPerPixel(format) + 0x3) & ~0x3; } -static TemporaryRef +static already_AddRefed CreateLockedSurface(VolatileBuffer* vbuf, const IntSize& size, SurfaceFormat format) @@ -69,7 +69,7 @@ CreateLockedSurface(VolatileBuffer* vbuf, return surf.forget(); } -static TemporaryRef +static already_AddRefed AllocateBufferForImage(const IntSize& size, SurfaceFormat format) { int32_t stride = VolatileSurfaceStride(size, format); @@ -1045,14 +1045,14 @@ imgFrame::IsSinglePixel() const return mSinglePixel; } -TemporaryRef +already_AddRefed imgFrame::GetSurface() { MonitorAutoLock lock(mMonitor); return GetSurfaceInternal(); } -TemporaryRef +already_AddRefed imgFrame::GetSurfaceInternal() { mMonitor.AssertCurrentThreadOwns(); @@ -1083,7 +1083,7 @@ imgFrame::GetSurfaceInternal() return CreateLockedSurface(mVBuf, mSize, mFormat); } -TemporaryRef +already_AddRefed imgFrame::GetDrawTarget() { MonitorAutoLock lock(mMonitor); diff --git a/image/imgFrame.h b/image/imgFrame.h index c77d32543a4..43b212edb10 100644 --- a/image/imgFrame.h +++ b/image/imgFrame.h @@ -274,8 +274,8 @@ public: Color SinglePixelColor() const; bool IsSinglePixel() const; - TemporaryRef GetSurface(); - TemporaryRef GetDrawTarget(); + already_AddRefed GetSurface(); + already_AddRefed GetDrawTarget(); size_t SizeOfExcludingThis(gfxMemoryLocation aLocation, MallocSizeOf aMallocSizeOf) const; @@ -297,7 +297,7 @@ private: // methods uint32_t GetImageBytesPerRow() const; uint32_t GetImageDataLength() const; int32_t GetStride() const; - TemporaryRef GetSurfaceInternal(); + already_AddRefed GetSurfaceInternal(); uint32_t PaletteDataLength() const { diff --git a/image/imgIContainer.idl b/image/imgIContainer.idl index a9e168e59cd..945984725f3 100644 --- a/image/imgIContainer.idl +++ b/image/imgIContainer.idl @@ -104,7 +104,7 @@ native TempRefImageContainer(already_AddRefed); native Orientation(mozilla::image::Orientation); [ref] native TimeStamp(mozilla::TimeStamp); [ref] native MaybeSVGImageContext(mozilla::Maybe); -native TempRefSourceSurface(mozilla::TemporaryRef); +native TempRefSourceSurface(already_AddRefed); native TempRefImgIContainer(already_AddRefed); native nsIntSizeByVal(nsIntSize); @@ -116,7 +116,7 @@ native nsIntSizeByVal(nsIntSize); * * Internally, imgIContainer also manages animation of images. */ -[scriptable, builtinclass, uuid(f5e1230a-3733-477f-b49b-fee8717a786b)] +[scriptable, builtinclass, uuid(f3596ad3-4238-4bc4-8093-90bc2d002ab6)] interface imgIContainer : nsISupports { /** diff --git a/layout/base/DisplayItemClip.cpp b/layout/base/DisplayItemClip.cpp index da65ee25cda..6ef03d05d69 100644 --- a/layout/base/DisplayItemClip.cpp +++ b/layout/base/DisplayItemClip.cpp @@ -152,7 +152,7 @@ DisplayItemClip::FillIntersectionOfRoundedRectClips(gfxContext* aContext, } } -TemporaryRef +already_AddRefed DisplayItemClip::MakeRoundedRectPath(DrawTarget& aDrawTarget, int32_t A2D, const RoundedRect &aRoundRect) const diff --git a/layout/base/DisplayItemClip.h b/layout/base/DisplayItemClip.h index 21db189ab39..1536242da16 100644 --- a/layout/base/DisplayItemClip.h +++ b/layout/base/DisplayItemClip.h @@ -91,7 +91,7 @@ public: uint32_t aBegin, uint32_t aEnd) const; // 'Draw' (create as a path, does not stroke or fill) aRoundRect to aContext - mozilla::TemporaryRef MakeRoundedRectPath(DrawTarget& aDrawTarget, + already_AddRefed MakeRoundedRectPath(DrawTarget& aDrawTarget, int32_t A2D, const RoundedRect &aRoundRect) const; diff --git a/layout/base/nsCSSRenderingBorders.cpp b/layout/base/nsCSSRenderingBorders.cpp index 15f2f767967..ce932b17243 100644 --- a/layout/base/nsCSSRenderingBorders.cpp +++ b/layout/base/nsCSSRenderingBorders.cpp @@ -443,7 +443,7 @@ MaybeMoveToMidPoint(Point& aP0, Point& aP1, const Point& aMidPoint) } } -TemporaryRef +already_AddRefed nsCSSBorderRenderer::GetSideClipSubPath(mozilla::css::Side aSide) { // the clip proceeds clockwise from the top left corner; @@ -1032,7 +1032,7 @@ bool IsVisible(int aStyle) return false; } -TemporaryRef +already_AddRefed nsCSSBorderRenderer::CreateCornerGradient(mozilla::css::Corner aCorner, nscolor aFirstColor, nscolor aSecondColor, diff --git a/layout/base/nsCSSRenderingBorders.h b/layout/base/nsCSSRenderingBorders.h index 67efbb55e62..cbe2d06bd86 100644 --- a/layout/base/nsCSSRenderingBorders.h +++ b/layout/base/nsCSSRenderingBorders.h @@ -165,7 +165,7 @@ private: // This code needs to make sure that the individual pieces // don't ever (mathematically) overlap; the pixel overlap // is taken care of by the ADD compositing. - mozilla::TemporaryRef GetSideClipSubPath(mozilla::css::Side aSide); + already_AddRefed GetSideClipSubPath(mozilla::css::Side aSide); // Given a set of sides to fill and a color, do so in the fastest way. // @@ -212,7 +212,7 @@ private: bool AllBordersSolid(bool *aHasCompositeColors); // Azure variant of CreateCornerGradient. - mozilla::TemporaryRef + already_AddRefed CreateCornerGradient(mozilla::css::Corner aCorner, nscolor aFirstColor, nscolor aSecondColor, mozilla::gfx::DrawTarget *aDT, mozilla::gfx::Point &aPoint1, mozilla::gfx::Point &aPoint2); diff --git a/layout/base/nsIPresShell.h b/layout/base/nsIPresShell.h index e66bd6b523a..c15624856c6 100644 --- a/layout/base/nsIPresShell.h +++ b/layout/base/nsIPresShell.h @@ -1111,7 +1111,7 @@ public: * edge of the presshell area. The aPoint, aScreenRect and aSurface * arguments function in a similar manner as RenderSelection. */ - virtual mozilla::TemporaryRef + virtual already_AddRefed RenderNode(nsIDOMNode* aNode, nsIntRegion* aRegion, nsIntPoint& aPoint, @@ -1132,7 +1132,7 @@ public: * the original. When scaling does not occur, the mouse point isn't used * as the position can be determined from the displayed frames. */ - virtual mozilla::TemporaryRef + virtual already_AddRefed RenderSelection(nsISelection* aSelection, nsIntPoint& aPoint, nsIntRect* aScreenRect) = 0; diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 59d8ca76276..67788277115 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -4913,7 +4913,7 @@ PresShell::CreateRangePaintInfo(nsIDOMRange* aRange, return info; } -TemporaryRef +already_AddRefed PresShell::PaintRangePaintInfo(nsTArray >* aItems, nsISelection* aSelection, nsIntRegion* aRegion, @@ -5038,7 +5038,7 @@ PresShell::PaintRangePaintInfo(nsTArray >* aItems, return dt->Snapshot(); } -TemporaryRef +already_AddRefed PresShell::RenderNode(nsIDOMNode* aNode, nsIntRegion* aRegion, nsIntPoint& aPoint, @@ -5084,7 +5084,7 @@ PresShell::RenderNode(nsIDOMNode* aNode, aScreenRect); } -TemporaryRef +already_AddRefed PresShell::RenderSelection(nsISelection* aSelection, nsIntPoint& aPoint, nsIntRect* aScreenRect) diff --git a/layout/base/nsPresShell.h b/layout/base/nsPresShell.h index 7ac0adb64e0..72f979947fd 100644 --- a/layout/base/nsPresShell.h +++ b/layout/base/nsPresShell.h @@ -186,13 +186,13 @@ public: nscolor aBackgroundColor, gfxContext* aThebesContext) override; - virtual mozilla::TemporaryRef + virtual already_AddRefed RenderNode(nsIDOMNode* aNode, nsIntRegion* aRegion, nsIntPoint& aPoint, nsIntRect* aScreenRect) override; - virtual mozilla::TemporaryRef + virtual already_AddRefed RenderSelection(nsISelection* aSelection, nsIntPoint& aPoint, nsIntRect* aScreenRect) override; @@ -543,7 +543,7 @@ protected: * aScreenRect - [out] set to the area of the screen the painted area should * be displayed at */ - mozilla::TemporaryRef + already_AddRefed PaintRangePaintInfo(nsTArray >* aItems, nsISelection* aSelection, nsIntRegion* aRegion, diff --git a/layout/svg/SVGTextFrame.cpp b/layout/svg/SVGTextFrame.cpp index 4187408b994..445d4f4b0ac 100644 --- a/layout/svg/SVGTextFrame.cpp +++ b/layout/svg/SVGTextFrame.cpp @@ -4945,7 +4945,7 @@ SVGTextFrame::GetTextPathPathElement(nsIFrame* aTextPathFrame) static_cast(element) : nullptr; } -TemporaryRef +already_AddRefed SVGTextFrame::GetTextPath(nsIFrame* aTextPathFrame) { SVGPathElement* element = GetTextPathPathElement(aTextPathFrame); diff --git a/layout/svg/SVGTextFrame.h b/layout/svg/SVGTextFrame.h index 6150e2374ce..c35ea3e4f9b 100644 --- a/layout/svg/SVGTextFrame.h +++ b/layout/svg/SVGTextFrame.h @@ -605,7 +605,7 @@ private: // Methods to get information for a frame. mozilla::dom::SVGPathElement* GetTextPathPathElement(nsIFrame* aTextPathFrame); - mozilla::TemporaryRef GetTextPath(nsIFrame* aTextPathFrame); + already_AddRefed GetTextPath(nsIFrame* aTextPathFrame); gfxFloat GetOffsetScale(nsIFrame* aTextPathFrame); gfxFloat GetStartOffset(nsIFrame* aTextPathFrame); diff --git a/layout/svg/nsSVGMaskFrame.cpp b/layout/svg/nsSVGMaskFrame.cpp index 200df54a82f..9421e66b6f4 100644 --- a/layout/svg/nsSVGMaskFrame.cpp +++ b/layout/svg/nsSVGMaskFrame.cpp @@ -200,7 +200,7 @@ NS_NewSVGMaskFrame(nsIPresShell* aPresShell, nsStyleContext* aContext) NS_IMPL_FRAMEARENA_HELPERS(nsSVGMaskFrame) -TemporaryRef +already_AddRefed nsSVGMaskFrame::GetMaskForMaskedFrame(gfxContext* aContext, nsIFrame* aMaskedFrame, const gfxMatrix &aMatrix, diff --git a/layout/svg/nsSVGMaskFrame.h b/layout/svg/nsSVGMaskFrame.h index c94899f8c97..a93c96898db 100644 --- a/layout/svg/nsSVGMaskFrame.h +++ b/layout/svg/nsSVGMaskFrame.h @@ -53,7 +53,7 @@ public: NS_DECL_FRAMEARENA_HELPERS // nsSVGMaskFrame method: - mozilla::TemporaryRef + already_AddRefed GetMaskForMaskedFrame(gfxContext* aContext, nsIFrame* aMaskedFrame, const gfxMatrix &aMatrix, diff --git a/layout/svg/nsSVGPatternFrame.cpp b/layout/svg/nsSVGPatternFrame.cpp index 701945ffd48..39b5ecd5ca1 100644 --- a/layout/svg/nsSVGPatternFrame.cpp +++ b/layout/svg/nsSVGPatternFrame.cpp @@ -229,7 +229,7 @@ GetTargetGeometry(gfxRect *aBBox, return NS_OK; } -TemporaryRef +already_AddRefed nsSVGPatternFrame::PaintPattern(const DrawTarget* aDrawTarget, Matrix* patternMatrix, const Matrix &aContextMatrix, diff --git a/layout/svg/nsSVGPatternFrame.h b/layout/svg/nsSVGPatternFrame.h index 62954e310f2..ed832a591c6 100644 --- a/layout/svg/nsSVGPatternFrame.h +++ b/layout/svg/nsSVGPatternFrame.h @@ -109,7 +109,7 @@ protected: return GetLengthValue(aIndex, mContent); } - mozilla::TemporaryRef + already_AddRefed PaintPattern(const DrawTarget* aDrawTarget, Matrix *patternMatrix, const Matrix &aContextMatrix, diff --git a/media/mtransport/dtlsidentity.cpp b/media/mtransport/dtlsidentity.cpp index 7e17c98e720..b0a0b21907d 100644 --- a/media/mtransport/dtlsidentity.cpp +++ b/media/mtransport/dtlsidentity.cpp @@ -26,7 +26,7 @@ DtlsIdentity::~DtlsIdentity() { const std::string DtlsIdentity::DEFAULT_HASH_ALGORITHM = "sha-256"; -TemporaryRef DtlsIdentity::Generate() { +already_AddRefed DtlsIdentity::Generate() { ScopedPK11SlotInfo slot(PK11_GetInternalSlot()); if (!slot) { diff --git a/media/mtransport/dtlsidentity.h b/media/mtransport/dtlsidentity.h index f511e37a3f0..ab2c160302f 100644 --- a/media/mtransport/dtlsidentity.h +++ b/media/mtransport/dtlsidentity.h @@ -24,7 +24,7 @@ class DtlsIdentity { public: // Generate an identity with a random name. - static TemporaryRef Generate(); + static already_AddRefed Generate(); // Note: the following two functions just provide access. They // do not transfer ownership. If you want a pointer that lasts diff --git a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.h b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.h index 137dd6eb07a..9430a975137 100644 --- a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.h +++ b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.h @@ -361,7 +361,7 @@ class GenericReceiveCallback : public TrackAddedCallback class ConduitDeleteEvent: public nsRunnable { public: - explicit ConduitDeleteEvent(TemporaryRef aConduit) : + explicit ConduitDeleteEvent(already_AddRefed aConduit) : mConduit(aConduit) {} /* we exist solely to proxy release of the conduit */ diff --git a/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp b/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp index b6051f5a882..cba75c34633 100644 --- a/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp +++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp @@ -1316,7 +1316,7 @@ RefPtr SourceStreamInfo::GetPipelineByTrackId_m( return nullptr; } -TemporaryRef +already_AddRefed LocalSourceStreamInfo::ForgetPipelineByTrackId_m(const std::string& trackId) { ASSERT_ON_THREAD(mParent->GetMainThread()); diff --git a/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.h b/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.h index 0db2170d6b3..707ab8b8ada 100644 --- a/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.h +++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.h @@ -144,7 +144,7 @@ public: NS_INLINE_DECL_THREADSAFE_REFCOUNTING(LocalSourceStreamInfo) private: - TemporaryRef ForgetPipelineByTrackId_m( + already_AddRefed ForgetPipelineByTrackId_m( const std::string& trackId); }; diff --git a/mfbt/RefPtr.h b/mfbt/RefPtr.h index 99ffe59b06e..7baa053eb5b 100644 --- a/mfbt/RefPtr.h +++ b/mfbt/RefPtr.h @@ -278,11 +278,11 @@ public: return *this; } - TemporaryRef forget() + already_AddRefed forget() { T* tmp = mPtr; mPtr = nullptr; - return TemporaryRef(tmp, DontRef()); + return already_AddRefed(tmp); } T* get() const { return mPtr; } @@ -410,19 +410,14 @@ byRef(RefPtr& aPtr) /** * Helper function to be able to conveniently write things like: * - * TemporaryRef + * already_AddRefed * f(...) * { * return MakeAndAddRef(...); * } - * - * since explicitly constructing TemporaryRef is unsightly. Having an - * explicit construction of TemporaryRef from T* also inhibits a future - * auto-conversion from TemporaryRef to already_AddRefed, since the semantics - * of TemporaryRef(T*) differ from already_AddRefed(T*). */ template -TemporaryRef +already_AddRefed MakeAndAddRef(Args&&... aArgs) { RefPtr p(new T(Forward(aArgs)...)); diff --git a/mfbt/tests/TestRefPtr.cpp b/mfbt/tests/TestRefPtr.cpp index ad28482508f..44e1b416bef 100644 --- a/mfbt/tests/TestRefPtr.cpp +++ b/mfbt/tests/TestRefPtr.cpp @@ -8,7 +8,6 @@ using mozilla::RefCounted; using mozilla::RefPtr; -using mozilla::TemporaryRef; class Foo : public RefCounted { @@ -33,14 +32,14 @@ int Foo::sNumDestroyed; struct Bar : public Foo {}; -TemporaryRef +already_AddRefed NewFoo() { RefPtr f(new Foo()); return f.forget(); } -TemporaryRef +already_AddRefed NewBar() { RefPtr bar = new Bar(); @@ -72,7 +71,7 @@ void GetPassedFoo(RefPtr* aFoo) {} -TemporaryRef +already_AddRefed GetNullFoo() { return 0; @@ -114,8 +113,10 @@ main() MOZ_RELEASE_ASSERT(5 == Foo::sNumDestroyed); { - RefPtr f = new Foo(); - f.forget(); + { + RefPtr f = new Foo(); + RefPtr g = f.forget(); + } MOZ_RELEASE_ASSERT(6 == Foo::sNumDestroyed); } diff --git a/mozglue/linker/BaseElf.cpp b/mozglue/linker/BaseElf.cpp index 2eadf124036..8a78285ef6e 100644 --- a/mozglue/linker/BaseElf.cpp +++ b/mozglue/linker/BaseElf.cpp @@ -81,7 +81,7 @@ BaseElf::FindExidx(int *pcount) const } #endif -mozilla::TemporaryRef +already_AddRefed LoadedElf::Create(const char *path, void *base_addr) { DEBUG_LOG("LoadedElf::Create(\"%s\", %p) = ...", path, base_addr); diff --git a/mozglue/linker/BaseElf.h b/mozglue/linker/BaseElf.h index 5d3a8fd9148..a7b708b50bb 100644 --- a/mozglue/linker/BaseElf.h +++ b/mozglue/linker/BaseElf.h @@ -114,7 +114,7 @@ public: * Returns a LoadedElf corresponding to the already loaded ELF * at the given base address. */ - static mozilla::TemporaryRef Create(const char *path, + static already_AddRefed Create(const char *path, void *base_addr); private: diff --git a/mozglue/linker/CustomElf.cpp b/mozglue/linker/CustomElf.cpp index 53736a28f7a..6ceaee485ca 100644 --- a/mozglue/linker/CustomElf.cpp +++ b/mozglue/linker/CustomElf.cpp @@ -101,7 +101,7 @@ private: }; -TemporaryRef +already_AddRefed CustomElf::Load(Mappable *mappable, const char *path, int flags) { DEBUG_LOG("CustomElf::Load(\"%s\", 0x%x) = ...", path, flags); diff --git a/mozglue/linker/CustomElf.h b/mozglue/linker/CustomElf.h index c7242fb465e..430ce766597 100644 --- a/mozglue/linker/CustomElf.h +++ b/mozglue/linker/CustomElf.h @@ -28,7 +28,7 @@ public: * currently, none are supported and the behaviour is more or less that of * RTLD_GLOBAL | RTLD_BIND_NOW. */ - static mozilla::TemporaryRef Load(Mappable *mappable, + static already_AddRefed Load(Mappable *mappable, const char *path, int flags); /** diff --git a/mozglue/linker/ElfLoader.cpp b/mozglue/linker/ElfLoader.cpp index 09e34e5a3b6..c8f2b1a78f8 100644 --- a/mozglue/linker/ElfLoader.cpp +++ b/mozglue/linker/ElfLoader.cpp @@ -252,7 +252,7 @@ LibHandle::MappableMUnmap(void *addr, size_t length) const /** * SystemElf */ -TemporaryRef +already_AddRefed SystemElf::Load(const char *path, int flags) { /* The Android linker returns a handle when the file name matches an @@ -331,7 +331,7 @@ SystemElf::FindExidx(int *pcount) const /* Unique ElfLoader instance */ ElfLoader ElfLoader::Singleton; -TemporaryRef +already_AddRefed ElfLoader::Load(const char *path, int flags, LibHandle *parent) { /* Ensure logging is initialized or refresh if environment changed. */ @@ -406,7 +406,7 @@ ElfLoader::Load(const char *path, int flags, LibHandle *parent) return handle.forget(); } -mozilla::TemporaryRef +already_AddRefed ElfLoader::GetHandleByPtr(void *addr) { /* Scan the list of handles we already have for a match */ diff --git a/mozglue/linker/ElfLoader.h b/mozglue/linker/ElfLoader.h index 117e2c7e3c9..f8df7a5497a 100644 --- a/mozglue/linker/ElfLoader.h +++ b/mozglue/linker/ElfLoader.h @@ -279,7 +279,7 @@ public: * Returns a new SystemElf for the given path. The given flags are passed * to dlopen(). */ - static mozilla::TemporaryRef Load(const char *path, int flags); + static already_AddRefed Load(const char *path, int flags); /** * Inherited from LibHandle @@ -412,7 +412,7 @@ public: * requesting the given library to be loaded. The loader may look in the * directory containing that parent library for the library to load. */ - mozilla::TemporaryRef Load(const char *path, int flags, + already_AddRefed Load(const char *path, int flags, LibHandle *parent = nullptr); /** @@ -421,7 +421,7 @@ public: * LibHandle::Contains returns true. Its purpose is to allow to * implement dladdr(). */ - mozilla::TemporaryRef GetHandleByPtr(void *addr); + already_AddRefed GetHandleByPtr(void *addr); /** * Returns a Mappable object for the path. Paths in the form diff --git a/mozglue/linker/Zip.cpp b/mozglue/linker/Zip.cpp index 80628e59b76..3344a9a349b 100644 --- a/mozglue/linker/Zip.cpp +++ b/mozglue/linker/Zip.cpp @@ -12,7 +12,7 @@ #include "Logging.h" #include "Zip.h" -mozilla::TemporaryRef +already_AddRefed Zip::Create(const char *filename) { /* Open and map the file in memory */ @@ -41,7 +41,7 @@ Zip::Create(const char *filename) return Create(filename, mapped, size); } -mozilla::TemporaryRef +already_AddRefed Zip::Create(const char *filename, void *mapped, size_t size) { mozilla::RefPtr zip = new Zip(filename, mapped, size); @@ -181,7 +181,7 @@ Zip::GetFirstEntry() const ZipCollection ZipCollection::Singleton; -mozilla::TemporaryRef +already_AddRefed ZipCollection::GetZip(const char *path) { /* Search the list of Zips we already have for a match */ diff --git a/mozglue/linker/Zip.h b/mozglue/linker/Zip.h index 363eecafd7f..76256a14c24 100644 --- a/mozglue/linker/Zip.h +++ b/mozglue/linker/Zip.h @@ -155,17 +155,17 @@ public: * Create a Zip instance for the given file name. Returns nullptr in case * of failure. */ - static mozilla::TemporaryRef Create(const char *filename); + static already_AddRefed Create(const char *filename); /** * Create a Zip instance using the given buffer. */ - static mozilla::TemporaryRef Create(void *buffer, size_t size) { + static already_AddRefed Create(void *buffer, size_t size) { return Create(nullptr, buffer, size); } private: - static mozilla::TemporaryRef Create(const char *filename, + static already_AddRefed Create(const char *filename, void *buffer, size_t size); /** @@ -455,7 +455,7 @@ public: * Get a Zip instance for the given path. If there is an existing one * already, return that one, otherwise create a new one. */ - static mozilla::TemporaryRef GetZip(const char *path); + static already_AddRefed GetZip(const char *path); protected: friend class Zip; diff --git a/security/manager/ssl/nsCertTree.cpp b/security/manager/ssl/nsCertTree.cpp index 9556de5f6d8..97c70fbfa5c 100644 --- a/security/manager/ssl/nsCertTree.cpp +++ b/security/manager/ssl/nsCertTree.cpp @@ -271,7 +271,7 @@ nsCertTree::GetCertAtIndex(int32_t index, int32_t *outAbsoluteCertOffset) } // If the row at index is a cert, return that cert. Otherwise, return null. -TemporaryRef +already_AddRefed nsCertTree::GetDispInfoAtIndex(int32_t index, int32_t *outAbsoluteCertOffset) { diff --git a/security/manager/ssl/nsCertTree.h b/security/manager/ssl/nsCertTree.h index 5bc206bee4d..cd22e426ea4 100644 --- a/security/manager/ssl/nsCertTree.h +++ b/security/manager/ssl/nsCertTree.h @@ -132,7 +132,7 @@ private: treeArrayEl *GetThreadDescAtIndex(int32_t _index); already_AddRefed GetCertAtIndex(int32_t _index, int32_t *outAbsoluteCertOffset = nullptr); - mozilla::TemporaryRef + already_AddRefed GetDispInfoAtIndex(int32_t index, int32_t *outAbsoluteCertOffset = nullptr); void FreeCertArray(); nsresult UpdateUIContents(); diff --git a/security/manager/ssl/nsNSSComponent.cpp b/security/manager/ssl/nsNSSComponent.cpp index 4625002a946..faaf02ce08a 100644 --- a/security/manager/ssl/nsNSSComponent.cpp +++ b/security/manager/ssl/nsNSSComponent.cpp @@ -1568,7 +1568,7 @@ nsNSSComponent::IsNSSInitialized(bool* initialized) SharedCertVerifier::~SharedCertVerifier() { } -TemporaryRef +already_AddRefed nsNSSComponent::GetDefaultCertVerifier() { MutexAutoLock lock(mutex); @@ -1579,7 +1579,7 @@ nsNSSComponent::GetDefaultCertVerifier() namespace mozilla { namespace psm { -TemporaryRef +already_AddRefed GetDefaultCertVerifier() { static NS_DEFINE_CID(kNSSComponentCID, NS_NSSCOMPONENT_CID); diff --git a/security/manager/ssl/nsNSSComponent.h b/security/manager/ssl/nsNSSComponent.h index fd58714248d..24e4b82df9a 100644 --- a/security/manager/ssl/nsNSSComponent.h +++ b/security/manager/ssl/nsNSSComponent.h @@ -29,7 +29,7 @@ class SmartCardThreadList; namespace mozilla { namespace psm { MOZ_WARN_UNUSED_RESULT - ::mozilla::TemporaryRef + ::already_AddRefed GetDefaultCertVerifier(); } } // namespace mozilla::psm @@ -95,7 +95,7 @@ class NS_NO_VTABLE nsINSSComponent : public nsISupports { NS_IMETHOD IsNSSInitialized(bool* initialized) = 0; - virtual ::mozilla::TemporaryRef + virtual ::already_AddRefed GetDefaultCertVerifier() = 0; }; @@ -152,7 +152,7 @@ public: NS_IMETHOD IsNSSInitialized(bool* initialized) override; - ::mozilla::TemporaryRef + ::already_AddRefed GetDefaultCertVerifier() override; // The following two methods are thread-safe. diff --git a/widget/cocoa/nsChildView.h b/widget/cocoa/nsChildView.h index 5a51b90cb38..e240c1c380c 100644 --- a/widget/cocoa/nsChildView.h +++ b/widget/cocoa/nsChildView.h @@ -536,7 +536,7 @@ public: return nsCocoaUtils::DevPixelsToCocoaPoints(aRect, BackingScaleFactor()); } - mozilla::TemporaryRef StartRemoteDrawing() override; + already_AddRefed StartRemoteDrawing() override; void EndRemoteDrawing() override; void CleanupRemoteDrawing() override; diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm index f2a740bd6ed..30f36f87c29 100644 --- a/widget/cocoa/nsChildView.mm +++ b/widget/cocoa/nsChildView.mm @@ -275,7 +275,7 @@ public: virtual ~RectTextureImage(); - TemporaryRef + already_AddRefed BeginUpdate(const nsIntSize& aNewSize, const nsIntRegion& aDirtyRegion = nsIntRegion()); void EndUpdate(bool aKeepSurface = false); @@ -2559,7 +2559,7 @@ nsChildView::EnsureVibrancyManager() return *mVibrancyManager; } -TemporaryRef +already_AddRefed nsChildView::StartRemoteDrawing() { if (!mGLPresenter) { @@ -2676,7 +2676,7 @@ RectTextureImage::TextureSizeForSize(const nsIntSize& aSize) gfx::NextPowerOfTwo(aSize.height)); } -TemporaryRef +already_AddRefed RectTextureImage::BeginUpdate(const nsIntSize& aNewSize, const nsIntRegion& aDirtyRegion) { diff --git a/widget/gonk/nativewindow/GonkBufferQueueJB.cpp b/widget/gonk/nativewindow/GonkBufferQueueJB.cpp index f70b537ed55..4fd47280273 100644 --- a/widget/gonk/nativewindow/GonkBufferQueueJB.cpp +++ b/widget/gonk/nativewindow/GonkBufferQueueJB.cpp @@ -126,7 +126,7 @@ status_t GonkBufferQueue::setTransformHint(uint32_t hint) { return NO_ERROR; } -TemporaryRef +already_AddRefed GonkBufferQueue::getTextureClientFromBuffer(ANativeWindowBuffer* buffer) { Mutex::Autolock _l(mMutex); diff --git a/widget/gonk/nativewindow/GonkBufferQueueJB.h b/widget/gonk/nativewindow/GonkBufferQueueJB.h index afce611402b..e3fa3d494be 100644 --- a/widget/gonk/nativewindow/GonkBufferQueueJB.h +++ b/widget/gonk/nativewindow/GonkBufferQueueJB.h @@ -385,7 +385,7 @@ public: // NATIVE_WINDOW_TRANSFORM_ROT_90. The default is 0 (no transform). status_t setTransformHint(uint32_t hint); - mozilla::TemporaryRef getTextureClientFromBuffer(ANativeWindowBuffer* buffer); + already_AddRefed getTextureClientFromBuffer(ANativeWindowBuffer* buffer); int getSlotFromTextureClientLocked(TextureClient* client) const; diff --git a/widget/gonk/nativewindow/GonkBufferQueueKK.cpp b/widget/gonk/nativewindow/GonkBufferQueueKK.cpp index 1d9a88e00d7..3bacbb76f91 100644 --- a/widget/gonk/nativewindow/GonkBufferQueueKK.cpp +++ b/widget/gonk/nativewindow/GonkBufferQueueKK.cpp @@ -118,7 +118,7 @@ status_t GonkBufferQueue::setTransformHint(uint32_t hint) { return NO_ERROR; } -TemporaryRef +already_AddRefed GonkBufferQueue::getTextureClientFromBuffer(ANativeWindowBuffer* buffer) { Mutex::Autolock _l(mMutex); diff --git a/widget/gonk/nativewindow/GonkBufferQueueKK.h b/widget/gonk/nativewindow/GonkBufferQueueKK.h index d40e439f3ab..cca3cb63dba 100644 --- a/widget/gonk/nativewindow/GonkBufferQueueKK.h +++ b/widget/gonk/nativewindow/GonkBufferQueueKK.h @@ -324,7 +324,7 @@ public: // dump our state in a String virtual void dumpToString(String8& result, const char* prefix) const; - mozilla::TemporaryRef getTextureClientFromBuffer(ANativeWindowBuffer* buffer); + already_AddRefed getTextureClientFromBuffer(ANativeWindowBuffer* buffer); int getSlotFromTextureClientLocked(TextureClient* client) const; diff --git a/widget/gonk/nativewindow/GonkBufferQueueLL/GonkBufferQueueConsumer.cpp b/widget/gonk/nativewindow/GonkBufferQueueLL/GonkBufferQueueConsumer.cpp index 8993c70b898..1f775795f01 100644 --- a/widget/gonk/nativewindow/GonkBufferQueueLL/GonkBufferQueueConsumer.cpp +++ b/widget/gonk/nativewindow/GonkBufferQueueLL/GonkBufferQueueConsumer.cpp @@ -520,7 +520,7 @@ void GonkBufferQueueConsumer::dumpToString(String8& result, const char* prefix) mCore->dump(result, prefix); } -TemporaryRef +already_AddRefed GonkBufferQueueConsumer::getTextureClientFromBuffer(ANativeWindowBuffer* buffer) { Mutex::Autolock _l(mCore->mMutex); diff --git a/widget/gonk/nativewindow/GonkBufferQueueLL/GonkBufferQueueConsumer.h b/widget/gonk/nativewindow/GonkBufferQueueLL/GonkBufferQueueConsumer.h index 111d284a974..a97cfab428c 100644 --- a/widget/gonk/nativewindow/GonkBufferQueueLL/GonkBufferQueueConsumer.h +++ b/widget/gonk/nativewindow/GonkBufferQueueLL/GonkBufferQueueConsumer.h @@ -140,7 +140,7 @@ public: virtual void dumpToString(String8& result, const char* prefix) const; // Added by mozilla - virtual mozilla::TemporaryRef getTextureClientFromBuffer(ANativeWindowBuffer* buffer); + virtual already_AddRefed getTextureClientFromBuffer(ANativeWindowBuffer* buffer); virtual int getSlotFromTextureClientLocked(GonkBufferSlot::TextureClient* client) const; diff --git a/widget/gonk/nativewindow/GonkNativeWindowICS.cpp b/widget/gonk/nativewindow/GonkNativeWindowICS.cpp index 324f72389e5..954bf7fe4b2 100644 --- a/widget/gonk/nativewindow/GonkNativeWindowICS.cpp +++ b/widget/gonk/nativewindow/GonkNativeWindowICS.cpp @@ -401,7 +401,7 @@ int GonkNativeWindow::getSlotFromTextureClientLocked( return BAD_VALUE; } -TemporaryRef +already_AddRefed GonkNativeWindow::getTextureClientFromBuffer(ANativeWindowBuffer* buffer) { int buf = getSlotFromBufferLocked(buffer); @@ -464,7 +464,7 @@ status_t GonkNativeWindow::queueBuffer(int buf, int64_t timestamp, } -TemporaryRef +already_AddRefed GonkNativeWindow::getCurrentBuffer() { CNW_LOGD("GonkNativeWindow::getCurrentBuffer"); Mutex::Autolock lock(mMutex); diff --git a/widget/gonk/nativewindow/GonkNativeWindowICS.h b/widget/gonk/nativewindow/GonkNativeWindowICS.h index eebbd4bb51c..f4ec9ef2ae5 100644 --- a/widget/gonk/nativewindow/GonkNativeWindowICS.h +++ b/widget/gonk/nativewindow/GonkNativeWindowICS.h @@ -62,7 +62,7 @@ public: // Get next frame from the queue and mark it as RENDERING, caller // owns the returned buffer. - mozilla::TemporaryRef getCurrentBuffer(); + already_AddRefed getCurrentBuffer(); // Return the buffer to the queue and mark it as FREE. After that // the buffer is useable again for the decoder. @@ -138,7 +138,7 @@ public: // then those buffer will remain allocated. void abandon(); - mozilla::TemporaryRef getTextureClientFromBuffer(ANativeWindowBuffer* buffer); + already_AddRefed getTextureClientFromBuffer(ANativeWindowBuffer* buffer); static void RecycleCallback(TextureClient* client, void* closure); diff --git a/widget/gonk/nativewindow/GonkNativeWindowJB.cpp b/widget/gonk/nativewindow/GonkNativeWindowJB.cpp index 20c119f372e..3065559dcbb 100644 --- a/widget/gonk/nativewindow/GonkNativeWindowJB.cpp +++ b/widget/gonk/nativewindow/GonkNativeWindowJB.cpp @@ -108,7 +108,7 @@ status_t GonkNativeWindow::setDefaultBufferFormat(uint32_t defaultFormat) { return mBufferQueue->setDefaultBufferFormat(defaultFormat); } -TemporaryRef +already_AddRefed GonkNativeWindow::getCurrentBuffer() { Mutex::Autolock _l(mMutex); GonkBufferQueue::BufferItem item; @@ -156,7 +156,7 @@ void GonkNativeWindow::returnBuffer(TextureClient* client) { releaseBufferLocked(index); } -TemporaryRef +already_AddRefed GonkNativeWindow::getTextureClientFromBuffer(ANativeWindowBuffer* buffer) { Mutex::Autolock lock(mMutex); return mBufferQueue->getTextureClientFromBuffer(buffer); diff --git a/widget/gonk/nativewindow/GonkNativeWindowJB.h b/widget/gonk/nativewindow/GonkNativeWindowJB.h index 3a4410162db..882b307f7cb 100644 --- a/widget/gonk/nativewindow/GonkNativeWindowJB.h +++ b/widget/gonk/nativewindow/GonkNativeWindowJB.h @@ -110,13 +110,13 @@ class GonkNativeWindow: public GonkConsumerBase status_t setDefaultBufferFormat(uint32_t defaultFormat); // Get next frame from the queue, caller owns the returned buffer. - mozilla::TemporaryRef getCurrentBuffer(); + already_AddRefed getCurrentBuffer(); // Return the buffer to the queue and mark it as FREE. After that // the buffer is useable again for the decoder. void returnBuffer(TextureClient* client); - mozilla::TemporaryRef getTextureClientFromBuffer(ANativeWindowBuffer* buffer); + already_AddRefed getTextureClientFromBuffer(ANativeWindowBuffer* buffer); void setNewFrameCallback(GonkNativeWindowNewFrameCallback* callback); diff --git a/widget/gonk/nativewindow/GonkNativeWindowKK.cpp b/widget/gonk/nativewindow/GonkNativeWindowKK.cpp index 7a98e0073cb..e1d0b307838 100644 --- a/widget/gonk/nativewindow/GonkNativeWindowKK.cpp +++ b/widget/gonk/nativewindow/GonkNativeWindowKK.cpp @@ -108,7 +108,7 @@ status_t GonkNativeWindow::setDefaultBufferFormat(uint32_t defaultFormat) { return mConsumer->setDefaultBufferFormat(defaultFormat); } -TemporaryRef +already_AddRefed GonkNativeWindow::getCurrentBuffer() { Mutex::Autolock _l(mMutex); BufferItem item; @@ -158,7 +158,7 @@ void GonkNativeWindow::returnBuffer(TextureClient* client) { releaseBufferLocked(index, mSlots[index].mGraphicBuffer); } -TemporaryRef +already_AddRefed GonkNativeWindow::getTextureClientFromBuffer(ANativeWindowBuffer* buffer) { Mutex::Autolock lock(mMutex); return mConsumer->getTextureClientFromBuffer(buffer); diff --git a/widget/gonk/nativewindow/GonkNativeWindowKK.h b/widget/gonk/nativewindow/GonkNativeWindowKK.h index f9f3dc475d0..13f93809f88 100644 --- a/widget/gonk/nativewindow/GonkNativeWindowKK.h +++ b/widget/gonk/nativewindow/GonkNativeWindowKK.h @@ -112,13 +112,13 @@ class GonkNativeWindow: public GonkConsumerBase status_t setDefaultBufferFormat(uint32_t defaultFormat); // Get next frame from the queue, caller owns the returned buffer. - mozilla::TemporaryRef getCurrentBuffer(); + already_AddRefed getCurrentBuffer(); // Return the buffer to the queue and mark it as FREE. After that // the buffer is useable again for the decoder. void returnBuffer(TextureClient* client); - mozilla::TemporaryRef getTextureClientFromBuffer(ANativeWindowBuffer* buffer); + already_AddRefed getTextureClientFromBuffer(ANativeWindowBuffer* buffer); void setNewFrameCallback(GonkNativeWindowNewFrameCallback* callback); diff --git a/widget/gonk/nativewindow/GonkNativeWindowLL.cpp b/widget/gonk/nativewindow/GonkNativeWindowLL.cpp index 49eed5b28ed..ea82a3a06ba 100644 --- a/widget/gonk/nativewindow/GonkNativeWindowLL.cpp +++ b/widget/gonk/nativewindow/GonkNativeWindowLL.cpp @@ -119,7 +119,7 @@ status_t GonkNativeWindow::setDefaultBufferFormat(uint32_t defaultFormat) { return mConsumer->setDefaultBufferFormat(defaultFormat); } -TemporaryRef +already_AddRefed GonkNativeWindow::getCurrentBuffer() { Mutex::Autolock _l(mMutex); BufferItem item; @@ -175,7 +175,7 @@ void GonkNativeWindow::returnBuffer(TextureClient* client) { } } -TemporaryRef +already_AddRefed GonkNativeWindow::getTextureClientFromBuffer(ANativeWindowBuffer* buffer) { Mutex::Autolock lock(mMutex); return mConsumer->getTextureClientFromBuffer(buffer); diff --git a/widget/gonk/nativewindow/GonkNativeWindowLL.h b/widget/gonk/nativewindow/GonkNativeWindowLL.h index 1a9b21074bc..64cd6482d3f 100644 --- a/widget/gonk/nativewindow/GonkNativeWindowLL.h +++ b/widget/gonk/nativewindow/GonkNativeWindowLL.h @@ -105,13 +105,13 @@ class GonkNativeWindow: public GonkConsumerBase status_t setDefaultBufferFormat(uint32_t defaultFormat); // Get next frame from the queue, caller owns the returned buffer. - mozilla::TemporaryRef getCurrentBuffer(); + already_AddRefed getCurrentBuffer(); // Return the buffer to the queue and mark it as FREE. After that // the buffer is useable again for the decoder. void returnBuffer(TextureClient* client); - mozilla::TemporaryRef getTextureClientFromBuffer(ANativeWindowBuffer* buffer); + already_AddRefed getTextureClientFromBuffer(ANativeWindowBuffer* buffer); void setNewFrameCallback(GonkNativeWindowNewFrameCallback* callback); diff --git a/widget/gonk/nativewindow/IGonkGraphicBufferConsumerLL.cpp b/widget/gonk/nativewindow/IGonkGraphicBufferConsumerLL.cpp index 16c697fe661..729ed67369f 100644 --- a/widget/gonk/nativewindow/IGonkGraphicBufferConsumerLL.cpp +++ b/widget/gonk/nativewindow/IGonkGraphicBufferConsumerLL.cpp @@ -415,7 +415,7 @@ public: } // Added by mozilla - virtual mozilla::TemporaryRef + virtual already_AddRefed getTextureClientFromBuffer(ANativeWindowBuffer* buffer) { return nullptr; diff --git a/widget/gonk/nativewindow/IGonkGraphicBufferConsumerLL.h b/widget/gonk/nativewindow/IGonkGraphicBufferConsumerLL.h index 92a500fed47..8a93a084971 100644 --- a/widget/gonk/nativewindow/IGonkGraphicBufferConsumerLL.h +++ b/widget/gonk/nativewindow/IGonkGraphicBufferConsumerLL.h @@ -311,7 +311,7 @@ public: virtual void dumpToString(String8& result, const char* prefix) const = 0; // Added by mozilla - virtual mozilla::TemporaryRef + virtual already_AddRefed getTextureClientFromBuffer(ANativeWindowBuffer* buffer) = 0; virtual int getSlotFromTextureClientLocked(mozilla::layers::TextureClient* client) const = 0; diff --git a/widget/gonk/nsWindow.cpp b/widget/gonk/nsWindow.cpp index d34d7572bdf..787243ccf33 100644 --- a/widget/gonk/nsWindow.cpp +++ b/widget/gonk/nsWindow.cpp @@ -646,7 +646,7 @@ HalFormatToSurfaceFormat(int aHalFormat, int* bytepp) } } -TemporaryRef +already_AddRefed nsWindow::StartRemoteDrawing() { GonkDisplay* display = GetGonkDisplay(); diff --git a/widget/gonk/nsWindow.h b/widget/gonk/nsWindow.h index 07983a03b60..7f6d527d1d6 100644 --- a/widget/gonk/nsWindow.h +++ b/widget/gonk/nsWindow.h @@ -102,7 +102,7 @@ public: NS_IMETHOD MakeFullScreen(bool aFullScreen, nsIScreen* aTargetScreen = nullptr) /*override*/; - virtual mozilla::TemporaryRef + virtual already_AddRefed StartRemoteDrawing() override; virtual void EndRemoteDrawing() override; diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp index 02a491ee346..da605ba28c2 100644 --- a/widget/gtk/nsWindow.cpp +++ b/widget/gtk/nsWindow.cpp @@ -6146,7 +6146,7 @@ nsWindow::GetSurfaceForGdkDrawable(GdkDrawable* aDrawable, } #endif -TemporaryRef +already_AddRefed nsWindow::StartRemoteDrawing() { gfxASurface *surf = GetThebesSurface(); diff --git a/widget/gtk/nsWindow.h b/widget/gtk/nsWindow.h index 8f89777e63b..ad7cf01b4de 100644 --- a/widget/gtk/nsWindow.h +++ b/widget/gtk/nsWindow.h @@ -194,7 +194,7 @@ public: guint aTime, gpointer aData); - virtual mozilla::TemporaryRef + virtual already_AddRefed StartRemoteDrawing() override; virtual void EndRemoteDrawingInRegion(mozilla::gfx::DrawTarget* aDrawTarget, nsIntRegion& aInvalidRegion) override; diff --git a/widget/nsBaseWidget.cpp b/widget/nsBaseWidget.cpp index 5b0d4fc87f4..842cc879593 100644 --- a/widget/nsBaseWidget.cpp +++ b/widget/nsBaseWidget.cpp @@ -1259,7 +1259,7 @@ CompositorChild* nsBaseWidget::GetRemoteRenderer() return mCompositorChild; } -TemporaryRef nsBaseWidget::StartRemoteDrawing() +already_AddRefed nsBaseWidget::StartRemoteDrawing() { return nullptr; } @@ -1943,7 +1943,7 @@ nsIWidget::UpdateRegisteredPluginWindowVisibility(uintptr_t aOwnerWidget, #endif } -TemporaryRef +already_AddRefed nsIWidget::SnapshotWidgetOnScreen() { // This is only supported on a widget with a compositor. diff --git a/widget/nsBaseWidget.h b/widget/nsBaseWidget.h index 656b43445fe..dfb4a184b70 100644 --- a/widget/nsBaseWidget.h +++ b/widget/nsBaseWidget.h @@ -161,7 +161,7 @@ public: virtual void PostRender(LayerManagerComposite* aManager) override {} virtual void DrawWindowUnderlay(LayerManagerComposite* aManager, nsIntRect aRect) override {} virtual void DrawWindowOverlay(LayerManagerComposite* aManager, nsIntRect aRect) override {} - virtual mozilla::TemporaryRef StartRemoteDrawing() override; + virtual already_AddRefed StartRemoteDrawing() override; virtual void EndRemoteDrawing() override { }; virtual void CleanupRemoteDrawing() override { }; virtual void UpdateThemeGeometries(const nsTArray& aThemeGeometries) override {} diff --git a/widget/nsIWidget.h b/widget/nsIWidget.h index 1e8355a2101..42b11539ad9 100644 --- a/widget/nsIWidget.h +++ b/widget/nsIWidget.h @@ -1703,7 +1703,7 @@ class nsIWidget : public nsISupports { * Called by BasicCompositor on the compositor thread for OMTC drawing * before each composition. */ - virtual mozilla::TemporaryRef StartRemoteDrawing() = 0; + virtual already_AddRefed StartRemoteDrawing() = 0; /** * Ensure that what was painted into the DrawTarget returned from @@ -2123,7 +2123,7 @@ class nsIWidget : public nsISupports { * * This is only supported for widgets using OMTC. */ - mozilla::TemporaryRef SnapshotWidgetOnScreen(); + already_AddRefed SnapshotWidgetOnScreen(); /* * Implementation of SnapshotWidgetOnScreen. This is invoked by the diff --git a/widget/qt/nsWindow.cpp b/widget/qt/nsWindow.cpp index 79faa263605..125904ba638 100644 --- a/widget/qt/nsWindow.cpp +++ b/widget/qt/nsWindow.cpp @@ -805,7 +805,7 @@ nsWindow::GetGLFrameBufferFormat() return LOCAL_GL_NONE; } -TemporaryRef +already_AddRefed nsWindow::StartRemoteDrawing() { if (!mWidget) { diff --git a/widget/qt/nsWindow.h b/widget/qt/nsWindow.h index d38ddd5a280..92320278bb0 100644 --- a/widget/qt/nsWindow.h +++ b/widget/qt/nsWindow.h @@ -142,7 +142,7 @@ public: virtual uint32_t GetGLFrameBufferFormat() override; - mozilla::TemporaryRef StartRemoteDrawing() override; + already_AddRefed StartRemoteDrawing() override; // Widget notifications virtual void OnPaint(); diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp index 044e7c798f4..6794fe79b21 100644 --- a/widget/windows/nsWindow.cpp +++ b/widget/windows/nsWindow.cpp @@ -3512,7 +3512,7 @@ nsWindow::OverrideSystemMouseScrollSpeed(double aOriginalDeltaX, return NS_OK; } -mozilla::TemporaryRef +already_AddRefed nsWindow::StartRemoteDrawing() { MOZ_ASSERT(!mCompositeDC); diff --git a/widget/windows/nsWindow.h b/widget/windows/nsWindow.h index e3a56ececd0..1ad650ffd5f 100644 --- a/widget/windows/nsWindow.h +++ b/widget/windows/nsWindow.h @@ -193,7 +193,7 @@ public: NS_IMETHOD GetNonClientMargins(nsIntMargin &margins); NS_IMETHOD SetNonClientMargins(nsIntMargin &margins); void SetDrawsInTitlebar(bool aState); - mozilla::TemporaryRef StartRemoteDrawing() override; + already_AddRefed StartRemoteDrawing() override; virtual void EndRemoteDrawing() override; virtual void UpdateWindowDraggingRegion(const nsIntRegion& aRegion) override;