зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1161627 - part 2 - machine-convert TemporaryRef<T> to already_AddRefed<T>; r=ehsan
This conversion was done with the script: find . -name '*.cpp' -o -name '*.h' -o -name '*.mm' -o -name '*.idl' | \ egrep -v 'cairo-win32-refptr.h|RefPtr.h|TestRefPtr.cpp' | \ xargs sed -i -e 's/mozilla::TemporaryRef</already_AddRefed</g' \ -e 's/TemporaryRef</already_AddRefed</g' Manual fixups were performed in the following instances: - We handled mfbt/RefPtr.h manually so as to not convert TemporaryRef itself into already_AddRefed. - The following files had explicit Move() calls added to make up for the lack of a copy constructor on already_AddRefed: dom/base/ImageEncoder.cpp dom/media/MediaTaskQueue.{h,cpp} dom/media/webaudio/PannerNode.cpp - A redundant overload for MediaTaskQueue::Dispatch was deleted. - A few manual fixups were required in mfbt/tests/TestRefPtr.cpp. - Comments, using declarations, and forward declarations relating to TemporaryRef in dom/canvas/ and gfx/layers/ were changed to refer to already_AddRefed.
This commit is contained in:
Родитель
e2ee7534b5
Коммит
974d8120f2
|
@ -22,7 +22,7 @@ namespace dom {
|
|||
// template parameter, we need to move this class outside.
|
||||
class SurfaceHelper : public nsRunnable {
|
||||
public:
|
||||
explicit SurfaceHelper(TemporaryRef<layers::Image> aImage) : mImage(aImage) {}
|
||||
explicit SurfaceHelper(already_AddRefed<layers::Image> 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<gfx::DataSourceSurface> GetDataSurfaceSafe() {
|
||||
already_AddRefed<gfx::DataSourceSurface> GetDataSurfaceSafe() {
|
||||
nsCOMPtr<nsIThread> 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<DataSourceSurface>
|
||||
GetBRGADataSourceSurfaceSync(TemporaryRef<layers::Image> aImage)
|
||||
already_AddRefed<DataSourceSurface>
|
||||
GetBRGADataSourceSurfaceSync(already_AddRefed<layers::Image> aImage)
|
||||
{
|
||||
nsRefPtr<SurfaceHelper> helper = new SurfaceHelper(aImage);
|
||||
nsRefPtr<SurfaceHelper> helper = new SurfaceHelper(Move(aImage));
|
||||
return helper->GetDataSurfaceSafe();
|
||||
}
|
||||
|
||||
|
|
|
@ -1478,7 +1478,7 @@ nsDOMWindowUtils::GetTranslationNodes(nsIDOMNode* aRoot,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
static TemporaryRef<DataSourceSurface>
|
||||
static already_AddRefed<DataSourceSurface>
|
||||
CanvasToDataSourceSurface(nsIDOMHTMLCanvasElement* aCanvas)
|
||||
{
|
||||
nsCOMPtr<nsINode> node = do_QueryInterface(aCanvas);
|
||||
|
|
|
@ -57,14 +57,14 @@ public:
|
|||
const gfx::Point& aCP2,
|
||||
const gfx::Point& aCP3);
|
||||
|
||||
TemporaryRef<gfx::Path> GetPath(const CanvasWindingRule& aWinding,
|
||||
already_AddRefed<gfx::Path> 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<gfx::PathBuilder> aPathBuilder);
|
||||
already_AddRefed<gfx::PathBuilder> aPathBuilder);
|
||||
|
||||
void AddPath(CanvasPath& aCanvasPath,
|
||||
const Optional<NonNull<SVGMatrix>>& aMatrix);
|
||||
|
|
|
@ -342,7 +342,7 @@ public:
|
|||
}
|
||||
|
||||
// Return a SourceSurface that contains the FillPaint or StrokePaint source.
|
||||
TemporaryRef<SourceSurface>
|
||||
already_AddRefed<SourceSurface>
|
||||
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<SourceSurface>
|
||||
static already_AddRefed<SourceSurface>
|
||||
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<PathBuilder> aPathBuilder)
|
||||
CanvasPath::CanvasPath(nsISupports* aParent, already_AddRefed<PathBuilder> aPathBuilder)
|
||||
: mParent(aParent), mPathBuilder(aPathBuilder)
|
||||
{
|
||||
if (!mPathBuilder) {
|
||||
|
@ -5766,7 +5766,7 @@ CanvasPath::AddPath(CanvasPath& aCanvasPath, const Optional<NonNull<SVGMatrix>>&
|
|||
tempPath->StreamToSink(mPathBuilder);
|
||||
}
|
||||
|
||||
TemporaryRef<gfx::Path>
|
||||
already_AddRefed<gfx::Path>
|
||||
CanvasPath::GetPath(const CanvasWindingRule& winding, const DrawTarget* aTarget) const
|
||||
{
|
||||
FillRule fillRule = FillRule::FILL_WINDING;
|
||||
|
|
|
@ -445,7 +445,7 @@ public:
|
|||
const char16_t* aEncoderOptions,
|
||||
nsIInputStream **aStream) override;
|
||||
|
||||
mozilla::TemporaryRef<mozilla::gfx::SourceSurface> GetSurfaceSnapshot(bool* aPremultAlpha = nullptr) override
|
||||
already_AddRefed<mozilla::gfx::SourceSurface> GetSurfaceSnapshot(bool* aPremultAlpha = nullptr) override
|
||||
{
|
||||
EnsureTarget();
|
||||
if (aPremultAlpha) {
|
||||
|
|
|
@ -1752,7 +1752,7 @@ WebGLContext::MakeContextCurrent() const
|
|||
gl->MakeCurrent();
|
||||
}
|
||||
|
||||
mozilla::TemporaryRef<mozilla::gfx::SourceSurface>
|
||||
already_AddRefed<mozilla::gfx::SourceSurface>
|
||||
WebGLContext::GetSurfaceSnapshot(bool* out_premultAlpha)
|
||||
{
|
||||
if (!gl)
|
||||
|
|
|
@ -234,7 +234,7 @@ public:
|
|||
const char16_t* encoderOptions,
|
||||
nsIInputStream** out_stream) override;
|
||||
|
||||
mozilla::TemporaryRef<mozilla::gfx::SourceSurface>
|
||||
already_AddRefed<mozilla::gfx::SourceSurface>
|
||||
GetSurfaceSnapshot(bool* out_premultAlpha) override;
|
||||
|
||||
NS_IMETHOD SetIsOpaque(bool) override { return NS_OK; };
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ AddActiveBlockInfo(const nsACString& baseUserName,
|
|||
|
||||
//#define DUMP_SHADERVAR_MAPPINGS
|
||||
|
||||
static TemporaryRef<const webgl::LinkedProgramInfo>
|
||||
static already_AddRefed<const webgl::LinkedProgramInfo>
|
||||
QueryProgramInfo(WebGLProgram* prog, gl::GLContext* gl)
|
||||
{
|
||||
RefPtr<webgl::LinkedProgramInfo> info(new webgl::LinkedProgramInfo(prog));
|
||||
|
|
|
@ -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<mozilla::gfx::SourceSurface> GetSurfaceSnapshot(bool* aPremultAlpha = nullptr) = 0;
|
||||
virtual already_AddRefed<mozilla::gfx::SourceSurface> 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
|
||||
|
|
|
@ -1034,7 +1034,7 @@ HTMLCanvasElement::MarkContextClean()
|
|||
mCurrentContext->MarkContextClean();
|
||||
}
|
||||
|
||||
TemporaryRef<SourceSurface>
|
||||
already_AddRefed<SourceSurface>
|
||||
HTMLCanvasElement::GetSurfaceSnapshot(bool* aPremultAlpha)
|
||||
{
|
||||
if (!mCurrentContext)
|
||||
|
|
|
@ -168,7 +168,7 @@ public:
|
|||
*/
|
||||
bool GetIsOpaque();
|
||||
|
||||
virtual TemporaryRef<gfx::SourceSurface> GetSurfaceSnapshot(bool* aPremultAlpha = nullptr);
|
||||
virtual already_AddRefed<gfx::SourceSurface> GetSurfaceSnapshot(bool* aPremultAlpha = nullptr);
|
||||
|
||||
virtual bool ParseAttribute(int32_t aNamespaceID,
|
||||
nsIAtom* aAttribute,
|
||||
|
|
|
@ -2135,7 +2135,7 @@ MediaManager::Observe(nsISupports* aSubject, const char* aTopic,
|
|||
class ShutdownTask : public Task
|
||||
{
|
||||
public:
|
||||
ShutdownTask(TemporaryRef<MediaEngine> aBackend,
|
||||
ShutdownTask(already_AddRefed<MediaEngine> aBackend,
|
||||
nsRunnable* aReply)
|
||||
: mReply(aReply)
|
||||
, mBackend(aBackend) {}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
namespace mozilla {
|
||||
|
||||
MediaTaskQueue::MediaTaskQueue(TemporaryRef<SharedThreadPool> aPool,
|
||||
MediaTaskQueue::MediaTaskQueue(already_AddRefed<SharedThreadPool> aPool,
|
||||
bool aRequireTailDispatch)
|
||||
: AbstractThread(aRequireTailDispatch)
|
||||
, mPool(aPool)
|
||||
|
@ -74,7 +74,7 @@ MediaTaskQueue::DispatchLocked(already_AddRefed<nsIRunnable> aRunnable,
|
|||
|
||||
class MediaTaskQueueSyncRunnable : public nsRunnable {
|
||||
public:
|
||||
explicit MediaTaskQueueSyncRunnable(TemporaryRef<nsIRunnable> aRunnable)
|
||||
explicit MediaTaskQueueSyncRunnable(already_AddRefed<nsIRunnable> aRunnable)
|
||||
: mRunnable(aRunnable)
|
||||
, mMonitor("MediaTaskQueueSyncRunnable")
|
||||
, mDone(false)
|
||||
|
@ -104,9 +104,9 @@ private:
|
|||
};
|
||||
|
||||
void
|
||||
MediaTaskQueue::SyncDispatch(TemporaryRef<nsIRunnable> aRunnable) {
|
||||
MediaTaskQueue::SyncDispatch(already_AddRefed<nsIRunnable> aRunnable) {
|
||||
NS_WARNING("MediaTaskQueue::SyncDispatch is dangerous and deprecated. Stop using this!");
|
||||
nsRefPtr<MediaTaskQueueSyncRunnable> task(new MediaTaskQueueSyncRunnable(aRunnable));
|
||||
nsRefPtr<MediaTaskQueueSyncRunnable> 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<nsIRunnable> aRunnable)
|
||||
FlushableMediaTaskQueue::FlushAndDispatch(already_AddRefed<nsIRunnable> aRunnable)
|
||||
{
|
||||
MonitorAutoLock mon(mQueueMonitor);
|
||||
AutoSetFlushing autoFlush(this);
|
||||
|
|
|
@ -31,14 +31,7 @@ typedef MediaPromise<bool, bool, false> ShutdownPromise;
|
|||
// to make this threadsafe for objects that aren't already threadsafe.
|
||||
class MediaTaskQueue : public AbstractThread {
|
||||
public:
|
||||
explicit MediaTaskQueue(TemporaryRef<SharedThreadPool> aPool, bool aSupportsTailDispatch = false);
|
||||
|
||||
void Dispatch(TemporaryRef<nsIRunnable> aRunnable,
|
||||
DispatchFailureHandling aFailureHandling = AssertDispatchSuccess)
|
||||
{
|
||||
nsCOMPtr<nsIRunnable> r = dont_AddRef(aRunnable.take());
|
||||
return Dispatch(r.forget(), aFailureHandling);
|
||||
}
|
||||
explicit MediaTaskQueue(already_AddRefed<SharedThreadPool> 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<nsIRunnable> aRunnable);
|
||||
void SyncDispatch(already_AddRefed<nsIRunnable> 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<SharedThreadPool> aPool) : MediaTaskQueue(aPool) {}
|
||||
nsresult FlushAndDispatch(TemporaryRef<nsIRunnable> aRunnable);
|
||||
explicit FlushableMediaTaskQueue(already_AddRefed<SharedThreadPool> aPool) : MediaTaskQueue(Move(aPool)) {}
|
||||
nsresult FlushAndDispatch(already_AddRefed<nsIRunnable> aRunnable);
|
||||
void Flush();
|
||||
|
||||
bool IsDispatchReliable() override { return false; }
|
||||
|
|
|
@ -58,7 +58,7 @@ SharedThreadPool::SpinUntilEmpty()
|
|||
}
|
||||
}
|
||||
|
||||
TemporaryRef<SharedThreadPool>
|
||||
already_AddRefed<SharedThreadPool>
|
||||
SharedThreadPool::Get(const nsCString& aName, uint32_t aThreadLimit)
|
||||
{
|
||||
MOZ_ASSERT(sMonitor && sPools);
|
||||
|
|
|
@ -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<SharedThreadPool> Get(const nsCString& aName,
|
||||
static already_AddRefed<SharedThreadPool> Get(const nsCString& aName,
|
||||
uint32_t aThreadLimit = 4);
|
||||
|
||||
// We implement custom threadsafe AddRef/Release pair, that destroys the
|
||||
|
|
|
@ -201,7 +201,7 @@ IsValidVideoRegion(const nsIntSize& aFrame, const nsIntRect& aPicture,
|
|||
aDisplay.width * aDisplay.height != 0;
|
||||
}
|
||||
|
||||
TemporaryRef<SharedThreadPool> GetMediaThreadPool(MediaThreadType aType)
|
||||
already_AddRefed<SharedThreadPool> GetMediaThreadPool(MediaThreadType aType)
|
||||
{
|
||||
const char *name;
|
||||
switch (aType) {
|
||||
|
|
|
@ -221,7 +221,7 @@ enum class MediaThreadType {
|
|||
};
|
||||
// Returns the thread pool that is shared amongst all decoder state machines
|
||||
// for decoding streams.
|
||||
TemporaryRef<SharedThreadPool> GetMediaThreadPool(MediaThreadType aType);
|
||||
already_AddRefed<SharedThreadPool> GetMediaThreadPool(MediaThreadType aType);
|
||||
|
||||
enum H264_PROFILE {
|
||||
H264_PROFILE_UNKNOWN = 0,
|
||||
|
|
|
@ -131,7 +131,7 @@ AudioSinkInputPin::Receive(IMediaSample* aSample )
|
|||
return S_OK;
|
||||
}
|
||||
|
||||
TemporaryRef<IMediaSeeking>
|
||||
already_AddRefed<IMediaSeeking>
|
||||
AudioSinkInputPin::GetConnectedPinSeeking()
|
||||
{
|
||||
RefPtr<IPin> peer = GetConnected();
|
||||
|
|
|
@ -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<IMediaSeeking> GetConnectedPinSeeking();
|
||||
already_AddRefed<IMediaSeeking> GetConnectedPinSeeking();
|
||||
|
||||
SampleSink* GetSampleSink();
|
||||
|
||||
|
|
|
@ -284,7 +284,7 @@ MatchUnconnectedPin(IPin* aPin,
|
|||
}
|
||||
|
||||
// Return the first unconnected input pin or output pin.
|
||||
TemporaryRef<IPin>
|
||||
already_AddRefed<IPin>
|
||||
GetUnconnectedPin(IBaseFilter* aFilter, PIN_DIRECTION aPinDir)
|
||||
{
|
||||
RefPtr<IEnumPins> enumPins;
|
||||
|
|
|
@ -68,7 +68,7 @@ MFTDecoder::SetMediaTypes(IMFMediaType* aInputType,
|
|||
return S_OK;
|
||||
}
|
||||
|
||||
TemporaryRef<IMFAttributes>
|
||||
already_AddRefed<IMFAttributes>
|
||||
MFTDecoder::GetAttributes()
|
||||
{
|
||||
RefPtr<IMFAttributes> attr;
|
||||
|
|
|
@ -43,7 +43,7 @@ public:
|
|||
void* aData = nullptr);
|
||||
|
||||
// Returns the MFT's IMFAttributes object.
|
||||
TemporaryRef<IMFAttributes> GetAttributes();
|
||||
already_AddRefed<IMFAttributes> GetAttributes();
|
||||
|
||||
// Retrieves the media type being output. This may not be valid until
|
||||
// the first sample is decoded.
|
||||
|
|
|
@ -113,7 +113,7 @@ WMFAudioMFTManager::GetMediaSubtypeGUID()
|
|||
};
|
||||
}
|
||||
|
||||
TemporaryRef<MFTDecoder>
|
||||
already_AddRefed<MFTDecoder>
|
||||
WMFAudioMFTManager::Init()
|
||||
{
|
||||
NS_ENSURE_TRUE(mStreamType != Unknown, nullptr);
|
||||
|
|
|
@ -20,7 +20,7 @@ public:
|
|||
WMFAudioMFTManager(const AudioInfo& aConfig);
|
||||
~WMFAudioMFTManager();
|
||||
|
||||
virtual TemporaryRef<MFTDecoder> Init() override;
|
||||
virtual already_AddRefed<MFTDecoder> Init() override;
|
||||
|
||||
virtual HRESULT Input(MediaRawData* aSample) override;
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ public:
|
|||
|
||||
// Creates an initializs the MFTDecoder.
|
||||
// Returns nullptr on failure.
|
||||
virtual TemporaryRef<MFTDecoder> Init() = 0;
|
||||
virtual already_AddRefed<MFTDecoder> Init() = 0;
|
||||
|
||||
// Submit a compressed sample for decoding.
|
||||
// This should forward to the MFTDecoder after performing
|
||||
|
|
|
@ -172,7 +172,7 @@ WMFVideoMFTManager::InitializeDXVA(bool aForceD3D9)
|
|||
return mDXVA2Manager != nullptr;
|
||||
}
|
||||
|
||||
TemporaryRef<MFTDecoder>
|
||||
already_AddRefed<MFTDecoder>
|
||||
WMFVideoMFTManager::Init()
|
||||
{
|
||||
RefPtr<MFTDecoder> decoder = InitInternal(/* aForceD3D9 = */ false);
|
||||
|
@ -187,7 +187,7 @@ WMFVideoMFTManager::Init()
|
|||
return decoder.forget();
|
||||
}
|
||||
|
||||
TemporaryRef<MFTDecoder>
|
||||
already_AddRefed<MFTDecoder>
|
||||
WMFVideoMFTManager::InitInternal(bool aForceD3D9)
|
||||
{
|
||||
mUseHwAccel = false; // default value; changed if D3D setup succeeds.
|
||||
|
|
|
@ -26,7 +26,7 @@ public:
|
|||
bool aDXVAEnabled);
|
||||
~WMFVideoMFTManager();
|
||||
|
||||
virtual TemporaryRef<MFTDecoder> Init() override;
|
||||
virtual already_AddRefed<MFTDecoder> Init() override;
|
||||
|
||||
virtual HRESULT Input(MediaRawData* aSample) override;
|
||||
|
||||
|
@ -41,7 +41,7 @@ private:
|
|||
|
||||
bool InitializeDXVA(bool aForceD3D9);
|
||||
|
||||
TemporaryRef<MFTDecoder> InitInternal(bool aForceD3D9);
|
||||
already_AddRefed<MFTDecoder> InitInternal(bool aForceD3D9);
|
||||
|
||||
HRESULT ConfigureVideoFrameGeometry();
|
||||
|
||||
|
|
|
@ -63,9 +63,9 @@ public:
|
|||
, mLeftOverData(INT_MIN)
|
||||
{
|
||||
// HRTFDatabaseLoader needs to be fetched on the main thread.
|
||||
TemporaryRef<HRTFDatabaseLoader> loader =
|
||||
already_AddRefed<HRTFDatabaseLoader> 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
|
||||
|
|
|
@ -42,7 +42,7 @@ size_t HRTFDatabaseLoader::sizeOfLoaders(mozilla::MallocSizeOf aMallocSizeOf)
|
|||
return s_loaderMap ? s_loaderMap->SizeOfIncludingThis(aMallocSizeOf) : 0;
|
||||
}
|
||||
|
||||
TemporaryRef<HRTFDatabaseLoader> HRTFDatabaseLoader::createAndLoadAsynchronouslyIfNecessary(float sampleRate)
|
||||
already_AddRefed<HRTFDatabaseLoader> HRTFDatabaseLoader::createAndLoadAsynchronouslyIfNecessary(float sampleRate)
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
|
|
|
@ -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<HRTFDatabaseLoader> createAndLoadAsynchronouslyIfNecessary(float sampleRate);
|
||||
static already_AddRefed<HRTFDatabaseLoader> createAndLoadAsynchronouslyIfNecessary(float sampleRate);
|
||||
|
||||
// AddRef and Release may be called from any thread.
|
||||
void AddRef()
|
||||
|
|
|
@ -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<HRTFDatabaseLoader> databaseLoader)
|
||||
HRTFPanner::HRTFPanner(float sampleRate, already_AddRefed<HRTFDatabaseLoader> databaseLoader)
|
||||
: m_databaseLoader(databaseLoader)
|
||||
, m_sampleRate(sampleRate)
|
||||
, m_crossfadeSelection(CrossfadeSelection1)
|
||||
|
|
|
@ -43,7 +43,7 @@ using mozilla::AudioChunk;
|
|||
|
||||
class HRTFPanner {
|
||||
public:
|
||||
HRTFPanner(float sampleRate, mozilla::TemporaryRef<HRTFDatabaseLoader> databaseLoader);
|
||||
HRTFPanner(float sampleRate, already_AddRefed<HRTFDatabaseLoader> databaseLoader);
|
||||
~HRTFPanner();
|
||||
|
||||
// chunk durations must be 128
|
||||
|
|
|
@ -955,7 +955,7 @@ void nsNPAPIPluginInstance::ReleaseContentTexture(nsNPAPIPluginInstance::Texture
|
|||
mContentTexture->Release(aTextureInfo);
|
||||
}
|
||||
|
||||
TemporaryRef<AndroidSurfaceTexture> nsNPAPIPluginInstance::CreateSurfaceTexture()
|
||||
already_AddRefed<AndroidSurfaceTexture> nsNPAPIPluginInstance::CreateSurfaceTexture()
|
||||
{
|
||||
if (!EnsureGLContext())
|
||||
return nullptr;
|
||||
|
|
|
@ -386,7 +386,7 @@ private:
|
|||
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
void EnsureSharedTexture();
|
||||
mozilla::TemporaryRef<mozilla::gl::AndroidSurfaceTexture> CreateSurfaceTexture();
|
||||
already_AddRefed<mozilla::gl::AndroidSurfaceTexture> CreateSurfaceTexture();
|
||||
|
||||
std::map<void*, VideoInfo*> mVideos;
|
||||
bool mOnScreen;
|
||||
|
|
|
@ -109,7 +109,7 @@ SVGCircleElement::GetGeometryBounds(
|
|||
return false;
|
||||
}
|
||||
|
||||
TemporaryRef<Path>
|
||||
already_AddRefed<Path>
|
||||
SVGCircleElement::BuildPath(PathBuilder* aBuilder)
|
||||
{
|
||||
float x, y, r;
|
||||
|
|
|
@ -33,7 +33,7 @@ public:
|
|||
// nsSVGPathGeometryElement methods:
|
||||
virtual bool GetGeometryBounds(Rect* aBounds, const StrokeOptions& aStrokeOptions,
|
||||
const Matrix& aTransform) override;
|
||||
virtual TemporaryRef<Path> BuildPath(PathBuilder* aBuilder) override;
|
||||
virtual already_AddRefed<Path> BuildPath(PathBuilder* aBuilder) override;
|
||||
|
||||
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override;
|
||||
|
||||
|
|
|
@ -797,7 +797,7 @@ SVGContentUtils::CoordToFloat(nsSVGElement *aContent,
|
|||
}
|
||||
}
|
||||
|
||||
TemporaryRef<gfx::Path>
|
||||
already_AddRefed<gfx::Path>
|
||||
SVGContentUtils::GetPath(const nsAString& aPathString)
|
||||
{
|
||||
SVGPathData pathData;
|
||||
|
|
|
@ -321,7 +321,7 @@ public:
|
|||
* Returns a path
|
||||
* string formatted as an SVG path
|
||||
*/
|
||||
static mozilla::TemporaryRef<mozilla::gfx::Path>
|
||||
static already_AddRefed<mozilla::gfx::Path>
|
||||
GetPath(const nsAString& aPathString);
|
||||
|
||||
/**
|
||||
|
|
|
@ -121,7 +121,7 @@ SVGEllipseElement::GetGeometryBounds(
|
|||
return false;
|
||||
}
|
||||
|
||||
TemporaryRef<Path>
|
||||
already_AddRefed<Path>
|
||||
SVGEllipseElement::BuildPath(PathBuilder* aBuilder)
|
||||
{
|
||||
float x, y, rx, ry;
|
||||
|
|
|
@ -33,7 +33,7 @@ public:
|
|||
// nsSVGPathGeometryElement methods:
|
||||
virtual bool GetGeometryBounds(Rect* aBounds, const StrokeOptions& aStrokeOptions,
|
||||
const Matrix& aTransform) override;
|
||||
virtual TemporaryRef<Path> BuildPath(PathBuilder* aBuilder) override;
|
||||
virtual already_AddRefed<Path> BuildPath(PathBuilder* aBuilder) override;
|
||||
|
||||
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override;
|
||||
|
||||
|
|
|
@ -242,7 +242,7 @@ SVGImageElement::GetGeometryBounds(
|
|||
return true;
|
||||
}
|
||||
|
||||
TemporaryRef<Path>
|
||||
already_AddRefed<Path>
|
||||
SVGImageElement::BuildPath(PathBuilder* aBuilder)
|
||||
{
|
||||
// We get called in order to get bounds for this element, and for
|
||||
|
|
|
@ -56,7 +56,7 @@ public:
|
|||
// nsSVGPathGeometryElement methods:
|
||||
virtual bool GetGeometryBounds(Rect* aBounds, const StrokeOptions& aStrokeOptions,
|
||||
const Matrix& aTransform) override;
|
||||
virtual TemporaryRef<Path> BuildPath(PathBuilder* aBuilder) override;
|
||||
virtual already_AddRefed<Path> BuildPath(PathBuilder* aBuilder) override;
|
||||
|
||||
// nsSVGSVGElement methods:
|
||||
virtual bool HasValidDimensions() const override;
|
||||
|
|
|
@ -115,7 +115,7 @@ SVGLineElement::GetAsSimplePath(SimplePath* aSimplePath)
|
|||
aSimplePath->SetLine(x1, y1, x2, y2);
|
||||
}
|
||||
|
||||
TemporaryRef<Path>
|
||||
already_AddRefed<Path>
|
||||
SVGLineElement::BuildPath(PathBuilder* aBuilder)
|
||||
{
|
||||
float x1, y1, x2, y2;
|
||||
|
|
|
@ -34,7 +34,7 @@ public:
|
|||
virtual bool IsMarkable() override { return true; }
|
||||
virtual void GetMarkPoints(nsTArray<nsSVGMark> *aMarks) override;
|
||||
virtual void GetAsSimplePath(SimplePath* aSimplePath) override;
|
||||
virtual TemporaryRef<Path> BuildPath(PathBuilder* aBuilder) override;
|
||||
virtual already_AddRefed<Path> BuildPath(PathBuilder* aBuilder) override;
|
||||
virtual bool GetGeometryBounds(Rect* aBounds, const StrokeOptions& aStrokeOptions,
|
||||
const Matrix& aTransform) override;
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ SVGMotionSMILPathUtils::PathGenerator::
|
|||
return true;
|
||||
}
|
||||
|
||||
TemporaryRef<Path>
|
||||
already_AddRefed<Path>
|
||||
SVGMotionSMILPathUtils::PathGenerator::GetResultingPath()
|
||||
{
|
||||
return mPathBuilder->Finish();
|
||||
|
|
|
@ -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<Path> GetResultingPath();
|
||||
already_AddRefed<Path> GetResultingPath();
|
||||
|
||||
protected:
|
||||
// Helper methods
|
||||
|
|
|
@ -273,7 +273,7 @@ ApproximateZeroLengthSubpathSquareCaps(PathBuilder* aPB,
|
|||
} \
|
||||
} while(0)
|
||||
|
||||
TemporaryRef<Path>
|
||||
already_AddRefed<Path>
|
||||
SVGPathData::BuildPath(PathBuilder* builder,
|
||||
uint8_t aStrokeLineCap,
|
||||
Float aStrokeWidth) const
|
||||
|
@ -507,7 +507,7 @@ SVGPathData::BuildPath(PathBuilder* builder,
|
|||
return builder->Finish();
|
||||
}
|
||||
|
||||
TemporaryRef<Path>
|
||||
already_AddRefed<Path>
|
||||
SVGPathData::BuildPathForMeasuring() const
|
||||
{
|
||||
// Since the path that we return will not be used for painting it doesn't
|
||||
|
|
|
@ -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<Path> BuildPathForMeasuring() const;
|
||||
already_AddRefed<Path> BuildPathForMeasuring() const;
|
||||
|
||||
TemporaryRef<Path> BuildPath(PathBuilder* aBuilder,
|
||||
already_AddRefed<Path> BuildPath(PathBuilder* aBuilder,
|
||||
uint8_t aCapStyle,
|
||||
Float aStrokeWidth) const;
|
||||
|
||||
|
|
|
@ -305,7 +305,7 @@ SVGPathElement::IsAttributeMapped(const nsIAtom* name) const
|
|||
SVGPathElementBase::IsAttributeMapped(name);
|
||||
}
|
||||
|
||||
TemporaryRef<Path>
|
||||
already_AddRefed<Path>
|
||||
SVGPathElement::GetOrBuildPathForMeasuring()
|
||||
{
|
||||
return mD.GetAnimValue().BuildPathForMeasuring();
|
||||
|
@ -364,7 +364,7 @@ SVGPathElement::GetPathLengthScale(PathLengthScaleForType aFor)
|
|||
return 1.0;
|
||||
}
|
||||
|
||||
TemporaryRef<Path>
|
||||
already_AddRefed<Path>
|
||||
SVGPathElement::BuildPath(PathBuilder* aBuilder)
|
||||
{
|
||||
// The Moz2D PathBuilder that our SVGPathData will be using only cares about
|
||||
|
|
|
@ -51,14 +51,14 @@ public:
|
|||
virtual bool AttributeDefinesGeometry(const nsIAtom *aName) override;
|
||||
virtual bool IsMarkable() override;
|
||||
virtual void GetMarkPoints(nsTArray<nsSVGMark> *aMarks) override;
|
||||
virtual TemporaryRef<Path> BuildPath(PathBuilder* aBuilder) override;
|
||||
virtual already_AddRefed<Path> 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<Path> GetOrBuildPathForMeasuring() override;
|
||||
virtual already_AddRefed<Path> GetOrBuildPathForMeasuring() override;
|
||||
|
||||
// nsIContent interface
|
||||
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override;
|
||||
|
|
|
@ -62,7 +62,7 @@ SVGPolygonElement::GetMarkPoints(nsTArray<nsSVGMark> *aMarks)
|
|||
nsSVGMark::eEnd));
|
||||
}
|
||||
|
||||
TemporaryRef<Path>
|
||||
already_AddRefed<Path>
|
||||
SVGPolygonElement::BuildPath(PathBuilder* aBuilder)
|
||||
{
|
||||
const SVGPointList &points = mPoints.GetAnimValue();
|
||||
|
|
|
@ -29,7 +29,7 @@ protected:
|
|||
public:
|
||||
// nsSVGPathGeometryElement methods:
|
||||
virtual void GetMarkPoints(nsTArray<nsSVGMark> *aMarks) override;
|
||||
virtual mozilla::TemporaryRef<Path> BuildPath(PathBuilder* aBuilder) override;
|
||||
virtual already_AddRefed<Path> BuildPath(PathBuilder* aBuilder) override;
|
||||
|
||||
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override;
|
||||
};
|
||||
|
|
|
@ -38,7 +38,7 @@ NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGPolylineElement)
|
|||
//----------------------------------------------------------------------
|
||||
// nsSVGPathGeometryElement methods
|
||||
|
||||
TemporaryRef<Path>
|
||||
already_AddRefed<Path>
|
||||
SVGPolylineElement::BuildPath(PathBuilder* aBuilder)
|
||||
{
|
||||
const SVGPointList &points = mPoints.GetAnimValue();
|
||||
|
|
|
@ -26,7 +26,7 @@ protected:
|
|||
already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
|
||||
|
||||
// nsSVGPathGeometryElement methods:
|
||||
virtual mozilla::TemporaryRef<Path> BuildPath(PathBuilder* aBuilder) override;
|
||||
virtual already_AddRefed<Path> BuildPath(PathBuilder* aBuilder) override;
|
||||
|
||||
public:
|
||||
// nsIContent interface
|
||||
|
|
|
@ -168,7 +168,7 @@ SVGRectElement::GetAsSimplePath(SimplePath* aSimplePath)
|
|||
aSimplePath->SetRect(x, y, width, height);
|
||||
}
|
||||
|
||||
TemporaryRef<Path>
|
||||
already_AddRefed<Path>
|
||||
SVGRectElement::BuildPath(PathBuilder* aBuilder)
|
||||
{
|
||||
float x, y, width, height, rx, ry;
|
||||
|
|
|
@ -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<Path> BuildPath(PathBuilder* aBuilder = nullptr) override;
|
||||
virtual already_AddRefed<Path> BuildPath(PathBuilder* aBuilder = nullptr) override;
|
||||
|
||||
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override;
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ nsSVGPathGeometryElement::GetMarkPoints(nsTArray<nsSVGMark> *aMarks)
|
|||
{
|
||||
}
|
||||
|
||||
TemporaryRef<Path>
|
||||
already_AddRefed<Path>
|
||||
nsSVGPathGeometryElement::GetOrBuildPath(const DrawTarget& aDrawTarget,
|
||||
FillRule aFillRule)
|
||||
{
|
||||
|
@ -101,7 +101,7 @@ nsSVGPathGeometryElement::GetOrBuildPath(const DrawTarget& aDrawTarget,
|
|||
return path.forget();
|
||||
}
|
||||
|
||||
TemporaryRef<Path>
|
||||
already_AddRefed<Path>
|
||||
nsSVGPathGeometryElement::GetOrBuildPathForMeasuring()
|
||||
{
|
||||
return nullptr;
|
||||
|
|
|
@ -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<Path> GetOrBuildPath(const DrawTarget& aDrawTarget,
|
||||
virtual already_AddRefed<Path> 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<Path> BuildPath(PathBuilder* aBuilder) = 0;
|
||||
virtual already_AddRefed<Path> 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<Path> GetOrBuildPathForMeasuring();
|
||||
virtual already_AddRefed<Path> GetOrBuildPathForMeasuring();
|
||||
|
||||
/**
|
||||
* Returns the current computed value of the CSS property 'fill-rule' for
|
||||
|
|
|
@ -154,7 +154,7 @@ MozMtpDatabase::FindEntryByPath(const nsACString& aPath)
|
|||
return 0;
|
||||
}
|
||||
|
||||
TemporaryRef<MozMtpDatabase::DbEntry>
|
||||
already_AddRefed<MozMtpDatabase::DbEntry>
|
||||
MozMtpDatabase::GetEntry(MtpObjectHandle aHandle)
|
||||
{
|
||||
MutexAutoLock lock(mMutex);
|
||||
|
|
|
@ -243,7 +243,7 @@ private:
|
|||
void AddEntryAndNotify(DbEntry* aEntr, RefCountedMtpServer* aMtpServer);
|
||||
void DumpEntries(const char* aLabel);
|
||||
MtpObjectHandle FindEntryByPath(const nsACString& aPath);
|
||||
mozilla::TemporaryRef<DbEntry> GetEntry(MtpObjectHandle aHandle);
|
||||
already_AddRefed<DbEntry> GetEntry(MtpObjectHandle aHandle);
|
||||
void RemoveEntry(MtpObjectHandle aHandle);
|
||||
void RemoveEntryAndNotify(MtpObjectHandle aHandle, RefCountedMtpServer* aMtpServer);
|
||||
void UpdateEntry(MtpObjectHandle aHandle, DeviceStorageFile* aFile);
|
||||
|
|
|
@ -71,7 +71,7 @@ VolumeManager::NumVolumes()
|
|||
}
|
||||
|
||||
//static
|
||||
TemporaryRef<Volume>
|
||||
already_AddRefed<Volume>
|
||||
VolumeManager::GetVolume(size_t aIndex)
|
||||
{
|
||||
MOZ_ASSERT(aIndex < NumVolumes());
|
||||
|
@ -125,7 +125,7 @@ void VolumeManager::UnregisterStateObserver(StateObserver* aObserver)
|
|||
}
|
||||
|
||||
//static
|
||||
TemporaryRef<Volume>
|
||||
already_AddRefed<Volume>
|
||||
VolumeManager::FindVolumeByName(const nsCSubstring& aName)
|
||||
{
|
||||
if (!sVolumeManager) {
|
||||
|
@ -143,7 +143,7 @@ VolumeManager::FindVolumeByName(const nsCSubstring& aName)
|
|||
}
|
||||
|
||||
//static
|
||||
TemporaryRef<Volume>
|
||||
already_AddRefed<Volume>
|
||||
VolumeManager::FindAddVolumeByName(const nsCSubstring& aName)
|
||||
{
|
||||
RefPtr<Volume> vol = FindVolumeByName(aName);
|
||||
|
|
|
@ -125,9 +125,9 @@ public:
|
|||
static void Dump(const char* aLabel);
|
||||
|
||||
static VolumeArray::size_type NumVolumes();
|
||||
static TemporaryRef<Volume> GetVolume(VolumeArray::index_type aIndex);
|
||||
static TemporaryRef<Volume> FindVolumeByName(const nsCSubstring& aName);
|
||||
static TemporaryRef<Volume> FindAddVolumeByName(const nsCSubstring& aName);
|
||||
static already_AddRefed<Volume> GetVolume(VolumeArray::index_type aIndex);
|
||||
static already_AddRefed<Volume> FindVolumeByName(const nsCSubstring& aName);
|
||||
static already_AddRefed<Volume> FindAddVolumeByName(const nsCSubstring& aName);
|
||||
static void InitConfig();
|
||||
|
||||
static void PostCommand(VolumeCommand* aCommand);
|
||||
|
|
74
gfx/2d/2D.h
74
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<DataSourceSurface> GetDataSurface() = 0;
|
||||
virtual already_AddRefed<DataSourceSurface> 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<DataSourceSurface> GetDataSurface() override;
|
||||
virtual already_AddRefed<DataSourceSurface> 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<PathBuilder> CopyToBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const = 0;
|
||||
virtual TemporaryRef<PathBuilder> TransformedCopyToBuilder(const Matrix &aTransform,
|
||||
virtual already_AddRefed<PathBuilder> CopyToBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const = 0;
|
||||
virtual already_AddRefed<PathBuilder> 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<Path> Finish() = 0;
|
||||
virtual already_AddRefed<Path> 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<Path> GetPathForGlyphs(const GlyphBuffer &aBuffer, const DrawTarget *aTarget) = 0;
|
||||
virtual already_AddRefed<Path> 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<SourceSurface> Snapshot() = 0;
|
||||
virtual already_AddRefed<SourceSurface> 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<SourceSurface> CreateSourceSurfaceFromData(unsigned char *aData,
|
||||
virtual already_AddRefed<SourceSurface> 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<SourceSurface> OptimizeSourceSurface(SourceSurface *aSurface) const = 0;
|
||||
virtual already_AddRefed<SourceSurface> 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<SourceSurface>
|
||||
virtual already_AddRefed<SourceSurface>
|
||||
CreateSourceSurfaceFromNativeSurface(const NativeSurface &aSurface) const = 0;
|
||||
|
||||
/**
|
||||
* Create a DrawTarget whose snapshot is optimized for use with this DrawTarget.
|
||||
*/
|
||||
virtual TemporaryRef<DrawTarget>
|
||||
virtual already_AddRefed<DrawTarget>
|
||||
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<DrawTargetCapture> CreateCaptureDT(const IntSize& aSize);
|
||||
virtual already_AddRefed<DrawTargetCapture> 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<DrawTarget>
|
||||
virtual already_AddRefed<DrawTarget>
|
||||
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<PathBuilder> CreatePathBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const = 0;
|
||||
virtual already_AddRefed<PathBuilder> 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<GradientStops>
|
||||
virtual already_AddRefed<GradientStops>
|
||||
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<FilterNode> CreateFilter(FilterType aType) = 0;
|
||||
virtual already_AddRefed<FilterNode> CreateFilter(FilterType aType) = 0;
|
||||
|
||||
Matrix GetTransform() const { return mTransform; }
|
||||
|
||||
|
@ -1144,18 +1144,18 @@ public:
|
|||
*/
|
||||
static bool ReasonableSurfaceSize(const IntSize &aSize);
|
||||
|
||||
static TemporaryRef<DrawTarget> CreateDrawTargetForCairoSurface(cairo_surface_t* aSurface, const IntSize& aSize, SurfaceFormat* aFormat = nullptr);
|
||||
static already_AddRefed<DrawTarget> CreateDrawTargetForCairoSurface(cairo_surface_t* aSurface, const IntSize& aSize, SurfaceFormat* aFormat = nullptr);
|
||||
|
||||
static TemporaryRef<DrawTarget>
|
||||
static already_AddRefed<DrawTarget>
|
||||
CreateDrawTarget(BackendType aBackend, const IntSize &aSize, SurfaceFormat aFormat);
|
||||
|
||||
static TemporaryRef<DrawTarget>
|
||||
static already_AddRefed<DrawTarget>
|
||||
CreateRecordingDrawTarget(DrawEventRecorder *aRecorder, DrawTarget *aDT);
|
||||
|
||||
static TemporaryRef<DrawTarget>
|
||||
static already_AddRefed<DrawTarget>
|
||||
CreateDrawTargetForData(BackendType aBackend, unsigned char* aData, const IntSize &aSize, int32_t aStride, SurfaceFormat aFormat);
|
||||
|
||||
static TemporaryRef<ScaledFont>
|
||||
static already_AddRefed<ScaledFont>
|
||||
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<ScaledFont>
|
||||
static already_AddRefed<ScaledFont>
|
||||
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<ScaledFont>
|
||||
static already_AddRefed<ScaledFont>
|
||||
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<DataSourceSurface>
|
||||
static already_AddRefed<DataSourceSurface>
|
||||
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<DataSourceSurface>
|
||||
static already_AddRefed<DataSourceSurface>
|
||||
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<DataSourceSurface>
|
||||
static already_AddRefed<DataSourceSurface>
|
||||
CreateWrappingDataSourceSurface(uint8_t *aData, int32_t aStride,
|
||||
const IntSize &aSize, SurfaceFormat aFormat);
|
||||
|
||||
static TemporaryRef<DrawEventRecorder>
|
||||
static already_AddRefed<DrawEventRecorder>
|
||||
CreateEventRecorderForFile(const char *aFilename);
|
||||
|
||||
static void SetGlobalEventRecorder(DrawEventRecorder *aRecorder);
|
||||
|
@ -1224,7 +1224,7 @@ private:
|
|||
public:
|
||||
|
||||
#ifdef USE_SKIA_GPU
|
||||
static TemporaryRef<DrawTarget>
|
||||
static already_AddRefed<DrawTarget>
|
||||
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<GlyphRenderingOptions>
|
||||
static already_AddRefed<GlyphRenderingOptions>
|
||||
CreateCairoGlyphRenderingOptions(FontHinting aHinting, bool aAutoHinting);
|
||||
#endif
|
||||
static TemporaryRef<DrawTarget>
|
||||
static already_AddRefed<DrawTarget>
|
||||
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<DrawTarget> CreateTiledDrawTarget(const TileSet& aTileSet);
|
||||
static already_AddRefed<DrawTarget> CreateTiledDrawTarget(const TileSet& aTileSet);
|
||||
|
||||
static bool DoesBackendSupportDataDrawtarget(BackendType aType);
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
static TemporaryRef<DrawTarget> CreateDrawTargetForCairoCGContext(CGContextRef cg, const IntSize& aSize);
|
||||
static TemporaryRef<GlyphRenderingOptions>
|
||||
static already_AddRefed<DrawTarget> CreateDrawTargetForCairoCGContext(CGContextRef cg, const IntSize& aSize);
|
||||
static already_AddRefed<GlyphRenderingOptions>
|
||||
CreateCGGlyphRenderingOptions(const Color &aFontSmoothingBackgroundColor);
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
static TemporaryRef<DrawTarget> CreateDrawTargetForD3D10Texture(ID3D10Texture2D *aTexture, SurfaceFormat aFormat);
|
||||
static TemporaryRef<DrawTarget>
|
||||
static already_AddRefed<DrawTarget> CreateDrawTargetForD3D10Texture(ID3D10Texture2D *aTexture, SurfaceFormat aFormat);
|
||||
static already_AddRefed<DrawTarget>
|
||||
CreateDualDrawTargetForD3D10Textures(ID3D10Texture2D *aTextureA,
|
||||
ID3D10Texture2D *aTextureB,
|
||||
SurfaceFormat aFormat);
|
||||
|
||||
static void SetDirect3D10Device(ID3D10Device1 *aDevice);
|
||||
static ID3D10Device1 *GetDirect3D10Device();
|
||||
static TemporaryRef<DrawTarget> CreateDrawTargetForD3D11Texture(ID3D11Texture2D *aTexture, SurfaceFormat aFormat);
|
||||
static already_AddRefed<DrawTarget> CreateDrawTargetForD3D11Texture(ID3D11Texture2D *aTexture, SurfaceFormat aFormat);
|
||||
|
||||
static void SetDirect3D11Device(ID3D11Device *aDevice);
|
||||
static ID3D11Device *GetDirect3D11Device();
|
||||
static ID2D1Device *GetD2D1Device();
|
||||
static bool SupportsD2D1();
|
||||
|
||||
static TemporaryRef<GlyphRenderingOptions>
|
||||
static already_AddRefed<GlyphRenderingOptions>
|
||||
CreateDWriteGlyphRenderingOptions(IDWriteRenderingParams *aParams);
|
||||
|
||||
static uint64_t GetD2DVRAMUsageDrawTarget();
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
namespace mozilla {
|
||||
namespace gfx {
|
||||
|
||||
TemporaryRef<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
DataSourceSurface::GetDataSurface()
|
||||
{
|
||||
RefPtr<DataSourceSurface> surface =
|
||||
|
|
|
@ -278,7 +278,7 @@ CopyRect(DataSourceSurface* aSrc, DataSourceSurface* aDest,
|
|||
}
|
||||
}
|
||||
|
||||
TemporaryRef<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
CreateDataSourceSurfaceByCloning(DataSourceSurface* aSource)
|
||||
{
|
||||
RefPtr<DataSourceSurface> copy =
|
||||
|
|
|
@ -83,7 +83,7 @@ CopyRect(DataSourceSurface* aSrc, DataSourceSurface* aDest,
|
|||
*
|
||||
* @return a dss allocated by Factory that contains a copy a aSource.
|
||||
*/
|
||||
TemporaryRef<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
CreateDataSourceSurfaceByCloning(DataSourceSurface* aSource);
|
||||
|
||||
/**
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
namespace mozilla {
|
||||
namespace gfx {
|
||||
|
||||
TemporaryRef<DrawTargetCapture>
|
||||
already_AddRefed<DrawTargetCapture>
|
||||
DrawTarget::CreateCaptureDT(const IntSize& aSize)
|
||||
{
|
||||
RefPtr<DrawTargetCaptureImpl> dt = new DrawTargetCaptureImpl();
|
||||
|
|
|
@ -186,7 +186,7 @@ DrawTargetCG::GetBackendType() const
|
|||
}
|
||||
}
|
||||
|
||||
TemporaryRef<SourceSurface>
|
||||
already_AddRefed<SourceSurface>
|
||||
DrawTargetCG::Snapshot()
|
||||
{
|
||||
if (!mSnapshot) {
|
||||
|
@ -201,7 +201,7 @@ DrawTargetCG::Snapshot()
|
|||
return snapshot.forget();
|
||||
}
|
||||
|
||||
TemporaryRef<DrawTarget>
|
||||
already_AddRefed<DrawTarget>
|
||||
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<SourceSurface>
|
||||
already_AddRefed<SourceSurface>
|
||||
DrawTargetCG::CreateSourceSurfaceFromData(unsigned char *aData,
|
||||
const IntSize &aSize,
|
||||
int32_t aStride,
|
||||
|
@ -260,7 +260,7 @@ GetRetainedImageFromSourceSurface(SourceSurface *aSurface)
|
|||
}
|
||||
}
|
||||
|
||||
TemporaryRef<SourceSurface>
|
||||
already_AddRefed<SourceSurface>
|
||||
DrawTargetCG::OptimizeSourceSurface(SourceSurface *aSurface) const
|
||||
{
|
||||
RefPtr<SourceSurface> surface(aSurface);
|
||||
|
@ -392,7 +392,7 @@ DrawTargetCG::DrawSurface(SourceSurface *aSurface,
|
|||
CGContextRestoreGState(mCg);
|
||||
}
|
||||
|
||||
TemporaryRef<FilterNode>
|
||||
already_AddRefed<FilterNode>
|
||||
DrawTargetCG::CreateFilter(FilterType aType)
|
||||
{
|
||||
return FilterNodeSoftware::Create(aType);
|
||||
|
@ -468,7 +468,7 @@ class GradientStopsCG : public GradientStops
|
|||
ExtendMode mExtend;
|
||||
};
|
||||
|
||||
TemporaryRef<GradientStops>
|
||||
already_AddRefed<GradientStops>
|
||||
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<PathBuilder>
|
||||
already_AddRefed<PathBuilder>
|
||||
DrawTargetCG::CreatePathBuilder(FillRule aFillRule) const
|
||||
{
|
||||
return MakeAndAddRef<PathBuilderCG>(aFillRule);
|
||||
|
|
|
@ -120,7 +120,7 @@ public:
|
|||
|
||||
virtual DrawTargetType GetType() const override;
|
||||
virtual BackendType GetBackendType() const override;
|
||||
virtual TemporaryRef<SourceSurface> Snapshot() override;
|
||||
virtual already_AddRefed<SourceSurface> 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<SourceSurface> CreateSourceSurfaceFromNativeSurface(const NativeSurface&) const override { return nullptr;}
|
||||
virtual TemporaryRef<DrawTarget> CreateSimilarDrawTarget(const IntSize &, SurfaceFormat) const override;
|
||||
virtual TemporaryRef<PathBuilder> CreatePathBuilder(FillRule) const override;
|
||||
virtual TemporaryRef<GradientStops> CreateGradientStops(GradientStop *, uint32_t,
|
||||
virtual already_AddRefed<SourceSurface> CreateSourceSurfaceFromNativeSurface(const NativeSurface&) const override { return nullptr;}
|
||||
virtual already_AddRefed<DrawTarget> CreateSimilarDrawTarget(const IntSize &, SurfaceFormat) const override;
|
||||
virtual already_AddRefed<PathBuilder> CreatePathBuilder(FillRule) const override;
|
||||
virtual already_AddRefed<GradientStops> CreateGradientStops(GradientStop *, uint32_t,
|
||||
ExtendMode aExtendMode = ExtendMode::CLAMP) const override;
|
||||
virtual TemporaryRef<FilterNode> CreateFilter(FilterType aType) override;
|
||||
virtual already_AddRefed<FilterNode> 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<SourceSurface> CreateSourceSurfaceFromData(unsigned char *aData,
|
||||
virtual already_AddRefed<SourceSurface> CreateSourceSurfaceFromData(unsigned char *aData,
|
||||
const IntSize &aSize,
|
||||
int32_t aStride,
|
||||
SurfaceFormat aFormat) const override;
|
||||
virtual TemporaryRef<SourceSurface> OptimizeSourceSurface(SourceSurface *aSurface) const override;
|
||||
virtual already_AddRefed<SourceSurface> OptimizeSourceSurface(SourceSurface *aSurface) const override;
|
||||
CGContextRef GetCGContext() {
|
||||
return mCg;
|
||||
}
|
||||
|
|
|
@ -678,7 +678,7 @@ DrawTargetCairo::GetSize()
|
|||
return mSize;
|
||||
}
|
||||
|
||||
TemporaryRef<SourceSurface>
|
||||
already_AddRefed<SourceSurface>
|
||||
DrawTargetCairo::Snapshot()
|
||||
{
|
||||
if (mSnapshot) {
|
||||
|
@ -1369,7 +1369,7 @@ DrawTargetCairo::PopClip()
|
|||
"Transforms are out of sync");
|
||||
}
|
||||
|
||||
TemporaryRef<PathBuilder>
|
||||
already_AddRefed<PathBuilder>
|
||||
DrawTargetCairo::CreatePathBuilder(FillRule aFillRule /* = FillRule::FILL_WINDING */) const
|
||||
{
|
||||
return MakeAndAddRef<PathBuilderCairo>(aFillRule);
|
||||
|
@ -1388,20 +1388,20 @@ DrawTargetCairo::ClearSurfaceForUnboundedSource(const CompositionOp &aOperator)
|
|||
}
|
||||
|
||||
|
||||
TemporaryRef<GradientStops>
|
||||
already_AddRefed<GradientStops>
|
||||
DrawTargetCairo::CreateGradientStops(GradientStop *aStops, uint32_t aNumStops,
|
||||
ExtendMode aExtendMode) const
|
||||
{
|
||||
return MakeAndAddRef<GradientStopsCairo>(aStops, aNumStops, aExtendMode);
|
||||
}
|
||||
|
||||
TemporaryRef<FilterNode>
|
||||
already_AddRefed<FilterNode>
|
||||
DrawTargetCairo::CreateFilter(FilterType aType)
|
||||
{
|
||||
return FilterNodeSoftware::Create(aType);
|
||||
}
|
||||
|
||||
TemporaryRef<SourceSurface>
|
||||
already_AddRefed<SourceSurface>
|
||||
DrawTargetCairo::CreateSourceSurfaceFromData(unsigned char *aData,
|
||||
const IntSize &aSize,
|
||||
int32_t aStride,
|
||||
|
@ -1443,7 +1443,7 @@ DestroyPixmap(void *data)
|
|||
}
|
||||
#endif
|
||||
|
||||
TemporaryRef<SourceSurface>
|
||||
already_AddRefed<SourceSurface>
|
||||
DrawTargetCairo::OptimizeSourceSurface(SourceSurface *aSurface) const
|
||||
{
|
||||
RefPtr<SourceSurface> surface(aSurface);
|
||||
|
@ -1532,7 +1532,7 @@ DrawTargetCairo::OptimizeSourceSurface(SourceSurface *aSurface) const
|
|||
return surface.forget();
|
||||
}
|
||||
|
||||
TemporaryRef<SourceSurface>
|
||||
already_AddRefed<SourceSurface>
|
||||
DrawTargetCairo::CreateSourceSurfaceFromNativeSurface(const NativeSurface &aSurface) const
|
||||
{
|
||||
if (aSurface.mType == NativeSurfaceType::CAIRO_SURFACE) {
|
||||
|
@ -1548,7 +1548,7 @@ DrawTargetCairo::CreateSourceSurfaceFromNativeSurface(const NativeSurface &aSurf
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
TemporaryRef<DrawTarget>
|
||||
already_AddRefed<DrawTarget>
|
||||
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<DrawTarget>
|
||||
already_AddRefed<DrawTarget>
|
||||
DrawTargetCairo::CreateShadowDrawTarget(const IntSize &aSize, SurfaceFormat aFormat,
|
||||
float aSigma) const
|
||||
{
|
||||
|
|
|
@ -61,7 +61,7 @@ public:
|
|||
|
||||
virtual DrawTargetType GetType() const override;
|
||||
virtual BackendType GetBackendType() const override { return BackendType::CAIRO; }
|
||||
virtual TemporaryRef<SourceSurface> Snapshot() override;
|
||||
virtual already_AddRefed<SourceSurface> 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<PathBuilder> CreatePathBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const override;
|
||||
virtual already_AddRefed<PathBuilder> CreatePathBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const override;
|
||||
|
||||
virtual TemporaryRef<SourceSurface> CreateSourceSurfaceFromData(unsigned char *aData,
|
||||
virtual already_AddRefed<SourceSurface> CreateSourceSurfaceFromData(unsigned char *aData,
|
||||
const IntSize &aSize,
|
||||
int32_t aStride,
|
||||
SurfaceFormat aFormat) const override;
|
||||
virtual TemporaryRef<SourceSurface> OptimizeSourceSurface(SourceSurface *aSurface) const override;
|
||||
virtual TemporaryRef<SourceSurface>
|
||||
virtual already_AddRefed<SourceSurface> OptimizeSourceSurface(SourceSurface *aSurface) const override;
|
||||
virtual already_AddRefed<SourceSurface>
|
||||
CreateSourceSurfaceFromNativeSurface(const NativeSurface &aSurface) const override;
|
||||
virtual TemporaryRef<DrawTarget>
|
||||
virtual already_AddRefed<DrawTarget>
|
||||
CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aFormat) const override;
|
||||
virtual TemporaryRef<DrawTarget>
|
||||
virtual already_AddRefed<DrawTarget>
|
||||
CreateShadowDrawTarget(const IntSize &aSize, SurfaceFormat aFormat,
|
||||
float aSigma) const override;
|
||||
|
||||
virtual TemporaryRef<GradientStops>
|
||||
virtual already_AddRefed<GradientStops>
|
||||
CreateGradientStops(GradientStop *aStops,
|
||||
uint32_t aNumStops,
|
||||
ExtendMode aExtendMode = ExtendMode::CLAMP) const override;
|
||||
|
||||
virtual TemporaryRef<FilterNode> CreateFilter(FilterType aType) override;
|
||||
virtual already_AddRefed<FilterNode> CreateFilter(FilterType aType) override;
|
||||
|
||||
virtual void *GetNativeSurface(NativeSurfaceType aType) override;
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ DrawTargetCaptureImpl::Init(const IntSize& aSize, DrawTarget* aRefDT)
|
|||
return true;
|
||||
}
|
||||
|
||||
TemporaryRef<SourceSurface>
|
||||
already_AddRefed<SourceSurface>
|
||||
DrawTargetCaptureImpl::Snapshot()
|
||||
{
|
||||
RefPtr<DrawTarget> dt = mRefDT->CreateSimilarDrawTarget(mSize, mRefDT->GetFormat());
|
||||
|
|
|
@ -27,7 +27,7 @@ public:
|
|||
virtual BackendType GetBackendType() const { return mRefDT->GetBackendType(); }
|
||||
virtual DrawTargetType GetType() const { return mRefDT->GetType(); }
|
||||
|
||||
virtual TemporaryRef<SourceSurface> Snapshot();
|
||||
virtual already_AddRefed<SourceSurface> Snapshot();
|
||||
virtual IntSize GetSize() { return mSize; }
|
||||
|
||||
virtual void Flush() {}
|
||||
|
@ -90,43 +90,43 @@ public:
|
|||
|
||||
virtual void SetTransform(const Matrix &aTransform);
|
||||
|
||||
virtual TemporaryRef<SourceSurface> CreateSourceSurfaceFromData(unsigned char *aData,
|
||||
virtual already_AddRefed<SourceSurface> CreateSourceSurfaceFromData(unsigned char *aData,
|
||||
const IntSize &aSize,
|
||||
int32_t aStride,
|
||||
SurfaceFormat aFormat) const
|
||||
{
|
||||
return mRefDT->CreateSourceSurfaceFromData(aData, aSize, aStride, aFormat);
|
||||
}
|
||||
virtual TemporaryRef<SourceSurface> OptimizeSourceSurface(SourceSurface *aSurface) const
|
||||
virtual already_AddRefed<SourceSurface> OptimizeSourceSurface(SourceSurface *aSurface) const
|
||||
{
|
||||
return mRefDT->OptimizeSourceSurface(aSurface);
|
||||
}
|
||||
|
||||
virtual TemporaryRef<SourceSurface>
|
||||
virtual already_AddRefed<SourceSurface>
|
||||
CreateSourceSurfaceFromNativeSurface(const NativeSurface &aSurface) const
|
||||
{
|
||||
return mRefDT->CreateSourceSurfaceFromNativeSurface(aSurface);
|
||||
}
|
||||
|
||||
virtual TemporaryRef<DrawTarget>
|
||||
virtual already_AddRefed<DrawTarget>
|
||||
CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aFormat) const
|
||||
{
|
||||
return mRefDT->CreateSimilarDrawTarget(aSize, aFormat);
|
||||
}
|
||||
|
||||
virtual TemporaryRef<PathBuilder> CreatePathBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const
|
||||
virtual already_AddRefed<PathBuilder> CreatePathBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const
|
||||
{
|
||||
return mRefDT->CreatePathBuilder(aFillRule);
|
||||
}
|
||||
|
||||
virtual TemporaryRef<GradientStops>
|
||||
virtual already_AddRefed<GradientStops>
|
||||
CreateGradientStops(GradientStop *aStops,
|
||||
uint32_t aNumStops,
|
||||
ExtendMode aExtendMode = ExtendMode::CLAMP) const
|
||||
{
|
||||
return mRefDT->CreateGradientStops(aStops, aNumStops, aExtendMode);
|
||||
}
|
||||
virtual TemporaryRef<FilterNode> CreateFilter(FilterType aType)
|
||||
virtual already_AddRefed<FilterNode> CreateFilter(FilterType aType)
|
||||
{
|
||||
return mRefDT->CreateFilter(aType);
|
||||
}
|
||||
|
|
|
@ -219,7 +219,7 @@ DrawTargetD2D::~DrawTargetD2D()
|
|||
/*
|
||||
* DrawTarget Implementation
|
||||
*/
|
||||
TemporaryRef<SourceSurface>
|
||||
already_AddRefed<SourceSurface>
|
||||
DrawTargetD2D::Snapshot()
|
||||
{
|
||||
if (!mSnapshot) {
|
||||
|
@ -259,7 +259,7 @@ DrawTargetD2D::AddDependencyOnSource(SourceSurfaceD2DTarget* aSource)
|
|||
}
|
||||
}
|
||||
|
||||
TemporaryRef<ID2D1Bitmap>
|
||||
already_AddRefed<ID2D1Bitmap>
|
||||
DrawTargetD2D::GetBitmapForSurface(SourceSurface *aSurface,
|
||||
Rect &aSource)
|
||||
{
|
||||
|
@ -337,7 +337,7 @@ DrawTargetD2D::GetBitmapForSurface(SourceSurface *aSurface,
|
|||
return bitmap.forget();
|
||||
}
|
||||
|
||||
TemporaryRef<ID2D1Image>
|
||||
already_AddRefed<ID2D1Image>
|
||||
DrawTargetD2D::GetImageForSurface(SourceSurface *aSurface)
|
||||
{
|
||||
RefPtr<ID2D1Image> image;
|
||||
|
@ -1195,7 +1195,7 @@ DrawTargetD2D::PopClip()
|
|||
mPushedClips.pop_back();
|
||||
}
|
||||
|
||||
TemporaryRef<SourceSurface>
|
||||
already_AddRefed<SourceSurface>
|
||||
DrawTargetD2D::CreateSourceSurfaceFromData(unsigned char *aData,
|
||||
const IntSize &aSize,
|
||||
int32_t aStride,
|
||||
|
@ -1210,7 +1210,7 @@ DrawTargetD2D::CreateSourceSurfaceFromData(unsigned char *aData,
|
|||
return newSurf.forget();
|
||||
}
|
||||
|
||||
TemporaryRef<SourceSurface>
|
||||
already_AddRefed<SourceSurface>
|
||||
DrawTargetD2D::OptimizeSourceSurface(SourceSurface *aSurface) const
|
||||
{
|
||||
if (aSurface->GetType() == SurfaceType::D2D1_BITMAP ||
|
||||
|
@ -1237,7 +1237,7 @@ DrawTargetD2D::OptimizeSourceSurface(SourceSurface *aSurface) const
|
|||
return newSurf.forget();
|
||||
}
|
||||
|
||||
TemporaryRef<SourceSurface>
|
||||
already_AddRefed<SourceSurface>
|
||||
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<DrawTarget>
|
||||
already_AddRefed<DrawTarget>
|
||||
DrawTargetD2D::CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aFormat) const
|
||||
{
|
||||
RefPtr<DrawTargetD2D> newTarget =
|
||||
|
@ -1271,7 +1271,7 @@ DrawTargetD2D::CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aForm
|
|||
return newTarget.forget();
|
||||
}
|
||||
|
||||
TemporaryRef<PathBuilder>
|
||||
already_AddRefed<PathBuilder>
|
||||
DrawTargetD2D::CreatePathBuilder(FillRule aFillRule) const
|
||||
{
|
||||
RefPtr<ID2D1PathGeometry> path;
|
||||
|
@ -1296,7 +1296,7 @@ DrawTargetD2D::CreatePathBuilder(FillRule aFillRule) const
|
|||
return MakeAndAddRef<PathBuilderD2D>(sink, path, aFillRule, BackendType::DIRECT2D);
|
||||
}
|
||||
|
||||
TemporaryRef<GradientStops>
|
||||
already_AddRefed<GradientStops>
|
||||
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<GradientStopsD2D>(stopCollection, Factory::GetDirect3D11Device());
|
||||
}
|
||||
|
||||
TemporaryRef<FilterNode>
|
||||
already_AddRefed<FilterNode>
|
||||
DrawTargetD2D::CreateFilter(FilterType aType)
|
||||
{
|
||||
RefPtr<ID2D1DeviceContext> dc;
|
||||
|
@ -1490,7 +1490,7 @@ DrawTargetD2D::GetByteSize() const
|
|||
return mSize.width * mSize.height * BytesPerPixel(mFormat);
|
||||
}
|
||||
|
||||
TemporaryRef<ID2D1Layer>
|
||||
already_AddRefed<ID2D1Layer>
|
||||
DrawTargetD2D::GetCachedLayer()
|
||||
{
|
||||
RefPtr<ID2D1Layer> layer;
|
||||
|
@ -1871,7 +1871,7 @@ DrawTargetD2D::GetDeviceSpaceClipRect(D2D1_RECT_F& aClipRect, bool& aIsPixelAlig
|
|||
return true;
|
||||
}
|
||||
|
||||
TemporaryRef<ID2D1Geometry>
|
||||
already_AddRefed<ID2D1Geometry>
|
||||
DrawTargetD2D::GetClippedGeometry(IntRect *aClipBounds)
|
||||
{
|
||||
if (mCurrentClippedGeometry) {
|
||||
|
@ -1960,7 +1960,7 @@ DrawTargetD2D::GetClippedGeometry(IntRect *aClipBounds)
|
|||
return clippedGeometry.forget();
|
||||
}
|
||||
|
||||
TemporaryRef<ID2D1RenderTarget>
|
||||
already_AddRefed<ID2D1RenderTarget>
|
||||
DrawTargetD2D::CreateRTForTexture(ID3D10Texture2D *aTexture, SurfaceFormat aFormat)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
@ -2288,7 +2288,7 @@ DrawTargetD2D::FillGlyphsManual(ScaledFontDWrite *aFont,
|
|||
return true;
|
||||
}
|
||||
|
||||
TemporaryRef<ID2D1Brush>
|
||||
already_AddRefed<ID2D1Brush>
|
||||
DrawTargetD2D::CreateBrushForPattern(const Pattern &aPattern, Float aAlpha)
|
||||
{
|
||||
if (!IsPatternSupportedByD2D(aPattern)) {
|
||||
|
@ -2454,7 +2454,7 @@ DrawTargetD2D::CreateBrushForPattern(const Pattern &aPattern, Float aAlpha)
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
TemporaryRef<ID3D10Texture2D>
|
||||
already_AddRefed<ID3D10Texture2D>
|
||||
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<ID3D10Texture2D>
|
||||
already_AddRefed<ID3D10Texture2D>
|
||||
DrawTargetD2D::CreateTextureForAnalysis(IDWriteGlyphRunAnalysis *aAnalysis, const IntRect &aBounds)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
|
|
@ -45,7 +45,7 @@ public:
|
|||
|
||||
virtual DrawTargetType GetType() const override { return DrawTargetType::HARDWARE_RASTER; }
|
||||
virtual BackendType GetBackendType() const { return BackendType::DIRECT2D; }
|
||||
virtual TemporaryRef<SourceSurface> Snapshot();
|
||||
virtual already_AddRefed<SourceSurface> 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<SourceSurface> CreateSourceSurfaceFromData(unsigned char *aData,
|
||||
virtual already_AddRefed<SourceSurface> CreateSourceSurfaceFromData(unsigned char *aData,
|
||||
const IntSize &aSize,
|
||||
int32_t aStride,
|
||||
SurfaceFormat aFormat) const;
|
||||
virtual TemporaryRef<SourceSurface> OptimizeSourceSurface(SourceSurface *aSurface) const;
|
||||
virtual already_AddRefed<SourceSurface> OptimizeSourceSurface(SourceSurface *aSurface) const;
|
||||
|
||||
virtual TemporaryRef<SourceSurface>
|
||||
virtual already_AddRefed<SourceSurface>
|
||||
CreateSourceSurfaceFromNativeSurface(const NativeSurface &aSurface) const;
|
||||
|
||||
virtual TemporaryRef<DrawTarget>
|
||||
virtual already_AddRefed<DrawTarget>
|
||||
CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aFormat) const;
|
||||
|
||||
virtual TemporaryRef<PathBuilder> CreatePathBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const;
|
||||
virtual already_AddRefed<PathBuilder> CreatePathBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const;
|
||||
|
||||
virtual TemporaryRef<GradientStops>
|
||||
virtual already_AddRefed<GradientStops>
|
||||
CreateGradientStops(GradientStop *aStops,
|
||||
uint32_t aNumStops,
|
||||
ExtendMode aExtendMode = ExtendMode::CLAMP) const;
|
||||
|
||||
virtual TemporaryRef<FilterNode> CreateFilter(FilterType aType);
|
||||
virtual already_AddRefed<FilterNode> 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<ID2D1Layer> GetCachedLayer();
|
||||
already_AddRefed<ID2D1Layer> GetCachedLayer();
|
||||
void PopCachedLayer(ID2D1RenderTarget *aRT);
|
||||
|
||||
TemporaryRef<ID2D1Image> GetImageForSurface(SourceSurface *aSurface);
|
||||
already_AddRefed<ID2D1Image> GetImageForSurface(SourceSurface *aSurface);
|
||||
|
||||
static ID2D1Factory *factory();
|
||||
static void CleanupD2D();
|
||||
|
@ -159,7 +159,7 @@ public:
|
|||
static uint64_t mVRAMUsageSS;
|
||||
|
||||
private:
|
||||
TemporaryRef<ID2D1Bitmap>
|
||||
already_AddRefed<ID2D1Bitmap>
|
||||
GetBitmapForSurface(SourceSurface *aSurface,
|
||||
Rect &aSource);
|
||||
friend class AutoSaveRestoreClippedOut;
|
||||
|
@ -199,20 +199,20 @@ private:
|
|||
IDWriteRenderingParams *aParams,
|
||||
const DrawOptions &aOptions = DrawOptions());
|
||||
|
||||
TemporaryRef<ID2D1RenderTarget> CreateRTForTexture(ID3D10Texture2D *aTexture, SurfaceFormat aFormat);
|
||||
already_AddRefed<ID2D1RenderTarget> 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<ID2D1Geometry> GetClippedGeometry(IntRect *aClipBounds);
|
||||
already_AddRefed<ID2D1Geometry> GetClippedGeometry(IntRect *aClipBounds);
|
||||
|
||||
bool GetDeviceSpaceClipRect(D2D1_RECT_F& aClipRect, bool& aIsPixelAligned);
|
||||
|
||||
TemporaryRef<ID2D1Brush> CreateBrushForPattern(const Pattern &aPattern, Float aAlpha = 1.0f);
|
||||
already_AddRefed<ID2D1Brush> CreateBrushForPattern(const Pattern &aPattern, Float aAlpha = 1.0f);
|
||||
|
||||
TemporaryRef<ID3D10Texture2D> CreateGradientTexture(const GradientStopsD2D *aStops);
|
||||
TemporaryRef<ID3D10Texture2D> CreateTextureForAnalysis(IDWriteGlyphRunAnalysis *aAnalysis, const IntRect &aBounds);
|
||||
already_AddRefed<ID3D10Texture2D> CreateGradientTexture(const GradientStopsD2D *aStops);
|
||||
already_AddRefed<ID3D10Texture2D> CreateTextureForAnalysis(IDWriteGlyphRunAnalysis *aAnalysis, const IntRect &aBounds);
|
||||
|
||||
void SetupEffectForRadialGradient(const RadialGradientPattern *aPattern);
|
||||
void SetupStateForRendering();
|
||||
|
|
|
@ -65,7 +65,7 @@ DrawTargetD2D1::~DrawTargetD2D1()
|
|||
}
|
||||
}
|
||||
|
||||
TemporaryRef<SourceSurface>
|
||||
already_AddRefed<SourceSurface>
|
||||
DrawTargetD2D1::Snapshot()
|
||||
{
|
||||
if (mSnapshot) {
|
||||
|
@ -705,7 +705,7 @@ DrawTargetD2D1::PopClip()
|
|||
mPushedClips.pop_back();
|
||||
}
|
||||
|
||||
TemporaryRef<SourceSurface>
|
||||
already_AddRefed<SourceSurface>
|
||||
DrawTargetD2D1::CreateSourceSurfaceFromData(unsigned char *aData,
|
||||
const IntSize &aSize,
|
||||
int32_t aStride,
|
||||
|
@ -725,7 +725,7 @@ DrawTargetD2D1::CreateSourceSurfaceFromData(unsigned char *aData,
|
|||
return MakeAndAddRef<SourceSurfaceD2D1>(bitmap.get(), mDC, aFormat, aSize);
|
||||
}
|
||||
|
||||
TemporaryRef<DrawTarget>
|
||||
already_AddRefed<DrawTarget>
|
||||
DrawTargetD2D1::CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aFormat) const
|
||||
{
|
||||
RefPtr<DrawTargetD2D1> dt = new DrawTargetD2D1();
|
||||
|
@ -737,7 +737,7 @@ DrawTargetD2D1::CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aFor
|
|||
return dt.forget();
|
||||
}
|
||||
|
||||
TemporaryRef<PathBuilder>
|
||||
already_AddRefed<PathBuilder>
|
||||
DrawTargetD2D1::CreatePathBuilder(FillRule aFillRule) const
|
||||
{
|
||||
RefPtr<ID2D1PathGeometry> path;
|
||||
|
@ -762,7 +762,7 @@ DrawTargetD2D1::CreatePathBuilder(FillRule aFillRule) const
|
|||
return MakeAndAddRef<PathBuilderD2D>(sink, path, aFillRule, BackendType::DIRECT2D1_1);
|
||||
}
|
||||
|
||||
TemporaryRef<GradientStops>
|
||||
already_AddRefed<GradientStops>
|
||||
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<GradientStopsD2D>(stopCollection, Factory::GetDirect3D11Device());
|
||||
}
|
||||
|
||||
TemporaryRef<FilterNode>
|
||||
already_AddRefed<FilterNode>
|
||||
DrawTargetD2D1::CreateFilter(FilterType aType)
|
||||
{
|
||||
return FilterNodeD2D1::Create(mDC, aType);
|
||||
|
@ -1198,7 +1198,7 @@ DrawTargetD2D1::GetDeviceSpaceClipRect(D2D1_RECT_F& aClipRect, bool& aIsPixelAli
|
|||
return true;
|
||||
}
|
||||
|
||||
TemporaryRef<ID2D1Geometry>
|
||||
already_AddRefed<ID2D1Geometry>
|
||||
DrawTargetD2D1::GetClippedGeometry(IntRect *aClipBounds)
|
||||
{
|
||||
if (mCurrentClippedGeometry) {
|
||||
|
@ -1289,7 +1289,7 @@ DrawTargetD2D1::GetClippedGeometry(IntRect *aClipBounds)
|
|||
return clippedGeometry.forget();
|
||||
}
|
||||
|
||||
TemporaryRef<ID2D1Geometry>
|
||||
already_AddRefed<ID2D1Geometry>
|
||||
DrawTargetD2D1::GetInverseClippedGeometry()
|
||||
{
|
||||
IntRect bounds;
|
||||
|
@ -1355,13 +1355,13 @@ DrawTargetD2D1::PopClipsFromDC(ID2D1DeviceContext *aDC)
|
|||
}
|
||||
}
|
||||
|
||||
TemporaryRef<ID2D1Brush>
|
||||
already_AddRefed<ID2D1Brush>
|
||||
DrawTargetD2D1::CreateTransparentBlackBrush()
|
||||
{
|
||||
return GetSolidColorBrush(D2D1::ColorF(0, 0));
|
||||
}
|
||||
|
||||
TemporaryRef<ID2D1SolidColorBrush>
|
||||
already_AddRefed<ID2D1SolidColorBrush>
|
||||
DrawTargetD2D1::GetSolidColorBrush(const D2D_COLOR_F& aColor)
|
||||
{
|
||||
RefPtr<ID2D1SolidColorBrush> brush = mSolidColorBrush;
|
||||
|
@ -1369,7 +1369,7 @@ DrawTargetD2D1::GetSolidColorBrush(const D2D_COLOR_F& aColor)
|
|||
return brush.forget();
|
||||
}
|
||||
|
||||
TemporaryRef<ID2D1Brush>
|
||||
already_AddRefed<ID2D1Brush>
|
||||
DrawTargetD2D1::CreateBrushForPattern(const Pattern &aPattern, Float aAlpha)
|
||||
{
|
||||
if (!IsPatternSupportedByD2D(aPattern)) {
|
||||
|
@ -1513,7 +1513,7 @@ DrawTargetD2D1::CreateBrushForPattern(const Pattern &aPattern, Float aAlpha)
|
|||
return CreateTransparentBlackBrush();
|
||||
}
|
||||
|
||||
TemporaryRef<ID2D1Image>
|
||||
already_AddRefed<ID2D1Image>
|
||||
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<SourceSurface>
|
||||
already_AddRefed<SourceSurface>
|
||||
DrawTargetD2D1::OptimizeSourceSurface(SourceSurface* aSurface) const
|
||||
{
|
||||
if (aSurface->GetType() == SurfaceType::D2D1_1_IMAGE) {
|
||||
|
|
|
@ -35,7 +35,7 @@ public:
|
|||
|
||||
virtual DrawTargetType GetType() const override { return DrawTargetType::HARDWARE_RASTER; }
|
||||
virtual BackendType GetBackendType() const { return BackendType::DIRECT2D1_1; }
|
||||
virtual TemporaryRef<SourceSurface> Snapshot();
|
||||
virtual already_AddRefed<SourceSurface> 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<SourceSurface> CreateSourceSurfaceFromData(unsigned char *aData,
|
||||
virtual already_AddRefed<SourceSurface> CreateSourceSurfaceFromData(unsigned char *aData,
|
||||
const IntSize &aSize,
|
||||
int32_t aStride,
|
||||
SurfaceFormat aFormat) const;
|
||||
virtual TemporaryRef<SourceSurface> OptimizeSourceSurface(SourceSurface *aSurface) const;
|
||||
virtual already_AddRefed<SourceSurface> OptimizeSourceSurface(SourceSurface *aSurface) const;
|
||||
|
||||
virtual TemporaryRef<SourceSurface>
|
||||
virtual already_AddRefed<SourceSurface>
|
||||
CreateSourceSurfaceFromNativeSurface(const NativeSurface &aSurface) const { return nullptr; }
|
||||
|
||||
virtual TemporaryRef<DrawTarget>
|
||||
virtual already_AddRefed<DrawTarget>
|
||||
CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aFormat) const;
|
||||
|
||||
virtual TemporaryRef<PathBuilder> CreatePathBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const;
|
||||
virtual already_AddRefed<PathBuilder> CreatePathBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const;
|
||||
|
||||
virtual TemporaryRef<GradientStops>
|
||||
virtual already_AddRefed<GradientStops>
|
||||
CreateGradientStops(GradientStop *aStops,
|
||||
uint32_t aNumStops,
|
||||
ExtendMode aExtendMode = ExtendMode::CLAMP) const;
|
||||
|
||||
virtual TemporaryRef<FilterNode> CreateFilter(FilterType aType);
|
||||
virtual already_AddRefed<FilterNode> 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<ID2D1Image> GetImageForSurface(SourceSurface *aSurface, Matrix &aSourceTransform,
|
||||
already_AddRefed<ID2D1Image> GetImageForSurface(SourceSurface *aSurface, Matrix &aSourceTransform,
|
||||
ExtendMode aExtendMode, const IntRect* aSourceRect = nullptr);
|
||||
|
||||
TemporaryRef<ID2D1Image> GetImageForSurface(SourceSurface *aSurface, ExtendMode aExtendMode) {
|
||||
already_AddRefed<ID2D1Image> 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<ID2D1Geometry> GetClippedGeometry(IntRect *aClipBounds);
|
||||
already_AddRefed<ID2D1Geometry> GetClippedGeometry(IntRect *aClipBounds);
|
||||
|
||||
TemporaryRef<ID2D1Geometry> GetInverseClippedGeometry();
|
||||
already_AddRefed<ID2D1Geometry> 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<ID2D1Brush> CreateTransparentBlackBrush();
|
||||
TemporaryRef<ID2D1SolidColorBrush> GetSolidColorBrush(const D2D_COLOR_F& aColor);
|
||||
TemporaryRef<ID2D1Brush> CreateBrushForPattern(const Pattern &aPattern, Float aAlpha = 1.0f);
|
||||
already_AddRefed<ID2D1Brush> CreateTransparentBlackBrush();
|
||||
already_AddRefed<ID2D1SolidColorBrush> GetSolidColorBrush(const D2D_COLOR_F& aColor);
|
||||
already_AddRefed<ID2D1Brush> 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());
|
||||
|
|
|
@ -181,7 +181,7 @@ DrawTargetDual::Mask(const Pattern &aSource, const Pattern &aMask, const DrawOpt
|
|||
mB->Mask(*source.mB, *mask.mB, aOptions);
|
||||
}
|
||||
|
||||
TemporaryRef<DrawTarget>
|
||||
already_AddRefed<DrawTarget>
|
||||
DrawTargetDual::CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aFormat) const
|
||||
{
|
||||
RefPtr<DrawTarget> dtA = mA->CreateSimilarDrawTarget(aSize, aFormat);
|
||||
|
|
|
@ -45,7 +45,7 @@ public:
|
|||
|
||||
virtual DrawTargetType GetType() const override { return mA->GetType(); }
|
||||
virtual BackendType GetBackendType() const override { return mA->GetBackendType(); }
|
||||
virtual TemporaryRef<SourceSurface> Snapshot() override {
|
||||
virtual already_AddRefed<SourceSurface> Snapshot() override {
|
||||
return MakeAndAddRef<SourceSurfaceDual>(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<SourceSurface>
|
||||
virtual already_AddRefed<SourceSurface>
|
||||
CreateSourceSurfaceFromData(unsigned char *aData,
|
||||
const IntSize &aSize,
|
||||
int32_t aStride,
|
||||
|
@ -114,26 +114,26 @@ public:
|
|||
return mA->CreateSourceSurfaceFromData(aData, aSize, aStride, aFormat);
|
||||
}
|
||||
|
||||
virtual TemporaryRef<SourceSurface> OptimizeSourceSurface(SourceSurface *aSurface) const override
|
||||
virtual already_AddRefed<SourceSurface> OptimizeSourceSurface(SourceSurface *aSurface) const override
|
||||
{
|
||||
return mA->OptimizeSourceSurface(aSurface);
|
||||
}
|
||||
|
||||
virtual TemporaryRef<SourceSurface>
|
||||
virtual already_AddRefed<SourceSurface>
|
||||
CreateSourceSurfaceFromNativeSurface(const NativeSurface &aSurface) const override
|
||||
{
|
||||
return mA->CreateSourceSurfaceFromNativeSurface(aSurface);
|
||||
}
|
||||
|
||||
virtual TemporaryRef<DrawTarget>
|
||||
virtual already_AddRefed<DrawTarget>
|
||||
CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aFormat) const override;
|
||||
|
||||
virtual TemporaryRef<PathBuilder> CreatePathBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const override
|
||||
virtual already_AddRefed<PathBuilder> CreatePathBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const override
|
||||
{
|
||||
return mA->CreatePathBuilder(aFillRule);
|
||||
}
|
||||
|
||||
virtual TemporaryRef<GradientStops>
|
||||
virtual already_AddRefed<GradientStops>
|
||||
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<FilterNode> CreateFilter(FilterType aType) override
|
||||
virtual already_AddRefed<FilterNode> CreateFilter(FilterType aType) override
|
||||
{
|
||||
return mA->CreateFilter(aType);
|
||||
}
|
||||
|
|
|
@ -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<DataSourceSurface> GetDataSurface() { return mFinalSurface->GetDataSurface(); }
|
||||
virtual already_AddRefed<DataSourceSurface> GetDataSurface() { return mFinalSurface->GetDataSurface(); }
|
||||
|
||||
RefPtr<SourceSurface> mFinalSurface;
|
||||
RefPtr<DrawEventRecorderPrivate> mRecorder;
|
||||
|
@ -365,7 +365,7 @@ DrawTargetRecording::Stroke(const Path *aPath,
|
|||
mFinalDT->Stroke(GetPathForPathRecording(aPath), *AdjustedPattern(aPattern), aStrokeOptions, aOptions);
|
||||
}
|
||||
|
||||
TemporaryRef<SourceSurface>
|
||||
already_AddRefed<SourceSurface>
|
||||
DrawTargetRecording::Snapshot()
|
||||
{
|
||||
RefPtr<SourceSurface> surf = mFinalDT->Snapshot();
|
||||
|
@ -410,7 +410,7 @@ DrawTargetRecording::DrawFilter(FilterNode *aNode,
|
|||
mFinalDT->DrawFilter(GetFilterNode(aNode), aSourceRect, aDestPoint, aOptions);
|
||||
}
|
||||
|
||||
TemporaryRef<FilterNode>
|
||||
already_AddRefed<FilterNode>
|
||||
DrawTargetRecording::CreateFilter(FilterType aType)
|
||||
{
|
||||
RefPtr<FilterNode> node = mFinalDT->CreateFilter(aType);
|
||||
|
@ -461,7 +461,7 @@ DrawTargetRecording::PopClip()
|
|||
mFinalDT->PopClip();
|
||||
}
|
||||
|
||||
TemporaryRef<SourceSurface>
|
||||
already_AddRefed<SourceSurface>
|
||||
DrawTargetRecording::CreateSourceSurfaceFromData(unsigned char *aData,
|
||||
const IntSize &aSize,
|
||||
int32_t aStride,
|
||||
|
@ -476,7 +476,7 @@ DrawTargetRecording::CreateSourceSurfaceFromData(unsigned char *aData,
|
|||
return retSurf.forget();
|
||||
}
|
||||
|
||||
TemporaryRef<SourceSurface>
|
||||
already_AddRefed<SourceSurface>
|
||||
DrawTargetRecording::OptimizeSourceSurface(SourceSurface *aSurface) const
|
||||
{
|
||||
RefPtr<SourceSurface> surf = mFinalDT->OptimizeSourceSurface(aSurface);
|
||||
|
@ -509,7 +509,7 @@ DrawTargetRecording::OptimizeSourceSurface(SourceSurface *aSurface) const
|
|||
return retSurf.forget();
|
||||
}
|
||||
|
||||
TemporaryRef<SourceSurface>
|
||||
already_AddRefed<SourceSurface>
|
||||
DrawTargetRecording::CreateSourceSurfaceFromNativeSurface(const NativeSurface &aSurface) const
|
||||
{
|
||||
RefPtr<SourceSurface> surf = mFinalDT->CreateSourceSurfaceFromNativeSurface(aSurface);
|
||||
|
@ -537,21 +537,21 @@ DrawTargetRecording::CreateSourceSurfaceFromNativeSurface(const NativeSurface &a
|
|||
return retSurf.forget();
|
||||
}
|
||||
|
||||
TemporaryRef<DrawTarget>
|
||||
already_AddRefed<DrawTarget>
|
||||
DrawTargetRecording::CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aFormat) const
|
||||
{
|
||||
RefPtr<DrawTarget> dt = mFinalDT->CreateSimilarDrawTarget(aSize, aFormat);
|
||||
return MakeAndAddRef<DrawTargetRecording>(mRecorder.get(), dt);
|
||||
}
|
||||
|
||||
TemporaryRef<PathBuilder>
|
||||
already_AddRefed<PathBuilder>
|
||||
DrawTargetRecording::CreatePathBuilder(FillRule aFillRule) const
|
||||
{
|
||||
RefPtr<PathBuilder> builder = mFinalDT->CreatePathBuilder(aFillRule);
|
||||
return MakeAndAddRef<PathBuilderRecording>(builder, aFillRule);
|
||||
}
|
||||
|
||||
TemporaryRef<GradientStops>
|
||||
already_AddRefed<GradientStops>
|
||||
DrawTargetRecording::CreateGradientStops(GradientStop *aStops,
|
||||
uint32_t aNumStops,
|
||||
ExtendMode aExtendMode) const
|
||||
|
|
|
@ -22,7 +22,7 @@ public:
|
|||
virtual DrawTargetType GetType() const override { return mFinalDT->GetType(); }
|
||||
virtual BackendType GetBackendType() const override { return mFinalDT->GetBackendType(); }
|
||||
|
||||
virtual TemporaryRef<SourceSurface> Snapshot() override;
|
||||
virtual already_AddRefed<SourceSurface> 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<SourceSurface> CreateSourceSurfaceFromData(unsigned char *aData,
|
||||
virtual already_AddRefed<SourceSurface> 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<SourceSurface> OptimizeSourceSurface(SourceSurface *aSurface) const override;
|
||||
virtual already_AddRefed<SourceSurface> 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<SourceSurface>
|
||||
virtual already_AddRefed<SourceSurface>
|
||||
CreateSourceSurfaceFromNativeSurface(const NativeSurface &aSurface) const override;
|
||||
|
||||
/*
|
||||
* Create a DrawTarget whose snapshot is optimized for use with this DrawTarget.
|
||||
*/
|
||||
virtual TemporaryRef<DrawTarget>
|
||||
virtual already_AddRefed<DrawTarget>
|
||||
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<PathBuilder> CreatePathBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const override;
|
||||
virtual already_AddRefed<PathBuilder> 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<GradientStops>
|
||||
virtual already_AddRefed<GradientStops>
|
||||
CreateGradientStops(GradientStop *aStops,
|
||||
uint32_t aNumStops,
|
||||
ExtendMode aExtendMode = ExtendMode::CLAMP) const override;
|
||||
|
||||
virtual TemporaryRef<FilterNode> CreateFilter(FilterType aType) override;
|
||||
virtual already_AddRefed<FilterNode> CreateFilter(FilterType aType) override;
|
||||
|
||||
/*
|
||||
* Set a transform on the surface, this transform is applied at drawing time
|
||||
|
|
|
@ -134,7 +134,7 @@ DrawTargetSkia::~DrawTargetSkia()
|
|||
{
|
||||
}
|
||||
|
||||
TemporaryRef<SourceSurface>
|
||||
already_AddRefed<SourceSurface>
|
||||
DrawTargetSkia::Snapshot()
|
||||
{
|
||||
RefPtr<SourceSurfaceSkia> snapshot = mSnapshot;
|
||||
|
@ -664,7 +664,7 @@ DrawTargetSkia::MaskSurface(const Pattern &aSource,
|
|||
}
|
||||
}
|
||||
|
||||
TemporaryRef<SourceSurface>
|
||||
already_AddRefed<SourceSurface>
|
||||
DrawTargetSkia::CreateSourceSurfaceFromData(unsigned char *aData,
|
||||
const IntSize &aSize,
|
||||
int32_t aStride,
|
||||
|
@ -680,7 +680,7 @@ DrawTargetSkia::CreateSourceSurfaceFromData(unsigned char *aData,
|
|||
return newSurf.forget();
|
||||
}
|
||||
|
||||
TemporaryRef<DrawTarget>
|
||||
already_AddRefed<DrawTarget>
|
||||
DrawTargetSkia::CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aFormat) const
|
||||
{
|
||||
RefPtr<DrawTargetSkia> target = new DrawTargetSkia();
|
||||
|
@ -700,7 +700,7 @@ DrawTargetSkia::UsingSkiaGPU() const
|
|||
#endif
|
||||
}
|
||||
|
||||
TemporaryRef<SourceSurface>
|
||||
already_AddRefed<SourceSurface>
|
||||
DrawTargetSkia::OptimizeSourceSurface(SourceSurface *aSurface) const
|
||||
{
|
||||
if (aSurface->GetType() == SurfaceType::SKIA) {
|
||||
|
@ -732,7 +732,7 @@ DrawTargetSkia::OptimizeSourceSurface(SourceSurface *aSurface) const
|
|||
return result.forget();
|
||||
}
|
||||
|
||||
TemporaryRef<SourceSurface>
|
||||
already_AddRefed<SourceSurface>
|
||||
DrawTargetSkia::CreateSourceSurfaceFromNativeSurface(const NativeSurface &aSurface) const
|
||||
{
|
||||
if (aSurface.mType == NativeSurfaceType::CAIRO_SURFACE) {
|
||||
|
@ -926,7 +926,7 @@ DrawTargetSkia::GetNativeSurface(NativeSurfaceType aType)
|
|||
}
|
||||
|
||||
|
||||
TemporaryRef<PathBuilder>
|
||||
already_AddRefed<PathBuilder>
|
||||
DrawTargetSkia::CreatePathBuilder(FillRule aFillRule) const
|
||||
{
|
||||
return MakeAndAddRef<PathBuilderSkia>(aFillRule);
|
||||
|
@ -972,7 +972,7 @@ DrawTargetSkia::PopClip()
|
|||
mCanvas->restore();
|
||||
}
|
||||
|
||||
TemporaryRef<GradientStops>
|
||||
already_AddRefed<GradientStops>
|
||||
DrawTargetSkia::CreateGradientStops(GradientStop *aStops, uint32_t aNumStops, ExtendMode aExtendMode) const
|
||||
{
|
||||
std::vector<GradientStop> stops;
|
||||
|
@ -985,7 +985,7 @@ DrawTargetSkia::CreateGradientStops(GradientStop *aStops, uint32_t aNumStops, Ex
|
|||
return MakeAndAddRef<GradientStopsSkia>(stops, aNumStops, aExtendMode);
|
||||
}
|
||||
|
||||
TemporaryRef<FilterNode>
|
||||
already_AddRefed<FilterNode>
|
||||
DrawTargetSkia::CreateFilter(FilterType aType)
|
||||
{
|
||||
return FilterNodeSoftware::Create(aType);
|
||||
|
|
|
@ -34,7 +34,7 @@ public:
|
|||
|
||||
virtual DrawTargetType GetType() const override;
|
||||
virtual BackendType GetBackendType() const override { return BackendType::SKIA; }
|
||||
virtual TemporaryRef<SourceSurface> Snapshot() override;
|
||||
virtual already_AddRefed<SourceSurface> 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<SourceSurface> CreateSourceSurfaceFromData(unsigned char *aData,
|
||||
virtual already_AddRefed<SourceSurface> CreateSourceSurfaceFromData(unsigned char *aData,
|
||||
const IntSize &aSize,
|
||||
int32_t aStride,
|
||||
SurfaceFormat aFormat) const override;
|
||||
virtual TemporaryRef<SourceSurface> OptimizeSourceSurface(SourceSurface *aSurface) const override;
|
||||
virtual TemporaryRef<SourceSurface>
|
||||
virtual already_AddRefed<SourceSurface> OptimizeSourceSurface(SourceSurface *aSurface) const override;
|
||||
virtual already_AddRefed<SourceSurface>
|
||||
CreateSourceSurfaceFromNativeSurface(const NativeSurface &aSurface) const override;
|
||||
virtual TemporaryRef<DrawTarget>
|
||||
virtual already_AddRefed<DrawTarget>
|
||||
CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aFormat) const override;
|
||||
virtual TemporaryRef<PathBuilder> CreatePathBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const override;
|
||||
virtual TemporaryRef<GradientStops> CreateGradientStops(GradientStop *aStops, uint32_t aNumStops, ExtendMode aExtendMode = ExtendMode::CLAMP) const override;
|
||||
virtual TemporaryRef<FilterNode> CreateFilter(FilterType aType) override;
|
||||
virtual already_AddRefed<PathBuilder> CreatePathBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const override;
|
||||
virtual already_AddRefed<GradientStops> CreateGradientStops(GradientStop *aStops, uint32_t aNumStops, ExtendMode aExtendMode = ExtendMode::CLAMP) const override;
|
||||
virtual already_AddRefed<FilterNode> CreateFilter(FilterType aType) override;
|
||||
virtual void SetTransform(const Matrix &aTransform) override;
|
||||
virtual void *GetNativeSurface(NativeSurfaceType aType) override;
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ DrawTargetTiled::Init(const TileSet& aTiles)
|
|||
return true;
|
||||
}
|
||||
|
||||
TemporaryRef<SourceSurface>
|
||||
already_AddRefed<SourceSurface>
|
||||
DrawTargetTiled::Snapshot()
|
||||
{
|
||||
return MakeAndAddRef<SnapshotTiled>(mTiles, mRect);
|
||||
|
|
|
@ -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<SourceSurface> Snapshot() override;
|
||||
virtual already_AddRefed<SourceSurface> 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<SourceSurface> CreateSourceSurfaceFromData(unsigned char *aData,
|
||||
virtual already_AddRefed<SourceSurface> 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<SourceSurface> OptimizeSourceSurface(SourceSurface *aSurface) const override
|
||||
virtual already_AddRefed<SourceSurface> OptimizeSourceSurface(SourceSurface *aSurface) const override
|
||||
{
|
||||
return mTiles[0].mDrawTarget->OptimizeSourceSurface(aSurface);
|
||||
}
|
||||
|
||||
virtual TemporaryRef<SourceSurface>
|
||||
virtual already_AddRefed<SourceSurface>
|
||||
CreateSourceSurfaceFromNativeSurface(const NativeSurface &aSurface) const override
|
||||
{
|
||||
return mTiles[0].mDrawTarget->CreateSourceSurfaceFromNativeSurface(aSurface);
|
||||
}
|
||||
|
||||
virtual TemporaryRef<DrawTarget>
|
||||
virtual already_AddRefed<DrawTarget>
|
||||
CreateSimilarDrawTarget(const IntSize &aSize, SurfaceFormat aFormat) const override
|
||||
{
|
||||
return mTiles[0].mDrawTarget->CreateSimilarDrawTarget(aSize, aFormat);
|
||||
}
|
||||
|
||||
virtual TemporaryRef<PathBuilder> CreatePathBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const override
|
||||
virtual already_AddRefed<PathBuilder> CreatePathBuilder(FillRule aFillRule = FillRule::FILL_WINDING) const override
|
||||
{
|
||||
return mTiles[0].mDrawTarget->CreatePathBuilder(aFillRule);
|
||||
}
|
||||
|
||||
virtual TemporaryRef<GradientStops>
|
||||
virtual already_AddRefed<GradientStops>
|
||||
CreateGradientStops(GradientStop *aStops,
|
||||
uint32_t aNumStops,
|
||||
ExtendMode aExtendMode = ExtendMode::CLAMP) const override
|
||||
{
|
||||
return mTiles[0].mDrawTarget->CreateGradientStops(aStops, aNumStops, aExtendMode);
|
||||
}
|
||||
virtual TemporaryRef<FilterNode> CreateFilter(FilterType aType) override
|
||||
virtual already_AddRefed<FilterNode> 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<DataSourceSurface> GetDataSurface()
|
||||
virtual already_AddRefed<DataSourceSurface> GetDataSurface()
|
||||
{
|
||||
RefPtr<DataSourceSurface> surf = Factory::CreateDataSourceSurface(GetSize(), GetFormat());
|
||||
|
||||
|
|
|
@ -268,7 +268,7 @@ Factory::CheckSurfaceSize(const IntSize &sz, int32_t limit)
|
|||
return true;
|
||||
}
|
||||
|
||||
TemporaryRef<DrawTarget>
|
||||
already_AddRefed<DrawTarget>
|
||||
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<DrawTarget>
|
||||
already_AddRefed<DrawTarget>
|
||||
Factory::CreateRecordingDrawTarget(DrawEventRecorder *aRecorder, DrawTarget *aDT)
|
||||
{
|
||||
return MakeAndAddRef<DrawTargetRecording>(aRecorder, aDT);
|
||||
}
|
||||
|
||||
TemporaryRef<DrawTarget>
|
||||
already_AddRefed<DrawTarget>
|
||||
Factory::CreateDrawTargetForData(BackendType aBackend,
|
||||
unsigned char *aData,
|
||||
const IntSize &aSize,
|
||||
|
@ -416,7 +416,7 @@ Factory::CreateDrawTargetForData(BackendType aBackend,
|
|||
return retVal.forget();
|
||||
}
|
||||
|
||||
TemporaryRef<DrawTarget>
|
||||
already_AddRefed<DrawTarget>
|
||||
Factory::CreateTiledDrawTarget(const TileSet& aTileSet)
|
||||
{
|
||||
RefPtr<DrawTargetTiled> dt = new DrawTargetTiled();
|
||||
|
@ -471,7 +471,7 @@ Factory::GetMaxSurfaceSize(BackendType aType)
|
|||
}
|
||||
}
|
||||
|
||||
TemporaryRef<ScaledFont>
|
||||
already_AddRefed<ScaledFont>
|
||||
Factory::CreateScaledFontForNativeFont(const NativeFont &aNativeFont, Float aSize)
|
||||
{
|
||||
switch (aNativeFont.mType) {
|
||||
|
@ -505,7 +505,7 @@ Factory::CreateScaledFontForNativeFont(const NativeFont &aNativeFont, Float aSiz
|
|||
}
|
||||
}
|
||||
|
||||
TemporaryRef<ScaledFont>
|
||||
already_AddRefed<ScaledFont>
|
||||
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<ScaledFont>
|
||||
already_AddRefed<ScaledFont>
|
||||
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<DrawTarget>
|
||||
already_AddRefed<DrawTarget>
|
||||
Factory::CreateDualDrawTarget(DrawTarget *targetA, DrawTarget *targetB)
|
||||
{
|
||||
MOZ_ASSERT(targetA && targetB);
|
||||
|
@ -558,7 +558,7 @@ Factory::CreateDualDrawTarget(DrawTarget *targetA, DrawTarget *targetB)
|
|||
|
||||
|
||||
#ifdef WIN32
|
||||
TemporaryRef<DrawTarget>
|
||||
already_AddRefed<DrawTarget>
|
||||
Factory::CreateDrawTargetForD3D10Texture(ID3D10Texture2D *aTexture, SurfaceFormat aFormat)
|
||||
{
|
||||
MOZ_ASSERT(aTexture);
|
||||
|
@ -582,7 +582,7 @@ Factory::CreateDrawTargetForD3D10Texture(ID3D10Texture2D *aTexture, SurfaceForma
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
TemporaryRef<DrawTarget>
|
||||
already_AddRefed<DrawTarget>
|
||||
Factory::CreateDualDrawTargetForD3D10Textures(ID3D10Texture2D *aTextureA,
|
||||
ID3D10Texture2D *aTextureB,
|
||||
SurfaceFormat aFormat)
|
||||
|
@ -637,7 +637,7 @@ Factory::GetDirect3D10Device()
|
|||
return mD3D10Device;
|
||||
}
|
||||
|
||||
TemporaryRef<DrawTarget>
|
||||
already_AddRefed<DrawTarget>
|
||||
Factory::CreateDrawTargetForD3D11Texture(ID3D11Texture2D *aTexture, SurfaceFormat aFormat)
|
||||
{
|
||||
MOZ_ASSERT(aTexture);
|
||||
|
@ -703,7 +703,7 @@ Factory::SupportsD2D1()
|
|||
return !!D2DFactory1();
|
||||
}
|
||||
|
||||
TemporaryRef<GlyphRenderingOptions>
|
||||
already_AddRefed<GlyphRenderingOptions>
|
||||
Factory::CreateDWriteGlyphRenderingOptions(IDWriteRenderingParams *aParams)
|
||||
{
|
||||
return MakeAndAddRef<GlyphRenderingOptionsDWrite>(aParams);
|
||||
|
@ -735,7 +735,7 @@ Factory::D2DCleanup()
|
|||
#endif // XP_WIN
|
||||
|
||||
#ifdef USE_SKIA_GPU
|
||||
TemporaryRef<DrawTarget>
|
||||
already_AddRefed<DrawTarget>
|
||||
Factory::CreateDrawTargetSkiaWithGrContext(GrContext* aGrContext,
|
||||
const IntSize &aSize,
|
||||
SurfaceFormat aFormat)
|
||||
|
@ -755,7 +755,7 @@ Factory::PurgeAllCaches()
|
|||
}
|
||||
|
||||
#ifdef USE_SKIA_FREETYPE
|
||||
TemporaryRef<GlyphRenderingOptions>
|
||||
already_AddRefed<GlyphRenderingOptions>
|
||||
Factory::CreateCairoGlyphRenderingOptions(FontHinting aHinting, bool aAutoHinting)
|
||||
{
|
||||
RefPtr<GlyphRenderingOptionsCairo> options =
|
||||
|
@ -767,7 +767,7 @@ Factory::CreateCairoGlyphRenderingOptions(FontHinting aHinting, bool aAutoHintin
|
|||
}
|
||||
#endif
|
||||
|
||||
TemporaryRef<DrawTarget>
|
||||
already_AddRefed<DrawTarget>
|
||||
Factory::CreateDrawTargetForCairoSurface(cairo_surface_t* aSurface, const IntSize& aSize, SurfaceFormat* aFormat)
|
||||
{
|
||||
RefPtr<DrawTarget> retVal;
|
||||
|
@ -787,7 +787,7 @@ Factory::CreateDrawTargetForCairoSurface(cairo_surface_t* aSurface, const IntSiz
|
|||
}
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
TemporaryRef<DrawTarget>
|
||||
already_AddRefed<DrawTarget>
|
||||
Factory::CreateDrawTargetForCairoCGContext(CGContextRef cg, const IntSize& aSize)
|
||||
{
|
||||
RefPtr<DrawTarget> retVal;
|
||||
|
@ -804,14 +804,14 @@ Factory::CreateDrawTargetForCairoCGContext(CGContextRef cg, const IntSize& aSize
|
|||
return retVal.forget();
|
||||
}
|
||||
|
||||
TemporaryRef<GlyphRenderingOptions>
|
||||
already_AddRefed<GlyphRenderingOptions>
|
||||
Factory::CreateCGGlyphRenderingOptions(const Color &aFontSmoothingBackgroundColor)
|
||||
{
|
||||
return MakeAndAddRef<GlyphRenderingOptionsCG>(aFontSmoothingBackgroundColor);
|
||||
}
|
||||
#endif
|
||||
|
||||
TemporaryRef<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
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<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
Factory::CreateDataSourceSurface(const IntSize &aSize,
|
||||
SurfaceFormat aFormat,
|
||||
bool aZero)
|
||||
|
@ -849,7 +849,7 @@ Factory::CreateDataSourceSurface(const IntSize &aSize,
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
TemporaryRef<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
Factory::CreateDataSourceSurfaceWithStride(const IntSize &aSize,
|
||||
SurfaceFormat aFormat,
|
||||
int32_t aStride,
|
||||
|
@ -869,7 +869,7 @@ Factory::CreateDataSourceSurfaceWithStride(const IntSize &aSize,
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
TemporaryRef<DrawEventRecorder>
|
||||
already_AddRefed<DrawEventRecorder>
|
||||
Factory::CreateEventRecorderForFile(const char *aFilename)
|
||||
{
|
||||
return MakeAndAddRef<DrawEventRecorderFile>(aFilename);
|
||||
|
|
|
@ -150,7 +150,7 @@ D2D1_CHANNEL_SELECTOR D2DChannelSelector(uint32_t aMode)
|
|||
return D2D1_CHANNEL_SELECTOR_R;
|
||||
}
|
||||
|
||||
TemporaryRef<ID2D1Image> GetImageForSourceSurface(DrawTarget *aDT, SourceSurface *aSurface)
|
||||
already_AddRefed<ID2D1Image> 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<FilterNode>
|
||||
already_AddRefed<FilterNode>
|
||||
FilterNodeD2D1::Create(ID2D1DeviceContext *aDC, FilterType aType)
|
||||
{
|
||||
if (aType == FilterType::CONVOLVE_MATRIX) {
|
||||
|
|
|
@ -19,7 +19,7 @@ class FilterNodeD2D1 : public FilterNode
|
|||
{
|
||||
public:
|
||||
MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(FilterNodeD2D1)
|
||||
static TemporaryRef<FilterNode> Create(ID2D1DeviceContext *aDC, FilterType aType);
|
||||
static already_AddRefed<FilterNode> Create(ID2D1DeviceContext *aDC, FilterType aType);
|
||||
|
||||
FilterNodeD2D1(ID2D1Effect *aEffect, FilterType aType)
|
||||
: mEffect(aEffect)
|
||||
|
|
|
@ -180,7 +180,7 @@ NS_lround(double x)
|
|||
return x >= 0.0 ? int32_t(x + 0.5) : int32_t(x - 0.5);
|
||||
}
|
||||
|
||||
TemporaryRef<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
CloneAligned(DataSourceSurface* aSource)
|
||||
{
|
||||
return CreateDataSourceSurfaceByCloning(aSource);
|
||||
|
@ -393,7 +393,7 @@ TileSurface(DataSourceSurface* aSource, DataSourceSurface* aTarget, const IntPoi
|
|||
}
|
||||
}
|
||||
|
||||
static TemporaryRef<DataSourceSurface>
|
||||
static already_AddRefed<DataSourceSurface>
|
||||
GetDataSurfaceInRect(SourceSurface *aSurface,
|
||||
const IntRect &aSurfaceRect,
|
||||
const IntRect &aDestRect,
|
||||
|
@ -446,7 +446,7 @@ GetDataSurfaceInRect(SourceSurface *aSurface,
|
|||
return target.forget();
|
||||
}
|
||||
|
||||
/* static */ TemporaryRef<FilterNode>
|
||||
/* static */ already_AddRefed<FilterNode>
|
||||
FilterNodeSoftware::Create(FilterType aType)
|
||||
{
|
||||
RefPtr<FilterNodeSoftware> filter;
|
||||
|
@ -601,7 +601,7 @@ FilterNodeSoftware::Draw(DrawTarget* aDrawTarget,
|
|||
}
|
||||
}
|
||||
|
||||
TemporaryRef<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
FilterNodeSoftware::GetOutput(const IntRect &aRect)
|
||||
{
|
||||
MOZ_ASSERT(GetOutputRectInRect(aRect).Contains(aRect));
|
||||
|
@ -662,7 +662,7 @@ FilterNodeSoftware::DesiredFormat(SurfaceFormat aCurrentFormat,
|
|||
return SurfaceFormat::B8G8R8A8;
|
||||
}
|
||||
|
||||
TemporaryRef<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
FilterNodeSoftware::GetInputDataSourceSurface(uint32_t aInputEnumIndex,
|
||||
const IntRect& aRect,
|
||||
FormatHint aFormatHint,
|
||||
|
@ -961,7 +961,7 @@ static CompositionOp ToBlendOp(BlendMode aOp)
|
|||
return CompositionOp::OP_OVER;
|
||||
}
|
||||
|
||||
TemporaryRef<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
FilterNodeBlendSoftware::Render(const IntRect& aRect)
|
||||
{
|
||||
RefPtr<DataSourceSurface> input1 =
|
||||
|
@ -1086,7 +1086,7 @@ FilterNodeTransformSoftware::SourceRectForOutputRect(const IntRect &aRect)
|
|||
return GetInputRectInRect(IN_TRANSFORM_IN, neededIntRect);
|
||||
}
|
||||
|
||||
TemporaryRef<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
FilterNodeTransformSoftware::Render(const IntRect& aRect)
|
||||
{
|
||||
IntRect srcRect = SourceRectForOutputRect(aRect);
|
||||
|
@ -1192,7 +1192,7 @@ FilterNodeMorphologySoftware::SetAttribute(uint32_t aIndex,
|
|||
Invalidate();
|
||||
}
|
||||
|
||||
static TemporaryRef<DataSourceSurface>
|
||||
static already_AddRefed<DataSourceSurface>
|
||||
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<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
FilterNodeMorphologySoftware::Render(const IntRect& aRect)
|
||||
{
|
||||
IntRect srcRect = aRect;
|
||||
|
@ -1327,7 +1327,7 @@ FilterNodeColorMatrixSoftware::SetAttribute(uint32_t aIndex,
|
|||
Invalidate();
|
||||
}
|
||||
|
||||
static TemporaryRef<DataSourceSurface>
|
||||
static already_AddRefed<DataSourceSurface>
|
||||
Premultiply(DataSourceSurface* aSurface)
|
||||
{
|
||||
if (aSurface->GetFormat() == SurfaceFormat::A8) {
|
||||
|
@ -1359,7 +1359,7 @@ Premultiply(DataSourceSurface* aSurface)
|
|||
return target.forget();
|
||||
}
|
||||
|
||||
static TemporaryRef<DataSourceSurface>
|
||||
static already_AddRefed<DataSourceSurface>
|
||||
Unpremultiply(DataSourceSurface* aSurface)
|
||||
{
|
||||
if (aSurface->GetFormat() == SurfaceFormat::A8) {
|
||||
|
@ -1391,7 +1391,7 @@ Unpremultiply(DataSourceSurface* aSurface)
|
|||
return target.forget();
|
||||
}
|
||||
|
||||
TemporaryRef<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
FilterNodeColorMatrixSoftware::Render(const IntRect& aRect)
|
||||
{
|
||||
RefPtr<DataSourceSurface> input =
|
||||
|
@ -1460,7 +1460,7 @@ FormatForColor(Color aColor)
|
|||
return SurfaceFormat::B8G8R8A8;
|
||||
}
|
||||
|
||||
TemporaryRef<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
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<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
FilterNodeFloodSoftware::GetOutput(const IntRect& aRect)
|
||||
{
|
||||
return Render(aRect);
|
||||
|
@ -1556,7 +1556,7 @@ struct CompareIntRects
|
|||
};
|
||||
}
|
||||
|
||||
TemporaryRef<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
FilterNodeTileSoftware::Render(const IntRect& aRect)
|
||||
{
|
||||
if (mSourceRect.IsEmpty()) {
|
||||
|
@ -1728,7 +1728,7 @@ IsAllZero(uint8_t aLookupTable[256])
|
|||
return true;
|
||||
}
|
||||
|
||||
TemporaryRef<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
FilterNodeComponentTransferSoftware::Render(const IntRect& aRect)
|
||||
{
|
||||
if (mDisableR && mDisableG && mDisableB && mDisableA) {
|
||||
|
@ -2342,7 +2342,7 @@ ConvolvePixel(const uint8_t *aSourceData,
|
|||
}
|
||||
}
|
||||
|
||||
TemporaryRef<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
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<typename CoordType>
|
||||
TemporaryRef<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
FilterNodeConvolveMatrixSoftware::DoRender(const IntRect& aRect,
|
||||
CoordType aKernelUnitLengthX,
|
||||
CoordType aKernelUnitLengthY)
|
||||
|
@ -2580,7 +2580,7 @@ FilterNodeDisplacementMapSoftware::SetAttribute(uint32_t aIndex, uint32_t aValue
|
|||
Invalidate();
|
||||
}
|
||||
|
||||
TemporaryRef<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
FilterNodeDisplacementMapSoftware::Render(const IntRect& aRect)
|
||||
{
|
||||
IntRect srcRect = InflatedSourceOrDestRect(aRect);
|
||||
|
@ -2729,7 +2729,7 @@ FilterNodeTurbulenceSoftware::SetAttribute(uint32_t aIndex, uint32_t aValue)
|
|||
Invalidate();
|
||||
}
|
||||
|
||||
TemporaryRef<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
FilterNodeTurbulenceSoftware::Render(const IntRect& aRect)
|
||||
{
|
||||
return FilterProcessing::RenderTurbulence(
|
||||
|
@ -2774,7 +2774,7 @@ FilterNodeArithmeticCombineSoftware::SetAttribute(uint32_t aIndex,
|
|||
Invalidate();
|
||||
}
|
||||
|
||||
TemporaryRef<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
FilterNodeArithmeticCombineSoftware::Render(const IntRect& aRect)
|
||||
{
|
||||
RefPtr<DataSourceSurface> input1 =
|
||||
|
@ -2848,7 +2848,7 @@ FilterNodeCompositeSoftware::SetAttribute(uint32_t aIndex, uint32_t aCompositeOp
|
|||
Invalidate();
|
||||
}
|
||||
|
||||
TemporaryRef<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
FilterNodeCompositeSoftware::Render(const IntRect& aRect)
|
||||
{
|
||||
RefPtr<DataSourceSurface> start =
|
||||
|
@ -2924,7 +2924,7 @@ FilterNodeBlurXYSoftware::InputIndex(uint32_t aInputEnumIndex)
|
|||
}
|
||||
}
|
||||
|
||||
TemporaryRef<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
FilterNodeBlurXYSoftware::Render(const IntRect& aRect)
|
||||
{
|
||||
Size sigmaXY = StdDeviationXY();
|
||||
|
@ -3102,7 +3102,7 @@ FilterNodeCropSoftware::SetAttribute(uint32_t aIndex,
|
|||
Invalidate();
|
||||
}
|
||||
|
||||
TemporaryRef<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
FilterNodeCropSoftware::Render(const IntRect& aRect)
|
||||
{
|
||||
return GetInputDataSourceSurface(IN_CROP_IN, aRect.Intersect(mCropRect));
|
||||
|
@ -3129,7 +3129,7 @@ FilterNodePremultiplySoftware::InputIndex(uint32_t aInputEnumIndex)
|
|||
}
|
||||
}
|
||||
|
||||
TemporaryRef<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
FilterNodePremultiplySoftware::Render(const IntRect& aRect)
|
||||
{
|
||||
RefPtr<DataSourceSurface> input =
|
||||
|
@ -3158,7 +3158,7 @@ FilterNodeUnpremultiplySoftware::InputIndex(uint32_t aInputEnumIndex)
|
|||
}
|
||||
}
|
||||
|
||||
TemporaryRef<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
FilterNodeUnpremultiplySoftware::Render(const IntRect& aRect)
|
||||
{
|
||||
RefPtr<DataSourceSurface> input =
|
||||
|
@ -3438,7 +3438,7 @@ GenerateNormal(const uint8_t *data, int32_t stride,
|
|||
}
|
||||
|
||||
template<typename LightType, typename LightingType>
|
||||
TemporaryRef<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
FilterNodeLightingSoftware<LightType, LightingType>::Render(const IntRect& aRect)
|
||||
{
|
||||
if (mKernelUnitLength.width == floor(mKernelUnitLength.width) &&
|
||||
|
@ -3459,7 +3459,7 @@ FilterNodeLightingSoftware<LightType, LightingType>::RequestFromInputsForRect(co
|
|||
}
|
||||
|
||||
template<typename LightType, typename LightingType> template<typename CoordType>
|
||||
TemporaryRef<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
FilterNodeLightingSoftware<LightType, LightingType>::DoRender(const IntRect& aRect,
|
||||
CoordType aKernelUnitLengthX,
|
||||
CoordType aKernelUnitLengthY)
|
||||
|
|
|
@ -42,7 +42,7 @@ public:
|
|||
virtual ~FilterNodeSoftware();
|
||||
|
||||
// Factory method, intended to be called from DrawTarget*::CreateFilter.
|
||||
static TemporaryRef<FilterNode> Create(FilterType aType);
|
||||
static already_AddRefed<FilterNode> 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<DataSourceSurface> Render(const IntRect& aRect) = 0;
|
||||
virtual already_AddRefed<DataSourceSurface> 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<DataSourceSurface> GetOutput(const IntRect &aRect);
|
||||
virtual already_AddRefed<DataSourceSurface> 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<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
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<DataSourceSurface> Render(const IntRect& aRect) override;
|
||||
virtual already_AddRefed<DataSourceSurface> 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<DataSourceSurface> Render(const IntRect& aRect) override;
|
||||
virtual already_AddRefed<DataSourceSurface> 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<DataSourceSurface> Render(const IntRect& aRect) override;
|
||||
virtual already_AddRefed<DataSourceSurface> 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<DataSourceSurface> Render(const IntRect& aRect) override;
|
||||
virtual already_AddRefed<DataSourceSurface> 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<DataSourceSurface> GetOutput(const IntRect &aRect) override;
|
||||
virtual TemporaryRef<DataSourceSurface> Render(const IntRect& aRect) override;
|
||||
virtual already_AddRefed<DataSourceSurface> GetOutput(const IntRect &aRect) override;
|
||||
virtual already_AddRefed<DataSourceSurface> 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<DataSourceSurface> Render(const IntRect& aRect) override;
|
||||
virtual already_AddRefed<DataSourceSurface> 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<DataSourceSurface> Render(const IntRect& aRect) override;
|
||||
virtual already_AddRefed<DataSourceSurface> 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<DataSourceSurface> Render(const IntRect& aRect) override;
|
||||
virtual already_AddRefed<DataSourceSurface> 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<typename CoordType>
|
||||
TemporaryRef<DataSourceSurface> DoRender(const IntRect& aRect,
|
||||
already_AddRefed<DataSourceSurface> 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<DataSourceSurface> Render(const IntRect& aRect) override;
|
||||
virtual already_AddRefed<DataSourceSurface> 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<DataSourceSurface> Render(const IntRect& aRect) override;
|
||||
virtual already_AddRefed<DataSourceSurface> 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<DataSourceSurface> Render(const IntRect& aRect) override;
|
||||
virtual already_AddRefed<DataSourceSurface> 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<DataSourceSurface> Render(const IntRect& aRect) override;
|
||||
virtual already_AddRefed<DataSourceSurface> 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<DataSourceSurface> Render(const IntRect& aRect) override;
|
||||
virtual already_AddRefed<DataSourceSurface> 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<DataSourceSurface> Render(const IntRect& aRect) override;
|
||||
virtual already_AddRefed<DataSourceSurface> 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<DataSourceSurface> Render(const IntRect& aRect) override;
|
||||
virtual already_AddRefed<DataSourceSurface> 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<DataSourceSurface> Render(const IntRect& aRect) override;
|
||||
virtual already_AddRefed<DataSourceSurface> 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<DataSourceSurface> Render(const IntRect& aRect) override;
|
||||
virtual already_AddRefed<DataSourceSurface> 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<typename CoordType>
|
||||
TemporaryRef<DataSourceSurface> DoRender(const IntRect& aRect,
|
||||
already_AddRefed<DataSourceSurface> DoRender(const IntRect& aRect,
|
||||
CoordType aKernelUnitLengthX,
|
||||
CoordType aKernelUnitLengthY);
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
namespace mozilla {
|
||||
namespace gfx {
|
||||
|
||||
TemporaryRef<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
FilterProcessing::ExtractAlpha(DataSourceSurface* aSource)
|
||||
{
|
||||
IntSize size = aSource->GetSize();
|
||||
|
@ -40,7 +40,7 @@ FilterProcessing::ExtractAlpha(DataSourceSurface* aSource)
|
|||
return alpha.forget();
|
||||
}
|
||||
|
||||
TemporaryRef<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
FilterProcessing::ConvertToB8G8R8A8(SourceSurface* aSurface)
|
||||
{
|
||||
if (Factory::HasSSE2()) {
|
||||
|
@ -51,7 +51,7 @@ FilterProcessing::ConvertToB8G8R8A8(SourceSurface* aSurface)
|
|||
return ConvertToB8G8R8A8_Scalar(aSurface);
|
||||
}
|
||||
|
||||
TemporaryRef<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
FilterProcessing::ApplyBlending(DataSourceSurface* aInput1, DataSourceSurface* aInput2,
|
||||
BlendMode aBlendMode)
|
||||
{
|
||||
|
@ -97,7 +97,7 @@ FilterProcessing::ApplyMorphologyVertical(uint8_t* aSourceData, int32_t aSourceS
|
|||
}
|
||||
}
|
||||
|
||||
TemporaryRef<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
FilterProcessing::ApplyColorMatrix(DataSourceSurface* aInput, const Matrix5x4 &aMatrix)
|
||||
{
|
||||
if (Factory::HasSSE2()) {
|
||||
|
@ -164,7 +164,7 @@ FilterProcessing::SeparateColorChannels(DataSourceSurface* aSource,
|
|||
}
|
||||
}
|
||||
|
||||
TemporaryRef<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
FilterProcessing::CombineColorChannels(DataSourceSurface* aChannel0, DataSourceSurface* aChannel1,
|
||||
DataSourceSurface* aChannel2, DataSourceSurface* aChannel3)
|
||||
{
|
||||
|
@ -235,7 +235,7 @@ FilterProcessing::DoUnpremultiplicationCalculation(const IntSize& aSize,
|
|||
}
|
||||
}
|
||||
|
||||
TemporaryRef<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
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<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
FilterProcessing::ApplyArithmeticCombine(DataSourceSurface* aInput1, DataSourceSurface* aInput2, Float aK1, Float aK2, Float aK3, Float aK4)
|
||||
{
|
||||
if (Factory::HasSSE2()) {
|
||||
|
|
|
@ -31,9 +31,9 @@ public:
|
|||
return ((v << 8) + v + 255) >> 16;
|
||||
}
|
||||
|
||||
static TemporaryRef<DataSourceSurface> ExtractAlpha(DataSourceSurface* aSource);
|
||||
static TemporaryRef<DataSourceSurface> ConvertToB8G8R8A8(SourceSurface* aSurface);
|
||||
static TemporaryRef<DataSourceSurface> ApplyBlending(DataSourceSurface* aInput1, DataSourceSurface* aInput2, BlendMode aBlendMode);
|
||||
static already_AddRefed<DataSourceSurface> ExtractAlpha(DataSourceSurface* aSource);
|
||||
static already_AddRefed<DataSourceSurface> ConvertToB8G8R8A8(SourceSurface* aSurface);
|
||||
static already_AddRefed<DataSourceSurface> 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<DataSourceSurface> ApplyColorMatrix(DataSourceSurface* aInput, const Matrix5x4 &aMatrix);
|
||||
static already_AddRefed<DataSourceSurface> ApplyColorMatrix(DataSourceSurface* aInput, const Matrix5x4 &aMatrix);
|
||||
static void ApplyComposition(DataSourceSurface* aSource, DataSourceSurface* aDest, CompositeOperator aOperator);
|
||||
static void SeparateColorChannels(DataSourceSurface* aSource,
|
||||
RefPtr<DataSourceSurface>& aChannel0,
|
||||
RefPtr<DataSourceSurface>& aChannel1,
|
||||
RefPtr<DataSourceSurface>& aChannel2,
|
||||
RefPtr<DataSourceSurface>& aChannel3);
|
||||
static TemporaryRef<DataSourceSurface>
|
||||
static already_AddRefed<DataSourceSurface>
|
||||
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<DataSourceSurface>
|
||||
static already_AddRefed<DataSourceSurface>
|
||||
RenderTurbulence(const IntSize &aSize, const Point &aOffset, const Size &aBaseFrequency,
|
||||
int32_t aSeed, int aNumOctaves, TurbulenceType aType, bool aStitch, const Rect &aTileRect);
|
||||
static TemporaryRef<DataSourceSurface>
|
||||
static already_AddRefed<DataSourceSurface>
|
||||
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<DataSourceSurface> ConvertToB8G8R8A8_Scalar(SourceSurface* aSurface);
|
||||
static already_AddRefed<DataSourceSurface> 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<DataSourceSurface> ApplyColorMatrix_Scalar(DataSourceSurface* aInput, const Matrix5x4 &aMatrix);
|
||||
static already_AddRefed<DataSourceSurface> 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<DataSourceSurface>
|
||||
static already_AddRefed<DataSourceSurface>
|
||||
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<DataSourceSurface>
|
||||
static already_AddRefed<DataSourceSurface>
|
||||
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<DataSourceSurface> ConvertToB8G8R8A8_SSE2(SourceSurface* aSurface);
|
||||
static TemporaryRef<DataSourceSurface> ApplyBlending_SSE2(DataSourceSurface* aInput1, DataSourceSurface* aInput2, BlendMode aBlendMode);
|
||||
static already_AddRefed<DataSourceSurface> ConvertToB8G8R8A8_SSE2(SourceSurface* aSurface);
|
||||
static already_AddRefed<DataSourceSurface> 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<DataSourceSurface> ApplyColorMatrix_SSE2(DataSourceSurface* aInput, const Matrix5x4 &aMatrix);
|
||||
static already_AddRefed<DataSourceSurface> 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<DataSourceSurface>
|
||||
static already_AddRefed<DataSourceSurface>
|
||||
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<DataSourceSurface>
|
||||
static already_AddRefed<DataSourceSurface>
|
||||
ApplyArithmeticCombine_SSE2(DataSourceSurface* aInput1, DataSourceSurface* aInput2, Float aK1, Float aK2, Float aK3, Float aK4);
|
||||
#endif
|
||||
};
|
||||
|
|
|
@ -12,7 +12,7 @@ namespace mozilla {
|
|||
namespace gfx {
|
||||
|
||||
template<typename u8x16_t>
|
||||
inline TemporaryRef<DataSourceSurface>
|
||||
inline already_AddRefed<DataSourceSurface>
|
||||
ConvertToB8G8R8A8_SIMD(SourceSurface* aSurface)
|
||||
{
|
||||
IntSize size = aSurface->GetSize();
|
||||
|
@ -284,7 +284,7 @@ ShuffleAndPackComponents(i32x4_t bbbb1234, i32x4_t gggg1234,
|
|||
}
|
||||
|
||||
template<typename i32x4_t, typename i16x8_t, typename u8x16_t, BlendMode mode>
|
||||
inline TemporaryRef<DataSourceSurface>
|
||||
inline already_AddRefed<DataSourceSurface>
|
||||
ApplyBlending_SIMD(DataSourceSurface* aInput1, DataSourceSurface* aInput2)
|
||||
{
|
||||
IntSize size = aInput1->GetSize();
|
||||
|
@ -338,7 +338,7 @@ ApplyBlending_SIMD(DataSourceSurface* aInput1, DataSourceSurface* aInput2)
|
|||
}
|
||||
|
||||
template<typename i32x4_t, typename i16x8_t, typename u8x16_t>
|
||||
static TemporaryRef<DataSourceSurface>
|
||||
static already_AddRefed<DataSourceSurface>
|
||||
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<typename i32x4_t, typename i16x8_t, typename u8x16_t>
|
||||
static TemporaryRef<DataSourceSurface>
|
||||
static already_AddRefed<DataSourceSurface>
|
||||
ApplyColorMatrix_SIMD(DataSourceSurface* aInput, const Matrix5x4 &aMatrix)
|
||||
{
|
||||
IntSize size = aInput->GetSize();
|
||||
|
@ -953,7 +953,7 @@ DoUnpremultiplicationCalculation_SIMD(const IntSize& aSize,
|
|||
}
|
||||
|
||||
template<typename f32x4_t, typename i32x4_t, typename u8x16_t>
|
||||
static TemporaryRef<DataSourceSurface>
|
||||
static already_AddRefed<DataSourceSurface>
|
||||
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<typename i32x4_t, typename i16x8_t, typename u8x16_t>
|
||||
static TemporaryRef<DataSourceSurface>
|
||||
static already_AddRefed<DataSourceSurface>
|
||||
ApplyArithmeticCombine_SIMD(DataSourceSurface* aInput1, DataSourceSurface* aInput2,
|
||||
Float aK1, Float aK2, Float aK3, Float aK4)
|
||||
{
|
||||
|
|
|
@ -20,13 +20,13 @@ FilterProcessing::ExtractAlpha_SSE2(const IntSize& size, uint8_t* sourceData, in
|
|||
ExtractAlpha_SIMD<__m128i>(size, sourceData, sourceStride, alphaData, alphaStride);
|
||||
}
|
||||
|
||||
TemporaryRef<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
FilterProcessing::ConvertToB8G8R8A8_SSE2(SourceSurface* aSurface)
|
||||
{
|
||||
return ConvertToB8G8R8A8_SIMD<__m128i>(aSurface);
|
||||
}
|
||||
|
||||
TemporaryRef<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
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<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
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<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
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<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
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);
|
||||
|
|
|
@ -23,7 +23,7 @@ FilterProcessing::ExtractAlpha_Scalar(const IntSize& size, uint8_t* sourceData,
|
|||
}
|
||||
}
|
||||
|
||||
TemporaryRef<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
FilterProcessing::ConvertToB8G8R8A8_Scalar(SourceSurface* aSurface)
|
||||
{
|
||||
return ConvertToB8G8R8A8_SIMD<simd::Scalaru8x16_t>(aSurface);
|
||||
|
@ -134,7 +134,7 @@ FilterProcessing::ApplyMorphologyVertical_Scalar(uint8_t* aSourceData, int32_t a
|
|||
}
|
||||
}
|
||||
|
||||
TemporaryRef<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
FilterProcessing::ApplyColorMatrix_Scalar(DataSourceSurface* aInput, const Matrix5x4 &aMatrix)
|
||||
{
|
||||
return ApplyColorMatrix_SIMD<simd::Scalari32x4_t,simd::Scalari16x8_t,simd::Scalaru8x16_t>(aInput, aMatrix);
|
||||
|
@ -226,7 +226,7 @@ FilterProcessing::DoUnpremultiplicationCalculation_Scalar(
|
|||
}
|
||||
}
|
||||
|
||||
TemporaryRef<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
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<DataSourceSurface>
|
||||
already_AddRefed<DataSourceSurface>
|
||||
FilterProcessing::ApplyArithmeticCombine_Scalar(DataSourceSurface* aInput1, DataSourceSurface* aInput2, Float aK1, Float aK2, Float aK3, Float aK4)
|
||||
{
|
||||
return ApplyArithmeticCombine_SIMD<simd::Scalari32x4_t,simd::Scalari16x8_t,simd::Scalaru8x16_t>(aInput1, aInput2, aK1, aK2, aK3, aK4);
|
||||
|
|
|
@ -422,7 +422,7 @@ DWriteGlyphRunFromGlyphs(const GlyphBuffer &aGlyphs, ScaledFontDWrite *aFont, Au
|
|||
run->isSideways = FALSE;
|
||||
}
|
||||
|
||||
static inline TemporaryRef<ID2D1Geometry>
|
||||
static inline already_AddRefed<ID2D1Geometry>
|
||||
ConvertRectToGeometry(const D2D1_RECT_F& aRect)
|
||||
{
|
||||
RefPtr<ID2D1RectangleGeometry> rectGeom;
|
||||
|
@ -430,7 +430,7 @@ ConvertRectToGeometry(const D2D1_RECT_F& aRect)
|
|||
return rectGeom.forget();
|
||||
}
|
||||
|
||||
static inline TemporaryRef<ID2D1Geometry>
|
||||
static inline already_AddRefed<ID2D1Geometry>
|
||||
GetTransformedGeometry(ID2D1Geometry *aGeometry, const D2D1_MATRIX_3X2_F &aTransform)
|
||||
{
|
||||
RefPtr<ID2D1PathGeometry> tmpGeometry;
|
||||
|
@ -443,7 +443,7 @@ GetTransformedGeometry(ID2D1Geometry *aGeometry, const D2D1_MATRIX_3X2_F &aTrans
|
|||
return tmpGeometry.forget();
|
||||
}
|
||||
|
||||
static inline TemporaryRef<ID2D1Geometry>
|
||||
static inline already_AddRefed<ID2D1Geometry>
|
||||
IntersectGeometry(ID2D1Geometry *aGeometryA, ID2D1Geometry *aGeometryB)
|
||||
{
|
||||
RefPtr<ID2D1PathGeometry> pathGeom;
|
||||
|
@ -456,7 +456,7 @@ IntersectGeometry(ID2D1Geometry *aGeometryA, ID2D1Geometry *aGeometryB)
|
|||
return pathGeom.forget();
|
||||
}
|
||||
|
||||
static inline TemporaryRef<ID2D1StrokeStyle>
|
||||
static inline already_AddRefed<ID2D1StrokeStyle>
|
||||
CreateStrokeStyleForOptions(const StrokeOptions &aStrokeOptions)
|
||||
{
|
||||
RefPtr<ID2D1StrokeStyle> 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<ID2D1Bitmap>
|
||||
static inline already_AddRefed<ID2D1Bitmap>
|
||||
CreatePartialBitmapForSurface(DataSourceSurface *aSurface, const Matrix &aDestinationTransform,
|
||||
const IntSize &aDestinationSize, ExtendMode aExtendMode,
|
||||
Matrix &aSourceTransform, ID2D1RenderTarget *aRT,
|
||||
|
|
|
@ -285,7 +285,7 @@ MacIOSurface::~MacIOSurface() {
|
|||
CFRelease(mIOSurfacePtr);
|
||||
}
|
||||
|
||||
TemporaryRef<MacIOSurface> MacIOSurface::CreateIOSurface(int aWidth, int aHeight,
|
||||
already_AddRefed<MacIOSurface> MacIOSurface::CreateIOSurface(int aWidth, int aHeight,
|
||||
double aContentsScaleFactor,
|
||||
bool aHasAlpha) {
|
||||
if (!MacIOSurfaceLib::isInit() || aContentsScaleFactor <= 0)
|
||||
|
@ -338,7 +338,7 @@ TemporaryRef<MacIOSurface> MacIOSurface::CreateIOSurface(int aWidth, int aHeight
|
|||
return ioSurface.forget();
|
||||
}
|
||||
|
||||
TemporaryRef<MacIOSurface> MacIOSurface::LookupSurface(IOSurfaceID aIOSurfaceID,
|
||||
already_AddRefed<MacIOSurface> 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<SourceSurface>
|
||||
already_AddRefed<SourceSurface>
|
||||
MacIOSurface::GetAsSurface() {
|
||||
Lock();
|
||||
size_t bytesPerRow = GetBytesPerRow();
|
||||
|
@ -499,7 +499,7 @@ CGImageRef MacIOSurface::CreateImageFromIOSurfaceContext(CGContextRef aContext)
|
|||
return MacIOSurfaceLib::IOSurfaceContextCreateImage(aContext);
|
||||
}
|
||||
|
||||
TemporaryRef<MacIOSurface> MacIOSurface::IOSurfaceContextGetSurface(CGContextRef aContext,
|
||||
already_AddRefed<MacIOSurface> MacIOSurface::IOSurfaceContextGetSurface(CGContextRef aContext,
|
||||
double aContentsScaleFactor,
|
||||
bool aHasAlpha) {
|
||||
if (!MacIOSurfaceLib::isInit() || aContentsScaleFactor <= 0)
|
||||
|
|
|
@ -69,11 +69,11 @@ public:
|
|||
// of the MacIOSurface instance.
|
||||
// MacIOSurface holds a reference to the corresponding IOSurface.
|
||||
|
||||
static mozilla::TemporaryRef<MacIOSurface> CreateIOSurface(int aWidth, int aHeight,
|
||||
static already_AddRefed<MacIOSurface> CreateIOSurface(int aWidth, int aHeight,
|
||||
double aContentsScaleFactor = 1.0,
|
||||
bool aHasAlpha = true);
|
||||
static void ReleaseIOSurface(MacIOSurface *aIOSurface);
|
||||
static mozilla::TemporaryRef<MacIOSurface> LookupSurface(IOSurfaceID aSurfaceID,
|
||||
static already_AddRefed<MacIOSurface> 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<SourceSurface> GetAsSurface();
|
||||
already_AddRefed<SourceSurface> GetAsSurface();
|
||||
CGContextRef CreateIOSurfaceContext();
|
||||
|
||||
// FIXME This doesn't really belong here
|
||||
static CGImageRef CreateImageFromIOSurfaceContext(CGContextRef aContext);
|
||||
static mozilla::TemporaryRef<MacIOSurface> IOSurfaceContextGetSurface(CGContextRef aContext,
|
||||
static already_AddRefed<MacIOSurface> IOSurfaceContextGetSurface(CGContextRef aContext,
|
||||
double aContentsScaleFactor = 1.0,
|
||||
bool aHasAlpha = true);
|
||||
static size_t GetMaxWidth();
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче