mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1116905 - part 1 - remove dependence on implicit conversion from T* to TemporaryRef<T>, non-gfx changes; r=ehsan
This commit is contained in:
parent
9df7e5e6d9
commit
ac7e1768b8
@ -392,7 +392,8 @@ ImageEncoder::ExtractDataInternal(const nsAString& aType,
|
||||
aOptions);
|
||||
} else {
|
||||
RefPtr<gfx::DataSourceSurface> dataSurface;
|
||||
dataSurface = GetBRGADataSourceSurfaceSync(aImage);
|
||||
RefPtr<layers::Image> image(aImage);
|
||||
dataSurface = GetBRGADataSourceSurfaceSync(image.forget());
|
||||
|
||||
DataSourceSurface::MappedSurface map;
|
||||
if (!dataSurface->Map(gfx::DataSourceSurface::MapType::READ, &map)) {
|
||||
|
@ -4079,14 +4079,16 @@ ExtractSubrect(SourceSurface* aSurface, mgfx::Rect* aSourceRect, DrawTarget* aTa
|
||||
roundedOutSourceRect.RoundOut();
|
||||
mgfx::IntRect roundedOutSourceRectInt;
|
||||
if (!roundedOutSourceRect.ToIntRect(&roundedOutSourceRectInt)) {
|
||||
return aSurface;
|
||||
RefPtr<SourceSurface> surface(aSurface);
|
||||
return surface.forget();
|
||||
}
|
||||
|
||||
RefPtr<DrawTarget> subrectDT =
|
||||
aTargetDT->CreateSimilarDrawTarget(roundedOutSourceRectInt.Size(), SurfaceFormat::B8G8R8A8);
|
||||
|
||||
if (!subrectDT) {
|
||||
return aSurface;
|
||||
RefPtr<SourceSurface> surface(aSurface);
|
||||
return surface.forget();
|
||||
}
|
||||
|
||||
*aSourceRect -= roundedOutSourceRect.TopLeft();
|
||||
|
@ -38,7 +38,8 @@ AudioSink::OnAudioEndTimeUpdateTask::Dispatch(int64_t aEndTime) {
|
||||
MutexAutoLock lock(mMutex);
|
||||
if (mStateMachine) {
|
||||
mEndTime = aEndTime;
|
||||
mStateMachine->TaskQueue()->Dispatch(this);
|
||||
nsRefPtr<AudioSink::OnAudioEndTimeUpdateTask> runnable(this);
|
||||
mStateMachine->TaskQueue()->Dispatch(runnable.forget());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -176,7 +176,9 @@ public:
|
||||
|
||||
void DispatchShutdown()
|
||||
{
|
||||
TaskQueue()->Dispatch(NS_NewRunnableMethod(this, &MediaDecoderStateMachine::Shutdown));
|
||||
nsCOMPtr<nsIRunnable> runnable =
|
||||
NS_NewRunnableMethod(this, &MediaDecoderStateMachine::Shutdown);
|
||||
TaskQueue()->Dispatch(runnable.forget());
|
||||
}
|
||||
|
||||
void FinishShutdown();
|
||||
@ -243,7 +245,9 @@ public:
|
||||
|
||||
void DispatchStartBuffering()
|
||||
{
|
||||
TaskQueue()->Dispatch(NS_NewRunnableMethod(this, &MediaDecoderStateMachine::StartBuffering));
|
||||
nsCOMPtr<nsIRunnable> runnable =
|
||||
NS_NewRunnableMethod(this, &MediaDecoderStateMachine::StartBuffering);
|
||||
TaskQueue()->Dispatch(runnable.forget());
|
||||
}
|
||||
|
||||
// This is called on the state machine thread and audio thread.
|
||||
@ -745,7 +749,9 @@ private:
|
||||
public:
|
||||
void DispatchOnAudioSinkComplete()
|
||||
{
|
||||
TaskQueue()->Dispatch(NS_NewRunnableMethod(this, &MediaDecoderStateMachine::OnAudioSinkComplete));
|
||||
nsCOMPtr<nsIRunnable> runnable =
|
||||
NS_NewRunnableMethod(this, &MediaDecoderStateMachine::OnAudioSinkComplete);
|
||||
TaskQueue()->Dispatch(runnable.forget());
|
||||
}
|
||||
|
||||
// Called by the AudioSink to signal errors.
|
||||
@ -753,7 +759,9 @@ public:
|
||||
|
||||
void DispatchOnAudioSinkError()
|
||||
{
|
||||
TaskQueue()->Dispatch(NS_NewRunnableMethod(this, &MediaDecoderStateMachine::OnAudioSinkError));
|
||||
nsCOMPtr<nsIRunnable> runnable =
|
||||
NS_NewRunnableMethod(this, &MediaDecoderStateMachine::OnAudioSinkError);
|
||||
TaskQueue()->Dispatch(runnable.forget());
|
||||
}
|
||||
|
||||
// Return true if the video decoder's decode speed can not catch up the
|
||||
|
@ -72,11 +72,12 @@ AppleATDecoder::Input(MediaRawData* aSample)
|
||||
(unsigned long long)aSample->mSize);
|
||||
|
||||
// Queue a task to perform the actual decoding on a separate thread.
|
||||
mTaskQueue->Dispatch(
|
||||
nsCOMPtr<nsIRunnable> runnable =
|
||||
NS_NewRunnableMethodWithArg<nsRefPtr<MediaRawData>>(
|
||||
this,
|
||||
&AppleATDecoder::SubmitSample,
|
||||
nsRefPtr<MediaRawData>(aSample)));
|
||||
nsRefPtr<MediaRawData>(aSample));
|
||||
mTaskQueue->Dispatch(runnable.forget());
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -108,11 +108,12 @@ AppleVDADecoder::Input(MediaRawData* aSample)
|
||||
aSample->mKeyframe ? " keyframe" : "",
|
||||
aSample->mSize);
|
||||
|
||||
mTaskQueue->Dispatch(
|
||||
nsCOMPtr<nsIRunnable> runnable =
|
||||
NS_NewRunnableMethodWithArg<nsRefPtr<MediaRawData>>(
|
||||
this,
|
||||
&AppleVDADecoder::SubmitFrame,
|
||||
nsRefPtr<MediaRawData>(aSample)));
|
||||
nsRefPtr<MediaRawData>(aSample));
|
||||
mTaskQueue->Dispatch(runnable.forget());
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -98,11 +98,12 @@ AppleVTDecoder::Input(MediaRawData* aSample)
|
||||
LOG(" sha1 %s", digest.get());
|
||||
#endif // LOG_MEDIA_SHA1
|
||||
|
||||
mTaskQueue->Dispatch(
|
||||
nsCOMPtr<nsIRunnable> runnable =
|
||||
NS_NewRunnableMethodWithArg<nsRefPtr<MediaRawData>>(
|
||||
this,
|
||||
&AppleVTDecoder::SubmitFrame,
|
||||
nsRefPtr<MediaRawData>(aSample)));
|
||||
nsRefPtr<MediaRawData>(aSample));
|
||||
mTaskQueue->Dispatch(runnable.forget());
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -148,9 +148,9 @@ FFmpegAudioDecoder<LIBAV_VER>::DecodePacket(MediaRawData* aSample)
|
||||
nsresult
|
||||
FFmpegAudioDecoder<LIBAV_VER>::Input(MediaRawData* aSample)
|
||||
{
|
||||
mTaskQueue->Dispatch(NS_NewRunnableMethodWithArg<nsRefPtr<MediaRawData> >(
|
||||
nsCOMPtr<nsIRunnable> runnable(NS_NewRunnableMethodWithArg<nsRefPtr<MediaRawData>>(
|
||||
this, &FFmpegAudioDecoder::DecodePacket, nsRefPtr<MediaRawData>(aSample)));
|
||||
|
||||
mTaskQueue->Dispatch(runnable.forget());
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -242,10 +242,11 @@ FFmpegH264Decoder<LIBAV_VER>::AllocateYUV420PVideoBuffer(
|
||||
nsresult
|
||||
FFmpegH264Decoder<LIBAV_VER>::Input(MediaRawData* aSample)
|
||||
{
|
||||
mTaskQueue->Dispatch(
|
||||
nsCOMPtr<nsIRunnable> runnable(
|
||||
NS_NewRunnableMethodWithArg<nsRefPtr<MediaRawData>>(
|
||||
this, &FFmpegH264Decoder<LIBAV_VER>::DecodeFrame,
|
||||
nsRefPtr<MediaRawData>(aSample)));
|
||||
mTaskQueue->Dispatch(runnable.forget());
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@ -262,8 +263,9 @@ FFmpegH264Decoder<LIBAV_VER>::DoDrain()
|
||||
nsresult
|
||||
FFmpegH264Decoder<LIBAV_VER>::Drain()
|
||||
{
|
||||
mTaskQueue->Dispatch(
|
||||
nsCOMPtr<nsIRunnable> runnable(
|
||||
NS_NewRunnableMethod(this, &FFmpegH264Decoder<LIBAV_VER>::DoDrain));
|
||||
mTaskQueue->Dispatch(runnable.forget());
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -65,11 +65,12 @@ GonkMediaDataDecoder::Shutdown()
|
||||
nsresult
|
||||
GonkMediaDataDecoder::Input(MediaRawData* aSample)
|
||||
{
|
||||
mTaskQueue->Dispatch(
|
||||
nsCOMPtr<nsIRunnable> runnable(
|
||||
NS_NewRunnableMethodWithArg<nsRefPtr<MediaRawData>>(
|
||||
this,
|
||||
&GonkMediaDataDecoder::ProcessDecode,
|
||||
nsRefPtr<MediaRawData>(aSample)));
|
||||
mTaskQueue->Dispatch(runnable.forget());
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -161,7 +162,9 @@ GonkMediaDataDecoder::ProcessDrain()
|
||||
nsresult
|
||||
GonkMediaDataDecoder::Drain()
|
||||
{
|
||||
mTaskQueue->Dispatch(NS_NewRunnableMethod(this, &GonkMediaDataDecoder::ProcessDrain));
|
||||
nsCOMPtr<nsIRunnable> runnable =
|
||||
NS_NewRunnableMethod(this, &GonkMediaDataDecoder::ProcessDrain);
|
||||
mTaskQueue->Dispatch(runnable.forget());
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -84,8 +84,9 @@ WMFMediaDataDecoder::Shutdown()
|
||||
MOZ_DIAGNOSTIC_ASSERT(!mIsShutDown);
|
||||
|
||||
if (mTaskQueue) {
|
||||
mTaskQueue->Dispatch(
|
||||
NS_NewRunnableMethod(this, &WMFMediaDataDecoder::ProcessShutdown));
|
||||
nsCOMPtr<nsIRunnable> runnable =
|
||||
NS_NewRunnableMethod(this, &WMFMediaDataDecoder::ProcessShutdown);
|
||||
mTaskQueue->Dispatch(runnable.forget());
|
||||
} else {
|
||||
ProcessShutdown();
|
||||
}
|
||||
@ -226,7 +227,9 @@ WMFMediaDataDecoder::Drain()
|
||||
MOZ_ASSERT(mCallback->OnReaderTaskQueue());
|
||||
MOZ_DIAGNOSTIC_ASSERT(!mIsShutDown);
|
||||
|
||||
mTaskQueue->Dispatch(NS_NewRunnableMethod(this, &WMFMediaDataDecoder::ProcessDrain));
|
||||
nsCOMPtr<nsIRunnable> runnable =
|
||||
NS_NewRunnableMethod(this, &WMFMediaDataDecoder::ProcessDrain);
|
||||
mTaskQueue->Dispatch(runnable.forget());
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -150,7 +150,9 @@ TemporaryRef<DtlsIdentity> DtlsIdentity::Generate() {
|
||||
}
|
||||
certificate->derCert = *signedCert;
|
||||
|
||||
return new DtlsIdentity(private_key.forget(), certificate.forget());
|
||||
RefPtr<DtlsIdentity> identity =
|
||||
new DtlsIdentity(private_key.forget(), certificate.forget());
|
||||
return identity.forget();
|
||||
}
|
||||
|
||||
|
||||
|
@ -42,7 +42,8 @@ NewFoo()
|
||||
TemporaryRef<Foo>
|
||||
NewBar()
|
||||
{
|
||||
return new Bar();
|
||||
RefPtr<Bar> bar = new Bar();
|
||||
return bar.forget();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -268,7 +268,8 @@ SystemElf::Load(const char *path, int flags)
|
||||
if (handle) {
|
||||
SystemElf *elf = new SystemElf(path, handle);
|
||||
ElfLoader::Singleton.Register(elf);
|
||||
return elf;
|
||||
RefPtr<LibHandle> lib(elf);
|
||||
return lib.forget();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
@ -355,12 +356,16 @@ ElfLoader::Load(const char *path, int flags, LibHandle *parent)
|
||||
* path is not absolute, compare file names, otherwise compare full paths. */
|
||||
if (name == path) {
|
||||
for (LibHandleList::iterator it = handles.begin(); it < handles.end(); ++it)
|
||||
if ((*it)->GetName() && (strcmp((*it)->GetName(), name) == 0))
|
||||
return *it;
|
||||
if ((*it)->GetName() && (strcmp((*it)->GetName(), name) == 0)) {
|
||||
handle = *it;
|
||||
return handle.forget();
|
||||
}
|
||||
} else {
|
||||
for (LibHandleList::iterator it = handles.begin(); it < handles.end(); ++it)
|
||||
if ((*it)->GetPath() && (strcmp((*it)->GetPath(), path) == 0))
|
||||
return *it;
|
||||
if ((*it)->GetPath() && (strcmp((*it)->GetPath(), path) == 0)) {
|
||||
handle = *it;
|
||||
return handle.forget();
|
||||
}
|
||||
}
|
||||
|
||||
char *abs_path = nullptr;
|
||||
@ -398,7 +403,7 @@ ElfLoader::Load(const char *path, int flags, LibHandle *parent)
|
||||
reinterpret_cast<void *>(parent), parent ? parent->GetPath() : "",
|
||||
static_cast<void *>(handle));
|
||||
|
||||
return handle;
|
||||
return handle.forget();
|
||||
}
|
||||
|
||||
mozilla::TemporaryRef<LibHandle>
|
||||
@ -406,8 +411,10 @@ ElfLoader::GetHandleByPtr(void *addr)
|
||||
{
|
||||
/* Scan the list of handles we already have for a match */
|
||||
for (LibHandleList::iterator it = handles.begin(); it < handles.end(); ++it) {
|
||||
if ((*it)->Contains(addr))
|
||||
return *it;
|
||||
if ((*it)->Contains(addr)) {
|
||||
RefPtr<LibHandle> lib = *it;
|
||||
return lib.forget();
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -187,8 +187,10 @@ ZipCollection::GetZip(const char *path)
|
||||
/* Search the list of Zips we already have for a match */
|
||||
for (std::vector<Zip *>::iterator it = Singleton.zips.begin();
|
||||
it < Singleton.zips.end(); ++it) {
|
||||
if ((*it)->GetName() && (strcmp((*it)->GetName(), path) == 0))
|
||||
return *it;
|
||||
if ((*it)->GetName() && (strcmp((*it)->GetName(), path) == 0)) {
|
||||
mozilla::RefPtr<Zip> zip = *it;
|
||||
return zip.forget();
|
||||
}
|
||||
}
|
||||
return Zip::Create(path);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user