From 0595d6594e3eff94ff45afb3981788e967b0c031 Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Tue, 2 Feb 2016 17:05:40 +1100 Subject: [PATCH 001/117] Bug 1243608: P1. Only use video time if video frame contains seek target. r=cpearce This restrict the behaviour introduced in bug 1112438. --- dom/media/MediaDecoderStateMachine.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/dom/media/MediaDecoderStateMachine.cpp b/dom/media/MediaDecoderStateMachine.cpp index ea38cb8a5a0..f816a74baaf 100644 --- a/dom/media/MediaDecoderStateMachine.cpp +++ b/dom/media/MediaDecoderStateMachine.cpp @@ -2095,9 +2095,16 @@ MediaDecoderStateMachine::SeekCompleted() // While seeking to a position where there's only either audio or video, or // seeking to a position lies before audio or video, we need to check if // seekTime is bounded in suitable duration. See Bug 1112438. - int64_t videoStart = video ? video->mTime : seekTime; int64_t audioStart = audio ? audio->mTime : seekTime; - newCurrentTime = std::min(audioStart, videoStart); + // We only pin the seek time to the video start time if the video frame + // contains the seek time. We also perform this operation if there's no + // video in order to get around bug 1244639. + if (!video || (video->mTime <= seekTime && video->GetEndTime() > seekTime)) { + int64_t videoStart = video ? video->mTime : seekTime; + newCurrentTime = std::min(audioStart, videoStart); + } else { + newCurrentTime = audioStart; + } } else { newCurrentTime = video ? video->mTime : seekTime; } From 0014bd0d655bead760415a75a6b8700586604433 Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Mon, 1 Feb 2016 15:05:25 +1100 Subject: [PATCH 002/117] Bug 1243608: P2. Pass the full SeekTarget object to MediaDecoderReader::Seek. r=cpearce This will allow the reader to know if we are performing a fast seek. --- dom/media/AbstractMediaDecoder.h | 5 -- dom/media/MediaDecoder.h | 46 +--------------- dom/media/MediaDecoderReader.h | 3 +- dom/media/MediaDecoderStateMachine.cpp | 4 +- dom/media/MediaFormatReader.cpp | 16 +++--- dom/media/MediaFormatReader.h | 10 ++-- dom/media/SeekTarget.h | 66 +++++++++++++++++++++++ dom/media/android/AndroidMediaReader.cpp | 12 ++--- dom/media/android/AndroidMediaReader.h | 2 +- dom/media/directshow/DirectShowReader.cpp | 6 +-- dom/media/directshow/DirectShowReader.h | 2 +- dom/media/moz.build | 1 + dom/media/ogg/OggReader.cpp | 6 +-- dom/media/ogg/OggReader.h | 2 +- dom/media/omx/AudioOffloadPlayer.cpp | 6 ++- dom/media/omx/MediaOmxCommonDecoder.cpp | 2 +- dom/media/omx/MediaOmxCommonDecoder.h | 2 +- dom/media/omx/MediaOmxReader.cpp | 12 ++--- dom/media/omx/MediaOmxReader.h | 2 +- dom/media/omx/RtspOmxReader.cpp | 6 +-- dom/media/omx/RtspOmxReader.h | 2 +- dom/media/raw/RawReader.cpp | 14 ++--- dom/media/raw/RawReader.h | 2 +- dom/media/wave/WaveReader.cpp | 8 +-- dom/media/wave/WaveReader.h | 2 +- 25 files changed, 131 insertions(+), 108 deletions(-) create mode 100644 dom/media/SeekTarget.h diff --git a/dom/media/AbstractMediaDecoder.h b/dom/media/AbstractMediaDecoder.h index 8ca77ce008b..f4764bbbd3f 100644 --- a/dom/media/AbstractMediaDecoder.h +++ b/dom/media/AbstractMediaDecoder.h @@ -37,11 +37,6 @@ static inline bool IsCurrentThread(nsIThread* aThread) { return NS_GetCurrentThread() == aThread; } -enum class MediaDecoderEventVisibility : int8_t { - Observable, - Suppressed -}; - /** * The AbstractMediaDecoder class describes the public interface for a media decoder * and is used by the MediaReader classes. diff --git a/dom/media/MediaDecoder.h b/dom/media/MediaDecoder.h index 72b01840034..0542703cca7 100644 --- a/dom/media/MediaDecoder.h +++ b/dom/media/MediaDecoder.h @@ -36,6 +36,7 @@ #include "MediaStatistics.h" #include "MediaStreamGraph.h" #include "TimeUnits.h" +#include "SeekTarget.h" class nsIStreamListener; class nsIPrincipal; @@ -53,51 +54,6 @@ enum class MediaEventType : int8_t; #undef GetCurrentTime #endif -// Stores the seek target; the time to seek to, and whether an Accurate, -// or "Fast" (nearest keyframe) seek was requested. -struct SeekTarget { - enum Type { - Invalid, - PrevSyncPoint, - Accurate - }; - SeekTarget() - : mTime(-1.0) - , mType(SeekTarget::Invalid) - , mEventVisibility(MediaDecoderEventVisibility::Observable) - { - } - SeekTarget(int64_t aTimeUsecs, - Type aType, - MediaDecoderEventVisibility aEventVisibility = - MediaDecoderEventVisibility::Observable) - : mTime(aTimeUsecs) - , mType(aType) - , mEventVisibility(aEventVisibility) - { - } - SeekTarget(const SeekTarget& aOther) - : mTime(aOther.mTime) - , mType(aOther.mType) - , mEventVisibility(aOther.mEventVisibility) - { - } - bool IsValid() const { - return mType != SeekTarget::Invalid; - } - void Reset() { - mTime = -1; - mType = SeekTarget::Invalid; - } - // Seek target time in microseconds. - int64_t mTime; - // Whether we should seek "Fast", or "Accurate". - // "Fast" seeks to the seek point preceeding mTime, whereas - // "Accurate" seeks as close as possible to mTime. - Type mType; - MediaDecoderEventVisibility mEventVisibility; -}; - class MediaDecoder : public AbstractMediaDecoder { public: diff --git a/dom/media/MediaDecoderReader.h b/dom/media/MediaDecoderReader.h index 1cc1d55f0c2..1836459f611 100644 --- a/dom/media/MediaDecoderReader.h +++ b/dom/media/MediaDecoderReader.h @@ -17,6 +17,7 @@ #include "AudioCompactor.h" #include "Intervals.h" #include "TimeUnits.h" +#include "SeekTarget.h" namespace mozilla { @@ -177,7 +178,7 @@ public: // Moves the decode head to aTime microseconds. aEndTime denotes the end // time of the media in usecs. This is only needed for OggReader, and should // probably be removed somehow. - virtual RefPtr Seek(int64_t aTime, int64_t aEndTime) = 0; + virtual RefPtr Seek(SeekTarget aTarget, int64_t aEndTime) = 0; // Called to move the reader into idle state. When the reader is // created it is assumed to be active (i.e. not idle). When the media diff --git a/dom/media/MediaDecoderStateMachine.cpp b/dom/media/MediaDecoderStateMachine.cpp index f816a74baaf..e23a83b9cca 100644 --- a/dom/media/MediaDecoderStateMachine.cpp +++ b/dom/media/MediaDecoderStateMachine.cpp @@ -1642,8 +1642,10 @@ MediaDecoderStateMachine::InitiateSeek() // Do the seek. RefPtr self = this; + SeekTarget seekTarget = mCurrentSeek.mTarget; + seekTarget.mTime += StartTime(); mSeekRequest.Begin(InvokeAsync(DecodeTaskQueue(), mReader.get(), __func__, - &MediaDecoderReader::Seek, mCurrentSeek.mTarget.mTime + StartTime(), + &MediaDecoderReader::Seek, seekTarget, Duration().ToMicroseconds()) ->Then(OwnerThread(), __func__, [self] (int64_t) -> void { diff --git a/dom/media/MediaFormatReader.cpp b/dom/media/MediaFormatReader.cpp index f7d06bfcc84..c95011dd95c 100644 --- a/dom/media/MediaFormatReader.cpp +++ b/dom/media/MediaFormatReader.cpp @@ -929,8 +929,8 @@ MediaFormatReader::HandleDemuxedSamples(TrackType aTrack, decoder.mQueuedSamples.AppendElements(Move(samples)); NotifyDecodingRequested(aTrack); } else { - SeekTarget seekTarget = - decoder.mTimeThreshold.refOr(SeekTarget(TimeUnit::FromMicroseconds(sample->mTime), false)); + InternalSeekTarget seekTarget = + decoder.mTimeThreshold.refOr(InternalSeekTarget(TimeUnit::FromMicroseconds(sample->mTime), false)); LOG("Stream change occurred on a non-keyframe. Seeking to:%lld", seekTarget.mTime.ToMicroseconds()); InternalSeek(aTrack, seekTarget); @@ -968,7 +968,7 @@ MediaFormatReader::HandleDemuxedSamples(TrackType aTrack, } void -MediaFormatReader::InternalSeek(TrackType aTrack, const SeekTarget& aTarget) +MediaFormatReader::InternalSeek(TrackType aTrack, const InternalSeekTarget& aTarget) { MOZ_ASSERT(OnTaskQueue()); auto& decoder = GetDecoderData(aTrack); @@ -1058,7 +1058,7 @@ MediaFormatReader::Update(TrackType aTrack) // Drop any frames found prior our internal seek target. while (decoder.mTimeThreshold && decoder.mOutput.Length()) { RefPtr& output = decoder.mOutput[0]; - SeekTarget target = decoder.mTimeThreshold.ref(); + InternalSeekTarget target = decoder.mTimeThreshold.ref(); media::TimeUnit time = media::TimeUnit::FromMicroseconds(output->mTime); if (time >= target.mTime) { // We have reached our internal seek target. @@ -1112,7 +1112,7 @@ MediaFormatReader::Update(TrackType aTrack) // last sample decoded. LOG("Seeking to last sample time: %lld", decoder.mLastSampleTime.ref().ToMicroseconds()); - InternalSeek(aTrack, SeekTarget(decoder.mLastSampleTime.ref(), true)); + InternalSeek(aTrack, InternalSeekTarget(decoder.mLastSampleTime.ref(), true)); } LOG("Rejecting %s promise: WAITING_FOR_DATA", TrackTypeToStr(aTrack)); decoder.RejectPromise(WAITING_FOR_DATA, __func__); @@ -1403,11 +1403,11 @@ MediaFormatReader::OnVideoSkipFailed(MediaTrackDemuxer::SkipFailureHolder aFailu } RefPtr -MediaFormatReader::Seek(int64_t aTime, int64_t aUnused) +MediaFormatReader::Seek(SeekTarget aTarget, int64_t aUnused) { MOZ_ASSERT(OnTaskQueue()); - LOG("aTime=(%lld)", aTime); + LOG("aTarget=(%lld)", aTarget.mTime); MOZ_DIAGNOSTIC_ASSERT(mSeekPromise.IsEmpty()); MOZ_DIAGNOSTIC_ASSERT(!mVideo.HasPromise()); @@ -1425,7 +1425,7 @@ MediaFormatReader::Seek(int64_t aTime, int64_t aUnused) return SeekPromise::CreateAndReject(NS_ERROR_FAILURE, __func__); } - mOriginalSeekTime = Some(media::TimeUnit::FromMicroseconds(aTime)); + mOriginalSeekTime = Some(media::TimeUnit::FromMicroseconds(aTarget.mTime)); mPendingSeekTime = mOriginalSeekTime; RefPtr p = mSeekPromise.Ensure(__func__); diff --git a/dom/media/MediaFormatReader.h b/dom/media/MediaFormatReader.h index 4fe53ed24be..ad2b1e54c9b 100644 --- a/dom/media/MediaFormatReader.h +++ b/dom/media/MediaFormatReader.h @@ -48,7 +48,7 @@ public: void ReadUpdatedMetadata(MediaInfo* aInfo) override; RefPtr - Seek(int64_t aTime, int64_t aUnused) override; + Seek(SeekTarget aTarget, int64_t aUnused) override; protected: void NotifyDataArrivedInternal() override; @@ -133,8 +133,8 @@ private: bool DecodeDemuxedSamples(TrackType aTrack, MediaRawData* aSample); - struct SeekTarget { - SeekTarget(const media::TimeUnit& aTime, bool aDropTarget) + struct InternalSeekTarget { + InternalSeekTarget(const media::TimeUnit& aTime, bool aDropTarget) : mTime(aTime) , mDropTarget(aDropTarget) , mWaiting(false) @@ -146,7 +146,7 @@ private: }; // Perform an internal seek to aTime. If aDropTarget is true then // the first sample past the target will be dropped. - void InternalSeek(TrackType aTrack, const SeekTarget& aTarget); + void InternalSeek(TrackType aTrack, const InternalSeekTarget& aTarget); // Drain the current decoder. void DrainDecoder(TrackType aTrack); @@ -300,7 +300,7 @@ private: // If set, all decoded samples prior mTimeThreshold will be dropped. // Used for internal seeking when a change of stream is detected or when // encountering data discontinuity. - Maybe mTimeThreshold; + Maybe mTimeThreshold; // Time of last sample returned. Maybe mLastSampleTime; diff --git a/dom/media/SeekTarget.h b/dom/media/SeekTarget.h new file mode 100644 index 00000000000..61c970c7935 --- /dev/null +++ b/dom/media/SeekTarget.h @@ -0,0 +1,66 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef SEEK_TARGET_H +#define SEEK_TARGET_H + +#include "TimeUnits.h" + +namespace mozilla { + +enum class MediaDecoderEventVisibility : int8_t { + Observable, + Suppressed +}; + +// Stores the seek target; the time to seek to, and whether an Accurate, +// or "Fast" (nearest keyframe) seek was requested. +struct SeekTarget { + enum Type { + Invalid, + PrevSyncPoint, + Accurate + }; + SeekTarget() + : mTime(-1.0) + , mType(SeekTarget::Invalid) + , mEventVisibility(MediaDecoderEventVisibility::Observable) + { + } + SeekTarget(int64_t aTimeUsecs, + Type aType, + MediaDecoderEventVisibility aEventVisibility = + MediaDecoderEventVisibility::Observable) + : mTime(aTimeUsecs) + , mType(aType) + , mEventVisibility(aEventVisibility) + { + } + SeekTarget(const SeekTarget& aOther) + : mTime(aOther.mTime) + , mType(aOther.mType) + , mEventVisibility(aOther.mEventVisibility) + { + } + bool IsValid() const { + return mType != SeekTarget::Invalid; + } + void Reset() { + mTime = -1; + mType = SeekTarget::Invalid; + } + // Seek target time in microseconds. + int64_t mTime; + // Whether we should seek "Fast", or "Accurate". + // "Fast" seeks to the seek point preceeding mTime, whereas + // "Accurate" seeks as close as possible to mTime. + Type mType; + MediaDecoderEventVisibility mEventVisibility; +}; + +} // namespace mozilla + +#endif /* SEEK_TARGET_H */ diff --git a/dom/media/android/AndroidMediaReader.cpp b/dom/media/android/AndroidMediaReader.cpp index 130f024e950..44f47d6f8fb 100644 --- a/dom/media/android/AndroidMediaReader.cpp +++ b/dom/media/android/AndroidMediaReader.cpp @@ -314,7 +314,7 @@ bool AndroidMediaReader::DecodeAudioData() } RefPtr -AndroidMediaReader::Seek(int64_t aTarget, int64_t aEndTime) +AndroidMediaReader::Seek(SeekTarget aTarget, int64_t aEndTime) { MOZ_ASSERT(OnTaskQueue()); @@ -328,7 +328,7 @@ AndroidMediaReader::Seek(int64_t aTarget, int64_t aEndTime) // stream to the preceeding keyframe first, get the stream time, and then // seek the audio stream to match the video stream's time. Otherwise, the // audio and video streams won't be in sync after the seek. - mVideoSeekTimeUs = aTarget; + mVideoSeekTimeUs = aTarget.mTime; RefPtr self = this; mSeekRequest.Begin(DecodeToFirstVideoData()->Then(OwnerThread(), __func__, [self] (MediaData* v) { @@ -337,12 +337,12 @@ AndroidMediaReader::Seek(int64_t aTarget, int64_t aEndTime) self->mSeekPromise.Resolve(self->mAudioSeekTimeUs, __func__); }, [self, aTarget] () { self->mSeekRequest.Complete(); - self->mAudioSeekTimeUs = aTarget; - self->mSeekPromise.Resolve(aTarget, __func__); + self->mAudioSeekTimeUs = aTarget.mTime; + self->mSeekPromise.Resolve(aTarget.mTime, __func__); })); } else { - mAudioSeekTimeUs = mVideoSeekTimeUs = aTarget; - mSeekPromise.Resolve(aTarget, __func__); + mAudioSeekTimeUs = mVideoSeekTimeUs = aTarget.mTime; + mSeekPromise.Resolve(aTarget.mTime, __func__); } return p; diff --git a/dom/media/android/AndroidMediaReader.h b/dom/media/android/AndroidMediaReader.h index 80f43448caa..cb7d264c22d 100644 --- a/dom/media/android/AndroidMediaReader.h +++ b/dom/media/android/AndroidMediaReader.h @@ -48,7 +48,7 @@ public: bool DecodeVideoFrame(bool &aKeyframeSkip, int64_t aTimeThreshold) override; nsresult ReadMetadata(MediaInfo* aInfo, MetadataTags** aTags) override; - RefPtr Seek(int64_t aTime, int64_t aEndTime) override; + RefPtr Seek(SeekTarget aTarget, int64_t aEndTime) override; RefPtr Shutdown() override; diff --git a/dom/media/directshow/DirectShowReader.cpp b/dom/media/directshow/DirectShowReader.cpp index 8b60fe8f460..f21b50a2dd2 100644 --- a/dom/media/directshow/DirectShowReader.cpp +++ b/dom/media/directshow/DirectShowReader.cpp @@ -329,13 +329,13 @@ DirectShowReader::DecodeVideoFrame(bool &aKeyframeSkip, } RefPtr -DirectShowReader::Seek(int64_t aTargetUs, int64_t aEndTime) +DirectShowReader::Seek(SeekTarget aTarget, int64_t aEndTime) { - nsresult res = SeekInternal(aTargetUs); + nsresult res = SeekInternal(aTarget.mTime); if (NS_FAILED(res)) { return SeekPromise::CreateAndReject(res, __func__); } else { - return SeekPromise::CreateAndResolve(aTargetUs, __func__); + return SeekPromise::CreateAndResolve(aTarget.mTime, __func__); } } diff --git a/dom/media/directshow/DirectShowReader.h b/dom/media/directshow/DirectShowReader.h index 5e80c98261f..5e6a8ca35a6 100644 --- a/dom/media/directshow/DirectShowReader.h +++ b/dom/media/directshow/DirectShowReader.h @@ -52,7 +52,7 @@ public: MetadataTags** aTags) override; RefPtr - Seek(int64_t aTime, int64_t aEndTime) override; + Seek(SeekTarget aTarget, int64_t aEndTime) override; protected: void NotifyDataArrivedInternal() override; diff --git a/dom/media/moz.build b/dom/media/moz.build index a76f2cfef46..cc661e746a6 100644 --- a/dom/media/moz.build +++ b/dom/media/moz.build @@ -133,6 +133,7 @@ EXPORTS += [ 'MP3FrameParser.h', 'nsIDocumentActivity.h', 'RtspMediaResource.h', + 'SeekTarget.h', 'SelfRef.h', 'SharedBuffer.h', 'StreamBuffer.h', diff --git a/dom/media/ogg/OggReader.cpp b/dom/media/ogg/OggReader.cpp index 3bb3de595d9..a84e0a5ea8e 100644 --- a/dom/media/ogg/OggReader.cpp +++ b/dom/media/ogg/OggReader.cpp @@ -1408,13 +1408,13 @@ nsresult OggReader::SeekInUnbuffered(int64_t aTarget, } RefPtr -OggReader::Seek(int64_t aTarget, int64_t aEndTime) +OggReader::Seek(SeekTarget aTarget, int64_t aEndTime) { - nsresult res = SeekInternal(aTarget, aEndTime); + nsresult res = SeekInternal(aTarget.mTime, aEndTime); if (NS_FAILED(res)) { return SeekPromise::CreateAndReject(res, __func__); } else { - return SeekPromise::CreateAndResolve(aTarget, __func__); + return SeekPromise::CreateAndResolve(aTarget.mTime, __func__); } } diff --git a/dom/media/ogg/OggReader.h b/dom/media/ogg/OggReader.h index a7eff650306..c5eea1e44c6 100644 --- a/dom/media/ogg/OggReader.h +++ b/dom/media/ogg/OggReader.h @@ -60,7 +60,7 @@ public: bool DecodeVideoFrame(bool &aKeyframeSkip, int64_t aTimeThreshold) override; nsresult ReadMetadata(MediaInfo* aInfo, MetadataTags** aTags) override; - RefPtr Seek(int64_t aTime, int64_t aEndTime) override; + RefPtr Seek(SeekTarget aTarget, int64_t aEndTime) override; media::TimeIntervals GetBuffered() override; private: diff --git a/dom/media/omx/AudioOffloadPlayer.cpp b/dom/media/omx/AudioOffloadPlayer.cpp index cb8a7df9c04..587c76314cf 100644 --- a/dom/media/omx/AudioOffloadPlayer.cpp +++ b/dom/media/omx/AudioOffloadPlayer.cpp @@ -345,7 +345,8 @@ status_t AudioOffloadPlayer::DoSeek() MOZ_ASSERT(mSeekTarget.IsValid()); CHECK(mAudioSink.get()); - AUDIO_OFFLOAD_LOG(LogLevel::Debug, ("DoSeek ( %lld )", mSeekTarget.mTime)); + AUDIO_OFFLOAD_LOG(LogLevel::Debug, + "DoSeek ( %lld )", mSeekTarget.mTime); mReachedEOS = false; mPositionTimeMediaUs = -1; @@ -557,7 +558,8 @@ size_t AudioOffloadPlayer::FillBuffer(void* aData, size_t aSize) kKeyTime, &mPositionTimeMediaUs)); } - if (mSeekTarget.IsValid() && seekTimeUs == mSeekTarget.mTime) { + if (mSeekTarget.IsValid() && + seekTimeUs == mSeekTarget.mTime) { MOZ_ASSERT(mSeekTarget.IsValid()); mSeekTarget.Reset(); if (!mSeekPromise.IsEmpty()) { diff --git a/dom/media/omx/MediaOmxCommonDecoder.cpp b/dom/media/omx/MediaOmxCommonDecoder.cpp index 90f760bed1c..21bd4479739 100644 --- a/dom/media/omx/MediaOmxCommonDecoder.cpp +++ b/dom/media/omx/MediaOmxCommonDecoder.cpp @@ -231,7 +231,7 @@ MediaOmxCommonDecoder::ChangeState(PlayState aState) } void -MediaOmxCommonDecoder::CallSeek(const SeekTarget& aTarget) +MediaOmxCommonDecoder::CallSeek(SeekTarget aTarget) { if (!mAudioOffloadPlayer) { MediaDecoder::CallSeek(aTarget); diff --git a/dom/media/omx/MediaOmxCommonDecoder.h b/dom/media/omx/MediaOmxCommonDecoder.h index 318480f6397..f784a5a82c6 100644 --- a/dom/media/omx/MediaOmxCommonDecoder.h +++ b/dom/media/omx/MediaOmxCommonDecoder.h @@ -26,7 +26,7 @@ public: void FirstFrameLoaded(nsAutoPtr aInfo, MediaDecoderEventVisibility aEventVisibility) override; void ChangeState(PlayState aState) override; - void CallSeek(const SeekTarget& aTarget) override; + void CallSeek(SeekTarget aTarget) override; void SetVolume(double aVolume) override; int64_t CurrentPosition() override; MediaDecoderOwner::NextFrameStatus NextFrameStatus() override; diff --git a/dom/media/omx/MediaOmxReader.cpp b/dom/media/omx/MediaOmxReader.cpp index f5098ca3d41..86d70aebea8 100644 --- a/dom/media/omx/MediaOmxReader.cpp +++ b/dom/media/omx/MediaOmxReader.cpp @@ -523,7 +523,7 @@ bool MediaOmxReader::DecodeAudioData() } RefPtr -MediaOmxReader::Seek(int64_t aTarget, int64_t aEndTime) +MediaOmxReader::Seek(SeekTarget aTarget, int64_t aEndTime) { MOZ_ASSERT(OnTaskQueue()); EnsureActive(); @@ -538,7 +538,7 @@ MediaOmxReader::Seek(int64_t aTarget, int64_t aEndTime) // stream to the preceeding keyframe first, get the stream time, and then // seek the audio stream to match the video stream's time. Otherwise, the // audio and video streams won't be in sync after the seek. - mVideoSeekTimeUs = aTarget; + mVideoSeekTimeUs = aTarget.mTime; RefPtr self = this; mSeekRequest.Begin(DecodeToFirstVideoData()->Then(OwnerThread(), __func__, [self] (MediaData* v) { @@ -547,12 +547,12 @@ MediaOmxReader::Seek(int64_t aTarget, int64_t aEndTime) self->mSeekPromise.Resolve(self->mAudioSeekTimeUs, __func__); }, [self, aTarget] () { self->mSeekRequest.Complete(); - self->mAudioSeekTimeUs = aTarget; - self->mSeekPromise.Resolve(aTarget, __func__); + self->mAudioSeekTimeUs = aTarget.mTime; + self->mSeekPromise.Resolve(aTarget.mTime, __func__); })); } else { - mAudioSeekTimeUs = mVideoSeekTimeUs = aTarget; - mSeekPromise.Resolve(aTarget, __func__); + mAudioSeekTimeUs = mVideoSeekTimeUs = GetTime().ToMicroseconds(); + mSeekPromise.Resolve(aTarget.mTime, __func__); } return p; diff --git a/dom/media/omx/MediaOmxReader.h b/dom/media/omx/MediaOmxReader.h index 21abbd00810..4f2fce278ae 100644 --- a/dom/media/omx/MediaOmxReader.h +++ b/dom/media/omx/MediaOmxReader.h @@ -89,7 +89,7 @@ public: RefPtr AsyncReadMetadata() override; RefPtr - Seek(int64_t aTime, int64_t aEndTime) override; + Seek(SeekTarget aTarget, int64_t aEndTime) override; void SetIdle() override; diff --git a/dom/media/omx/RtspOmxReader.cpp b/dom/media/omx/RtspOmxReader.cpp index 07e6d8ed406..caf2ab6baa1 100644 --- a/dom/media/omx/RtspOmxReader.cpp +++ b/dom/media/omx/RtspOmxReader.cpp @@ -33,14 +33,14 @@ nsresult RtspOmxReader::InitOmxDecoder() } RefPtr -RtspOmxReader::Seek(int64_t aTime, int64_t aEndTime) +RtspOmxReader::Seek(SeekTarget aTarget, int64_t aEndTime) { // The seek function of Rtsp is time-based, we call the SeekTime function in // RtspMediaResource. The SeekTime function finally send a seek command to // Rtsp stream server through network and also clear the buffer data in // RtspMediaResource. if (mRtspResource) { - mRtspResource->SeekTime(aTime); + mRtspResource->SeekTime(aTarget.mTime); mRtspResource->EnablePlayoutDelay(); } @@ -49,7 +49,7 @@ RtspOmxReader::Seek(int64_t aTime, int64_t aEndTime) // that store the decoded data and also call the |DecodeToTarget| to pass // the seek time to OMX a/v decoders. mEnsureActiveFromSeek = true; - return MediaOmxReader::Seek(aTime, aEndTime); + return MediaOmxReader::Seek(aTarget, aEndTime); } void RtspOmxReader::SetIdle() { diff --git a/dom/media/omx/RtspOmxReader.h b/dom/media/omx/RtspOmxReader.h index 4da19d81df7..973da14d060 100644 --- a/dom/media/omx/RtspOmxReader.h +++ b/dom/media/omx/RtspOmxReader.h @@ -48,7 +48,7 @@ public: } // Implement a time-based seek instead of byte-based.. - RefPtr Seek(int64_t aTime, int64_t aEndTime) final override; + RefPtr Seek(SeekTarget aTarget, int64_t aEndTime) final override; // Override GetBuffered() to do nothing for below reasons: // 1. Because the Rtsp stream is a/v separated. The buffered data in a/v diff --git a/dom/media/raw/RawReader.cpp b/dom/media/raw/RawReader.cpp index cfe775c1a9c..71c6b368ce0 100644 --- a/dom/media/raw/RawReader.cpp +++ b/dom/media/raw/RawReader.cpp @@ -206,14 +206,14 @@ bool RawReader::DecodeVideoFrame(bool &aKeyframeSkip, } RefPtr -RawReader::Seek(int64_t aTime, int64_t aEndTime) +RawReader::Seek(SeekTarget aTarget, int64_t aEndTime) { MOZ_ASSERT(OnTaskQueue()); uint32_t frame = mCurrentFrame; - if (aTime >= UINT_MAX) + if (aTarget.mTime >= UINT_MAX) return SeekPromise::CreateAndReject(NS_ERROR_FAILURE, __func__); - mCurrentFrame = aTime * mFrameRate / USECS_PER_S; + mCurrentFrame = aTarget.mTime * mFrameRate / USECS_PER_S; CheckedUint32 offset = CheckedUint32(mCurrentFrame) * mFrameSize; offset += sizeof(RawVideoHeader); @@ -230,15 +230,15 @@ RawReader::Seek(int64_t aTime, int64_t aEndTime) NS_ENSURE_TRUE(!self->mShutdown, false); bool skip = false; return self->DecodeVideoFrame(skip, 0); - }, [self, aTime] () { + }, [self, aTarget] () { MOZ_ASSERT(self->OnTaskQueue()); return self->mVideoQueue.Peek() && - self->mVideoQueue.Peek()->GetEndTime() >= aTime; - })->Then(OwnerThread(), __func__, [self, p, aTime] () { + self->mVideoQueue.Peek()->GetEndTime() >= aTarget.mTime; + })->Then(OwnerThread(), __func__, [self, p, aTarget] () { while (self->mVideoQueue.GetSize() >= 2) { RefPtr releaseMe = self->mVideoQueue.PopFront(); } - p->Resolve(aTime, __func__); + p->Resolve(aTarget.mTime, __func__); }, [self, p, frame] { self->mCurrentFrame = frame; self->mVideoQueue.Reset(); diff --git a/dom/media/raw/RawReader.h b/dom/media/raw/RawReader.h index 9742d26010c..d73d22fc328 100644 --- a/dom/media/raw/RawReader.h +++ b/dom/media/raw/RawReader.h @@ -28,7 +28,7 @@ public: nsresult ReadMetadata(MediaInfo* aInfo, MetadataTags** aTags) override; - RefPtr Seek(int64_t aTime, int64_t aEndTime) override; + RefPtr Seek(SeekTarget aTarget, int64_t aEndTime) override; media::TimeIntervals GetBuffered() override; diff --git a/dom/media/wave/WaveReader.cpp b/dom/media/wave/WaveReader.cpp index 248779bff56..f3e36ab6861 100644 --- a/dom/media/wave/WaveReader.cpp +++ b/dom/media/wave/WaveReader.cpp @@ -272,10 +272,10 @@ bool WaveReader::DecodeVideoFrame(bool &aKeyframeSkip, } RefPtr -WaveReader::Seek(int64_t aTarget, int64_t aEndTime) +WaveReader::Seek(SeekTarget aTarget, int64_t aEndTime) { MOZ_ASSERT(OnTaskQueue()); - LOG(LogLevel::Debug, ("%p About to seek to %lld", mDecoder, aTarget)); + LOG(LogLevel::Debug, ("%p About to seek to %lld", mDecoder, aTarget.mTime)); if (NS_FAILED(ResetDecode())) { return SeekPromise::CreateAndReject(NS_ERROR_FAILURE, __func__); @@ -283,7 +283,7 @@ WaveReader::Seek(int64_t aTarget, int64_t aEndTime) double d = BytesToTime(GetDataLength()); NS_ASSERTION(d < INT64_MAX / USECS_PER_S, "Duration overflow"); int64_t duration = static_cast(d * USECS_PER_S); - double seekTime = std::min(aTarget, duration) / static_cast(USECS_PER_S); + double seekTime = std::min(aTarget.mTime, duration) / static_cast(USECS_PER_S); int64_t position = RoundDownToFrame(static_cast(TimeToBytes(seekTime))); NS_ASSERTION(INT64_MAX - mWavePCMOffset > position, "Integer overflow during wave seek"); position += mWavePCMOffset; @@ -291,7 +291,7 @@ WaveReader::Seek(int64_t aTarget, int64_t aEndTime) if (NS_FAILED(res)) { return SeekPromise::CreateAndReject(res, __func__); } else { - return SeekPromise::CreateAndResolve(aTarget, __func__); + return SeekPromise::CreateAndResolve(aTarget.mTime, __func__); } } diff --git a/dom/media/wave/WaveReader.h b/dom/media/wave/WaveReader.h index ff58939c99b..c0a4e7265ba 100644 --- a/dom/media/wave/WaveReader.h +++ b/dom/media/wave/WaveReader.h @@ -27,7 +27,7 @@ public: int64_t aTimeThreshold) override; nsresult ReadMetadata(MediaInfo* aInfo, MetadataTags** aTags) override; - RefPtr Seek(int64_t aTime, int64_t aEndTime) override; + RefPtr Seek(SeekTarget aTarget, int64_t aEndTime) override; media::TimeIntervals GetBuffered() override; From 74b7b38be240cd395cf243d7e2c485cd3f396f44 Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Thu, 28 Jan 2016 21:24:30 +1100 Subject: [PATCH 003/117] Bug 1243608: P3. Make SeekTarget::mTime a TimeUnit object. r=cpearce Also makes it a private member and provide a GetTime() accessor instead. --- dom/media/MediaDecoderStateMachine.cpp | 30 +++++++++--------- dom/media/MediaFormatReader.cpp | 4 +-- dom/media/SeekTarget.h | 38 +++++++++++++++++------ dom/media/android/AndroidMediaReader.cpp | 10 +++--- dom/media/directshow/DirectShowReader.cpp | 4 +-- dom/media/ogg/OggReader.cpp | 4 +-- dom/media/omx/AudioOffloadPlayer.cpp | 10 +++--- dom/media/omx/MediaOmxReader.cpp | 6 ++-- dom/media/omx/RtspOmxReader.cpp | 2 +- dom/media/raw/RawReader.cpp | 8 ++--- dom/media/wave/WaveReader.cpp | 8 ++--- 11 files changed, 72 insertions(+), 52 deletions(-) diff --git a/dom/media/MediaDecoderStateMachine.cpp b/dom/media/MediaDecoderStateMachine.cpp index e23a83b9cca..c6a7a1ad774 100644 --- a/dom/media/MediaDecoderStateMachine.cpp +++ b/dom/media/MediaDecoderStateMachine.cpp @@ -648,7 +648,7 @@ MediaDecoderStateMachine::OnAudioDecoded(MediaData* aAudioSample) // We must be after the discontinuity; we're receiving samples // at or after the seek target. if (mCurrentSeek.mTarget.mType == SeekTarget::PrevSyncPoint && - mCurrentSeek.mTarget.mTime > mCurrentTimeBeforeSeek && + mCurrentSeek.mTarget.GetTime().ToMicroseconds() > mCurrentTimeBeforeSeek && audio->mTime < mCurrentTimeBeforeSeek) { // We are doing a fastSeek, but we ended up *before* the previous // playback position. This is surprising UX, so switch to an accurate @@ -968,7 +968,7 @@ MediaDecoderStateMachine::OnVideoDecoded(MediaData* aVideoSample) // We must be after the discontinuity; we're receiving samples // at or after the seek target. if (mCurrentSeek.mTarget.mType == SeekTarget::PrevSyncPoint && - mCurrentSeek.mTarget.mTime > mCurrentTimeBeforeSeek && + mCurrentSeek.mTarget.GetTime().ToMicroseconds() > mCurrentTimeBeforeSeek && video->mTime < mCurrentTimeBeforeSeek) { // We are doing a fastSeek, but we ended up *before* the previous // playback position. This is surprising UX, so switch to an accurate @@ -1524,7 +1524,7 @@ MediaDecoderStateMachine::Seek(SeekTarget aTarget) mPendingSeek.RejectIfExists(__func__); mPendingSeek.mTarget = aTarget; - DECODER_LOG("Changed state to SEEKING (to %lld)", mPendingSeek.mTarget.mTime); + DECODER_LOG("Changed state to SEEKING (to %lld)", mPendingSeek.mTarget.GetTime().ToMicroseconds()); SetState(DECODER_STATE_SEEKING); ScheduleStateMachine(); @@ -1618,12 +1618,12 @@ MediaDecoderStateMachine::InitiateSeek() // Bound the seek time to be inside the media range. int64_t end = Duration().ToMicroseconds(); NS_ASSERTION(end != -1, "Should know end time by now"); - int64_t seekTime = mCurrentSeek.mTarget.mTime; + int64_t seekTime = mCurrentSeek.mTarget.GetTime().ToMicroseconds(); seekTime = std::min(seekTime, end); seekTime = std::max(int64_t(0), seekTime); NS_ASSERTION(seekTime >= 0 && seekTime <= end, "Can only seek in range [0,duration]"); - mCurrentSeek.mTarget.mTime = seekTime; + mCurrentSeek.mTarget.SetTime(media::TimeUnit::FromMicroseconds(seekTime)); mDropAudioUntilNextDiscontinuity = HasAudio(); mDropVideoUntilNextDiscontinuity = HasVideo(); @@ -1633,7 +1633,7 @@ MediaDecoderStateMachine::InitiateSeek() // dispatching SeekingStarted, playback doesn't advance and mess with // mCurrentPosition that we've setting to seekTime here. StopPlayback(); - UpdatePlaybackPositionInternal(mCurrentSeek.mTarget.mTime); + UpdatePlaybackPositionInternal(mCurrentSeek.mTarget.GetTime().ToMicroseconds()); mOnSeekingStart.Notify(mCurrentSeek.mTarget.mEventVisibility); @@ -1643,7 +1643,7 @@ MediaDecoderStateMachine::InitiateSeek() // Do the seek. RefPtr self = this; SeekTarget seekTarget = mCurrentSeek.mTarget; - seekTarget.mTime += StartTime(); + seekTarget.SetTime(seekTarget.GetTime() + media::TimeUnit::FromMicroseconds(StartTime())); mSeekRequest.Begin(InvokeAsync(DecodeTaskQueue(), mReader.get(), __func__, &MediaDecoderReader::Seek, seekTarget, Duration().ToMicroseconds()) @@ -2082,7 +2082,7 @@ MediaDecoderStateMachine::SeekCompleted() MOZ_ASSERT(OnTaskQueue()); MOZ_ASSERT(mState == DECODER_STATE_SEEKING); - int64_t seekTime = mCurrentSeek.mTarget.mTime; + int64_t seekTime = mCurrentSeek.mTarget.GetTime().ToMicroseconds(); int64_t newCurrentTime = seekTime; // Setup timestamp state. @@ -2514,7 +2514,7 @@ MediaDecoderStateMachine::DropVideoUpToSeekTarget(MediaData* aSample) DECODER_LOG("DropVideoUpToSeekTarget() frame [%lld, %lld]", video->mTime, video->GetEndTime()); MOZ_ASSERT(mCurrentSeek.Exists()); - const int64_t target = mCurrentSeek.mTarget.mTime; + const int64_t target = mCurrentSeek.mTarget.GetTime().ToMicroseconds(); // If the frame end time is less than the seek target, we won't want // to display this frame after the seek, so discard it. @@ -2556,13 +2556,13 @@ MediaDecoderStateMachine::DropAudioUpToSeekTarget(MediaData* aSample) return NS_ERROR_FAILURE; } - if (audio->mTime + sampleDuration.value() <= mCurrentSeek.mTarget.mTime) { + if (audio->mTime + sampleDuration.value() <= mCurrentSeek.mTarget.GetTime().ToMicroseconds()) { // Our seek target lies after the frames in this AudioData. Don't // push it onto the audio queue, and keep decoding forwards. return NS_OK; } - if (audio->mTime > mCurrentSeek.mTarget.mTime) { + if (audio->mTime > mCurrentSeek.mTarget.GetTime().ToMicroseconds()) { // The seek target doesn't lie in the audio block just after the last // audio frames we've seen which were before the seek target. This // could have been the first audio data we've seen after seek, i.e. the @@ -2578,13 +2578,13 @@ MediaDecoderStateMachine::DropAudioUpToSeekTarget(MediaData* aSample) // The seek target lies somewhere in this AudioData's frames, strip off // any frames which lie before the seek target, so we'll begin playback // exactly at the seek target. - NS_ASSERTION(mCurrentSeek.mTarget.mTime >= audio->mTime, + NS_ASSERTION(mCurrentSeek.mTarget.GetTime().ToMicroseconds() >= audio->mTime, "Target must at or be after data start."); - NS_ASSERTION(mCurrentSeek.mTarget.mTime < audio->mTime + sampleDuration.value(), + NS_ASSERTION(mCurrentSeek.mTarget.GetTime().ToMicroseconds() < audio->mTime + sampleDuration.value(), "Data must end after target."); CheckedInt64 framesToPrune = - UsecsToFrames(mCurrentSeek.mTarget.mTime - audio->mTime, mInfo.mAudio.mRate); + UsecsToFrames(mCurrentSeek.mTarget.GetTime().ToMicroseconds() - audio->mTime, mInfo.mAudio.mRate); if (!framesToPrune.isValid()) { return NS_ERROR_FAILURE; } @@ -2605,7 +2605,7 @@ MediaDecoderStateMachine::DropAudioUpToSeekTarget(MediaData* aSample) return NS_ERROR_FAILURE; } RefPtr data(new AudioData(audio->mOffset, - mCurrentSeek.mTarget.mTime, + mCurrentSeek.mTarget.GetTime().ToMicroseconds(), duration.value(), frames, Move(audioData), diff --git a/dom/media/MediaFormatReader.cpp b/dom/media/MediaFormatReader.cpp index c95011dd95c..f99fc1fdf38 100644 --- a/dom/media/MediaFormatReader.cpp +++ b/dom/media/MediaFormatReader.cpp @@ -1407,7 +1407,7 @@ MediaFormatReader::Seek(SeekTarget aTarget, int64_t aUnused) { MOZ_ASSERT(OnTaskQueue()); - LOG("aTarget=(%lld)", aTarget.mTime); + LOG("aTarget=(%lld)", aTarget.GetTime().ToMicroseconds()); MOZ_DIAGNOSTIC_ASSERT(mSeekPromise.IsEmpty()); MOZ_DIAGNOSTIC_ASSERT(!mVideo.HasPromise()); @@ -1425,7 +1425,7 @@ MediaFormatReader::Seek(SeekTarget aTarget, int64_t aUnused) return SeekPromise::CreateAndReject(NS_ERROR_FAILURE, __func__); } - mOriginalSeekTime = Some(media::TimeUnit::FromMicroseconds(aTarget.mTime)); + mOriginalSeekTime = Some(aTarget.GetTime()); mPendingSeekTime = mOriginalSeekTime; RefPtr p = mSeekPromise.Ensure(__func__); diff --git a/dom/media/SeekTarget.h b/dom/media/SeekTarget.h index 61c970c7935..7b3baf7a0ed 100644 --- a/dom/media/SeekTarget.h +++ b/dom/media/SeekTarget.h @@ -25,40 +25,60 @@ struct SeekTarget { Accurate }; SeekTarget() - : mTime(-1.0) - , mType(SeekTarget::Invalid) + : mType(SeekTarget::Invalid) , mEventVisibility(MediaDecoderEventVisibility::Observable) + , mTime(media::TimeUnit::Invalid()) { } SeekTarget(int64_t aTimeUsecs, Type aType, MediaDecoderEventVisibility aEventVisibility = MediaDecoderEventVisibility::Observable) - : mTime(aTimeUsecs) - , mType(aType) + : mType(aType) , mEventVisibility(aEventVisibility) + , mTime(media::TimeUnit::FromMicroseconds(aTimeUsecs)) + { + } + SeekTarget(const media::TimeUnit& aTime, + Type aType, + MediaDecoderEventVisibility aEventVisibility = + MediaDecoderEventVisibility::Observable) + : mType(aType) + , mEventVisibility(aEventVisibility) + , mTime(aTime) { } SeekTarget(const SeekTarget& aOther) - : mTime(aOther.mTime) - , mType(aOther.mType) + : mType(aOther.mType) , mEventVisibility(aOther.mEventVisibility) + , mTime(aOther.mTime) { } bool IsValid() const { return mType != SeekTarget::Invalid; } void Reset() { - mTime = -1; + mTime = media::TimeUnit::Invalid(); mType = SeekTarget::Invalid; } - // Seek target time in microseconds. - int64_t mTime; + media::TimeUnit GetTime() const { + NS_ASSERTION(mTime.IsValid(), "Invalid SeekTarget"); + return mTime; + } + void SetTime(const media::TimeUnit& aTime) { + NS_ASSERTION(aTime.IsValid(), "Invalid SeekTarget destination"); + mTime = aTime; + } + // Whether we should seek "Fast", or "Accurate". // "Fast" seeks to the seek point preceeding mTime, whereas // "Accurate" seeks as close as possible to mTime. Type mType; MediaDecoderEventVisibility mEventVisibility; + +private: + // Seek target time. + media::TimeUnit mTime; }; } // namespace mozilla diff --git a/dom/media/android/AndroidMediaReader.cpp b/dom/media/android/AndroidMediaReader.cpp index 44f47d6f8fb..9f5a7984d31 100644 --- a/dom/media/android/AndroidMediaReader.cpp +++ b/dom/media/android/AndroidMediaReader.cpp @@ -328,7 +328,7 @@ AndroidMediaReader::Seek(SeekTarget aTarget, int64_t aEndTime) // stream to the preceeding keyframe first, get the stream time, and then // seek the audio stream to match the video stream's time. Otherwise, the // audio and video streams won't be in sync after the seek. - mVideoSeekTimeUs = aTarget.mTime; + mVideoSeekTimeUs = aTarget.GetTime().ToMicroseconds(); RefPtr self = this; mSeekRequest.Begin(DecodeToFirstVideoData()->Then(OwnerThread(), __func__, [self] (MediaData* v) { @@ -337,12 +337,12 @@ AndroidMediaReader::Seek(SeekTarget aTarget, int64_t aEndTime) self->mSeekPromise.Resolve(self->mAudioSeekTimeUs, __func__); }, [self, aTarget] () { self->mSeekRequest.Complete(); - self->mAudioSeekTimeUs = aTarget.mTime; - self->mSeekPromise.Resolve(aTarget.mTime, __func__); + self->mAudioSeekTimeUs = aTarget.GetTime().ToMicroseconds(); + self->mSeekPromise.Resolve(aTarget.GetTime().ToMicroseconds(), __func__); })); } else { - mAudioSeekTimeUs = mVideoSeekTimeUs = aTarget.mTime; - mSeekPromise.Resolve(aTarget.mTime, __func__); + mAudioSeekTimeUs = mVideoSeekTimeUs = aTarget.GetTime().ToMicroseconds(); + mSeekPromise.Resolve(aTarget.GetTime().ToMicroseconds(), __func__); } return p; diff --git a/dom/media/directshow/DirectShowReader.cpp b/dom/media/directshow/DirectShowReader.cpp index f21b50a2dd2..8cd4bb53836 100644 --- a/dom/media/directshow/DirectShowReader.cpp +++ b/dom/media/directshow/DirectShowReader.cpp @@ -331,11 +331,11 @@ DirectShowReader::DecodeVideoFrame(bool &aKeyframeSkip, RefPtr DirectShowReader::Seek(SeekTarget aTarget, int64_t aEndTime) { - nsresult res = SeekInternal(aTarget.mTime); + nsresult res = SeekInternal(aTarget.GetTime().ToMicroseconds()); if (NS_FAILED(res)) { return SeekPromise::CreateAndReject(res, __func__); } else { - return SeekPromise::CreateAndResolve(aTarget.mTime, __func__); + return SeekPromise::CreateAndResolve(aTarget.GetTime().ToMicroseconds(), __func__); } } diff --git a/dom/media/ogg/OggReader.cpp b/dom/media/ogg/OggReader.cpp index a84e0a5ea8e..df3247efa3e 100644 --- a/dom/media/ogg/OggReader.cpp +++ b/dom/media/ogg/OggReader.cpp @@ -1410,11 +1410,11 @@ nsresult OggReader::SeekInUnbuffered(int64_t aTarget, RefPtr OggReader::Seek(SeekTarget aTarget, int64_t aEndTime) { - nsresult res = SeekInternal(aTarget.mTime, aEndTime); + nsresult res = SeekInternal(aTarget.GetTime().ToMicroseconds(), aEndTime); if (NS_FAILED(res)) { return SeekPromise::CreateAndReject(res, __func__); } else { - return SeekPromise::CreateAndResolve(aTarget.mTime, __func__); + return SeekPromise::CreateAndResolve(aTarget.GetTime().ToMicroseconds(), __func__); } } diff --git a/dom/media/omx/AudioOffloadPlayer.cpp b/dom/media/omx/AudioOffloadPlayer.cpp index 587c76314cf..670c6a965d7 100644 --- a/dom/media/omx/AudioOffloadPlayer.cpp +++ b/dom/media/omx/AudioOffloadPlayer.cpp @@ -346,11 +346,11 @@ status_t AudioOffloadPlayer::DoSeek() CHECK(mAudioSink.get()); AUDIO_OFFLOAD_LOG(LogLevel::Debug, - "DoSeek ( %lld )", mSeekTarget.mTime); + "DoSeek ( %lld )", mSeekTarget.GetTime().ToMicroseconds()); mReachedEOS = false; mPositionTimeMediaUs = -1; - mStartPosUs = mSeekTarget.mTime; + mStartPosUs = mSeekTarget.GetTime().ToMicroseconds(); if (!mSeekPromise.IsEmpty()) { nsCOMPtr nsEvent = @@ -388,7 +388,7 @@ int64_t AudioOffloadPlayer::GetMediaTimeUs() int64_t playPosition = 0; if (mSeekTarget.IsValid()) { - return mSeekTarget.mTime; + return mSeekTarget.GetTime().ToMicroseconds(); } if (!mStarted) { return mPositionTimeMediaUs; @@ -506,7 +506,7 @@ size_t AudioOffloadPlayer::FillBuffer(void* aData, size_t aSize) android::Mutex::Autolock autoLock(mLock); if (mSeekTarget.IsValid()) { - seekTimeUs = mSeekTarget.mTime; + seekTimeUs = mSeekTarget.GetTime().ToMicroseconds(); options.setSeekTo(seekTimeUs); refreshSeekTime = true; @@ -559,7 +559,7 @@ size_t AudioOffloadPlayer::FillBuffer(void* aData, size_t aSize) } if (mSeekTarget.IsValid() && - seekTimeUs == mSeekTarget.mTime) { + seekTimeUs == mSeekTarget.GetTime().ToMicroseconds()) { MOZ_ASSERT(mSeekTarget.IsValid()); mSeekTarget.Reset(); if (!mSeekPromise.IsEmpty()) { diff --git a/dom/media/omx/MediaOmxReader.cpp b/dom/media/omx/MediaOmxReader.cpp index 86d70aebea8..7eb1040701a 100644 --- a/dom/media/omx/MediaOmxReader.cpp +++ b/dom/media/omx/MediaOmxReader.cpp @@ -547,12 +547,12 @@ MediaOmxReader::Seek(SeekTarget aTarget, int64_t aEndTime) self->mSeekPromise.Resolve(self->mAudioSeekTimeUs, __func__); }, [self, aTarget] () { self->mSeekRequest.Complete(); - self->mAudioSeekTimeUs = aTarget.mTime; - self->mSeekPromise.Resolve(aTarget.mTime, __func__); + self->mAudioSeekTimeUs = aTarget.GetTime().ToMicroseconds(); + self->mSeekPromise.Resolve(aTarget.GetTime().ToMicroseconds(), __func__); })); } else { mAudioSeekTimeUs = mVideoSeekTimeUs = GetTime().ToMicroseconds(); - mSeekPromise.Resolve(aTarget.mTime, __func__); + mSeekPromise.Resolve(aTarget.GetTime().ToMicroseconds(), __func__); } return p; diff --git a/dom/media/omx/RtspOmxReader.cpp b/dom/media/omx/RtspOmxReader.cpp index caf2ab6baa1..29948c4716c 100644 --- a/dom/media/omx/RtspOmxReader.cpp +++ b/dom/media/omx/RtspOmxReader.cpp @@ -40,7 +40,7 @@ RtspOmxReader::Seek(SeekTarget aTarget, int64_t aEndTime) // Rtsp stream server through network and also clear the buffer data in // RtspMediaResource. if (mRtspResource) { - mRtspResource->SeekTime(aTarget.mTime); + mRtspResource->SeekTime(aTarget.GetTime().ToMicroseconds()); mRtspResource->EnablePlayoutDelay(); } diff --git a/dom/media/raw/RawReader.cpp b/dom/media/raw/RawReader.cpp index 71c6b368ce0..658c5c2163d 100644 --- a/dom/media/raw/RawReader.cpp +++ b/dom/media/raw/RawReader.cpp @@ -211,9 +211,9 @@ RawReader::Seek(SeekTarget aTarget, int64_t aEndTime) MOZ_ASSERT(OnTaskQueue()); uint32_t frame = mCurrentFrame; - if (aTarget.mTime >= UINT_MAX) + if (aTarget.GetTime().ToMicroseconds() >= UINT_MAX) return SeekPromise::CreateAndReject(NS_ERROR_FAILURE, __func__); - mCurrentFrame = aTarget.mTime * mFrameRate / USECS_PER_S; + mCurrentFrame = aTarget.GetTime().ToMicroseconds() * mFrameRate / USECS_PER_S; CheckedUint32 offset = CheckedUint32(mCurrentFrame) * mFrameSize; offset += sizeof(RawVideoHeader); @@ -233,12 +233,12 @@ RawReader::Seek(SeekTarget aTarget, int64_t aEndTime) }, [self, aTarget] () { MOZ_ASSERT(self->OnTaskQueue()); return self->mVideoQueue.Peek() && - self->mVideoQueue.Peek()->GetEndTime() >= aTarget.mTime; + self->mVideoQueue.Peek()->GetEndTime() >= aTarget.GetTime().ToMicroseconds(); })->Then(OwnerThread(), __func__, [self, p, aTarget] () { while (self->mVideoQueue.GetSize() >= 2) { RefPtr releaseMe = self->mVideoQueue.PopFront(); } - p->Resolve(aTarget.mTime, __func__); + p->Resolve(aTarget.GetTime().ToMicroseconds(), __func__); }, [self, p, frame] { self->mCurrentFrame = frame; self->mVideoQueue.Reset(); diff --git a/dom/media/wave/WaveReader.cpp b/dom/media/wave/WaveReader.cpp index f3e36ab6861..778d1d9ec11 100644 --- a/dom/media/wave/WaveReader.cpp +++ b/dom/media/wave/WaveReader.cpp @@ -275,15 +275,15 @@ RefPtr WaveReader::Seek(SeekTarget aTarget, int64_t aEndTime) { MOZ_ASSERT(OnTaskQueue()); - LOG(LogLevel::Debug, ("%p About to seek to %lld", mDecoder, aTarget.mTime)); + LOG(LogLevel::Debug, ("%p About to seek to %lld", mDecoder, aTarget.GetTime().ToMicroseconds())); if (NS_FAILED(ResetDecode())) { return SeekPromise::CreateAndReject(NS_ERROR_FAILURE, __func__); } double d = BytesToTime(GetDataLength()); NS_ASSERTION(d < INT64_MAX / USECS_PER_S, "Duration overflow"); - int64_t duration = static_cast(d * USECS_PER_S); - double seekTime = std::min(aTarget.mTime, duration) / static_cast(USECS_PER_S); + media::TimeUnit duration = media::TimeUnit::FromSeconds(d); + double seekTime = std::min(aTarget.GetTime(), duration).ToSeconds(); int64_t position = RoundDownToFrame(static_cast(TimeToBytes(seekTime))); NS_ASSERTION(INT64_MAX - mWavePCMOffset > position, "Integer overflow during wave seek"); position += mWavePCMOffset; @@ -291,7 +291,7 @@ WaveReader::Seek(SeekTarget aTarget, int64_t aEndTime) if (NS_FAILED(res)) { return SeekPromise::CreateAndReject(res, __func__); } else { - return SeekPromise::CreateAndResolve(aTarget.mTime, __func__); + return SeekPromise::CreateAndResolve(aTarget.GetTime().ToMicroseconds(), __func__); } } From 64624fb929ffce3c552b1bd5adb49e8856ab2161 Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Thu, 28 Jan 2016 21:20:29 +1100 Subject: [PATCH 004/117] Bug 1243608: P4. Have MediaDecoderReader::SeekPromise return a TimeUnit. r=cpearce --- dom/media/MediaDecoderReader.h | 2 +- dom/media/MediaDecoderStateMachine.cpp | 2 +- dom/media/MediaFormatReader.cpp | 4 ++-- dom/media/android/AndroidMediaReader.cpp | 6 +++--- dom/media/directshow/DirectShowReader.cpp | 2 +- dom/media/ogg/OggReader.cpp | 2 +- dom/media/omx/MediaOmxReader.cpp | 6 +++--- dom/media/raw/RawReader.cpp | 2 +- dom/media/wave/WaveReader.cpp | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/dom/media/MediaDecoderReader.h b/dom/media/MediaDecoderReader.h index 1836459f611..30d55438601 100644 --- a/dom/media/MediaDecoderReader.h +++ b/dom/media/MediaDecoderReader.h @@ -79,7 +79,7 @@ public: MozPromise, NotDecodedReason, IsExclusive>; using VideoDataPromise = MozPromise, NotDecodedReason, IsExclusive>; - using SeekPromise = MozPromise; + using SeekPromise = MozPromise; // Note that, conceptually, WaitForData makes sense in a non-exclusive sense. // But in the current architecture it's only ever used exclusively (by MDSM), diff --git a/dom/media/MediaDecoderStateMachine.cpp b/dom/media/MediaDecoderStateMachine.cpp index c6a7a1ad774..86ec56163da 100644 --- a/dom/media/MediaDecoderStateMachine.cpp +++ b/dom/media/MediaDecoderStateMachine.cpp @@ -1648,7 +1648,7 @@ MediaDecoderStateMachine::InitiateSeek() &MediaDecoderReader::Seek, seekTarget, Duration().ToMicroseconds()) ->Then(OwnerThread(), __func__, - [self] (int64_t) -> void { + [self] (media::TimeUnit) -> void { self->mSeekRequest.Complete(); // We must decode the first samples of active streams, so we can determine // the new stream time. So dispatch tasks to do that. diff --git a/dom/media/MediaFormatReader.cpp b/dom/media/MediaFormatReader.cpp index f99fc1fdf38..23c92568808 100644 --- a/dom/media/MediaFormatReader.cpp +++ b/dom/media/MediaFormatReader.cpp @@ -1530,7 +1530,7 @@ MediaFormatReader::OnVideoSeekCompleted(media::TimeUnit aTime) DoAudioSeek(); } else { mPendingSeekTime.reset(); - mSeekPromise.Resolve(aTime.ToMicroseconds(), __func__); + mSeekPromise.Resolve(aTime, __func__); } } @@ -1553,7 +1553,7 @@ MediaFormatReader::OnAudioSeekCompleted(media::TimeUnit aTime) LOGV("Audio seeked to %lld", aTime.ToMicroseconds()); mAudio.mSeekRequest.Complete(); mPendingSeekTime.reset(); - mSeekPromise.Resolve(aTime.ToMicroseconds(), __func__); + mSeekPromise.Resolve(aTime, __func__); } media::TimeIntervals diff --git a/dom/media/android/AndroidMediaReader.cpp b/dom/media/android/AndroidMediaReader.cpp index 9f5a7984d31..34d3c5b4a8f 100644 --- a/dom/media/android/AndroidMediaReader.cpp +++ b/dom/media/android/AndroidMediaReader.cpp @@ -334,15 +334,15 @@ AndroidMediaReader::Seek(SeekTarget aTarget, int64_t aEndTime) mSeekRequest.Begin(DecodeToFirstVideoData()->Then(OwnerThread(), __func__, [self] (MediaData* v) { self->mSeekRequest.Complete(); self->mAudioSeekTimeUs = v->mTime; - self->mSeekPromise.Resolve(self->mAudioSeekTimeUs, __func__); + self->mSeekPromise.Resolve(media::TimeUnit::FromMicroseconds(self->mAudioSeekTimeUs), __func__); }, [self, aTarget] () { self->mSeekRequest.Complete(); self->mAudioSeekTimeUs = aTarget.GetTime().ToMicroseconds(); - self->mSeekPromise.Resolve(aTarget.GetTime().ToMicroseconds(), __func__); + self->mSeekPromise.Resolve(aTarget.GetTime(), __func__); })); } else { mAudioSeekTimeUs = mVideoSeekTimeUs = aTarget.GetTime().ToMicroseconds(); - mSeekPromise.Resolve(aTarget.GetTime().ToMicroseconds(), __func__); + mSeekPromise.Resolve(aTarget.GetTime(), __func__); } return p; diff --git a/dom/media/directshow/DirectShowReader.cpp b/dom/media/directshow/DirectShowReader.cpp index 8cd4bb53836..24e6fa72f6b 100644 --- a/dom/media/directshow/DirectShowReader.cpp +++ b/dom/media/directshow/DirectShowReader.cpp @@ -335,7 +335,7 @@ DirectShowReader::Seek(SeekTarget aTarget, int64_t aEndTime) if (NS_FAILED(res)) { return SeekPromise::CreateAndReject(res, __func__); } else { - return SeekPromise::CreateAndResolve(aTarget.GetTime().ToMicroseconds(), __func__); + return SeekPromise::CreateAndResolve(aTarget.GetTime(), __func__); } } diff --git a/dom/media/ogg/OggReader.cpp b/dom/media/ogg/OggReader.cpp index df3247efa3e..31204fc3925 100644 --- a/dom/media/ogg/OggReader.cpp +++ b/dom/media/ogg/OggReader.cpp @@ -1414,7 +1414,7 @@ OggReader::Seek(SeekTarget aTarget, int64_t aEndTime) if (NS_FAILED(res)) { return SeekPromise::CreateAndReject(res, __func__); } else { - return SeekPromise::CreateAndResolve(aTarget.GetTime().ToMicroseconds(), __func__); + return SeekPromise::CreateAndResolve(aTarget.GetTime(), __func__); } } diff --git a/dom/media/omx/MediaOmxReader.cpp b/dom/media/omx/MediaOmxReader.cpp index 7eb1040701a..41acefc7ee9 100644 --- a/dom/media/omx/MediaOmxReader.cpp +++ b/dom/media/omx/MediaOmxReader.cpp @@ -544,15 +544,15 @@ MediaOmxReader::Seek(SeekTarget aTarget, int64_t aEndTime) mSeekRequest.Begin(DecodeToFirstVideoData()->Then(OwnerThread(), __func__, [self] (MediaData* v) { self->mSeekRequest.Complete(); self->mAudioSeekTimeUs = v->mTime; - self->mSeekPromise.Resolve(self->mAudioSeekTimeUs, __func__); + self->mSeekPromise.Resolve(media::TimeUnit::FromMicroseconds(self->mAudioSeekTimeUs), __func__); }, [self, aTarget] () { self->mSeekRequest.Complete(); self->mAudioSeekTimeUs = aTarget.GetTime().ToMicroseconds(); - self->mSeekPromise.Resolve(aTarget.GetTime().ToMicroseconds(), __func__); + self->mSeekPromise.Resolve(aTarget.GetTime(), __func__); })); } else { mAudioSeekTimeUs = mVideoSeekTimeUs = GetTime().ToMicroseconds(); - mSeekPromise.Resolve(aTarget.GetTime().ToMicroseconds(), __func__); + mSeekPromise.Resolve(aTarget.GetTime(), __func__); } return p; diff --git a/dom/media/raw/RawReader.cpp b/dom/media/raw/RawReader.cpp index 658c5c2163d..aa562d53d98 100644 --- a/dom/media/raw/RawReader.cpp +++ b/dom/media/raw/RawReader.cpp @@ -238,7 +238,7 @@ RawReader::Seek(SeekTarget aTarget, int64_t aEndTime) while (self->mVideoQueue.GetSize() >= 2) { RefPtr releaseMe = self->mVideoQueue.PopFront(); } - p->Resolve(aTarget.GetTime().ToMicroseconds(), __func__); + p->Resolve(aTarget.GetTime(), __func__); }, [self, p, frame] { self->mCurrentFrame = frame; self->mVideoQueue.Reset(); diff --git a/dom/media/wave/WaveReader.cpp b/dom/media/wave/WaveReader.cpp index 778d1d9ec11..b650ce8cb08 100644 --- a/dom/media/wave/WaveReader.cpp +++ b/dom/media/wave/WaveReader.cpp @@ -291,7 +291,7 @@ WaveReader::Seek(SeekTarget aTarget, int64_t aEndTime) if (NS_FAILED(res)) { return SeekPromise::CreateAndReject(res, __func__); } else { - return SeekPromise::CreateAndResolve(aTarget.GetTime().ToMicroseconds(), __func__); + return SeekPromise::CreateAndResolve(aTarget.GetTime(), __func__); } } From b89bc88b63c9934ed92f5764e77241cfacf306d2 Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Thu, 28 Jan 2016 23:24:06 +1100 Subject: [PATCH 005/117] Bug 1243608: P5. Add type utility methods to SeekTarget class. r=cpearce --- dom/media/MediaDecoderStateMachine.cpp | 14 +++++------ dom/media/SeekTarget.h | 33 ++++++++++++++++---------- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/dom/media/MediaDecoderStateMachine.cpp b/dom/media/MediaDecoderStateMachine.cpp index 86ec56163da..772555428b3 100644 --- a/dom/media/MediaDecoderStateMachine.cpp +++ b/dom/media/MediaDecoderStateMachine.cpp @@ -647,7 +647,7 @@ MediaDecoderStateMachine::OnAudioDecoded(MediaData* aAudioSample) if (!mDropAudioUntilNextDiscontinuity) { // We must be after the discontinuity; we're receiving samples // at or after the seek target. - if (mCurrentSeek.mTarget.mType == SeekTarget::PrevSyncPoint && + if (mCurrentSeek.mTarget.IsFast() && mCurrentSeek.mTarget.GetTime().ToMicroseconds() > mCurrentTimeBeforeSeek && audio->mTime < mCurrentTimeBeforeSeek) { // We are doing a fastSeek, but we ended up *before* the previous @@ -656,9 +656,9 @@ MediaDecoderStateMachine::OnAudioDecoded(MediaData* aAudioSample) // spec, fastSeek should always be fast, but until we get the time to // change all Readers to seek to the keyframe after the currentTime // in this case, we'll just decode forward. Bug 1026330. - mCurrentSeek.mTarget.mType = SeekTarget::Accurate; + mCurrentSeek.mTarget.SetType(SeekTarget::Accurate); } - if (mCurrentSeek.mTarget.mType == SeekTarget::PrevSyncPoint) { + if (mCurrentSeek.mTarget.IsFast()) { // Non-precise seek; we can stop the seek at the first sample. Push(audio, MediaData::AUDIO_DATA); } else { @@ -967,7 +967,7 @@ MediaDecoderStateMachine::OnVideoDecoded(MediaData* aVideoSample) if (!mDropVideoUntilNextDiscontinuity) { // We must be after the discontinuity; we're receiving samples // at or after the seek target. - if (mCurrentSeek.mTarget.mType == SeekTarget::PrevSyncPoint && + if (mCurrentSeek.mTarget.IsFast() && mCurrentSeek.mTarget.GetTime().ToMicroseconds() > mCurrentTimeBeforeSeek && video->mTime < mCurrentTimeBeforeSeek) { // We are doing a fastSeek, but we ended up *before* the previous @@ -976,9 +976,9 @@ MediaDecoderStateMachine::OnVideoDecoded(MediaData* aVideoSample) // spec, fastSeek should always be fast, but until we get the time to // change all Readers to seek to the keyframe after the currentTime // in this case, we'll just decode forward. Bug 1026330. - mCurrentSeek.mTarget.mType = SeekTarget::Accurate; + mCurrentSeek.mTarget.SetType(SeekTarget::Accurate); } - if (mCurrentSeek.mTarget.mType == SeekTarget::PrevSyncPoint || + if (mCurrentSeek.mTarget.IsFast() || mPendingSeek.Exists()) { // Non-precise seek; or a pending seek exists ; we can stop the seek // at the first sample. @@ -2548,7 +2548,7 @@ MediaDecoderStateMachine::DropAudioUpToSeekTarget(MediaData* aSample) RefPtr audio(aSample->As()); MOZ_ASSERT(audio && mCurrentSeek.Exists() && - mCurrentSeek.mTarget.mType == SeekTarget::Accurate); + mCurrentSeek.mTarget.IsAccurate()); CheckedInt64 sampleDuration = FramesToUsecs(audio->mFrames, mInfo.mAudio.mRate); diff --git a/dom/media/SeekTarget.h b/dom/media/SeekTarget.h index 7b3baf7a0ed..0d81ac58c6c 100644 --- a/dom/media/SeekTarget.h +++ b/dom/media/SeekTarget.h @@ -25,33 +25,33 @@ struct SeekTarget { Accurate }; SeekTarget() - : mType(SeekTarget::Invalid) - , mEventVisibility(MediaDecoderEventVisibility::Observable) + : mEventVisibility(MediaDecoderEventVisibility::Observable) , mTime(media::TimeUnit::Invalid()) + , mType(SeekTarget::Invalid) { } SeekTarget(int64_t aTimeUsecs, Type aType, MediaDecoderEventVisibility aEventVisibility = MediaDecoderEventVisibility::Observable) - : mType(aType) - , mEventVisibility(aEventVisibility) + : mEventVisibility(aEventVisibility) , mTime(media::TimeUnit::FromMicroseconds(aTimeUsecs)) + , mType(aType) { } SeekTarget(const media::TimeUnit& aTime, Type aType, MediaDecoderEventVisibility aEventVisibility = MediaDecoderEventVisibility::Observable) - : mType(aType) - , mEventVisibility(aEventVisibility) + : mEventVisibility(aEventVisibility) , mTime(aTime) + , mType(aType) { } SeekTarget(const SeekTarget& aOther) - : mType(aOther.mType) - , mEventVisibility(aOther.mEventVisibility) + : mEventVisibility(aOther.mEventVisibility) , mTime(aOther.mTime) + , mType(aOther.mType) { } bool IsValid() const { @@ -69,16 +69,25 @@ struct SeekTarget { NS_ASSERTION(aTime.IsValid(), "Invalid SeekTarget destination"); mTime = aTime; } + void SetType(Type aType) { + mType = aType; + } + bool IsFast() const { + return mType == SeekTarget::Type::PrevSyncPoint; + } + bool IsAccurate() const { + return mType == SeekTarget::Type::Accurate; + } - // Whether we should seek "Fast", or "Accurate". - // "Fast" seeks to the seek point preceeding mTime, whereas - // "Accurate" seeks as close as possible to mTime. - Type mType; MediaDecoderEventVisibility mEventVisibility; private: // Seek target time. media::TimeUnit mTime; + // Whether we should seek "Fast", or "Accurate". + // "Fast" seeks to the seek point preceeding mTime, whereas + // "Accurate" seeks as close as possible to mTime. + Type mType; }; } // namespace mozilla From f54117c21414514ae2be52c78558774e67c6cee5 Mon Sep 17 00:00:00 2001 From: Jean-Yves Avenard Date: Thu, 28 Jan 2016 23:25:15 +1100 Subject: [PATCH 006/117] Bug 1243608: P6. Only seek audio to video seek time when performing a fast seek. r=cpearce This allows for much faster seek time. --- dom/media/MediaFormatReader.cpp | 22 +++++++++++++--------- dom/media/MediaFormatReader.h | 2 +- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/dom/media/MediaFormatReader.cpp b/dom/media/MediaFormatReader.cpp index 23c92568808..b3e9590c418 100644 --- a/dom/media/MediaFormatReader.cpp +++ b/dom/media/MediaFormatReader.cpp @@ -1425,8 +1425,8 @@ MediaFormatReader::Seek(SeekTarget aTarget, int64_t aUnused) return SeekPromise::CreateAndReject(NS_ERROR_FAILURE, __func__); } - mOriginalSeekTime = Some(aTarget.GetTime()); - mPendingSeekTime = mOriginalSeekTime; + mOriginalSeekTarget = Some(aTarget); + mPendingSeekTime = Some(aTarget.GetTime()); RefPtr p = mSeekPromise.Ensure(__func__); @@ -1470,8 +1470,8 @@ MediaFormatReader::OnSeekFailed(TrackType aTrack, DemuxerFailureReason aResult) if (aResult == DemuxerFailureReason::WAITING_FOR_DATA) { if (HasVideo() && aTrack == TrackType::kAudioTrack && - mOriginalSeekTime.isSome() && - mPendingSeekTime.ref() != mOriginalSeekTime.ref()) { + mOriginalSeekTarget.isSome() && + mPendingSeekTime.ref() != mOriginalSeekTarget.ref().GetTime()) { // We have failed to seek audio where video seeked to earlier. // Attempt to seek instead to the closest point that we know we have in // order to limit A/V sync discrepency. @@ -1487,11 +1487,11 @@ MediaFormatReader::OnSeekFailed(TrackType aTrack, DemuxerFailureReason aResult) } } if (nextSeekTime.isNothing() || - nextSeekTime.ref() > mOriginalSeekTime.ref()) { - nextSeekTime = mOriginalSeekTime; + nextSeekTime.ref() > mOriginalSeekTarget.ref().GetTime()) { + nextSeekTime = Some(mOriginalSeekTarget.ref().GetTime()); LOG("Unable to seek audio to video seek time. A/V sync may be broken"); } else { - mOriginalSeekTime.reset(); + mOriginalSeekTarget.reset(); } mPendingSeekTime = nextSeekTime; DoAudioSeek(); @@ -1525,8 +1525,12 @@ MediaFormatReader::OnVideoSeekCompleted(media::TimeUnit aTime) mVideo.mSeekRequest.Complete(); if (HasAudio()) { - MOZ_ASSERT(mPendingSeekTime.isSome()); - mPendingSeekTime = Some(aTime); + MOZ_ASSERT(mPendingSeekTime.isSome() && mOriginalSeekTarget.isSome()); + if (mOriginalSeekTarget.ref().IsFast()) { + // We are performing a fast seek. We need to seek audio to where the + // video seeked to, to ensure proper A/V sync once playback resume. + mPendingSeekTime = Some(aTime); + } DoAudioSeek(); } else { mPendingSeekTime.reset(); diff --git a/dom/media/MediaFormatReader.h b/dom/media/MediaFormatReader.h index ad2b1e54c9b..d817abaf590 100644 --- a/dom/media/MediaFormatReader.h +++ b/dom/media/MediaFormatReader.h @@ -466,7 +466,7 @@ private: OnSeekFailed(TrackType::kAudioTrack, aFailure); } // Temporary seek information while we wait for the data - Maybe mOriginalSeekTime; + Maybe mOriginalSeekTarget; Maybe mPendingSeekTime; MozPromiseHolder mSeekPromise; From 1f53891ed3083c3447a8d755fab4b0103f04e580 Mon Sep 17 00:00:00 2001 From: Makoto Kato Date: Tue, 2 Feb 2016 17:05:56 +0900 Subject: [PATCH 007/117] Bug 1243268 - Support ImmSetCandidateWindow(CFS_EXCLUDE) on plugin process. r=masayuki --- dom/ipc/PBrowser.ipdl | 3 ++- dom/ipc/TabParent.cpp | 6 +++--- dom/ipc/TabParent.h | 4 ++-- dom/plugins/base/nsPluginInstanceOwner.cpp | 5 +++-- dom/plugins/base/nsPluginInstanceOwner.h | 3 ++- dom/plugins/ipc/PPluginInstance.ipdl | 6 +++--- dom/plugins/ipc/PluginInstanceChild.cpp | 18 +++++++++++++----- dom/plugins/ipc/PluginInstanceParent.cpp | 6 +++--- dom/plugins/ipc/PluginInstanceParent.h | 3 ++- widget/IMEData.h | 12 ++++++++++++ widget/PuppetWidget.cpp | 5 +++-- widget/PuppetWidget.h | 3 ++- widget/nsBaseWidget.h | 5 +++-- widget/nsGUIEventIPC.h | 20 ++++++++++++++++++++ widget/nsIWidget.h | 3 ++- widget/windows/nsWindow.cpp | 16 ++++++++++++---- widget/windows/nsWindow.h | 5 +++-- 17 files changed, 90 insertions(+), 33 deletions(-) diff --git a/dom/ipc/PBrowser.ipdl b/dom/ipc/PBrowser.ipdl index 5563adb6962..db35c241ba4 100644 --- a/dom/ipc/PBrowser.ipdl +++ b/dom/ipc/PBrowser.ipdl @@ -70,6 +70,7 @@ using class mozilla::dom::ipc::StructuredCloneData from "ipc/IPCMessageUtils.h"; using mozilla::EventMessage from "mozilla/EventForwards.h"; using nsEventStatus from "mozilla/EventForwards.h"; using nsSizeMode from "nsIWidgetListener.h"; +using mozilla::widget::CandidateWindowPosition from "ipc/nsGUIEventIPC.h"; namespace mozilla { namespace dom { @@ -284,7 +285,7 @@ parent: /** * Set IME candidate window by windowless plugin if plugin has focus. */ - async SetCandidateWindowForPlugin(int32_t aX, int32_t aY); + async SetCandidateWindowForPlugin(CandidateWindowPosition aPosition); /** * When plugin event isn't consumed, call this diff --git a/dom/ipc/TabParent.cpp b/dom/ipc/TabParent.cpp index 95de646b84c..6ea222e7c73 100644 --- a/dom/ipc/TabParent.cpp +++ b/dom/ipc/TabParent.cpp @@ -2392,15 +2392,15 @@ TabParent::RecvSetPluginFocused(const bool& aFocused) } bool -TabParent::RecvSetCandidateWindowForPlugin(const int32_t& aX, - const int32_t& aY) +TabParent::RecvSetCandidateWindowForPlugin( + const CandidateWindowPosition& aPosition) { nsCOMPtr widget = GetWidget(); if (!widget) { return true; } - widget->SetCandidateWindowForPlugin(aX, aY); + widget->SetCandidateWindowForPlugin(aPosition); return true; } diff --git a/dom/ipc/TabParent.h b/dom/ipc/TabParent.h index ae221996501..080ff547c29 100644 --- a/dom/ipc/TabParent.h +++ b/dom/ipc/TabParent.h @@ -238,8 +238,8 @@ public: virtual bool RecvSetPluginFocused(const bool& aFocused) override; - virtual bool RecvSetCandidateWindowForPlugin(const int32_t& aX, - const int32_t& aY) override; + virtual bool RecvSetCandidateWindowForPlugin( + const widget::CandidateWindowPosition& aPosition) override; virtual bool RecvDefaultProcOfPluginEvent(const WidgetPluginEvent& aEvent) override; diff --git a/dom/plugins/base/nsPluginInstanceOwner.cpp b/dom/plugins/base/nsPluginInstanceOwner.cpp index 0df46218d34..d52d352831f 100644 --- a/dom/plugins/base/nsPluginInstanceOwner.cpp +++ b/dom/plugins/base/nsPluginInstanceOwner.cpp @@ -941,7 +941,8 @@ nsPluginInstanceOwner::GetCompositionString(uint32_t aType, } bool -nsPluginInstanceOwner::SetCandidateWindow(int32_t aX, int32_t aY) +nsPluginInstanceOwner::SetCandidateWindow( + const widget::CandidateWindowPosition& aPosition) { if (NS_WARN_IF(!mPluginFrame)) { return false; @@ -955,7 +956,7 @@ nsPluginInstanceOwner::SetCandidateWindow(int32_t aX, int32_t aY) } } - widget->SetCandidateWindowForPlugin(aX, aY); + widget->SetCandidateWindowForPlugin(aPosition); return true; } diff --git a/dom/plugins/base/nsPluginInstanceOwner.h b/dom/plugins/base/nsPluginInstanceOwner.h index 556a9414a6f..69bb08da94f 100644 --- a/dom/plugins/base/nsPluginInstanceOwner.h +++ b/dom/plugins/base/nsPluginInstanceOwner.h @@ -269,7 +269,8 @@ public: bool GetCompositionString(uint32_t aIndex, nsTArray* aString, int32_t* aLength); - bool SetCandidateWindow(int32_t aX, int32_t aY); + bool SetCandidateWindow( + const mozilla::widget::CandidateWindowPosition& aPosition); bool RequestCommitOrCancel(bool aCommitted); private: diff --git a/dom/plugins/ipc/PPluginInstance.ipdl b/dom/plugins/ipc/PPluginInstance.ipdl index 0067a0dd266..ff09c7f8822 100644 --- a/dom/plugins/ipc/PPluginInstance.ipdl +++ b/dom/plugins/ipc/PPluginInstance.ipdl @@ -31,6 +31,7 @@ using mozilla::layers::SurfaceDescriptorX11 from "gfxipc/ShadowLayerUtils.h"; using nsIntRect from "nsRect.h"; using mozilla::gfx::SurfaceFormat from "mozilla/gfx/Types.h"; using struct DxgiAdapterDesc from "mozilla/D3DMessageUtils.h"; +using struct mozilla::widget::CandidateWindowPosition from "ipc/nsGUIEventIPC.h"; namespace mozilla { namespace plugins { @@ -264,9 +265,8 @@ parent: returns (uint8_t[] aDist, int32_t aLength); // Set candidate window position. // - // @param aX x position of candidate window - // @param aY y position of candidate window - async SetCandidateWindow(int32_t aX, int32_t aY); + // @param aPosition position information of candidate window + async SetCandidateWindow(CandidateWindowPosition aPosition); async RequestCommitOrCancel(bool aCommitted); both: diff --git a/dom/plugins/ipc/PluginInstanceChild.cpp b/dom/plugins/ipc/PluginInstanceChild.cpp index 7f0144eea60..e276f293942 100644 --- a/dom/plugins/ipc/PluginInstanceChild.cpp +++ b/dom/plugins/ipc/PluginInstanceChild.cpp @@ -2065,14 +2065,22 @@ PluginInstanceChild::ImmSetCandidateWindowProc(HIMC aIMC, LPCANDIDATEFORM aForm) } if (!sCurrentPluginInstance || - aForm->dwIndex != 0 || - !(aForm->dwStyle & CFS_CANDIDATEPOS)) { - // Flash only uses CFS_CANDIDATEPOS with index == 0. + aForm->dwIndex != 0) { return FALSE; } - sCurrentPluginInstance->SendSetCandidateWindow( - aForm->ptCurrentPos.x, aForm->ptCurrentPos.y); + CandidateWindowPosition position; + position.mPoint.x = aForm->ptCurrentPos.x; + position.mPoint.y = aForm->ptCurrentPos.y; + position.mExcludeRect = !!(aForm->dwStyle & CFS_EXCLUDE); + if (position.mExcludeRect) { + position.mRect.x = aForm->rcArea.left; + position.mRect.y = aForm->rcArea.top; + position.mRect.width = aForm->rcArea.right - aForm->rcArea.left; + position.mRect.height = aForm->rcArea.bottom - aForm->rcArea.top; + } + + sCurrentPluginInstance->SendSetCandidateWindow(position); return TRUE; } diff --git a/dom/plugins/ipc/PluginInstanceParent.cpp b/dom/plugins/ipc/PluginInstanceParent.cpp index 8dcbd99c464..ea755c042e3 100644 --- a/dom/plugins/ipc/PluginInstanceParent.cpp +++ b/dom/plugins/ipc/PluginInstanceParent.cpp @@ -2396,13 +2396,13 @@ PluginInstanceParent::RecvGetCompositionString(const uint32_t& aIndex, } bool -PluginInstanceParent::RecvSetCandidateWindow(const int32_t& aX, - const int32_t& aY) +PluginInstanceParent::RecvSetCandidateWindow( + const mozilla::widget::CandidateWindowPosition& aPosition) { #if defined(OS_WIN) nsPluginInstanceOwner* owner = GetOwner(); if (owner) { - owner->SetCandidateWindow(aX, aY); + owner->SetCandidateWindow(aPosition); } #endif return true; diff --git a/dom/plugins/ipc/PluginInstanceParent.h b/dom/plugins/ipc/PluginInstanceParent.h index 2e211824c0f..751cc72574d 100644 --- a/dom/plugins/ipc/PluginInstanceParent.h +++ b/dom/plugins/ipc/PluginInstanceParent.h @@ -359,7 +359,8 @@ public: nsTArray* aBuffer, int32_t* aLength) override; virtual bool - RecvSetCandidateWindow(const int32_t& aX, const int32_t& aY) override; + RecvSetCandidateWindow( + const mozilla::widget::CandidateWindowPosition& aPosition) override; virtual bool RecvRequestCommitOrCancel(const bool& aCommitted) override; diff --git a/widget/IMEData.h b/widget/IMEData.h index 4e2adb55cd7..8c022331942 100644 --- a/widget/IMEData.h +++ b/widget/IMEData.h @@ -859,6 +859,18 @@ struct IMENotification final } }; +struct CandidateWindowPosition +{ + // Upper left corner of the candidate window if mExcludeRect is false. + // Otherwise, the position currently interested. E.g., caret position. + LayoutDeviceIntPoint mPoint; + // Rect which shouldn't be overlapped with the candidate window. + // This is valid only when mExcludeRect is true. + LayoutDeviceIntRect mRect; + // See explanation of mPoint and mRect. + bool mExcludeRect; +}; + } // namespace widget } // namespace mozilla diff --git a/widget/PuppetWidget.cpp b/widget/PuppetWidget.cpp index 5f27f6e4dbb..74dd4a31aa8 100644 --- a/widget/PuppetWidget.cpp +++ b/widget/PuppetWidget.cpp @@ -1414,13 +1414,14 @@ PuppetWidget::GetCurrentWidgetListener() } void -PuppetWidget::SetCandidateWindowForPlugin(int32_t aX, int32_t aY) +PuppetWidget::SetCandidateWindowForPlugin( + const CandidateWindowPosition& aPosition) { if (!mTabChild) { return; } - mTabChild->SendSetCandidateWindowForPlugin(aX, aY); + mTabChild->SendSetCandidateWindowForPlugin(aPosition); } void diff --git a/widget/PuppetWidget.h b/widget/PuppetWidget.h index a9ea5c03626..bca266879c3 100644 --- a/widget/PuppetWidget.h +++ b/widget/PuppetWidget.h @@ -253,7 +253,8 @@ public: virtual void StartAsyncScrollbarDrag(const AsyncDragMetrics& aDragMetrics) override; - virtual void SetCandidateWindowForPlugin(int32_t aX, int32_t aY) override; + virtual void SetCandidateWindowForPlugin( + const CandidateWindowPosition& aPosition) override; virtual void ZoomToRect(const uint32_t& aPresShellId, const FrameMetrics::ViewID& aViewId, diff --git a/widget/nsBaseWidget.h b/widget/nsBaseWidget.h index 34729aaa3fd..d3a74b35f57 100644 --- a/widget/nsBaseWidget.h +++ b/widget/nsBaseWidget.h @@ -223,8 +223,9 @@ public: { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHOD SetPluginFocused(bool& aFocused) override { return NS_ERROR_NOT_IMPLEMENTED; } - virtual void SetCandidateWindowForPlugin(int32_t aX, - int32_t aY) override + virtual void SetCandidateWindowForPlugin( + const mozilla::widget::CandidateWindowPosition& + aPosition) override { } virtual void DefaultProcOfPluginEvent( const mozilla::WidgetPluginEvent& aEvent) override diff --git a/widget/nsGUIEventIPC.h b/widget/nsGUIEventIPC.h index a9d75142b94..964625feabd 100644 --- a/widget/nsGUIEventIPC.h +++ b/widget/nsGUIEventIPC.h @@ -950,6 +950,26 @@ struct ParamTraits } }; +template<> +struct ParamTraits +{ + typedef mozilla::widget::CandidateWindowPosition paramType; + + static void Write(Message* aMsg, const paramType& aParam) + { + WriteParam(aMsg, aParam.mPoint); + WriteParam(aMsg, aParam.mRect); + WriteParam(aMsg, aParam.mExcludeRect); + } + + static bool Read(const Message* aMsg, void** aIter, paramType* aResult) + { + return ReadParam(aMsg, aIter, &aResult->mPoint) && + ReadParam(aMsg, aIter, &aResult->mRect) && + ReadParam(aMsg, aIter, &aResult->mExcludeRect); + } +}; + } // namespace IPC #endif // nsGUIEventIPC_h__ diff --git a/widget/nsIWidget.h b/widget/nsIWidget.h index 02b31c0b386..7c99fc42bc2 100644 --- a/widget/nsIWidget.h +++ b/widget/nsIWidget.h @@ -1835,7 +1835,8 @@ public: /** * Set IME candidate window position by windowless plugin. */ - virtual void SetCandidateWindowForPlugin(int32_t aX, int32_t aY) = 0; + virtual void SetCandidateWindowForPlugin( + const mozilla::widget::CandidateWindowPosition& aPosition) = 0; /** * Handle default action when PluginEvent isn't handled diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp index 1dd17237cae..4cdb114238b 100644 --- a/widget/windows/nsWindow.cpp +++ b/widget/windows/nsWindow.cpp @@ -7843,13 +7843,21 @@ nsWindow::ComputeShouldAccelerate() } void -nsWindow::SetCandidateWindowForPlugin(int32_t aX, int32_t aY) +nsWindow::SetCandidateWindowForPlugin(const CandidateWindowPosition& aPosition) { CANDIDATEFORM form; form.dwIndex = 0; - form.dwStyle = CFS_CANDIDATEPOS; - form.ptCurrentPos.x = aX; - form.ptCurrentPos.y = aY; + if (aPosition.mExcludeRect) { + form.dwStyle = CFS_EXCLUDE; + form.rcArea.left = aPosition.mRect.x; + form.rcArea.top = aPosition.mRect.y; + form.rcArea.right = aPosition.mRect.x + aPosition.mRect.width; + form.rcArea.bottom = aPosition.mRect.y + aPosition.mRect.height; + } else { + form.dwStyle = CFS_CANDIDATEPOS; + } + form.ptCurrentPos.x = aPosition.mPoint.x; + form.ptCurrentPos.y = aPosition.mPoint.y; IMEHandler::SetCandidateWindow(this, &form); } diff --git a/widget/windows/nsWindow.h b/widget/windows/nsWindow.h index 95faa6ca2f9..505558b95f6 100644 --- a/widget/windows/nsWindow.h +++ b/widget/windows/nsWindow.h @@ -305,8 +305,9 @@ public: const IMEContext& DefaultIMC() const { return mDefaultIMC; } - virtual void SetCandidateWindowForPlugin(int32_t aX, - int32_t aY) override; + virtual void SetCandidateWindowForPlugin( + const mozilla::widget::CandidateWindowPosition& + aPosition) override; virtual void DefaultProcOfPluginEvent( const mozilla::WidgetPluginEvent& aEvent) override; From 998623d5f56fa4f181d7c26700390558cb471045 Mon Sep 17 00:00:00 2001 From: Makoto Kato Date: Tue, 2 Feb 2016 17:06:14 +0900 Subject: [PATCH 008/117] Bug 1243268 - Adjust ATOK workaround. r=masayuki --- widget/windows/IMMHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/widget/windows/IMMHandler.cpp b/widget/windows/IMMHandler.cpp index 24e901fe235..1666d686a54 100644 --- a/widget/windows/IMMHandler.cpp +++ b/widget/windows/IMMHandler.cpp @@ -2756,7 +2756,7 @@ IMMHandler::SetCandidateWindow(nsWindow* aWindow, CANDIDATEFORM* aForm) { // Hack for ATOK. ATOK (Japanese IME) refers native caret position at // deciding candidate window position. - if (aForm->dwStyle == CFS_CANDIDATEPOS && aWindow->PluginHasFocus()) { + if (aWindow->PluginHasFocus()) { // We cannot retrieve proper character height from plugin. Therefore, // we should assume that the caret height is always 20px since if less than // this height, candidate window may overlap with composition string when From 91dff6a5bd5bab592031fc77d784e326db6efae1 Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Tue, 26 Jan 2016 15:09:00 +0100 Subject: [PATCH 009/117] Bug 1243198 - Use rvalue references for JS::ubi::ByFilename constructor; r=jimb This change makes it a bit more clear that ByFilename is taking ownership of the given arguments. --- js/src/vm/UbiNodeCensus.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/src/vm/UbiNodeCensus.cpp b/js/src/vm/UbiNodeCensus.cpp index d48af700841..b6fe2c5cea0 100644 --- a/js/src/vm/UbiNodeCensus.cpp +++ b/js/src/vm/UbiNodeCensus.cpp @@ -773,7 +773,7 @@ class ByFilename : public CountType { CountTypePtr noFilenameType; public: - ByFilename(CountTypePtr& thenType, CountTypePtr& noFilenameType) + ByFilename(CountTypePtr&& thenType, CountTypePtr&& noFilenameType) : CountType(), thenType(Move(thenType)), noFilenameType(Move(noFilenameType)) @@ -1037,7 +1037,7 @@ ParseBreakdown(JSContext* cx, HandleValue breakdownValue) if (!noFilenameType) return nullptr; - return CountTypePtr(js_new(thenType, noFilenameType)); + return CountTypePtr(js_new(Move(thenType), Move(noFilenameType))); } // We didn't recognize the breakdown type; complain. From b54325012704d52cb4ee5bcd8d4b319f24b801b9 Mon Sep 17 00:00:00 2001 From: Kaku Kuo Date: Mon, 25 Jan 2016 19:15:27 +0800 Subject: [PATCH 010/117] Bug 1242338 - fix numerical issue in MediaDecoder::Seek(); r=jwwang --- dom/media/MediaDecoder.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/dom/media/MediaDecoder.cpp b/dom/media/MediaDecoder.cpp index 323294ca958..db5b9ed9159 100644 --- a/dom/media/MediaDecoder.cpp +++ b/dom/media/MediaDecoder.cpp @@ -805,9 +805,7 @@ MediaDecoder::Seek(double aTime, SeekTarget::Type aSeekType) MOZ_ASSERT(!mIsDormant, "should be out of dormant by now"); MOZ_ASSERT(aTime >= 0.0, "Cannot seek to a negative value."); - int64_t timeUsecs = 0; - nsresult rv = SecondsToUsecs(aTime, timeUsecs); - NS_ENSURE_SUCCESS(rv, rv); + int64_t timeUsecs = TimeUnit::FromSeconds(aTime).ToMicroseconds(); mLogicalPosition = aTime; mWasEndedWhenEnteredDormant = false; From c8bc8aba9ad3adf88e61733f25c2ceacd9a0258f Mon Sep 17 00:00:00 2001 From: Kaku Kuo Date: Mon, 25 Jan 2016 17:57:57 +0800 Subject: [PATCH 011/117] Bug 1242338 - test cases; r=jwwang --- dom/media/test/manifest.js | 5 ++- dom/media/test/mochitest.ini | 1 + dom/media/test/test_bug1242338.html | 66 +++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 dom/media/test/test_bug1242338.html diff --git a/dom/media/test/manifest.js b/dom/media/test/manifest.js index 88da24fa794..6c74c46b652 100644 --- a/dom/media/test/manifest.js +++ b/dom/media/test/manifest.js @@ -480,7 +480,10 @@ var gSeekTests = [ { name:"detodos.opus", type:"audio/ogg; codecs=opus", duration:2.9135 }, { name:"gizmo.mp4", type:"video/mp4", duration:5.56 }, { name:"owl.mp3", type:"audio/mpeg", duration:3.343 }, - { name:"bogus.duh", type:"bogus/duh", duration:123 } + { name:"bogus.duh", type:"bogus/duh", duration:123 }, + + // Bug 1242338: hit a numerical problem while seeking to the duration. + { name:"bug482461-theora.ogv", type:"video/ogg", duration:4.138 }, ]; var gFastSeekTests = [ diff --git a/dom/media/test/mochitest.ini b/dom/media/test/mochitest.ini index 84ac2aeed39..4540ee6087a 100644 --- a/dom/media/test/mochitest.ini +++ b/dom/media/test/mochitest.ini @@ -601,6 +601,7 @@ skip-if = os == 'win' && !debug # bug 1140675 [test_bug1018933.html] [test_bug1113600.html] tags=capturestream +[test_bug1242338.html] [test_can_play_type.html] [test_can_play_type_mpeg.html] skip-if = buildapp == 'b2g' || (toolkit == 'android' && processor == 'x86') # bug 1021675 #x86 only bug 914439 diff --git a/dom/media/test/test_bug1242338.html b/dom/media/test/test_bug1242338.html new file mode 100644 index 00000000000..c404d7b1dbf --- /dev/null +++ b/dom/media/test/test_bug1242338.html @@ -0,0 +1,66 @@ + + + + Test Bug 1242338 + + + + + +
+
+
+ + \ No newline at end of file From 2693ddff631cedc2c7dcc63dcab6c34a1a2bb571 Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Mon, 1 Feb 2016 00:46:00 +0100 Subject: [PATCH 012/117] Bug 1244080 - Part 0: Remove unnecessary argument for remove(). r=bbirtles --- dom/animation/test/chrome/test_restyles.html | 28 ++++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/dom/animation/test/chrome/test_restyles.html b/dom/animation/test/chrome/test_restyles.html index ce0b9975f74..51c41d55886 100644 --- a/dom/animation/test/chrome/test_restyles.html +++ b/dom/animation/test/chrome/test_restyles.html @@ -81,7 +81,7 @@ waitForAllPaints(function() { is(markers.length, 0, 'CSS animations running on the compositor should not update style ' + 'on the main thread'); - div.remove(div); + div.remove(); }); add_task_if_omta_enabled(function* no_restyling_for_compositor_transitions() { @@ -98,7 +98,7 @@ waitForAllPaints(function() { is(markers.length, 0, 'CSS transitions running on the compositor should not update style ' + 'on the main thread'); - div.remove(div); + div.remove(); }); add_task_if_omta_enabled(function* no_restyling_when_animation_duration_is_changed() { @@ -114,7 +114,7 @@ waitForAllPaints(function() { is(markers.length, 0, 'Animations running on the compositor should not update style ' + 'on the main thread'); - div.remove(div); + div.remove(); }); add_task_if_omta_enabled(function* only_one_restyling_after_finish_is_called() { @@ -130,7 +130,7 @@ waitForAllPaints(function() { is(markers.length, 1, 'Animations running on the compositor should only update style ' + 'once after finish() is called'); - div.remove(div); + div.remove(); }); add_task(function* no_restyling_mouse_movement_on_finished_transition() { @@ -155,7 +155,7 @@ waitForAllPaints(function() { is(markers.length, 0, 'Bug 1219236: Finished transitions should never cause restyles ' + 'when mouse is moved on the animations'); - div.remove(div); + div.remove(); }); add_task(function* no_restyling_mouse_movement_on_finished_animation() { @@ -178,7 +178,7 @@ waitForAllPaints(function() { is(markers.length, 0, 'Bug 1219236: Finished animations should never cause restyles ' + 'when mouse is moved on the animations'); - div.remove(div); + div.remove(); }); add_task_if_omta_enabled(function* no_restyling_compositor_animations_out_of_view_element() { @@ -194,7 +194,7 @@ waitForAllPaints(function() { todo_is(markers.length, 0, 'Bug 1166500: Animations running on the compositor in out of ' + 'view element should never cause restyles'); - div.remove(div); + div.remove(); }); add_task(function* no_restyling_main_thread_animations_out_of_view_element() { @@ -208,7 +208,7 @@ waitForAllPaints(function() { todo_is(markers.length, 0, 'Bug 1166500: Animations running on the main-thread in out of ' + 'view element should never cause restyles'); - div.remove(div); + div.remove(); }); /* @@ -249,7 +249,7 @@ waitForAllPaints(function() { todo_is(markers.length, 0, 'Bug 1166500: Animations running on the main-thread in elements ' + 'which are scrolled out should never cause restyles'); - parentElement.remove(div); + parentElement.remove(); }); /* @@ -269,7 +269,7 @@ waitForAllPaints(function() { todo_is(markers.length, 0, 'Bug 1237454: Animations running on the compositor in ' + 'visibility hidden element should never cause restyles'); - div.remove(div); + div.remove(); }); */ @@ -284,7 +284,7 @@ waitForAllPaints(function() { todo_is(markers.length, 0, 'Bug 1237454: Animations running on the main-thread in ' + 'visibility hidden element should never cause restyles'); - div.remove(div); + div.remove(); }); add_task_if_omta_enabled(function* no_restyling_compositor_animations_after_pause_is_called() { @@ -302,10 +302,10 @@ waitForAllPaints(function() { is(markers.length, 0, 'Bug 1232563: Paused animations running on the compositor should ' + 'never cause restyles once after pause() is called'); - div.remove(div); + div.remove(); }); - add_task(function* no_restyling_matn_thread_animations_after_pause_is_called() { + add_task(function* no_restyling_main_thread_animations_after_pause_is_called() { var div = addDiv(null, { style: 'animation: background-color 100s' }); var animation = div.getAnimations()[0]; @@ -319,7 +319,7 @@ waitForAllPaints(function() { is(markers.length, 0, 'Bug 1232563: Paused animations running on the main-thread should ' + 'never cause restyles after pause() is called'); - div.remove(div); + div.remove(); }); }); From 18e74fef43828b27ed0e33726210722432bd558e Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Mon, 1 Feb 2016 00:46:00 +0100 Subject: [PATCH 013/117] Bug 1244080 - Part 1: Test that setting duration in the middle of the animation causes only once a restyling. r=bbirtles --- dom/animation/test/chrome/test_restyles.html | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/dom/animation/test/chrome/test_restyles.html b/dom/animation/test/chrome/test_restyles.html index 51c41d55886..17b20993e08 100644 --- a/dom/animation/test/chrome/test_restyles.html +++ b/dom/animation/test/chrome/test_restyles.html @@ -322,6 +322,21 @@ waitForAllPaints(function() { div.remove(); }); + add_task_if_omta_enabled(function* only_one_restyling_when_current_time_is_set_to_middle_of_duration() { + var div = addDiv(null, { style: 'animation: opacity 100s' }); + var animation = div.getAnimations()[0]; + + yield animation.ready; + + animation.currentTime = 50000; // 50s + + var markers = yield observeStyling(5); + is(markers.length, 1, + 'Bug 1235478: Animations running on the compositor should only once ' + + 'update style when currentTime is set to middle of duration time'); + div.remove(); + }); + }); From 9dbdcd17671bd6ea5217c3d8caa6b51f80745987 Mon Sep 17 00:00:00 2001 From: Milan Sreckovic Date: Mon, 1 Feb 2016 13:34:00 +0100 Subject: [PATCH 014/117] Bug 1244735 - Preference to override the default behaviour for partial present. r=jrmuizel --- gfx/layers/d3d11/CompositorD3D11.cpp | 25 ++++++++++++++++++------- gfx/thebes/gfxPrefs.h | 1 + 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/gfx/layers/d3d11/CompositorD3D11.cpp b/gfx/layers/d3d11/CompositorD3D11.cpp index 991aa1a5f46..46815a59d26 100644 --- a/gfx/layers/d3d11/CompositorD3D11.cpp +++ b/gfx/layers/d3d11/CompositorD3D11.cpp @@ -1126,13 +1126,24 @@ CompositorD3D11::EndFrame() if (oldSize == mSize) { RefPtr chain; HRESULT hr = mSwapChain->QueryInterface((IDXGISwapChain1**)getter_AddRefs(chain)); - nsString vendorID; - nsCOMPtr gfxInfo = services::GetGfxInfo(); - gfxInfo->GetAdapterVendorID(vendorID); - bool isNvidia = vendorID.EqualsLiteral("0x10de") && !gfxWindowsPlatform::GetPlatform()->IsWARP(); - if (SUCCEEDED(hr) && chain && !isNvidia) { - // Avoid partial present on Nvidia hardware to try to work around - // bug 1189940 + // We can force partial present or block partial present, based on the value of + // this preference; the default is to disable it on Nvidia (bug 1189940) + bool allowPartialPresent = false; + + int32_t partialPresentPref = gfxPrefs::PartialPresent(); + if (partialPresentPref > 0) { + allowPartialPresent = true; + } else if (partialPresentPref < 0) { + allowPartialPresent = false; + } else if (partialPresentPref == 0) { + nsString vendorID; + nsCOMPtr gfxInfo = services::GetGfxInfo(); + gfxInfo->GetAdapterVendorID(vendorID); + allowPartialPresent = !vendorID.EqualsLiteral("0x10de") || + gfxWindowsPlatform::GetPlatform()->IsWARP(); + } + + if (SUCCEEDED(hr) && chain && allowPartialPresent) { DXGI_PRESENT_PARAMETERS params; PodZero(¶ms); params.DirtyRectsCount = mInvalidRegion.GetNumRects(); diff --git a/gfx/thebes/gfxPrefs.h b/gfx/thebes/gfxPrefs.h index 17c3a74ed5f..ad2f85f8fa8 100644 --- a/gfx/thebes/gfxPrefs.h +++ b/gfx/thebes/gfxPrefs.h @@ -257,6 +257,7 @@ private: // The maximums here are quite conservative, we can tighten them if problems show up. DECL_GFX_PREF(Once, "gfx.max-alloc-size", MaxAllocSize, int32_t, (int32_t)500000000); DECL_GFX_PREF(Once, "gfx.max-texture-size", MaxTextureSize, int32_t, (int32_t)32767); + DECL_GFX_PREF(Live, "gfx.partialpresent.force", PartialPresent, int32_t, 0); DECL_GFX_PREF(Live, "gfx.perf-warnings.enabled", PerfWarnings, bool, false); DECL_GFX_PREF(Live, "gfx.SurfaceTexture.detach.enabled", SurfaceTextureDetachEnabled, bool, true); DECL_GFX_PREF(Live, "gfx.testing.device-reset", DeviceResetForTesting, int32_t, 0); From ed60a4089bfe346025993fef0728e384274bee75 Mon Sep 17 00:00:00 2001 From: Gerald Squelart Date: Tue, 2 Feb 2016 20:20:03 +1100 Subject: [PATCH 015/117] Bug 1239983 - Diags around TrackBuffersMgr promises - r=jya Added diagnostics around demuxer init/reset promises, to catch early cases where TrackBuffersManager::mInputDemuxer is destroyed while an init/reset promise is in flight, which would cause later issues when the 'Then' clause assumes that mInputDemuxer still exists. Note: This is *not* an actual fix for crashes linked to this bug, but it should help identify unexpected situations, or instead eliminate these patched locations as sources of crashes. A new bug will be needed to examine the fallout from this patch and produce a real fix, or continue investigating. --- dom/media/mediasource/TrackBuffersManager.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dom/media/mediasource/TrackBuffersManager.cpp b/dom/media/mediasource/TrackBuffersManager.cpp index 81697c90578..20f42b1e0c9 100644 --- a/dom/media/mediasource/TrackBuffersManager.cpp +++ b/dom/media/mediasource/TrackBuffersManager.cpp @@ -786,6 +786,9 @@ TrackBuffersManager::ShutdownDemuxers() mAudioTracks.mDemuxer->BreakCycles(); mAudioTracks.mDemuxer = nullptr; } + // We shouldn't change mInputDemuxer while a demuxer init/reset request is + // being processed. See bug 1239983. + MOZ_DIAGNOSTIC_ASSERT(!mDemuxerInitRequest.Exists()); mInputDemuxer = nullptr; mLastParsedEndTime.reset(); } @@ -843,6 +846,9 @@ TrackBuffersManager::OnDemuxerResetDone(nsresult) RejectAppend(NS_ERROR_ABORT, __func__); return; } + // mInputDemuxer shouldn't have been destroyed while a demuxer init/reset + // request was being processed. See bug 1239983. + MOZ_DIAGNOSTIC_ASSERT(mInputDemuxer); // Recreate track demuxers. uint32_t numVideos = mInputDemuxer->GetNumberTracks(TrackInfo::kVideoTrack); @@ -918,6 +924,9 @@ TrackBuffersManager::OnDemuxerInitDone(nsresult) RejectAppend(NS_ERROR_ABORT, __func__); return; } + // mInputDemuxer shouldn't have been destroyed while a demuxer init/reset + // request was being processed. See bug 1239983. + MOZ_DIAGNOSTIC_ASSERT(mInputDemuxer); MediaInfo info; From 954b74edeb5f18327c98d516d2a22e2d5d94265b Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Sun, 24 Jan 2016 10:03:00 +0100 Subject: [PATCH 016/117] Bug 1242270 - Add SPS pseudo frames for the Array.prototype methods; r=shu This commit adds SPS pseudo frames for the Array.prototype methods that are not self-hosted. This provides better insight into where time is spent when profiling. Self-hosted methods do not need special treatment, as they will be seen by the usual JS stack sampling. --- js/src/jsarray.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/js/src/jsarray.cpp b/js/src/jsarray.cpp index 66c43943c40..d476509907a 100644 --- a/js/src/jsarray.cpp +++ b/js/src/jsarray.cpp @@ -1194,6 +1194,7 @@ js::array_join(JSContext* cx, unsigned argc, Value* vp) { JS_CHECK_RECURSION(cx, return false); + AutoSPSEntry pseudoFrame(cx->runtime(), "Array.prototype.join"); CallArgs args = CallArgsFromVp(argc, vp); return ArrayJoin(cx, args); } @@ -1310,6 +1311,7 @@ DefineBoxedOrUnboxedFunctor3(ArrayReverseDenseKernel, static bool array_reverse(JSContext* cx, unsigned argc, Value* vp) { + AutoSPSEntry pseudoFrame(cx->runtime(), "Array.prototype.reverse"); CallArgs args = CallArgsFromVp(argc, vp); RootedObject obj(cx, ToObject(cx, args.thisv())); if (!obj) @@ -2008,6 +2010,7 @@ js::NewbornArrayPush(JSContext* cx, HandleObject obj, const Value& v) bool js::array_push(JSContext* cx, unsigned argc, Value* vp) { + AutoSPSEntry pseudoFrame(cx->runtime(), "Array.prototype.push"); CallArgs args = CallArgsFromVp(argc, vp); /* Step 1. */ @@ -2059,6 +2062,7 @@ js::array_push(JSContext* cx, unsigned argc, Value* vp) bool js::array_pop(JSContext* cx, unsigned argc, Value* vp) { + AutoSPSEntry pseudoFrame(cx->runtime(), "Array.prototype.pop"); CallArgs args = CallArgsFromVp(argc, vp); /* Step 1. */ @@ -2158,6 +2162,7 @@ DefineBoxedOrUnboxedFunctor3(ArrayShiftDenseKernel, bool js::array_shift(JSContext* cx, unsigned argc, Value* vp) { + AutoSPSEntry pseudoFrame(cx->runtime(), "Array.prototype.shift"); CallArgs args = CallArgsFromVp(argc, vp); /* Step 1. */ @@ -2231,6 +2236,7 @@ js::array_shift(JSContext* cx, unsigned argc, Value* vp) bool js::array_unshift(JSContext* cx, unsigned argc, Value* vp) { + AutoSPSEntry pseudoFrame(cx->runtime(), "Array.prototype.unshift"); CallArgs args = CallArgsFromVp(argc, vp); RootedObject obj(cx, ToObject(cx, args.thisv())); if (!obj) @@ -2361,6 +2367,7 @@ array_splice(JSContext* cx, unsigned argc, Value* vp) bool js::array_splice_impl(JSContext* cx, unsigned argc, Value* vp, bool returnValueIsUsed) { + AutoSPSEntry pseudoFrame(cx->runtime(), "Array.prototype.splice"); CallArgs args = CallArgsFromVp(argc, vp); /* Step 1. */ @@ -2621,6 +2628,7 @@ js::array_concat_dense(JSContext* cx, HandleObject obj1, HandleObject obj2, bool js::array_concat(JSContext* cx, unsigned argc, Value* vp) { + AutoSPSEntry pseudoFrame(cx->runtime(), "Array.prototype.concat"); CallArgs args = CallArgsFromVp(argc, vp); /* Treat our |this| object as the first argument; see ECMA 15.4.4.4. */ @@ -2914,6 +2922,7 @@ NormalizeSliceTerm(T value, uint32_t length) bool js::array_slice(JSContext* cx, unsigned argc, Value* vp) { + AutoSPSEntry pseudoFrame(cx->runtime(), "Array.prototype.slice"); CallArgs args = CallArgsFromVp(argc, vp); RootedObject obj(cx, ToObject(cx, args.thisv())); From ee27695b92a919a7047e2812133bd4150270e571 Mon Sep 17 00:00:00 2001 From: Christoph Kerschbaumer Date: Mon, 1 Feb 2016 14:37:06 -0800 Subject: [PATCH 017/117] Bug 1244890 - Convert tests within toolkit/components/passwordmgr to use asyncOpen2(). r=sicking --- .../browser/browser_hasInsecureLoginForms_streamConverter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolkit/components/passwordmgr/test/browser/browser_hasInsecureLoginForms_streamConverter.js b/toolkit/components/passwordmgr/test/browser/browser_hasInsecureLoginForms_streamConverter.js index 49417b2ab22..2dfdc66b9e7 100644 --- a/toolkit/components/passwordmgr/test/browser/browser_hasInsecureLoginForms_streamConverter.js +++ b/toolkit/components/passwordmgr/test/browser/browser_hasInsecureLoginForms_streamConverter.js @@ -44,7 +44,7 @@ function* registerConverter() { // In this test, we pass the new channel to the listener but don't fire a // redirect notification, even if it would be required. This keeps the // test code simpler and doesn't impact the principal check we're testing. - channel.asyncOpen(this.listener, aContext); + channel.asyncOpen2(this.listener); }, // nsIRequestObserver From 2b40da56f0c9db18c2e02943d4a945adf3891957 Mon Sep 17 00:00:00 2001 From: "Byron Campen [:bwc]" Date: Fri, 29 Jan 2016 14:54:47 -0600 Subject: [PATCH 018/117] Bug 1234578 - Assert if PCM is destroyed improperly. r=rjesup --- .../signaling/src/peerconnection/PeerConnectionMedia.cpp | 2 ++ .../signaling/src/peerconnection/PeerConnectionMedia.h | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp b/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp index d7f695c5f0a..f9643ad7713 100644 --- a/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp +++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.cpp @@ -812,6 +812,8 @@ PeerConnectionMedia::SelfDestruct_m() mLocalSourceStreams.Clear(); mRemoteSourceStreams.Clear(); + mMainThread = nullptr; + // Final self-destruct. this->Release(); } diff --git a/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.h b/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.h index 80e2cf869c0..b11bdfbadbe 100644 --- a/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.h +++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionMedia.h @@ -221,7 +221,10 @@ class RemoteSourceStreamInfo : public SourceStreamInfo { }; class PeerConnectionMedia : public sigslot::has_slots<> { - ~PeerConnectionMedia() {} + ~PeerConnectionMedia() + { + MOZ_RELEASE_ASSERT(!mMainThread); + } public: explicit PeerConnectionMedia(PeerConnectionImpl *parent); From cfbba6dcd36909162e622a8c0b7b0fea34c39988 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabrice=20Desr=C3=A9?= Date: Tue, 2 Feb 2016 01:53:05 -0800 Subject: [PATCH 019/117] Bug 1245016 - b2g build failure in gfx/layers/ipc/LayerAnimationUtils.h r=hiro --- gfx/layers/ipc/LayerAnimationUtils.cpp | 1 - gfx/layers/ipc/LayerAnimationUtils.h | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/gfx/layers/ipc/LayerAnimationUtils.cpp b/gfx/layers/ipc/LayerAnimationUtils.cpp index 82c7fba2d71..efa3364f547 100644 --- a/gfx/layers/ipc/LayerAnimationUtils.cpp +++ b/gfx/layers/ipc/LayerAnimationUtils.cpp @@ -7,7 +7,6 @@ #include "LayerAnimationUtils.h" #include "mozilla/ComputedTimingFunction.h" // For ComputedTimingFunction #include "mozilla/layers/LayersMessages.h" // For TimingFunction etc. -#include "mozilla/Maybe.h" // For Maybe<> namespace mozilla { namespace layers { diff --git a/gfx/layers/ipc/LayerAnimationUtils.h b/gfx/layers/ipc/LayerAnimationUtils.h index 1959eaaf3a0..fc807dbea19 100644 --- a/gfx/layers/ipc/LayerAnimationUtils.h +++ b/gfx/layers/ipc/LayerAnimationUtils.h @@ -7,12 +7,16 @@ #ifndef mozilla_layers_LayerAnimationUtils_h #define mozilla_layers_LayerAnimationUtils_h +#include "mozilla/Maybe.h" + namespace mozilla { class ComputedTimingFunction; namespace layers { +class TimingFunction; + class AnimationUtils { public: From 1841136a22a7c1ff6da88161f1157209feae5bab Mon Sep 17 00:00:00 2001 From: Fernando Jimenez Date: Tue, 2 Feb 2016 01:53:21 -0800 Subject: [PATCH 020/117] Bug 1245033 - Build break in dom/system/gonk/GonkGPSGeolocationProvider.cpp:541:126: error: format '%d' expects argument of type 'int', but argument 5 has type 'nsresult'. r=fabrice --- dom/system/gonk/GonkGPSGeolocationProvider.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dom/system/gonk/GonkGPSGeolocationProvider.cpp b/dom/system/gonk/GonkGPSGeolocationProvider.cpp index 5ad23c67d6e..de068e0cd4f 100644 --- a/dom/system/gonk/GonkGPSGeolocationProvider.cpp +++ b/dom/system/gonk/GonkGPSGeolocationProvider.cpp @@ -538,13 +538,13 @@ GonkGPSGeolocationProvider::RequestSettingValue(const char* aKey) nsCOMPtr lock; nsresult rv = ss->CreateLock(nullptr, getter_AddRefs(lock)); if (NS_FAILED(rv)) { - ERR("error while createLock setting '%s': %d\n", aKey, rv); + ERR("error while createLock setting '%s': %d\n", aKey, uint32_t(rv)); return; } rv = lock->Get(aKey, this); if (NS_FAILED(rv)) { - ERR("error while get setting '%s': %d\n", aKey, rv); + ERR("error while get setting '%s': %d\n", aKey, uint32_t(rv)); return; } } From 99d1f7039438c0401362ec1fcb653b89daebf0f0 Mon Sep 17 00:00:00 2001 From: Henrik Skupin Date: Thu, 28 Jan 2016 10:54:05 +0100 Subject: [PATCH 021/117] Bug 1243684 - If symbols_url does not exist, let mozcrash auto-detect it on demand. r=jlund --- .../mozharness/mozilla/testing/testbase.py | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/testing/mozharness/mozharness/mozilla/testing/testbase.py b/testing/mozharness/mozharness/mozilla/testing/testbase.py index 02c5cb3368b..46ff6933703 100755 --- a/testing/mozharness/mozharness/mozilla/testing/testbase.py +++ b/testing/mozharness/mozharness/mozilla/testing/testbase.py @@ -167,14 +167,27 @@ class TestingMixin(VirtualenvMixin, BuildbotMixin, ResourceMonitoringMixin, def query_symbols_url(self): if self.symbols_url: return self.symbols_url - if not self.installer_url: - self.fatal("Can't figure out symbols_url without an installer_url!") - for suffix in INSTALLER_SUFFIXES: - if self.installer_url.endswith(suffix): - self.symbols_url = self.installer_url[:-len(suffix)] + '.crashreporter-symbols.zip' - return self.symbols_url + + elif self.installer_url: + symbols_url = None + for suffix in INSTALLER_SUFFIXES: + if self.installer_url.endswith(suffix): + symbols_url = self.installer_url[:-len(suffix)] + '.crashreporter-symbols.zip' + break + + # Check if the URL exists. If not, use none to allow mozcrash to auto-check for symbols + try: + if symbols_url: + self._urlopen(symbols_url) + self.symbols_url = symbols_url + except urllib2.URLError: + self.warning("Can't figure out symbols_url from installer_url: %s!" % + self.installer_url) + else: - self.fatal("Can't figure out symbols_url from installer_url %s!" % self.installer_url) + self.fatal("Can't figure out symbols_url without an installer_url!") + + return self.symbols_url def _pre_config_lock(self, rw_config): for i, (target_file, target_dict) in enumerate(rw_config.all_cfg_files_and_dicts): From 0a70d29a1afa3af669553d4d80e7e4d6e50e8210 Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Tue, 2 Feb 2016 11:07:12 +0100 Subject: [PATCH 022/117] Bug 1245048: Check call to GetPrototype; r=till --- js/src/vm/SelfHosting.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/src/vm/SelfHosting.cpp b/js/src/vm/SelfHosting.cpp index 9ac33628b24..4d0acb9d5ae 100644 --- a/js/src/vm/SelfHosting.cpp +++ b/js/src/vm/SelfHosting.cpp @@ -365,7 +365,9 @@ intrinsic_FinishBoundFunctionInit(JSContext* cx, unsigned argc, Value* vp) // 9.4.1.3 BoundFunctionCreate, steps 2-3,8. RootedObject proto(cx); - GetPrototype(cx, targetObj, &proto); + if (!GetPrototype(cx, targetObj, &proto)) + return false; + if (bound->getProto() != proto) { if (!SetPrototype(cx, bound, proto)) return false; From 60413c234e7727970234eae46481a384e0d92a86 Mon Sep 17 00:00:00 2001 From: Kai Engert Date: Tue, 2 Feb 2016 11:50:47 +0100 Subject: [PATCH 023/117] Bug 1244062, NSPR_4_12_BETA2, and Bug 1245053, NSS_3_23_BETA2 --- nsprpub/TAG-INFO | 2 +- nsprpub/config/prdepend.h | 1 - nsprpub/configure | 8 +--- nsprpub/configure.in | 9 ++-- nsprpub/pr/include/md/_freebsd.cfg | 46 +++++++++++++++++++ nsprpub/pr/include/md/_freebsd.h | 4 +- nsprpub/pr/include/md/_linux.h | 2 +- nsprpub/pr/include/md/_netbsd.h | 2 +- nsprpub/pr/include/md/_openbsd.h | 2 +- nsprpub/pr/include/md/_unixos.h | 2 +- nsprpub/pr/include/prenv.h | 14 ++++++ nsprpub/pr/include/prinit.h | 6 +-- nsprpub/pr/src/io/prlog.c | 8 +--- nsprpub/pr/src/io/prprf.c | 34 +++++++++++--- nsprpub/pr/src/io/prscanf.c | 4 +- nsprpub/pr/src/md/unix/unix.c | 2 +- nsprpub/pr/src/md/windows/w95thred.c | 7 ++- nsprpub/pr/src/misc/prenv.c | 35 ++++++++++++++ nsprpub/pr/src/misc/prnetdb.c | 3 +- nsprpub/pr/src/misc/prtpool.c | 4 +- nsprpub/pr/src/misc/prtrace.c | 8 +--- nsprpub/pr/src/nspr.def | 7 +++ nsprpub/pr/src/pthreads/ptio.c | 6 +-- nsprpub/pr/src/pthreads/ptthread.c | 12 +++-- nsprpub/pr/tests/env.c | 38 ++++++++++++++- nsprpub/pr/tests/server_test.c | 23 ++++++++-- nsprpub/pr/tests/vercheck.c | 6 +-- security/nss/TAG-INFO | 2 +- security/nss/cmd/httpserv/httpserv.c | 6 +-- security/nss/cmd/lib/secutil.c | 4 +- security/nss/cmd/lib/secutil.h | 2 +- .../libpkix/pkix/top/test_validatechain_NB.c | 4 +- security/nss/cmd/modutil/installparse.c | 4 +- security/nss/cmd/pk11mode/pk11mode.c | 2 +- security/nss/cmd/pk11util/pk11util.c | 2 +- security/nss/cmd/selfserv/selfserv.c | 8 ++-- security/nss/cmd/shlibsign/shlibsign.c | 2 +- security/nss/cmd/signtool/javascript.c | 2 +- security/nss/cmd/signtool/util.c | 5 +- security/nss/cmd/smimetools/cmsutil.c | 4 +- security/nss/cmd/strsclnt/strsclnt.c | 2 +- security/nss/cmd/tstclnt/tstclnt.c | 2 +- security/nss/coreconf/coreconf.dep | 1 + .../google_test/gtest/test/gtest_unittest.cc | 6 +-- .../nss/external_tests/ssl_gtest/ssl_gtest.cc | 3 +- security/nss/lib/certdb/certdb.c | 2 +- security/nss/lib/certhigh/certvfypkix.c | 4 +- security/nss/lib/certhigh/ocsp.c | 2 +- security/nss/lib/freebl/Makefile | 3 ++ security/nss/lib/freebl/loader.c | 2 +- security/nss/lib/freebl/mpi/utils/isprime.c | 2 +- security/nss/lib/freebl/mpi/utils/metime.c | 4 +- security/nss/lib/freebl/mpi/utils/primegen.c | 2 +- security/nss/lib/freebl/rijndael.c | 3 +- security/nss/lib/freebl/stubs.c | 9 ++++ security/nss/lib/freebl/stubs.h | 1 + security/nss/lib/freebl/unix_rand.c | 7 +-- .../pkix_pl_nss/module/pkix_pl_socket.c | 2 +- .../pkix_pl_nss/system/pkix_pl_lifecycle.c | 4 +- security/nss/lib/nss/nss.h | 6 +-- security/nss/lib/nss/nssinit.c | 2 +- security/nss/lib/pk11wrap/debug_module.c | 2 +- security/nss/lib/pk11wrap/pk11akey.c | 2 +- security/nss/lib/pk11wrap/pk11load.c | 8 ++-- security/nss/lib/pk11wrap/pk11pars.c | 2 +- security/nss/lib/pk11wrap/pk11util.c | 2 +- security/nss/lib/softoken/fipstokn.c | 2 +- security/nss/lib/softoken/legacydb/lgattr.c | 2 +- security/nss/lib/softoken/legacydb/lginit.c | 2 +- security/nss/lib/softoken/lgglue.c | 2 +- security/nss/lib/softoken/pkcs11c.c | 3 +- security/nss/lib/softoken/sdb.c | 6 +-- security/nss/lib/softoken/softkver.h | 6 +-- security/nss/lib/softoken/softoken.h | 4 +- security/nss/lib/ssl/ssl3con.c | 6 +-- security/nss/lib/ssl/sslsnce.c | 4 +- security/nss/lib/ssl/sslsock.c | 18 ++++---- security/nss/lib/sysinit/nsssysinit.c | 5 +- security/nss/lib/util/nssutil.h | 6 +-- security/nss/lib/util/secoid.c | 4 +- security/nss/lib/util/secport.c | 2 +- security/nss/lib/util/utilpars.c | 2 +- 82 files changed, 343 insertions(+), 158 deletions(-) diff --git a/nsprpub/TAG-INFO b/nsprpub/TAG-INFO index 9156f605b70..bba2b1c70a9 100644 --- a/nsprpub/TAG-INFO +++ b/nsprpub/TAG-INFO @@ -1 +1 @@ -NSPR_4_11_RTM +NSPR_4_12_BETA2 diff --git a/nsprpub/config/prdepend.h b/nsprpub/config/prdepend.h index 6c66b37ca0f..e49e92677e3 100644 --- a/nsprpub/config/prdepend.h +++ b/nsprpub/config/prdepend.h @@ -10,4 +10,3 @@ */ #error "Do not include this header file." - diff --git a/nsprpub/configure b/nsprpub/configure index 1ea42308535..0ff06ecface 100755 --- a/nsprpub/configure +++ b/nsprpub/configure @@ -2488,7 +2488,7 @@ test -n "$target_alias" && program_prefix=${target_alias}- MOD_MAJOR_VERSION=4 -MOD_MINOR_VERSION=11 +MOD_MINOR_VERSION=12 MOD_PATCH_VERSION=0 NSPR_MODNAME=nspr20 _HAVE_PTHREADS= @@ -7048,10 +7048,6 @@ tools are selected during the Xcode/Developer Tools installation." "$LINENO" 5 PR_MD_ASFILES=os_Linux_ppc.s fi ;; - m68k) - CFLAGS="$CFLAGS -m68020-60" - CXXFLAGS="$CXXFLAGS -m68020-60" - ;; esac ;; @@ -7894,7 +7890,7 @@ fi _SAVE_LIBS="$LIBS" LIBS="$LIBS $OS_LIBS" -for ac_func in dladdr gettid lchown setpriority strerror syscall +for ac_func in dladdr gettid lchown setpriority strerror syscall secure_getenv __secure_getenv do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" diff --git a/nsprpub/configure.in b/nsprpub/configure.in index aff14c2f39c..2ab2383361d 100644 --- a/nsprpub/configure.in +++ b/nsprpub/configure.in @@ -15,7 +15,7 @@ dnl ======================================================== dnl = Defaults dnl ======================================================== MOD_MAJOR_VERSION=4 -MOD_MINOR_VERSION=11 +MOD_MINOR_VERSION=12 MOD_PATCH_VERSION=0 NSPR_MODNAME=nspr20 _HAVE_PTHREADS= @@ -1856,10 +1856,6 @@ tools are selected during the Xcode/Developer Tools installation.]) PR_MD_ASFILES=os_Linux_ppc.s fi ;; - m68k) - CFLAGS="$CFLAGS -m68020-60" - CXXFLAGS="$CXXFLAGS -m68020-60" - ;; esac ;; @@ -2543,7 +2539,8 @@ dnl ======================================================== AC_PROG_GCC_TRADITIONAL _SAVE_LIBS="$LIBS" LIBS="$LIBS $OS_LIBS" -AC_CHECK_FUNCS(dladdr gettid lchown setpriority strerror syscall) +AC_CHECK_FUNCS(dladdr gettid lchown setpriority strerror syscall dnl + secure_getenv __secure_getenv) LIBS="$_SAVE_LIBS" dnl ======================================================== diff --git a/nsprpub/pr/include/md/_freebsd.cfg b/nsprpub/pr/include/md/_freebsd.cfg index 3265ed3d8a5..1d1039a5b8c 100644 --- a/nsprpub/pr/include/md/_freebsd.cfg +++ b/nsprpub/pr/include/md/_freebsd.cfg @@ -342,6 +342,52 @@ #define PR_BYTES_PER_WORD_LOG2 2 #define PR_BYTES_PER_DWORD_LOG2 3 +#elif defined(__aarch64__) + +#undef IS_BIG_ENDIAN +#define IS_LITTLE_ENDIAN 1 +#define IS_64 + +#define PR_BYTES_PER_BYTE 1 +#define PR_BYTES_PER_SHORT 2 +#define PR_BYTES_PER_INT 4 +#define PR_BYTES_PER_INT64 8 +#define PR_BYTES_PER_LONG 8 +#define PR_BYTES_PER_FLOAT 4 +#define PR_BYTES_PER_DOUBLE 8 +#define PR_BYTES_PER_WORD 8 +#define PR_BYTES_PER_DWORD 8 + +#define PR_BITS_PER_BYTE 8 +#define PR_BITS_PER_SHORT 16 +#define PR_BITS_PER_INT 32 +#define PR_BITS_PER_INT64 64 +#define PR_BITS_PER_LONG 64 +#define PR_BITS_PER_FLOAT 32 +#define PR_BITS_PER_DOUBLE 64 +#define PR_BITS_PER_WORD 64 + +#define PR_BITS_PER_BYTE_LOG2 3 +#define PR_BITS_PER_SHORT_LOG2 4 +#define PR_BITS_PER_INT_LOG2 5 +#define PR_BITS_PER_INT64_LOG2 6 +#define PR_BITS_PER_LONG_LOG2 6 +#define PR_BITS_PER_FLOAT_LOG2 5 +#define PR_BITS_PER_DOUBLE_LOG2 6 +#define PR_BITS_PER_WORD_LOG2 6 + +#define PR_ALIGN_OF_SHORT 2 +#define PR_ALIGN_OF_INT 4 +#define PR_ALIGN_OF_LONG 8 +#define PR_ALIGN_OF_INT64 8 +#define PR_ALIGN_OF_FLOAT 4 +#define PR_ALIGN_OF_DOUBLE 8 +#define PR_ALIGN_OF_POINTER 8 +#define PR_ALIGN_OF_WORD 8 + +#define PR_BYTES_PER_WORD_LOG2 3 +#define PR_BYTES_PER_DWORD_LOG2 3 + #elif defined(__arm__) #if defined(__ARMEB__) || defined(__ARM_BIG_ENDIAN__) diff --git a/nsprpub/pr/include/md/_freebsd.h b/nsprpub/pr/include/md/_freebsd.h index 68de133cb6f..9a179bcb78c 100644 --- a/nsprpub/pr/include/md/_freebsd.h +++ b/nsprpub/pr/include/md/_freebsd.h @@ -29,6 +29,8 @@ #define _PR_SI_ARCHITECTURE "powerpc64" #elif defined(__powerpc__) #define _PR_SI_ARCHITECTURE "powerpc" +#elif defined(__aarch64__) +#define _PR_SI_ARCHITECTURE "aarch64" #elif defined(__arm__) #define _PR_SI_ARCHITECTURE "arm" #elif defined(__mips64__) @@ -228,7 +230,7 @@ extern void _MD_EarlyInit(void); #define _MD_EARLY_INIT _MD_EarlyInit #define _MD_FINAL_INIT _PR_UnixInit -#define _MD_INTERVAL_USE_GTOD +#define _PR_HAVE_CLOCK_MONOTONIC /* * We wrapped the select() call. _MD_SELECT refers to the built-in, diff --git a/nsprpub/pr/include/md/_linux.h b/nsprpub/pr/include/md/_linux.h index d378db56094..b4b298b71c1 100644 --- a/nsprpub/pr/include/md/_linux.h +++ b/nsprpub/pr/include/md/_linux.h @@ -671,7 +671,7 @@ extern void _MD_EarlyInit(void); #define _MD_EARLY_INIT _MD_EarlyInit #define _MD_FINAL_INIT _PR_UnixInit -#define HAVE_CLOCK_MONOTONIC +#define _PR_HAVE_CLOCK_MONOTONIC /* * We wrapped the select() call. _MD_SELECT refers to the built-in, diff --git a/nsprpub/pr/include/md/_netbsd.h b/nsprpub/pr/include/md/_netbsd.h index 8b8e8dd8d79..945d94ff4b0 100644 --- a/nsprpub/pr/include/md/_netbsd.h +++ b/nsprpub/pr/include/md/_netbsd.h @@ -211,7 +211,7 @@ extern void _MD_EarlyInit(void); #define _MD_EARLY_INIT _MD_EarlyInit #define _MD_FINAL_INIT _PR_UnixInit -#define _MD_INTERVAL_USE_GTOD +#define _PR_HAVE_CLOCK_MONOTONIC /* * We wrapped the select() call. _MD_SELECT refers to the built-in, diff --git a/nsprpub/pr/include/md/_openbsd.h b/nsprpub/pr/include/md/_openbsd.h index e014088e63d..666c177e34d 100644 --- a/nsprpub/pr/include/md/_openbsd.h +++ b/nsprpub/pr/include/md/_openbsd.h @@ -192,7 +192,7 @@ struct _MDCPU { #define _MD_EARLY_INIT _MD_EarlyInit #define _MD_FINAL_INIT _PR_UnixInit -#define _MD_INTERVAL_USE_GTOD +#define _PR_HAVE_CLOCK_MONOTONIC /* * We wrapped the select() call. _MD_SELECT refers to the built-in, diff --git a/nsprpub/pr/include/md/_unixos.h b/nsprpub/pr/include/md/_unixos.h index 04d990414fa..ea46b3a47f6 100644 --- a/nsprpub/pr/include/md/_unixos.h +++ b/nsprpub/pr/include/md/_unixos.h @@ -302,7 +302,7 @@ extern PRIntervalTime _PR_UNIX_TicksPerSecond(void); #define _MD_INTERVAL_PER_SEC _PR_UNIX_TicksPerSecond #endif -#ifdef HAVE_CLOCK_MONOTONIC +#ifdef _PR_HAVE_CLOCK_MONOTONIC extern PRIntervalTime _PR_UNIX_GetInterval2(void); extern PRIntervalTime _PR_UNIX_TicksPerSecond2(void); #define _MD_INTERVAL_INIT() diff --git a/nsprpub/pr/include/prenv.h b/nsprpub/pr/include/prenv.h index 2a4771673a6..468c7d59629 100644 --- a/nsprpub/pr/include/prenv.h +++ b/nsprpub/pr/include/prenv.h @@ -90,6 +90,20 @@ PR_BEGIN_EXTERN_C */ NSPR_API(char*) PR_GetEnv(const char *var); +/* +** PR_GetEnvSecure() -- get a security-sensitive environment variable +** +** Description: +** +** PR_GetEnvSecure() is similar to PR_GetEnv(), but it returns NULL if +** the program was run with elevated privilege (e.g., setuid or setgid +** on Unix). This can be used for cases like log file paths which +** could otherwise be used for privilege escalation. Note that some +** platforms may have platform-specific privilege elevation mechanisms +** not recognized by this function; see the implementation for details. +*/ +NSPR_API(char*) PR_GetEnvSecure(const char *var); + /* ** PR_SetEnv() -- set, unset or change an environment variable ** diff --git a/nsprpub/pr/include/prinit.h b/nsprpub/pr/include/prinit.h index 93749e634b7..fa9a43e16e4 100644 --- a/nsprpub/pr/include/prinit.h +++ b/nsprpub/pr/include/prinit.h @@ -31,11 +31,11 @@ PR_BEGIN_EXTERN_C ** The format of the version string is ** ".[.] []" */ -#define PR_VERSION "4.11" +#define PR_VERSION "4.12 Beta" #define PR_VMAJOR 4 -#define PR_VMINOR 11 +#define PR_VMINOR 12 #define PR_VPATCH 0 -#define PR_BETA PR_FALSE +#define PR_BETA PR_TRUE /* ** PRVersionCheck diff --git a/nsprpub/pr/src/io/prlog.c b/nsprpub/pr/src/io/prlog.c index dae80282d9a..6098460edeb 100644 --- a/nsprpub/pr/src/io/prlog.c +++ b/nsprpub/pr/src/io/prlog.c @@ -238,13 +238,7 @@ void _PR_InitLog(void) } PR_SetLogBuffering(isSync ? 0 : bufSize); -#ifdef XP_UNIX - if ((getuid() != geteuid()) || (getgid() != getegid())) { - return; - } -#endif /* XP_UNIX */ - - ev = PR_GetEnv("NSPR_LOG_FILE"); + ev = PR_GetEnvSecure("NSPR_LOG_FILE"); if (ev && ev[0]) { if (!PR_SetLogFile(ev)) { #ifdef XP_PC diff --git a/nsprpub/pr/src/io/prprf.c b/nsprpub/pr/src/io/prprf.c index 1a891415482..798ea2a448b 100644 --- a/nsprpub/pr/src/io/prprf.c +++ b/nsprpub/pr/src/io/prprf.c @@ -37,7 +37,7 @@ struct SprintfStateStr { char *base; char *cur; - PRUint32 maxlen; + PRUint32 maxlen; /* Must not exceed PR_INT32_MAX. */ int (*func)(void *arg, const char *sp, PRUint32 len); void *arg; @@ -697,7 +697,7 @@ static int dosprintf(SprintfState *ss, const char *fmt, va_list ap) char *hexp; int rv, i; struct NumArg* nas = NULL; - struct NumArg* nap; + struct NumArg* nap = NULL; struct NumArg nasArray[ NAS_DEFAULT_NUM ]; char pattern[20]; const char* dolPt = NULL; /* in "%4$.2f", dolPt will point to . */ @@ -1060,6 +1060,13 @@ static int FuncStuff(SprintfState *ss, const char *sp, PRUint32 len) { int rv; + /* + ** We will add len to ss->maxlen at the end of the function. First check + ** if ss->maxlen + len would overflow or be greater than PR_INT32_MAX. + */ + if (PR_UINT32_MAX - ss->maxlen < len || ss->maxlen + len > PR_INT32_MAX) { + return -1; + } rv = (*ss->func)(ss->arg, sp, len); if (rv < 0) { return rv; @@ -1105,9 +1112,21 @@ static int GrowStuff(SprintfState *ss, const char *sp, PRUint32 len) PRUint32 newlen; off = ss->cur - ss->base; + if (PR_UINT32_MAX - len < off) { + /* off + len would be too big. */ + return -1; + } if (off + len >= ss->maxlen) { /* Grow the buffer */ - newlen = ss->maxlen + ((len > 32) ? len : 32); + PRUint32 increment = (len > 32) ? len : 32; + if (PR_UINT32_MAX - ss->maxlen < increment) { + /* ss->maxlen + increment would overflow. */ + return -1; + } + newlen = ss->maxlen + increment; + if (newlen > PR_INT32_MAX) { + return -1; + } if (ss->base) { newbase = (char*) PR_REALLOC(ss->base, newlen); } else { @@ -1210,8 +1229,8 @@ PR_IMPLEMENT(PRUint32) PR_vsnprintf(char *out, PRUint32 outlen,const char *fmt, SprintfState ss; PRUint32 n; - PR_ASSERT((PRInt32)outlen > 0); - if ((PRInt32)outlen <= 0) { + PR_ASSERT(outlen != 0 && outlen <= PR_INT32_MAX); + if (outlen == 0 || outlen > PR_INT32_MAX) { return 0; } @@ -1247,7 +1266,10 @@ PR_IMPLEMENT(char *) PR_vsprintf_append(char *last, const char *fmt, va_list ap) ss.stuff = GrowStuff; if (last) { - int lastlen = strlen(last); + size_t lastlen = strlen(last); + if (lastlen > PR_INT32_MAX) { + return 0; + } ss.base = last; ss.cur = last + lastlen; ss.maxlen = lastlen; diff --git a/nsprpub/pr/src/io/prscanf.c b/nsprpub/pr/src/io/prscanf.c index b95d6561aa1..9d75d824e8e 100644 --- a/nsprpub/pr/src/io/prscanf.c +++ b/nsprpub/pr/src/io/prscanf.c @@ -194,7 +194,7 @@ static PRStatus GetInt(ScanfState *state, int code) { char buf[FMAX + 1], *p; - int ch; + int ch = 0; static const char digits[] = "0123456789abcdefABCDEF"; PRBool seenDigit = PR_FALSE; int base; @@ -304,7 +304,7 @@ static PRStatus GetFloat(ScanfState *state) { char buf[FMAX + 1], *p; - int ch; + int ch = 0; PRBool seenDigit = PR_FALSE; if (state->width == 0 || state->width > FMAX) { diff --git a/nsprpub/pr/src/md/unix/unix.c b/nsprpub/pr/src/md/unix/unix.c index 7405053fa01..fdae1199cee 100644 --- a/nsprpub/pr/src/md/unix/unix.c +++ b/nsprpub/pr/src/md/unix/unix.c @@ -3040,7 +3040,7 @@ PRIntervalTime _PR_UNIX_TicksPerSecond() } #endif -#if defined(HAVE_CLOCK_MONOTONIC) +#if defined(_PR_HAVE_CLOCK_MONOTONIC) PRIntervalTime _PR_UNIX_GetInterval2() { struct timespec time; diff --git a/nsprpub/pr/src/md/windows/w95thred.c b/nsprpub/pr/src/md/windows/w95thred.c index 932c50c3ee8..c27d982a748 100644 --- a/nsprpub/pr/src/md/windows/w95thred.c +++ b/nsprpub/pr/src/md/windows/w95thred.c @@ -65,7 +65,7 @@ _PR_MD_INIT_THREAD(PRThread *thread) ** suspending). Therefore, get a real handle from ** the pseudo handle via DuplicateHandle(...) */ - DuplicateHandle( + BOOL ok = DuplicateHandle( GetCurrentProcess(), /* Process of source handle */ GetCurrentThread(), /* Pseudo Handle to dup */ GetCurrentProcess(), /* Process of handle */ @@ -73,6 +73,11 @@ _PR_MD_INIT_THREAD(PRThread *thread) 0L, /* access flags */ FALSE, /* Inheritable */ DUPLICATE_SAME_ACCESS); /* Options */ + if (!ok) { + return PR_FAILURE; + } + thread->id = GetCurrentThreadId(); + thread->md.id = thread->id; } /* Create the blocking IO semaphore */ diff --git a/nsprpub/pr/src/misc/prenv.c b/nsprpub/pr/src/misc/prenv.c index 4935f9dc78e..cc2e198b978 100644 --- a/nsprpub/pr/src/misc/prenv.c +++ b/nsprpub/pr/src/misc/prenv.c @@ -4,10 +4,12 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include +#include #include "primpl.h" #include "prmem.h" #if defined(XP_UNIX) +#include #if defined(DARWIN) #if defined(HAVE_CRT_EXTERNS_H) #include @@ -17,6 +19,11 @@ PR_IMPORT_DATA(char **) environ; #endif /* DARWIN */ #endif /* XP_UNIX */ +#if !defined(HAVE_SECURE_GETENV) && defined(HAVE___SECURE_GETENV) +#define secure_getenv __secure_getenv +#define HAVE_SECURE_GETENV 1 +#endif + /* Lock used to lock the environment */ #if defined(_PR_NO_PREEMPT) #define _PR_NEW_LOCK_ENV() @@ -63,6 +70,34 @@ PR_IMPLEMENT(char*) PR_GetEnv(const char *var) return ev; } +PR_IMPLEMENT(char*) PR_GetEnvSecure(const char *var) +{ +#ifdef HAVE_SECURE_GETENV + char *ev; + + if (!_pr_initialized) _PR_ImplicitInitialization(); + + _PR_LOCK_ENV(); + ev = secure_getenv(var); + _PR_UNLOCK_ENV(); + + return ev; +#else +#ifdef XP_UNIX + /* + ** Fall back to checking uids and gids. This won't detect any other + ** privilege-granting mechanisms the platform may have. This also + ** can't detect the case where the process already called + ** setuid(geteuid()) and/or setgid(getegid()). + */ + if (getuid() != geteuid() || getgid() != getegid()) { + return NULL; + } +#endif /* XP_UNIX */ + return PR_GetEnv(var); +#endif /* HAVE_SECURE_GETENV */ +} + PR_IMPLEMENT(PRStatus) PR_SetEnv(const char *string) { PRIntn result; diff --git a/nsprpub/pr/src/misc/prnetdb.c b/nsprpub/pr/src/misc/prnetdb.c index b86248f863f..b2f6e435b5f 100644 --- a/nsprpub/pr/src/misc/prnetdb.c +++ b/nsprpub/pr/src/misc/prnetdb.c @@ -63,8 +63,7 @@ PRLock *_pr_dnsLock = NULL; #if defined(SOLARIS) || (defined(BSDI) && defined(_REENTRANT)) \ || (defined(LINUX) && defined(_REENTRANT) \ - && !(defined(__GLIBC__) && __GLIBC__ >= 2) \ - && !defined(ANDROID)) + && defined(__GLIBC__) && __GLIBC__ < 2) #define _PR_HAVE_GETPROTO_R #define _PR_HAVE_GETPROTO_R_POINTER #endif diff --git a/nsprpub/pr/src/misc/prtpool.c b/nsprpub/pr/src/misc/prtpool.c index 8870a3cfe53..0671cc19b16 100644 --- a/nsprpub/pr/src/misc/prtpool.c +++ b/nsprpub/pr/src/misc/prtpool.c @@ -281,8 +281,8 @@ PRThreadPool *tp = (PRThreadPool *) arg; int pollfd_cnt, pollfds_used; int rv; PRCList *qp, *nextqp; -PRPollDesc *pollfds; -PRJob **polljobs; +PRPollDesc *pollfds = NULL; +PRJob **polljobs = NULL; int poll_timeout; PRIntervalTime now; diff --git a/nsprpub/pr/src/misc/prtrace.c b/nsprpub/pr/src/misc/prtrace.c index e1b456c7623..058f700b5a2 100644 --- a/nsprpub/pr/src/misc/prtrace.c +++ b/nsprpub/pr/src/misc/prtrace.c @@ -657,14 +657,8 @@ static PRFileDesc * InitializeRecording( void ) logLostData = 0; /* reset at entry */ logState = LogReset; -#ifdef XP_UNIX - if ((getuid() != geteuid()) || (getgid() != getegid())) { - return NULL; - } -#endif /* XP_UNIX */ - /* Get the filename for the logfile from the environment */ - logFileName = PR_GetEnv( "NSPR_TRACE_LOG" ); + logFileName = PR_GetEnvSecure( "NSPR_TRACE_LOG" ); if ( logFileName == NULL ) { PR_LOG( lm, PR_LOG_ERROR, diff --git a/nsprpub/pr/src/nspr.def b/nsprpub/pr/src/nspr.def index 6b91e551738..726979ba9de 100644 --- a/nsprpub/pr/src/nspr.def +++ b/nsprpub/pr/src/nspr.def @@ -455,3 +455,10 @@ EXPORTS ;- ;+ global: PR_SyncMemMap; ;+} NSPR_4.9.2; +;+# Function PR_DuplicateEnvironment had been added in NSPR 4.10.9, +;+# but we neglected to add it to nspr.def until NSPR 4.12 +;+NSPR_4.12 { +;+ global: + PR_DuplicateEnvironment; + PR_GetEnvSecure; +;+} NSPR_4.10.3; diff --git a/nsprpub/pr/src/pthreads/ptio.c b/nsprpub/pr/src/pthreads/ptio.c index 125f1f93f53..e4fe5198bbf 100644 --- a/nsprpub/pr/src/pthreads/ptio.c +++ b/nsprpub/pr/src/pthreads/ptio.c @@ -3765,7 +3765,7 @@ static PRInt32 _pr_poll_with_poll( * We use these variables to figure out how much time has * elapsed and how much of the timeout still remains. */ - PRIntervalTime start, elapsed, remaining; + PRIntervalTime start = 0, elapsed, remaining; if (pt_TestAbort()) return -1; @@ -4019,7 +4019,7 @@ static PRInt32 _pr_poll_with_select( * We use these variables to figure out how much time has * elapsed and how much of the timeout still remains. */ - PRIntervalTime start, elapsed, remaining; + PRIntervalTime start = 0, elapsed, remaining; if (pt_TestAbort()) return -1; @@ -4919,7 +4919,7 @@ PR_IMPLEMENT(PRInt32) PR_Select( * We use these variables to figure out how much time has elapsed * and how much of the timeout still remains. */ - PRIntervalTime start, elapsed, remaining; + PRIntervalTime start = 0, elapsed, remaining; static PRBool unwarned = PR_TRUE; if (unwarned) unwarned = _PR_Obsolete( "PR_Select", "PR_Poll"); diff --git a/nsprpub/pr/src/pthreads/ptthread.c b/nsprpub/pr/src/pthreads/ptthread.c index de90e4d39fd..9e12606ea3f 100644 --- a/nsprpub/pr/src/pthreads/ptthread.c +++ b/nsprpub/pr/src/pthreads/ptthread.c @@ -21,6 +21,10 @@ #include #include +#if defined(OPENBSD) || defined(FREEBSD) || defined(DRAGONFLY) +#include +#endif + #ifdef SYMBIAN /* In Open C sched_get_priority_min/max do not work properly, so we undefine * _POSIX_THREAD_PRIORITY_SCHEDULING here. @@ -1733,7 +1737,7 @@ PR_IMPLEMENT(PRStatus) PR_SetCurrentThreadName(const char *name) { PRThread *thread; size_t nameLen; - int result; + int result = 0; if (!name) { PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0); @@ -1751,8 +1755,10 @@ PR_IMPLEMENT(PRStatus) PR_SetCurrentThreadName(const char *name) return PR_FAILURE; memcpy(thread->name, name, nameLen + 1); -#if defined(OPENBSD) || defined(FREEBSD) - result = pthread_set_name_np(thread->id, name); +#if defined(OPENBSD) || defined(FREEBSD) || defined(DRAGONFLY) + pthread_set_name_np(thread->id, name); +#elif defined(NETBSD) + result = pthread_setname_np(thread->id, "%s", (void *)name); #else /* not BSD */ /* * On OSX, pthread_setname_np is only available in 10.6 or later, so test diff --git a/nsprpub/pr/tests/env.c b/nsprpub/pr/tests/env.c index 720c0c40b71..c11588d67ca 100644 --- a/nsprpub/pr/tests/env.c +++ b/nsprpub/pr/tests/env.c @@ -18,6 +18,7 @@ PRIntn debug = 0; PRIntn verbose = 0; +PRIntn secure = 0; PRBool failedAlready = PR_FALSE; #define ENVNAME "NSPR_ENVIRONMENT_TEST_VARIABLE" @@ -43,7 +44,7 @@ int main(int argc, char **argv) { /* Get command line options */ PLOptStatus os; - PLOptState *opt = PL_CreateOptState(argc, argv, "vd"); + PLOptState *opt = PL_CreateOptState(argc, argv, "vds"); while (PL_OPT_EOL != (os = PL_GetNextOpt(opt))) { @@ -56,6 +57,15 @@ int main(int argc, char **argv) case 'v': /* verbose */ verbose = 1; break; + case 's': /* secure / set[ug]id */ + /* + ** To test PR_GetEnvSecure, make this executable (or a + ** copy of it) setuid / setgid / otherwise inherently + ** privileged (e.g., file capabilities) and run it + ** with this flag. + */ + secure = 1; + break; default: break; } @@ -113,6 +123,32 @@ int main(int argc, char **argv) if (verbose) printf("env: PR_GetEnv() worked after setting it. Found: %s\n", value ); } + if ( secure ) { + /* + ** In this case we've been run with elevated privileges, so + ** test that PR_GetEnvSecure *doesn't* find that env var. + */ + value = PR_GetEnvSecure( ENVNAME ); + if ( NULL != value ) { + if (debug) printf( "env: PR_GetEnvSecure() failed; expected NULL, found \"%s\"\n", value ); + failedAlready = PR_TRUE; + } else { + if (verbose) printf("env: PR_GetEnvSecure() worked\n" ); + } + } else { + /* + ** In this case the program is being run normally, so do the + ** same check for PR_GetEnvSecure as for PR_GetEnv. + */ + value = PR_GetEnvSecure( ENVNAME ); + if ( (NULL == value ) || (strcmp( value, ENVVALUE))) { + if (debug) printf( "env: PR_GetEnvSecure() Failed after setting\n" ); + failedAlready = PR_TRUE; + } else { + if (verbose) printf("env: PR_GetEnvSecure() worked after setting it. Found: %s\n", value ); + } + } + /* ---------------------------------------------------------------------- */ /* check that PR_DuplicateEnvironment() agrees with PR_GetEnv() */ { diff --git a/nsprpub/pr/tests/server_test.c b/nsprpub/pr/tests/server_test.c index 5c608cd1eb9..b794a7fe744 100644 --- a/nsprpub/pr/tests/server_test.c +++ b/nsprpub/pr/tests/server_test.c @@ -37,6 +37,7 @@ #define PASS 0 #define FAIL 1 static int debug_mode = 0; +static int failed_already = 0; static int _iterations = 1000; static int _clients = 1; @@ -90,6 +91,7 @@ static void Test_Result (int result) break; case FAIL: printf ("FAIL\n"); + failed_already = 1; break; default: break; @@ -246,21 +248,32 @@ PRFileDesc * ServerSetup(void) { PRFileDesc *listenSocket; + PRSocketOptionData sockOpt; PRNetAddr serverAddr; PRThread *WorkerThread; - if ( (listenSocket = PR_NewTCPSocket()) == NULL) { + if ((listenSocket = PR_NewTCPSocket()) == NULL) { if (debug_mode) printf("\tServer error creating listen socket\n"); else Test_Result(FAIL); return NULL; } + sockOpt.option = PR_SockOpt_Reuseaddr; + sockOpt.value.reuse_addr = PR_TRUE; + if (PR_SetSocketOption(listenSocket, &sockOpt) != PR_SUCCESS) { + if (debug_mode) printf("\tServer error setting socket option: OS error %d\n", + PR_GetOSError()); + else Test_Result(FAIL); + PR_Close(listenSocket); + return NULL; + } + memset(&serverAddr, 0, sizeof(PRNetAddr)); serverAddr.inet.family = PR_AF_INET; serverAddr.inet.port = PR_htons(PORT); serverAddr.inet.ip = PR_htonl(PR_INADDR_ANY); - if ( PR_Bind(listenSocket, &serverAddr) == PR_FAILURE) { + if (PR_Bind(listenSocket, &serverAddr) != PR_SUCCESS) { if (debug_mode) printf("\tServer error binding to server address: OS error %d\n", PR_GetOSError()); else Test_Result(FAIL); @@ -268,7 +281,7 @@ ServerSetup(void) return NULL; } - if ( PR_Listen(listenSocket, 128) == PR_FAILURE) { + if (PR_Listen(listenSocket, 128) != PR_SUCCESS) { if (debug_mode) printf("\tServer error listening to server socket\n"); else Test_Result(FAIL); PR_Close(listenSocket); @@ -548,7 +561,7 @@ int main(int argc, char **argv) Usage: test_name -d */ PLOptStatus os; - PLOptState *opt = PL_CreateOptState(argc, argv, "d:"); + PLOptState *opt = PL_CreateOptState(argc, argv, "d"); while (PL_OPT_EOL != (os = PL_GetNextOpt(opt))) { if (PL_OPT_BAD == os) continue; @@ -606,5 +619,5 @@ int main(int argc, char **argv) PR_Cleanup(); - return 0; + return failed_already; } diff --git a/nsprpub/pr/tests/vercheck.c b/nsprpub/pr/tests/vercheck.c index 2b4e6fba2c4..b19b579a9ed 100644 --- a/nsprpub/pr/tests/vercheck.c +++ b/nsprpub/pr/tests/vercheck.c @@ -22,7 +22,7 @@ /* * This release (4.10.10) is backward compatible with the * 4.0.x, 4.1.x, 4.2.x, 4.3.x, 4.4.x, 4.5.x, 4.6.x, 4.7.x, - * 4.8.x, 4.9.x, and 4.10.x releases. + * 4.8.x, 4.9.x, 4.10.x and 4.11.X releases. * It, of course, is compatible with itself. */ static char *compatible_version[] = { @@ -39,7 +39,7 @@ static char *compatible_version[] = { "4.9.6", "4.10", "4.10.1", "4.10.2", "4.10.3", "4.10.4", "4.10.5", "4.10.6", "4.10.7", "4.10.8", "4.10.9", - "4.10.10", + "4.10.10", "4.11", PR_VERSION }; @@ -56,7 +56,7 @@ static char *incompatible_version[] = { "3.1", "3.1.1", "3.1.2", "3.1.3", "3.5", "3.5.1", "4.11.1", - "4.12", "4.12.1", + "4.12.1", "10.0", "11.1", "12.14.20" }; diff --git a/security/nss/TAG-INFO b/security/nss/TAG-INFO index 2b58a1fb2e9..a30036354ea 100644 --- a/security/nss/TAG-INFO +++ b/security/nss/TAG-INFO @@ -1 +1 @@ -NSS_3_22_RTM +NSS_3_23_BETA2 diff --git a/security/nss/cmd/httpserv/httpserv.c b/security/nss/cmd/httpserv/httpserv.c index b01da4b8f38..3e8a0f6a108 100644 --- a/security/nss/cmd/httpserv/httpserv.c +++ b/security/nss/cmd/httpserv/httpserv.c @@ -1268,11 +1268,11 @@ main(int argc, char **argv) } } - tmp = getenv("TMP"); + tmp = PR_GetEnvSecure("TMP"); if (!tmp) - tmp = getenv("TMPDIR"); + tmp = PR_GetEnvSecure("TMPDIR"); if (!tmp) - tmp = getenv("TEMP"); + tmp = PR_GetEnvSecure("TEMP"); /* we're an ordinary single process server. */ listen_sock = getBoundListenSocket(port); prStatus = PR_SetFDInheritable(listen_sock, PR_FALSE); diff --git a/security/nss/cmd/lib/secutil.c b/security/nss/cmd/lib/secutil.c index e79817b3196..24cf682dc3f 100644 --- a/security/nss/cmd/lib/secutil.c +++ b/security/nss/cmd/lib/secutil.c @@ -416,7 +416,7 @@ SECU_DefaultSSLDir(void) char *dir; static char sslDir[1000]; - dir = PR_GetEnv("SSL_DIR"); + dir = PR_GetEnvSecure("SSL_DIR"); if (!dir) return NULL; @@ -455,7 +455,7 @@ SECU_ConfigDirectory(const char* base) if (base == NULL || *base == 0) { - home = PR_GetEnv("HOME"); + home = PR_GetEnvSecure("HOME"); if (!home) home = ""; if (*home && home[strlen(home) - 1] == '/') diff --git a/security/nss/cmd/lib/secutil.h b/security/nss/cmd/lib/secutil.h index 9f2744a3d28..c501920b0ae 100644 --- a/security/nss/cmd/lib/secutil.h +++ b/security/nss/cmd/lib/secutil.h @@ -116,7 +116,7 @@ extern char *SEC_ReadDongleFile(int fd); /* Just sticks the two strings together with a / if needed */ char *SECU_AppendFilenameToDir(char *dir, char *filename); -/* Returns result of getenv("SSL_DIR") or NULL */ +/* Returns result of PR_GetEnvSecure("SSL_DIR") or NULL */ extern char *SECU_DefaultSSLDir(void); /* diff --git a/security/nss/cmd/libpkix/pkix/top/test_validatechain_NB.c b/security/nss/cmd/libpkix/pkix/top/test_validatechain_NB.c index d5b5ff6eca4..e01930286ef 100644 --- a/security/nss/cmd/libpkix/pkix/top/test_validatechain_NB.c +++ b/security/nss/cmd/libpkix/pkix/top/test_validatechain_NB.c @@ -249,7 +249,7 @@ int test_validatechain_NB(int argc, char *argv[]){ chainCerts, plContext); - ldapName = PR_GetEnv("LDAP"); + ldapName = PR_GetEnvSecure("LDAP"); /* Is LDAP set in the environment? */ if ((ldapName == NULL) || (*ldapName == '\0')) { testError("LDAP not set in environment"); @@ -276,7 +276,7 @@ int test_validatechain_NB(int argc, char *argv[]){ testSetupCertStore(valParams, ldapName); - logging = PR_GetEnv("LOGGING"); + logging = PR_GetEnvSecure("LOGGING"); /* Is LOGGING set in the environment? */ if ((logging != NULL) && (*logging != '\0')) { diff --git a/security/nss/cmd/modutil/installparse.c b/security/nss/cmd/modutil/installparse.c index 3691c6388da..12694db1e15 100644 --- a/security/nss/cmd/modutil/installparse.c +++ b/security/nss/cmd/modutil/installparse.c @@ -201,9 +201,9 @@ yyparse() register int yym, yyn, yystate; #if YYDEBUG register char *yys; - extern char *getenv(); + extern char *PR_GetEnvSecure(); - if ((yys = getenv("YYDEBUG")) != NULL) + if ((yys = PR_GetEnvSecure("YYDEBUG")) != NULL) { yyn = *yys; if (yyn >= '0' && yyn <= '9') diff --git a/security/nss/cmd/pk11mode/pk11mode.c b/security/nss/cmd/pk11mode/pk11mode.c index 901323abe81..335d173b7ff 100644 --- a/security/nss/cmd/pk11mode/pk11mode.c +++ b/security/nss/cmd/pk11mode/pk11mode.c @@ -754,7 +754,7 @@ cleanup: #ifdef _WIN32 FreeLibrary(hModule); #else - disableUnload = PR_GetEnv("NSS_DISABLE_UNLOAD"); + disableUnload = PR_GetEnvSecure("NSS_DISABLE_UNLOAD"); if (!disableUnload) { PR_UnloadLibrary(lib); } diff --git a/security/nss/cmd/pk11util/pk11util.c b/security/nss/cmd/pk11util/pk11util.c index 45161fd97e3..5640f10aa53 100644 --- a/security/nss/cmd/pk11util/pk11util.c +++ b/security/nss/cmd/pk11util/pk11util.c @@ -1404,7 +1404,7 @@ unloadModule(Module *module) { char *disableUnload = NULL; - disableUnload = PR_GetEnv("NSS_DISABLE_UNLOAD"); + disableUnload = PR_GetEnvSecure("NSS_DISABLE_UNLOAD"); if (module->library && !disableUnload) { PR_UnloadLibrary(module->library); diff --git a/security/nss/cmd/selfserv/selfserv.c b/security/nss/cmd/selfserv/selfserv.c index 98986c31882..fc071f703d4 100644 --- a/security/nss/cmd/selfserv/selfserv.c +++ b/security/nss/cmd/selfserv/selfserv.c @@ -2459,12 +2459,12 @@ main(int argc, char **argv) testBulkBuf[i] = i; } - envString = getenv(envVarName); - tmp = getenv("TMP"); + envString = PR_GetEnvSecure(envVarName); + tmp = PR_GetEnvSecure("TMP"); if (!tmp) - tmp = getenv("TMPDIR"); + tmp = PR_GetEnvSecure("TMPDIR"); if (!tmp) - tmp = getenv("TEMP"); + tmp = PR_GetEnvSecure("TEMP"); if (envString) { /* we're one of the children in a multi-process server. */ listen_sock = PR_GetInheritedFD(inheritableSockName); diff --git a/security/nss/cmd/shlibsign/shlibsign.c b/security/nss/cmd/shlibsign/shlibsign.c index 7ddbf343dfe..63a48367f1e 100644 --- a/security/nss/cmd/shlibsign/shlibsign.c +++ b/security/nss/cmd/shlibsign/shlibsign.c @@ -1288,7 +1288,7 @@ cleanup: } #endif - disableUnload = PR_GetEnv("NSS_DISABLE_UNLOAD"); + disableUnload = PR_GetEnvSecure("NSS_DISABLE_UNLOAD"); if (!disableUnload) { PR_UnloadLibrary(lib); } diff --git a/security/nss/cmd/signtool/javascript.c b/security/nss/cmd/signtool/javascript.c index 3beffa522b4..bbaa939992c 100644 --- a/security/nss/cmd/signtool/javascript.c +++ b/security/nss/cmd/signtool/javascript.c @@ -64,7 +64,7 @@ InlineJavaScript(char *dir, PRBool recurse) PR_fprintf(outputFD, "\nGenerating inline signatures from HTML files in: %s\n", dir); } - if (PR_GetEnv("SIGNTOOL_DUMP_PARSE")) { + if (PR_GetEnvSecure("SIGNTOOL_DUMP_PARSE")) { dumpParse = PR_TRUE; } diff --git a/security/nss/cmd/signtool/util.c b/security/nss/cmd/signtool/util.c index 73568d1ba0a..74055d6810e 100644 --- a/security/nss/cmd/signtool/util.c +++ b/security/nss/cmd/signtool/util.c @@ -5,6 +5,7 @@ #include "signtool.h" #include "prio.h" #include "prmem.h" +#include "prenv.h" #include "nss.h" static int is_dir (char *filename); @@ -981,7 +982,7 @@ char *get_default_cert_dir (void) static char db [FNSIZE]; #ifdef XP_UNIX - home = getenv ("HOME"); + home = PR_GetEnvSecure ("HOME"); if (home && *home) { sprintf (db, "%s/.netscape", home); @@ -994,7 +995,7 @@ char *get_default_cert_dir (void) /* first check the environment override */ - home = getenv ("JAR_HOME"); + home = PR_GetEnvSecure ("JAR_HOME"); if (home && *home) { sprintf (db, "%s/cert7.db", home); diff --git a/security/nss/cmd/smimetools/cmsutil.c b/security/nss/cmd/smimetools/cmsutil.c index eee9baf6744..346fb6b2bb6 100644 --- a/security/nss/cmd/smimetools/cmsutil.c +++ b/security/nss/cmd/smimetools/cmsutil.c @@ -1069,9 +1069,9 @@ main(int argc, char **argv) PRBool batch = PR_FALSE; #ifdef NISCC_TEST - const char *ev = PR_GetEnv("NSS_DISABLE_ARENA_FREE_LIST"); + const char *ev = PR_GetEnvSecure("NSS_DISABLE_ARENA_FREE_LIST"); PORT_Assert(ev); - ev = PR_GetEnv("NSS_STRICT_SHUTDOWN"); + ev = PR_GetEnvSecure("NSS_STRICT_SHUTDOWN"); PORT_Assert(ev); #endif diff --git a/security/nss/cmd/strsclnt/strsclnt.c b/security/nss/cmd/strsclnt/strsclnt.c index f4825050f27..7233249dd8c 100644 --- a/security/nss/cmd/strsclnt/strsclnt.c +++ b/security/nss/cmd/strsclnt/strsclnt.c @@ -1448,7 +1448,7 @@ main(int argc, char **argv) PK11_SetPasswordFunc(SECU_GetModulePassword); - tmp = PR_GetEnv("NSS_DEBUG_TIMEOUT"); + tmp = PR_GetEnvSecure("NSS_DEBUG_TIMEOUT"); if (tmp && tmp[0]) { int sec = PORT_Atoi(tmp); if (sec > 0) { diff --git a/security/nss/cmd/tstclnt/tstclnt.c b/security/nss/cmd/tstclnt/tstclnt.c index 4f4c4d9c48f..d55e5b8e810 100644 --- a/security/nss/cmd/tstclnt/tstclnt.c +++ b/security/nss/cmd/tstclnt/tstclnt.c @@ -968,7 +968,7 @@ int main(int argc, char **argv) progName = strrchr(argv[0], '\\'); progName = progName ? progName+1 : argv[0]; - tmp = PR_GetEnv("NSS_DEBUG_TIMEOUT"); + tmp = PR_GetEnvSecure("NSS_DEBUG_TIMEOUT"); if (tmp && tmp[0]) { int sec = PORT_Atoi(tmp); if (sec > 0) { diff --git a/security/nss/coreconf/coreconf.dep b/security/nss/coreconf/coreconf.dep index 5182f75552c..590d1bfaeee 100644 --- a/security/nss/coreconf/coreconf.dep +++ b/security/nss/coreconf/coreconf.dep @@ -10,3 +10,4 @@ */ #error "Do not include this header file." + diff --git a/security/nss/external_tests/google_test/gtest/test/gtest_unittest.cc b/security/nss/external_tests/google_test/gtest/test/gtest_unittest.cc index 42638ce222b..9625fa4e815 100644 --- a/security/nss/external_tests/google_test/gtest/test/gtest_unittest.cc +++ b/security/nss/external_tests/google_test/gtest/test/gtest_unittest.cc @@ -421,9 +421,9 @@ class FormatEpochTimeInMillisAsIso8601Test : public Test { virtual void SetUp() { saved_tz_ = NULL; - GTEST_DISABLE_MSC_WARNINGS_PUSH_(4996 /* getenv, strdup: deprecated */) - if (getenv("TZ")) - saved_tz_ = strdup(getenv("TZ")); + GTEST_DISABLE_MSC_WARNINGS_PUSH_(4996 /* PR_GetEnvSecure, strdup: deprecated */) + if (PR_GetEnvSecure("TZ")) + saved_tz_ = strdup(PR_GetEnvSecure("TZ")); GTEST_DISABLE_MSC_WARNINGS_POP_() // Set up the time zone for FormatEpochTimeInMillisAsIso8601 to use. We diff --git a/security/nss/external_tests/ssl_gtest/ssl_gtest.cc b/security/nss/external_tests/ssl_gtest/ssl_gtest.cc index ee1c40cfd8a..b99b3d23612 100644 --- a/security/nss/external_tests/ssl_gtest/ssl_gtest.cc +++ b/security/nss/external_tests/ssl_gtest/ssl_gtest.cc @@ -1,4 +1,5 @@ #include "nspr.h" +#include "prenv.h" #include "nss.h" #include "ssl.h" @@ -16,7 +17,7 @@ int main(int argc, char **argv) { ::testing::InitGoogleTest(&argc, argv); g_working_dir_path = "."; - char* workdir = getenv("NSS_GTEST_WORKDIR"); + char* workdir = PR_GetEnvSecure("NSS_GTEST_WORKDIR"); if (workdir) g_working_dir_path = workdir; diff --git a/security/nss/lib/certdb/certdb.c b/security/nss/lib/certdb/certdb.c index 902e0366df0..086728963f5 100644 --- a/security/nss/lib/certdb/certdb.c +++ b/security/nss/lib/certdb/certdb.c @@ -1344,7 +1344,7 @@ cert_TestHostName(char *cn, const char *hn) static int useShellExp = -1; if (useShellExp < 0) { - useShellExp = (NULL != PR_GetEnv("NSS_USE_SHEXP_IN_CERT_NAME")); + useShellExp = (NULL != PR_GetEnvSecure("NSS_USE_SHEXP_IN_CERT_NAME")); } if (useShellExp) { /* Backward compatible code, uses Shell Expressions (SHEXP). */ diff --git a/security/nss/lib/certhigh/certvfypkix.c b/security/nss/lib/certhigh/certvfypkix.c index 7ae10b0c169..d87304bc470 100644 --- a/security/nss/lib/certhigh/certvfypkix.c +++ b/security/nss/lib/certhigh/certvfypkix.c @@ -1137,7 +1137,7 @@ cert_VerifyCertChainPkix( fnStackNameArr[0] = "cert_VerifyCertChainPkix"; fnStackInvCountArr[0] = 0; PKIX_Boolean abortOnLeak = - (PR_GetEnv("PKIX_OBJECT_LEAK_TEST_ABORT_ON_LEAK") == NULL) ? + (PR_GetEnvSecure("PKIX_OBJECT_LEAK_TEST_ABORT_ON_LEAK") == NULL) ? PKIX_FALSE : PKIX_TRUE; runningLeakTest = PKIX_TRUE; @@ -2019,7 +2019,7 @@ CERT_PKIXVerifyCert( fnStackNameArr[0] = "CERT_PKIXVerifyCert"; fnStackInvCountArr[0] = 0; PKIX_Boolean abortOnLeak = - (PR_GetEnv("PKIX_OBJECT_LEAK_TEST_ABORT_ON_LEAK") == NULL) ? + (PR_GetEnvSecure("PKIX_OBJECT_LEAK_TEST_ABORT_ON_LEAK") == NULL) ? PKIX_FALSE : PKIX_TRUE; runningLeakTest = PKIX_TRUE; diff --git a/security/nss/lib/certhigh/ocsp.c b/security/nss/lib/certhigh/ocsp.c index e6c9c219ea0..fb8721a6fe6 100644 --- a/security/nss/lib/certhigh/ocsp.c +++ b/security/nss/lib/certhigh/ocsp.c @@ -159,7 +159,7 @@ wantOcspTrace(void) #ifdef NSS_HAVE_GETENV if (firstTime) { - char *ev = getenv("NSS_TRACE_OCSP"); + char *ev = PR_GetEnvSecure("NSS_TRACE_OCSP"); if (ev && ev[0]) { wantTrace = PR_TRUE; } diff --git a/security/nss/lib/freebl/Makefile b/security/nss/lib/freebl/Makefile index ab0b1e57177..e8f94024139 100644 --- a/security/nss/lib/freebl/Makefile +++ b/security/nss/lib/freebl/Makefile @@ -166,6 +166,9 @@ else DEFINES += -DUSE_HW_AES -DINTEL_GCM ASFILES += intel-aes-x64-masm.asm intel-gcm-x64-masm.asm EXTRA_SRCS += intel-gcm-wrap.c + ifeq ($(CLANG_CL),1) + INTEL_GCM_CLANG_CL = 1 + endif endif MPI_SRCS += mpi_amd64.c endif diff --git a/security/nss/lib/freebl/loader.c b/security/nss/lib/freebl/loader.c index 9105a69002e..12fe5600324 100644 --- a/security/nss/lib/freebl/loader.c +++ b/security/nss/lib/freebl/loader.c @@ -904,7 +904,7 @@ BL_Unload(void) * never does a handshake on it, BL_Unload will be called even though freebl * was never loaded. So, don't assert blLib. */ if (blLib) { - disableUnload = PR_GetEnv("NSS_DISABLE_UNLOAD"); + disableUnload = PR_GetEnvSecure("NSS_DISABLE_UNLOAD"); if (!disableUnload) { #ifdef DEBUG PRStatus status = PR_UnloadLibrary(blLib); diff --git a/security/nss/lib/freebl/mpi/utils/isprime.c b/security/nss/lib/freebl/mpi/utils/isprime.c index 65488991665..b43b8eb8246 100644 --- a/security/nss/lib/freebl/mpi/utils/isprime.c +++ b/security/nss/lib/freebl/mpi/utils/isprime.c @@ -38,7 +38,7 @@ int main(int argc, char *argv[]) { char *tmp; - if((tmp = getenv("RM_TESTS")) != NULL) { + if((tmp = PR_GetEnvSecure("RM_TESTS")) != NULL) { if((g_tests = atoi(tmp)) <= 0) g_tests = RM_TESTS; } diff --git a/security/nss/lib/freebl/mpi/utils/metime.c b/security/nss/lib/freebl/mpi/utils/metime.c index de5104304b4..c2264b7562e 100644 --- a/security/nss/lib/freebl/mpi/utils/metime.c +++ b/security/nss/lib/freebl/mpi/utils/metime.c @@ -27,8 +27,8 @@ int main(int argc, char *argv[]) mp_int a, m, c; - if(getenv("SEED") != NULL) - seed = abs(atoi(getenv("SEED"))); + if(PR_GetEnvSecure("SEED") != NULL) + seed = abs(atoi(PR_GetEnvSecure("SEED"))); else seed = (unsigned int)time(NULL); diff --git a/security/nss/lib/freebl/mpi/utils/primegen.c b/security/nss/lib/freebl/mpi/utils/primegen.c index aac7abaf96d..b922a746f6b 100644 --- a/security/nss/lib/freebl/mpi/utils/primegen.c +++ b/security/nss/lib/freebl/mpi/utils/primegen.c @@ -46,7 +46,7 @@ int main(int argc, char *argv[]) /* We'll just use the C library's rand() for now, although this won't be good enough for cryptographic purposes */ - if((out = getenv("SEED")) == NULL) { + if((out = PR_GetEnvSecure("SEED")) == NULL) { srand((unsigned int)time(NULL)); } else { srand((unsigned int)atoi(out)); diff --git a/security/nss/lib/freebl/rijndael.c b/security/nss/lib/freebl/rijndael.c index 8b3704bed86..f6e38f62bdc 100644 --- a/security/nss/lib/freebl/rijndael.c +++ b/security/nss/lib/freebl/rijndael.c @@ -7,6 +7,7 @@ #endif #include "prinit.h" +#include "prenv.h" #include "prerr.h" #include "secerr.h" @@ -1041,7 +1042,7 @@ aes_InitContext(AESContext *cx, const unsigned char *key, unsigned int keysize, #ifdef USE_HW_AES if (has_intel_aes == 0) { unsigned long eax, ebx, ecx, edx; - char *disable_hw_aes = getenv("NSS_DISABLE_HW_AES"); + char *disable_hw_aes = PR_GetEnvSecure("NSS_DISABLE_HW_AES"); if (disable_hw_aes == NULL) { freebl_cpuid(1, &eax, &ebx, &ecx, &edx); diff --git a/security/nss/lib/freebl/stubs.c b/security/nss/lib/freebl/stubs.c index 993d01e18ef..ed2b643d416 100644 --- a/security/nss/lib/freebl/stubs.c +++ b/security/nss/lib/freebl/stubs.c @@ -138,6 +138,7 @@ STUB_DECLARE(PRStatus,PR_Sleep,(PRIntervalTime ticks)); STUB_DECLARE(PRStatus,PR_Unlock,(PRLock *lock)); STUB_DECLARE(PRStatus,PR_WaitCondVar,(PRCondVar *cvar, PRIntervalTime timeout)); +STUB_DECLARE(char*,PR_GetEnvSecure,(const char *)); STUB_DECLARE(SECItem *,SECITEM_AllocItem_Util,(PLArenaPool *arena, @@ -465,6 +466,13 @@ PR_WaitCondVar_stub(PRCondVar *cvar, PRIntervalTime timeout) return PR_FAILURE; } +extern char* +PR_GetEnvSecure_stub(const char *var) +{ + STUB_SAFE_CALL1(PR_GetEnvSecure, var); + abort(); + return NULL; +} extern void @@ -570,6 +578,7 @@ freebl_InitNSPR(void *lib) STUB_FETCH_FUNCTION(PR_Unlock); STUB_FETCH_FUNCTION(PR_Lock); STUB_FETCH_FUNCTION(PR_DestroyLock); + STUB_FETCH_FUNCTION(PR_GetEnvSecure); return SECSuccess; } diff --git a/security/nss/lib/freebl/stubs.h b/security/nss/lib/freebl/stubs.h index 72f30000ccd..3ba00705d91 100644 --- a/security/nss/lib/freebl/stubs.h +++ b/security/nss/lib/freebl/stubs.h @@ -58,6 +58,7 @@ #define PR_Sleep PR_Sleep_stub #define PR_Unlock PR_Unlock_stub #define PR_WaitCondVar PR_WaitCondVar_stub +#define PR_GetEnvSecure PR_GetEnvSecure_stub extern int FREEBL_InitStubs(void); diff --git a/security/nss/lib/freebl/unix_rand.c b/security/nss/lib/freebl/unix_rand.c index 579040eea8e..c9674ea9126 100644 --- a/security/nss/lib/freebl/unix_rand.c +++ b/security/nss/lib/freebl/unix_rand.c @@ -17,6 +17,7 @@ #include "prerror.h" #include "prthread.h" #include "prprf.h" +#include "prenv.h" size_t RNG_FileUpdate(const char *fileName, size_t limit); @@ -888,9 +889,9 @@ void RNG_SystemInfoForRNG(void) bytes = RNG_FileUpdate("/dev/urandom", SYSTEM_RNG_SEED_COUNT); /* If the user points us to a random file, pass it through the rng */ - randfile = getenv("NSRANDFILE"); + randfile = PR_GetEnvSecure("NSRANDFILE"); if ( ( randfile != NULL ) && ( randfile[0] != '\0') ) { - char *randCountString = getenv("NSRANDCOUNT"); + char *randCountString = PR_GetEnvSecure("NSRANDCOUNT"); int randCount = randCountString ? atoi(randCountString) : 0; if (randCount != 0) { RNG_FileUpdate(randfile, randCount); @@ -1075,7 +1076,7 @@ int ReadOneFile(int fileToRead) int i, error = -1; if (fd == NULL) { - dir = getenv("HOME"); + dir = PR_GetEnvSecure("HOME"); if (dir) { fd = opendir(dir); } diff --git a/security/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_socket.c b/security/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_socket.c index 6bd0a3a0990..e8698376b5b 100644 --- a/security/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_socket.c +++ b/security/nss/lib/libpkix/pkix_pl_nss/module/pkix_pl_socket.c @@ -765,7 +765,7 @@ pkix_pl_Socket_RegisterSelf(void *plContext) #ifdef PKIX_SOCKETTRACE { char *val = NULL; - val = PR_GetEnv("SOCKETTRACE"); + val = PR_GetEnvSecure("SOCKETTRACE"); /* Is SOCKETTRACE set in the environment? */ if ((val != NULL) && (*val != '\0')) { socketTraceFlag = diff --git a/security/nss/lib/libpkix/pkix_pl_nss/system/pkix_pl_lifecycle.c b/security/nss/lib/libpkix/pkix_pl_nss/system/pkix_pl_lifecycle.c index 338eb1c017e..70ed25d729a 100755 --- a/security/nss/lib/libpkix/pkix_pl_nss/system/pkix_pl_lifecycle.c +++ b/security/nss/lib/libpkix/pkix_pl_nss/system/pkix_pl_lifecycle.c @@ -135,7 +135,7 @@ PKIX_PL_Initialize( return PKIX_ALLOC_ERROR(); } - if (PR_GetEnv("NSS_STRICT_SHUTDOWN")) { + if (PR_GetEnvSecure("NSS_STRICT_SHUTDOWN")) { pkixLog = PR_NewLogModule("pkix"); } /* @@ -262,7 +262,7 @@ PKIX_PL_Shutdown(void *plContext) #ifdef DEBUG numLeakedObjects = pkix_pl_lifecycle_ObjectLeakCheck(NULL); - if (PR_GetEnv("NSS_STRICT_SHUTDOWN")) { + if (PR_GetEnvSecure("NSS_STRICT_SHUTDOWN")) { PORT_Assert(numLeakedObjects == 0); } #else diff --git a/security/nss/lib/nss/nss.h b/security/nss/lib/nss/nss.h index 968a039dd18..53a05090436 100644 --- a/security/nss/lib/nss/nss.h +++ b/security/nss/lib/nss/nss.h @@ -33,12 +33,12 @@ * The format of the version string should be * ".[.[.]][ ][ ]" */ -#define NSS_VERSION "3.22" _NSS_ECC_STRING _NSS_CUSTOMIZED +#define NSS_VERSION "3.23" _NSS_ECC_STRING _NSS_CUSTOMIZED " Beta" #define NSS_VMAJOR 3 -#define NSS_VMINOR 22 +#define NSS_VMINOR 23 #define NSS_VPATCH 0 #define NSS_VBUILD 0 -#define NSS_BETA PR_FALSE +#define NSS_BETA PR_TRUE #ifndef RC_INVOKED diff --git a/security/nss/lib/nss/nssinit.c b/security/nss/lib/nss/nssinit.c index b22f9151e3f..b73d447d8cf 100644 --- a/security/nss/lib/nss/nssinit.c +++ b/security/nss/lib/nss/nssinit.c @@ -691,7 +691,7 @@ nss_Init(const char *configdir, const char *certPrefix, const char *keyPrefix, if (pkixError != NULL) { goto loser; } else { - char *ev = getenv("NSS_ENABLE_PKIX_VERIFY"); + char *ev = PR_GetEnvSecure("NSS_ENABLE_PKIX_VERIFY"); if (ev && ev[0]) { CERT_SetUsePKIXForValidation(PR_TRUE); } diff --git a/security/nss/lib/pk11wrap/debug_module.c b/security/nss/lib/pk11wrap/debug_module.c index 89ebacca5a3..bf3eccbf40d 100644 --- a/security/nss/lib/pk11wrap/debug_module.c +++ b/security/nss/lib/pk11wrap/debug_module.c @@ -2685,7 +2685,7 @@ static void print_final_statistics(void) FILE *outfile = NULL; int i; - fname = PR_GetEnv("NSS_OUTPUT_FILE"); + fname = PR_GetEnvSecure("NSS_OUTPUT_FILE"); if (fname) { /* need to add an optional process id to the filename */ outfile = fopen(fname,"w+"); diff --git a/security/nss/lib/pk11wrap/pk11akey.c b/security/nss/lib/pk11wrap/pk11akey.c index b0604de3a81..63de67d8d40 100644 --- a/security/nss/lib/pk11wrap/pk11akey.c +++ b/security/nss/lib/pk11wrap/pk11akey.c @@ -168,7 +168,7 @@ PK11_ImportPublicKey(PK11SlotInfo *slot, SECKEYPublicKey *pubKey, PK11_SETATTRS(attrs, CKA_EC_PARAMS, pubKey->u.ec.DEREncodedParams.data, pubKey->u.ec.DEREncodedParams.len); attrs++; - if (PR_GetEnv("NSS_USE_DECODED_CKA_EC_POINT")) { + if (PR_GetEnvSecure("NSS_USE_DECODED_CKA_EC_POINT")) { PK11_SETATTRS(attrs, CKA_EC_POINT, pubKey->u.ec.publicValue.data, pubKey->u.ec.publicValue.len); attrs++; diff --git a/security/nss/lib/pk11wrap/pk11load.c b/security/nss/lib/pk11wrap/pk11load.c index e3ba1226e5f..5c5d2caebd0 100644 --- a/security/nss/lib/pk11wrap/pk11load.c +++ b/security/nss/lib/pk11wrap/pk11load.c @@ -466,7 +466,7 @@ secmod_LoadPKCS11Module(SECMODModule *mod, SECMODModule **oldModule) { #ifdef DEBUG_MODULE if (PR_TRUE) { - modToDBG = PR_GetEnv("NSS_DEBUG_PKCS11_MODULE"); + modToDBG = PR_GetEnvSecure("NSS_DEBUG_PKCS11_MODULE"); if (modToDBG && strcmp(mod->commonName, modToDBG) == 0) { mod->functionList = (void *)nss_InsertDeviceLog( (CK_FUNCTION_LIST_PTR)mod->functionList); @@ -558,7 +558,7 @@ fail2: } fail: mod->functionList = NULL; - disableUnload = PR_GetEnv("NSS_DISABLE_UNLOAD"); + disableUnload = PR_GetEnvSecure("NSS_DISABLE_UNLOAD"); if (library && !disableUnload) { PR_UnloadLibrary(library); } @@ -587,7 +587,7 @@ SECMOD_UnloadModule(SECMODModule *mod) { if (mod->internal && (mod->dllName == NULL)) { if (0 == PR_ATOMIC_DECREMENT(&softokenLoadCount)) { if (softokenLib) { - disableUnload = PR_GetEnv("NSS_DISABLE_UNLOAD"); + disableUnload = PR_GetEnvSecure("NSS_DISABLE_UNLOAD"); if (!disableUnload) { #ifdef DEBUG PRStatus status = PR_UnloadLibrary(softokenLib); @@ -609,7 +609,7 @@ SECMOD_UnloadModule(SECMODModule *mod) { return SECFailure; } - disableUnload = PR_GetEnv("NSS_DISABLE_UNLOAD"); + disableUnload = PR_GetEnvSecure("NSS_DISABLE_UNLOAD"); if (!disableUnload) { PR_UnloadLibrary(library); } diff --git a/security/nss/lib/pk11wrap/pk11pars.c b/security/nss/lib/pk11wrap/pk11pars.c index 5585de1df37..51160bbda1c 100644 --- a/security/nss/lib/pk11wrap/pk11pars.c +++ b/security/nss/lib/pk11wrap/pk11pars.c @@ -1086,7 +1086,7 @@ secmod_configIsDBM(char *configDir) || (strncmp(configDir, "extern:", 7) == 0)) { return PR_FALSE; } - env = PR_GetEnv("NSS_DEFAULT_DB_TYPE"); + env = PR_GetEnvSecure("NSS_DEFAULT_DB_TYPE"); /* implicit dbm open */ if ((env == NULL) || (strcmp(env,"dbm") == 0)) { return PR_TRUE; diff --git a/security/nss/lib/pk11wrap/pk11util.c b/security/nss/lib/pk11wrap/pk11util.c index 88f7e004017..712f267f114 100644 --- a/security/nss/lib/pk11wrap/pk11util.c +++ b/security/nss/lib/pk11wrap/pk11util.c @@ -84,7 +84,7 @@ SECMOD_Shutdown() nss_DumpModuleLog(); #ifdef DEBUG - if (PR_GetEnv("NSS_STRICT_SHUTDOWN")) { + if (PR_GetEnvSecure("NSS_STRICT_SHUTDOWN")) { PORT_Assert(secmod_PrivateModuleCount == 0); } #endif diff --git a/security/nss/lib/softoken/fipstokn.c b/security/nss/lib/softoken/fipstokn.c index 3cb6b794def..06335591b19 100644 --- a/security/nss/lib/softoken/fipstokn.c +++ b/security/nss/lib/softoken/fipstokn.c @@ -436,7 +436,7 @@ CK_RV FC_Initialize(CK_VOID_PTR pReserved) { return CKR_CRYPTOKI_ALREADY_INITIALIZED; } - if ((envp = PR_GetEnv("NSS_ENABLE_AUDIT")) != NULL) { + if ((envp = PR_GetEnvSecure("NSS_ENABLE_AUDIT")) != NULL) { sftk_audit_enabled = (atoi(envp) == 1); } diff --git a/security/nss/lib/softoken/legacydb/lgattr.c b/security/nss/lib/softoken/legacydb/lgattr.c index 429ef87260b..65289b076d3 100644 --- a/security/nss/lib/softoken/legacydb/lgattr.c +++ b/security/nss/lib/softoken/legacydb/lgattr.c @@ -571,7 +571,7 @@ lg_FindECPublicKeyAttribute(NSSLOWKEYPublicKey *key, CK_ATTRIBUTE_TYPE type, key->u.ec.ecParams.DEREncoding.data, key->u.ec.ecParams.DEREncoding.len); case CKA_EC_POINT: - if (getenv("NSS_USE_DECODED_CKA_EC_POINT")) { + if (PR_GetEnvSecure("NSS_USE_DECODED_CKA_EC_POINT")) { return lg_CopyAttributeSigned(attribute, type, key->u.ec.publicValue.data, key->u.ec.publicValue.len); diff --git a/security/nss/lib/softoken/legacydb/lginit.c b/security/nss/lib/softoken/legacydb/lginit.c index b49f3fea684..363e719d873 100644 --- a/security/nss/lib/softoken/legacydb/lginit.c +++ b/security/nss/lib/softoken/legacydb/lginit.c @@ -168,7 +168,7 @@ DB * rdbopen(const char *appName, const char *prefix, } /* couldn't find the entry point, unload the library and fail */ - disableUnload = PR_GetEnv("NSS_DISABLE_UNLOAD"); + disableUnload = PR_GetEnvSecure("NSS_DISABLE_UNLOAD"); if (!disableUnload) { PR_UnloadLibrary(lib); } diff --git a/security/nss/lib/softoken/lgglue.c b/security/nss/lib/softoken/lgglue.c index c7b82bd1d2b..653501c26c7 100644 --- a/security/nss/lib/softoken/lgglue.c +++ b/security/nss/lib/softoken/lgglue.c @@ -418,7 +418,7 @@ sftkdbCall_Shutdown(void) #endif crv = (*legacy_glue_shutdown)(parentForkedAfterC_Initialize); } - disableUnload = PR_GetEnv("NSS_DISABLE_UNLOAD"); + disableUnload = PR_GetEnvSecure("NSS_DISABLE_UNLOAD"); if (!disableUnload) { PR_UnloadLibrary(legacy_glue_lib); } diff --git a/security/nss/lib/softoken/pkcs11c.c b/security/nss/lib/softoken/pkcs11c.c index 3c96849f979..ace74961d26 100644 --- a/security/nss/lib/softoken/pkcs11c.c +++ b/security/nss/lib/softoken/pkcs11c.c @@ -36,6 +36,7 @@ #include "secerr.h" #include "prprf.h" +#include "prenv.h" #define __PASTE(x,y) x##y @@ -4770,7 +4771,7 @@ dhgn_done: break; } - if (getenv("NSS_USE_DECODED_CKA_EC_POINT")) { + if (PR_GetEnvSecure("NSS_USE_DECODED_CKA_EC_POINT")) { crv = sftk_AddAttributeType(publicKey, CKA_EC_POINT, sftk_item_expand(&ecPriv->publicValue)); } else { diff --git a/security/nss/lib/softoken/sdb.c b/security/nss/lib/softoken/sdb.c index 16848604c6f..36bdcc132f0 100644 --- a/security/nss/lib/softoken/sdb.c +++ b/security/nss/lib/softoken/sdb.c @@ -235,7 +235,7 @@ sdb_getFallbackTempDir(void) const char *zDir = NULL; azDirs[0] = sqlite3_temp_directory; - azDirs[1] = getenv("TMPDIR"); + azDirs[1] = PR_GetEnvSecure("TMPDIR"); for (i = 0; i < PR_ARRAY_SIZE(azDirs); i++) { zDir = azDirs[i]; @@ -1862,7 +1862,7 @@ sdb_init(char *dbname, char *table, sdbDataType type, int *inUpdate, * the environment variable is primarily to simplify testing, and to * correct potential corner cases where */ - env = PR_GetEnv("NSS_SDB_USE_CACHE"); + env = PR_GetEnvSecure("NSS_SDB_USE_CACHE"); if (env && PORT_Strcasecmp(env,"no") == 0) { enableCache = PR_FALSE; @@ -2013,7 +2013,7 @@ s_open(const char *directory, const char *certPrefix, const char *keyPrefix, accessOps = 1; { char *env; - env = PR_GetEnv("NSS_SDB_USE_CACHE"); + env = PR_GetEnvSecure("NSS_SDB_USE_CACHE"); /* If the environment variable is set to yes or no, sdb_init() will * ignore the value of accessOps, and we can skip the measuring.*/ if (!env || ((PORT_Strcasecmp(env, "no") != 0) && diff --git a/security/nss/lib/softoken/softkver.h b/security/nss/lib/softoken/softkver.h index 675eda4db87..5de3b08ec3a 100644 --- a/security/nss/lib/softoken/softkver.h +++ b/security/nss/lib/softoken/softkver.h @@ -25,11 +25,11 @@ * The format of the version string should be * ".[.[.]][ ][ ]" */ -#define SOFTOKEN_VERSION "3.22" SOFTOKEN_ECC_STRING +#define SOFTOKEN_VERSION "3.23" SOFTOKEN_ECC_STRING " Beta" #define SOFTOKEN_VMAJOR 3 -#define SOFTOKEN_VMINOR 22 +#define SOFTOKEN_VMINOR 23 #define SOFTOKEN_VPATCH 0 #define SOFTOKEN_VBUILD 0 -#define SOFTOKEN_BETA PR_FALSE +#define SOFTOKEN_BETA PR_TRUE #endif /* _SOFTKVER_H_ */ diff --git a/security/nss/lib/softoken/softoken.h b/security/nss/lib/softoken/softoken.h index fbd00b6c7f2..5935ea24f5a 100644 --- a/security/nss/lib/softoken/softoken.h +++ b/security/nss/lib/softoken/softoken.h @@ -152,7 +152,7 @@ extern PRBool sftk_fatalError; #define FORK_ASSERT() \ { \ - char* forkAssert = getenv("NSS_STRICT_NOFORK"); \ + char* forkAssert = PR_GetEnvSecure("NSS_STRICT_NOFORK"); \ if ( (!forkAssert) || (0 == strcmp(forkAssert, "1")) ) { \ PORT_Assert(0); \ } \ @@ -239,7 +239,7 @@ extern PRBool sftkForkCheckDisabled; #define ENABLE_FORK_CHECK() \ { \ - char* doForkCheck = getenv("NSS_STRICT_NOFORK"); \ + char* doForkCheck = PR_GetEnvSecure("NSS_STRICT_NOFORK"); \ if ( doForkCheck && !strcmp(doForkCheck, "DISABLED") ) { \ sftkForkCheckDisabled = PR_TRUE; \ } \ diff --git a/security/nss/lib/ssl/ssl3con.c b/security/nss/lib/ssl/ssl3con.c index a8e5eb9f952..9f19d619067 100644 --- a/security/nss/lib/ssl/ssl3con.c +++ b/security/nss/lib/ssl/ssl3con.c @@ -10165,16 +10165,16 @@ get_fake_cert(SECItem *pCertItem, int *pIndex) char cfn[100]; pCertItem->data = 0; - if ((testdir = PR_GetEnv("NISCC_TEST")) == NULL) { + if ((testdir = PR_GetEnvSecure("NISCC_TEST")) == NULL) { return SECSuccess; } *pIndex = (NULL != strstr(testdir, "root")); extension = (strstr(testdir, "simple") ? "" : ".der"); fileNum = PR_ATOMIC_INCREMENT(&connNum) - 1; - if ((startat = PR_GetEnv("START_AT")) != NULL) { + if ((startat = PR_GetEnvSecure("START_AT")) != NULL) { fileNum += atoi(startat); } - if ((stopat = PR_GetEnv("STOP_AT")) != NULL && + if ((stopat = PR_GetEnvSecure("STOP_AT")) != NULL && fileNum >= atoi(stopat)) { *pIndex = -1; return SECSuccess; diff --git a/security/nss/lib/ssl/sslsnce.c b/security/nss/lib/ssl/sslsnce.c index f31b2e9c2d7..acad15dd768 100644 --- a/security/nss/lib/ssl/sslsnce.c +++ b/security/nss/lib/ssl/sslsnce.c @@ -1528,7 +1528,7 @@ SSL_InheritMPServerSIDCacheInstance(cacheDesc *cache, const char * envString) ssl_sid_uncache = ServerSessionIDUncache; if (!envString) { - envString = getenv(envVarName); + envString = PR_GetEnvSecure(envVarName); if (!envString) { SET_ERROR_CODE return SECFailure; @@ -1747,7 +1747,7 @@ LaunchLockPoller(cacheDesc *cache) PRThread * pollerThread; cache->mutexTimeout = SID_LOCK_EXPIRATION_TIMEOUT; - timeoutString = getenv("NSS_SSL_SERVER_CACHE_MUTEX_TIMEOUT"); + timeoutString = PR_GetEnvSecure("NSS_SSL_SERVER_CACHE_MUTEX_TIMEOUT"); if (timeoutString) { long newTime = strtol(timeoutString, 0, 0); if (newTime == 0) diff --git a/security/nss/lib/ssl/sslsock.c b/security/nss/lib/ssl/sslsock.c index b29913aaf9a..6c19e647cd1 100644 --- a/security/nss/lib/ssl/sslsock.c +++ b/security/nss/lib/ssl/sslsock.c @@ -3332,7 +3332,7 @@ ssl_SetDefaultsFromEnvironment(void) char * ev; firsttime = 0; #ifdef DEBUG - ev = getenv("SSLDEBUGFILE"); + ev = PR_GetEnvSecure("SSLDEBUGFILE"); if (ev && ev[0]) { ssl_trace_iob = fopen(ev, "w"); } @@ -3340,19 +3340,19 @@ ssl_SetDefaultsFromEnvironment(void) ssl_trace_iob = stderr; } #ifdef TRACE - ev = getenv("SSLTRACE"); + ev = PR_GetEnvSecure("SSLTRACE"); if (ev && ev[0]) { ssl_trace = atoi(ev); SSL_TRACE(("SSL: tracing set to %d", ssl_trace)); } #endif /* TRACE */ - ev = getenv("SSLDEBUG"); + ev = PR_GetEnvSecure("SSLDEBUG"); if (ev && ev[0]) { ssl_debug = atoi(ev); SSL_TRACE(("SSL: debugging set to %d", ssl_debug)); } #endif /* DEBUG */ - ev = getenv("SSLKEYLOGFILE"); + ev = PR_GetEnvSecure("SSLKEYLOGFILE"); if (ev && ev[0]) { ssl_keylog_iob = fopen(ev, "a"); if (!ssl_keylog_iob) { @@ -3366,21 +3366,21 @@ ssl_SetDefaultsFromEnvironment(void) } } #ifndef NO_PKCS11_BYPASS - ev = getenv("SSLBYPASS"); + ev = PR_GetEnvSecure("SSLBYPASS"); if (ev && ev[0]) { ssl_defaults.bypassPKCS11 = (ev[0] == '1'); SSL_TRACE(("SSL: bypass default set to %d", \ ssl_defaults.bypassPKCS11)); } #endif /* NO_PKCS11_BYPASS */ - ev = getenv("SSLFORCELOCKS"); + ev = PR_GetEnvSecure("SSLFORCELOCKS"); if (ev && ev[0] == '1') { ssl_force_locks = PR_TRUE; ssl_defaults.noLocks = 0; strcpy(lockStatus + LOCKSTATUS_OFFSET, "FORCED. "); SSL_TRACE(("SSL: force_locks set to %d", ssl_force_locks)); } - ev = getenv("NSS_SSL_ENABLE_RENEGOTIATION"); + ev = PR_GetEnvSecure("NSS_SSL_ENABLE_RENEGOTIATION"); if (ev) { if (ev[0] == '1' || LOWER(ev[0]) == 'u') ssl_defaults.enableRenegotiation = SSL_RENEGOTIATE_UNRESTRICTED; @@ -3393,13 +3393,13 @@ ssl_SetDefaultsFromEnvironment(void) SSL_TRACE(("SSL: enableRenegotiation set to %d", ssl_defaults.enableRenegotiation)); } - ev = getenv("NSS_SSL_REQUIRE_SAFE_NEGOTIATION"); + ev = PR_GetEnvSecure("NSS_SSL_REQUIRE_SAFE_NEGOTIATION"); if (ev && ev[0] == '1') { ssl_defaults.requireSafeNegotiation = PR_TRUE; SSL_TRACE(("SSL: requireSafeNegotiation set to %d", PR_TRUE)); } - ev = getenv("NSS_SSL_CBC_RANDOM_IV"); + ev = PR_GetEnvSecure("NSS_SSL_CBC_RANDOM_IV"); if (ev && ev[0] == '0') { ssl_defaults.cbcRandomIV = PR_FALSE; SSL_TRACE(("SSL: cbcRandomIV set to 0")); diff --git a/security/nss/lib/sysinit/nsssysinit.c b/security/nss/lib/sysinit/nsssysinit.c index 5d139ab866d..0cc3a64e65e 100644 --- a/security/nss/lib/sysinit/nsssysinit.c +++ b/security/nss/lib/sysinit/nsssysinit.c @@ -5,6 +5,7 @@ #include "prio.h" #include "prprf.h" #include "plhash.h" +#include "prenv.h" /* * The following provides a default example for operating systems to set up @@ -41,7 +42,7 @@ testdir(char *dir) static char * getUserDB(void) { - char *userdir = getenv("HOME"); + char *userdir = PR_GetEnvSecure("HOME"); char *nssdir = NULL; if (userdir == NULL) { @@ -133,7 +134,7 @@ userCanModifySystemDB() static PRBool getFIPSEnv(void) { - char *fipsEnv = getenv("NSS_FIPS"); + char *fipsEnv = PR_GetEnvSecure("NSS_FIPS"); if (!fipsEnv) { return PR_FALSE; } diff --git a/security/nss/lib/util/nssutil.h b/security/nss/lib/util/nssutil.h index 7e67861e373..b80ac50caeb 100644 --- a/security/nss/lib/util/nssutil.h +++ b/security/nss/lib/util/nssutil.h @@ -19,12 +19,12 @@ * The format of the version string should be * ".[.[.]][ ]" */ -#define NSSUTIL_VERSION "3.22" +#define NSSUTIL_VERSION "3.23 Beta" #define NSSUTIL_VMAJOR 3 -#define NSSUTIL_VMINOR 22 +#define NSSUTIL_VMINOR 23 #define NSSUTIL_VPATCH 0 #define NSSUTIL_VBUILD 0 -#define NSSUTIL_BETA PR_FALSE +#define NSSUTIL_BETA PR_TRUE SEC_BEGIN_PROTOS diff --git a/security/nss/lib/util/secoid.c b/security/nss/lib/util/secoid.c index 71fd24cf384..6f2edb1ae19 100644 --- a/security/nss/lib/util/secoid.c +++ b/security/nss/lib/util/secoid.c @@ -1990,7 +1990,7 @@ SECOID_Init(void) return SECSuccess; /* already initialized */ } - if (!PR_GetEnv("NSS_ALLOW_WEAK_SIGNATURE_ALG")) { + if (!PR_GetEnvSecure("NSS_ALLOW_WEAK_SIGNATURE_ALG")) { /* initialize any policy flags that are disabled by default */ xOids[SEC_OID_MD2 ].notPolicyFlags = ~0; xOids[SEC_OID_MD4 ].notPolicyFlags = ~0; @@ -2005,7 +2005,7 @@ SECOID_Init(void) /* turn off NSS_USE_POLICY_IN_SSL by default */ xOids[SEC_OID_APPLY_SSL_POLICY].notPolicyFlags = NSS_USE_POLICY_IN_SSL; - envVal = PR_GetEnv("NSS_HASH_ALG_SUPPORT"); + envVal = PR_GetEnvSecure("NSS_HASH_ALG_SUPPORT"); if (envVal) handleHashAlgSupport(envVal); diff --git a/security/nss/lib/util/secport.c b/security/nss/lib/util/secport.c index 723d89b351d..dcf58934eb9 100644 --- a/security/nss/lib/util/secport.c +++ b/security/nss/lib/util/secport.c @@ -321,7 +321,7 @@ PORT_FreeArena(PLArenaPool *arena, PRBool zero) } if (!checkedEnv) { /* no need for thread protection here */ - doFreeArenaPool = (PR_GetEnv("NSS_DISABLE_ARENA_FREE_LIST") == NULL); + doFreeArenaPool = (PR_GetEnvSecure("NSS_DISABLE_ARENA_FREE_LIST") == NULL); checkedEnv = PR_TRUE; } if (zero) { diff --git a/security/nss/lib/util/utilpars.c b/security/nss/lib/util/utilpars.c index 3f293408ca8..eef3eee7e9c 100644 --- a/security/nss/lib/util/utilpars.c +++ b/security/nss/lib/util/utilpars.c @@ -1083,7 +1083,7 @@ _NSSUTIL_EvaluateConfigDir(const char *configdir, configdir = configdir + sizeof(LEGACY) -1; } else { /* look up the default from the environment */ - char *defaultType = PR_GetEnv("NSS_DEFAULT_DB_TYPE"); + char *defaultType = PR_GetEnvSecure("NSS_DEFAULT_DB_TYPE"); if (defaultType != NULL) { if (PORT_Strncmp(defaultType, SQLDB, sizeof(SQLDB)-2) == 0) { dbType = NSS_DB_TYPE_SQL; From c3b9e9117cb17ce99b33f0422453440dd51c2674 Mon Sep 17 00:00:00 2001 From: James Cheng Date: Tue, 2 Feb 2016 01:26:00 +0100 Subject: [PATCH 024/117] Bug 1238883 - [TV Browser] It shows "The page cannot be displayed" when user browse some webpages. r=roc --- dom/browser-element/BrowserElementChildPreload.js | 1 + 1 file changed, 1 insertion(+) diff --git a/dom/browser-element/BrowserElementChildPreload.js b/dom/browser-element/BrowserElementChildPreload.js index cc6e652af59..f8d9b331478 100644 --- a/dom/browser-element/BrowserElementChildPreload.js +++ b/dom/browser-element/BrowserElementChildPreload.js @@ -1887,6 +1887,7 @@ BrowserElementChild.prototype = { case Cr.NS_BINDING_ABORTED : // Ignoring NS_BINDING_ABORTED, which is set when loading page is // stopped. + case Cr.NS_ERROR_PARSED_DATA_CACHED: return; // TODO See nsDocShell::DisplayLoadError to see what extra From a3bdeeed025f8ad59c145c5932c572dc19b94c96 Mon Sep 17 00:00:00 2001 From: Henrik Skupin Date: Tue, 2 Feb 2016 12:04:59 +0100 Subject: [PATCH 025/117] Bug 1243696 - Fix unsafe CPOW usage for TabBar.get_handle_for_tab(). r=maja_zf --- .../firefox/firefox_puppeteer/ui/browser/tabbar.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/testing/puppeteer/firefox/firefox_puppeteer/ui/browser/tabbar.py b/testing/puppeteer/firefox/firefox_puppeteer/ui/browser/tabbar.py index d54d6e8e750..7aa894b4f26 100644 --- a/testing/puppeteer/firefox/firefox_puppeteer/ui/browser/tabbar.py +++ b/testing/puppeteer/firefox/firefox_puppeteer/ui/browser/tabbar.py @@ -193,13 +193,11 @@ class TabBar(UIBaseLib): # element corresponding to the active window according to # marionette or a similar ability should be added to marionette. handle = marionette.execute_script(""" - let win = arguments[0].linkedBrowser.contentWindowAsCPOW; + let win = arguments[0].linkedBrowser; if (!win) { return null; } - return win.QueryInterface(Components.interfaces.nsIInterfaceRequestor) - .getInterface(Components.interfaces.nsIDOMWindowUtils) - .outerWindowID.toString(); + return win.outerWindowID.toString(); """, script_args=[tab_element]) return handle From 29eb5cf8c85cc0abc810401b4ff2d79e7dfb86c5 Mon Sep 17 00:00:00 2001 From: Henry Chang Date: Mon, 25 Jan 2016 22:55:00 +0800 Subject: [PATCH 026/117] Bug 1241000 - Enable all wifi emulator test case. r=edgar --- dom/wifi/test/marionette/manifest.ini | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/dom/wifi/test/marionette/manifest.ini b/dom/wifi/test/marionette/manifest.ini index c2e398d037a..5d245739c02 100644 --- a/dom/wifi/test/marionette/manifest.ini +++ b/dom/wifi/test/marionette/manifest.ini @@ -10,18 +10,15 @@ qemu = true [test_wifi_auto_connect.js] [test_wifi_static_ip.js] [test_wifi_tethering_wifi_disabled.js] -skip-if = android_version > '15' # Bug 1203075 [test_wifi_tethering_wifi_inactive.js] -skip-if = android_version > '15' # Bug 1203075 [test_wifi_tethering_wifi_active.js] -skip-if = android_version > '15' # Bug 1203075 [test_wifi_manage_server_certificate.js] [test_wifi_manage_user_certificate.js] [test_wifi_manage_pkcs12_certificate.js] [test_wifi_associate_WPA_EAP_PEAP.js] -disabled = Bug 1173697 +skip-if = android_version < '16' # EAP test not working before KK. [test_wifi_associate_WPA_EAP_TTLS.js] -disabled = Bug 1173697 +skip-if = android_version < '16' [test_wifi_associate_WPA_EAP_TLS.js] -disabled = Bug 1173697 +skip-if = android_version < '16' [test_wifi_enable_api.js] From 9fb47fefbfae56e066db99d14adaf9c3d8aa3696 Mon Sep 17 00:00:00 2001 From: Henrik Skupin Date: Tue, 2 Feb 2016 12:45:57 +0100 Subject: [PATCH 027/117] Bug 1244715 - Upgrade firefox-ui-tests to use marionette_client 2.2.0 and marionette-driver 1.3.0. r=maja_zf DONTBUILD --- testing/firefox-ui/harness/firefox_ui_harness/__init__.py | 2 +- testing/firefox-ui/harness/requirements.txt | 4 ++-- testing/firefox-ui/tests/setup.py | 4 ++-- testing/puppeteer/firefox/firefox_puppeteer/__init__.py | 2 +- testing/puppeteer/firefox/requirements.txt | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/testing/firefox-ui/harness/firefox_ui_harness/__init__.py b/testing/firefox-ui/harness/firefox_ui_harness/__init__.py index f0dba0a832a..e2dcf05ec16 100644 --- a/testing/firefox-ui/harness/firefox_ui_harness/__init__.py +++ b/testing/firefox-ui/harness/firefox_ui_harness/__init__.py @@ -2,4 +2,4 @@ # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. -__version__ = '1.1.2' +__version__ = '1.2.0' diff --git a/testing/firefox-ui/harness/requirements.txt b/testing/firefox-ui/harness/requirements.txt index 33a3f15da34..967dc8110d5 100644 --- a/testing/firefox-ui/harness/requirements.txt +++ b/testing/firefox-ui/harness/requirements.txt @@ -1,4 +1,4 @@ -marionette-client >= 2.1.0 +marionette-client >= 2.2.0 mozfile >= 1.2 mozinfo >= 0.8 mozinstall >= 1.12 @@ -8,7 +8,7 @@ mozinstall >= 1.12 # to avoid installations of those packages from pypi. # Necessary because of the testcase classes -# firefox-puppeteer == 3.1.0 +# firefox-puppeteer == 3.2.0 # Necessary because of server-root, and manifest files # firefox-ui-tests diff --git a/testing/firefox-ui/tests/setup.py b/testing/firefox-ui/tests/setup.py index a3dc073cdd2..250e96cc947 100644 --- a/testing/firefox-ui/tests/setup.py +++ b/testing/firefox-ui/tests/setup.py @@ -7,8 +7,8 @@ from setuptools import setup, find_packages PACKAGE_VERSION = '0.3.1' deps = [ - 'firefox-puppeteer >= 3.1.0, <4.0.0', - 'firefox-ui-harness == 1.1.2', + 'firefox-puppeteer >= 3.2.0, <4.0.0', + 'firefox-ui-harness == 1.2.0', ] setup(name='firefox-ui-tests', diff --git a/testing/puppeteer/firefox/firefox_puppeteer/__init__.py b/testing/puppeteer/firefox/firefox_puppeteer/__init__.py index c2b267f110b..e4ee4b93ccf 100644 --- a/testing/puppeteer/firefox/firefox_puppeteer/__init__.py +++ b/testing/puppeteer/firefox/firefox_puppeteer/__init__.py @@ -9,7 +9,7 @@ from marionette_driver.marionette import HTMLElement from decorators import use_class_as_property -__version__ = '3.1.0' +__version__ = '3.2.0' root = os.path.abspath(os.path.dirname(__file__)) manifest = os.path.join(root, 'tests', 'manifest.ini') diff --git a/testing/puppeteer/firefox/requirements.txt b/testing/puppeteer/firefox/requirements.txt index 88f7e4242f5..8c858021d6b 100644 --- a/testing/puppeteer/firefox/requirements.txt +++ b/testing/puppeteer/firefox/requirements.txt @@ -1,5 +1,5 @@ # The following line can be removed once testcases are no longer part of the puppeteer module. -marionette-client >= 2.1.0 +marionette-client >= 2.2.0 -marionette-driver >= 1.2.0 +marionette-driver >= 1.3.0 mozinfo >= 0.8 From 909bbe8c1e6c234287052af16760c4591c948c9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabrice=20Desr=C3=A9?= Date: Tue, 2 Feb 2016 05:12:55 -0800 Subject: [PATCH 028/117] Bug 1245052 - various media b2g build errors r=jya --- dom/media/omx/AudioOffloadPlayer.cpp | 2 +- dom/media/omx/MediaOmxCommonDecoder.cpp | 2 +- dom/media/omx/MediaOmxCommonDecoder.h | 2 +- dom/media/omx/MediaOmxReader.cpp | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dom/media/omx/AudioOffloadPlayer.cpp b/dom/media/omx/AudioOffloadPlayer.cpp index 670c6a965d7..05e5a45e67a 100644 --- a/dom/media/omx/AudioOffloadPlayer.cpp +++ b/dom/media/omx/AudioOffloadPlayer.cpp @@ -346,7 +346,7 @@ status_t AudioOffloadPlayer::DoSeek() CHECK(mAudioSink.get()); AUDIO_OFFLOAD_LOG(LogLevel::Debug, - "DoSeek ( %lld )", mSeekTarget.GetTime().ToMicroseconds()); + ("DoSeek ( %lld )", mSeekTarget.GetTime().ToMicroseconds())); mReachedEOS = false; mPositionTimeMediaUs = -1; diff --git a/dom/media/omx/MediaOmxCommonDecoder.cpp b/dom/media/omx/MediaOmxCommonDecoder.cpp index 21bd4479739..90f760bed1c 100644 --- a/dom/media/omx/MediaOmxCommonDecoder.cpp +++ b/dom/media/omx/MediaOmxCommonDecoder.cpp @@ -231,7 +231,7 @@ MediaOmxCommonDecoder::ChangeState(PlayState aState) } void -MediaOmxCommonDecoder::CallSeek(SeekTarget aTarget) +MediaOmxCommonDecoder::CallSeek(const SeekTarget& aTarget) { if (!mAudioOffloadPlayer) { MediaDecoder::CallSeek(aTarget); diff --git a/dom/media/omx/MediaOmxCommonDecoder.h b/dom/media/omx/MediaOmxCommonDecoder.h index f784a5a82c6..318480f6397 100644 --- a/dom/media/omx/MediaOmxCommonDecoder.h +++ b/dom/media/omx/MediaOmxCommonDecoder.h @@ -26,7 +26,7 @@ public: void FirstFrameLoaded(nsAutoPtr aInfo, MediaDecoderEventVisibility aEventVisibility) override; void ChangeState(PlayState aState) override; - void CallSeek(SeekTarget aTarget) override; + void CallSeek(const SeekTarget& aTarget) override; void SetVolume(double aVolume) override; int64_t CurrentPosition() override; MediaDecoderOwner::NextFrameStatus NextFrameStatus() override; diff --git a/dom/media/omx/MediaOmxReader.cpp b/dom/media/omx/MediaOmxReader.cpp index 41acefc7ee9..d237bef0ae5 100644 --- a/dom/media/omx/MediaOmxReader.cpp +++ b/dom/media/omx/MediaOmxReader.cpp @@ -538,7 +538,7 @@ MediaOmxReader::Seek(SeekTarget aTarget, int64_t aEndTime) // stream to the preceeding keyframe first, get the stream time, and then // seek the audio stream to match the video stream's time. Otherwise, the // audio and video streams won't be in sync after the seek. - mVideoSeekTimeUs = aTarget.mTime; + mVideoSeekTimeUs = aTarget.GetTime().ToMicroseconds(); RefPtr self = this; mSeekRequest.Begin(DecodeToFirstVideoData()->Then(OwnerThread(), __func__, [self] (MediaData* v) { @@ -551,7 +551,7 @@ MediaOmxReader::Seek(SeekTarget aTarget, int64_t aEndTime) self->mSeekPromise.Resolve(aTarget.GetTime(), __func__); })); } else { - mAudioSeekTimeUs = mVideoSeekTimeUs = GetTime().ToMicroseconds(); + mAudioSeekTimeUs = mVideoSeekTimeUs = aTarget.GetTime().ToMicroseconds(); mSeekPromise.Resolve(aTarget.GetTime(), __func__); } From f88a51be06dd8084d6f144accdc5cbec5c7ee38f Mon Sep 17 00:00:00 2001 From: Andreas Tolfsen Date: Sat, 30 Jan 2016 08:53:51 +0000 Subject: [PATCH 029/117] Bug 1239987 - Merge marionette-transport into marionette-driver; r=automatedtester --- .../driver/marionette_driver/marionette.py | 2 +- .../marionette_driver}/transport.py | 0 testing/marionette/driver/requirements.txt | 1 - .../marionette_transport/__init__.py | 7 --- testing/marionette/transport/setup.py | 53 ------------------- 5 files changed, 1 insertion(+), 62 deletions(-) rename testing/marionette/{transport/marionette_transport => driver/marionette_driver}/transport.py (100%) delete mode 100644 testing/marionette/transport/marionette_transport/__init__.py delete mode 100644 testing/marionette/transport/setup.py diff --git a/testing/marionette/driver/marionette_driver/marionette.py b/testing/marionette/driver/marionette_driver/marionette.py index 6ad1a707c57..3b60feb380f 100644 --- a/testing/marionette/driver/marionette_driver/marionette.py +++ b/testing/marionette/driver/marionette_driver/marionette.py @@ -15,12 +15,12 @@ from contextlib import contextmanager from decorators import do_crash_check from keys import Keys -import marionette_transport as transport from mozrunner import B2GEmulatorRunner import geckoinstance import errors +import transport WEBELEMENT_KEY = "ELEMENT" W3C_WEBELEMENT_KEY = "element-6066-11e4-a52e-4f735466cecf" diff --git a/testing/marionette/transport/marionette_transport/transport.py b/testing/marionette/driver/marionette_driver/transport.py similarity index 100% rename from testing/marionette/transport/marionette_transport/transport.py rename to testing/marionette/driver/marionette_driver/transport.py diff --git a/testing/marionette/driver/requirements.txt b/testing/marionette/driver/requirements.txt index 9ad9d393945..a77e91f0e89 100644 --- a/testing/marionette/driver/requirements.txt +++ b/testing/marionette/driver/requirements.txt @@ -1,2 +1 @@ -marionette-transport == 1.2.0 mozrunner >= 6.9 diff --git a/testing/marionette/transport/marionette_transport/__init__.py b/testing/marionette/transport/marionette_transport/__init__.py deleted file mode 100644 index 50bd7dee9a1..00000000000 --- a/testing/marionette/transport/marionette_transport/__init__.py +++ /dev/null @@ -1,7 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/ - -__version__ = '1.2.0' - -from transport import * diff --git a/testing/marionette/transport/setup.py b/testing/marionette/transport/setup.py deleted file mode 100644 index 1be3ff9d1e9..00000000000 --- a/testing/marionette/transport/setup.py +++ /dev/null @@ -1,53 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -import os -import re -from setuptools import setup, find_packages - - -THIS_DIR = os.path.dirname(os.path.realpath(__name__)) - - -def read(*parts): - with open(os.path.join(THIS_DIR, *parts)) as f: - return f.read() - - -def get_version(): - return re.findall("__version__ = '([\d\.]+)'", - read('marionette_transport', '__init__.py'), re.M)[0] - - -long_description = \ -"""Marionette_ is a Mozilla project to enable remote automation in Gecko-based -projects, including desktop Firefox, mobile Firefox, and Firefox OS. It is -inspired by `Selenium Webdriver`_. - -This package defines the transport layer used by a Marionette client to -communicate with the Marionette server embedded in Gecko. It has no entry -points; rather it's designed to be used by a Marionette client implementation. - -.. _Marionette: https://developer.mozilla.org/en/Marionette -.. _`Selenium Webdriver`: http://www.seleniumhq.org/projects/webdriver/""" - - -setup(name='marionette-transport', - version=get_version(), - description="Transport layer for Marionette client", - long_description=long_description, - classifiers=[], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers - keywords='mozilla', - author='Mozilla Automation and Tools Team', - author_email='tools@lists.mozilla.org', - url='https://developer.mozilla.org/en-US/docs/Marionette', - license='MPL', - packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), - package_data={}, - include_package_data=False, - zip_safe=False, - entry_points=""" - """, - install_requires=[], - ) From 4343a66c6e4a3a983861c7945290e07f3258c3c7 Mon Sep 17 00:00:00 2001 From: Andreas Tolfsen Date: Sat, 30 Jan 2016 08:54:45 +0000 Subject: [PATCH 030/117] Bug 1239987 - Change testing/marionette/client to use marionette.transport; r=automatedtester --- testing/marionette/client/marionette/b2g_update_test.py | 9 ++++++--- testing/marionette/client/marionette/runtests.py | 7 ++----- .../client/marionette/tests/unit/test_transport.py | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/testing/marionette/client/marionette/b2g_update_test.py b/testing/marionette/client/marionette/b2g_update_test.py index edb350feb88..742ee03232d 100644 --- a/testing/marionette/client/marionette/b2g_update_test.py +++ b/testing/marionette/client/marionette/b2g_update_test.py @@ -12,13 +12,15 @@ import types import weakref from marionette_driver.marionette import Marionette +from marionette_driver import transport + from .marionette_test import MarionetteTestCase -from marionette_transport import MarionetteTransport from b2ginstance import B2GInstance from .runtests import MarionetteTestRunner, cli -class B2GUpdateMarionetteClient(MarionetteTransport): + +class B2GUpdateMarionetteClient(transport.TcpTransport): RETRY_TIMEOUT = 5 CONNECT_TIMEOUT = 30 SEND_TIMEOUT = 60 * 5 @@ -36,7 +38,7 @@ class B2GUpdateMarionetteClient(MarionetteTransport): """ for i in range(self.MAX_RETRIES): try: - MarionetteTransport.connect(self) + transport.TcpTransport.connect(self) break except: if i == self.MAX_RETRIES - 1: @@ -48,6 +50,7 @@ class B2GUpdateMarionetteClient(MarionetteTransport): # Upon success, reset the socket timeout to something more reasonable self.sock.settimeout(self.SEND_TIMEOUT) + class B2GUpdateTestRunner(MarionetteTestRunner): match_re = re.compile(r'update_(smoke)?test_(.*)\.py$') diff --git a/testing/marionette/client/marionette/runtests.py b/testing/marionette/client/marionette/runtests.py index a498c3ec75d..0b83918ab86 100644 --- a/testing/marionette/client/marionette/runtests.py +++ b/testing/marionette/client/marionette/runtests.py @@ -6,7 +6,6 @@ import sys from marionette import __version__ from marionette_driver import __version__ as driver_version -from marionette_transport import __version__ as transport_version from marionette.marionette_test import MarionetteTestCase, MarionetteJSTestCase from marionette.runner import ( BaseMarionetteTestRunner, @@ -42,11 +41,9 @@ class MarionetteHarness(object): parser.add_argument('--version', action='version', help="Show version information.", version="%(prog)s {version}" - " (using marionette-driver: {driver_version}, " - "marionette-transport: {transport_version})".format( + " (using marionette-driver: {driver_version}, ".format( version=__version__, - driver_version=driver_version, - transport_version=transport_version + driver_version=driver_version )) mozlog.commandline.add_logging_group(parser) args = parser.parse_args() diff --git a/testing/marionette/client/marionette/tests/unit/test_transport.py b/testing/marionette/client/marionette/tests/unit/test_transport.py index acb056df460..e1a0bdb116a 100644 --- a/testing/marionette/client/marionette/tests/unit/test_transport.py +++ b/testing/marionette/client/marionette/tests/unit/test_transport.py @@ -4,11 +4,11 @@ import json from marionette import MarionetteTestCase, skip_unless_protocol -from marionette_transport import ( +from marionette_driver.transport import ( Command, Proto2Command, Proto2Response, - Response + Response, ) get_current_url = ("getCurrentUrl", None) From f46993af84861e7380465385b4b9b4923ae7e0ce Mon Sep 17 00:00:00 2001 From: Andreas Tolfsen Date: Sat, 30 Jan 2016 08:55:24 +0000 Subject: [PATCH 031/117] Bug 1239987 - Remove marionette-transport dependency from build environment; r=gps --- build/mach_bootstrap.py | 1 - build/virtualenv_packages.txt | 1 - testing/config/marionette_requirements.txt | 1 - testing/testsuite-targets.mk | 1 - 4 files changed, 4 deletions(-) diff --git a/build/mach_bootstrap.py b/build/mach_bootstrap.py index 4f7365ba2ea..e91038031cc 100644 --- a/build/mach_bootstrap.py +++ b/build/mach_bootstrap.py @@ -72,7 +72,6 @@ SEARCH_PATHS = [ 'testing/luciddream', 'testing/marionette/client', 'testing/marionette/client/marionette/runner/mixins/browsermob-proxy-py', - 'testing/marionette/transport', 'testing/marionette/driver', 'testing/mozbase/mozcrash', 'testing/mozbase/mozdebug', diff --git a/build/virtualenv_packages.txt b/build/virtualenv_packages.txt index 96ad3303f71..f7b61873c25 100644 --- a/build/virtualenv_packages.txt +++ b/build/virtualenv_packages.txt @@ -1,4 +1,3 @@ -marionette_transport.pth:testing/marionette/transport marionette_driver.pth:testing/marionette/driver browsermobproxy.pth:testing/marionette/client/marionette/runner/mixins/browsermob-proxy-py wptserve.pth:testing/web-platform/tests/tools/wptserve diff --git a/testing/config/marionette_requirements.txt b/testing/config/marionette_requirements.txt index 296c5d61b88..e596b596ef8 100644 --- a/testing/config/marionette_requirements.txt +++ b/testing/config/marionette_requirements.txt @@ -1,6 +1,5 @@ -r mozbase_requirements.txt ../tools/wptserve -../marionette/transport ../marionette/driver ../marionette/marionette/runner/mixins/browsermob-proxy-py ../marionette diff --git a/testing/testsuite-targets.mk b/testing/testsuite-targets.mk index 25cb2c3e702..c037da11650 100644 --- a/testing/testsuite-targets.mk +++ b/testing/testsuite-targets.mk @@ -564,7 +564,6 @@ stage-marionette: make-stage-dir $(NSINSTALL) -D $(MARIONETTE_DIR)/transport $(NSINSTALL) -D $(MARIONETTE_DIR)/driver @(cd $(topsrcdir)/testing/marionette/client && tar --exclude marionette/tests $(TAR_CREATE_FLAGS) - *) | (cd $(MARIONETTE_DIR)/ && tar -xf -) - @(cd $(topsrcdir)/testing/marionette/transport && tar $(TAR_CREATE_FLAGS) - *) | (cd $(MARIONETTE_DIR)/transport && tar -xf -) @(cd $(topsrcdir)/testing/marionette/driver && tar $(TAR_CREATE_FLAGS) - *) | (cd $(MARIONETTE_DIR)/driver && tar -xf -) $(PYTHON) $(topsrcdir)/testing/marionette/client/marionette/tests/print-manifest-dirs.py \ $(topsrcdir) \ From 3faf41bf6547677f59f5050a074d9d60d71b6442 Mon Sep 17 00:00:00 2001 From: Andreas Tolfsen Date: Sat, 30 Jan 2016 08:55:54 +0000 Subject: [PATCH 032/117] Bug 1239987 - Remove marionette-transport dependency from DOM media tests; r=sydpolk --- dom/media/test/external/requirements.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dom/media/test/external/requirements.txt b/dom/media/test/external/requirements.txt index 3934f929ffd..85dd07f338a 100644 --- a/dom/media/test/external/requirements.txt +++ b/dom/media/test/external/requirements.txt @@ -15,9 +15,8 @@ mozrunner==6.11 moztest==0.7 mozversion==1.4 wptserve==1.3.0 -marionette-client == 2.1.0 -marionette-driver == 1.2.0 -marionette-transport == 1.1.0 +marionette-client==2.1.0 +marionette-driver==1.2.0 firefox-puppeteer==3.1.0 # Install the firefox media tests package From 42fbe88f47cda4a4588787a0cdf31e8838eb2253 Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Tue, 2 Feb 2016 14:23:21 +0100 Subject: [PATCH 033/117] Bug 1245057: Refer to |gfx::IntPoint| in |GrallocTextureHostOGL::SetCropRect|, r=sotaro This change is required to build for B2G. --- gfx/layers/opengl/GrallocTextureHost.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gfx/layers/opengl/GrallocTextureHost.cpp b/gfx/layers/opengl/GrallocTextureHost.cpp index 17ea0e71778..62efd68365e 100644 --- a/gfx/layers/opengl/GrallocTextureHost.cpp +++ b/gfx/layers/opengl/GrallocTextureHost.cpp @@ -429,7 +429,7 @@ GrallocTextureHostOGL::WaitAcquireFenceHandleSyncComplete() void GrallocTextureHostOGL::SetCropRect(nsIntRect aCropRect) { - MOZ_ASSERT(aCropRect.TopLeft() == IntPoint(0, 0)); + MOZ_ASSERT(aCropRect.TopLeft() == gfx::IntPoint(0, 0)); MOZ_ASSERT(!aCropRect.IsEmpty()); MOZ_ASSERT(aCropRect.width <= mSize.width); MOZ_ASSERT(aCropRect.height <= mSize.height); From 8e0af4dfc3005cb41a455d9a2689f5e61c76e84c Mon Sep 17 00:00:00 2001 From: Thomas Zimmermann Date: Tue, 2 Feb 2016 15:19:58 +0100 Subject: [PATCH 034/117] Bug 1196221: Add libfdio to sources.xml for ICS emulators, r=gsvelto Until bug 1243436 has been resolved, updates to B2G manifests are not reliably mirrored in the sources.xml files. This patch adds an entry for libfdio on ICS emulators. --- b2g/config/emulator-ics/sources.xml | 1 + b2g/config/emulator/sources.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/b2g/config/emulator-ics/sources.xml b/b2g/config/emulator-ics/sources.xml index 5d75798b057..c47d3cb7826 100644 --- a/b2g/config/emulator-ics/sources.xml +++ b/b2g/config/emulator-ics/sources.xml @@ -25,6 +25,7 @@ + diff --git a/b2g/config/emulator/sources.xml b/b2g/config/emulator/sources.xml index 5d75798b057..c47d3cb7826 100644 --- a/b2g/config/emulator/sources.xml +++ b/b2g/config/emulator/sources.xml @@ -25,6 +25,7 @@ + From 3d2fb58192e82de5e0a0180864ec1d138f897ea1 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Tue, 2 Feb 2016 15:28:59 +0100 Subject: [PATCH 035/117] Bug 1244770 - Fixed minidumpwriter compilation on mingw. r=ted --- testing/tools/minidumpwriter/moz.build | 2 ++ 1 file changed, 2 insertions(+) diff --git a/testing/tools/minidumpwriter/moz.build b/testing/tools/minidumpwriter/moz.build index d97c12534b1..93d589e7c4b 100644 --- a/testing/tools/minidumpwriter/moz.build +++ b/testing/tools/minidumpwriter/moz.build @@ -13,5 +13,7 @@ if CONFIG['ENABLE_TESTS'] and CONFIG['CPU_ARCH'] == 'x86_64' and CONFIG['OS_ARCH 'minidumpwriter.cpp', ] USE_STATIC_LIBS = True + if CONFIG['GNU_CC']: + WIN32_EXE_LDFLAGS += ['-municode'] NO_PGO = True From e0803855dcee8f3f2082c58e21a14fb0b5922418 Mon Sep 17 00:00:00 2001 From: Jeff Muizelaar Date: Tue, 2 Feb 2016 10:23:06 -0500 Subject: [PATCH 036/117] Bug 1243861 - Specify SSE_FLAGS and SSE2_FLAGS when compiling with MSVC; r=glandium --- configure.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure.in b/configure.in index 712504b9233..56d61ffc560 100644 --- a/configure.in +++ b/configure.in @@ -2216,6 +2216,8 @@ ia64*-hpux*) _USE_CPP_INCLUDE_FLAG=1 _DEFINES_CFLAGS='-FI $(topobjdir)/mozilla-config.h -DMOZILLA_CLIENT' _DEFINES_CXXFLAGS='-FI $(topobjdir)/mozilla-config.h -DMOZILLA_CLIENT' + SSE_FLAGS="-arch:SSE" + SSE2_FLAGS="-arch:SSE2" CFLAGS="$CFLAGS -W3 -Gy" CXXFLAGS="$CXXFLAGS -W3 -Gy" if test "$CPU_ARCH" = "x86"; then From 9036f3f77980558f7bc8ce7975cca69b9cf205ea Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Thu, 28 Jan 2016 18:02:12 -0500 Subject: [PATCH 037/117] Bug 1243918 - Don't clobber safeseh in msvcc.sh -clang-cl; r=glandium Currently we remove the -SAFESEH that we added in bug 1242722 by mistake which breaks x86 builds. Upstream patch: https://github.com/atgreen/libffi/pull/225 --- js/src/ctypes/libffi/msvcc.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/js/src/ctypes/libffi/msvcc.sh b/js/src/ctypes/libffi/msvcc.sh index 65fbfef7e35..1621e5f0e8b 100755 --- a/js/src/ctypes/libffi/msvcc.sh +++ b/js/src/ctypes/libffi/msvcc.sh @@ -70,7 +70,6 @@ do ;; -clang-cl) cl="clang-cl" - safeseh= shift 1 ;; -O0) From daf45d50c36ec5d8661574b58ec31ed4d5038c87 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Tue, 2 Feb 2016 10:24:32 -0500 Subject: [PATCH 038/117] Bug 1244076 - Fix a crash in nsDocShell::IssueWarning by null-checking mContentViewer; r=bzbarsky --- docshell/base/nsDocShell.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index bce09ed5227..1112d96383f 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -14313,9 +14313,11 @@ nsDocShell::InFrameSwap() NS_IMETHODIMP nsDocShell::IssueWarning(uint32_t aWarning, bool aAsError) { - nsCOMPtr doc = mContentViewer->GetDocument(); - if (doc) { - doc->WarnOnceAbout(nsIDocument::DeprecatedOperations(aWarning), aAsError); + if (mContentViewer) { + nsCOMPtr doc = mContentViewer->GetDocument(); + if (doc) { + doc->WarnOnceAbout(nsIDocument::DeprecatedOperations(aWarning), aAsError); + } } return NS_OK; } From 9bed3781f9c6b098c3898d985197b8184bd88a82 Mon Sep 17 00:00:00 2001 From: Birunthan Mohanathas Date: Tue, 2 Feb 2016 17:36:30 +0200 Subject: [PATCH 039/117] Bug 1235261 - Part 1: Rename nsAutoTArray to AutoTArray. r=froydnj --- accessible/atk/AccessibleWrap.cpp | 8 +-- accessible/atk/nsMaiInterfaceTable.cpp | 4 +- accessible/atk/nsMaiInterfaceText.cpp | 4 +- accessible/base/EventQueue.h | 2 +- accessible/base/NotificationController.h | 4 +- accessible/base/TextRange-inl.h | 2 +- accessible/base/TextRange.cpp | 6 +- accessible/base/TreeWalker.h | 2 +- accessible/ipc/DocAccessibleChild.cpp | 8 +-- accessible/ipc/ProxyAccessible.cpp | 4 +- accessible/mac/mozAccessible.mm | 6 +- accessible/mac/mozTableAccessible.mm | 4 +- accessible/windows/ia2/ia2Accessible.cpp | 2 +- accessible/windows/ia2/ia2AccessibleTable.cpp | 8 +-- .../windows/ia2/ia2AccessibleTableCell.cpp | 4 +- accessible/windows/ia2/ia2AccessibleText.cpp | 2 +- accessible/windows/msaa/AccessibleWrap.cpp | 2 +- accessible/xpcom/xpcAccessibleHyperText.cpp | 2 +- accessible/xpcom/xpcAccessibleSelectable.cpp | 2 +- accessible/xpcom/xpcAccessibleTable.cpp | 8 +-- accessible/xpcom/xpcAccessibleTableCell.cpp | 4 +- docshell/base/nsDocShell.cpp | 6 +- docshell/shistory/nsSHistory.cpp | 2 +- dom/animation/EffectCompositor.cpp | 2 +- dom/animation/KeyframeEffect.cpp | 2 +- dom/base/DOMMatrix.cpp | 4 +- dom/base/File.cpp | 2 +- dom/base/FragmentOrElement.cpp | 18 +++--- dom/base/Navigator.cpp | 2 +- dom/base/nsContentIterator.cpp | 10 +-- dom/base/nsContentList.cpp | 2 +- dom/base/nsContentUtils.cpp | 14 ++-- dom/base/nsDOMMutationObserver.cpp | 10 +-- dom/base/nsDOMMutationObserver.h | 10 +-- dom/base/nsDOMTokenList.cpp | 8 +-- dom/base/nsDocument.cpp | 8 +-- dom/base/nsDocumentEncoder.cpp | 10 +-- dom/base/nsFocusManager.cpp | 2 +- dom/base/nsFrameMessageManager.h | 2 +- dom/base/nsIDocument.h | 2 +- dom/base/nsINode.cpp | 8 +-- dom/base/nsLineBreaker.cpp | 6 +- dom/base/nsLineBreaker.h | 4 +- dom/base/nsPerformance.cpp | 2 +- dom/base/nsPlainTextSerializer.h | 4 +- dom/base/nsXHTMLContentSerializer.h | 2 +- dom/bindings/Codegen.py | 8 +-- dom/bluetooth/common/BluetoothService.cpp | 2 +- dom/cache/AutoUtils.cpp | 6 +- dom/cache/Cache.cpp | 4 +- dom/cache/CacheOpChild.cpp | 4 +- dom/cache/CacheOpParent.cpp | 6 +- dom/cache/DBSchema.cpp | 22 +++---- dom/cache/Manager.cpp | 10 +-- dom/cache/ReadStream.cpp | 4 +- dom/cache/TypeUtils.cpp | 6 +- dom/camera/GonkCameraControl.cpp | 12 ++-- dom/canvas/CanvasRenderingContext2D.h | 2 +- dom/canvas/ImageBitmapRenderingContext.cpp | 2 +- dom/events/EventStateManager.cpp | 4 +- dom/events/TextComposition.h | 2 +- dom/fetch/FetchDriver.cpp | 4 +- dom/fetch/InternalHeaders.cpp | 2 +- dom/gamepad/linux/LinuxGamepad.cpp | 2 +- dom/html/HTMLAllCollection.cpp | 2 +- dom/html/HTMLOptionsCollection.cpp | 2 +- dom/html/TimeRanges.cpp | 4 +- dom/html/TimeRanges.h | 2 +- dom/html/nsHTMLContentSink.cpp | 2 +- dom/indexedDB/ActorsParent.cpp | 8 +-- dom/indexedDB/IDBDatabase.cpp | 6 +- dom/indexedDB/Key.cpp | 2 +- dom/ipc/ContentParent.cpp | 6 +- dom/ipc/PreallocatedProcessManager.cpp | 4 +- dom/ipc/TabChild.h | 4 +- dom/media/AudioCaptureStream.cpp | 4 +- dom/media/AudioSegment.cpp | 8 +-- dom/media/AudioSegment.h | 10 +-- dom/media/AudioStream.cpp | 6 +- dom/media/DOMMediaStream.h | 4 +- dom/media/FileBlockCache.h | 2 +- dom/media/GraphDriver.cpp | 2 +- dom/media/GraphDriver.h | 2 +- dom/media/Intervals.h | 2 +- dom/media/MediaCache.cpp | 4 +- dom/media/MediaStreamGraph.cpp | 8 +-- dom/media/TrackUnionStream.cpp | 4 +- dom/media/VideoFrameContainer.cpp | 2 +- dom/media/encoder/OpusTrackEncoder.cpp | 4 +- dom/media/encoder/TrackEncoder.cpp | 4 +- dom/media/encoder/VorbisTrackEncoder.cpp | 4 +- dom/media/gmp/GMPDecryptorChild.cpp | 2 +- dom/media/gtest/TestVorbisTrackEncoder.cpp | 2 +- dom/media/mediasink/DecodedStream.cpp | 6 +- dom/media/mediasink/VideoSink.cpp | 4 +- dom/media/ogg/OggReader.cpp | 8 +-- dom/media/omx/OMXCodecWrapper.cpp | 4 +- .../platforms/agnostic/VorbisDecoder.cpp | 4 +- .../platforms/ffmpeg/FFmpegVideoDecoder.h | 2 +- dom/media/systemservices/MediaUtils.h | 2 +- dom/media/webaudio/AudioBuffer.h | 2 +- dom/media/webaudio/AudioNodeEngine.h | 4 +- .../webaudio/AudioNodeExternalInputStream.cpp | 6 +- dom/media/webaudio/AudioNodeStream.cpp | 8 +-- dom/media/webaudio/AudioNodeStream.h | 2 +- dom/media/webaudio/DelayBuffer.h | 2 +- dom/media/webaudio/WebAudioUtils.cpp | 10 +-- dom/media/webaudio/blink/HRTFElevation.cpp | 4 +- dom/media/webaudio/blink/Reverb.cpp | 4 +- dom/media/webm/WebMDemuxer.cpp | 4 +- dom/media/webrtc/MediaEngineDefault.cpp | 2 +- dom/media/webrtc/MediaEngineWebRTCAudio.cpp | 2 +- .../recognition/SpeechRecognition.cpp | 4 +- .../cocoa/OSXSpeechSynthesizerService.mm | 2 +- dom/media/webspeech/synth/nsSpeechTask.cpp | 2 +- .../webspeech/synth/nsSynthVoiceRegistry.cpp | 2 +- dom/messagechannel/MessagePort.cpp | 4 +- dom/notification/Notification.cpp | 4 +- dom/plugins/base/nsNPAPIPlugin.cpp | 2 +- dom/plugins/base/nsPluginHost.cpp | 4 +- dom/plugins/base/nsPluginInstanceOwner.cpp | 2 +- dom/plugins/base/nsPluginsDirUtils.h | 2 +- dom/plugins/ipc/PluginInstanceChild.cpp | 2 +- dom/plugins/ipc/PluginInstanceParent.cpp | 4 +- dom/plugins/ipc/PluginModuleChild.h | 2 +- dom/power/PowerManager.cpp | 2 +- dom/power/PowerManagerService.cpp | 2 +- dom/quota/ActorsParent.cpp | 4 +- dom/quota/QuotaManager.h | 2 +- dom/svg/SVGLengthList.h | 6 +- dom/voicemail/Voicemail.h | 2 +- dom/workers/Queue.h | 2 +- dom/workers/RuntimeService.cpp | 20 +++--- dom/workers/ServiceWorkerEvents.cpp | 2 +- dom/workers/ServiceWorkerManager.cpp | 4 +- dom/workers/ServiceWorkerManager.h | 2 +- dom/workers/WorkerPrivate.cpp | 8 +-- dom/xbl/nsXBLEventHandler.cpp | 2 +- dom/xbl/nsXBLService.cpp | 4 +- dom/xbl/nsXBLWindowKeyHandler.cpp | 2 +- dom/xslt/xpath/txMozillaXPathTreeWalker.cpp | 2 +- dom/xul/templates/nsTreeRows.h | 2 +- dom/xul/templates/nsXULContentBuilder.cpp | 2 +- dom/xul/templates/nsXULTemplateBuilder.cpp | 2 +- dom/xul/templates/nsXULTreeBuilder.cpp | 2 +- editor/libeditor/nsEditor.cpp | 4 +- .../commandhandler/nsCommandGroup.cpp | 2 +- extensions/cookie/nsPermissionManager.h | 4 +- gfx/2d/StackArray.h | 2 +- gfx/gl/DecomposeIntoNoRepeatTriangles.h | 4 +- gfx/gl/GLContextProviderGLX.cpp | 2 +- gfx/layers/ImageContainer.cpp | 2 +- gfx/layers/ImageContainer.h | 2 +- gfx/layers/LayerTreeInvalidation.cpp | 4 +- gfx/layers/Layers.cpp | 2 +- gfx/layers/basic/BasicLayerManager.cpp | 4 +- gfx/layers/client/CanvasClient.cpp | 4 +- gfx/layers/client/ClientContainerLayer.h | 4 +- gfx/layers/client/ClientLayerManager.h | 4 +- gfx/layers/client/ContentClient.cpp | 2 +- gfx/layers/client/ImageClient.cpp | 4 +- .../composite/AsyncCompositionManager.cpp | 2 +- .../composite/ContainerLayerComposite.cpp | 8 +-- gfx/layers/composite/FPSCounter.h | 4 +- gfx/layers/composite/FrameUniformityData.h | 2 +- .../ipc/CompositableTransactionParent.cpp | 2 +- gfx/layers/ipc/CompositorChild.cpp | 2 +- gfx/layers/ipc/CompositorChild.h | 2 +- gfx/layers/ipc/ImageBridgeChild.cpp | 4 +- gfx/layers/ipc/ImageBridgeParent.cpp | 2 +- gfx/layers/ipc/ImageContainerParent.h | 2 +- gfx/layers/ipc/ShadowLayers.cpp | 4 +- gfx/layers/opengl/CompositorOGL.h | 2 +- gfx/src/nsRegion.cpp | 2 +- gfx/thebes/gfxCoreTextShaper.cpp | 6 +- gfx/thebes/gfxDWriteFontList.cpp | 8 +-- gfx/thebes/gfxFT2FontList.cpp | 2 +- gfx/thebes/gfxFont.cpp | 12 ++-- gfx/thebes/gfxFont.h | 2 +- gfx/thebes/gfxFontEntry.cpp | 6 +- gfx/thebes/gfxFontconfigFonts.cpp | 8 +-- gfx/thebes/gfxFontconfigFonts.h | 2 +- gfx/thebes/gfxFontconfigUtils.cpp | 2 +- gfx/thebes/gfxFontconfigUtils.h | 4 +- gfx/thebes/gfxGraphiteShaper.cpp | 2 +- gfx/thebes/gfxHarfBuzzShaper.cpp | 4 +- gfx/thebes/gfxMacPlatformFontList.mm | 10 +-- gfx/thebes/gfxPlatformFontList.cpp | 8 +-- gfx/thebes/gfxTextRun.cpp | 16 ++--- gfx/thebes/gfxTextRun.h | 2 +- gfx/thebes/gfxWindowsPlatform.cpp | 2 +- hal/gonk/GonkSensor.cpp | 2 +- image/RasterImage.cpp | 2 +- image/decoders/icon/mac/nsIconChannelCocoa.mm | 2 +- image/imgLoader.cpp | 2 +- intl/hyphenation/glue/nsHyphenator.cpp | 2 +- intl/locale/mac/nsDateTimeFormatMac.cpp | 2 +- intl/locale/nsLocaleService.cpp | 2 +- intl/lwbrk/nsJISx4051LineBreaker.cpp | 2 +- intl/lwbrk/nsPangoBreaker.cpp | 2 +- intl/lwbrk/nsUniscribeBreaker.cpp | 4 +- ipc/glue/IPCMessageUtils.h | 4 +- ipc/glue/WindowsMessageLoop.cpp | 2 +- js/xpconnect/src/XPCWrappedNative.cpp | 2 +- layout/base/FrameLayerBuilder.cpp | 10 +-- layout/base/FrameLayerBuilder.h | 4 +- layout/base/PositionedEventTargeting.cpp | 2 +- layout/base/RestyleManager.h | 2 +- layout/base/RestyleTracker.cpp | 4 +- layout/base/RestyleTracker.h | 2 +- layout/base/nsBidiPresUtils.cpp | 4 +- layout/base/nsCSSFrameConstructor.cpp | 10 +-- layout/base/nsCounterManager.cpp | 2 +- layout/base/nsDisplayList.cpp | 14 ++-- layout/base/nsDisplayList.h | 8 +-- layout/base/nsIPresShell.h | 2 +- layout/base/nsLayoutUtils.cpp | 20 +++--- layout/base/nsPresContext.cpp | 2 +- layout/base/nsPresShell.cpp | 12 ++-- layout/base/nsRefreshDriver.cpp | 4 +- layout/base/nsRefreshDriver.h | 6 +- layout/generic/FrameChildList.h | 2 +- layout/generic/MathMLTextRunFactory.cpp | 8 +-- layout/generic/RubyUtils.h | 6 +- layout/generic/nsBlockFrame.cpp | 4 +- layout/generic/nsContainerFrame.cpp | 2 +- layout/generic/nsFlexContainerFrame.cpp | 2 +- layout/generic/nsFontInflationData.cpp | 4 +- layout/generic/nsFrame.cpp | 8 +-- layout/generic/nsFrameState.cpp | 2 +- layout/generic/nsGfxScrollFrame.cpp | 2 +- layout/generic/nsGridContainerFrame.cpp | 4 +- layout/generic/nsHTMLReflowState.cpp | 2 +- layout/generic/nsIFrame.h | 2 +- layout/generic/nsImageMap.h | 2 +- layout/generic/nsPluginFrame.cpp | 2 +- layout/generic/nsRubyBaseContainerFrame.cpp | 6 +- layout/generic/nsSelection.cpp | 2 +- layout/generic/nsTextFrame.cpp | 14 ++-- layout/generic/nsTextFrame.h | 2 +- layout/generic/nsTextRunTransformations.cpp | 10 +-- layout/inspector/inDOMUtils.cpp | 2 +- layout/mathml/nsMathMLChar.cpp | 4 +- layout/mathml/nsMathMLmmultiscriptsFrame.cpp | 2 +- layout/style/CSSStyleSheet.cpp | 2 +- layout/style/CSSStyleSheet.h | 4 +- layout/style/CounterStyleManager.cpp | 4 +- layout/style/Declaration.cpp | 2 +- layout/style/Declaration.h | 2 +- layout/style/FontFace.h | 4 +- layout/style/FontFaceSet.cpp | 2 +- layout/style/Loader.cpp | 2 +- layout/style/Loader.h | 2 +- layout/style/StyleAnimationValue.cpp | 2 +- layout/style/StyleRule.cpp | 2 +- layout/style/nsCSSParser.cpp | 14 ++-- layout/style/nsCSSRuleProcessor.cpp | 8 +-- layout/style/nsCSSValue.cpp | 2 +- layout/style/nsFontFaceUtils.cpp | 4 +- layout/style/nsRuleNode.cpp | 14 ++-- layout/style/nsRuleProcessorData.h | 4 +- layout/style/nsStyleSet.cpp | 6 +- layout/style/nsStyleStruct.h | 8 +-- layout/svg/SVGTextFrame.cpp | 4 +- layout/svg/nsSVGEffects.cpp | 6 +- layout/svg/nsSVGFilterInstance.cpp | 4 +- layout/svg/nsSVGGradientFrame.cpp | 2 +- layout/tables/nsCellMap.cpp | 4 +- layout/tables/nsCellMap.h | 2 +- layout/tables/nsTableFrame.cpp | 4 +- layout/tables/nsTableFrame.h | 4 +- layout/tables/nsTableRowGroupFrame.cpp | 2 +- layout/xul/nsMenuBarFrame.cpp | 2 +- layout/xul/nsMenuBarListener.cpp | 2 +- layout/xul/tree/nsTreeContentView.cpp | 4 +- media/libstagefright/binding/Index.cpp | 2 +- .../binding/include/mp4_demuxer/ByteReader.h | 2 +- .../src/media-conduit/AudioConduit.h | 2 +- .../src/media-conduit/WebrtcGmpVideoCodec.cpp | 2 +- .../media-conduit/WebrtcOMXH264VideoCodec.cpp | 2 +- .../src/mediapipeline/MediaPipeline.cpp | 4 +- .../signaling/test/FakeMediaStreamsImpl.h | 2 +- .../components/build/nsAndroidHistory.h | 6 +- modules/libjar/nsJARProtocolHandler.h | 2 +- modules/libpref/nsPrefBranch.cpp | 2 +- netwerk/base/nsLoadGroup.cpp | 6 +- netwerk/cache/nsCacheService.cpp | 2 +- netwerk/cookie/nsCookieService.cpp | 8 +-- netwerk/sctp/datachannel/DataChannel.h | 4 +- parser/html/nsHtml5DocumentBuilder.h | 2 +- parser/html/nsParserUtils.cpp | 2 +- python/lldbutils/lldbutils/general.py | 2 +- rdf/base/nsCompositeDataSource.cpp | 2 +- rdf/base/nsInMemoryDataSource.cpp | 2 +- rdf/base/nsRDFContentSink.cpp | 4 +- rdf/base/nsRDFXMLSerializer.cpp | 2 +- storage/mozStorageSQLFunctions.cpp | 4 +- .../downloads/nsDownloadManager.cpp | 2 +- toolkit/components/places/History.h | 2 +- toolkit/profile/ProfileUnlockerWin.cpp | 4 +- uriloader/base/nsDocLoader.h | 2 +- .../exthandler/mac/nsOSHelperAppService.mm | 6 +- widget/TextEvents.h | 2 +- widget/TextRange.h | 2 +- widget/TouchEvents.h | 2 +- widget/android/nsAppShell.cpp | 2 +- widget/android/nsWindow.cpp | 6 +- widget/cocoa/NativeKeyBindings.mm | 4 +- widget/cocoa/nsChildView.mm | 2 +- widget/gonk/HwcComposer2D.cpp | 2 +- widget/gtk/nsWindow.cpp | 8 +-- widget/nsNativeTheme.h | 2 +- widget/qt/nsWindow.cpp | 2 +- widget/windows/KeyboardLayout.cpp | 6 +- widget/windows/WinMouseScrollHandler.cpp | 2 +- widget/windows/WinUtils.cpp | 2 +- widget/windows/nsFilePicker.h | 4 +- widget/windows/nsScreenManagerWin.h | 2 +- widget/windows/nsWindow.cpp | 4 +- xpcom/base/CycleCollectedJSRuntime.cpp | 2 +- xpcom/glue/BlockingResourceBase.h | 2 +- xpcom/glue/nsTArray-inl.h | 10 +-- xpcom/glue/nsTArray.h | 58 ++++++++--------- xpcom/glue/nsTArrayForwardDeclare.h | 4 +- xpcom/glue/nsTObserverArray.h | 2 +- xpcom/glue/tests/gtest/TestGCPostBarriers.cpp | 2 +- xpcom/io/nsLocalFileCommon.cpp | 4 +- xpcom/string/nsTStringObsolete.cpp | 2 +- xpcom/tests/TestTArray.cpp | 64 +++++++++---------- xpcom/threads/LazyIdleThread.cpp | 2 +- 330 files changed, 735 insertions(+), 735 deletions(-) diff --git a/accessible/atk/AccessibleWrap.cpp b/accessible/atk/AccessibleWrap.cpp index a0ef188fb2a..dd25b25d7bd 100644 --- a/accessible/atk/AccessibleWrap.cpp +++ b/accessible/atk/AccessibleWrap.cpp @@ -759,7 +759,7 @@ getAttributesCB(AtkObject *aAtkObj) if (!proxy) return nullptr; - nsAutoTArray attrs; + AutoTArray attrs; proxy->Attributes(&attrs); if (attrs.IsEmpty()) return nullptr; @@ -1019,7 +1019,7 @@ refRelationSetCB(AtkObject *aAtkObj) continue; size_t targetCount = targetSets[i].Length(); - nsAutoTArray wrappers; + AutoTArray wrappers; for (size_t j = 0; j < targetCount; j++) wrappers.AppendElement(GetWrapperFor(targetSets[i][j])); @@ -1664,7 +1664,7 @@ AccessibleWrap::GetColumnHeader(TableAccessible* aAccessible, int32_t aColIdx) return nullptr; } - nsAutoTArray headerCells; + AutoTArray headerCells; tableCell->ColHeaderCells(&headerCells); if (headerCells.IsEmpty()) { return nullptr; @@ -1698,7 +1698,7 @@ AccessibleWrap::GetRowHeader(TableAccessible* aAccessible, int32_t aRowIdx) return nullptr; } - nsAutoTArray headerCells; + AutoTArray headerCells; tableCell->RowHeaderCells(&headerCells); if (headerCells.IsEmpty()) { return nullptr; diff --git a/accessible/atk/nsMaiInterfaceTable.cpp b/accessible/atk/nsMaiInterfaceTable.cpp index 1795f8e12b0..c94815f3c82 100644 --- a/accessible/atk/nsMaiInterfaceTable.cpp +++ b/accessible/atk/nsMaiInterfaceTable.cpp @@ -273,7 +273,7 @@ getSelectedColumnsCB(AtkTable *aTable, gint** aSelected) { *aSelected = nullptr; - nsAutoTArray cols; + AutoTArray cols; AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable)); if (accWrap) { accWrap->AsTable()->SelectedColIndices(&cols); @@ -300,7 +300,7 @@ getSelectedColumnsCB(AtkTable *aTable, gint** aSelected) static gint getSelectedRowsCB(AtkTable *aTable, gint **aSelected) { - nsAutoTArray rows; + AutoTArray rows; AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable)); if (accWrap) { accWrap->AsTable()->SelectedRowIndices(&rows); diff --git a/accessible/atk/nsMaiInterfaceText.cpp b/accessible/atk/nsMaiInterfaceText.cpp index 0386ef8343f..1982f373091 100644 --- a/accessible/atk/nsMaiInterfaceText.cpp +++ b/accessible/atk/nsMaiInterfaceText.cpp @@ -311,7 +311,7 @@ getRunAttributesCB(AtkText *aText, gint aOffset, return nullptr; } - nsAutoTArray attrs; + AutoTArray attrs; proxy->TextAttributes(false, aOffset, &attrs, &startOffset, &endOffset); *aStartOffset = startOffset; *aEndOffset = endOffset; @@ -337,7 +337,7 @@ getDefaultAttributesCB(AtkText *aText) return nullptr; } - nsAutoTArray attrs; + AutoTArray attrs; proxy->DefaultTextAttributes(&attrs); return ConvertToAtkTextAttributeSet(attrs); } diff --git a/accessible/base/EventQueue.h b/accessible/base/EventQueue.h index 01384b844f7..b80cddcbeb4 100644 --- a/accessible/base/EventQueue.h +++ b/accessible/base/EventQueue.h @@ -76,7 +76,7 @@ protected: DocAccessible* mDocument; /** - * Pending events array. Don't make this an nsAutoTArray; we use + * Pending events array. Don't make this an AutoTArray; we use * SwapElements() on it. */ nsTArray > mEvents; diff --git a/accessible/base/NotificationController.h b/accessible/base/NotificationController.h index ab106fc00c1..14f7b3af527 100644 --- a/accessible/base/NotificationController.h +++ b/accessible/base/NotificationController.h @@ -282,7 +282,7 @@ private: /** * A pending accessible tree update notifications for content insertions. - * Don't make this an nsAutoTArray; we use SwapElements() on it. + * Don't make this an AutoTArray; we use SwapElements() on it. */ nsTArray > mContentInsertions; @@ -316,7 +316,7 @@ private: nsTHashtable > mTextHash; /** - * Other notifications like DOM events. Don't make this an nsAutoTArray; we + * Other notifications like DOM events. Don't make this an AutoTArray; we * use SwapElements() on it. */ nsTArray > mNotifications; diff --git a/accessible/base/TextRange-inl.h b/accessible/base/TextRange-inl.h index ab8a4969a43..15bbaa23570 100644 --- a/accessible/base/TextRange-inl.h +++ b/accessible/base/TextRange-inl.h @@ -17,7 +17,7 @@ inline Accessible* TextRange::Container() const { uint32_t pos1 = 0, pos2 = 0; - nsAutoTArray parents1, parents2; + AutoTArray parents1, parents2; return CommonParent(mStartContainer, mEndContainer, &parents1, &pos1, &parents2, &pos2); } diff --git a/accessible/base/TextRange.cpp b/accessible/base/TextRange.cpp index 5a1afe272f9..c2a69dc59ee 100644 --- a/accessible/base/TextRange.cpp +++ b/accessible/base/TextRange.cpp @@ -24,7 +24,7 @@ TextPoint::operator <(const TextPoint& aPoint) const // Build the chain of parents Accessible* p1 = mContainer; Accessible* p2 = aPoint.mContainer; - nsAutoTArray parents1, parents2; + AutoTArray parents1, parents2; do { parents1.AppendElement(p1); p1 = p1->Parent(); @@ -76,7 +76,7 @@ TextRange::EmbeddedChildren(nsTArray* aChildren) const Accessible* p2 = mEndContainer->GetChildAtOffset(mEndOffset); uint32_t pos1 = 0, pos2 = 0; - nsAutoTArray parents1, parents2; + AutoTArray parents1, parents2; Accessible* container = CommonParent(p1, p2, &parents1, &pos1, &parents2, &pos2); @@ -146,7 +146,7 @@ bool TextRange::Crop(Accessible* aContainer) { uint32_t boundaryPos = 0, containerPos = 0; - nsAutoTArray boundaryParents, containerParents; + AutoTArray boundaryParents, containerParents; // Crop the start boundary. Accessible* container = nullptr; diff --git a/accessible/base/TreeWalker.h b/accessible/base/TreeWalker.h index 356a329aef7..72d3f8dbd7c 100644 --- a/accessible/base/TreeWalker.h +++ b/accessible/base/TreeWalker.h @@ -87,7 +87,7 @@ private: DocAccessible* mDoc; Accessible* mContext; nsIContent* mAnchorNode; - nsAutoTArray mStateStack; + AutoTArray mStateStack; int32_t mChildFilter; uint32_t mFlags; }; diff --git a/accessible/ipc/DocAccessibleChild.cpp b/accessible/ipc/DocAccessibleChild.cpp index 0c47835b64b..023cdfbdddf 100644 --- a/accessible/ipc/DocAccessibleChild.cpp +++ b/accessible/ipc/DocAccessibleChild.cpp @@ -1048,7 +1048,7 @@ DocAccessibleChild::RecvColHeaderCells(const uint64_t& aID, { TableCellAccessible* acc = IdToTableCellAccessible(aID); if (acc) { - nsAutoTArray headerCells; + AutoTArray headerCells; acc->ColHeaderCells(&headerCells); aCells->SetCapacity(headerCells.Length()); for (uint32_t i = 0; i < headerCells.Length(); ++i) { @@ -1066,7 +1066,7 @@ DocAccessibleChild::RecvRowHeaderCells(const uint64_t& aID, { TableCellAccessible* acc = IdToTableCellAccessible(aID); if (acc) { - nsAutoTArray headerCells; + AutoTArray headerCells; acc->RowHeaderCells(&headerCells); aCells->SetCapacity(headerCells.Length()); for (uint32_t i = 0; i < headerCells.Length(); ++i) { @@ -1368,7 +1368,7 @@ DocAccessibleChild::RecvTableSelectedCells(const uint64_t& aID, { TableAccessible* acc = IdToTableAccessible(aID); if (acc) { - nsAutoTArray cells; + AutoTArray cells; acc->SelectedCells(&cells); aCellIDs->SetCapacity(cells.Length()); for (uint32_t i = 0; i < cells.Length(); ++i) { @@ -1529,7 +1529,7 @@ DocAccessibleChild::RecvSelectedItems(const uint64_t& aID, { Accessible* acc = IdToAccessibleSelect(aID); if (acc) { - nsAutoTArray selectedItems; + AutoTArray selectedItems; acc->SelectedItems(&selectedItems); aSelectedItemIDs->SetCapacity(selectedItems.Length()); for (size_t i = 0; i < selectedItems.Length(); ++i) { diff --git a/accessible/ipc/ProxyAccessible.cpp b/accessible/ipc/ProxyAccessible.cpp index 43665c5308d..aad2f03c061 100644 --- a/accessible/ipc/ProxyAccessible.cpp +++ b/accessible/ipc/ProxyAccessible.cpp @@ -778,7 +778,7 @@ ProxyAccessible::TableSelectedRowCount() void ProxyAccessible::TableSelectedCells(nsTArray* aCellIDs) { - nsAutoTArray cellIDs; + AutoTArray cellIDs; Unused << mDoc->SendTableSelectedCells(mID, &cellIDs); aCellIDs->SetCapacity(cellIDs.Length()); for (uint32_t i = 0; i < cellIDs.Length(); ++i) { @@ -857,7 +857,7 @@ ProxyAccessible::AtkTableRowHeader(int32_t aRow) void ProxyAccessible::SelectedItems(nsTArray* aSelectedItems) { - nsAutoTArray itemIDs; + AutoTArray itemIDs; Unused << mDoc->SendSelectedItems(mID, &itemIDs); aSelectedItems->SetCapacity(itemIDs.Length()); for (size_t i = 0; i < itemIDs.Length(); ++i) { diff --git a/accessible/mac/mozAccessible.mm b/accessible/mac/mozAccessible.mm index 770df417e0e..4426af45b7b 100644 --- a/accessible/mac/mozAccessible.mm +++ b/accessible/mac/mozAccessible.mm @@ -420,7 +420,7 @@ ConvertToNSArray(nsTArray& aArray) nsCOMPtr attributes = accWrap->Attributes(); nsAccUtils::GetAccAttr(attributes, nsGkAtoms::linethickness_, thickness); } else { - nsAutoTArray attrs; + AutoTArray attrs; proxy->Attributes(&attrs); for (size_t i = 0 ; i < attrs.Length() ; i++) { if (attrs.ElementAt(i).Name() == "thickness") { @@ -684,11 +684,11 @@ ConvertToNSArray(nsTArray& aArray) // get the array of children. if (accWrap) { - nsAutoTArray childrenArray; + AutoTArray childrenArray; accWrap->GetUnignoredChildren(&childrenArray); mChildren = ConvertToNSArray(childrenArray); } else if (ProxyAccessible* proxy = [self getProxyAccessible]) { - nsAutoTArray childrenArray; + AutoTArray childrenArray; GetProxyUnignoredChildren(proxy, &childrenArray); mChildren = ConvertToNSArray(childrenArray); } diff --git a/accessible/mac/mozTableAccessible.mm b/accessible/mac/mozTableAccessible.mm index 53381cd2cad..a3612e5bc3b 100644 --- a/accessible/mac/mozTableAccessible.mm +++ b/accessible/mac/mozTableAccessible.mm @@ -207,12 +207,12 @@ return [NSValue valueWithRange:NSMakeRange(cell->ColIdx(), cell->ColExtent())]; if ([attribute isEqualToString:NSAccessibilityRowHeaderUIElementsAttribute]) { - nsAutoTArray headerCells; + AutoTArray headerCells; cell->RowHeaderCells(&headerCells); return ConvertToNSArray(headerCells); } if ([attribute isEqualToString:NSAccessibilityColumnHeaderUIElementsAttribute]) { - nsAutoTArray headerCells; + AutoTArray headerCells; cell->ColHeaderCells(&headerCells); return ConvertToNSArray(headerCells); } diff --git a/accessible/windows/ia2/ia2Accessible.cpp b/accessible/windows/ia2/ia2Accessible.cpp index f655417800a..ec17b47e222 100644 --- a/accessible/windows/ia2/ia2Accessible.cpp +++ b/accessible/windows/ia2/ia2Accessible.cpp @@ -768,7 +768,7 @@ ia2Accessible::get_selectionRanges(IA2Range** aRanges, if (acc->IsDefunct()) return CO_E_OBJNOTCONNECTED; - nsAutoTArray ranges; + AutoTArray ranges; acc->Document()->SelectionRanges(&ranges); uint32_t len = ranges.Length(); for (uint32_t idx = 0; idx < len; idx++) { diff --git a/accessible/windows/ia2/ia2AccessibleTable.cpp b/accessible/windows/ia2/ia2AccessibleTable.cpp index 79ea2ccaebf..6ac6bbab4e7 100644 --- a/accessible/windows/ia2/ia2AccessibleTable.cpp +++ b/accessible/windows/ia2/ia2AccessibleTable.cpp @@ -371,7 +371,7 @@ ia2AccessibleTable::get_selectedChildren(long aMaxChildren, long** aChildren, if (!mTable) return CO_E_OBJNOTCONNECTED; - nsAutoTArray cellIndices; + AutoTArray cellIndices; mTable->SelectedCellIndices(&cellIndices); uint32_t maxCells = cellIndices.Length(); @@ -663,7 +663,7 @@ ia2AccessibleTable::get_selectedCells(IUnknown*** aCells, long* aNSelectedCells) if (!mTable) return CO_E_OBJNOTCONNECTED; - nsAutoTArray cells; + AutoTArray cells; mTable->SelectedCells(&cells); if (cells.IsEmpty()) return S_FALSE; @@ -699,7 +699,7 @@ ia2AccessibleTable::get_selectedColumns(long** aColumns, long* aNColumns) if (!mTable) return CO_E_OBJNOTCONNECTED; - nsAutoTArray colIndices; + AutoTArray colIndices; mTable->SelectedColIndices(&colIndices); uint32_t maxCols = colIndices.Length(); @@ -729,7 +729,7 @@ ia2AccessibleTable::get_selectedRows(long** aRows, long* aNRows) if (!mTable) return CO_E_OBJNOTCONNECTED; - nsAutoTArray rowIndices; + AutoTArray rowIndices; mTable->SelectedRowIndices(&rowIndices); uint32_t maxRows = rowIndices.Length(); diff --git a/accessible/windows/ia2/ia2AccessibleTableCell.cpp b/accessible/windows/ia2/ia2AccessibleTableCell.cpp index 20f0f1ecd7b..e625a70495b 100644 --- a/accessible/windows/ia2/ia2AccessibleTableCell.cpp +++ b/accessible/windows/ia2/ia2AccessibleTableCell.cpp @@ -100,7 +100,7 @@ ia2AccessibleTableCell::get_columnHeaderCells(IUnknown*** aCellAccessibles, if (!mTableCell) return CO_E_OBJNOTCONNECTED; - nsAutoTArray cells; + AutoTArray cells; mTableCell->ColHeaderCells(&cells); *aNColumnHeaderCells = cells.Length(); @@ -172,7 +172,7 @@ ia2AccessibleTableCell::get_rowHeaderCells(IUnknown*** aCellAccessibles, if (!mTableCell) return CO_E_OBJNOTCONNECTED; - nsAutoTArray cells; + AutoTArray cells; mTableCell->RowHeaderCells(&cells); *aNRowHeaderCells = cells.Length(); diff --git a/accessible/windows/ia2/ia2AccessibleText.cpp b/accessible/windows/ia2/ia2AccessibleText.cpp index d8237370cfc..7f79b110cc4 100644 --- a/accessible/windows/ia2/ia2AccessibleText.cpp +++ b/accessible/windows/ia2/ia2AccessibleText.cpp @@ -61,7 +61,7 @@ ia2AccessibleText::get_attributes(long aOffset, long *aStartOffset, int32_t startOffset = 0, endOffset = 0; HRESULT hr; if (ProxyAccessible* proxy = HyperTextProxyFor(this)) { - nsAutoTArray attrs; + AutoTArray attrs; proxy->TextAttributes(true, aOffset, &attrs, &startOffset, &endOffset); hr = AccessibleWrap::ConvertToIA2Attributes(&attrs, aTextAttributes); } else { diff --git a/accessible/windows/msaa/AccessibleWrap.cpp b/accessible/windows/msaa/AccessibleWrap.cpp index 249784d886e..1fba158128b 100644 --- a/accessible/windows/msaa/AccessibleWrap.cpp +++ b/accessible/windows/msaa/AccessibleWrap.cpp @@ -834,7 +834,7 @@ AccessibleWrap::get_accSelection(VARIANT __RPC_FAR *pvarChildren) return E_NOTIMPL; if (IsSelect()) { - nsAutoTArray selectedItems; + AutoTArray selectedItems; if (IsProxy()) { nsTArray proxies; Proxy()->SelectedItems(&proxies); diff --git a/accessible/xpcom/xpcAccessibleHyperText.cpp b/accessible/xpcom/xpcAccessibleHyperText.cpp index 3734ed85180..ade838eca34 100644 --- a/accessible/xpcom/xpcAccessibleHyperText.cpp +++ b/accessible/xpcom/xpcAccessibleHyperText.cpp @@ -371,7 +371,7 @@ xpcAccessibleHyperText::GetSelectionRanges(nsIArray** aRanges) do_CreateInstance(NS_ARRAY_CONTRACTID, &rv); NS_ENSURE_SUCCESS(rv, rv); - nsAutoTArray ranges; + AutoTArray ranges; Intl()->SelectionRanges(&ranges); uint32_t len = ranges.Length(); for (uint32_t idx = 0; idx < len; idx++) diff --git a/accessible/xpcom/xpcAccessibleSelectable.cpp b/accessible/xpcom/xpcAccessibleSelectable.cpp index 2a09450530e..df63e116c85 100644 --- a/accessible/xpcom/xpcAccessibleSelectable.cpp +++ b/accessible/xpcom/xpcAccessibleSelectable.cpp @@ -21,7 +21,7 @@ xpcAccessibleSelectable::GetSelectedItems(nsIArray** aSelectedItems) return NS_ERROR_FAILURE; NS_PRECONDITION(Intl()->IsSelect(), "Called on non selectable widget!"); - nsAutoTArray items; + AutoTArray items; Intl()->SelectedItems(&items); uint32_t itemCount = items.Length(); diff --git a/accessible/xpcom/xpcAccessibleTable.cpp b/accessible/xpcom/xpcAccessibleTable.cpp index aa6ee8f7646..0787bf73fdf 100644 --- a/accessible/xpcom/xpcAccessibleTable.cpp +++ b/accessible/xpcom/xpcAccessibleTable.cpp @@ -273,7 +273,7 @@ xpcAccessibleTable::GetSelectedCells(nsIArray** aSelectedCells) do_CreateInstance(NS_ARRAY_CONTRACTID, &rv); NS_ENSURE_SUCCESS(rv, rv); - nsAutoTArray cellsArray; + AutoTArray cellsArray; Intl()->SelectedCells(&cellsArray); uint32_t totalCount = cellsArray.Length(); @@ -299,7 +299,7 @@ xpcAccessibleTable::GetSelectedCellIndices(uint32_t* aCellsArraySize, if (!Intl()) return NS_ERROR_FAILURE; - nsAutoTArray cellsArray; + AutoTArray cellsArray; Intl()->SelectedCellIndices(&cellsArray); *aCellsArraySize = cellsArray.Length(); @@ -324,7 +324,7 @@ xpcAccessibleTable::GetSelectedColumnIndices(uint32_t* aColsArraySize, if (!Intl()) return NS_ERROR_FAILURE; - nsAutoTArray colsArray; + AutoTArray colsArray; Intl()->SelectedColIndices(&colsArray); *aColsArraySize = colsArray.Length(); @@ -349,7 +349,7 @@ xpcAccessibleTable::GetSelectedRowIndices(uint32_t* aRowsArraySize, if (!Intl()) return NS_ERROR_FAILURE; - nsAutoTArray rowsArray; + AutoTArray rowsArray; Intl()->SelectedRowIndices(&rowsArray); *aRowsArraySize = rowsArray.Length(); diff --git a/accessible/xpcom/xpcAccessibleTableCell.cpp b/accessible/xpcom/xpcAccessibleTableCell.cpp index dfd975bbdb0..e507a88162f 100644 --- a/accessible/xpcom/xpcAccessibleTableCell.cpp +++ b/accessible/xpcom/xpcAccessibleTableCell.cpp @@ -108,7 +108,7 @@ xpcAccessibleTableCell::GetColumnHeaderCells(nsIArray** aHeaderCells) if (!Intl()) return NS_ERROR_FAILURE; - nsAutoTArray headerCells; + AutoTArray headerCells; Intl()->ColHeaderCells(&headerCells); nsCOMPtr cells = do_CreateInstance(NS_ARRAY_CONTRACTID); @@ -132,7 +132,7 @@ xpcAccessibleTableCell::GetRowHeaderCells(nsIArray** aHeaderCells) if (!Intl()) return NS_ERROR_FAILURE; - nsAutoTArray headerCells; + AutoTArray headerCells; Intl()->RowHeaderCells(&headerCells); nsCOMPtr cells = do_CreateInstance(NS_ARRAY_CONTRACTID); diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 1112d96383f..b90661b2640 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -1688,7 +1688,7 @@ nsDocShell::FirePageHideNotification(bool aIsUnload) mTiming->NotifyUnloadEventEnd(); } - nsAutoTArray, 8> kids; + AutoTArray, 8> kids; uint32_t n = mChildList.Length(); kids.SetCapacity(n); for (uint32_t i = 0; i < n; i++) { @@ -4396,7 +4396,7 @@ nsDocShell::RemoveFromSessionHistory() int32_t index = 0; sessionHistory->GetIndex(&index); - nsAutoTArray ids; + AutoTArray ids; ids.AppendElement(mHistoryID); internalHistory->RemoveEntries(ids, index); return NS_OK; @@ -4487,7 +4487,7 @@ nsDocShell::ClearFrameHistory(nsISHEntry* aEntry) int32_t count = 0; shcontainer->GetChildCount(&count); - nsAutoTArray ids; + AutoTArray ids; for (int32_t i = 0; i < count; ++i) { nsCOMPtr child; shcontainer->GetChildAt(i, getter_AddRefs(child)); diff --git a/docshell/shistory/nsSHistory.cpp b/docshell/shistory/nsSHistory.cpp index 6400fe64dbd..94455c4ff41 100644 --- a/docshell/shistory/nsSHistory.cpp +++ b/docshell/shistory/nsSHistory.cpp @@ -1405,7 +1405,7 @@ nsSHistory::RemoveDynEntries(int32_t aOldIndex, int32_t aNewIndex) nsCOMPtr originalSH; GetEntryAtIndex(aOldIndex, false, getter_AddRefs(originalSH)); nsCOMPtr originalContainer = do_QueryInterface(originalSH); - nsAutoTArray toBeRemovedEntries; + AutoTArray toBeRemovedEntries; if (originalContainer) { nsTArray originalDynDocShellIDs; GetDynamicChildren(originalContainer, originalDynDocShellIDs, true); diff --git a/dom/animation/EffectCompositor.cpp b/dom/animation/EffectCompositor.cpp index 3c4da5ee63e..fb6af8b0335 100644 --- a/dom/animation/EffectCompositor.cpp +++ b/dom/animation/EffectCompositor.cpp @@ -578,7 +578,7 @@ EffectCompositor::GetOverriddenProperties(nsStyleContext* aStyleContext, nsCSSPropertySet& aPropertiesOverridden) { - nsAutoTArray propertiesToTrack; + AutoTArray propertiesToTrack; { nsCSSPropertySet propertiesToTrackAsSet; for (KeyframeEffectReadOnly* effect : aEffectSet) { diff --git a/dom/animation/KeyframeEffect.cpp b/dom/animation/KeyframeEffect.cpp index 65787afab44..3c85556facb 100644 --- a/dom/animation/KeyframeEffect.cpp +++ b/dom/animation/KeyframeEffect.cpp @@ -1355,7 +1355,7 @@ BuildAnimationPropertyListFromKeyframeSequence( { // Convert the object in aIterator to sequence, producing // an array of OffsetIndexedKeyframe objects. - nsAutoTArray keyframes; + AutoTArray keyframes; if (!ConvertKeyframeSequence(aCx, aIterator, keyframes)) { aRv.Throw(NS_ERROR_FAILURE); return; diff --git a/dom/base/DOMMatrix.cpp b/dom/base/DOMMatrix.cpp index 47210d96fe9..f30243befd0 100644 --- a/dom/base/DOMMatrix.cpp +++ b/dom/base/DOMMatrix.cpp @@ -267,7 +267,7 @@ template void GetDataFromMatrix(const DOMMatrixReadOnly* aMatrix, T void DOMMatrixReadOnly::ToFloat32Array(JSContext* aCx, JS::MutableHandle aResult, ErrorResult& aRv) const { - nsAutoTArray arr; + AutoTArray arr; arr.SetLength(16); GetDataFromMatrix(this, arr.Elements()); JS::Rooted value(aCx); @@ -281,7 +281,7 @@ DOMMatrixReadOnly::ToFloat32Array(JSContext* aCx, JS::MutableHandle a void DOMMatrixReadOnly::ToFloat64Array(JSContext* aCx, JS::MutableHandle aResult, ErrorResult& aRv) const { - nsAutoTArray arr; + AutoTArray arr; arr.SetLength(16); GetDataFromMatrix(this, arr.Elements()); JS::Rooted value(aCx); diff --git a/dom/base/File.cpp b/dom/base/File.cpp index f252d043d71..a8299523155 100644 --- a/dom/base/File.cpp +++ b/dom/base/File.cpp @@ -259,7 +259,7 @@ Blob::ToFile() already_AddRefed Blob::ToFile(const nsAString& aName, ErrorResult& aRv) const { - nsAutoTArray, 1> blobImpls; + AutoTArray, 1> blobImpls; blobImpls.AppendElement(mImpl); nsAutoString contentType; diff --git a/dom/base/FragmentOrElement.cpp b/dom/base/FragmentOrElement.cpp index c51e07f3157..a490e3a9af4 100644 --- a/dom/base/FragmentOrElement.cpp +++ b/dom/base/FragmentOrElement.cpp @@ -308,7 +308,7 @@ nsIContent::GetBaseURI(bool aTryUseXHRDocBaseURI) const // faster for the far more common case of there not being any such // attributes. // Also check for SVG elements which require special handling - nsAutoTArray baseAttrs; + AutoTArray baseAttrs; nsString attr; const nsIContent *elem = this; do { @@ -1328,7 +1328,7 @@ public: } private: - nsAutoTArray, + AutoTArray, SUBTREE_UNBINDINGS_PER_RUNNABLE> mSubtreeRoots; RefPtr mNext; ContentUnbinder* mLast; @@ -1528,11 +1528,11 @@ FragmentOrElement::CanSkipInCC(nsINode* aNode) // nodesToUnpurple contains nodes which will be removed // from the purple buffer if the DOM tree is black. - nsAutoTArray nodesToUnpurple; + AutoTArray nodesToUnpurple; // grayNodes need script traverse, so they aren't removed from // the purple buffer, but are marked to be in black subtree so that // traverse is faster. - nsAutoTArray grayNodes; + AutoTArray grayNodes; bool foundBlack = root->IsBlack(); if (root != currentDoc) { @@ -1598,8 +1598,8 @@ FragmentOrElement::CanSkipInCC(nsINode* aNode) return !NeedsScriptTraverse(aNode); } -nsAutoTArray* gPurpleRoots = nullptr; -nsAutoTArray* gNodesToUnbind = nullptr; +AutoTArray* gPurpleRoots = nullptr; +AutoTArray* gNodesToUnbind = nullptr; void ClearCycleCollectorCleanupData() { @@ -1702,7 +1702,7 @@ FragmentOrElement::CanSkip(nsINode* aNode, bool aRemovingAllowed) // nodesToClear contains nodes which are either purple or // gray. - nsAutoTArray nodesToClear; + AutoTArray nodesToClear; bool foundBlack = root->IsBlack(); bool domOnlyCycle = false; @@ -1751,7 +1751,7 @@ FragmentOrElement::CanSkip(nsINode* aNode, bool aRemovingAllowed) root->SetIsPurpleRoot(true); if (domOnlyCycle) { if (!gNodesToUnbind) { - gNodesToUnbind = new nsAutoTArray(); + gNodesToUnbind = new AutoTArray(); } gNodesToUnbind->AppendElement(static_cast(root)); for (uint32_t i = 0; i < nodesToClear.Length(); ++i) { @@ -1763,7 +1763,7 @@ FragmentOrElement::CanSkip(nsINode* aNode, bool aRemovingAllowed) return true; } else { if (!gPurpleRoots) { - gPurpleRoots = new nsAutoTArray(); + gPurpleRoots = new AutoTArray(); } gPurpleRoots->AppendElement(root); } diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp index 3065657a38c..265c3c26a17 100644 --- a/dom/base/Navigator.cpp +++ b/dom/base/Navigator.cpp @@ -871,7 +871,7 @@ Navigator::RemoveIdleObserver(MozIdleObserver& aIdleObserver, ErrorResult& aRv) bool Navigator::Vibrate(uint32_t aDuration) { - nsAutoTArray pattern; + AutoTArray pattern; pattern.AppendElement(aDuration); return Vibrate(pattern); } diff --git a/dom/base/nsContentIterator.cpp b/dom/base/nsContentIterator.cpp index 85dbee07fa5..5bbb604539a 100644 --- a/dom/base/nsContentIterator.cpp +++ b/dom/base/nsContentIterator.cpp @@ -155,7 +155,7 @@ protected: nsCOMPtr mCommonParent; // used by nsContentIterator to cache indices - nsAutoTArray mIndexes; + AutoTArray mIndexes; // used by nsSubtreeIterator to cache indices. Why put them in the base // class? Because otherwise I have to duplicate the routines GetNextSibling @@ -1058,8 +1058,8 @@ nsContentIterator::PositionAt(nsINode* aCurNode) // We can be at ANY node in the sequence. Need to regenerate the array of // indexes back to the root or common parent! - nsAutoTArray oldParentStack; - nsAutoTArray newIndexes; + AutoTArray oldParentStack; + AutoTArray newIndexes; // Get a list of the parents up to the root, then compare the new node with // entries in that array until we find a match (lowest common ancestor). If @@ -1213,8 +1213,8 @@ protected: RefPtr mRange; // these arrays all typically are used and have elements - nsAutoTArray mEndNodes; - nsAutoTArray mEndOffsets; + AutoTArray mEndNodes; + AutoTArray mEndOffsets; }; NS_IMPL_ADDREF_INHERITED(nsContentSubtreeIterator, nsContentIterator) diff --git a/dom/base/nsContentList.cpp b/dom/base/nsContentList.cpp index dbf0fb29dfe..e09239b376c 100644 --- a/dom/base/nsContentList.cpp +++ b/dom/base/nsContentList.cpp @@ -548,7 +548,7 @@ nsContentList::GetSupportedNames(unsigned aFlags, nsTArray& aNames) BringSelfUpToDate(true); - nsAutoTArray atoms; + AutoTArray atoms; for (uint32_t i = 0; i < mElements.Length(); ++i) { nsIContent *content = mElements.ElementAt(i); if (content->HasID()) { diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp index 00cea3a2e4e..86e80fc08a9 100644 --- a/dom/base/nsContentUtils.cpp +++ b/dom/base/nsContentUtils.cpp @@ -2286,7 +2286,7 @@ nsContentUtils::GetCommonAncestor(nsINode* aNode1, } // Build the chain of parents - nsAutoTArray parents1, parents2; + AutoTArray parents1, parents2; do { parents1.AppendElement(aNode1); aNode1 = aNode1->GetParentNode(); @@ -2335,7 +2335,7 @@ nsContentUtils::ComparePoints(nsINode* aParent1, int32_t aOffset1, 0; } - nsAutoTArray parents1, parents2; + AutoTArray parents1, parents2; nsINode* node1 = aParent1; nsINode* node2 = aParent2; do { @@ -4287,7 +4287,7 @@ nsContentUtils::CreateContextualFragment(nsINode* aContextNode, return frag.forget(); } - nsAutoTArray tagStack; + AutoTArray tagStack; nsAutoString uriStr, nameStr; nsCOMPtr content = do_QueryInterface(aContextNode); // just in case we have a text node @@ -6853,7 +6853,7 @@ nsContentUtils::FireMutationEventsForDirectParsing(nsIDocument* aDoc, int32_t newChildCount = aDest->GetChildCount(); if (newChildCount && nsContentUtils:: HasMutationListeners(aDoc, NS_EVENT_BITS_MUTATION_NODEINSERTED)) { - nsAutoTArray, 50> childNodes; + AutoTArray, 50> childNodes; NS_ASSERTION(newChildCount - aOldChildCount >= 0, "What, some unexpected dom mutation has happened?"); childNodes.SetCapacity(newChildCount - aOldChildCount); @@ -7920,7 +7920,7 @@ nsContentUtils::FirePageHideEvent(nsIDocShellTreeItem* aItem, int32_t childCount = 0; aItem->GetChildCount(&childCount); - nsAutoTArray, 8> kids; + AutoTArray, 8> kids; kids.AppendElements(childCount); for (int32_t i = 0; i < childCount; ++i) { aItem->GetChildAt(i, getter_AddRefs(kids[i])); @@ -7945,7 +7945,7 @@ nsContentUtils::FirePageShowEvent(nsIDocShellTreeItem* aItem, { int32_t childCount = 0; aItem->GetChildCount(&childCount); - nsAutoTArray, 8> kids; + AutoTArray, 8> kids; kids.AppendElements(childCount); for (int32_t i = 0; i < childCount; ++i) { aItem->GetChildAt(i, getter_AddRefs(kids[i])); @@ -8534,7 +8534,7 @@ private: } } - nsAutoTArray mUnits; + AutoTArray mUnits; nsAutoPtr mNext; StringBuilder* mLast; // mLength is used only in the first StringBuilder object in the linked list. diff --git a/dom/base/nsDOMMutationObserver.cpp b/dom/base/nsDOMMutationObserver.cpp index da89b51cd2a..b801765ca19 100644 --- a/dom/base/nsDOMMutationObserver.cpp +++ b/dom/base/nsDOMMutationObserver.cpp @@ -22,7 +22,7 @@ using mozilla::dom::TreeOrderComparator; using mozilla::dom::Animation; -nsAutoTArray, 4>* +AutoTArray, 4>* nsDOMMutationObserver::sScheduledMutationObservers = nullptr; nsDOMMutationObserver* nsDOMMutationObserver::sCurrentObserver = nullptr; @@ -30,7 +30,7 @@ nsDOMMutationObserver* nsDOMMutationObserver::sCurrentObserver = nullptr; uint32_t nsDOMMutationObserver::sMutationLevel = 0; uint64_t nsDOMMutationObserver::sCount = 0; -nsAutoTArray, 4>, 4>* +AutoTArray, 4>, 4>* nsDOMMutationObserver::sCurrentlyHandlingObservers = nullptr; nsINodeList* @@ -585,7 +585,7 @@ void nsDOMMutationObserver::RescheduleForRun() { if (!sScheduledMutationObservers) { - sScheduledMutationObservers = new nsAutoTArray, 4>; + sScheduledMutationObservers = new AutoTArray, 4>; } bool didInsert = false; @@ -882,7 +882,7 @@ nsDOMMutationObserver::HandleMutationsInternal() nsTArray >* suppressedObservers = nullptr; while (sScheduledMutationObservers) { - nsAutoTArray, 4>* observers = + AutoTArray, 4>* observers = sScheduledMutationObservers; sScheduledMutationObservers = nullptr; for (uint32_t i = 0; i < observers->Length(); ++i) { @@ -995,7 +995,7 @@ nsDOMMutationObserver::AddCurrentlyHandlingObserver(nsDOMMutationObserver* aObse if (!sCurrentlyHandlingObservers) { sCurrentlyHandlingObservers = - new nsAutoTArray, 4>, 4>; + new AutoTArray, 4>, 4>; } while (sCurrentlyHandlingObservers->Length() < aMutationLevel) { diff --git a/dom/base/nsDOMMutationObserver.h b/dom/base/nsDOMMutationObserver.h index b2c6e398160..8ff450d3ad3 100644 --- a/dom/base/nsDOMMutationObserver.h +++ b/dom/base/nsDOMMutationObserver.h @@ -605,7 +605,7 @@ protected: nsClassHashtable > mTransientReceivers; // MutationRecords which are being constructed. - nsAutoTArray mCurrentMutations; + AutoTArray mCurrentMutations; // MutationRecords which will be handed to the callback at the end of // the microtask. RefPtr mFirstPendingMutation; @@ -621,11 +621,11 @@ protected: uint64_t mId; static uint64_t sCount; - static nsAutoTArray, 4>* sScheduledMutationObservers; + static AutoTArray, 4>* sScheduledMutationObservers; static nsDOMMutationObserver* sCurrentObserver; static uint32_t sMutationLevel; - static nsAutoTArray, 4>, 4>* + static AutoTArray, 4>, 4>* sCurrentlyHandlingObservers; }; @@ -740,7 +740,7 @@ private: static nsAutoMutationBatch* sCurrentBatch; nsAutoMutationBatch* mPreviousBatch; - nsAutoTArray mObservers; + AutoTArray mObservers; nsTArray > mRemovedNodes; nsTArray > mAddedNodes; nsINode* mBatchTarget; @@ -907,7 +907,7 @@ private: }; static nsAutoAnimationMutationBatch* sCurrentBatch; - nsAutoTArray mObservers; + AutoTArray mObservers; typedef nsTArray EntryArray; nsClassHashtable, EntryArray> mEntryTable; // List of nodes referred to by mEntryTable so we can sort them diff --git a/dom/base/nsDOMTokenList.cpp b/dom/base/nsDOMTokenList.cpp index 682be1ddb9c..855b8e9c0e5 100644 --- a/dom/base/nsDOMTokenList.cpp +++ b/dom/base/nsDOMTokenList.cpp @@ -134,7 +134,7 @@ nsDOMTokenList::AddInternal(const nsAttrValue* aAttr, } bool oneWasAdded = false; - nsAutoTArray addedClasses; + AutoTArray addedClasses; for (uint32_t i = 0, l = aTokens.Length(); i < l; ++i) { const nsString& aToken = aTokens[i]; @@ -175,7 +175,7 @@ nsDOMTokenList::Add(const nsTArray& aTokens, ErrorResult& aError) void nsDOMTokenList::Add(const nsAString& aToken, mozilla::ErrorResult& aError) { - nsAutoTArray tokens; + AutoTArray tokens; tokens.AppendElement(aToken); Add(tokens, aError); } @@ -261,7 +261,7 @@ nsDOMTokenList::Remove(const nsTArray& aTokens, ErrorResult& aError) void nsDOMTokenList::Remove(const nsAString& aToken, mozilla::ErrorResult& aError) { - nsAutoTArray tokens; + AutoTArray tokens; tokens.AppendElement(aToken); Remove(tokens, aError); } @@ -281,7 +281,7 @@ nsDOMTokenList::Toggle(const nsAString& aToken, const bool forceOff = aForce.WasPassed() && !aForce.Value(); bool isPresent = attr && attr->Contains(aToken); - nsAutoTArray tokens; + AutoTArray tokens; (*tokens.AppendElement()).Rebind(aToken.Data(), aToken.Length()); if (isPresent) { diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index 679fcf0fdbe..fe98617af4d 100644 --- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -3294,7 +3294,7 @@ nsDocument::ElementFromPointHelper(float aX, float aY, bool aIgnoreRootScrollFrame, bool aFlushLayout) { - nsAutoTArray, 1> elementArray; + AutoTArray, 1> elementArray; ElementsFromPointHelper(aX, aY, ((aIgnoreRootScrollFrame ? nsIDocument::IGNORE_ROOT_SCROLL_FRAME : 0) | (aFlushLayout ? nsIDocument::FLUSH_LAYOUT : 0) | @@ -3416,7 +3416,7 @@ nsDocument::NodesFromRectHelper(float aX, float aY, if (!rootFrame) return NS_OK; // return nothing to premature XUL callers as a reminder to wait - nsAutoTArray outFrames; + AutoTArray outFrames; nsLayoutUtils::GetFramesForArea(rootFrame, rect, outFrames, nsLayoutUtils::IGNORE_PAINT_SUPPRESSION | nsLayoutUtils::IGNORE_CROSS_DOC | (aIgnoreRootScrollFrame ? nsLayoutUtils::IGNORE_ROOT_SCROLL_FRAME : 0)); @@ -11238,7 +11238,7 @@ nsDocument::RestorePreviousFullScreenState() } nsCOMPtr fullScreenDoc = GetFullscreenLeaf(this); - nsAutoTArray exitDocs; + AutoTArray exitDocs; nsIDocument* doc = fullScreenDoc; // Collect all subdocuments. @@ -11855,7 +11855,7 @@ nsDocument::ApplyFullscreen(const FullscreenRequest& aRequest) // order, but we traverse the doctree in a leaf-to-root order, so we save // references to the documents we must dispatch to so that we get the order // as specified. - nsAutoTArray changed; + AutoTArray changed; // Remember the root document, so that if a full-screen document is hidden // we can reset full-screen state in the remaining visible full-screen documents. diff --git a/dom/base/nsDocumentEncoder.cpp b/dom/base/nsDocumentEncoder.cpp index f100a808d65..09b7195b37d 100644 --- a/dom/base/nsDocumentEncoder.cpp +++ b/dom/base/nsDocumentEncoder.cpp @@ -162,11 +162,11 @@ protected: uint32_t mEndDepth; int32_t mStartRootIndex; int32_t mEndRootIndex; - nsAutoTArray mCommonAncestors; - nsAutoTArray mStartNodes; - nsAutoTArray mStartOffsets; - nsAutoTArray mEndNodes; - nsAutoTArray mEndOffsets; + AutoTArray mCommonAncestors; + AutoTArray mStartNodes; + AutoTArray mStartOffsets; + AutoTArray mEndNodes; + AutoTArray mEndOffsets; bool mHaltRangeHint; // Used when context has already been serialized for // table cell selections (where parent is ) diff --git a/dom/base/nsFocusManager.cpp b/dom/base/nsFocusManager.cpp index 33b5e43c9a8..eb0d5b070e8 100644 --- a/dom/base/nsFocusManager.cpp +++ b/dom/base/nsFocusManager.cpp @@ -1370,7 +1370,7 @@ nsFocusManager::GetCommonAncestor(nsPIDOMWindowOuter* aWindow1, nsCOMPtr dsti2 = aWindow2->GetDocShell(); NS_ENSURE_TRUE(dsti2, nullptr); - nsAutoTArray parents1, parents2; + AutoTArray parents1, parents2; do { parents1.AppendElement(dsti1); nsCOMPtr parentDsti1; diff --git a/dom/base/nsFrameMessageManager.h b/dom/base/nsFrameMessageManager.h index b0215ef32c8..9f38e293bda 100644 --- a/dom/base/nsFrameMessageManager.h +++ b/dom/base/nsFrameMessageManager.h @@ -399,7 +399,7 @@ protected: bool InitChildGlobalInternal(nsISupports* aScope, const nsACString& aID); nsCOMPtr mGlobal; nsCOMPtr mPrincipal; - nsAutoTArray, 2> mAnonymousGlobalScopes; + AutoTArray, 2> mAnonymousGlobalScopes; static nsDataHashtable* sCachedScripts; static nsScriptCacheCleaner* sScriptCacheCleaner; diff --git a/dom/base/nsIDocument.h b/dom/base/nsIDocument.h index 66ac703417a..a0e3b1a5766 100644 --- a/dom/base/nsIDocument.h +++ b/dom/base/nsIDocument.h @@ -1830,7 +1830,7 @@ public: return mObservers; } protected: - nsAutoTArray< nsCOMPtr, 8 > mObservers; + AutoTArray< nsCOMPtr, 8 > mObservers; }; /** diff --git a/dom/base/nsINode.cpp b/dom/base/nsINode.cpp index 9c81089b96c..091df34388d 100644 --- a/dom/base/nsINode.cpp +++ b/dom/base/nsINode.cpp @@ -595,7 +595,7 @@ void nsINode::Normalize() { // First collect list of nodes to be removed - nsAutoTArray, 50> nodes; + AutoTArray, 50> nodes; bool canMerge = false; for (nsIContent* node = this->GetFirstChild(); @@ -864,7 +864,7 @@ nsINode::CompareDocumentPosition(nsINode& aOtherNode) const return static_cast(nsIDOMNode::DOCUMENT_POSITION_FOLLOWING); } - nsAutoTArray parents1, parents2; + AutoTArray parents1, parents2; const nsINode *node1 = &aOtherNode, *node2 = this; @@ -1992,7 +1992,7 @@ nsINode::ReplaceOrInsertBefore(bool aReplace, nsINode* aNewChild, nodeToInsertBefore = nodeToInsertBefore->GetNextSibling(); } - Maybe, 50> > fragChildren; + Maybe, 50> > fragChildren; // Remove the new child from the old parent if one exists nsIContent* newContent = aNewChild->AsContent(); @@ -2702,7 +2702,7 @@ nsINode::QuerySelectorAll(const nsAString& aSelector, ErrorResult& aResult) nsCSSSelectorList* selectorList = ParseSelectorList(aSelector, aResult); if (selectorList) { - FindMatchingElements>(this, + FindMatchingElements>(this, selectorList, *contentList, aResult); diff --git a/dom/base/nsLineBreaker.cpp b/dom/base/nsLineBreaker.cpp index b0e71275fa9..2a2296e3383 100644 --- a/dom/base/nsLineBreaker.cpp +++ b/dom/base/nsLineBreaker.cpp @@ -59,7 +59,7 @@ nsresult nsLineBreaker::FlushCurrentWord() { uint32_t length = mCurrentWord.Length(); - nsAutoTArray breakState; + AutoTArray breakState; if (!breakState.AppendElements(length)) return NS_ERROR_OUT_OF_MEMORY; @@ -187,7 +187,7 @@ nsLineBreaker::AppendText(nsIAtom* aHyphenationLanguage, const char16_t* aText, return rv; } - nsAutoTArray breakState; + AutoTArray breakState; if (aSink) { if (!breakState.AppendElements(aLength)) return NS_ERROR_OUT_OF_MEMORY; @@ -368,7 +368,7 @@ nsLineBreaker::AppendText(nsIAtom* aHyphenationLanguage, const uint8_t* aText, u return rv; } - nsAutoTArray breakState; + AutoTArray breakState; if (aSink) { if (!breakState.AppendElements(aLength)) return NS_ERROR_OUT_OF_MEMORY; diff --git a/dom/base/nsLineBreaker.h b/dom/base/nsLineBreaker.h index 012faa62dd1..81c4c334e9b 100644 --- a/dom/base/nsLineBreaker.h +++ b/dom/base/nsLineBreaker.h @@ -206,9 +206,9 @@ private: const char16_t *aTextLimit, uint8_t *aBreakState); - nsAutoTArray mCurrentWord; + AutoTArray mCurrentWord; // All the items that contribute to mCurrentWord - nsAutoTArray mTextItems; + AutoTArray mTextItems; nsIAtom* mCurrentWordLanguage; bool mCurrentWordContainsMixedLang; bool mCurrentWordContainsComplexChar; diff --git a/dom/base/nsPerformance.cpp b/dom/base/nsPerformance.cpp index 3f4160744af..baecce534e5 100644 --- a/dom/base/nsPerformance.cpp +++ b/dom/base/nsPerformance.cpp @@ -958,7 +958,7 @@ DOMHighResTimeStamp PerformanceBase::ResolveTimestampFromName(const nsAString& aName, ErrorResult& aRv) { - nsAutoTArray, 1> arr; + AutoTArray, 1> arr; DOMHighResTimeStamp ts; Optional typeParam; nsAutoString str; diff --git a/dom/base/nsPlainTextSerializer.h b/dom/base/nsPlainTextSerializer.h index a154b38321a..acdbff5bae0 100644 --- a/dom/base/nsPlainTextSerializer.h +++ b/dom/base/nsPlainTextSerializer.h @@ -199,10 +199,10 @@ private: RefPtr mElement; // For handling table rows - nsAutoTArray mHasWrittenCellsForRow; + AutoTArray mHasWrittenCellsForRow; // Values gotten in OpenContainer that is (also) needed in CloseContainer - nsAutoTArray mIsInCiteBlockquote; + AutoTArray mIsInCiteBlockquote; // The output data nsAString* mOutputString; diff --git a/dom/base/nsXHTMLContentSerializer.h b/dom/base/nsXHTMLContentSerializer.h index f6041c98b45..6fc7dce6691 100644 --- a/dom/base/nsXHTMLContentSerializer.h +++ b/dom/base/nsXHTMLContentSerializer.h @@ -152,7 +152,7 @@ protected: }; // Stack to store one olState struct per
    . - nsAutoTArray mOLStateStack; + AutoTArray mOLStateStack; bool HasNoChildren(nsIContent* aContent); }; diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py index 99e4bb77e7e..e8e2947bdc9 100644 --- a/dom/bindings/Codegen.py +++ b/dom/bindings/Codegen.py @@ -4474,8 +4474,8 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None, # reallocation behavior for arrays. In particular, if we use auto # arrays for sequences and have a sequence of elements which are # themselves sequences or have sequences as members, we have a problem. - # In that case, resizing the outermost nsAutoTarray to the right size - # will memmove its elements, but nsAutoTArrays are not memmovable and + # In that case, resizing the outermost AutoTArray to the right size + # will memmove its elements, but AutoTArrays are not memmovable and # hence will end up with pointers to bogus memory, which is bad. To # deal with this, we typically map WebIDL sequences to our Sequence # type, which is in fact memmovable. The one exception is when we're @@ -8389,7 +8389,7 @@ class CGEnumerateHook(CGAbstractBindingMethod): def generate_code(self): return CGGeneric(dedent(""" - nsAutoTArray names; + AutoTArray names; ErrorResult rv; self->GetOwnPropertyNames(cx, names, rv); if (rv.MaybeSetPendingException(cx)) { @@ -10456,7 +10456,7 @@ class CGEnumerateOwnPropertiesViaGetOwnPropertyNames(CGAbstractBindingMethod): def generate_code(self): return CGGeneric(dedent(""" - nsAutoTArray names; + AutoTArray names; ErrorResult rv; self->GetOwnPropertyNames(cx, names, rv); if (rv.MaybeSetPendingException(cx)) { diff --git a/dom/bluetooth/common/BluetoothService.cpp b/dom/bluetooth/common/BluetoothService.cpp index 76c1a945fae..aea7e8bc88e 100644 --- a/dom/bluetooth/common/BluetoothService.cpp +++ b/dom/bluetooth/common/BluetoothService.cpp @@ -94,7 +94,7 @@ GetAllBluetoothActors(InfallibleTArray& aActors) MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(aActors.IsEmpty()); - nsAutoTArray contentActors; + AutoTArray contentActors; ContentParent::GetAll(contentActors); for (uint32_t contentIndex = 0; diff --git a/dom/cache/AutoUtils.cpp b/dom/cache/AutoUtils.cpp index 1f9c8a52c75..527cb528a73 100644 --- a/dom/cache/AutoUtils.cpp +++ b/dom/cache/AutoUtils.cpp @@ -47,7 +47,7 @@ CleanupChildFds(CacheReadStream& aReadStream, CleanupAction aAction) return; } - nsAutoTArray fds; + AutoTArray fds; FileDescriptorSetChild* fdSetActor = static_cast(aReadStream.fds().get_PFileDescriptorSetChild()); @@ -107,7 +107,7 @@ CleanupParentFds(CacheReadStream& aReadStream, CleanupAction aAction) return; } - nsAutoTArray fds; + AutoTArray fds; FileDescriptorSetParent* fdSetActor = static_cast(aReadStream.fds().get_PFileDescriptorSetParent()); @@ -306,7 +306,7 @@ MatchInPutList(InternalRequest* aRequest, RefPtr cachedResponseHeaders = TypeUtils::ToInternalHeaders(cachedResponse.headers()); - nsAutoTArray varyHeaders; + AutoTArray varyHeaders; ErrorResult rv; cachedResponseHeaders->GetAll(NS_LITERAL_CSTRING("vary"), varyHeaders, rv); MOZ_ALWAYS_TRUE(!rv.Failed()); diff --git a/dom/cache/Cache.cpp b/dom/cache/Cache.cpp index a91e2cb488e..a34ccf47d3a 100644 --- a/dom/cache/Cache.cpp +++ b/dom/cache/Cache.cpp @@ -114,7 +114,7 @@ public: // an Array of Response objects. The following code unwraps these // JS values back to an nsTArray>. - nsAutoTArray, 256> responseList; + AutoTArray, 256> responseList; responseList.SetCapacity(mRequestList.Length()); bool isArray; @@ -571,7 +571,7 @@ Cache::AddAll(const GlobalObject& aGlobal, return promise.forget(); } - nsAutoTArray, 256> fetchList; + AutoTArray, 256> fetchList; fetchList.SetCapacity(aRequestList.Length()); // Begin fetching each request in parallel. For now, if an error occurs just diff --git a/dom/cache/CacheOpChild.cpp b/dom/cache/CacheOpChild.cpp index fdc942abe38..c65a7fe1c65 100644 --- a/dom/cache/CacheOpChild.cpp +++ b/dom/cache/CacheOpChild.cpp @@ -219,7 +219,7 @@ CacheOpChild::HandleResponse(const CacheResponseOrVoid& aResponseOrVoid) void CacheOpChild::HandleResponseList(const nsTArray& aResponseList) { - nsAutoTArray, 256> responses; + AutoTArray, 256> responses; responses.SetCapacity(aResponseList.Length()); for (uint32_t i = 0; i < aResponseList.Length(); ++i) { @@ -233,7 +233,7 @@ CacheOpChild::HandleResponseList(const nsTArray& aResponseList) void CacheOpChild::HandleRequestList(const nsTArray& aRequestList) { - nsAutoTArray, 256> requests; + AutoTArray, 256> requests; requests.SetCapacity(aRequestList.Length()); for (uint32_t i = 0; i < aRequestList.Length(); ++i) { diff --git a/dom/cache/CacheOpParent.cpp b/dom/cache/CacheOpParent.cpp index 1077d4e8ab6..b67fbaa774b 100644 --- a/dom/cache/CacheOpParent.cpp +++ b/dom/cache/CacheOpParent.cpp @@ -79,8 +79,8 @@ CacheOpParent::Execute(Manager* aManager) const CachePutAllArgs& args = mOpArgs.get_CachePutAllArgs(); const nsTArray& list = args.requestResponseList(); - nsAutoTArray, 256> requestStreamList; - nsAutoTArray, 256> responseStreamList; + AutoTArray, 256> requestStreamList; + AutoTArray, 256> responseStreamList; for (uint32_t i = 0; i < list.Length(); ++i) { requestStreamList.AppendElement( @@ -221,7 +221,7 @@ CacheOpParent::DeserializeCacheStream(const CacheReadStreamOrVoid& aStreamOrVoid } // Option 3: A stream was serialized using normal methods. - nsAutoTArray fds; + AutoTArray fds; if (readStream.fds().type() == OptionalFileDescriptorSet::TPFileDescriptorSetChild) { diff --git a/dom/cache/DBSchema.cpp b/dom/cache/DBSchema.cpp index fa83a268a58..c3a49dea8b0 100644 --- a/dom/cache/DBSchema.cpp +++ b/dom/cache/DBSchema.cpp @@ -588,11 +588,11 @@ DeleteCacheId(mozIStorageConnection* aConn, CacheId aCacheId, // Delete the bodies explicitly as we need to read out the body IDs // anyway. These body IDs must be deleted one-by-one as content may // still be referencing them invidivually. - nsAutoTArray matches; + AutoTArray matches; nsresult rv = QueryAll(aConn, aCacheId, matches); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } - nsAutoTArray deletedSecurityIdList; + AutoTArray deletedSecurityIdList; rv = DeleteEntries(aConn, matches, aDeletedBodyIdListOut, deletedSecurityIdList); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } @@ -720,7 +720,7 @@ CacheMatch(mozIStorageConnection* aConn, CacheId aCacheId, *aFoundResponseOut = false; - nsAutoTArray matches; + AutoTArray matches; nsresult rv = QueryCache(aConn, aCacheId, aRequest, aParams, matches, 1); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } @@ -747,7 +747,7 @@ CacheMatchAll(mozIStorageConnection* aConn, CacheId aCacheId, MOZ_ASSERT(aConn); nsresult rv; - nsAutoTArray matches; + AutoTArray matches; if (aRequestOrVoid.type() == CacheRequestOrVoid::Tvoid_t) { rv = QueryAll(aConn, aCacheId, matches); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } @@ -781,11 +781,11 @@ CachePut(mozIStorageConnection* aConn, CacheId aCacheId, CacheQueryParams params(false, false, false, false, NS_LITERAL_STRING("")); - nsAutoTArray matches; + AutoTArray matches; nsresult rv = QueryCache(aConn, aCacheId, aRequest, params, matches); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } - nsAutoTArray deletedSecurityIdList; + AutoTArray deletedSecurityIdList; rv = DeleteEntries(aConn, matches, aDeletedBodyIdListOut, deletedSecurityIdList); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } @@ -814,7 +814,7 @@ CacheDelete(mozIStorageConnection* aConn, CacheId aCacheId, *aSuccessOut = false; - nsAutoTArray matches; + AutoTArray matches; nsresult rv = QueryCache(aConn, aCacheId, aRequest, aParams, matches); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } @@ -822,7 +822,7 @@ CacheDelete(mozIStorageConnection* aConn, CacheId aCacheId, return rv; } - nsAutoTArray deletedSecurityIdList; + AutoTArray deletedSecurityIdList; rv = DeleteEntries(aConn, matches, aDeletedBodyIdListOut, deletedSecurityIdList); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } @@ -845,7 +845,7 @@ CacheKeys(mozIStorageConnection* aConn, CacheId aCacheId, MOZ_ASSERT(aConn); nsresult rv; - nsAutoTArray matches; + AutoTArray matches; if (aRequestOrVoid.type() == CacheRequestOrVoid::Tvoid_t) { rv = QueryAll(aConn, aCacheId, matches); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } @@ -912,7 +912,7 @@ StorageMatch(mozIStorageConnection* aConn, rv = state->BindInt32ByName(NS_LITERAL_CSTRING("namespace"), aNamespace); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } - nsAutoTArray cacheIdList; + AutoTArray cacheIdList; bool hasMoreData = false; while (NS_SUCCEEDED(state->ExecuteStep(&hasMoreData)) && hasMoreData) { @@ -1218,7 +1218,7 @@ MatchByVaryHeader(mozIStorageConnection* aConn, rv = state->BindInt32ByName(NS_LITERAL_CSTRING("entry_id"), entryId); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } - nsAutoTArray varyValues; + AutoTArray varyValues; bool hasMoreData = false; while (NS_SUCCEEDED(state->ExecuteStep(&hasMoreData)) && hasMoreData) { diff --git a/dom/cache/Manager.cpp b/dom/cache/Manager.cpp index 4a9f9e0a1c2..0e425035632 100644 --- a/dom/cache/Manager.cpp +++ b/dom/cache/Manager.cpp @@ -74,12 +74,12 @@ public: mozIStorageConnection::TRANSACTION_IMMEDIATE); // Clean up orphaned Cache objects - nsAutoTArray orphanedCacheIdList; + AutoTArray orphanedCacheIdList; nsresult rv = db::FindOrphanedCacheIds(aConn, orphanedCacheIdList); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } for (uint32_t i = 0; i < orphanedCacheIdList.Length(); ++i) { - nsAutoTArray deletedBodyIdList; + AutoTArray deletedBodyIdList; rv = db::DeleteCacheId(aConn, orphanedCacheIdList[i], deletedBodyIdList); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; } @@ -88,7 +88,7 @@ public: } // Clean up orphaned body objects - nsAutoTArray knownBodyIdList; + AutoTArray knownBodyIdList; rv = db::GetKnownBodyIds(aConn, knownBodyIdList); rv = BodyDeleteOrphanedFiles(aDBDir, knownBodyIdList); @@ -1373,7 +1373,7 @@ Manager::Listener::OnOpComplete(ErrorResult&& aRv, const CacheOpResult& aResult, const SavedResponse& aSavedResponse, StreamList* aStreamList) { - nsAutoTArray responseList; + AutoTArray responseList; responseList.AppendElement(aSavedResponse); OnOpComplete(Move(aRv), aResult, INVALID_CACHE_ID, responseList, nsTArray(), aStreamList); @@ -1902,7 +1902,7 @@ Manager::NoteOrphanedBodyIdList(const nsTArray& aDeletedBodyIdList) { NS_ASSERT_OWNINGTHREAD(Manager); - nsAutoTArray deleteNowList; + AutoTArray deleteNowList; deleteNowList.SetCapacity(aDeletedBodyIdList.Length()); for (uint32_t i = 0; i < aDeletedBodyIdList.Length(); ++i) { diff --git a/dom/cache/ReadStream.cpp b/dom/cache/ReadStream.cpp index d4a74c0084f..7cdd3d3a765 100644 --- a/dom/cache/ReadStream.cpp +++ b/dom/cache/ReadStream.cpp @@ -222,7 +222,7 @@ ReadStream::Inner::Serialize(CacheReadStream* aReadStreamOut) aReadStreamOut->id() = mId; mControl->SerializeControl(aReadStreamOut); - nsAutoTArray fds; + AutoTArray fds; SerializeInputStream(mStream, aReadStreamOut->params(), fds); mControl->SerializeFds(aReadStreamOut, fds); @@ -451,7 +451,7 @@ ReadStream::Create(const CacheReadStream& aReadStream) } MOZ_ASSERT(control); - nsAutoTArray fds; + AutoTArray fds; control->DeserializeFds(aReadStream, fds); nsCOMPtr stream = diff --git a/dom/cache/TypeUtils.cpp b/dom/cache/TypeUtils.cpp index ad373b26737..dce6909509f 100644 --- a/dom/cache/TypeUtils.cpp +++ b/dom/cache/TypeUtils.cpp @@ -44,7 +44,7 @@ namespace { static bool HasVaryStar(mozilla::dom::InternalHeaders* aHeaders) { - nsAutoTArray varyHeaders; + AutoTArray varyHeaders; ErrorResult rv; aHeaders->GetAll(NS_LITERAL_CSTRING("vary"), varyHeaders, rv); MOZ_ALWAYS_TRUE(!rv.Failed()); @@ -67,7 +67,7 @@ HasVaryStar(mozilla::dom::InternalHeaders* aHeaders) void SerializeNormalStream(nsIInputStream* aStream, CacheReadStream& aReadStreamOut) { - nsAutoTArray fds; + AutoTArray fds; SerializeInputStream(aStream, aReadStreamOut.params(), fds); PFileDescriptorSetChild* fdSet = nullptr; @@ -94,7 +94,7 @@ ToHeadersEntryList(nsTArray& aOut, InternalHeaders* aHeaders) { MOZ_ASSERT(aHeaders); - nsAutoTArray entryList; + AutoTArray entryList; aHeaders->GetEntries(entryList); for (uint32_t i = 0; i < entryList.Length(); ++i) { diff --git a/dom/camera/GonkCameraControl.cpp b/dom/camera/GonkCameraControl.cpp index 9d06e9e00b9..280a77391c0 100644 --- a/dom/camera/GonkCameraControl.cpp +++ b/dom/camera/GonkCameraControl.cpp @@ -247,7 +247,7 @@ nsGonkCameraControl::Initialize() DOM_CAMERA_LOGI(" - flash: NOT supported\n"); } - nsAutoTArray sizes; + AutoTArray sizes; mParams.Get(CAMERA_PARAM_SUPPORTED_VIDEOSIZES, sizes); if (sizes.Length() > 0) { mSeparateVideoAndPreviewSizesSupported = true; @@ -264,7 +264,7 @@ nsGonkCameraControl::Initialize() mLastRecorderSize = mCurrentConfiguration.mPreviewSize; } - nsAutoTArray modes; + AutoTArray modes; mParams.Get(CAMERA_PARAM_SUPPORTED_METERINGMODES, modes); if (!modes.IsEmpty()) { nsString mode; @@ -302,7 +302,7 @@ nsGonkCameraControl::~nsGonkCameraControl() nsresult nsGonkCameraControl::ValidateConfiguration(const Configuration& aConfig, Configuration& aValidatedConfig) { - nsAutoTArray supportedSizes; + AutoTArray supportedSizes; Get(CAMERA_PARAM_SUPPORTED_PICTURESIZES, supportedSizes); nsresult rv = GetSupportedSize(aConfig.mPictureSize, supportedSizes, @@ -923,7 +923,7 @@ nsGonkCameraControl::SetThumbnailSizeImpl(const Size& aSize) uint32_t smallestDeltaIndex = UINT32_MAX; int targetArea = aSize.width * aSize.height; - nsAutoTArray supportedSizes; + AutoTArray supportedSizes; Get(CAMERA_PARAM_SUPPORTED_JPEG_THUMBNAIL_SIZES, supportedSizes); for (uint32_t i = 0; i < supportedSizes.Length(); ++i) { @@ -1028,7 +1028,7 @@ nsGonkCameraControl::SetPictureSizeImpl(const Size& aSize) return NS_OK; } - nsAutoTArray supportedSizes; + AutoTArray supportedSizes; Get(CAMERA_PARAM_SUPPORTED_PICTURESIZES, supportedSizes); Size best; @@ -1727,7 +1727,7 @@ nsGonkCameraControl::SelectCaptureAndPreviewSize(const Size& aPreviewSize, aPreviewSize.width, aPreviewSize.height, aMaxSize.width, aMaxSize.height); - nsAutoTArray sizes; + AutoTArray sizes; nsresult rv = Get(CAMERA_PARAM_SUPPORTED_PREVIEWSIZES, sizes); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; diff --git a/dom/canvas/CanvasRenderingContext2D.h b/dom/canvas/CanvasRenderingContext2D.h index 291ec80d743..e2a5ecf194b 100644 --- a/dom/canvas/CanvasRenderingContext2D.h +++ b/dom/canvas/CanvasRenderingContext2D.h @@ -1034,7 +1034,7 @@ protected: bool fontExplicitLanguage; }; - nsAutoTArray mStyleStack; + AutoTArray mStyleStack; inline ContextState& CurrentState() { return mStyleStack[mStyleStack.Length() - 1]; diff --git a/dom/canvas/ImageBitmapRenderingContext.cpp b/dom/canvas/ImageBitmapRenderingContext.cpp index b8b079eeb5c..e3009918618 100644 --- a/dom/canvas/ImageBitmapRenderingContext.cpp +++ b/dom/canvas/ImageBitmapRenderingContext.cpp @@ -239,7 +239,7 @@ ImageBitmapRenderingContext::GetCanvasLayer(nsDisplayListBuilder* aBuilder, imageLayer->SetContainer(imageContainer); } - nsAutoTArray imageList; + AutoTArray imageList; RefPtr image = ClipToIntrinsicSize(); imageList.AppendElement(ImageContainer::NonOwningImage(image)); imageContainer->SetCurrentImages(imageList); diff --git a/dom/events/EventStateManager.cpp b/dom/events/EventStateManager.cpp index a324f80eb75..8b365157f43 100644 --- a/dom/events/EventStateManager.cpp +++ b/dom/events/EventStateManager.cpp @@ -731,7 +731,7 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext, if (modifierMask && (modifierMask == Prefs::ChromeAccessModifierMask() || modifierMask == Prefs::ContentAccessModifierMask())) { - nsAutoTArray accessCharCodes; + AutoTArray accessCharCodes; nsContentUtils::GetAccessKeyCandidates(keyEvent, accessCharCodes); if (HandleAccessKey(aPresContext, accessCharCodes, @@ -1291,7 +1291,7 @@ EventStateManager::HandleCrossProcessEvent(WidgetEvent* aEvent, // event to. // // NB: the elements of |targets| must be unique, for correctness. - nsAutoTArray, 1> targets; + AutoTArray, 1> targets; if (aEvent->mClass != eTouchEventClass || aEvent->mMessage == eTouchStart) { // If this event only has one target, and it's remote, add it to // the array. diff --git a/dom/events/TextComposition.h b/dom/events/TextComposition.h index f99da8ef09a..103d0b81e2c 100644 --- a/dom/events/TextComposition.h +++ b/dom/events/TextComposition.h @@ -429,7 +429,7 @@ private: */ class TextCompositionArray final : - public nsAutoTArray, 2> + public AutoTArray, 2> { public: // Looking for per native IME context. diff --git a/dom/fetch/FetchDriver.cpp b/dom/fetch/FetchDriver.cpp index c05823ed248..21bb9faba18 100644 --- a/dom/fetch/FetchDriver.cpp +++ b/dom/fetch/FetchDriver.cpp @@ -338,7 +338,7 @@ FetchDriver::HttpFetch() // nsCORSListenerProxy. We just inform it which unsafe headers are included // in the request. if (mRequest->Mode() == RequestMode::Cors) { - nsAutoTArray unsafeHeaders; + AutoTArray unsafeHeaders; mRequest->Headers()->GetUnsafeHeaders(unsafeHeaders); nsCOMPtr loadInfo = chan->GetLoadInfo(); loadInfo->SetCorsPreflightInfo(unsafeHeaders, false); @@ -709,7 +709,7 @@ FetchDriver::SetRequestHeaders(nsIHttpChannel* aChannel) const { MOZ_ASSERT(aChannel); - nsAutoTArray headers; + AutoTArray headers; mRequest->Headers()->GetEntries(headers); bool hasAccept = false; for (uint32_t i = 0; i < headers.Length(); ++i) { diff --git a/dom/fetch/InternalHeaders.cpp b/dom/fetch/InternalHeaders.cpp index fccc9fc18f0..e8d1a76e7df 100644 --- a/dom/fetch/InternalHeaders.cpp +++ b/dom/fetch/InternalHeaders.cpp @@ -309,7 +309,7 @@ InternalHeaders::CORSHeaders(InternalHeaders* aHeaders) aHeaders->Get(NS_LITERAL_CSTRING("Access-Control-Expose-Headers"), acExposedNames, result); MOZ_ASSERT(!result.Failed()); - nsAutoTArray exposeNamesArray; + AutoTArray exposeNamesArray; nsCCharSeparatedTokenizer exposeTokens(acExposedNames, ','); while (exposeTokens.hasMoreTokens()) { const nsDependentCSubstring& token = exposeTokens.nextToken(); diff --git a/dom/gamepad/linux/LinuxGamepad.cpp b/dom/gamepad/linux/LinuxGamepad.cpp index 420f277d880..7cc52ec53ed 100644 --- a/dom/gamepad/linux/LinuxGamepad.cpp +++ b/dom/gamepad/linux/LinuxGamepad.cpp @@ -77,7 +77,7 @@ private: struct udev_monitor* mMonitor; guint mMonitorSourceID; // Information about currently connected gamepads. - nsAutoTArray mGamepads; + AutoTArray mGamepads; }; // singleton instance diff --git a/dom/html/HTMLAllCollection.cpp b/dom/html/HTMLAllCollection.cpp index 098fd3ffcf2..ff0c0c2a661 100644 --- a/dom/html/HTMLAllCollection.cpp +++ b/dom/html/HTMLAllCollection.cpp @@ -173,7 +173,7 @@ HTMLAllCollection::GetSupportedNames(unsigned aFlags, nsTArray& aNames // XXXbz this is very similar to nsContentList::GetSupportedNames, // but has to check IsAllNamedElement for the name case. - nsAutoTArray atoms; + AutoTArray atoms; for (uint32_t i = 0; i < Length(); ++i) { nsIContent *content = Item(i); if (content->HasID()) { diff --git a/dom/html/HTMLOptionsCollection.cpp b/dom/html/HTMLOptionsCollection.cpp index b4611aaf497..1435706179b 100644 --- a/dom/html/HTMLOptionsCollection.cpp +++ b/dom/html/HTMLOptionsCollection.cpp @@ -287,7 +287,7 @@ HTMLOptionsCollection::GetSupportedNames(unsigned aFlags, return; } - nsAutoTArray atoms; + AutoTArray atoms; for (uint32_t i = 0; i < mElements.Length(); ++i) { HTMLOptionElement* content = mElements.ElementAt(i); if (content) { diff --git a/dom/html/TimeRanges.cpp b/dom/html/TimeRanges.cpp index c817b53e203..debb81a2fa9 100644 --- a/dom/html/TimeRanges.cpp +++ b/dom/html/TimeRanges.cpp @@ -112,7 +112,7 @@ void TimeRanges::Normalize(double aTolerance) { if (mRanges.Length() >= 2) { - nsAutoTArray normalized; + AutoTArray normalized; mRanges.Sort(CompareTimeRanges()); @@ -147,7 +147,7 @@ TimeRanges::Union(const TimeRanges* aOtherRanges, double aTolerance) void TimeRanges::Intersection(const TimeRanges* aOtherRanges) { - nsAutoTArray intersection; + AutoTArray intersection; const nsTArray& otherRanges = aOtherRanges->mRanges; for (index_type i = 0, j = 0; i < mRanges.Length() && j < otherRanges.Length();) { diff --git a/dom/html/TimeRanges.h b/dom/html/TimeRanges.h index 5e9bb6f0047..306fe3ff0b8 100644 --- a/dom/html/TimeRanges.h +++ b/dom/html/TimeRanges.h @@ -93,7 +93,7 @@ private: } }; - nsAutoTArray mRanges; + AutoTArray mRanges; nsCOMPtr mParent; diff --git a/dom/html/nsHTMLContentSink.cpp b/dom/html/nsHTMLContentSink.cpp index 3a3b1c43d87..5be802274ed 100644 --- a/dom/html/nsHTMLContentSink.cpp +++ b/dom/html/nsHTMLContentSink.cpp @@ -160,7 +160,7 @@ protected: RefPtr mBody; RefPtr mHead; - nsAutoTArray mContextStack; + AutoTArray mContextStack; SinkContext* mCurrentContext; SinkContext* mHeadContext; diff --git a/dom/indexedDB/ActorsParent.cpp b/dom/indexedDB/ActorsParent.cpp index 026580c7a52..12a03286d8e 100644 --- a/dom/indexedDB/ActorsParent.cpp +++ b/dom/indexedDB/ActorsParent.cpp @@ -16352,10 +16352,10 @@ QuotaClient::InitOrigin(PersistenceType aPersistenceType, // are database files then we need to cleanup stored files (if it's needed) // and also get the usage. - nsAutoTArray subdirsToProcess; + AutoTArray subdirsToProcess; nsTArray> unknownFiles; nsTHashtable validSubdirs(20); - nsAutoTArray initInfos; + AutoTArray initInfos; nsCOMPtr entries; rv = directory->GetDirectoryEntries(getter_AddRefs(entries)); @@ -18217,7 +18217,7 @@ DatabaseOperationBase::GetStructuredCloneReadInfoFromBlob( aInfo->mData.SwapElements(uncompressed); if (!aFileIds.IsVoid()) { - nsAutoTArray array; + AutoTArray array; nsresult rv = ConvertFileIdsToArray(aFileIds, array); if (NS_WARN_IF(NS_FAILED(rv))) { return rv; @@ -23344,7 +23344,7 @@ UpdateIndexDataValuesFunction::OnFunctionCall(mozIStorageValueArray* aValues, const IndexMetadata& metadata = mOp->mMetadata; const int64_t& objectStoreId = mOp->mObjectStoreId; - nsAutoTArray updateInfos; + AutoTArray updateInfos; rv = IDBObjectStore::AppendIndexUpdateInfo(metadata.id(), metadata.keyPath(), metadata.unique(), diff --git a/dom/indexedDB/IDBDatabase.cpp b/dom/indexedDB/IDBDatabase.cpp index e9fb101b58e..c7ec6ecd30f 100644 --- a/dom/indexedDB/IDBDatabase.cpp +++ b/dom/indexedDB/IDBDatabase.cpp @@ -667,7 +667,7 @@ IDBDatabase::Transaction(const StringOrStringSequence& aStoreNames, return NS_ERROR_DOM_INDEXEDDB_NOT_ALLOWED_ERR; } - nsAutoTArray stackSequence; + AutoTArray stackSequence; if (aStoreNames.IsString()) { stackSequence.AppendElement(aStoreNames.GetAsString()); @@ -848,8 +848,8 @@ IDBDatabase::AbortTransactions(bool aShouldWarn) class MOZ_STACK_CLASS Helper final { - typedef nsAutoTArray, 20> StrongTransactionArray; - typedef nsAutoTArray WeakTransactionArray; + typedef AutoTArray, 20> StrongTransactionArray; + typedef AutoTArray WeakTransactionArray; public: static void diff --git a/dom/indexedDB/Key.cpp b/dom/indexedDB/Key.cpp index fe3c8d4f1b1..c7fd28048c2 100644 --- a/dom/indexedDB/Key.cpp +++ b/dom/indexedDB/Key.cpp @@ -470,7 +470,7 @@ Key::EncodeLocaleString(const nsDependentString& aString, uint8_t aTypeOffset, } MOZ_ASSERT(collator); - nsAutoTArray keyBuffer; + AutoTArray keyBuffer; int32_t sortKeyLength = ucol_getSortKey(collator, ustr, length, keyBuffer.Elements(), keyBuffer.Length()); diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index 5cfaaddebd0..79c37ba4151 100644 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -607,7 +607,7 @@ ContentParentsMemoryReporter::CollectReports(nsIMemoryReporterCallback* cb, nsISupports* aClosure, bool aAnonymize) { - nsAutoTArray cps; + AutoTArray cps; ContentParent::GetAllEvenIfDead(cps); for (uint32_t i = 0; i < cps.Length(); i++) { @@ -911,7 +911,7 @@ ContentParent::JoinAllSubprocesses() { MOZ_ASSERT(NS_IsMainThread()); - nsAutoTArray processes; + AutoTArray processes; GetAll(processes); if (processes.IsEmpty()) { printf_stderr("There are no live subprocesses."); @@ -5145,7 +5145,7 @@ ContentParent::IgnoreIPCPrincipal() void ContentParent::NotifyUpdatedDictionaries() { - nsAutoTArray processes; + AutoTArray processes; GetAll(processes); nsCOMPtr spellChecker(do_GetService(NS_SPELLCHECKER_CONTRACTID)); diff --git a/dom/ipc/PreallocatedProcessManager.cpp b/dom/ipc/PreallocatedProcessManager.cpp index 8bce3dc1a32..46c12f65780 100644 --- a/dom/ipc/PreallocatedProcessManager.cpp +++ b/dom/ipc/PreallocatedProcessManager.cpp @@ -71,8 +71,8 @@ private: CancelableTask* mPreallocateAppProcessTask; // The array containing the preallocated processes. 4 as the inline storage size - // should be enough so we don't need to grow the nsAutoTArray. - nsAutoTArray, 4> mSpareProcesses; + // should be enough so we don't need to grow the AutoTArray. + AutoTArray, 4> mSpareProcesses; // Nuwa process is ready for creating new process. bool mIsNuwaReady; diff --git a/dom/ipc/TabChild.h b/dom/ipc/TabChild.h index b403e39d2a8..42af6977f05 100644 --- a/dom/ipc/TabChild.h +++ b/dom/ipc/TabChild.h @@ -706,7 +706,7 @@ private: // Whether we have already received a FileDescriptor for the app package. bool mAppPackageFileDescriptorRecved; // At present only 1 of these is really expected. - nsAutoTArray, 1> + AutoTArray, 1> mCachedFileDescriptorInfos; nscolor mLastBackgroundColor; bool mDidFakeShow; @@ -734,7 +734,7 @@ private: CSSSize mUnscaledInnerSize; bool mDidSetRealShowInfo; - nsAutoTArray mAudioChannelsActive; + AutoTArray mAudioChannelsActive; DISALLOW_EVIL_CONSTRUCTORS(TabChild); }; diff --git a/dom/media/AudioCaptureStream.cpp b/dom/media/AudioCaptureStream.cpp index 459d1cba81e..5d192d8320f 100644 --- a/dom/media/AudioCaptureStream.cpp +++ b/dom/media/AudioCaptureStream.cpp @@ -102,8 +102,8 @@ AudioCaptureStream::MixerCallback(AudioDataValue* aMixedBuffer, AudioSampleFormat aFormat, uint32_t aChannels, uint32_t aFrames, uint32_t aSampleRate) { - nsAutoTArray, MONO> output; - nsAutoTArray bufferPtrs; + AutoTArray, MONO> output; + AutoTArray bufferPtrs; output.SetLength(MONO); bufferPtrs.SetLength(MONO); diff --git a/dom/media/AudioSegment.cpp b/dom/media/AudioSegment.cpp index 56a4f46cf37..1f242157323 100644 --- a/dom/media/AudioSegment.cpp +++ b/dom/media/AudioSegment.cpp @@ -85,9 +85,9 @@ void AudioSegment::Mix(AudioMixer& aMixer, uint32_t aOutputChannels, uint32_t aSampleRate) { - nsAutoTArray + AutoTArray buf; - nsAutoTArray channelData; + AutoTArray channelData; uint32_t offsetSamples = 0; uint32_t duration = GetDuration(); @@ -132,7 +132,7 @@ AudioSegment::Mix(AudioMixer& aMixer, uint32_t aOutputChannels, MOZ_ASSERT(channelData.Length() == aOutputChannels); } else if (channelData.Length() > aOutputChannels) { // Down mix. - nsAutoTArray outChannelPtrs; + AutoTArray outChannelPtrs; outChannelPtrs.SetLength(aOutputChannels); uint32_t offsetSamples = 0; for (uint32_t channel = 0; channel < aOutputChannels; channel++) { @@ -166,7 +166,7 @@ AudioSegment::Mix(AudioMixer& aMixer, uint32_t aOutputChannels, void AudioSegment::WriteTo(uint64_t aID, AudioMixer& aMixer, uint32_t aOutputChannels, uint32_t aSampleRate) { - nsAutoTArray buf; + AutoTArray buf; // Offset in the buffer that will be written to the mixer, in samples. uint32_t offset = 0; diff --git a/dom/media/AudioSegment.h b/dom/media/AudioSegment.h index e2880dadc37..252b7e5747c 100644 --- a/dom/media/AudioSegment.h +++ b/dom/media/AudioSegment.h @@ -118,8 +118,8 @@ DownmixAndInterleave(const nsTArray& aChannelData, InterleaveAndConvertBuffer(aChannelData.Elements(), aDuration, aVolume, aOutputChannels, aOutput); } else { - nsAutoTArray outputChannelData; - nsAutoTArray outputBuffers; + AutoTArray outputChannelData; + AutoTArray outputBuffers; outputChannelData.SetLength(aOutputChannels); outputBuffers.SetLength(aDuration * aOutputChannels); for (uint32_t i = 0; i < aOutputChannels; i++) { @@ -254,8 +254,8 @@ public: #endif for (ChunkIterator ci(*this); !ci.IsEnded(); ci.Next()) { - nsAutoTArray, GUESS_AUDIO_CHANNELS> output; - nsAutoTArray bufferPtrs; + AutoTArray, GUESS_AUDIO_CHANNELS> output; + AutoTArray bufferPtrs; AudioChunk& c = *ci; // If this chunk is null, don't bother resampling, just alter its duration if (c.IsNull()) { @@ -395,7 +395,7 @@ void WriteChunk(AudioChunk& aChunk, uint32_t aOutputChannels, AudioDataValue* aOutputBuffer) { - nsAutoTArray channelData; + AutoTArray channelData; channelData = aChunk.ChannelData(); diff --git a/dom/media/AudioStream.cpp b/dom/media/AudioStream.cpp index 087a0b5a474..4290669caab 100644 --- a/dom/media/AudioStream.cpp +++ b/dom/media/AudioStream.cpp @@ -113,7 +113,7 @@ public: } } private: - nsAutoTArray mChunks; + AutoTArray mChunks; int64_t mBaseOffset; double mBasePosition; }; @@ -287,7 +287,7 @@ WriteDumpFile(FILE* aDumpFile, AudioStream* aStream, uint32_t aFrames, } NS_ASSERTION(AUDIO_OUTPUT_FORMAT == AUDIO_FORMAT_FLOAT32, "bad format"); - nsAutoTArray buf; + AutoTArray buf; buf.SetLength(samples*2); float* input = static_cast(aBuffer); uint8_t* output = buf.Elements(); @@ -616,7 +616,7 @@ AudioStream::GetTimeStretched(AudioBufferWriter& aWriter) mTimeStretcher->putSamples(c->Data(), c->Frames()); } else { // Write silence if downmixing fails. - nsAutoTArray buf; + AutoTArray buf; buf.SetLength(mOutChannels * c->Frames()); memset(buf.Elements(), 0, buf.Length() * sizeof(AudioDataValue)); mTimeStretcher->putSamples(buf.Elements(), c->Frames()); diff --git a/dom/media/DOMMediaStream.h b/dom/media/DOMMediaStream.h index 03d622242ae..ffb30b13d5b 100644 --- a/dom/media/DOMMediaStream.h +++ b/dom/media/DOMMediaStream.h @@ -583,10 +583,10 @@ protected: RefPtr mPlaybackPort; // MediaStreamTracks corresponding to tracks in our mOwnedStream. - nsAutoTArray, 2> mOwnedTracks; + AutoTArray, 2> mOwnedTracks; // MediaStreamTracks corresponding to tracks in our mPlaybackStream. - nsAutoTArray, 2> mTracks; + AutoTArray, 2> mTracks; RefPtr mOwnedListener; RefPtr mPlaybackListener; diff --git a/dom/media/FileBlockCache.h b/dom/media/FileBlockCache.h index a32bfb638a2..58ac3942277 100644 --- a/dom/media/FileBlockCache.h +++ b/dom/media/FileBlockCache.h @@ -202,7 +202,7 @@ private: // main thread). nsCOMPtr mThread; // Queue of pending block indexes that need to be written or moved. - //nsAutoTArray mChangeIndexList; + //AutoTArray mChangeIndexList; Int32Queue mChangeIndexList; // True if we've dispatched an event to commit all pending block changes // to file on mThread. diff --git a/dom/media/GraphDriver.cpp b/dom/media/GraphDriver.cpp index 24532b6432f..82325f6bdf4 100644 --- a/dom/media/GraphDriver.cpp +++ b/dom/media/GraphDriver.cpp @@ -1098,7 +1098,7 @@ AudioCallbackDriver::EnqueueStreamAndPromiseForOperation(MediaStream* aStream, void AudioCallbackDriver::CompleteAudioContextOperations(AsyncCubebOperation aOperation) { - nsAutoTArray array; + AutoTArray array; // We can't lock for the whole function because AudioContextOperationCompleted // will grab the monitor diff --git a/dom/media/GraphDriver.h b/dom/media/GraphDriver.h index 319bdda05c8..b079f8cce8b 100644 --- a/dom/media/GraphDriver.h +++ b/dom/media/GraphDriver.h @@ -519,7 +519,7 @@ private: * shutdown of the audio stream. */ nsCOMPtr mInitShutdownThread; /* This must be accessed with the graph monitor held. */ - nsAutoTArray mPromisesForOperation; + AutoTArray mPromisesForOperation; /* This is set during initialization, and can be read safely afterwards. */ dom::AudioChannel mAudioChannel; /* Used to queue us to add the mixer callback on first run. */ diff --git a/dom/media/Intervals.h b/dom/media/Intervals.h index fa3ea2ed08e..4e0cbf161ff 100644 --- a/dom/media/Intervals.h +++ b/dom/media/Intervals.h @@ -255,7 +255,7 @@ class IntervalSet public: typedef IntervalSet SelfType; typedef Interval ElemType; - typedef nsAutoTArray ContainerType; + typedef AutoTArray ContainerType; typedef typename ContainerType::index_type IndexType; IntervalSet() diff --git a/dom/media/MediaCache.cpp b/dom/media/MediaCache.cpp index a9c76e7621b..0ee735272e4 100644 --- a/dom/media/MediaCache.cpp +++ b/dom/media/MediaCache.cpp @@ -794,7 +794,7 @@ MediaCache::FindReusableBlock(TimeStamp aNow, // predicted time of next use". We can exploit the fact that the block // linked lists are ordered by increasing time of next use. This is // actually the whole point of having the linked lists. - nsAutoTArray candidates; + AutoTArray candidates; for (uint32_t i = 0; i < mStreams.Length(); ++i) { MediaCacheStream* stream = mStreams[i]; if (stream->mPinCount > 0) { @@ -1040,7 +1040,7 @@ MediaCache::Update() // decisions while holding the cache lock but implement those decisions // without holding the cache lock, since we need to call out to // stream, decoder and element code. - nsAutoTArray actions; + AutoTArray actions; { ReentrantMonitorAutoEnter mon(mReentrantMonitor); diff --git a/dom/media/MediaStreamGraph.cpp b/dom/media/MediaStreamGraph.cpp index f245979d046..4c3e7824ee9 100644 --- a/dom/media/MediaStreamGraph.cpp +++ b/dom/media/MediaStreamGraph.cpp @@ -606,7 +606,7 @@ MediaStreamGraphImpl::CreateOrDestroyAudioStreams(MediaStream* aStream) STREAM_LOG(LogLevel::Debug, ("Updating AudioOutputStreams for MediaStream %p", aStream)); - nsAutoTArray audioOutputStreamsFound; + AutoTArray audioOutputStreamsFound; for (uint32_t i = 0; i < aStream->mAudioOutputStreams.Length(); ++i) { audioOutputStreamsFound.AppendElement(false); } @@ -791,7 +791,7 @@ MediaStreamGraphImpl::PlayVideo(MediaStream* aStream) TimeStamp currentTimeStamp = CurrentDriver()->GetCurrentTimeStamp(); // Collect any new frames produced in this iteration. - nsAutoTArray newImages; + AutoTArray newImages; RefPtr blackImage; MOZ_ASSERT(mProcessedTime >= aStream->mBufferStartTime, "frame position before buffer?"); @@ -861,14 +861,14 @@ MediaStreamGraphImpl::PlayVideo(MediaStream* aStream) if (!aStream->mLastPlayedVideoFrame.GetImage()) return; - nsAutoTArray images; + AutoTArray images; bool haveMultipleImages = false; for (uint32_t i = 0; i < aStream->mVideoOutputs.Length(); ++i) { VideoFrameContainer* output = aStream->mVideoOutputs[i]; // Find previous frames that may still be valid. - nsAutoTArray previousImages; + AutoTArray previousImages; output->GetImageContainer()->GetCurrentImages(&previousImages); uint32_t j = previousImages.Length(); if (j) { diff --git a/dom/media/TrackUnionStream.cpp b/dom/media/TrackUnionStream.cpp index 9325641970a..06ff80b5136 100644 --- a/dom/media/TrackUnionStream.cpp +++ b/dom/media/TrackUnionStream.cpp @@ -67,8 +67,8 @@ TrackUnionStream::TrackUnionStream(DOMMediaStream* aWrapper) : if (IsFinishedOnGraphThread()) { return; } - nsAutoTArray mappedTracksFinished; - nsAutoTArray mappedTracksWithMatchingInputTracks; + AutoTArray mappedTracksFinished; + AutoTArray mappedTracksWithMatchingInputTracks; for (uint32_t i = 0; i < mTrackMap.Length(); ++i) { mappedTracksFinished.AppendElement(true); mappedTracksWithMatchingInputTracks.AppendElement(false); diff --git a/dom/media/VideoFrameContainer.cpp b/dom/media/VideoFrameContainer.cpp index 2ece19ad2cb..e5a172e0ced 100644 --- a/dom/media/VideoFrameContainer.cpp +++ b/dom/media/VideoFrameContainer.cpp @@ -35,7 +35,7 @@ void VideoFrameContainer::SetCurrentFrame(const gfx::IntSize& aIntrinsicSize, { if (aImage) { MutexAutoLock lock(mMutex); - nsAutoTArray imageList; + AutoTArray imageList; imageList.AppendElement( ImageContainer::NonOwningImage(aImage, aTargetTime, ++mFrameID)); SetCurrentFramesLocked(aIntrinsicSize, imageList); diff --git a/dom/media/encoder/OpusTrackEncoder.cpp b/dom/media/encoder/OpusTrackEncoder.cpp index 33d96ab6205..3785d7f06d7 100644 --- a/dom/media/encoder/OpusTrackEncoder.cpp +++ b/dom/media/encoder/OpusTrackEncoder.cpp @@ -313,7 +313,7 @@ OpusTrackEncoder::GetEncodedTrack(EncodedFrameContainer& aData) } // Start encoding data. - nsAutoTArray pcm; + AutoTArray pcm; pcm.SetLength(GetPacketDuration() * mChannels); AudioSegment::ChunkIterator iter(mSourceSegment); int frameCopied = 0; @@ -344,7 +344,7 @@ OpusTrackEncoder::GetEncodedTrack(EncodedFrameContainer& aData) audiodata->SetFrameType(EncodedFrame::OPUS_AUDIO_FRAME); int framesInPCM = frameCopied; if (mResampler) { - nsAutoTArray resamplingDest; + AutoTArray resamplingDest; // We want to consume all the input data, so we slightly oversize the // resampled data buffer so we can fit the output data in. We cannot really // predict the output frame count at each call. diff --git a/dom/media/encoder/TrackEncoder.cpp b/dom/media/encoder/TrackEncoder.cpp index 0e2cc7610ad..6fbceea8c3e 100644 --- a/dom/media/encoder/TrackEncoder.cpp +++ b/dom/media/encoder/TrackEncoder.cpp @@ -140,7 +140,7 @@ AudioTrackEncoder::InterleaveTrackData(AudioChunk& aChunk, { switch(aChunk.mBufferFormat) { case AUDIO_FORMAT_S16: { - nsAutoTArray array; + AutoTArray array; array.SetLength(aOutputChannels); for (uint32_t i = 0; i < array.Length(); i++) { array[i] = static_cast(aChunk.mChannelData[i]); @@ -149,7 +149,7 @@ AudioTrackEncoder::InterleaveTrackData(AudioChunk& aChunk, break; } case AUDIO_FORMAT_FLOAT32: { - nsAutoTArray array; + AutoTArray array; array.SetLength(aOutputChannels); for (uint32_t i = 0; i < array.Length(); i++) { array[i] = static_cast(aChunk.mChannelData[i]); diff --git a/dom/media/encoder/VorbisTrackEncoder.cpp b/dom/media/encoder/VorbisTrackEncoder.cpp index 0899ee8c744..d53228631cc 100644 --- a/dom/media/encoder/VorbisTrackEncoder.cpp +++ b/dom/media/encoder/VorbisTrackEncoder.cpp @@ -202,8 +202,8 @@ VorbisTrackEncoder::GetEncodedTrack(EncodedFrameContainer& aData) vorbis_analysis_buffer(&mVorbisDsp, (int)sourceSegment->GetDuration()); int framesCopied = 0; - nsAutoTArray interleavedPcm; - nsAutoTArray nonInterleavedPcm; + AutoTArray interleavedPcm; + AutoTArray nonInterleavedPcm; interleavedPcm.SetLength(sourceSegment->GetDuration() * mChannels); nonInterleavedPcm.SetLength(sourceSegment->GetDuration() * mChannels); while (!iter.IsEnded()) { diff --git a/dom/media/gmp/GMPDecryptorChild.cpp b/dom/media/gmp/GMPDecryptorChild.cpp index 0df7da8d9c5..aec5078e45b 100644 --- a/dom/media/gmp/GMPDecryptorChild.cpp +++ b/dom/media/gmp/GMPDecryptorChild.cpp @@ -157,7 +157,7 @@ GMPDecryptorChild::KeyStatusChanged(const char* aSessionId, uint32_t aKeyIdLength, GMPMediaKeyStatus aStatus) { - nsAutoTArray kid; + AutoTArray kid; kid.AppendElements(aKeyId, aKeyIdLength); CALL_ON_GMP_THREAD(SendKeyStatusChanged, nsCString(aSessionId, aSessionIdLength), kid, diff --git a/dom/media/gtest/TestVorbisTrackEncoder.cpp b/dom/media/gtest/TestVorbisTrackEncoder.cpp index 4f16519364a..9166afcf5b1 100644 --- a/dom/media/gtest/TestVorbisTrackEncoder.cpp +++ b/dom/media/gtest/TestVorbisTrackEncoder.cpp @@ -183,7 +183,7 @@ TEST(VorbisTrackEncoder, EncodedFrame) for (int i = 0; i < rate; i++) { data[i] = ((i%8)*4000) - (7*4000)/2; } - nsAutoTArray channelData; + AutoTArray channelData; channelData.AppendElement(data); AudioSegment segment; segment.AppendFrames(samples.forget(), channelData, 44100); diff --git a/dom/media/mediasink/DecodedStream.cpp b/dom/media/mediasink/DecodedStream.cpp index 687994ad023..aced1eec833 100644 --- a/dom/media/mediasink/DecodedStream.cpp +++ b/dom/media/mediasink/DecodedStream.cpp @@ -500,7 +500,7 @@ SendStreamAudio(DecodedStreamData* aStream, int64_t aStartTime, audio->EnsureAudioBuffer(); RefPtr buffer = audio->mAudioBuffer; AudioDataValue* bufferData = static_cast(buffer->Data()); - nsAutoTArray channels; + AutoTArray channels; for (uint32_t i = 0; i < audio->mChannels; ++i) { channels.AppendElement(bufferData + i * audio->mFrames); } @@ -522,7 +522,7 @@ DecodedStream::SendAudio(double aVolume, bool aIsSameOrigin) AudioSegment output; uint32_t rate = mInfo.mAudio.mRate; - nsAutoTArray,10> audio; + AutoTArray,10> audio; TrackID audioTrackId = mInfo.mAudio.mTrackId; SourceMediaStream* sourceStream = mData->mStream; @@ -587,7 +587,7 @@ DecodedStream::SendVideo(bool aIsSameOrigin) VideoSegment output; TrackID videoTrackId = mInfo.mVideo.mTrackId; - nsAutoTArray, 10> video; + AutoTArray, 10> video; SourceMediaStream* sourceStream = mData->mStream; // It's OK to hold references to the VideoData because VideoData diff --git a/dom/media/mediasink/VideoSink.cpp b/dom/media/mediasink/VideoSink.cpp index 5fa85d65833..e12ad7ad18f 100644 --- a/dom/media/mediasink/VideoSink.cpp +++ b/dom/media/mediasink/VideoSink.cpp @@ -314,13 +314,13 @@ VideoSink::RenderVideoFrames(int32_t aMaxFrames, { AssertOwnerThread(); - nsAutoTArray,16> frames; + AutoTArray,16> frames; VideoQueue().GetFirstElements(aMaxFrames, &frames); if (frames.IsEmpty() || !mContainer) { return; } - nsAutoTArray images; + AutoTArray images; TimeStamp lastFrameTime; MediaSink::PlaybackParams params = mAudioSink->GetPlaybackParams(); for (uint32_t i = 0; i < frames.Length(); ++i) { diff --git a/dom/media/ogg/OggReader.cpp b/dom/media/ogg/OggReader.cpp index 31204fc3925..e00d40fa72b 100644 --- a/dom/media/ogg/OggReader.cpp +++ b/dom/media/ogg/OggReader.cpp @@ -296,7 +296,7 @@ void OggReader::SetupTargetSkeleton(SkeletonState* aSkeletonState) } else if (ReadHeaders(aSkeletonState) && aSkeletonState->HasIndex()) { // Extract the duration info out of the index, so we don't need to seek to // the end of resource to get it. - nsAutoTArray tracks; + AutoTArray tracks; BuildSerialList(tracks); int64_t duration = 0; if (NS_SUCCEEDED(aSkeletonState->GetDuration(tracks, duration))) { @@ -395,7 +395,7 @@ nsresult OggReader::ReadMetadata(MediaInfo* aInfo, *aTags = nullptr; ogg_page page; - nsAutoTArray bitstreams; + AutoTArray bitstreams; nsTArray serials; bool readAllBOS = false; while (!readAllBOS) { @@ -1254,7 +1254,7 @@ OggReader::IndexedSeekResult OggReader::SeekToKeyframeUsingIndex(int64_t aTarget return SEEK_INDEX_FAIL; } // We have an index from the Skeleton track, try to use it to seek. - nsAutoTArray tracks; + AutoTArray tracks; BuildSerialList(tracks); SkeletonState::nsSeekTarget keyframe; if (NS_FAILED(mSkeletonState->IndexedSeekTarget(aTarget, @@ -1449,7 +1449,7 @@ nsresult OggReader::SeekInternal(int64_t aTarget, int64_t aEndTime) // No index or other non-fatal index-related failure. Try to seek // using a bisection search. Determine the already downloaded data // in the media cache, so we can try to seek in the cached data first. - nsAutoTArray ranges; + AutoTArray ranges; res = GetSeekRanges(ranges); NS_ENSURE_SUCCESS(res,res); diff --git a/dom/media/omx/OMXCodecWrapper.cpp b/dom/media/omx/OMXCodecWrapper.cpp index 08892213750..b6e3f566bab 100644 --- a/dom/media/omx/OMXCodecWrapper.cpp +++ b/dom/media/omx/OMXCodecWrapper.cpp @@ -751,7 +751,7 @@ public: UpdateAfterSendChunk(chunkSamples, bytesCopied, aSamplesRead); } else { // Interleave data to a temporary buffer. - nsAutoTArray pcm; + AutoTArray pcm; pcm.SetLength(bytesToCopy); AudioDataValue* interleavedSource = pcm.Elements(); AudioTrackEncoder::InterleaveTrackData(aChunk, chunkSamples, @@ -853,7 +853,7 @@ private: * mOMXAEncoder.mChannels * sizeof(AudioDataValue); uint32_t dstSamplesCopied = aSamplesNum; if (mOMXAEncoder.mResampler) { - nsAutoTArray pcm; + AutoTArray pcm; pcm.SetLength(bytesToCopy); AudioTrackEncoder::InterleaveTrackData(aSource, aSamplesNum, mOMXAEncoder.mChannels, diff --git a/dom/media/platforms/agnostic/VorbisDecoder.cpp b/dom/media/platforms/agnostic/VorbisDecoder.cpp index c51c03d5a1b..50906e442c5 100644 --- a/dom/media/platforms/agnostic/VorbisDecoder.cpp +++ b/dom/media/platforms/agnostic/VorbisDecoder.cpp @@ -71,8 +71,8 @@ VorbisDataDecoder::Init() PodZero(&mVorbisDsp); PodZero(&mVorbisBlock); - nsAutoTArray headers; - nsAutoTArray headerLens; + AutoTArray headers; + AutoTArray headerLens; if (!XiphExtradataToHeaders(headers, headerLens, mInfo.mCodecSpecificConfig->Elements(), mInfo.mCodecSpecificConfig->Length())) { diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h index 7f3896b210d..91a6e38ec6e 100644 --- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h +++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.h @@ -123,7 +123,7 @@ private: } private: - nsAutoTArray mMap; + AutoTArray mMap; }; DurationMap mDurationMap; diff --git a/dom/media/systemservices/MediaUtils.h b/dom/media/systemservices/MediaUtils.h index bde0c913fae..dad43bd3499 100644 --- a/dom/media/systemservices/MediaUtils.h +++ b/dom/media/systemservices/MediaUtils.h @@ -321,7 +321,7 @@ private: static uint32_t counter = 0; return ++counter; }; - nsAutoTArray mElements; + AutoTArray mElements; }; /* media::Refcountable - Add threadsafe ref-counting to something that isn't. diff --git a/dom/media/webaudio/AudioBuffer.h b/dom/media/webaudio/AudioBuffer.h index ee462668f80..abb430d7fef 100644 --- a/dom/media/webaudio/AudioBuffer.h +++ b/dom/media/webaudio/AudioBuffer.h @@ -119,7 +119,7 @@ protected: nsWeakPtr mOwnerWindow; // Float32Arrays - nsAutoTArray, 2> mJSChannels; + AutoTArray, 2> mJSChannels; // mSharedChannels aggregates the data from mJSChannels. This is non-null // if and only if the mJSChannels' buffers are detached. diff --git a/dom/media/webaudio/AudioNodeEngine.h b/dom/media/webaudio/AudioNodeEngine.h index 51e64f7f593..58a9f962121 100644 --- a/dom/media/webaudio/AudioNodeEngine.h +++ b/dom/media/webaudio/AudioNodeEngine.h @@ -128,7 +128,7 @@ public: } private: - nsAutoTArray mContents; + AutoTArray mContents; }; /** @@ -253,7 +253,7 @@ class AudioNodeEngine { public: // This should be compatible with AudioNodeStream::OutputChunks. - typedef nsAutoTArray OutputChunks; + typedef AutoTArray OutputChunks; explicit AudioNodeEngine(dom::AudioNode* aNode) : mNode(aNode) diff --git a/dom/media/webaudio/AudioNodeExternalInputStream.cpp b/dom/media/webaudio/AudioNodeExternalInputStream.cpp index 3ebf9e48798..f7814774a1a 100644 --- a/dom/media/webaudio/AudioNodeExternalInputStream.cpp +++ b/dom/media/webaudio/AudioNodeExternalInputStream.cpp @@ -49,7 +49,7 @@ CopyChunkToBlock(AudioChunk& aInput, AudioBlock *aBlock, uint32_t aOffsetInBlock) { uint32_t blockChannels = aBlock->ChannelCount(); - nsAutoTArray channels; + AutoTArray channels; if (aInput.IsNull()) { channels.SetLength(blockChannels); PodZero(channels.Elements(), blockChannels); @@ -137,7 +137,7 @@ AudioNodeExternalInputStream::ProcessInput(GraphTime aFrom, GraphTime aTo, MOZ_ASSERT(mInputs.Length() == 1); MediaStream* source = mInputs[0]->GetSource(); - nsAutoTArray audioSegments; + AutoTArray audioSegments; uint32_t inputChannels = 0; for (StreamBuffer::TrackIter tracks(source->mBuffer, MediaSegment::AUDIO); !tracks.IsEnded(); tracks.Next()) { @@ -192,7 +192,7 @@ AudioNodeExternalInputStream::ProcessInput(GraphTime aFrom, GraphTime aTo, uint32_t accumulateIndex = 0; if (inputChannels) { - nsAutoTArray downmixBuffer; + AutoTArray downmixBuffer; for (uint32_t i = 0; i < audioSegments.Length(); ++i) { AudioBlock tmpChunk; ConvertSegmentToAudioBlock(&audioSegments[i], &tmpChunk, inputChannels); diff --git a/dom/media/webaudio/AudioNodeStream.cpp b/dom/media/webaudio/AudioNodeStream.cpp index 08c9f1a5a7e..9f0b5b665de 100644 --- a/dom/media/webaudio/AudioNodeStream.cpp +++ b/dom/media/webaudio/AudioNodeStream.cpp @@ -408,7 +408,7 @@ AudioNodeStream::ObtainInputBlock(AudioBlock& aTmpChunk, { uint32_t inputCount = mInputs.Length(); uint32_t outputChannelCount = 1; - nsAutoTArray inputChunks; + AutoTArray inputChunks; for (uint32_t i = 0; i < inputCount; ++i) { if (aPortIndex != mInputs[i]->InputNumber()) { // This input is connected to a different port @@ -454,7 +454,7 @@ AudioNodeStream::ObtainInputBlock(AudioBlock& aTmpChunk, aTmpChunk.AllocateChannels(outputChannelCount); // The static storage here should be 1KB, so it's fine - nsAutoTArray downmixBuffer; + AutoTArray downmixBuffer; for (uint32_t i = 0; i < inputChunkCount; ++i) { AccumulateInputChunk(i, *inputChunks[i], &aTmpChunk, &downmixBuffer); @@ -467,7 +467,7 @@ AudioNodeStream::AccumulateInputChunk(uint32_t aInputIndex, AudioBlock* aBlock, nsTArray* aDownmixBuffer) { - nsAutoTArray channels; + AutoTArray channels; UpMixDownMixChunk(&aChunk, aBlock->ChannelCount(), channels, *aDownmixBuffer); for (uint32_t c = 0; c < channels.Length(); ++c) { @@ -509,7 +509,7 @@ AudioNodeStream::UpMixDownMixChunk(const AudioBlock* aChunk, } } else if (aOutputChannels.Length() > aOutputChannelCount) { if (mChannelInterpretation == ChannelInterpretation::Speakers) { - nsAutoTArray outputChannels; + AutoTArray outputChannels; outputChannels.SetLength(aOutputChannelCount); aDownmixBuffer.SetLength(aOutputChannelCount * WEBAUDIO_BLOCK_SIZE); for (uint32_t j = 0; j < aOutputChannelCount; ++j) { diff --git a/dom/media/webaudio/AudioNodeStream.h b/dom/media/webaudio/AudioNodeStream.h index f0832e072ba..2882578c350 100644 --- a/dom/media/webaudio/AudioNodeStream.h +++ b/dom/media/webaudio/AudioNodeStream.h @@ -41,7 +41,7 @@ public: enum { AUDIO_TRACK = 1 }; - typedef nsAutoTArray OutputChunks; + typedef AutoTArray OutputChunks; // Flags re main thread updates and stream output. typedef unsigned Flags; diff --git a/dom/media/webaudio/DelayBuffer.h b/dom/media/webaudio/DelayBuffer.h index 6109e038f23..e55d0ba83a5 100644 --- a/dom/media/webaudio/DelayBuffer.h +++ b/dom/media/webaudio/DelayBuffer.h @@ -94,7 +94,7 @@ private: // Circular buffer for capturing delayed samples. FallibleTArray mChunks; // Cache upmixed channel arrays. - nsAutoTArray mUpmixChannels; + AutoTArray mUpmixChannels; double mSmoothingRate; // Current delay, in fractional ticks double mCurrentDelay; diff --git a/dom/media/webaudio/WebAudioUtils.cpp b/dom/media/webaudio/WebAudioUtils.cpp index d9e21f35c30..db9fbc38469 100644 --- a/dom/media/webaudio/WebAudioUtils.cpp +++ b/dom/media/webaudio/WebAudioUtils.cpp @@ -36,8 +36,8 @@ WebAudioUtils::SpeexResamplerProcess(SpeexResamplerState* aResampler, float* aOut, uint32_t* aOutLen) { #ifdef MOZ_SAMPLE_TYPE_S16 - nsAutoTArray tmp1; - nsAutoTArray tmp2; + AutoTArray tmp1; + AutoTArray tmp2; tmp1.SetLength(*aInLen); tmp2.SetLength(*aOutLen); ConvertAudioSamples(aIn, tmp1.Elements(), *aInLen); @@ -55,7 +55,7 @@ WebAudioUtils::SpeexResamplerProcess(SpeexResamplerState* aResampler, const int16_t* aIn, uint32_t* aInLen, float* aOut, uint32_t* aOutLen) { - nsAutoTArray tmp; + AutoTArray tmp; #ifdef MOZ_SAMPLE_TYPE_S16 tmp.SetLength(*aOutLen); int result = speex_resampler_process_int(aResampler, aChannel, aIn, aInLen, tmp.Elements(), aOutLen); @@ -78,8 +78,8 @@ WebAudioUtils::SpeexResamplerProcess(SpeexResamplerState* aResampler, #ifdef MOZ_SAMPLE_TYPE_S16 return speex_resampler_process_int(aResampler, aChannel, aIn, aInLen, aOut, aOutLen); #else - nsAutoTArray tmp1; - nsAutoTArray tmp2; + AutoTArray tmp1; + AutoTArray tmp2; tmp1.SetLength(*aInLen); tmp2.SetLength(*aOutLen); ConvertAudioSamples(aIn, tmp1.Elements(), *aInLen); diff --git a/dom/media/webaudio/blink/HRTFElevation.cpp b/dom/media/webaudio/blink/HRTFElevation.cpp index c6e04308859..2300872f3ab 100644 --- a/dom/media/webaudio/blink/HRTFElevation.cpp +++ b/dom/media/webaudio/blink/HRTFElevation.cpp @@ -128,7 +128,7 @@ nsReturnRef HRTFElevation::calculateKernelForAzimuthElevation(int az // Note that depending on the fftSize returned by the panner, we may be truncating the impulse response. const size_t resampledResponseLength = fftSizeForSampleRate(sampleRate) / 2; - nsAutoTArray resampled; + AutoTArray resampled; if (sampleRate == rawSampleRate) { resampledResponse = response; MOZ_ASSERT(resampledResponseLength == ResponseFrameSize); @@ -163,7 +163,7 @@ nsReturnRef HRTFElevation::calculateKernelForAzimuthElevation(int az } #ifdef MOZ_SAMPLE_TYPE_S16 - nsAutoTArray floatArray; + AutoTArray floatArray; floatArray.SetLength(resampledResponseLength); float *floatResponse = floatArray.Elements(); ConvertAudioSamples(resampledResponse, diff --git a/dom/media/webaudio/blink/Reverb.cpp b/dom/media/webaudio/blink/Reverb.cpp index 39f9d59c935..4fca0822b6a 100644 --- a/dom/media/webaudio/blink/Reverb.cpp +++ b/dom/media/webaudio/blink/Reverb.cpp @@ -81,11 +81,11 @@ Reverb::Reverb(ThreadSharedFloatArrayBufferList* impulseResponse, size_t impulse { float scale = 1; - nsAutoTArray irChannels; + AutoTArray irChannels; for (size_t i = 0; i < impulseResponse->GetChannels(); ++i) { irChannels.AppendElement(impulseResponse->GetData(i)); } - nsAutoTArray tempBuf; + AutoTArray tempBuf; if (normalize) { scale = calculateNormalizationScale(impulseResponse, impulseResponseBufferLength, sampleRate); diff --git a/dom/media/webm/WebMDemuxer.cpp b/dom/media/webm/WebMDemuxer.cpp index 4cf3fe57d42..ebc582bda99 100644 --- a/dom/media/webm/WebMDemuxer.cpp +++ b/dom/media/webm/WebMDemuxer.cpp @@ -389,8 +389,8 @@ WebMDemuxer::ReadMetadata() return NS_ERROR_FAILURE; } - nsAutoTArray headers; - nsAutoTArray headerLens; + AutoTArray headers; + AutoTArray headerLens; for (uint32_t header = 0; header < nheaders; ++header) { unsigned char* data = 0; size_t length = 0; diff --git a/dom/media/webrtc/MediaEngineDefault.cpp b/dom/media/webrtc/MediaEngineDefault.cpp index 9f7d272b87b..93710f97721 100644 --- a/dom/media/webrtc/MediaEngineDefault.cpp +++ b/dom/media/webrtc/MediaEngineDefault.cpp @@ -510,7 +510,7 @@ MediaEngineDefaultAudioSource::AppendToSegment(AudioSegment& aSegment, int16_t* dest = static_cast(buffer->Data()); mSineGenerator->generate(dest, aSamples); - nsAutoTArray channels; + AutoTArray channels; channels.AppendElement(dest); aSegment.AppendFrames(buffer.forget(), channels, aSamples); } diff --git a/dom/media/webrtc/MediaEngineWebRTCAudio.cpp b/dom/media/webrtc/MediaEngineWebRTCAudio.cpp index 4b826650093..10a4c93414b 100644 --- a/dom/media/webrtc/MediaEngineWebRTCAudio.cpp +++ b/dom/media/webrtc/MediaEngineWebRTCAudio.cpp @@ -639,7 +639,7 @@ MediaEngineWebRTCMicrophoneSource::Process(int channel, memcpy(dest, audio10ms, length * sizeof(sample)); nsAutoPtr segment(new AudioSegment()); - nsAutoTArray channels; + AutoTArray channels; channels.AppendElement(dest); segment->AppendFrames(buffer.forget(), channels, length); TimeStamp insertTime; diff --git a/dom/media/webspeech/recognition/SpeechRecognition.cpp b/dom/media/webspeech/recognition/SpeechRecognition.cpp index 1d07e9c513b..f2bcf2bb379 100644 --- a/dom/media/webspeech/recognition/SpeechRecognition.cpp +++ b/dom/media/webspeech/recognition/SpeechRecognition.cpp @@ -932,7 +932,7 @@ SpeechRecognition::CreateAudioSegment(nsTArray>& aChunks) RefPtr buffer = aChunks[i]; const int16_t* chunkData = static_cast(buffer->Data()); - nsAutoTArray channels; + AutoTArray channels; channels.AppendElement(chunkData); segment->AppendFrames(buffer.forget(), channels, mAudioSamplesPerChunk); } @@ -959,7 +959,7 @@ SpeechRecognition::FeedAudioData(already_AddRefed aSamples, uint32_t samplesIndex = 0; const int16_t* samples = static_cast(refSamples->Data()); - nsAutoTArray, 5> chunksToSend; + AutoTArray, 5> chunksToSend; // fill up our buffer and make a chunk out of it, if possible if (mBufferedSamples > 0) { diff --git a/dom/media/webspeech/synth/cocoa/OSXSpeechSynthesizerService.mm b/dom/media/webspeech/synth/cocoa/OSXSpeechSynthesizerService.mm index d78a99bb3cc..7ccab6b51e8 100644 --- a/dom/media/webspeech/synth/cocoa/OSXSpeechSynthesizerService.mm +++ b/dom/media/webspeech/synth/cocoa/OSXSpeechSynthesizerService.mm @@ -275,7 +275,7 @@ EnumVoicesRunnable::Run() { NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT; - nsAutoTArray list; + AutoTArray list; NSArray* voices = [NSSpeechSynthesizer availableVoices]; NSString* defaultVoice = [NSSpeechSynthesizer defaultVoice]; diff --git a/dom/media/webspeech/synth/nsSpeechTask.cpp b/dom/media/webspeech/synth/nsSpeechTask.cpp index 39fab24ceae..4be7290b88a 100644 --- a/dom/media/webspeech/synth/nsSpeechTask.cpp +++ b/dom/media/webspeech/synth/nsSpeechTask.cpp @@ -323,7 +323,7 @@ nsSpeechTask::SendAudioImpl(RefPtr& aSamples, uint32_t aD } AudioSegment segment; - nsAutoTArray channelData; + AutoTArray channelData; channelData.AppendElement(static_cast(aSamples->Data())); segment.AppendFrames(aSamples.forget(), channelData, aDataLen); mStream->AppendToTrack(1, &segment); diff --git a/dom/media/webspeech/synth/nsSynthVoiceRegistry.cpp b/dom/media/webspeech/synth/nsSynthVoiceRegistry.cpp index f413c5b3631..0b423b9b3d9 100644 --- a/dom/media/webspeech/synth/nsSynthVoiceRegistry.cpp +++ b/dom/media/webspeech/synth/nsSynthVoiceRegistry.cpp @@ -36,7 +36,7 @@ GetAllSpeechSynthActors(InfallibleTArray& MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(aActors.IsEmpty()); - nsAutoTArray contentActors; + AutoTArray contentActors; mozilla::dom::ContentParent::GetAll(contentActors); for (uint32_t contentIndex = 0; diff --git a/dom/messagechannel/MessagePort.cpp b/dom/messagechannel/MessagePort.cpp index 7fc5b927cd8..9b0f012d61a 100644 --- a/dom/messagechannel/MessagePort.cpp +++ b/dom/messagechannel/MessagePort.cpp @@ -475,10 +475,10 @@ MessagePort::PostMessage(JSContext* aCx, JS::Handle aMessage, MOZ_ASSERT(mActor); MOZ_ASSERT(mMessagesForTheOtherPort.IsEmpty()); - nsAutoTArray, 1> array; + AutoTArray, 1> array; array.AppendElement(data); - nsAutoTArray messages; + AutoTArray messages; SharedMessagePortMessage::FromSharedToMessagesChild(mActor, array, messages); mActor->SendPostMessages(messages); } diff --git a/dom/notification/Notification.cpp b/dom/notification/Notification.cpp index 5bb688b8cd4..e68e510c7af 100644 --- a/dom/notification/Notification.cpp +++ b/dom/notification/Notification.cpp @@ -158,7 +158,7 @@ public: MOZ_ASSERT(ok); ErrorResult result; - nsAutoTArray, 5> notifications; + AutoTArray, 5> notifications; for (uint32_t i = 0; i < mStrings.Length(); ++i) { RefPtr n = @@ -2094,7 +2094,7 @@ public: RefPtr workerPromise = mPromiseProxy->WorkerPromise(); ErrorResult result; - nsAutoTArray, 5> notifications; + AutoTArray, 5> notifications; for (uint32_t i = 0; i < mStrings.Length(); ++i) { RefPtr n = Notification::ConstructFromFields(aWorkerPrivate->GlobalScope(), diff --git a/dom/plugins/base/nsNPAPIPlugin.cpp b/dom/plugins/base/nsNPAPIPlugin.cpp index 708f46d0970..f769e93fc2f 100644 --- a/dom/plugins/base/nsNPAPIPlugin.cpp +++ b/dom/plugins/base/nsNPAPIPlugin.cpp @@ -1693,7 +1693,7 @@ _releasevariantvalue(NPVariant* variant) } else { void *p = (void *)s->UTF8Characters; DWORD nheaps = 0; - nsAutoTArray heaps; + AutoTArray heaps; nheaps = GetProcessHeaps(0, heaps.Elements()); heaps.AppendElements(nheaps); GetProcessHeaps(nheaps, heaps.Elements()); diff --git a/dom/plugins/base/nsPluginHost.cpp b/dom/plugins/base/nsPluginHost.cpp index dae2aec54ff..aad18ebbe43 100644 --- a/dom/plugins/base/nsPluginHost.cpp +++ b/dom/plugins/base/nsPluginHost.cpp @@ -2111,7 +2111,7 @@ nsresult nsPluginHost::ScanPluginsDirectory(nsIFile *pluginsDir, if (NS_FAILED(rv)) return rv; - nsAutoTArray, 6> pluginFiles; + AutoTArray, 6> pluginFiles; bool hasMore; while (NS_SUCCEEDED(iter->HasMoreElements(&hasMore)) && hasMore) { @@ -3666,7 +3666,7 @@ nsPluginHost::ParsePostBufferToFixHeaders(const char *inPostData, uint32_t inPos const char CRLFCRLF[] = {CR,LF,CR,LF,'\0'}; // C string"\r\n\r\n" const char ContentLenHeader[] = "Content-length"; - nsAutoTArray singleLF; + AutoTArray singleLF; const char *pSCntlh = 0;// pointer to start of ContentLenHeader in inPostData const char *pSod = 0; // pointer to start of data in inPostData const char *pEoh = 0; // pointer to end of headers in inPostData diff --git a/dom/plugins/base/nsPluginInstanceOwner.cpp b/dom/plugins/base/nsPluginInstanceOwner.cpp index d52d352831f..28518c560f1 100644 --- a/dom/plugins/base/nsPluginInstanceOwner.cpp +++ b/dom/plugins/base/nsPluginInstanceOwner.cpp @@ -903,7 +903,7 @@ nsPluginInstanceOwner::GetCompositionString(uint32_t aType, *aLength = aDist->Length(); return true; } - nsAutoTArray clauses; + AutoTArray clauses; clauses.AppendElement(0); for (TextRange& range : *ranges) { if (!range.IsClause()) { diff --git a/dom/plugins/base/nsPluginsDirUtils.h b/dom/plugins/base/nsPluginsDirUtils.h index 8fb907c0d1a..178dc6968e7 100644 --- a/dom/plugins/base/nsPluginsDirUtils.h +++ b/dom/plugins/base/nsPluginsDirUtils.h @@ -26,7 +26,7 @@ ParsePluginMimeDescription(const char *mdesc, nsPluginInfo &info) char *mdescDup = PL_strdup(mdesc); // make a dup of intput string we'll change it content char anEmptyString[] = ""; - nsAutoTArray tmpMimeTypeArr; + AutoTArray tmpMimeTypeArr; char delimiters[] = {':',':',';'}; int mimeTypeVariantCount = 0; char *p = mdescDup; // make a dup of intput string we'll change it content diff --git a/dom/plugins/ipc/PluginInstanceChild.cpp b/dom/plugins/ipc/PluginInstanceChild.cpp index e276f293942..27b66340402 100644 --- a/dom/plugins/ipc/PluginInstanceChild.cpp +++ b/dom/plugins/ipc/PluginInstanceChild.cpp @@ -2043,7 +2043,7 @@ PluginInstanceChild::ImmGetCompositionStringProc(HIMC aIMC, DWORD aIndex, if (!sCurrentPluginInstance) { return IMM_ERROR_GENERAL; } - nsAutoTArray dist; + AutoTArray dist; int32_t length = 0; // IMM_ERROR_NODATA sCurrentPluginInstance->SendGetCompositionString(aIndex, &dist, &length); if (length == IMM_ERROR_NODATA || length == IMM_ERROR_GENERAL) { diff --git a/dom/plugins/ipc/PluginInstanceParent.cpp b/dom/plugins/ipc/PluginInstanceParent.cpp index ea755c042e3..34e6547abcf 100644 --- a/dom/plugins/ipc/PluginInstanceParent.cpp +++ b/dom/plugins/ipc/PluginInstanceParent.cpp @@ -807,7 +807,7 @@ PluginInstanceParent::SetCurrentImage(Image* aImage) ImageContainer::NonOwningImage holder(aImage); holder.mFrameID = ++mFrameID; - nsAutoTArray imageList; + AutoTArray imageList; imageList.AppendElement(holder); mImageContainer->SetCurrentImages(imageList); @@ -959,7 +959,7 @@ PluginInstanceParent::RecvShow(const NPRect& updatedRect, gfxPlatform::GetPlatform()->GetSourceSurfaceForSurface(nullptr, surface); RefPtr image = new SourceSurfaceImage(surface->GetSize(), sourceSurface); - nsAutoTArray imageList; + AutoTArray imageList; imageList.AppendElement( ImageContainer::NonOwningImage(image)); diff --git a/dom/plugins/ipc/PluginModuleChild.h b/dom/plugins/ipc/PluginModuleChild.h index ffd35558166..61d84487a9d 100644 --- a/dom/plugins/ipc/PluginModuleChild.h +++ b/dom/plugins/ipc/PluginModuleChild.h @@ -363,7 +363,7 @@ private: bool _savedNestableTasksAllowed; }; - nsAutoTArray mIncallPumpingStack; + AutoTArray mIncallPumpingStack; static LRESULT CALLBACK NestedInputEventHook(int code, WPARAM wParam, diff --git a/dom/power/PowerManager.cpp b/dom/power/PowerManager.cpp index e7baeac48e9..64534976da1 100644 --- a/dom/power/PowerManager.cpp +++ b/dom/power/PowerManager.cpp @@ -135,7 +135,7 @@ PowerManager::Callback(const nsAString &aTopic, const nsAString &aState) * because the callbacks may install new listeners. We expect no * more than one listener per window, so it shouldn't be too long. */ - nsAutoTArray, 2> listeners(mListeners); + AutoTArray, 2> listeners(mListeners); for (uint32_t i = 0; i < listeners.Length(); ++i) { listeners[i]->Callback(aTopic, aState); } diff --git a/dom/power/PowerManagerService.cpp b/dom/power/PowerManagerService.cpp index a37a929ece4..5e972e12c05 100644 --- a/dom/power/PowerManagerService.cpp +++ b/dom/power/PowerManagerService.cpp @@ -112,7 +112,7 @@ PowerManagerService::Notify(const WakeLockInformation& aWakeLockInfo) * because the callbacks may install new listeners. We expect no * more than one listener per window, so it shouldn't be too long. */ - nsAutoTArray, 2> listeners(mWakeLockListeners); + AutoTArray, 2> listeners(mWakeLockListeners); for (uint32_t i = 0; i < listeners.Length(); ++i) { listeners[i]->Callback(aWakeLockInfo.topic(), state); diff --git a/dom/quota/ActorsParent.cpp b/dom/quota/ActorsParent.cpp index 665edb9a373..f9ced8a20d3 100644 --- a/dom/quota/ActorsParent.cpp +++ b/dom/quota/ActorsParent.cpp @@ -2476,7 +2476,7 @@ QuotaObject::MaybeUpdateSize(int64_t aSize, bool aTruncate) if (newTemporaryStorageUsage > quotaManager->mTemporaryStorageLimit) { // This will block the thread without holding the lock while waitting. - nsAutoTArray, 10> locks; + AutoTArray, 10> locks; uint64_t sizeToBeFreed = quotaManager->LockedCollectOriginsForEviction(delta, locks); @@ -3801,7 +3801,7 @@ QuotaManager::OpenDirectoryInternal(Nullable aPersistenceType, // All the locks that block this new exclusive lock need to be invalidated. // We also need to notify clients to abort operations for them. - nsAutoTArray>, + AutoTArray>, Client::TYPE_MAX> origins; origins.SetLength(Client::TYPE_MAX); diff --git a/dom/quota/QuotaManager.h b/dom/quota/QuotaManager.h index 4586958f0fb..db7ea977eec 100644 --- a/dom/quota/QuotaManager.h +++ b/dom/quota/QuotaManager.h @@ -500,7 +500,7 @@ private: // by any mutex but it is only ever touched on the IO thread. nsTArray mInitializedOrigins; - nsAutoTArray, Client::TYPE_MAX> mClients; + AutoTArray, Client::TYPE_MAX> mClients; nsString mIndexedDBPath; nsString mStoragePath; diff --git a/dom/svg/SVGLengthList.h b/dom/svg/SVGLengthList.h index 4d11e1afb9e..7ca07d1da35 100644 --- a/dom/svg/SVGLengthList.h +++ b/dom/svg/SVGLengthList.h @@ -130,20 +130,20 @@ protected: /* Rationale for using nsTArray and not nsTArray: * - * It might seem like we should use nsAutoTArray instead of + * It might seem like we should use AutoTArray instead of * nsTArray. That would preallocate space for one SVGLength and * avoid an extra memory allocation call in the common case of the 'x' * and 'y' attributes each containing a single length (and the 'dx' and 'dy' * attributes being empty). However, consider this: * - * An empty nsTArray uses sizeof(Header*). An nsAutoTArray on the other hand uses sizeof(Header*) + * (2 * sizeof(uint32_t)) + (N * sizeof(E)), which for one SVGLength is * sizeof(Header*) + 16 bytes. * * Now consider that for text elements we have four length list attributes * (x, y, dx, dy), each of which can have a baseVal and an animVal list. If - * we were to go the nsAutoTArray route for each of these, we'd + * we were to go the AutoTArray route for each of these, we'd * end up using at least 160 bytes for these four attributes alone, even * though we only need storage for two SVGLengths (16 bytes) in the common * case!! diff --git a/dom/voicemail/Voicemail.h b/dom/voicemail/Voicemail.h index 8cae51f96b0..d9e395bbb67 100644 --- a/dom/voicemail/Voicemail.h +++ b/dom/voicemail/Voicemail.h @@ -87,7 +87,7 @@ private: // |mStatuses| keeps all instantiated VoicemailStatus objects as well as the // empty slots for not interested ones. The length of |mStatuses| is decided // in the constructor and is never changed ever since. - nsAutoTArray, 1> mStatuses; + AutoTArray, 1> mStatuses; // Return a nsIVoicemailProvider instance based on the requests from external // components. Return nullptr if aOptionalServiceId contains an invalid diff --git a/dom/workers/Queue.h b/dom/workers/Queue.h index f4f87e985aa..c7a99158bf6 100644 --- a/dom/workers/Queue.h +++ b/dom/workers/Queue.h @@ -17,7 +17,7 @@ BEGIN_WORKERS_NAMESPACE template struct StorageWithTArray { - typedef nsAutoTArray StorageType; + typedef AutoTArray StorageType; static void Reverse(StorageType& aStorage) { diff --git a/dom/workers/RuntimeService.cpp b/dom/workers/RuntimeService.cpp index 544de2631e7..53319e82617 100644 --- a/dom/workers/RuntimeService.cpp +++ b/dom/workers/RuntimeService.cpp @@ -126,7 +126,7 @@ static_assert(MAX_WORKERS_PER_DOMAIN >= 1, PR_BEGIN_MACRO \ AssertIsOnMainThread(); \ \ - nsAutoTArray workers; \ + AutoTArray workers; \ { \ MutexAutoLock lock(mMutex); \ \ @@ -1788,7 +1788,7 @@ RuntimeService::ShutdownIdleThreads(nsITimer* aTimer, void* /* aClosure */) TimeStamp nextExpiration; - nsAutoTArray, 20> expiredThreads; + AutoTArray, 20> expiredThreads; { MutexAutoLock lock(runtime->mMutex); @@ -1992,7 +1992,7 @@ RuntimeService::Shutdown() { MutexAutoLock lock(mMutex); - nsAutoTArray workers; + AutoTArray workers; AddAllTopLevelWorkersToArray(workers); if (!workers.IsEmpty()) { @@ -2033,7 +2033,7 @@ RuntimeService::Cleanup() { MutexAutoLock lock(mMutex); - nsAutoTArray workers; + AutoTArray workers; AddAllTopLevelWorkersToArray(workers); if (!workers.IsEmpty()) { @@ -2042,7 +2042,7 @@ RuntimeService::Cleanup() // Shut down any idle threads. if (!mIdleThreadArray.IsEmpty()) { - nsAutoTArray, 20> idleThreads; + AutoTArray, 20> idleThreads; uint32_t idleThreadCount = mIdleThreadArray.Length(); idleThreads.SetLength(idleThreadCount); @@ -2197,7 +2197,7 @@ RuntimeService::CancelWorkersForWindow(nsPIDOMWindowInner* aWindow) { AssertIsOnMainThread(); - nsAutoTArray workers; + AutoTArray workers; GetWorkersForWindow(aWindow, workers); if (!workers.IsEmpty()) { @@ -2225,7 +2225,7 @@ RuntimeService::FreezeWorkersForWindow(nsPIDOMWindowInner* aWindow) AssertIsOnMainThread(); MOZ_ASSERT(aWindow); - nsAutoTArray workers; + AutoTArray workers; GetWorkersForWindow(aWindow, workers); if (!workers.IsEmpty()) { @@ -2249,7 +2249,7 @@ RuntimeService::ThawWorkersForWindow(nsPIDOMWindowInner* aWindow) AssertIsOnMainThread(); MOZ_ASSERT(aWindow); - nsAutoTArray workers; + AutoTArray workers; GetWorkersForWindow(aWindow, workers); if (!workers.IsEmpty()) { @@ -2273,7 +2273,7 @@ RuntimeService::SuspendWorkersForWindow(nsPIDOMWindowInner* aWindow) AssertIsOnMainThread(); MOZ_ASSERT(aWindow); - nsAutoTArray workers; + AutoTArray workers; GetWorkersForWindow(aWindow, workers); for (uint32_t index = 0; index < workers.Length(); index++) { @@ -2287,7 +2287,7 @@ RuntimeService::ResumeWorkersForWindow(nsPIDOMWindowInner* aWindow) AssertIsOnMainThread(); MOZ_ASSERT(aWindow); - nsAutoTArray workers; + AutoTArray workers; GetWorkersForWindow(aWindow, workers); for (uint32_t index = 0; index < workers.Length(); index++) { diff --git a/dom/workers/ServiceWorkerEvents.cpp b/dom/workers/ServiceWorkerEvents.cpp index 21d4f4c819b..a6b763a679a 100644 --- a/dom/workers/ServiceWorkerEvents.cpp +++ b/dom/workers/ServiceWorkerEvents.cpp @@ -199,7 +199,7 @@ public: mChannel->SynthesizeStatus(mInternalResponse->GetUnfilteredStatus(), mInternalResponse->GetUnfilteredStatusText()); - nsAutoTArray entries; + AutoTArray entries; mInternalResponse->UnfilteredHeaders()->GetEntries(entries); for (uint32_t i = 0; i < entries.Length(); ++i) { mChannel->SynthesizeHeader(entries[i].mName, entries[i].mValue); diff --git a/dom/workers/ServiceWorkerManager.cpp b/dom/workers/ServiceWorkerManager.cpp index d91842e24f4..7f4af258525 100644 --- a/dom/workers/ServiceWorkerManager.cpp +++ b/dom/workers/ServiceWorkerManager.cpp @@ -2636,7 +2636,7 @@ ServiceWorkerManager::ReportToAllClients(const nsCString& aScope, return; } - nsAutoTArray windows; + AutoTArray windows; // Report errors to every controlled document. for (auto iter = mControlledDocuments.Iter(); !iter.Done(); iter.Next()) { @@ -5125,7 +5125,7 @@ public: } private: - nsAutoTArray, 1> mInstances; + AutoTArray, 1> mInstances; ServiceWorkerState mState; }; diff --git a/dom/workers/ServiceWorkerManager.h b/dom/workers/ServiceWorkerManager.h index afa7bdb40e4..15d02f4f765 100644 --- a/dom/workers/ServiceWorkerManager.h +++ b/dom/workers/ServiceWorkerManager.h @@ -205,7 +205,7 @@ private: // addition and removal. // There is a high chance of there being at least one ServiceWorker // associated with this all the time. - nsAutoTArray mInstances; + AutoTArray mInstances; RefPtr mServiceWorkerPrivate; bool mSkipWaitingFlag; diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp index f6793730270..e2c0b96a651 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp @@ -3142,14 +3142,14 @@ WorkerPrivateParent::BroadcastErrorToSharedWorkers( { AssertIsOnMainThread(); - nsAutoTArray, 10> sharedWorkers; + AutoTArray, 10> sharedWorkers; GetAllSharedWorkers(sharedWorkers); if (sharedWorkers.IsEmpty()) { return; } - nsAutoTArray windowActions; + AutoTArray windowActions; nsresult rv; // First fire the error event at all SharedWorker objects. This may include @@ -5168,7 +5168,7 @@ WorkerPrivate::NotifyFeatures(JSContext* aCx, Status aStatus) } } - nsAutoTArray children; + AutoTArray children; children.AppendElements(mChildWorkers); for (uint32_t index = 0; index < children.Length(); index++) { @@ -5965,7 +5965,7 @@ WorkerPrivate::RunExpiredTimeouts(JSContext* aCx) (now - actual_now).ToMilliseconds())); } - nsAutoTArray expiredTimeouts; + AutoTArray expiredTimeouts; for (uint32_t index = 0; index < mTimeouts.Length(); index++) { nsAutoPtr& info = mTimeouts[index]; if (info->mTargetTime > now) { diff --git a/dom/xbl/nsXBLEventHandler.cpp b/dom/xbl/nsXBLEventHandler.cpp index 790ee374b13..2522419f8e6 100644 --- a/dom/xbl/nsXBLEventHandler.cpp +++ b/dom/xbl/nsXBLEventHandler.cpp @@ -140,7 +140,7 @@ nsXBLKeyEventHandler::HandleEvent(nsIDOMEvent* aEvent) if (!key) return NS_OK; - nsAutoTArray accessKeys; + AutoTArray accessKeys; nsContentUtils::GetAccelKeyCandidates(key, accessKeys); if (accessKeys.IsEmpty()) { diff --git a/dom/xbl/nsXBLService.cpp b/dom/xbl/nsXBLService.cpp index 569fcdb72c0..08f6db50eb9 100644 --- a/dom/xbl/nsXBLService.cpp +++ b/dom/xbl/nsXBLService.cpp @@ -188,7 +188,7 @@ private: ~nsXBLStreamListener(); nsCOMPtr mInner; - nsAutoTArray mBindingRequests; + AutoTArray mBindingRequests; nsCOMPtr mBoundDocument; nsCOMPtr mSink; // Only set until OnStartRequest @@ -647,7 +647,7 @@ nsXBLService::GetBinding(nsIContent* aBoundElement, nsIURI* aURI, bool* aIsReady, nsXBLBinding** aResult) { // More than 6 binding URIs are rare, see bug 55070 comment 18. - nsAutoTArray, 6> uris; + AutoTArray, 6> uris; return GetBinding(aBoundElement, aURI, aPeekOnly, aOriginPrincipal, aIsReady, aResult, uris); } diff --git a/dom/xbl/nsXBLWindowKeyHandler.cpp b/dom/xbl/nsXBLWindowKeyHandler.cpp index fd51f621a33..083a11aa6e4 100644 --- a/dom/xbl/nsXBLWindowKeyHandler.cpp +++ b/dom/xbl/nsXBLWindowKeyHandler.cpp @@ -441,7 +441,7 @@ nsXBLWindowKeyHandler::WalkHandlersInternal(nsIDOMKeyEvent* aKeyEvent, bool aExecute, bool* aOutReservedForChrome) { - nsAutoTArray accessKeys; + AutoTArray accessKeys; nsContentUtils::GetAccelKeyCandidates(aKeyEvent, accessKeys); if (accessKeys.IsEmpty()) { diff --git a/dom/xslt/xpath/txMozillaXPathTreeWalker.cpp b/dom/xslt/xpath/txMozillaXPathTreeWalker.cpp index 231b7ea465b..fee671ea59f 100644 --- a/dom/xslt/xpath/txMozillaXPathTreeWalker.cpp +++ b/dom/xslt/xpath/txMozillaXPathTreeWalker.cpp @@ -604,7 +604,7 @@ txXPathNodeUtils::comparePosition(const txXPathNode& aNode, // same tree. // Get parents up the tree. - nsAutoTArray parents, otherParents; + AutoTArray parents, otherParents; nsINode* node = aNode.mNode; nsINode* otherNode = aOtherNode.mNode; nsINode* parent; diff --git a/dom/xul/templates/nsTreeRows.h b/dom/xul/templates/nsTreeRows.h index 75eb1eba976..801af022693 100644 --- a/dom/xul/templates/nsTreeRows.h +++ b/dom/xul/templates/nsTreeRows.h @@ -187,7 +187,7 @@ public: class iterator { protected: int32_t mRowIndex; - nsAutoTArray mLink; + AutoTArray mLink; void Next(); void Prev(); diff --git a/dom/xul/templates/nsXULContentBuilder.cpp b/dom/xul/templates/nsXULContentBuilder.cpp index 95b644fa60a..246494016f6 100644 --- a/dom/xul/templates/nsXULContentBuilder.cpp +++ b/dom/xul/templates/nsXULContentBuilder.cpp @@ -1270,7 +1270,7 @@ nsXULContentBuilder::RemoveGeneratedContent(nsIContent* aElement) { // Keep a queue of "ungenerated" elements that we have to probe // for generated content. - nsAutoTArray ungenerated; + AutoTArray ungenerated; if (ungenerated.AppendElement(aElement) == nullptr) return NS_ERROR_OUT_OF_MEMORY; diff --git a/dom/xul/templates/nsXULTemplateBuilder.cpp b/dom/xul/templates/nsXULTemplateBuilder.cpp index fdcc35f1fdc..a5ea7597076 100644 --- a/dom/xul/templates/nsXULTemplateBuilder.cpp +++ b/dom/xul/templates/nsXULTemplateBuilder.cpp @@ -2358,7 +2358,7 @@ nsXULTemplateBuilder::AddSimpleRuleBindings(nsTemplateRule* aRule, // Crawl the content tree of a "simple" rule, adding a variable // assignment for any attribute whose value is "rdf:". - nsAutoTArray elements; + AutoTArray elements; if (elements.AppendElement(aElement) == nullptr) return NS_ERROR_OUT_OF_MEMORY; diff --git a/dom/xul/templates/nsXULTreeBuilder.cpp b/dom/xul/templates/nsXULTreeBuilder.cpp index e67f5e74d97..8c4e9682a78 100644 --- a/dom/xul/templates/nsXULTreeBuilder.cpp +++ b/dom/xul/templates/nsXULTreeBuilder.cpp @@ -1463,7 +1463,7 @@ nsXULTreeBuilder::OpenSubtreeOf(nsTreeRows::Subtree* aSubtree, nsIXULTemplateResult *aResult, int32_t* aDelta) { - nsAutoTArray open; + AutoTArray open; int32_t count = 0; int32_t rulecount = mQuerySets.Length(); diff --git a/editor/libeditor/nsEditor.cpp b/editor/libeditor/nsEditor.cpp index 2980365d1ca..bc604c141df 100644 --- a/editor/libeditor/nsEditor.cpp +++ b/editor/libeditor/nsEditor.cpp @@ -2664,7 +2664,7 @@ nsEditor::SplitNodeImpl(nsIContent& aExistingRightNode, nsIContent& aNewLeftNode) { // Remember all selection points. - nsAutoTArray savedRanges; + AutoTArray savedRanges; for (size_t i = 0; i < nsISelectionController::NUM_SELECTIONTYPES - 1; ++i) { SelectionType type(1 << i); SavedRange range; @@ -2811,7 +2811,7 @@ nsEditor::JoinNodesImpl(nsINode* aNodeToKeep, nsINode* parent = GetNodeLocation(aNodeToKeep, &keepOffset); // Remember all selection points. - nsAutoTArray savedRanges; + AutoTArray savedRanges; for (size_t i = 0; i < nsISelectionController::NUM_SELECTIONTYPES - 1; ++i) { SelectionType type(1 << i); SavedRange range; diff --git a/embedding/components/commandhandler/nsCommandGroup.cpp b/embedding/components/commandhandler/nsCommandGroup.cpp index 8619e207ad4..696b93f67c2 100644 --- a/embedding/components/commandhandler/nsCommandGroup.cpp +++ b/embedding/components/commandhandler/nsCommandGroup.cpp @@ -214,7 +214,7 @@ nsControllerCommandGroup::AddCommandToGroup(const char* aCommand, nsTArray* commandList = mGroupsHash.Get(groupKey); if (!commandList) { // make this list - commandList = new nsAutoTArray; + commandList = new AutoTArray; mGroupsHash.Put(groupKey, commandList); } diff --git a/extensions/cookie/nsPermissionManager.h b/extensions/cookie/nsPermissionManager.h index a75b2d62b6f..7dfcd443523 100644 --- a/extensions/cookie/nsPermissionManager.h +++ b/extensions/cookie/nsPermissionManager.h @@ -121,7 +121,7 @@ public: } // Force the hashtable to use the copy constructor when shuffling entries - // around, otherwise the Auto part of our nsAutoTArray won't be happy! + // around, otherwise the Auto part of our AutoTArray won't be happy! enum { ALLOW_MEMMOVE = false }; inline nsTArray & GetPermissions() @@ -150,7 +150,7 @@ public: } private: - nsAutoTArray mPermissions; + AutoTArray mPermissions; }; // nsISupports diff --git a/gfx/2d/StackArray.h b/gfx/2d/StackArray.h index e3c2684a0bf..a2451f93059 100644 --- a/gfx/2d/StackArray.h +++ b/gfx/2d/StackArray.h @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ /* A handy class that will allocate data for size*T objects on the stack and - * otherwise allocate them on the heap. It is similar in purpose to nsAutoTArray */ + * otherwise allocate them on the heap. It is similar in purpose to AutoTArray */ template class StackArray diff --git a/gfx/gl/DecomposeIntoNoRepeatTriangles.h b/gfx/gl/DecomposeIntoNoRepeatTriangles.h index 8e8b27ec5f6..f67d6f93e8a 100644 --- a/gfx/gl/DecomposeIntoNoRepeatTriangles.h +++ b/gfx/gl/DecomposeIntoNoRepeatTriangles.h @@ -45,8 +45,8 @@ public: } private: // Reserve inline storage for one quad (2 triangles, 3 coords). - nsAutoTArray mVertexCoords; - nsAutoTArray mTexCoords; + AutoTArray mVertexCoords; + AutoTArray mTexCoords; static void AppendRectToCoordArray(InfallibleTArray& array, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1); diff --git a/gfx/gl/GLContextProviderGLX.cpp b/gfx/gl/GLContextProviderGLX.cpp index aff5a78e79b..61c3fb46ffa 100644 --- a/gfx/gl/GLContextProviderGLX.cpp +++ b/gfx/gl/GLContextProviderGLX.cpp @@ -778,7 +778,7 @@ TRY_AGAIN_NO_SHARING: GLXContext glxContext = shareContext ? shareContext->mContext : nullptr; if (glx.HasCreateContextAttribs()) { - nsAutoTArray attrib_list; + AutoTArray attrib_list; if (glx.HasRobustness()) { int robust_attribs[] = { LOCAL_GL_CONTEXT_FLAGS_ARB, LOCAL_GL_CONTEXT_ROBUST_ACCESS_BIT_ARB, diff --git a/gfx/layers/ImageContainer.cpp b/gfx/layers/ImageContainer.cpp index 25b836f0972..0154a1a2eef 100644 --- a/gfx/layers/ImageContainer.cpp +++ b/gfx/layers/ImageContainer.cpp @@ -293,7 +293,7 @@ ImageContainer::SetCurrentImageInTransaction(Image *aImage) NS_ASSERTION(NS_IsMainThread(), "Should be on main thread."); NS_ASSERTION(!mImageClient, "Should use async image transfer with ImageBridge."); - nsAutoTArray images; + AutoTArray images; images.AppendElement(NonOwningImage(aImage)); SetCurrentImageInternal(images); } diff --git a/gfx/layers/ImageContainer.h b/gfx/layers/ImageContainer.h index c1a693e027f..e94e8875ff9 100644 --- a/gfx/layers/ImageContainer.h +++ b/gfx/layers/ImageContainer.h @@ -634,7 +634,7 @@ public: } private: - nsAutoTArray mImages; + AutoTArray mImages; }; struct PlanarYCbCrData { diff --git a/gfx/layers/LayerTreeInvalidation.cpp b/gfx/layers/LayerTreeInvalidation.cpp index 941d7c7ad6b..74f18051a07 100644 --- a/gfx/layers/LayerTreeInvalidation.cpp +++ b/gfx/layers/LayerTreeInvalidation.cpp @@ -21,7 +21,7 @@ #include "nsHashKeys.h" // for nsPtrHashKey #include "nsISupportsImpl.h" // for Layer::AddRef, etc #include "nsRect.h" // for IntRect -#include "nsTArray.h" // for nsAutoTArray, nsTArray_Impl +#include "nsTArray.h" // for AutoTArray, nsTArray_Impl #include "mozilla/layers/ImageHost.h" #include "mozilla/layers/LayerManagerComposite.h" @@ -383,7 +383,7 @@ struct ContainerLayerProperties : public LayerPropertiesBase } // The old list of children: - nsAutoTArray,1> mChildren; + AutoTArray,1> mChildren; float mPreXScale; float mPreYScale; }; diff --git a/gfx/layers/Layers.cpp b/gfx/layers/Layers.cpp index 9fe25c17b20..f6081cadb78 100644 --- a/gfx/layers/Layers.cpp +++ b/gfx/layers/Layers.cpp @@ -1331,7 +1331,7 @@ ContainerLayer::Collect3DContextLeaves(nsTArray& aToSort) void ContainerLayer::SortChildrenBy3DZOrder(nsTArray& aArray) { - nsAutoTArray toSort; + AutoTArray toSort; for (Layer* l = GetFirstChild(); l; l = l->GetNextSibling()) { ContainerLayer* container = l->AsContainerLayer(); diff --git a/gfx/layers/basic/BasicLayerManager.cpp b/gfx/layers/basic/BasicLayerManager.cpp index 46be276dcf1..9c3cfa4dc1a 100644 --- a/gfx/layers/basic/BasicLayerManager.cpp +++ b/gfx/layers/basic/BasicLayerManager.cpp @@ -43,7 +43,7 @@ #include "nsPoint.h" // for nsIntPoint #include "nsRect.h" // for mozilla::gfx::IntRect #include "nsRegion.h" // for nsIntRegion, etc -#include "nsTArray.h" // for nsAutoTArray +#include "nsTArray.h" // for AutoTArray #ifdef MOZ_ENABLE_SKIA #include "skia/include/core/SkCanvas.h" // for SkCanvas #include "skia/include/core/SkBitmapDevice.h" // for SkBitmapDevice @@ -897,7 +897,7 @@ BasicLayerManager::PaintSelfOrChildren(PaintLayerContext& aPaintContext, } else { ContainerLayer* container = static_cast(aPaintContext.mLayer); - nsAutoTArray children; + AutoTArray children; container->SortChildrenBy3DZOrder(children); for (uint32_t i = 0; i < children.Length(); i++) { Layer* layer = children.ElementAt(i); diff --git a/gfx/layers/client/CanvasClient.cpp b/gfx/layers/client/CanvasClient.cpp index 49143d9fadf..2a5c991c457 100644 --- a/gfx/layers/client/CanvasClient.cpp +++ b/gfx/layers/client/CanvasClient.cpp @@ -120,7 +120,7 @@ CanvasClient2D::Update(gfx::IntSize aSize, ClientCanvasLayer* aLayer) } if (updated) { - nsAutoTArray textures; + AutoTArray textures; CompositableForwarder::TimedTextureClient* t = textures.AppendElement(); t->mTextureClient = mBuffer; t->mPictureRect = nsIntRect(nsIntPoint(0, 0), mBuffer->GetSize()); @@ -476,7 +476,7 @@ CanvasClientSharedSurface::Updated() // Add the new TexClient. MOZ_ALWAYS_TRUE( AddTextureClient(mFront) ); - nsAutoTArray textures; + AutoTArray textures; CompositableForwarder::TimedTextureClient* t = textures.AppendElement(); t->mTextureClient = mFront; t->mPictureRect = nsIntRect(nsIntPoint(0, 0), mFront->GetSize()); diff --git a/gfx/layers/client/ClientContainerLayer.h b/gfx/layers/client/ClientContainerLayer.h index c6ad5b65800..254d2a45a9c 100644 --- a/gfx/layers/client/ClientContainerLayer.h +++ b/gfx/layers/client/ClientContainerLayer.h @@ -13,7 +13,7 @@ #include "nsISupportsImpl.h" // for MOZ_COUNT_CTOR, etc #include "nsISupportsUtils.h" // for NS_ADDREF, NS_RELEASE #include "nsRegion.h" // for nsIntRegion -#include "nsTArray.h" // for nsAutoTArray +#include "nsTArray.h" // for AutoTArray #include "ReadbackProcessor.h" #include "ClientPaintedLayer.h" @@ -50,7 +50,7 @@ public: DefaultComputeSupportsComponentAlphaChildren(); - nsAutoTArray children; + AutoTArray children; SortChildrenBy3DZOrder(children); ReadbackProcessor readback; diff --git a/gfx/layers/client/ClientLayerManager.h b/gfx/layers/client/ClientLayerManager.h index 7d8b3be4a94..94295c08565 100644 --- a/gfx/layers/client/ClientLayerManager.h +++ b/gfx/layers/client/ClientLayerManager.h @@ -350,8 +350,8 @@ private: APZTestData mApzTestData; RefPtr mForwarder; - nsAutoTArray,2> mTexturePools; - nsAutoTArray mOverfillCallbacks; + AutoTArray,2> mTexturePools; + AutoTArray mOverfillCallbacks; mozilla::TimeStamp mTransactionStart; nsTArray mDidCompositeObservers; diff --git a/gfx/layers/client/ContentClient.cpp b/gfx/layers/client/ContentClient.cpp index 77f37097261..9fc49bd6223 100644 --- a/gfx/layers/client/ContentClient.cpp +++ b/gfx/layers/client/ContentClient.cpp @@ -379,7 +379,7 @@ ContentClientRemoteBuffer::Updated(const nsIntRegion& aRegionToDraw, mForwarder->UseComponentAlphaTextures(this, mTextureClient, mTextureClientOnWhite); } else { - nsAutoTArray textures; + AutoTArray textures; CompositableForwarder::TimedTextureClient* t = textures.AppendElement(); t->mTextureClient = mTextureClient; IntSize size = mTextureClient->GetSize(); diff --git a/gfx/layers/client/ImageClient.cpp b/gfx/layers/client/ImageClient.cpp index 030ba720022..d7fda20665b 100644 --- a/gfx/layers/client/ImageClient.cpp +++ b/gfx/layers/client/ImageClient.cpp @@ -123,7 +123,7 @@ ImageClientSingle::FlushAllImages(AsyncTransactionWaiter* aAsyncTransactionWaite bool ImageClientSingle::UpdateImage(ImageContainer* aContainer, uint32_t aContentFlags) { - nsAutoTArray images; + AutoTArray images; uint32_t generationCounter; aContainer->GetCurrentImages(&images, &generationCounter); @@ -149,7 +149,7 @@ ImageClientSingle::UpdateImage(ImageContainer* aContainer, uint32_t aContentFlag } nsTArray newBuffers; - nsAutoTArray textures; + AutoTArray textures; for (auto& img : images) { Image* image = img.mImage; diff --git a/gfx/layers/composite/AsyncCompositionManager.cpp b/gfx/layers/composite/AsyncCompositionManager.cpp index f4db3f916e4..e44d5e23eee 100644 --- a/gfx/layers/composite/AsyncCompositionManager.cpp +++ b/gfx/layers/composite/AsyncCompositionManager.cpp @@ -1406,7 +1406,7 @@ AsyncCompositionManager::TransformShadowTree(TimeStamp aCurrentFrame, } #endif } else { - nsAutoTArray scrollableLayers; + AutoTArray scrollableLayers; #ifdef MOZ_WIDGET_ANDROID mLayerManager->GetRootScrollableLayers(scrollableLayers); #else diff --git a/gfx/layers/composite/ContainerLayerComposite.cpp b/gfx/layers/composite/ContainerLayerComposite.cpp index 0c842f937aa..f7a46eeeff9 100755 --- a/gfx/layers/composite/ContainerLayerComposite.cpp +++ b/gfx/layers/composite/ContainerLayerComposite.cpp @@ -29,7 +29,7 @@ #include "nsISupportsImpl.h" // for MOZ_COUNT_CTOR, etc #include "nsISupportsUtils.h" // for NS_ADDREF, NS_RELEASE #include "nsRegion.h" // for nsIntRegion -#include "nsTArray.h" // for nsAutoTArray +#include "nsTArray.h" // for AutoTArray #include "TextRenderer.h" // for TextRenderer #include #include "VRManager.h" // for VRManager @@ -190,7 +190,7 @@ ContainerRenderVR(ContainerT* aContainer, compositor->SetRenderTarget(surface); - nsAutoTArray children; + AutoTArray children; aContainer->SortChildrenBy3DZOrder(children); gfx::Matrix4x4 origTransform = aContainer->GetEffectiveTransform(); @@ -336,7 +336,7 @@ NeedToDrawCheckerboardingForLayer(Layer* aLayer, Color* aOutCheckerboardingColor struct PreparedData { RefPtr mTmpTarget; - nsAutoTArray mLayers; + AutoTArray mLayers; bool mNeedsSurfaceCopy; }; @@ -361,7 +361,7 @@ ContainerPrepare(ContainerT* aContainer, /** * Determine which layers to draw. */ - nsAutoTArray children; + AutoTArray children; aContainer->SortChildrenBy3DZOrder(children); for (uint32_t i = 0; i < children.Length(); i++) { diff --git a/gfx/layers/composite/FPSCounter.h b/gfx/layers/composite/FPSCounter.h index bf594093dbc..7a59267fced 100644 --- a/gfx/layers/composite/FPSCounter.h +++ b/gfx/layers/composite/FPSCounter.h @@ -12,7 +12,7 @@ #include "GLDefs.h" // for GLuint #include "mozilla/RefPtr.h" // for already_AddRefed, RefCounted #include "mozilla/TimeStamp.h" // for TimeStamp, TimeDuration -#include "nsTArray.h" // for nsAutoTArray, nsTArray_Impl, etc +#include "nsTArray.h" // for AutoTArray, nsTArray_Impl, etc #include "prio.h" // for NSPR file i/o namespace mozilla { @@ -87,7 +87,7 @@ private: * read at an offset except our latest write * we don't need an explicit read pointer. */ - nsAutoTArray mFrameTimestamps; + AutoTArray mFrameTimestamps; int mWriteIndex; // points to next open write slot int mIteratorIndex; // used only when iterating const char* mFPSName; diff --git a/gfx/layers/composite/FrameUniformityData.h b/gfx/layers/composite/FrameUniformityData.h index 70d9fb0efa6..f7e175f367d 100644 --- a/gfx/layers/composite/FrameUniformityData.h +++ b/gfx/layers/composite/FrameUniformityData.h @@ -30,7 +30,7 @@ struct LayerTransforms { gfx::Point GetStdDev(); // 60 fps * 5 seconds worth of data - nsAutoTArray mTransforms; + AutoTArray mTransforms; }; class LayerTransformRecorder { diff --git a/gfx/layers/ipc/CompositableTransactionParent.cpp b/gfx/layers/ipc/CompositableTransactionParent.cpp index cc0b4e1c178..82327c8bee8 100644 --- a/gfx/layers/ipc/CompositableTransactionParent.cpp +++ b/gfx/layers/ipc/CompositableTransactionParent.cpp @@ -172,7 +172,7 @@ CompositableParentManager::ReceiveCompositableUpdate(const CompositableOperation const OpUseTexture& op = aEdit.get_OpUseTexture(); CompositableHost* compositable = AsCompositable(op); - nsAutoTArray textures; + AutoTArray textures; for (auto& timedTexture : op.textures()) { CompositableHost::TimedTexture* t = textures.AppendElement(); t->mTexture = diff --git a/gfx/layers/ipc/CompositorChild.cpp b/gfx/layers/ipc/CompositorChild.cpp index 2f7817c3bca..f1600052ab0 100644 --- a/gfx/layers/ipc/CompositorChild.cpp +++ b/gfx/layers/ipc/CompositorChild.cpp @@ -95,7 +95,7 @@ CompositorChild::Destroy() mLayerManager = nullptr; } - nsAutoTArray transactions; + AutoTArray transactions; ManagedPLayerTransactionChild(transactions); for (int i = transactions.Length() - 1; i >= 0; --i) { RefPtr layers = diff --git a/gfx/layers/ipc/CompositorChild.h b/gfx/layers/ipc/CompositorChild.h index 8ca9f84a69a..a8ce648ddc8 100644 --- a/gfx/layers/ipc/CompositorChild.h +++ b/gfx/layers/ipc/CompositorChild.h @@ -195,7 +195,7 @@ private: DISALLOW_EVIL_CONSTRUCTORS(CompositorChild); // When we receive overfill numbers, notify these client layer managers - nsAutoTArray mOverfillObservers; + AutoTArray mOverfillObservers; // True until the beginning of the two-step shutdown sequence of this actor. bool mCanSend; diff --git a/gfx/layers/ipc/ImageBridgeChild.cpp b/gfx/layers/ipc/ImageBridgeChild.cpp index e99fdfb4a3b..b8f983067ad 100644 --- a/gfx/layers/ipc/ImageBridgeChild.cpp +++ b/gfx/layers/ipc/ImageBridgeChild.cpp @@ -35,7 +35,7 @@ #include "mozilla/mozalloc.h" // for operator new, etc #include "nsAutoPtr.h" // for nsRefPtr #include "nsISupportsImpl.h" // for ImageContainer::AddRef, etc -#include "nsTArray.h" // for nsAutoTArray, nsTArray, etc +#include "nsTArray.h" // for AutoTArray, nsTArray, etc #include "nsTArrayForwardDeclare.h" // for AutoInfallibleTArray #include "nsThreadUtils.h" // for NS_IsMainThread #include "nsXULAppAPI.h" // for XRE_GetIOMessageLoop @@ -146,7 +146,7 @@ ImageBridgeChild::UseTextures(CompositableClient* aCompositable, MOZ_ASSERT(aCompositable->GetIPDLActor()); MOZ_ASSERT(aCompositable->IsConnected()); - nsAutoTArray textures; + AutoTArray textures; for (auto& t : aTextures) { MOZ_ASSERT(t.mTextureClient); diff --git a/gfx/layers/ipc/ImageBridgeParent.cpp b/gfx/layers/ipc/ImageBridgeParent.cpp index 7e13db32082..7494d412e71 100644 --- a/gfx/layers/ipc/ImageBridgeParent.cpp +++ b/gfx/layers/ipc/ImageBridgeParent.cpp @@ -332,7 +332,7 @@ ImageBridgeParent::NotifyImageComposites(nsTArray& a uint32_t i = 0; bool ok = true; while (i < aNotifications.Length()) { - nsAutoTArray notifications; + AutoTArray notifications; notifications.AppendElement(aNotifications[i]); uint32_t end = i + 1; MOZ_ASSERT(aNotifications[i].imageContainerParent()); diff --git a/gfx/layers/ipc/ImageContainerParent.h b/gfx/layers/ipc/ImageContainerParent.h index 6f1e10edcc0..817aa823163 100644 --- a/gfx/layers/ipc/ImageContainerParent.h +++ b/gfx/layers/ipc/ImageContainerParent.h @@ -26,7 +26,7 @@ public: virtual bool RecvAsyncDelete() override; - nsAutoTArray mImageHosts; + AutoTArray mImageHosts; private: virtual void ActorDestroy(ActorDestroyReason why) override {} diff --git a/gfx/layers/ipc/ShadowLayers.cpp b/gfx/layers/ipc/ShadowLayers.cpp index f1b11c8dcfb..08bb1f7720c 100644 --- a/gfx/layers/ipc/ShadowLayers.cpp +++ b/gfx/layers/ipc/ShadowLayers.cpp @@ -29,7 +29,7 @@ #include "mozilla/layers/TextureClient.h" // for TextureClient #include "mozilla/mozalloc.h" // for operator new, etc #include "nsAutoPtr.h" // for nsRefPtr, getter_AddRefs, etc -#include "nsTArray.h" // for nsAutoTArray, nsTArray, etc +#include "nsTArray.h" // for AutoTArray, nsTArray, etc #include "nsXULAppAPI.h" // for XRE_GetProcessType, etc #include "mozilla/ReentrantMonitor.h" @@ -387,7 +387,7 @@ ShadowLayerForwarder::UseTextures(CompositableClient* aCompositable, { MOZ_ASSERT(aCompositable && aCompositable->IsConnected()); - nsAutoTArray textures; + AutoTArray textures; for (auto& t : aTextures) { MOZ_ASSERT(t.mTextureClient); diff --git a/gfx/layers/opengl/CompositorOGL.h b/gfx/layers/opengl/CompositorOGL.h index bde7a431090..06947781d65 100644 --- a/gfx/layers/opengl/CompositorOGL.h +++ b/gfx/layers/opengl/CompositorOGL.h @@ -28,7 +28,7 @@ #include "nsCOMPtr.h" // for already_AddRefed #include "nsDebug.h" // for NS_ASSERTION, NS_WARNING #include "nsISupportsImpl.h" // for MOZ_COUNT_CTOR, etc -#include "nsTArray.h" // for nsAutoTArray, nsTArray, etc +#include "nsTArray.h" // for AutoTArray, nsTArray, etc #include "nsThreadUtils.h" // for nsRunnable #include "nsXULAppAPI.h" // for XRE_GetProcessType #include "nscore.h" // for NS_IMETHOD diff --git a/gfx/src/nsRegion.cpp b/gfx/src/nsRegion.cpp index a90ea659b5e..a46944e6807 100644 --- a/gfx/src/nsRegion.cpp +++ b/gfx/src/nsRegion.cpp @@ -305,7 +305,7 @@ void nsRegion::SimplifyOutwardByArea(uint32_t aThreshold) pixman_box32_t *topRects = boxes; // we need some temporary storage for merging both rows of rectangles - nsAutoTArray tmpStorage; + AutoTArray tmpStorage; tmpStorage.SetCapacity(n); pixman_box32_t *tmpRect = tmpStorage.Elements(); diff --git a/gfx/thebes/gfxCoreTextShaper.cpp b/gfx/thebes/gfxCoreTextShaper.cpp index ab15e09466f..d83f84f4610 100644 --- a/gfx/thebes/gfxCoreTextShaper.cpp +++ b/gfx/thebes/gfxCoreTextShaper.cpp @@ -349,10 +349,10 @@ gfxCoreTextShaper::SetGlyphsFromRun(gfxShapedText *aShapedText, // Testing indicates that CTRunGetGlyphsPtr (almost?) always succeeds, // and so allocating a new array and copying data with CTRunGetGlyphs // will be extremely rare. - // If this were not the case, we could use an nsAutoTArray<> to + // If this were not the case, we could use an AutoTArray<> to // try and avoid the heap allocation for small runs. // It's possible that some future change to CoreText will mean that - // CTRunGetGlyphsPtr fails more often; if this happens, nsAutoTArray<> + // CTRunGetGlyphsPtr fails more often; if this happens, AutoTArray<> // may become an attractive option. glyphs = ::CTRunGetGlyphsPtr(aCTRun); if (!glyphs) { @@ -390,7 +390,7 @@ gfxCoreTextShaper::SetGlyphsFromRun(gfxShapedText *aShapedText, double runWidth = ::CTRunGetTypographicBounds(aCTRun, ::CFRangeMake(0, 0), nullptr, nullptr, nullptr); - nsAutoTArray detailedGlyphs; + AutoTArray detailedGlyphs; gfxShapedText::CompressedGlyph *charGlyphs = aShapedText->GetCharacterGlyphs() + aOffset; diff --git a/gfx/thebes/gfxDWriteFontList.cpp b/gfx/thebes/gfxDWriteFontList.cpp index 808341a445b..f8c5b2d1313 100644 --- a/gfx/thebes/gfxDWriteFontList.cpp +++ b/gfx/thebes/gfxDWriteFontList.cpp @@ -70,7 +70,7 @@ GetDirectWriteFontName(IDWriteFont *aFont, nsAString& aFontName) } BOOL exists; - nsAutoTArray faceName; + AutoTArray faceName; UINT32 englishIdx = 0; hr = names->FindLocaleName(L"en-us", &englishIdx, &exists); if (FAILED(hr)) { @@ -114,7 +114,7 @@ GetDirectWriteFaceName(IDWriteFont *aFont, return E_FAIL; } - nsAutoTArray faceName; + AutoTArray faceName; UINT32 englishIdx = 0; hr = infostrings->FindLocaleName(L"en-us", &englishIdx, &exists); if (FAILED(hr)) { @@ -633,7 +633,7 @@ gfxDWriteFontEntry::CreateFontFace(IDWriteFontFace **aFontFace, if (FAILED(mFontFace->GetFiles(&numberOfFiles, nullptr))) { return NS_ERROR_FAILURE; } - nsAutoTArray files; + AutoTArray files; files.AppendElements(numberOfFiles); if (FAILED(mFontFace->GetFiles(&numberOfFiles, files.Elements()))) { return NS_ERROR_FAILURE; @@ -1517,7 +1517,7 @@ void DirectWriteFontInfo::LoadFontFamilyData(const nsAString& aFamilyName) { // lookup the family - nsAutoTArray famName; + AutoTArray famName; uint32_t len = aFamilyName.Length(); if(!famName.SetLength(len + 1, fallible)) { diff --git a/gfx/thebes/gfxFT2FontList.cpp b/gfx/thebes/gfxFT2FontList.cpp index 8fd86da3236..e007945dec4 100644 --- a/gfx/thebes/gfxFT2FontList.cpp +++ b/gfx/thebes/gfxFT2FontList.cpp @@ -1353,7 +1353,7 @@ gfxFT2FontList::GetSystemFontList(InfallibleTArray* retValue) static void LoadSkipSpaceLookupCheck(nsTHashtable& aSkipSpaceLookupCheck) { - nsAutoTArray skiplist; + AutoTArray skiplist; gfxFontUtils::GetPrefsFontList( "font.whitelist.skip_default_features_space_check", skiplist); diff --git a/gfx/thebes/gfxFont.cpp b/gfx/thebes/gfxFont.cpp index e20d1aee2ea..cdb0fd935fb 100644 --- a/gfx/thebes/gfxFont.cpp +++ b/gfx/thebes/gfxFont.cpp @@ -347,7 +347,7 @@ LookupAlternateValues(gfxFontFeatureValueSet *featureLookup, uint32_t numAlternates = altValue.Length(); for (uint32_t i = 0; i < numAlternates; i++) { const gfxAlternateValue& av = altValue.ElementAt(i); - nsAutoTArray values; + AutoTArray values; // map ==> bool found = @@ -522,7 +522,7 @@ gfxFontShaper::MergeFontFeatures( // add font-specific feature values from style rules if (aStyle->featureValueLookup && numAlts > 0) { - nsAutoTArray featureList; + AutoTArray featureList; // insert list of alternate feature settings LookupAlternateValues(aStyle->featureValueLookup, aFamilyName, @@ -2190,8 +2190,8 @@ gfxFont::RenderColorGlyph(DrawTarget* aDrawTarget, const mozilla::gfx::Point& aPoint, uint32_t aGlyphId) const { - nsAutoTArray layerGlyphs; - nsAutoTArray layerColors; + AutoTArray layerGlyphs; + AutoTArray layerColors; if (!GetFontEntry()->GetColorLayersInfo(aGlyphId, layerGlyphs, layerColors)) { return false; @@ -3148,8 +3148,8 @@ gfxFont::InitFakeSmallCapsRun(DrawTarget *aDrawTarget, // apply uppercase transform to the string nsDependentSubstring origString(aText + runStart, runLength); nsAutoString convertedString; - nsAutoTArray charsToMergeArray; - nsAutoTArray deletedCharsArray; + AutoTArray charsToMergeArray; + AutoTArray deletedCharsArray; bool mergeNeeded = nsCaseTransformTextRunFactory:: TransformString(origString, diff --git a/gfx/thebes/gfxFont.h b/gfx/thebes/gfxFont.h index 511c01d8286..9047c0caccb 100644 --- a/gfx/thebes/gfxFont.h +++ b/gfx/thebes/gfxFont.h @@ -2083,7 +2083,7 @@ protected: nsExpirationState mExpirationState; gfxFontStyle mStyle; - nsAutoTArray mGlyphExtentsArray; + AutoTArray mGlyphExtentsArray; nsAutoPtr > > mGlyphChangeObservers; gfxFloat mAdjustedSize; diff --git a/gfx/thebes/gfxFontEntry.cpp b/gfx/thebes/gfxFontEntry.cpp index 7dd5d9e573b..84fcbd2bcc9 100644 --- a/gfx/thebes/gfxFontEntry.cpp +++ b/gfx/thebes/gfxFontEntry.cpp @@ -1148,7 +1148,7 @@ gfxFontEntry* gfxFontFamily::FindFontForStyle(const gfxFontStyle& aFontStyle, bool& aNeedsSyntheticBold) { - nsAutoTArray matched; + AutoTArray matched; FindAllFontsForStyle(aFontStyle, matched, aNeedsSyntheticBold); if (!matched.IsEmpty()) { return matched[0]; @@ -1636,7 +1636,7 @@ gfxFontFamily::ReadOtherFamilyNamesForFace(gfxPlatformFontList *aPlatformFontLis { uint32_t dataLength; const char *nameData = hb_blob_get_data(aNameTable, &dataLength); - nsAutoTArray otherFamilyNames; + AutoTArray otherFamilyNames; ReadOtherFamilyNamesForFace(mName, nameData, dataLength, otherFamilyNames, useFullName); @@ -1721,7 +1721,7 @@ gfxFontFamily::ReadFaceNames(gfxPlatformFontList *aPlatformFontList, aFontInfoData->mLoadOtherNames && !asyncFontLoaderDisabled) { - nsAutoTArray otherFamilyNames; + AutoTArray otherFamilyNames; bool foundOtherNames = aFontInfoData->GetOtherFamilyNames(mName, otherFamilyNames); if (foundOtherNames) { diff --git a/gfx/thebes/gfxFontconfigFonts.cpp b/gfx/thebes/gfxFontconfigFonts.cpp index f637fc20261..2e5950e1a05 100644 --- a/gfx/thebes/gfxFontconfigFonts.cpp +++ b/gfx/thebes/gfxFontconfigFonts.cpp @@ -189,7 +189,7 @@ public: cairo_font_face_reference(mFontFace); cairo_font_face_set_user_data(mFontFace, &sFontEntryKey, this, nullptr); - // mPatterns is an nsAutoTArray with 1 space always available, so the + // mPatterns is an AutoTArray with 1 space always available, so the // AppendElement always succeeds. // FIXME: Make this infallible after bug 968520 is done. MOZ_ALWAYS_TRUE(mPatterns.AppendElement(fallible)); @@ -913,7 +913,7 @@ gfxFcFontSet::SortPreferredFonts(bool &aWaitForUserFont) // but FcConfigSubstitute may add more values (e.g. prepending "en" to // "ja" will use western fonts to render Latin/Arabic numerals in Japanese // text.) - nsAutoTArray requiredLangs; + AutoTArray requiredLangs; for (int v = 0; ; ++v) { FcChar8 *lang; FcResult result = FcPatternGetString(mSortPattern, FC_LANG, v, &lang); @@ -1289,7 +1289,7 @@ gfxPangoFontGroup::FindGenericFontsPFG(FontFamilyType aGenericType, nsIAtom *aLanguage, void *aClosure) { - nsAutoTArray resolvedGenerics; + AutoTArray resolvedGenerics; ResolveGenericFontNamesPFG(aGenericType, aLanguage, resolvedGenerics); uint32_t g = 0, numGenerics = resolvedGenerics.Length(); for (g = 0; g < numGenerics; g++) { @@ -1494,7 +1494,7 @@ gfxPangoFontGroup::MakeFontSet(PangoLanguage *aLang, gfxFloat aSizeAdjustFactor, langGroup = do_GetAtom(lang); } - nsAutoTArray fcFamilyList; + AutoTArray fcFamilyList; EnumerateFontListPFG(langGroup ? langGroup.get() : mStyle.language.get(), &fcFamilyList); diff --git a/gfx/thebes/gfxFontconfigFonts.h b/gfx/thebes/gfxFontconfigFonts.h index d08749745aa..76b3e6b0fa9 100644 --- a/gfx/thebes/gfxFontconfigFonts.h +++ b/gfx/thebes/gfxFontconfigFonts.h @@ -73,7 +73,7 @@ private: }; // There is only one of entry in this array unless characters from scripts // of other languages are measured. - nsAutoTArray mFontSets; + AutoTArray mFontSets; gfxFloat mSizeAdjustFactor; PangoLanguage *mPangoLanguage; diff --git a/gfx/thebes/gfxFontconfigUtils.cpp b/gfx/thebes/gfxFontconfigUtils.cpp index 6b2633bf43b..867f60747ed 100644 --- a/gfx/thebes/gfxFontconfigUtils.cpp +++ b/gfx/thebes/gfxFontconfigUtils.cpp @@ -985,7 +985,7 @@ gfxFontconfigUtils::GetLangSupportEntry(const FcChar8 *aLang, bool aWithFonts) #endif }; - nsAutoTArray fonts; + AutoTArray fonts; for (unsigned fs = 0; fs < ArrayLength(fontSets); ++fs) { FcFontSet *fontSet = fontSets[fs]; diff --git a/gfx/thebes/gfxFontconfigUtils.h b/gfx/thebes/gfxFontconfigUtils.h index de9f27f9065..86e9a2c3b46 100644 --- a/gfx/thebes/gfxFontconfigUtils.h +++ b/gfx/thebes/gfxFontconfigUtils.h @@ -260,11 +260,11 @@ protected: return mFonts; } - // Don't memmove the nsAutoTArray. + // Don't memmove the AutoTArray. enum { ALLOW_MEMMOVE = false }; private: // There is usually only one font, but sometimes more. - nsAutoTArray,1> mFonts; + AutoTArray,1> mFonts; }; class LangSupportEntry : public CopiedFcStrEntry { diff --git a/gfx/thebes/gfxGraphiteShaper.cpp b/gfx/thebes/gfxGraphiteShaper.cpp index 97ac0f4d3ea..257655a6c20 100644 --- a/gfx/thebes/gfxGraphiteShaper.cpp +++ b/gfx/thebes/gfxGraphiteShaper.cpp @@ -313,7 +313,7 @@ gfxGraphiteShaper::SetGlyphsFromSegment(DrawTarget *aDrawTarget, charGlyphs[offs].SetSimpleGlyph(appAdvance, gids[c.baseGlyph]); } else { // not a one-to-one mapping with simple metrics: use DetailedGlyph - nsAutoTArray details; + AutoTArray details; float clusterLoc; for (uint32_t j = c.baseGlyph; j < c.baseGlyph + c.nGlyphs; ++j) { gfxShapedText::DetailedGlyph* d = details.AppendElement(); diff --git a/gfx/thebes/gfxHarfBuzzShaper.cpp b/gfx/thebes/gfxHarfBuzzShaper.cpp index 8299ca9d884..675307098de 100644 --- a/gfx/thebes/gfxHarfBuzzShaper.cpp +++ b/gfx/thebes/gfxHarfBuzzShaper.cpp @@ -1498,7 +1498,7 @@ gfxHarfBuzzShaper::ShapeText(DrawTarget *aDrawTarget, gfxFontEntry *entry = mFont->GetFontEntry(); // insert any merged features into hb_feature array - nsAutoTArray features; + AutoTArray features; MergeFontFeatures(style, entry->mFeatureSettings, aShapedText->DisableLigatures(), @@ -1579,7 +1579,7 @@ gfxHarfBuzzShaper::SetGlyphsFromRun(DrawTarget *aDrawTarget, return NS_OK; } - nsAutoTArray detailedGlyphs; + AutoTArray detailedGlyphs; uint32_t wordLength = aLength; static const int32_t NO_GLYPH = -1; diff --git a/gfx/thebes/gfxMacPlatformFontList.mm b/gfx/thebes/gfxMacPlatformFontList.mm index 4ee0f0cd415..9d2a85a9965 100644 --- a/gfx/thebes/gfxMacPlatformFontList.mm +++ b/gfx/thebes/gfxMacPlatformFontList.mm @@ -733,7 +733,7 @@ gfxMacPlatformFontList::InitFontList() void gfxMacPlatformFontList::InitSingleFaceList() { - nsAutoTArray singleFaceFonts; + AutoTArray singleFaceFonts; gfxFontUtils::GetPrefsFontList("font.single-face-list", singleFaceFonts); uint32_t numFonts = singleFaceFonts.Length(); @@ -902,7 +902,7 @@ gfxMacPlatformFontList::InitSystemFonts() #endif nsAutoCString en("en"); - nsAutoTArray list; + AutoTArray list; LookupFontCascadeForLang(en, list); mDefaultCascadeFamilies.AppendElements(list); } @@ -1018,7 +1018,7 @@ gfxMacPlatformFontList::GlobalFontFallback(const uint32_t aCh, ::CFStringCompare(familyNameRef, CFSTR("LastResort"), kCFCompareCaseInsensitive) != kCFCompareEqualTo) { - nsAutoTArray buffer; + AutoTArray buffer; CFIndex familyNameLen = ::CFStringGetLength(familyNameRef); buffer.SetLength(familyNameLen+1); ::CFStringGetCharacters(familyNameRef, ::CFRangeMake(0, familyNameLen), @@ -1300,7 +1300,7 @@ gfxMacPlatformFontList::AppendLinkedSystemFamilies(nsIAtom* aLanguage, } // lookup the cascade fonts - nsAutoTArray list; + AutoTArray list; LookupFontCascadeForLang(lang, list); // add cascade to cascade cache @@ -1380,7 +1380,7 @@ MacFontInfo::LoadFontFamilyData(const nsAString& aFamilyName) CFStringRef faceName = (CFStringRef) CTFontDescriptorCopyAttribute(faceDesc, kCTFontNameAttribute); - nsAutoTArray buffer; + AutoTArray buffer; CFIndex len = CFStringGetLength(faceName); buffer.SetLength(len+1); CFStringGetCharacters(faceName, ::CFRangeMake(0, len), diff --git a/gfx/thebes/gfxPlatformFontList.cpp b/gfx/thebes/gfxPlatformFontList.cpp index dd5521c87e8..9ed85639bc2 100644 --- a/gfx/thebes/gfxPlatformFontList.cpp +++ b/gfx/thebes/gfxPlatformFontList.cpp @@ -391,7 +391,7 @@ gfxPlatformFontList::LookupInFaceNameLists(const nsAString& aFaceName) void gfxPlatformFontList::PreloadNamesList() { - nsAutoTArray preloadFonts; + AutoTArray preloadFonts; gfxFontUtils::GetPrefsFontList("font.preload-names-list", preloadFonts); uint32_t numFonts = preloadFonts.Length(); @@ -411,7 +411,7 @@ gfxPlatformFontList::PreloadNamesList() void gfxPlatformFontList::LoadBadUnderlineList() { - nsAutoTArray blacklist; + AutoTArray blacklist; gfxFontUtils::GetPrefsFontList("font.blacklist.underline_offset", blacklist); uint32_t numFonts = blacklist.Length(); for (uint32_t i = 0; i < numFonts; i++) { @@ -568,7 +568,7 @@ gfxPlatformFontList::CommonFontFallback(uint32_t aCh, uint32_t aNextCh, const gfxFontStyle* aMatchStyle, gfxFontFamily** aMatchedFamily) { - nsAutoTArray defaultFallbacks; + AutoTArray defaultFallbacks; uint32_t i, numFallbacks; gfxPlatform::GetPlatform()->GetCommonFallbackFonts(aCh, aNextCh, @@ -795,7 +795,7 @@ gfxPlatformFontList::ResolveGenericFontNames( return; } - nsAutoTArray genericFamilies; + AutoTArray genericFamilies; // load family for "font.name.generic.lang" nsAutoCString prefFontName("font.name."); diff --git a/gfx/thebes/gfxTextRun.cpp b/gfx/thebes/gfxTextRun.cpp index 854557e32eb..aa7207f176e 100644 --- a/gfx/thebes/gfxTextRun.cpp +++ b/gfx/thebes/gfxTextRun.cpp @@ -397,7 +397,7 @@ gfxTextRun::DrawGlyphs(gfxFont *aFont, uint32_t aStart, uint32_t aEnd, uint32_t aSpacingStart, uint32_t aSpacingEnd, TextRunDrawParams& aParams, uint16_t aOrientation) { - nsAutoTArray spacingBuffer; + AutoTArray spacingBuffer; bool haveSpacing = GetAdjustedSpacingArray(aStart, aEnd, aProvider, aSpacingStart, aSpacingEnd, &spacingBuffer); aParams.spacing = haveSpacing ? spacingBuffer.Elements() : nullptr; @@ -711,7 +711,7 @@ gfxTextRun::DrawEmphasisMarks(gfxContext *aContext, gfxTextRun* aMark, inlineCoord += direction * ComputePartialLigatureWidth(start, ligatureRunStart, aProvider); - nsAutoTArray spacingBuffer; + AutoTArray spacingBuffer; bool haveSpacing = GetAdjustedSpacingArray( ligatureRunStart, ligatureRunEnd, aProvider, ligatureRunStart, ligatureRunEnd, &spacingBuffer); @@ -734,7 +734,7 @@ gfxTextRun::AccumulateMetricsForRun(gfxFont *aFont, uint16_t aOrientation, Metrics *aMetrics) { - nsAutoTArray spacingBuffer; + AutoTArray spacingBuffer; bool haveSpacing = GetAdjustedSpacingArray(aStart, aEnd, aProvider, aSpacingStart, aSpacingEnd, &spacingBuffer); Metrics metrics = aFont->Measure(this, aStart, aEnd, aBoundingBoxType, @@ -1027,7 +1027,7 @@ gfxTextRun::GetAdvanceWidth(uint32_t aStart, uint32_t aLength, // processing it along with the glyphs. if (aProvider && (mFlags & gfxTextRunFactory::TEXT_ENABLE_SPACING)) { uint32_t i; - nsAutoTArray spacingBuffer; + AutoTArray spacingBuffer; if (spacingBuffer.AppendElements(aLength)) { GetAdjustedSpacing(this, ligatureRunStart, ligatureRunEnd, aProvider, spacingBuffer.Elements()); @@ -1614,7 +1614,7 @@ gfxFontGroup::BuildFontList() } // initialize fonts in the font family list - nsAutoTArray fonts; + AutoTArray fonts; gfxPlatformFontList *pfl = gfxPlatformFontList::PlatformFontList(); // lookup fonts in the fontlist @@ -1682,7 +1682,7 @@ void gfxFontGroup::AddFamilyToFontList(gfxFontFamily* aFamily) { NS_ASSERTION(aFamily, "trying to add a null font family to fontlist"); - nsAutoTArray fontEntryList; + AutoTArray fontEntryList; bool needsBold; aFamily->FindAllFontsForStyle(mStyle, fontEntryList, needsBold); // add these to the fontlist @@ -1846,7 +1846,7 @@ gfxFontGroup::GetDefaultFont() // that assumes it will be able to get valid metrics for layout, // just look for the first usable font and put in the list. // (see bug 554544) - nsAutoTArray,200> familyList; + AutoTArray,200> familyList; pfl->GetFontFamilyList(familyList); numFonts = familyList.Length(); for (uint32_t i = 0; i < numFonts; ++i) { @@ -2345,7 +2345,7 @@ gfxFontGroup::InitScriptRun(DrawTarget* aDrawTarget, gfxFont *mainFont = GetFirstValidFont(); uint32_t runStart = 0; - nsAutoTArray fontRanges; + AutoTArray fontRanges; ComputeRanges(fontRanges, aString, aLength, aRunScript, aTextRun->GetFlags() & gfxTextRunFactory::TEXT_ORIENT_MASK); uint32_t numRanges = fontRanges.Length(); diff --git a/gfx/thebes/gfxTextRun.h b/gfx/thebes/gfxTextRun.h index d60b5854922..ea576acc5de 100644 --- a/gfx/thebes/gfxTextRun.h +++ b/gfx/thebes/gfxTextRun.h @@ -717,7 +717,7 @@ private: // XXX this should be changed to a GlyphRun plus a maybe-null GlyphRun*, // for smaller size especially in the super-common one-glyphrun case - nsAutoTArray mGlyphRuns; + AutoTArray mGlyphRuns; void *mUserData; gfxFontGroup *mFontGroup; // addrefed on creation, but our reference diff --git a/gfx/thebes/gfxWindowsPlatform.cpp b/gfx/thebes/gfxWindowsPlatform.cpp index f7e5341b0b5..48e31c75695 100755 --- a/gfx/thebes/gfxWindowsPlatform.cpp +++ b/gfx/thebes/gfxWindowsPlatform.cpp @@ -1284,7 +1284,7 @@ gfxWindowsPlatform::GetDLLVersion(char16ptr_t aDLLPath, nsAString& aVersion) // version info not available case aVersion.AssignLiteral(MOZ_UTF16("0.0.0.0")); versInfoSize = GetFileVersionInfoSizeW(aDLLPath, nullptr); - nsAutoTArray versionInfo; + AutoTArray versionInfo; if (versInfoSize == 0 || !versionInfo.AppendElements(uint32_t(versInfoSize))) diff --git a/hal/gonk/GonkSensor.cpp b/hal/gonk/GonkSensor.cpp index 7bffd63fe63..9f94e9b6926 100644 --- a/hal/gonk/GonkSensor.cpp +++ b/hal/gonk/GonkSensor.cpp @@ -183,7 +183,7 @@ public: private: SensorData mSensorData; - nsAutoTArray mSensorValues; + AutoTArray mSensorValues; }; namespace hal_impl { diff --git a/image/RasterImage.cpp b/image/RasterImage.cpp index 2e4e03a9437..fe6ad040e56 100644 --- a/image/RasterImage.cpp +++ b/image/RasterImage.cpp @@ -721,7 +721,7 @@ RasterImage::UpdateImageContainer() } mLastImageContainerDrawResult = drawResult; - nsAutoTArray imageList; + AutoTArray imageList; imageList.AppendElement(ImageContainer::NonOwningImage(image)); container->SetCurrentImages(imageList); } diff --git a/image/decoders/icon/mac/nsIconChannelCocoa.mm b/image/decoders/icon/mac/nsIconChannelCocoa.mm index 2b6c6e12d03..e6208d7be75 100644 --- a/image/decoders/icon/mac/nsIconChannelCocoa.mm +++ b/image/decoders/icon/mac/nsIconChannelCocoa.mm @@ -350,7 +350,7 @@ nsIconChannel::MakeInputStream(nsIInputStream** _retval, // create our buffer int32_t bufferCapacity = 2 + [bitmapRep bytesPerPlane]; - nsAutoTArray iconBuffer; // initial size is for + AutoTArray iconBuffer; // initial size is for // 16x16 iconBuffer.SetLength(bufferCapacity); diff --git a/image/imgLoader.cpp b/image/imgLoader.cpp index 9ce4ccb0244..ac4a8f8589a 100644 --- a/image/imgLoader.cpp +++ b/image/imgLoader.cpp @@ -1356,7 +1356,7 @@ NS_IMETHODIMP_(void) imgLoader::ClearCacheForControlledDocument(nsIDocument* aDoc) { MOZ_ASSERT(aDoc); - nsAutoTArray, 128> entriesToBeRemoved; + AutoTArray, 128> entriesToBeRemoved; imgCacheTable& cache = GetCache(false); for (auto iter = cache.Iter(); !iter.Done(); iter.Next()) { auto& key = iter.Key(); diff --git a/intl/hyphenation/glue/nsHyphenator.cpp b/intl/hyphenation/glue/nsHyphenator.cpp index 8a75090e40f..6235f5550c8 100644 --- a/intl/hyphenation/glue/nsHyphenator.cpp +++ b/intl/hyphenation/glue/nsHyphenator.cpp @@ -121,7 +121,7 @@ nsHyphenator::Hyphenate(const nsAString& aString, } } - nsAutoTArray utf8hyphens; + AutoTArray utf8hyphens; utf8hyphens.SetLength(utf8.Length() + 5); char **rep = nullptr; int *pos = nullptr; diff --git a/intl/locale/mac/nsDateTimeFormatMac.cpp b/intl/locale/mac/nsDateTimeFormatMac.cpp index e4ab1fc822f..6ee73292d7a 100644 --- a/intl/locale/mac/nsDateTimeFormatMac.cpp +++ b/intl/locale/mac/nsDateTimeFormatMac.cpp @@ -217,7 +217,7 @@ nsresult nsDateTimeFormatMac::FormatTMTime(nsILocale* locale, CFIndex stringLen = CFStringGetLength(formattedDate); - nsAutoTArray stringBuffer; + AutoTArray stringBuffer; stringBuffer.SetLength(stringLen + 1); CFStringGetCharacters(formattedDate, CFRangeMake(0, stringLen), stringBuffer.Elements()); stringOut.Assign(reinterpret_cast(stringBuffer.Elements()), stringLen); diff --git a/intl/locale/nsLocaleService.cpp b/intl/locale/nsLocaleService.cpp index 76d89abcb55..13b3f7f01b3 100644 --- a/intl/locale/nsLocaleService.cpp +++ b/intl/locale/nsLocaleService.cpp @@ -178,7 +178,7 @@ nsLocaleService::nsLocaleService(void) CFStringRef userLocaleStr = ::CFLocaleGetIdentifier(userLocaleRef); ::CFRetain(userLocaleStr); - nsAutoTArray buffer; + AutoTArray buffer; int size = ::CFStringGetLength(userLocaleStr); buffer.SetLength(size + 1); CFRange range = ::CFRangeMake(0, size); diff --git a/intl/lwbrk/nsJISx4051LineBreaker.cpp b/intl/lwbrk/nsJISx4051LineBreaker.cpp index 1b2a2382e0f..b2d0019df3d 100644 --- a/intl/lwbrk/nsJISx4051LineBreaker.cpp +++ b/intl/lwbrk/nsJISx4051LineBreaker.cpp @@ -774,7 +774,7 @@ nsJISx4051LineBreaker::WordMove(const char16_t* aText, uint32_t aLen, } int32_t ret; - nsAutoTArray breakState; + AutoTArray breakState; if (!textNeedsJISx4051 || !breakState.AppendElements(end - begin)) { // No complex text character, do not try to do complex line break. // (This is required for serializers. See Bug #344816.) diff --git a/intl/lwbrk/nsPangoBreaker.cpp b/intl/lwbrk/nsPangoBreaker.cpp index 8d5104c42d1..c6fcb37cf8b 100644 --- a/intl/lwbrk/nsPangoBreaker.cpp +++ b/intl/lwbrk/nsPangoBreaker.cpp @@ -18,7 +18,7 @@ NS_GetComplexLineBreaks(const char16_t* aText, uint32_t aLength, memset(aBreakBefore, false, aLength * sizeof(uint8_t)); - nsAutoTArray attrBuffer; + AutoTArray attrBuffer; if (!attrBuffer.AppendElements(aLength + 1)) return; diff --git a/intl/lwbrk/nsUniscribeBreaker.cpp b/intl/lwbrk/nsUniscribeBreaker.cpp index 0d29d284a31..2a1b69b2267 100644 --- a/intl/lwbrk/nsUniscribeBreaker.cpp +++ b/intl/lwbrk/nsUniscribeBreaker.cpp @@ -21,7 +21,7 @@ NS_GetComplexLineBreaks(const char16_t* aText, uint32_t aLength, int outItems = 0; HRESULT result; - nsAutoTArray items; + AutoTArray items; char16ptr_t text = aText; memset(aBreakBefore, false, aLength); @@ -42,7 +42,7 @@ NS_GetComplexLineBreaks(const char16_t* aText, uint32_t aLength, for (int iItem = 0; iItem < outItems; ++iItem) { uint32_t endOffset = (iItem + 1 == outItems ? aLength : items[iItem + 1].iCharPos); uint32_t startOffset = items[iItem].iCharPos; - nsAutoTArray sla; + AutoTArray sla; if (!sla.AppendElements(endOffset - startOffset)) return; diff --git a/ipc/glue/IPCMessageUtils.h b/ipc/glue/IPCMessageUtils.h index 1677c586226..93f2aed488d 100644 --- a/ipc/glue/IPCMessageUtils.h +++ b/ipc/glue/IPCMessageUtils.h @@ -542,9 +542,9 @@ struct ParamTraits > }; template -struct ParamTraits> : ParamTraits> +struct ParamTraits> : ParamTraits> { - typedef nsAutoTArray paramType; + typedef AutoTArray paramType; }; template<> diff --git a/ipc/glue/WindowsMessageLoop.cpp b/ipc/glue/WindowsMessageLoop.cpp index fcf0b201368..f743a93e1fc 100644 --- a/ipc/glue/WindowsMessageLoop.cpp +++ b/ipc/glue/WindowsMessageLoop.cpp @@ -830,7 +830,7 @@ MessageChannel::SyncStackFrame::SyncStackFrame(MessageChannel* channel, bool int if (!mStaticPrev) { NS_ASSERTION(!gNeuteredWindows, "Should only set this once!"); - gNeuteredWindows = new nsAutoTArray(); + gNeuteredWindows = new AutoTArray(); NS_ASSERTION(gNeuteredWindows, "Out of memory!"); } } diff --git a/js/xpconnect/src/XPCWrappedNative.cpp b/js/xpconnect/src/XPCWrappedNative.cpp index 5f415f9a79c..9a3aae5b7d9 100644 --- a/js/xpconnect/src/XPCWrappedNative.cpp +++ b/js/xpconnect/src/XPCWrappedNative.cpp @@ -1288,7 +1288,7 @@ class MOZ_STACK_CLASS CallMethodHelper const uint16_t mVTableIndex; HandleId mIdxValueId; - nsAutoTArray mDispatchParams; + AutoTArray mDispatchParams; uint8_t mJSContextIndex; // TODO make const uint8_t mOptArgcIndex; // TODO make const diff --git a/layout/base/FrameLayerBuilder.cpp b/layout/base/FrameLayerBuilder.cpp index 43124d96b40..50d40788a32 100644 --- a/layout/base/FrameLayerBuilder.cpp +++ b/layout/base/FrameLayerBuilder.cpp @@ -213,13 +213,13 @@ FrameLayerBuilder::DisplayItemData::BeginUpdate(Layer* aLayer, LayerState aState // We avoid adding or removing element unnecessarily // since we have to modify userdata each time - nsAutoTArray copy(mFrameList); + AutoTArray copy(mFrameList); if (!copy.RemoveElement(aItem->Frame())) { AddFrame(aItem->Frame()); mFrameListChanges.AppendElement(aItem->Frame()); } - nsAutoTArray mergedFrames; + AutoTArray mergedFrames; aItem->GetMergedFrames(&mergedFrames); for (uint32_t i = 0; i < mergedFrames.Length(); ++i) { if (!copy.RemoveElement(mergedFrames[i])) { @@ -1382,7 +1382,7 @@ protected: * It's essential that this array is only appended to, since PaintedLayerData * records the index of its PaintedLayer in this array. */ - typedef nsAutoTArray AutoLayersArray; + typedef AutoTArray AutoLayersArray; AutoLayersArray mNewChildLayers; nsTHashtable> mPaintedLayersAvailableForRecycling; nscoord mAppUnitsPerDevPixel; @@ -4667,7 +4667,7 @@ ContainerState::SetupScrollingMetadata(NewLayerEntry* aEntry) return; } - nsAutoTArray metricsArray; + AutoTArray metricsArray; if (aEntry->mBaseFrameMetrics) { metricsArray.AppendElement(*aEntry->mBaseFrameMetrics); @@ -4768,7 +4768,7 @@ GetStationaryClipInContainer(Layer* aLayer) void ContainerState::PostprocessRetainedLayers(nsIntRegion* aOpaqueRegionForContainer) { - nsAutoTArray opaqueRegions; + AutoTArray opaqueRegions; bool hideAll = false; int32_t opaqueRegionForContainer = -1; diff --git a/layout/base/FrameLayerBuilder.h b/layout/base/FrameLayerBuilder.h index 5f018d0fdaa..96049dd0e0a 100644 --- a/layout/base/FrameLayerBuilder.h +++ b/layout/base/FrameLayerBuilder.h @@ -489,7 +489,7 @@ public: RefPtr mLayer; RefPtr mOptLayer; RefPtr mInactiveManager; - nsAutoTArray mFrameList; + AutoTArray mFrameList; nsAutoPtr mGeometry; DisplayItemClip mClip; uint32_t mDisplayItemKey; @@ -501,7 +501,7 @@ public: * BeginUpdate and EndUpdate. */ nsDisplayItem* mItem; - nsAutoTArray mFrameListChanges; + AutoTArray mFrameListChanges; /** * Used to track if data currently stored in mFramesWithLayers (from an existing diff --git a/layout/base/PositionedEventTargeting.cpp b/layout/base/PositionedEventTargeting.cpp index 6b02ad978da..a0170510e28 100644 --- a/layout/base/PositionedEventTargeting.cpp +++ b/layout/base/PositionedEventTargeting.cpp @@ -595,7 +595,7 @@ FindFrameTargetedByInputEvent(WidgetGUIEvent* aEvent, restrictToDescendants, prefs, aFlags); PET_LOG("Expanded point to target rect %s\n", mozilla::layers::Stringify(targetRect).c_str()); - nsAutoTArray candidates; + AutoTArray candidates; nsresult rv = nsLayoutUtils::GetFramesForArea(aRootFrame, targetRect, candidates, flags); if (NS_FAILED(rv)) { return target; diff --git a/layout/base/RestyleManager.h b/layout/base/RestyleManager.h index 2f0b914f074..7bb8cb7ab8c 100644 --- a/layout/base/RestyleManager.h +++ b/layout/base/RestyleManager.h @@ -917,7 +917,7 @@ class MOZ_STACK_CLASS AutoDisplayContentsAncestorPusher final private: TreeMatchContext& mTreeMatchContext; nsPresContext* const mPresContext; - nsAutoTArray mAncestors; + AutoTArray mAncestors; }; } // namespace mozilla diff --git a/layout/base/RestyleTracker.cpp b/layout/base/RestyleTracker.cpp index 0c2237048d4..c0ff65e78eb 100644 --- a/layout/base/RestyleTracker.cpp +++ b/layout/base/RestyleTracker.cpp @@ -165,7 +165,7 @@ RestyleTracker::DoProcessRestyles() while (mPendingRestyles.Count()) { if (mHaveLaterSiblingRestyles) { // Convert them to individual restyles on all the later siblings - nsAutoTArray, RESTYLE_ARRAY_STACKSIZE> laterSiblingArr; + AutoTArray, RESTYLE_ARRAY_STACKSIZE> laterSiblingArr; for (auto iter = mPendingRestyles.Iter(); !iter.Done(); iter.Next()) { auto element = static_cast(iter.Key()); // Only collect the entries that actually need restyling by us (and @@ -280,7 +280,7 @@ RestyleTracker::DoProcessRestyles() // scratch array instead of calling out to ProcessOneRestyle while // enumerating the hashtable. Use the stack if we can, otherwise // fall back on heap-allocation. - nsAutoTArray restyleArr; + AutoTArray restyleArr; RestyleEnumerateData* restylesToProcess = restyleArr.AppendElements(mPendingRestyles.Count()); if (restylesToProcess) { diff --git a/layout/base/RestyleTracker.h b/layout/base/RestyleTracker.h index e2e7d943551..33bf4a6b7be 100644 --- a/layout/base/RestyleTracker.h +++ b/layout/base/RestyleTracker.h @@ -390,7 +390,7 @@ private: const RestyleHintData& aRestyleHintData); typedef nsClassHashtable PendingRestyleTable; - typedef nsAutoTArray< RefPtr, 32> RestyleRootArray; + typedef AutoTArray< RefPtr, 32> RestyleRootArray; // Our restyle bits. These will be a subset of ELEMENT_ALL_RESTYLE_FLAGS, and // will include one flag from ELEMENT_PENDING_RESTYLE_FLAGS, one flag // from ELEMENT_POTENTIAL_RESTYLE_ROOT_FLAGS, and might also include diff --git a/layout/base/nsBidiPresUtils.cpp b/layout/base/nsBidiPresUtils.cpp index 2d423aecbcb..cce51607b81 100644 --- a/layout/base/nsBidiPresUtils.cpp +++ b/layout/base/nsBidiPresUtils.cpp @@ -105,7 +105,7 @@ static char16_t GetBidiControl(nsStyleContext* aStyleContext, struct BidiParagraphData { nsString mBuffer; - nsAutoTArray mEmbeddingStack; + AutoTArray mEmbeddingStack; nsTArray mLogicalFrames; nsTArray mLinePerFrame; nsDataHashtable mContentToFrameIndex; @@ -394,7 +394,7 @@ struct BidiLineData { nsTArray mLogicalFrames; nsTArray mVisualFrames; nsTArray mIndexMap; - nsAutoTArray mLevels; + AutoTArray mLevels; bool mIsReordered; BidiLineData(nsIFrame* aFirstFrameOnLine, int32_t aNumFramesOnLine) diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index 16bbba972dd..81b31dc162b 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -1310,7 +1310,7 @@ nsFrameConstructorState::ProcessFrameInsertions(nsAbsoluteItems& aFrameItems, nsIFrame* firstNewFrame = aFrameItems.FirstChild(); // Cache the ancestor chain so that we can reuse it if needed. - nsAutoTArray firstNewFrameAncestors; + AutoTArray firstNewFrameAncestors; nsIFrame* notCommonAncestor = nullptr; if (lastChild) { notCommonAncestor = nsLayoutUtils::FillAncestors(firstNewFrame, @@ -1328,7 +1328,7 @@ nsFrameConstructorState::ProcessFrameInsertions(nsAbsoluteItems& aFrameItems, } else { // Try the other children. First collect them to an array so that a // reasonable fast binary search can be used to find the insertion point. - nsAutoTArray children; + AutoTArray children; for (nsIFrame* f = childList.FirstChild(); f != lastChild; f = f->GetNextSibling()) { children.AppendElement(f); @@ -2840,7 +2840,7 @@ nsCSSFrameConstructor::ConstructAnonymousContentForCanvas(nsFrameConstructorStat { NS_ASSERTION(aFrame->GetType() == nsGkAtoms::canvasFrame, "aFrame should be canvas frame!"); - nsAutoTArray anonymousItems; + AutoTArray anonymousItems; GetAnonymousContent(aDocElement, aFrame, anonymousItems); if (anonymousItems.IsEmpty()) { return; @@ -3968,7 +3968,7 @@ nsCSSFrameConstructor::CreateAnonymousFrames(nsFrameConstructorState& aState, PendingBinding* aPendingBinding, nsFrameItems& aChildItems) { - nsAutoTArray newAnonymousItems; + AutoTArray newAnonymousItems; nsresult rv = GetAnonymousContent(aParent, aParentFrame, newAnonymousItems); NS_ENSURE_SUCCESS(rv, rv); @@ -10381,7 +10381,7 @@ nsCSSFrameConstructor::ProcessChildren(nsFrameConstructorState& aState, // Create any anonymous frames we need here. This must happen before the // non-anonymous children are processed to ensure that popups are never // constructed before the popupset. - nsAutoTArray anonymousItems; + AutoTArray anonymousItems; GetAnonymousContent(aContent, aPossiblyLeafFrame, anonymousItems); #ifdef DEBUG for (uint32_t i = 0; i < anonymousItems.Length(); ++i) { diff --git a/layout/base/nsCounterManager.cpp b/layout/base/nsCounterManager.cpp index 6adf34d06ea..0a2424f3bd2 100644 --- a/layout/base/nsCounterManager.cpp +++ b/layout/base/nsCounterManager.cpp @@ -94,7 +94,7 @@ nsCounterUseNode::GetText(nsString& aResult) { aResult.Truncate(); - nsAutoTArray stack; + AutoTArray stack; stack.AppendElement(static_cast(this)); if (mAllCounters && mScopeStart) diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index d6f99f31a06..52d2bd905ed 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -973,7 +973,7 @@ nsDisplayListBuilder::MarkFramesForDisplayList(nsIFrame* aDirtyFrame, void nsDisplayListBuilder::MarkPreserve3DFramesForDisplayList(nsIFrame* aDirtyFrame, const nsRect& aDirtyRect) { - nsAutoTArray childListArray; + AutoTArray childListArray; aDirtyFrame->GetChildLists(&childListArray); nsIFrame::ChildListArrayIterator lists(childListArray); for (; !lists.IsDone(); lists.Next()) { @@ -1492,7 +1492,7 @@ nsDisplayList::ComputeVisibilityForSublist(nsDisplayListBuilder* aBuilder, bool anyVisible = false; - nsAutoTArray elements; + AutoTArray elements; MoveListTo(this, &elements); for (int32_t i = elements.Length() - 1; i >= 0; --i) { @@ -1929,7 +1929,7 @@ void nsDisplayList::HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect, aState->mItemBuffer.AppendElement(item); } - nsAutoTArray temp; + AutoTArray temp; for (int32_t i = aState->mItemBuffer.Length() - 1; i >= itemBufferStart; --i) { // Pop element off the end of the buffer. We want to shorten the buffer // so that recursive calls to HitTest have more buffer space. @@ -1949,7 +1949,7 @@ void nsDisplayList::HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect, if (!item->GetClip().MayIntersect(aRect)) { continue; } - nsAutoTArray neverUsed; + AutoTArray neverUsed; // Start gethering leaves of the 3D rendering context, and // append leaves at the end of mItemBuffer. Leaves are // processed at following iterations. @@ -1960,7 +1960,7 @@ void nsDisplayList::HitTest(nsDisplayListBuilder* aBuilder, const nsRect& aRect, continue; } if (same3DContext || item->GetClip().MayIntersect(r)) { - nsAutoTArray outFrames; + AutoTArray outFrames; item->HitTest(aBuilder, aRect, aState, &outFrames); // For 3d transforms with preserve-3d we add hit frames into the temp list @@ -3684,7 +3684,7 @@ nsDisplayBoxShadowOuter::Paint(nsDisplayListBuilder* aBuilder, nsPoint offset = ToReferenceFrame(); nsRect borderRect = mFrame->VisualBorderRectRelativeToSelf() + offset; nsPresContext* presContext = mFrame->PresContext(); - nsAutoTArray rects; + AutoTArray rects; ComputeDisjointRectangles(mVisibleRegion, &rects); PROFILER_LABEL("nsDisplayBoxShadowOuter", "Paint", @@ -3772,7 +3772,7 @@ nsDisplayBoxShadowInner::Paint(nsDisplayListBuilder* aBuilder, nsPoint offset = ToReferenceFrame(); nsRect borderRect = nsRect(offset, mFrame->GetSize()); nsPresContext* presContext = mFrame->PresContext(); - nsAutoTArray rects; + AutoTArray rects; ComputeDisjointRectangles(mVisibleRegion, &rects); PROFILER_LABEL("nsDisplayBoxShadowInner", "Paint", diff --git a/layout/base/nsDisplayList.h b/layout/base/nsDisplayList.h index c730e9db3b7..819b75f13f7 100644 --- a/layout/base/nsDisplayList.h +++ b/layout/base/nsDisplayList.h @@ -1196,9 +1196,9 @@ private: nsDisplayLayerEventRegions* mLayerEventRegions; PLArenaPool mPool; nsCOMPtr mBoundingSelection; - nsAutoTArray mPresShellStates; - nsAutoTArray mFramesMarkedForDisplay; - nsAutoTArray mThemeGeometries; + AutoTArray mPresShellStates; + AutoTArray mFramesMarkedForDisplay; + AutoTArray mThemeGeometries; nsDisplayTableItem* mCurrentTableItem; DisplayListClipState mClipState; // mCurrentFrame is the frame that we're currently calling (or about to call) @@ -1360,7 +1360,7 @@ public: // Handling transform items for preserve 3D frames. bool mInPreserves3D; - nsAutoTArray mItemBuffer; + AutoTArray mItemBuffer; }; /** diff --git a/layout/base/nsIPresShell.h b/layout/base/nsIPresShell.h index 21c15cf3a4e..e8697e86a6e 100644 --- a/layout/base/nsIPresShell.h +++ b/layout/base/nsIPresShell.h @@ -1783,7 +1783,7 @@ protected: // same update block we have already had other changes that require // the whole document to be restyled (i.e., mStylesHaveChanged is already // true), then we don't bother adding the scope root here. - nsAutoTArray,1> mChangedScopeStyleRoots; + AutoTArray,1> mChangedScopeStyleRoots; static nsIContent* gKeyDownTarget; diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp index 64252a89ba3..2cd96e32136 100644 --- a/layout/base/nsLayoutUtils.cpp +++ b/layout/base/nsLayoutUtils.cpp @@ -1597,7 +1597,7 @@ nsLayoutUtils::DoCompareTreePosition(nsIContent* aContent1, NS_PRECONDITION(aContent1, "aContent1 must not be null"); NS_PRECONDITION(aContent2, "aContent2 must not be null"); - nsAutoTArray content1Ancestors; + AutoTArray content1Ancestors; nsINode* c1; for (c1 = aContent1; c1 && c1 != aCommonAncestor; c1 = c1->GetParentNode()) { content1Ancestors.AppendElement(c1); @@ -1608,7 +1608,7 @@ nsLayoutUtils::DoCompareTreePosition(nsIContent* aContent1, aCommonAncestor = nullptr; } - nsAutoTArray content2Ancestors; + AutoTArray content2Ancestors; nsINode* c2; for (c2 = aContent2; c2 && c2 != aCommonAncestor; c2 = c2->GetParentNode()) { content2Ancestors.AppendElement(c2); @@ -1702,7 +1702,7 @@ nsLayoutUtils::DoCompareTreePosition(nsIFrame* aFrame1, NS_PRECONDITION(aFrame1, "aFrame1 must not be null"); NS_PRECONDITION(aFrame2, "aFrame2 must not be null"); - nsAutoTArray frame2Ancestors; + AutoTArray frame2Ancestors; nsIFrame* nonCommonAncestor = FillAncestors(aFrame2, aCommonAncestor, &frame2Ancestors); @@ -1729,7 +1729,7 @@ nsLayoutUtils::DoCompareTreePosition(nsIFrame* aFrame1, return 0; } - nsAutoTArray frame1Ancestors; + AutoTArray frame1Ancestors; if (aCommonAncestor && !FillAncestors(aFrame1, aCommonAncestor, &frame1Ancestors)) { // We reached the root of the frame tree ... if aCommonAncestor was set, @@ -2501,8 +2501,8 @@ nsLayoutUtils::GetTransformToAncestorScaleExcludingAnimated(nsIFrame* aFrame) nsIFrame* nsLayoutUtils::FindNearestCommonAncestorFrame(nsIFrame* aFrame1, nsIFrame* aFrame2) { - nsAutoTArray ancestors1; - nsAutoTArray ancestors2; + AutoTArray ancestors1; + AutoTArray ancestors2; nsIFrame* commonAncestor = nullptr; if (aFrame1->PresContext() == aFrame2->PresContext()) { commonAncestor = aFrame1->PresContext()->PresShell()->GetRootFrame(); @@ -2959,7 +2959,7 @@ nsLayoutUtils::GetFrameForPoint(nsIFrame* aFrame, nsPoint aPt, uint32_t aFlags) js::ProfileEntry::Category::GRAPHICS); nsresult rv; - nsAutoTArray outFrames; + AutoTArray outFrames; rv = GetFramesForArea(aFrame, nsRect(aPt, nsSize(1, 1)), outFrames, aFlags); NS_ENSURE_SUCCESS(rv, nullptr); return outFrames.Length() ? outFrames.ElementAt(0) : nullptr; @@ -5038,7 +5038,7 @@ nsLayoutUtils::ComputeBSizeDependentValue( /* static */ void nsLayoutUtils::MarkDescendantsDirty(nsIFrame *aSubtreeRoot) { - nsAutoTArray subtrees; + AutoTArray subtrees; subtrees.AppendElement(aSubtreeRoot); // dirty descendants, iterating over subtrees that may include @@ -5051,7 +5051,7 @@ nsLayoutUtils::MarkDescendantsDirty(nsIFrame *aSubtreeRoot) // recursion). // Note that nsHTMLReflowState::InitResizeFlags has some similar // code; see comments there for how and why it differs. - nsAutoTArray stack; + AutoTArray stack; stack.AppendElement(subtreeRoot); do { @@ -7451,7 +7451,7 @@ nsLayoutUtils::SizeOfTextRunsForFrames(nsIFrame* aFrame, return total; } - nsAutoTArray childListArray; + AutoTArray childListArray; aFrame->GetChildLists(&childListArray); for (nsIFrame::ChildListArrayIterator childLists(childListArray); diff --git a/layout/base/nsPresContext.cpp b/layout/base/nsPresContext.cpp index 71f3b93718f..8bedc64f72f 100644 --- a/layout/base/nsPresContext.cpp +++ b/layout/base/nsPresContext.cpp @@ -3112,7 +3112,7 @@ SortConfigurations(nsTArray* aConfigurations) continue; LayoutDeviceIntRect bounds; pluginsToMove[j].mChild->GetBounds(bounds); - nsAutoTArray clipRects; + AutoTArray clipRects; pluginsToMove[j].mChild->GetWindowClipRegion(&clipRects); if (HasOverlap(bounds.TopLeft(), clipRects, config->mBounds.TopLeft(), diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index cac064d1a77..ad958a710af 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -2503,7 +2503,7 @@ PresShell::FrameNeedsReflow(nsIFrame *aFrame, IntrinsicDirty aIntrinsicDirty, } #endif - nsAutoTArray subtrees; + AutoTArray subtrees; subtrees.AppendElement(aFrame); do { @@ -2554,7 +2554,7 @@ PresShell::FrameNeedsReflow(nsIFrame *aFrame, IntrinsicDirty aIntrinsicDirty, // recursion). // Note that nsHTMLReflowState::InitResizeFlags has some similar // code; see comments there for how and why it differs. - nsAutoTArray stack; + AutoTArray stack; stack.AppendElement(subtreeRoot); do { @@ -4347,7 +4347,7 @@ PresShell::ReconstructFrames(void) void nsIPresShell::ReconstructStyleDataInternal() { - nsAutoTArray,1> scopeRoots; + AutoTArray,1> scopeRoots; mChangedScopeStyleRoots.SwapElements(scopeRoots); if (mStylesHaveChanged) { @@ -5848,7 +5848,7 @@ public: nsDisplayListBuilder::EVENT_DELIVERY, /* aBuildCert= */ false); nsDisplayList list; - nsAutoTArray outFrames; + AutoTArray outFrames; nsDisplayItem::HitTestState hitTestState; builder.EnterPresShell(mFrame); nsRect bounds = mShell->GetPresContext()->GetVisibleArea(); @@ -6738,7 +6738,7 @@ PresShell::DispatchAfterKeyboardEvent(nsINode* aTarget, } // Build up a target chain. Each item in the chain will receive an after event. - nsAutoTArray, 5> chain; + AutoTArray, 5> chain; bool targetIsIframe = false; BuildTargetChainForBeforeAfterKeyboardEvent(aTarget, chain, targetIsIframe); DispatchAfterKeyboardEventInternal(chain, aEvent, aEmbeddedCancelled); @@ -6773,7 +6773,7 @@ PresShell::HandleKeyboardEvent(nsINode* aTarget, MOZ_ASSERT(aEvent.mMessage == eKeyDown || aEvent.mMessage == eKeyUp); // Build up a target chain. Each item in the chain will receive a before event. - nsAutoTArray, 5> chain; + AutoTArray, 5> chain; bool targetIsIframe = false; BuildTargetChainForBeforeAfterKeyboardEvent(aTarget, chain, targetIsIframe); diff --git a/layout/base/nsRefreshDriver.cpp b/layout/base/nsRefreshDriver.cpp index 23eff4d44f0..2517d3c1f0e 100644 --- a/layout/base/nsRefreshDriver.cpp +++ b/layout/base/nsRefreshDriver.cpp @@ -1703,7 +1703,7 @@ nsRefreshDriver::Tick(int64_t aNowEpoch, TimeStamp aNowTime) if (mPresContext && mPresContext->GetPresShell()) { bool tracingStyleFlush = false; - nsAutoTArray observers; + AutoTArray observers; observers.AppendElements(mStyleFlushObservers); for (uint32_t j = observers.Length(); j && mPresContext && mPresContext->GetPresShell(); --j) { @@ -1743,7 +1743,7 @@ nsRefreshDriver::Tick(int64_t aNowEpoch, TimeStamp aNowTime) } else if (i == 1) { // This is the Flush_Layout case. bool tracingLayoutFlush = false; - nsAutoTArray observers; + AutoTArray observers; observers.AppendElements(mLayoutFlushObservers); for (uint32_t j = observers.Length(); j && mPresContext && mPresContext->GetPresShell(); --j) { diff --git a/layout/base/nsRefreshDriver.h b/layout/base/nsRefreshDriver.h index 94dc784675b..cc72bbb2cf0 100644 --- a/layout/base/nsRefreshDriver.h +++ b/layout/base/nsRefreshDriver.h @@ -430,9 +430,9 @@ private: nsCOMPtr mEvent; }; - nsAutoTArray mStyleFlushObservers; - nsAutoTArray mLayoutFlushObservers; - nsAutoTArray mPresShellsToInvalidateIfHidden; + AutoTArray mStyleFlushObservers; + AutoTArray mLayoutFlushObservers; + AutoTArray mPresShellsToInvalidateIfHidden; // nsTArray on purpose, because we want to be able to swap. nsTArray mFrameRequestCallbackDocs; nsTArray mThrottledFrameRequestCallbackDocs; diff --git a/layout/generic/FrameChildList.h b/layout/generic/FrameChildList.h index 34bce1e1f4e..8ccfa2ff816 100644 --- a/layout/generic/FrameChildList.h +++ b/layout/generic/FrameChildList.h @@ -93,7 +93,7 @@ class MOZ_STACK_CLASS FrameChildListIterator explicit FrameChildListIterator(const nsIFrame* aFrame); protected: - nsAutoTArray mLists; + AutoTArray mLists; }; inline mozilla::layout::FrameChildListIDs diff --git a/layout/generic/MathMLTextRunFactory.cpp b/layout/generic/MathMLTextRunFactory.cpp index 557c1bfc375..1fc3cb148a0 100644 --- a/layout/generic/MathMLTextRunFactory.cpp +++ b/layout/generic/MathMLTextRunFactory.cpp @@ -535,10 +535,10 @@ MathMLTextRunFactory::RebuildTextRun(nsTransformedTextRun* aTextRun, gfxFontGroup* fontGroup = aTextRun->GetFontGroup(); nsAutoString convertedString; - nsAutoTArray charsToMergeArray; - nsAutoTArray deletedCharsArray; - nsAutoTArray,50> styleArray; - nsAutoTArray canBreakBeforeArray; + AutoTArray charsToMergeArray; + AutoTArray deletedCharsArray; + AutoTArray,50> styleArray; + AutoTArray canBreakBeforeArray; bool mergeNeeded = false; bool singleCharMI = diff --git a/layout/generic/RubyUtils.h b/layout/generic/RubyUtils.h index 1497c93c406..0b610c49b82 100644 --- a/layout/generic/RubyUtils.h +++ b/layout/generic/RubyUtils.h @@ -97,7 +97,7 @@ public: * of the given ruby base container. */ class MOZ_STACK_CLASS AutoRubyTextContainerArray final - : public nsAutoTArray + : public AutoTArray { public: explicit AutoRubyTextContainerArray(nsRubyBaseContainerFrame* aBaseContainer); @@ -131,7 +131,7 @@ private: struct MOZ_STACK_CLASS RubyColumn { nsRubyBaseFrame* mBaseFrame; - nsAutoTArray mTextFrames; + AutoTArray mTextFrames; bool mIsIntraLevelWhitespace; RubyColumn() : mBaseFrame(nullptr), mIsIntraLevelWhitespace(false) { } @@ -204,7 +204,7 @@ private: // Frames in this array are NOT necessary part of the current column. // When in doubt, use GetFrameAtLevel to access it. // See GetFrameAtLevel() and Next() for more info. - nsAutoTArray mFrames; + AutoTArray mFrames; // Whether we are on a column for intra-level whitespaces bool mAtIntraLevelWhitespace; }; diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index 02626e1d963..01c9b7a275d 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -7219,7 +7219,7 @@ nsBlockFrame::CheckFloats(nsBlockReflowState& aState) bool anyLineDirty = false; // Check that the float list is what we would have built - nsAutoTArray lineFloats; + AutoTArray lineFloats; for (line_iterator line = begin_lines(), line_end = end_lines(); line != line_end; ++line) { if (line->HasFloats()) { @@ -7234,7 +7234,7 @@ nsBlockFrame::CheckFloats(nsBlockReflowState& aState) } } - nsAutoTArray storedFloats; + AutoTArray storedFloats; bool equal = true; uint32_t i = 0; for (nsIFrame* f : mFloats) { diff --git a/layout/generic/nsContainerFrame.cpp b/layout/generic/nsContainerFrame.cpp index d60f91e63fa..c6874b3f355 100644 --- a/layout/generic/nsContainerFrame.cpp +++ b/layout/generic/nsContainerFrame.cpp @@ -1526,7 +1526,7 @@ nsContainerFrame::DeleteNextInFlowChild(nsIFrame* aNextInFlow, // with very many next-in-flows nsIFrame* nextNextInFlow = aNextInFlow->GetNextInFlow(); if (nextNextInFlow) { - nsAutoTArray frames; + AutoTArray frames; for (nsIFrame* f = nextNextInFlow; f; f = f->GetNextInFlow()) { frames.AppendElement(f); } diff --git a/layout/generic/nsFlexContainerFrame.cpp b/layout/generic/nsFlexContainerFrame.cpp index af5d5b9ee1f..aef9f32e4d4 100644 --- a/layout/generic/nsFlexContainerFrame.cpp +++ b/layout/generic/nsFlexContainerFrame.cpp @@ -3671,7 +3671,7 @@ nsFlexContainerFrame::Reflow(nsPresContext* aPresContext, nscoord contentBoxMainSize = GetMainSizeFromReflowState(aReflowState, axisTracker); - nsAutoTArray struts; + AutoTArray struts; DoFlexLayout(aPresContext, aDesiredSize, aReflowState, aStatus, contentBoxMainSize, availableBSizeForContent, struts, axisTracker); diff --git a/layout/generic/nsFontInflationData.cpp b/layout/generic/nsFontInflationData.cpp index 1809bd5e9da..e7af2372300 100644 --- a/layout/generic/nsFontInflationData.cpp +++ b/layout/generic/nsFontInflationData.cpp @@ -100,7 +100,7 @@ NearestCommonAncestorFirstInFlow(nsIFrame *aFrame1, nsIFrame *aFrame2, aFrame2 = aFrame2->FirstInFlow(); aKnownCommonAncestor = aKnownCommonAncestor->FirstInFlow(); - nsAutoTArray ancestors1, ancestors2; + AutoTArray ancestors1, ancestors2; for (nsIFrame *f = aFrame1; f != aKnownCommonAncestor; (f = f->GetParent()) && (f = f->FirstInFlow())) { ancestors1.AppendElement(f); @@ -238,7 +238,7 @@ nsFontInflationData::FindEdgeInflatableFrameIn(nsIFrame* aFrame, } // FIXME: aDirection! - nsAutoTArray lists; + AutoTArray lists; aFrame->GetChildLists(&lists); for (uint32_t i = 0, len = lists.Length(); i < len; ++i) { const nsFrameList& list = diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 7f3bed7cf05..89d7c4acf79 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -5245,7 +5245,7 @@ nsIFrame::InvalidateFrameSubtree(uint32_t aDisplayItemKey) AddStateBits(NS_FRAME_ALL_DESCENDANTS_NEED_PAINT); - nsAutoTArray childListArray; + AutoTArray childListArray; GetCrossDocChildLists(&childListArray); nsIFrame::ChildListArrayIterator lists(childListArray); @@ -5261,7 +5261,7 @@ void nsIFrame::ClearInvalidationStateBits() { if (HasAnyStateBits(NS_FRAME_DESCENDANT_NEEDS_PAINT)) { - nsAutoTArray childListArray; + AutoTArray childListArray; GetCrossDocChildLists(&childListArray); nsIFrame::ChildListArrayIterator lists(childListArray); @@ -8956,7 +8956,7 @@ nsIFrame::AddInPopupStateBitToDescendants(nsIFrame* aFrame) { aFrame->AddStateBits(NS_FRAME_IN_POPUP); - nsAutoTArray childListArray; + AutoTArray childListArray; aFrame->GetCrossDocChildLists(&childListArray); nsIFrame::ChildListArrayIterator lists(childListArray); @@ -8978,7 +8978,7 @@ nsIFrame::RemoveInPopupStateBitFromDescendants(nsIFrame* aFrame) aFrame->RemoveStateBits(NS_FRAME_IN_POPUP); - nsAutoTArray childListArray; + AutoTArray childListArray; aFrame->GetCrossDocChildLists(&childListArray); nsIFrame::ChildListArrayIterator lists(childListArray); diff --git a/layout/generic/nsFrameState.cpp b/layout/generic/nsFrameState.cpp index 3bfadca7d06..2eec729db2f 100644 --- a/layout/generic/nsFrameState.cpp +++ b/layout/generic/nsFrameState.cpp @@ -32,7 +32,7 @@ nsCString GetFrameState(nsIFrame* aFrame) { nsCString result; - nsAutoTArray groups; + AutoTArray groups; nsFrameState state = aFrame->GetStateBits(); diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index e8055cfed8c..5f8c2014bcc 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -2721,7 +2721,7 @@ ScrollFrameHelper::AppendScrollPartsTo(nsDisplayListBuilder* aBuilder, bool overlayScrollbars = LookAndFeel::GetInt(LookAndFeel::eIntID_UseOverlayScrollbars) != 0; - nsAutoTArray scrollParts; + AutoTArray scrollParts; for (nsIFrame* kid : mOuter->PrincipalChildList()) { if (kid == mScrolledFrame || (kid->IsAbsPosContaininingBlock() || overlayScrollbars) != aPositioned) diff --git a/layout/generic/nsGridContainerFrame.cpp b/layout/generic/nsGridContainerFrame.cpp index 1c9b3819a5e..907343c61a2 100644 --- a/layout/generic/nsGridContainerFrame.cpp +++ b/layout/generic/nsGridContainerFrame.cpp @@ -958,7 +958,7 @@ struct MOZ_STACK_CLASS nsGridContainerFrame::Tracks } #endif - nsAutoTArray mSizes; + AutoTArray mSizes; nscoord mContentBoxSize; nscoord mGridGap; LogicalAxis mAxis; @@ -2563,7 +2563,7 @@ nsGridContainerFrame::Tracks::ResolveIntrinsicSize( // http://dev.w3.org/csswg/css-grid/#algo-content // We're also setting mIsFlexing on the item here to speed up // FindUsedFlexFraction later. - nsAutoTArray stateBitsPerSpan; + AutoTArray stateBitsPerSpan; nsTArray step2Items; GridItemCSSOrderIterator& iter = aState.mIter; nsRenderingContext* rc = &aState.mRenderingContext; diff --git a/layout/generic/nsHTMLReflowState.cpp b/layout/generic/nsHTMLReflowState.cpp index d297a41645d..801144b65d4 100644 --- a/layout/generic/nsHTMLReflowState.cpp +++ b/layout/generic/nsHTMLReflowState.cpp @@ -598,7 +598,7 @@ nsHTMLReflowState::InitResizeFlags(nsPresContext* aPresContext, nsIAtom* aFrameT // frame tree geometry (the width on an ancestor) rather than // style. - nsAutoTArray stack; + AutoTArray stack; stack.AppendElement(frame); do { diff --git a/layout/generic/nsIFrame.h b/layout/generic/nsIFrame.h index c4b5e5fbc1e..e26436b4676 100644 --- a/layout/generic/nsIFrame.h +++ b/layout/generic/nsIFrame.h @@ -844,7 +844,7 @@ public: nsPoint GetPositionIgnoringScrolling(); - typedef nsAutoTArray ContentArray; + typedef AutoTArray ContentArray; static void DestroyContentArray(ContentArray* aArray); #define NS_DECLARE_FRAME_PROPERTY_WITH_DTOR(prop, type, dtor) \ diff --git a/layout/generic/nsImageMap.h b/layout/generic/nsImageMap.h index 627657b1045..50dd737972c 100644 --- a/layout/generic/nsImageMap.h +++ b/layout/generic/nsImageMap.h @@ -90,7 +90,7 @@ protected: nsImageFrame* mImageFrame; // the frame that owns us nsCOMPtr mMap; - nsAutoTArray mAreas; // almost always has some entries + AutoTArray mAreas; // almost always has some entries bool mContainsBlockContents; }; diff --git a/layout/generic/nsPluginFrame.cpp b/layout/generic/nsPluginFrame.cpp index 7d40c6b68cd..2c04e83a344 100644 --- a/layout/generic/nsPluginFrame.cpp +++ b/layout/generic/nsPluginFrame.cpp @@ -313,7 +313,7 @@ nsPluginFrame::PrepForDrawing(nsIWidget *aWidget) // will be reset when nsRootPresContext computes our true // geometry. The plugin window does need to have a good size here, so // set the size explicitly to a reasonable guess. - nsAutoTArray configurations; + AutoTArray configurations; nsIWidget::Configuration* configuration = configurations.AppendElement(); nscoord appUnitsPerDevPixel = presContext->AppUnitsPerDevPixel(); configuration->mChild = mWidget; diff --git a/layout/generic/nsRubyBaseContainerFrame.cpp b/layout/generic/nsRubyBaseContainerFrame.cpp index 364324babed..72262b25d33 100644 --- a/layout/generic/nsRubyBaseContainerFrame.cpp +++ b/layout/generic/nsRubyBaseContainerFrame.cpp @@ -334,8 +334,8 @@ nsRubyBaseContainerFrame::Reflow(nsPresContext* aPresContext, // Since there are pointers refer to reflow states and line layouts, // it is necessary to guarantee that they won't be moved. For this // reason, they are wrapped in UniquePtr here. - nsAutoTArray, RTC_ARRAY_SIZE> reflowStates; - nsAutoTArray, RTC_ARRAY_SIZE> lineLayouts; + AutoTArray, RTC_ARRAY_SIZE> reflowStates; + AutoTArray, RTC_ARRAY_SIZE> lineLayouts; reflowStates.SetCapacity(rtcCount); lineLayouts.SetCapacity(rtcCount); @@ -451,7 +451,7 @@ nsRubyBaseContainerFrame::Reflow(nsPresContext* aPresContext, struct MOZ_STACK_CLASS nsRubyBaseContainerFrame::PullFrameState { ContinuationTraversingState mBase; - nsAutoTArray mTexts; + AutoTArray mTexts; const AutoRubyTextContainerArray& mTextContainers; PullFrameState(nsRubyBaseContainerFrame* aBaseContainer, diff --git a/layout/generic/nsSelection.cpp b/layout/generic/nsSelection.cpp index fad6ec2cc8b..177b394a1c2 100644 --- a/layout/generic/nsSelection.cpp +++ b/layout/generic/nsSelection.cpp @@ -3674,7 +3674,7 @@ Selection::AddItem(nsRange* aItem, int32_t* aOutIndex, bool aNoStartSelect) NS_ASSERTION(aOutIndex, "aOutIndex can't be null"); if (mUserInitiated) { - nsAutoTArray, 4> rangesToAdd; + AutoTArray, 4> rangesToAdd; *aOutIndex = -1; if (!aNoStartSelect && mType == nsISelectionController::SELECTION_NORMAL && diff --git a/layout/generic/nsTextFrame.cpp b/layout/generic/nsTextFrame.cpp index 8ebe07807c2..dbd10a55557 100644 --- a/layout/generic/nsTextFrame.cpp +++ b/layout/generic/nsTextFrame.cpp @@ -1018,10 +1018,10 @@ public: }; private: - nsAutoTArray mMappedFlows; - nsAutoTArray mLineBreakBeforeFrames; - nsAutoTArray,10> mBreakSinks; - nsAutoTArray mTextRunsToDelete; + AutoTArray mMappedFlows; + AutoTArray mLineBreakBeforeFrames; + AutoTArray,10> mBreakSinks; + AutoTArray mTextRunsToDelete; nsLineBreaker mLineBreaker; gfxTextRun* mCurrentFramesAllSameTextRun; DrawTarget* mDrawTarget; @@ -1923,7 +1923,7 @@ BuildTextRunsScanner::BuildTextRunForFrames(void* aTextBuffer) textFlags |= gfxTextRunFactory::TEXT_INCOMING_ARABICCHAR; } - nsAutoTArray textBreakPoints; + AutoTArray textBreakPoints; TextRunUserData dummyData; TextRunMappedFlow dummyMappedFlow; @@ -2174,7 +2174,7 @@ BuildTextRunsScanner::BuildTextRunForFrames(void* aTextBuffer) NS_ASSERTION(nextBreakIndex == mLineBreakBeforeFrames.Length(), "Didn't find all the frames to break-before..."); gfxSkipCharsIterator iter(skipChars); - nsAutoTArray textBreakPointsAfterTransform; + AutoTArray textBreakPointsAfterTransform; for (uint32_t i = 0; i < textBreakPoints.Length(); ++i) { nsTextFrameUtils::AppendLineBreakOffset(&textBreakPointsAfterTransform, iter.ConvertOriginalToSkipped(textBreakPoints[i])); @@ -2316,7 +2316,7 @@ BuildTextRunsScanner::SetupLineBreakerContext(gfxTextRun *aTextRun) gfxSkipChars skipChars; - nsAutoTArray textBreakPoints; + AutoTArray textBreakPoints; TextRunUserData dummyData; TextRunMappedFlow dummyMappedFlow; diff --git a/layout/generic/nsTextFrame.h b/layout/generic/nsTextFrame.h index 931f79c0a87..84a602c6d05 100644 --- a/layout/generic/nsTextFrame.h +++ b/layout/generic/nsTextFrame.h @@ -662,7 +662,7 @@ protected: } }; struct TextDecorations { - nsAutoTArray mOverlines, mUnderlines, mStrikes; + AutoTArray mOverlines, mUnderlines, mStrikes; TextDecorations() { } diff --git a/layout/generic/nsTextRunTransformations.cpp b/layout/generic/nsTextRunTransformations.cpp index 5b210947ad0..07141d5ce11 100644 --- a/layout/generic/nsTextRunTransformations.cpp +++ b/layout/generic/nsTextRunTransformations.cpp @@ -133,7 +133,7 @@ MergeCharactersInTextRun(gfxTextRun* aDest, gfxTextRun* aSrc, gfxTextRun::GlyphRunIterator iter(aSrc, 0, aSrc->GetLength()); uint32_t offset = 0; - nsAutoTArray glyphs; + AutoTArray glyphs; while (iter.NextRun()) { gfxTextRun::GlyphRun* run = iter.GetGlyphRun(); nsresult rv = aDest->AddGlyphRun(run->mFont, run->mMatchType, @@ -605,10 +605,10 @@ nsCaseTransformTextRunFactory::RebuildTextRun(nsTransformedTextRun* aTextRun, gfxMissingFontRecorder* aMFR) { nsAutoString convertedString; - nsAutoTArray charsToMergeArray; - nsAutoTArray deletedCharsArray; - nsAutoTArray canBreakBeforeArray; - nsAutoTArray,50> styleArray; + AutoTArray charsToMergeArray; + AutoTArray deletedCharsArray; + AutoTArray canBreakBeforeArray; + AutoTArray,50> styleArray; bool mergeNeeded = TransformString(aTextRun->mString, convertedString, diff --git a/layout/inspector/inDOMUtils.cpp b/layout/inspector/inDOMUtils.cpp index d7761ed35e1..5c15eb3d219 100644 --- a/layout/inspector/inDOMUtils.cpp +++ b/layout/inspector/inDOMUtils.cpp @@ -91,7 +91,7 @@ inDOMUtils::GetAllStyleSheets(nsIDOMDocument *aDocument, uint32_t *aLength, for (int32_t i = 0; i < styleSet->SheetCount(sheetType); i++) { sheets.AppendElement(styleSet->StyleSheetAt(sheetType, i)); } - nsAutoTArray xblSheetArray; + AutoTArray xblSheetArray; styleSet->AppendAllXBLStyleSheets(xblSheetArray); // The XBL stylesheet array will quite often be full of duplicates. Cope: diff --git a/layout/mathml/nsMathMLChar.cpp b/layout/mathml/nsMathMLChar.cpp index 3582633fb13..b4c9488d84b 100644 --- a/layout/mathml/nsMathMLChar.cpp +++ b/layout/mathml/nsMathMLChar.cpp @@ -1087,7 +1087,7 @@ public: bool mTryParts; private: - nsAutoTArray mTablesTried; + AutoTArray mTablesTried; bool& mGlyphFound; }; @@ -1653,7 +1653,7 @@ nsMathMLChar::StretchInternal(nsPresContext* aPresContext, // really shouldn't be doing things this way but for now // insert fallbacks into the list - nsAutoTArray mathFallbacks; + AutoTArray mathFallbacks; gfxFontUtils::GetPrefsFontList("font.name.serif.x-math", mathFallbacks); gfxFontUtils::AppendPrefsFontList("font.name-list.serif.x-math", mathFallbacks); diff --git a/layout/mathml/nsMathMLmmultiscriptsFrame.cpp b/layout/mathml/nsMathMLmmultiscriptsFrame.cpp index 126f54ca305..01a3599fe38 100644 --- a/layout/mathml/nsMathMLmmultiscriptsFrame.cpp +++ b/layout/mathml/nsMathMLmmultiscriptsFrame.cpp @@ -59,7 +59,7 @@ nsMathMLmmultiscriptsFrame::TransmitAutomaticData() int32_t count = 0; bool isSubScript = !mContent->IsMathMLElement(nsGkAtoms::msup_); - nsAutoTArray subScriptFrames; + AutoTArray subScriptFrames; nsIFrame* childFrame = mFrames.FirstChild(); while (childFrame) { if (childFrame->GetContent()->IsMathMLElement(nsGkAtoms::mprescripts_)) { diff --git a/layout/style/CSSStyleSheet.cpp b/layout/style/CSSStyleSheet.cpp index f8b79a10ae5..0a825c30a59 100644 --- a/layout/style/CSSStyleSheet.cpp +++ b/layout/style/CSSStyleSheet.cpp @@ -1327,7 +1327,7 @@ nsresult CSSStyleSheet::AddRuleProcessor(nsCSSRuleProcessor* aProcessor) { if (! mRuleProcessors) { - mRuleProcessors = new nsAutoTArray(); + mRuleProcessors = new AutoTArray(); if (!mRuleProcessors) return NS_ERROR_OUT_OF_MEMORY; } diff --git a/layout/style/CSSStyleSheet.h b/layout/style/CSSStyleSheet.h index fcf1f0b82bf..f6c0f91987f 100644 --- a/layout/style/CSSStyleSheet.h +++ b/layout/style/CSSStyleSheet.h @@ -110,7 +110,7 @@ private: size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const; - nsAutoTArray mSheets; + AutoTArray mSheets; nsCOMPtr mSheetURI; // for error reports, etc. nsCOMPtr mOriginalSheetURI; // for GetHref. Can be null. nsCOMPtr mBaseURI; // for resolving relative URIs @@ -426,7 +426,7 @@ protected: CSSStyleSheetInner* mInner; - nsAutoTArray* mRuleProcessors; + AutoTArray* mRuleProcessors; nsTArray mStyleSets; friend class ::nsMediaList; diff --git a/layout/style/CounterStyleManager.cpp b/layout/style/CounterStyleManager.cpp index 8846f80daaa..0055ef2c99a 100644 --- a/layout/style/CounterStyleManager.cpp +++ b/layout/style/CounterStyleManager.cpp @@ -121,7 +121,7 @@ GetAlphabeticCounterText(CounterValue aOrdinal, // The precise length of this array should be // ceil(log((double) aOrdinal / n * (n - 1) + 1) / log(n)). // The max length is slightly smaller than which defined below. - nsAutoTArray::digits> indexes; + AutoTArray::digits> indexes; while (aOrdinal > 0) { --aOrdinal; indexes.AppendElement(aOrdinal % n); @@ -150,7 +150,7 @@ GetNumericCounterText(CounterValue aOrdinal, } auto n = aSymbols.Length(); - nsAutoTArray::digits> indexes; + AutoTArray::digits> indexes; while (aOrdinal > 0) { indexes.AppendElement(aOrdinal % n); aOrdinal /= n; diff --git a/layout/style/Declaration.cpp b/layout/style/Declaration.cpp index b924fd237e1..78db87e95fa 100644 --- a/layout/style/Declaration.cpp +++ b/layout/style/Declaration.cpp @@ -1442,7 +1442,7 @@ Declaration::ToString(nsAString& aString) const int32_t count = mOrder.Length(); int32_t index; - nsAutoTArray shorthandsUsed; + AutoTArray shorthandsUsed; for (index = 0; index < count; index++) { nsCSSProperty property = GetPropertyAt(index); diff --git a/layout/style/Declaration.h b/layout/style/Declaration.h index 335dc0388c2..62043397042 100644 --- a/layout/style/Declaration.h +++ b/layout/style/Declaration.h @@ -411,7 +411,7 @@ private: // Subtracting eCSSProperty_COUNT from those values that represent custom // properties results in an index into mVariableOrder, which identifies the // specific variable the custom property declaration is for. - nsAutoTArray mOrder; + AutoTArray mOrder; // variable names of custom properties found in mOrder nsTArray mVariableOrder; diff --git a/layout/style/FontFace.h b/layout/style/FontFace.h index 4893b4c3960..0b65f7d3611 100644 --- a/layout/style/FontFace.h +++ b/layout/style/FontFace.h @@ -55,14 +55,14 @@ public: virtual void SetLoadState(UserFontLoadState aLoadState) override; virtual void GetUserFontSets(nsTArray& aResult) override; - const nsAutoTArray& GetFontFaces() { return mFontFaces; } + const AutoTArray& GetFontFaces() { return mFontFaces; } protected: // The FontFace objects that use this user font entry. We need to store // an array of these, not just a single pointer, since the user font // cache can return the same entry for different FontFaces that have // the same descriptor values and come from the same origin. - nsAutoTArray mFontFaces; + AutoTArray mFontFaces; }; NS_DECL_CYCLE_COLLECTING_ISUPPORTS diff --git a/layout/style/FontFaceSet.cpp b/layout/style/FontFaceSet.cpp index 372bfeea41d..6a18c330dd6 100644 --- a/layout/style/FontFaceSet.cpp +++ b/layout/style/FontFaceSet.cpp @@ -282,7 +282,7 @@ FontFaceSet::FindMatchingFontFaces(const nsAString& aFont, continue; } - nsAutoTArray entries; + AutoTArray entries; bool needsBold; family->FindAllFontsForStyle(style, entries, needsBold); diff --git a/layout/style/Loader.cpp b/layout/style/Loader.cpp index e557c4d1fea..ec87c3a0220 100644 --- a/layout/style/Loader.cpp +++ b/layout/style/Loader.cpp @@ -1801,7 +1801,7 @@ Loader::SheetComplete(SheetLoadData* aLoadData, nsresult aStatus) // 8 is probably big enough for all our common cases. It's not likely that // imports will nest more than 8 deep, and multiple sheets with the same URI // are rare. - nsAutoTArray, 8> datasToNotify; + AutoTArray, 8> datasToNotify; DoSheetComplete(aLoadData, aStatus, datasToNotify); // Now it's safe to go ahead and notify observers diff --git a/layout/style/Loader.h b/layout/style/Loader.h index d2082eb2a53..8b6117e2abb 100644 --- a/layout/style/Loader.h +++ b/layout/style/Loader.h @@ -553,7 +553,7 @@ private: // We're not likely to have many levels of @import... But likely to have // some. Allocate some storage, what the hell. - nsAutoTArray mParsingDatas; + AutoTArray mParsingDatas; // The array of posted stylesheet loaded events (SheetLoadDatas) we have. // Note that these are rare. diff --git a/layout/style/StyleAnimationValue.cpp b/layout/style/StyleAnimationValue.cpp index 553941a9b91..86fc0219239 100644 --- a/layout/style/StyleAnimationValue.cpp +++ b/layout/style/StyleAnimationValue.cpp @@ -2567,7 +2567,7 @@ StyleAnimationValue::ComputeValue(nsCSSProperty aProperty, return true; } - nsAutoTArray values; + AutoTArray values; bool ok = ComputeValues(aProperty, nsCSSProps::eIgnoreEnabledState, aTargetElement, styleRule, values, aIsContextSensitive); diff --git a/layout/style/StyleRule.cpp b/layout/style/StyleRule.cpp index 126ff110c22..e72c4198cc7 100644 --- a/layout/style/StyleRule.cpp +++ b/layout/style/StyleRule.cpp @@ -566,7 +566,7 @@ nsCSSSelector::ToString(nsAString& aString, CSSStyleSheet* aSheet, // selectors are linked from right-to-left, so the next selector in // the linked list actually precedes this one in the resulting string - nsAutoTArray stack; + AutoTArray stack; for (const nsCSSSelector *s = this; s; s = s->mNext) { stack.AppendElement(s); } diff --git a/layout/style/nsCSSParser.cpp b/layout/style/nsCSSParser.cpp index d5fc8f65add..fc4e6dbed1e 100644 --- a/layout/style/nsCSSParser.cpp +++ b/layout/style/nsCSSParser.cpp @@ -623,7 +623,7 @@ protected: void SkipUntilOneOf(const char16_t* aStopSymbolChars); // For each character in aStopSymbolChars from the end of the array // to the start, calls SkipUntil with that character. - typedef nsAutoTArray StopSymbolCharStack; + typedef AutoTArray StopSymbolCharStack; void SkipUntilAllOf(const StopSymbolCharStack& aStopSymbolChars); // returns true if the stop symbol or EOF is found, and false for an // unexpected ')', ']' or '}'; this not safe to call outside variable @@ -2537,7 +2537,7 @@ CSSParserImpl::ResolveValueWithVariableReferencesRec( MOZ_ASSERT(aResult.IsEmpty()); // Stack of closing characters for currently open constructs. - nsAutoTArray stack; + AutoTArray stack; // The resolved value for this ResolveValueWithVariableReferencesRec call. nsString value; @@ -4173,7 +4173,7 @@ CSSParserImpl::ParseFontFeatureValueSet(nsCSSFontFeatureValuesRule } // -- ident integer+ [, ident integer+] - nsAutoTArray values; + AutoTArray values; // list of font-feature-values-declaration's for (;;) { @@ -4216,7 +4216,7 @@ CSSParserImpl::ParseFontFeatureValueSet(nsCSSFontFeatureValuesRule } // value list - nsAutoTArray featureSelectors; + AutoTArray featureSelectors; nsCSSValue intValue; while (ParseNonNegativeInteger(intValue)) { @@ -5055,7 +5055,7 @@ bool CSSParserImpl::SkipUntil(char16_t aStopSymbol) { nsCSSToken* tk = &mToken; - nsAutoTArray stack; + AutoTArray stack; stack.AppendElement(aStopSymbol); for (;;) { if (!GetToken(true)) { @@ -5091,7 +5091,7 @@ bool CSSParserImpl::SkipBalancedContentUntil(char16_t aStopSymbol) { nsCSSToken* tk = &mToken; - nsAutoTArray stack; + AutoTArray stack; stack.AppendElement(aStopSymbol); for (;;) { if (!GetToken(true)) { @@ -16890,7 +16890,7 @@ CSSParserImpl::ParseValueWithVariables(CSSVariableDeclarations::Type* aType, // Indexes into ')' characters in |stack| that correspond to "var(". This // is used to stop parsing when we encounter a '!' or ';' at the top level // of a variable reference's fallback. - nsAutoTArray references; + AutoTArray references; if (!GetToken(false)) { // Variable value was empty since we reached EOF. diff --git a/layout/style/nsCSSRuleProcessor.cpp b/layout/style/nsCSSRuleProcessor.cpp index 141431ca3a2..33f73518ae6 100644 --- a/layout/style/nsCSSRuleProcessor.cpp +++ b/layout/style/nsCSSRuleProcessor.cpp @@ -175,7 +175,7 @@ struct RuleHashTableEntry : public PLDHashEntryHdr { // If you add members that have heap allocated memory be sure to change the // logic in SizeOfRuleHashTable(). // Auto length 1, because we always have at least one entry in mRules. - nsAutoTArray mRules; + AutoTArray mRules; }; struct RuleHashTagTableEntry : public RuleHashTableEntry { @@ -812,7 +812,7 @@ struct AtomSelectorEntry : public PLDHashEntryHdr { nsIAtom *mAtom; // Auto length 2, because a decent fraction of these arrays ends up // with 2 elements, and each entry is cheap. - nsAutoTArray mSelectors; + AutoTArray mSelectors; }; static void @@ -4026,7 +4026,7 @@ TreeMatchContext::InitAncestors(Element *aElement) "for the assumption that GetParentNode() is non-null " "on all element ancestors of aElement to be true"); // Collect up the ancestors - nsAutoTArray ancestors; + AutoTArray ancestors; Element* cur = aElement; do { ancestors.AppendElement(cur); @@ -4048,7 +4048,7 @@ TreeMatchContext::InitStyleScopes(Element* aElement) if (MOZ_LIKELY(aElement)) { // Collect up the ancestors - nsAutoTArray ancestors; + AutoTArray ancestors; Element* cur = aElement; do { ancestors.AppendElement(cur); diff --git a/layout/style/nsCSSValue.cpp b/layout/style/nsCSSValue.cpp index c5222181613..870e13118f3 100644 --- a/layout/style/nsCSSValue.cpp +++ b/layout/style/nsCSSValue.cpp @@ -1640,7 +1640,7 @@ nsCSSValue::AppendToString(nsCSSProperty aProperty, nsAString& aResult, // functional values const nsCSSValueList *list = GetPairValue().mYValue.GetListValue(); - nsAutoTArray altValues; + AutoTArray altValues; nsStyleUtil::ComputeFunctionalAlternates(list, altValues); nsStyleUtil::SerializeFunctionalAlternates(altValues, out); diff --git a/layout/style/nsFontFaceUtils.cpp b/layout/style/nsFontFaceUtils.cpp index 92f6bd82761..02bac4342c9 100644 --- a/layout/style/nsFontFaceUtils.cpp +++ b/layout/style/nsFontFaceUtils.cpp @@ -107,7 +107,7 @@ ScheduleReflow(nsIPresShell* aShell, nsIFrame* aFrame) nsFontFaceUtils::MarkDirtyForFontChange(nsIFrame* aSubtreeRoot, const gfxUserFontEntry* aFont) { - nsAutoTArray subtrees; + AutoTArray subtrees; subtrees.AppendElement(aSubtreeRoot); nsIPresShell* ps = aSubtreeRoot->PresContext()->PresShell(); @@ -119,7 +119,7 @@ nsFontFaceUtils::MarkDirtyForFontChange(nsIFrame* aSubtreeRoot, subtrees.RemoveElementAt(subtrees.Length() - 1); // Check all descendants to see if they use the font - nsAutoTArray stack; + AutoTArray stack; stack.AppendElement(subtreeRoot); do { diff --git a/layout/style/nsRuleNode.cpp b/layout/style/nsRuleNode.cpp index 72526d02d50..299c6b423cc 100644 --- a/layout/style/nsRuleNode.cpp +++ b/layout/style/nsRuleNode.cpp @@ -3956,7 +3956,7 @@ nsRuleNode::SetGenericFont(nsPresContext* aPresContext, nsStyleFont* aFont) { // walk up the contexts until a context with the desired generic font - nsAutoTArray contextPath; + AutoTArray contextPath; contextPath.AppendElement(aContext); nsStyleContext* higherContext = aContext->GetParent(); while (higherContext) { @@ -6686,8 +6686,8 @@ template static void SetImageLayerList(nsStyleContext* aStyleContext, const nsCSSValue& aValue, - nsAutoTArray< nsStyleImageLayers::Layer, 1> &aLayers, - const nsAutoTArray &aParentLayers, + AutoTArray< nsStyleImageLayers::Layer, 1> &aLayers, + const AutoTArray &aParentLayers, ComputedValueItem nsStyleImageLayers::Layer::* aResultLocation, ComputedValueItem aInitialValue, uint32_t aParentItemCount, @@ -6751,8 +6751,8 @@ template static void SetImageLayerPairList(nsStyleContext* aStyleContext, const nsCSSValue& aValue, - nsAutoTArray< nsStyleImageLayers::Layer, 1> &aLayers, - const nsAutoTArray + AutoTArray< nsStyleImageLayers::Layer, 1> &aLayers, + const AutoTArray &aParentLayers, ComputedValueItem nsStyleImageLayers::Layer::* aResultLocation, @@ -6818,7 +6818,7 @@ SetImageLayerPairList(nsStyleContext* aStyleContext, template static void -FillBackgroundList(nsAutoTArray< nsStyleImageLayers::Layer, 1> &aLayers, +FillBackgroundList(AutoTArray< nsStyleImageLayers::Layer, 1> &aLayers, ComputedValueItem nsStyleImageLayers::Layer::* aResultLocation, uint32_t aItemCount, uint32_t aFillCount) { @@ -10040,7 +10040,7 @@ nsRuleNode::Sweep() return true; } - nsAutoTArray sweepQueue; + AutoTArray sweepQueue; sweepQueue.AppendElement(this); while (!sweepQueue.IsEmpty()) { nsTArray::index_type last = sweepQueue.Length() - 1; diff --git a/layout/style/nsRuleProcessorData.h b/layout/style/nsRuleProcessorData.h index 35a5d11e295..3deefbc6f26 100644 --- a/layout/style/nsRuleProcessorData.h +++ b/layout/style/nsRuleProcessorData.h @@ -336,7 +336,7 @@ struct MOZ_STACK_CLASS TreeMatchContext { nsRuleWalker::VisitedHandlingType mVisitedHandling; // For matching :scope - nsAutoTArray mScopes; + AutoTArray mScopes; public: // The document we're working with. nsIDocument* const mDocument; @@ -380,7 +380,7 @@ struct MOZ_STACK_CLASS TreeMatchContext { // List of ancestor elements that define a style scope (due to having a // + + +Mozilla Bug 1236979 +

    + +
    +
    +
    + + From a97dfe996bec0a4ac8d74ccb0e13e32a205672a4 Mon Sep 17 00:00:00 2001 From: Honza Bambas Date: Mon, 1 Feb 2016 12:32:00 -0500 Subject: [PATCH 061/117] Bug 1244038 - Drop localStorage database indexes before renaming the table during update. r=mak77 --- dom/storage/DOMStorageDBUpdater.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/dom/storage/DOMStorageDBUpdater.cpp b/dom/storage/DOMStorageDBUpdater.cpp index 0df68db9027..ec0fea6f91e 100644 --- a/dom/storage/DOMStorageDBUpdater.cpp +++ b/dom/storage/DOMStorageDBUpdater.cpp @@ -336,7 +336,17 @@ nsresult Update(mozIStorageConnection *aWorkerConnection) aWorkerConnection->RemoveFunction(NS_LITERAL_CSTRING("REVERSESTRING")); // Update the scoping to match the new implememntation: split to oa suffix and origin key - // First rename the old table, we want to remove some columns no longer needed. + // First rename the old table, we want to remove some columns no longer needed, + // but even before that drop all indexes from it (CREATE IF NOT EXISTS for index on the + // new table would falsely find the index!) + rv = aWorkerConnection->ExecuteSimpleSQL(NS_LITERAL_CSTRING( + "DROP INDEX IF EXISTS webappsstore2.origin_key_index")); + NS_ENSURE_SUCCESS(rv, rv); + + rv = aWorkerConnection->ExecuteSimpleSQL(NS_LITERAL_CSTRING( + "DROP INDEX IF EXISTS webappsstore2.scope_key_index")); + NS_ENSURE_SUCCESS(rv, rv); + rv = aWorkerConnection->ExecuteSimpleSQL(NS_LITERAL_CSTRING( "ALTER TABLE webappsstore2 RENAME TO webappsstore2_old")); NS_ENSURE_SUCCESS(rv, rv); From a36aa95b547dbc3941bc6fce8883995f8ea61de7 Mon Sep 17 00:00:00 2001 From: Olli Pettay Date: Tue, 2 Feb 2016 19:59:44 +0200 Subject: [PATCH 062/117] Bug 1245011, null check window object before testing whether speech synthesis is active, r=eeejay --- dom/base/nsDocument.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index fe98617af4d..fc8826eefc3 100644 --- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -8807,9 +8807,11 @@ nsDocument::CanSavePresentation(nsIRequest *aNewRequest) } #ifdef MOZ_WEBSPEECH - auto* globalWindow = nsGlobalWindow::Cast(win); - if (globalWindow->HasActiveSpeechSynthesis()) { - return false; + if (win) { + auto* globalWindow = nsGlobalWindow::Cast(win); + if (globalWindow->HasActiveSpeechSynthesis()) { + return false; + } } #endif From 964cc276c9aa0ea284ba4be5d32b069b9a302cb4 Mon Sep 17 00:00:00 2001 From: simplyblue Date: Sat, 30 Jan 2016 13:50:58 +0530 Subject: [PATCH 063/117] Bug 1241646 - remove unused token arguments from nsIX509CertDB r=keeler --- devtools/shared/security/LocalCertService.cpp | 2 +- .../pki/resources/content/certManager.js | 6 +-- .../pki/resources/content/editcerts.js | 2 +- .../pki/resources/content/viewCertDetails.js | 6 +-- security/manager/ssl/nsIX509CertDB.idl | 39 +++++------------ security/manager/ssl/nsNSSCertificateDB.cpp | 43 ++++++++----------- security/manager/ssl/nsNSSIOLayer.cpp | 2 +- .../tests/unit/test_add_preexisting_cert.js | 2 +- .../manager/ssl/tests/unit/test_cert_dbKey.js | 10 ++--- .../ssl/tests/unit/test_cert_keyUsage.js | 2 +- .../manager/ssl/tests/unit/test_cert_trust.js | 6 +-- .../manager/ssl/tests/unit/test_ev_certs.js | 12 +++--- .../manager/ssl/tests/unit/test_getchain.js | 2 +- 13 files changed, 55 insertions(+), 79 deletions(-) diff --git a/devtools/shared/security/LocalCertService.cpp b/devtools/shared/security/LocalCertService.cpp index eb580577d99..578009780b9 100644 --- a/devtools/shared/security/LocalCertService.cpp +++ b/devtools/shared/security/LocalCertService.cpp @@ -258,7 +258,7 @@ private: nsCOMPtr certFromDB; nsresult rv; - rv = certDB->FindCertByNickname(nullptr, NS_ConvertASCIItoUTF16(mNickname), + rv = certDB->FindCertByNickname(NS_ConvertASCIItoUTF16(mNickname), getter_AddRefs(certFromDB)); if (NS_FAILED(rv)) { return rv; diff --git a/security/manager/pki/resources/content/certManager.js b/security/manager/pki/resources/content/certManager.js index e21d00daea0..0011be8083f 100644 --- a/security/manager/pki/resources/content/certManager.js +++ b/security/manager/pki/resources/content/certManager.js @@ -506,7 +506,7 @@ function addCACerts() gCertFileTypes); fp.appendFilters(nsIFilePicker.filterAll); if (fp.show() == nsIFilePicker.returnOK) { - certdb.importCertsFromFile(null, fp.file, nsIX509Cert.CA_CERT); + certdb.importCertsFromFile(fp.file, nsIX509Cert.CA_CERT); caTreeView.loadCerts(nsIX509Cert.CA_CERT); caTreeView.selection.clearSelection(); } @@ -540,7 +540,7 @@ function addEmailCert() gCertFileTypes); fp.appendFilters(nsIFilePicker.filterAll); if (fp.show() == nsIFilePicker.returnOK) { - certdb.importCertsFromFile(null, fp.file, nsIX509Cert.EMAIL_CERT); + certdb.importCertsFromFile(fp.file, nsIX509Cert.EMAIL_CERT); var certcache = certdb.getCerts(); emailTreeView.loadCertsFromCache(certcache, nsIX509Cert.EMAIL_CERT); emailTreeView.selection.clearSelection(); @@ -560,7 +560,7 @@ function addWebSiteCert() gCertFileTypes); fp.appendFilters(nsIFilePicker.filterAll); if (fp.show() == nsIFilePicker.returnOK) { - certdb.importCertsFromFile(null, fp.file, nsIX509Cert.SERVER_CERT); + certdb.importCertsFromFile(fp.file, nsIX509Cert.SERVER_CERT); var certcache = certdb.getCerts(); serverTreeView.loadCertsFromCache(certcache, nsIX509Cert.SERVER_CERT); diff --git a/security/manager/pki/resources/content/editcerts.js b/security/manager/pki/resources/content/editcerts.js index 87ddf2a81cf..4258967036c 100644 --- a/security/manager/pki/resources/content/editcerts.js +++ b/security/manager/pki/resources/content/editcerts.js @@ -22,7 +22,7 @@ function setWindowName() // Get the cert from the cert database certdb = Components.classes[nsX509CertDB].getService(nsIX509CertDB); - cert = certdb.findCertByDBKey(dbkey, null); + cert = certdb.findCertByDBKey(dbkey); var bundle = document.getElementById("pippki_bundle"); diff --git a/security/manager/pki/resources/content/viewCertDetails.js b/security/manager/pki/resources/content/viewCertDetails.js index d36467df04f..d2d2d1e100a 100644 --- a/security/manager/pki/resources/content/viewCertDetails.js +++ b/security/manager/pki/resources/content/viewCertDetails.js @@ -76,7 +76,7 @@ function setWindowName() //var token = pk11db.findTokenByName(tokenName); //var cert = certdb.findCertByNickname(token, myName); - cert = certdb.findCertByNickname(null, myName); + cert = certdb.findCertByNickname(myName); } else { var params = window.arguments[0].QueryInterface(nsIDialogParamBlock); var cert = params.objects.queryElementAt(0, nsIX509Cert); @@ -265,7 +265,7 @@ function updateCertDump() var dbKey = item.firstChild.firstChild.getAttribute('display'); // Get the cert from the cert database var certdb = Components.classes[nsX509CertDB].getService(nsIX509CertDB); - var cert = certdb.findCertByDBKey(dbKey,null); + var cert = certdb.findCertByDBKey(dbKey); asn1Tree.loadASN1Structure(cert.ASN1Structure); } displaySelected(); @@ -290,7 +290,7 @@ function getCurrentCert() var item = tree.contentView.getItemAtIndex(realIndex); var dbKey = item.firstChild.firstChild.getAttribute('display'); var certdb = Components.classes[nsX509CertDB].getService(nsIX509CertDB); - var cert = certdb.findCertByDBKey(dbKey,null); + var cert = certdb.findCertByDBKey(dbKey); return cert; } /* shouldn't really happen */ diff --git a/security/manager/ssl/nsIX509CertDB.idl b/security/manager/ssl/nsIX509CertDB.idl index 345290433e6..e7f85671429 100644 --- a/security/manager/ssl/nsIX509CertDB.idl +++ b/security/manager/ssl/nsIX509CertDB.idl @@ -46,7 +46,7 @@ interface nsIVerifySignedManifestCallback : nsISupports * This represents a service to access and manipulate * X.509 certificates stored in a database. */ -[scriptable, uuid(a36c45fb-f7b5-423e-a0f7-ea1eb4fd60b5)] +[scriptable, uuid(5c16cd9b-5a73-47f1-ab0f-11ede7495cce)] interface nsIX509CertDB : nsISupports { /** @@ -59,19 +59,15 @@ interface nsIX509CertDB : nsISupports { const unsigned long TRUSTED_OBJSIGN = 1 << 2; /** - * Given a nickname and optionally a token, + * Given a nickname, * locate the matching certificate. * - * @param aToken Optionally limits the scope of - * this function to a token device. - * Can be null to mean any token. * @param aNickname The nickname to be used as the key * to find a certificate. * * @return The matching certificate if found. */ - nsIX509Cert findCertByNickname(in nsISupports aToken, - in AString aNickname); + nsIX509Cert findCertByNickname(in AString aNickname); /** * Will find a certificate based on its dbkey @@ -80,11 +76,8 @@ interface nsIX509CertDB : nsISupports { * * @param aDBkey Database internal key, as obtained using * attribute dbkey in nsIX509Cert. - * @param aToken Optionally limits the scope of - * this function to a token device. - * Can be null to mean any token. */ - nsIX509Cert findCertByDBKey(in string aDBkey, in nsISupports aToken); + nsIX509Cert findCertByDBKey(in string aDBkey); /** * Obtain a list of certificate nicknames from the database. @@ -92,16 +85,12 @@ interface nsIX509CertDB : nsISupports { * user, ca, or server cert - the nickname * email cert - the email address * - * @param aToken Optionally limits the scope of - * this function to a token device. - * Can be null to mean any token. * @param aType Type of certificate to obtain * See certificate type constants in nsIX509Cert. * @param count The number of nicknames in the returned array * @param certNameList The returned array of certificate nicknames. */ - void findCertNicknames(in nsISupports aToken, - in unsigned long aType, + void findCertNicknames(in unsigned long aType, out unsigned long count, [array, size_is(count)] out wstring certNameList); @@ -128,16 +117,12 @@ interface nsIX509CertDB : nsISupports { /** * Find a certificate by email address. * - * @param aToken Optionally limits the scope of - * this function to a token device. - * Can be null to mean any token. * @param aEmailAddress The email address to be used as the key * to find the certificate. * * @return The matching certificate if found. */ - nsIX509Cert findCertByEmailAddress(in nsISupports aToken, - in string aEmailAddress); + nsIX509Cert findCertByEmailAddress(in string aEmailAddress); /** * Use this to import a stream sent down as a mime type into @@ -229,23 +214,19 @@ interface nsIX509CertDB : nsISupports { * @return Returns true if the certificate is trusted for the given use. */ boolean isCertTrusted(in nsIX509Cert cert, - in unsigned long certType, - in unsigned long trustType); + in unsigned long certType, + in unsigned long trustType); /** * Import certificate(s) from file * - * @param aToken Optionally limits the scope of - * this function to a token device. - * Can be null to mean any token. * @param aFile Identifies a file that contains the certificate * to be imported. * @param aType Describes the type of certificate that is going to * be imported. See type constants in nsIX509Cert. */ - void importCertsFromFile(in nsISupports aToken, - in nsIFile aFile, - in unsigned long aType); + void importCertsFromFile(in nsIFile aFile, + in unsigned long aType); /** * Import a PKCS#12 file containing cert(s) and key(s) into the database. diff --git a/security/manager/ssl/nsNSSCertificateDB.cpp b/security/manager/ssl/nsNSSCertificateDB.cpp index b2332554546..022233855f3 100644 --- a/security/manager/ssl/nsNSSCertificateDB.cpp +++ b/security/manager/ssl/nsNSSCertificateDB.cpp @@ -96,9 +96,8 @@ nsNSSCertificateDB::~nsNSSCertificateDB() } NS_IMETHODIMP -nsNSSCertificateDB::FindCertByNickname(nsISupports *aToken, - const nsAString &nickname, - nsIX509Cert **_rvCert) +nsNSSCertificateDB::FindCertByNickname(const nsAString& nickname, + nsIX509Cert** _rvCert) { NS_ENSURE_ARG_POINTER(_rvCert); *_rvCert = nullptr; @@ -127,9 +126,8 @@ nsNSSCertificateDB::FindCertByNickname(nsISupports *aToken, return NS_ERROR_FAILURE; } -NS_IMETHODIMP -nsNSSCertificateDB::FindCertByDBKey(const char *aDBkey, nsISupports *aToken, - nsIX509Cert **_cert) +NS_IMETHODIMP +nsNSSCertificateDB::FindCertByDBKey(const char* aDBkey,nsIX509Cert** _cert) { NS_ENSURE_ARG_POINTER(aDBkey); NS_ENSURE_ARG(aDBkey[0]); @@ -199,10 +197,9 @@ nsNSSCertificateDB::FindCertByDBKey(const char *aDBkey, nsISupports *aToken, } NS_IMETHODIMP -nsNSSCertificateDB::FindCertNicknames(nsISupports *aToken, - uint32_t aType, - uint32_t *_count, - char16_t ***_certNames) +nsNSSCertificateDB::FindCertNicknames(uint32_t aType, + uint32_t* _count, + char16_t*** _certNames) { nsNSSShutDownPreventionLock locker; if (isAlreadyShutDown()) { @@ -1084,10 +1081,8 @@ nsNSSCertificateDB::IsCertTrusted(nsIX509Cert *cert, } -NS_IMETHODIMP -nsNSSCertificateDB::ImportCertsFromFile(nsISupports *aToken, - nsIFile *aFile, - uint32_t aType) +NS_IMETHODIMP +nsNSSCertificateDB::ImportCertsFromFile(nsIFile* aFile, uint32_t aType) { nsNSSShutDownPreventionLock locker; if (isAlreadyShutDown()) { @@ -1101,7 +1096,7 @@ nsNSSCertificateDB::ImportCertsFromFile(nsISupports *aToken, case nsIX509Cert::SERVER_CERT: // good break; - + default: // not supported (yet) return NS_ERROR_FAILURE; @@ -1155,8 +1150,7 @@ nsNSSCertificateDB::ImportCertsFromFile(nsISupports *aToken, } NS_IMETHODIMP -nsNSSCertificateDB::ImportPKCS12File(nsISupports *aToken, - nsIFile *aFile) +nsNSSCertificateDB::ImportPKCS12File(nsISupports* aToken, nsIFile* aFile) { nsNSSShutDownPreventionLock locker; if (isAlreadyShutDown()) { @@ -1173,10 +1167,10 @@ nsNSSCertificateDB::ImportPKCS12File(nsISupports *aToken, } NS_IMETHODIMP -nsNSSCertificateDB::ExportPKCS12File(nsISupports *aToken, - nsIFile *aFile, - uint32_t count, - nsIX509Cert **certs) +nsNSSCertificateDB::ExportPKCS12File(nsISupports* aToken, + nsIFile* aFile, + uint32_t count, + nsIX509Cert** certs) //const char16_t **aCertNames) { nsNSSShutDownPreventionLock locker; @@ -1343,20 +1337,21 @@ nsNSSCertificateDB::FindEmailSigningCert(const nsAString& aNickname, } NS_IMETHODIMP -nsNSSCertificateDB::FindCertByEmailAddress(nsISupports *aToken, const char *aEmailAddress, nsIX509Cert **_retval) +nsNSSCertificateDB::FindCertByEmailAddress(const char* aEmailAddress, + nsIX509Cert** _retval) { nsNSSShutDownPreventionLock locker; if (isAlreadyShutDown()) { return NS_ERROR_NOT_AVAILABLE; } - + RefPtr certVerifier(GetDefaultCertVerifier()); NS_ENSURE_TRUE(certVerifier, NS_ERROR_UNEXPECTED); ScopedCERTCertList certlist( PK11_FindCertsFromEmailAddress(aEmailAddress, nullptr)); if (!certlist) - return NS_ERROR_FAILURE; + return NS_ERROR_FAILURE; // certlist now contains certificates with the right email address, // but they might not have the correct usage or might even be invalid diff --git a/security/manager/ssl/nsNSSIOLayer.cpp b/security/manager/ssl/nsNSSIOLayer.cpp index 4da30ff7088..48d8f704233 100644 --- a/security/manager/ssl/nsNSSIOLayer.cpp +++ b/security/manager/ssl/nsNSSIOLayer.cpp @@ -2237,7 +2237,7 @@ ClientAuthDataRunnable::RunOnTargetThread() if (certdb) { nsCOMPtr found_cert; nsresult find_rv = - certdb->FindCertByDBKey(rememberedDBKey.get(), nullptr, + certdb->FindCertByDBKey(rememberedDBKey.get(), getter_AddRefs(found_cert)); if (NS_SUCCEEDED(find_rv) && found_cert) { nsNSSCertificate* obj_cert = diff --git a/security/manager/ssl/tests/unit/test_add_preexisting_cert.js b/security/manager/ssl/tests/unit/test_add_preexisting_cert.js index 9fdc838a43e..5bcb6dc9335 100644 --- a/security/manager/ssl/tests/unit/test_add_preexisting_cert.js +++ b/security/manager/ssl/tests/unit/test_add_preexisting_cert.js @@ -39,7 +39,7 @@ function run_test() { // Change the already existing intermediate certificate's trust using // addCertFromBase64(). We use findCertByNickname first to ensure that the // certificate already exists. - let int_cert = certDB.findCertByNickname(null, "int-limited-depth"); + let int_cert = certDB.findCertByNickname("int-limited-depth"); notEqual(int_cert, null, "Intermediate cert should be in the cert DB"); let base64_cert = btoa(getDERString(int_cert)); certDB.addCertFromBase64(base64_cert, "p,p,p", "ignored_argument"); diff --git a/security/manager/ssl/tests/unit/test_cert_dbKey.js b/security/manager/ssl/tests/unit/test_cert_dbKey.js index 742264e769a..f04e56a1d0b 100644 --- a/security/manager/ssl/tests/unit/test_cert_dbKey.js +++ b/security/manager/ssl/tests/unit/test_cert_dbKey.js @@ -55,7 +55,7 @@ function encodeCommonNameAsBytes(commonName) { function testInvalidDBKey(certDB, dbKey) { let exceptionCaught = false; try { - let cert = certDB.findCertByDBKey(dbKey, null); + let cert = certDB.findCertByDBKey(dbKey); } catch(e) { do_print(e); exceptionCaught = true; @@ -64,7 +64,7 @@ function testInvalidDBKey(certDB, dbKey) { } function testDBKeyForNonexistentCert(certDB, dbKey) { - let cert = certDB.findCertByDBKey(dbKey, null); + let cert = certDB.findCertByDBKey(dbKey); ok(!cert, "shouldn't find cert for given dbKey"); } @@ -98,7 +98,7 @@ function run_test() { equal(cert.dbKey, expectedDbKey, "actual and expected dbKey values should match"); - let certFromDbKey = certDB.findCertByDBKey(expectedDbKey, null); + let certFromDbKey = certDB.findCertByDBKey(expectedDbKey); ok(certFromDbKey.equals(cert), "nsIX509CertDB.findCertByDBKey should find the right certificate"); @@ -107,14 +107,14 @@ function run_test() { let expectedDbKeyWithCRLF = expectedDbKey.replace(/(.{64})/, "$1\r\n"); ok(expectedDbKeyWithCRLF.indexOf("\r\n") == 64, "test self-check: adding CRLF to dbKey should succeed"); - certFromDbKey = certDB.findCertByDBKey(expectedDbKeyWithCRLF, null); + certFromDbKey = certDB.findCertByDBKey(expectedDbKeyWithCRLF); ok(certFromDbKey.equals(cert), "nsIX509CertDB.findCertByDBKey should work with dbKey with CRLF"); let expectedDbKeyWithSpaces = expectedDbKey.replace(/(.{64})/, "$1 "); ok(expectedDbKeyWithSpaces.indexOf(" ") == 64, "test self-check: adding spaces to dbKey should succeed"); - certFromDbKey = certDB.findCertByDBKey(expectedDbKeyWithSpaces, null); + certFromDbKey = certDB.findCertByDBKey(expectedDbKeyWithSpaces); ok(certFromDbKey.equals(cert), "nsIX509CertDB.findCertByDBKey should work with dbKey with spaces"); diff --git a/security/manager/ssl/tests/unit/test_cert_keyUsage.js b/security/manager/ssl/tests/unit/test_cert_keyUsage.js index ab96ac81664..2ae9d666174 100644 --- a/security/manager/ssl/tests/unit/test_cert_keyUsage.js +++ b/security/manager/ssl/tests/unit/test_cert_keyUsage.js @@ -44,7 +44,7 @@ function run_test() { caList.forEach(function(ca) { addCertFromFile(certdb, "test_cert_keyUsage/" + ca + ".pem", "CTu,CTu,CTu"); - let caCert = certdb.findCertByNickname(null, ca); + let caCert = certdb.findCertByNickname(ca); let usages = {}; caCert.getUsagesString(true, {}, usages); // true indicates local-only equal(usages.value, expectedUsagesMap[ca], diff --git a/security/manager/ssl/tests/unit/test_cert_trust.js b/security/manager/ssl/tests/unit/test_cert_trust.js index dd44b7a8f67..3d3002302c7 100644 --- a/security/manager/ssl/tests/unit/test_cert_trust.js +++ b/security/manager/ssl/tests/unit/test_cert_trust.js @@ -191,11 +191,11 @@ function run_test() { load_cert(certList[i], ',,'); } - let ca_cert = certdb.findCertByNickname(null, 'ca'); + let ca_cert = certdb.findCertByNickname('ca'); notEqual(ca_cert, null, "CA cert should be in the cert DB"); - let int_cert = certdb.findCertByNickname(null, 'int'); + let int_cert = certdb.findCertByNickname('int'); notEqual(int_cert, null, "Intermediate cert should be in the cert DB"); - let ee_cert = certdb.findCertByNickname(null, 'ee'); + let ee_cert = certdb.findCertByNickname('ee'); notEqual(ee_cert, null, "EE cert should be in the cert DB"); setup_basic_trusts(ca_cert, int_cert); diff --git a/security/manager/ssl/tests/unit/test_ev_certs.js b/security/manager/ssl/tests/unit/test_ev_certs.js index 7d69fc45d80..1ef0f622077 100644 --- a/security/manager/ssl/tests/unit/test_ev_certs.js +++ b/security/manager/ssl/tests/unit/test_ev_certs.js @@ -46,13 +46,13 @@ function start_ocsp_responder(expectedCertNames) { } function check_cert_err(cert_name, expected_error) { - let cert = certdb.findCertByNickname(null, cert_name); + let cert = certdb.findCertByNickname(cert_name); checkCertErrorGeneric(certdb, cert, expected_error, certificateUsageSSLServer); } function check_ee_for_ev(cert_name, expected_ev) { - let cert = certdb.findCertByNickname(null, cert_name); + let cert = certdb.findCertByNickname(cert_name); checkEVStatus(certdb, cert, certificateUsageSSLServer, expected_ev); } @@ -107,7 +107,7 @@ function run_test() { // causes the root to be untrusted. const nsIX509Cert = Ci.nsIX509Cert; add_test(function() { - let evRootCA = certdb.findCertByNickname(null, evrootnick); + let evRootCA = certdb.findCertByNickname(evrootnick); certdb.setCertTrust(evRootCA, nsIX509Cert.CA_CERT, 0); clearOCSPCache(); @@ -119,7 +119,7 @@ function run_test() { // bug 917380: Check that a trusted EV root is trusted after disabling and // re-enabling trust. add_test(function() { - let evRootCA = certdb.findCertByNickname(null, evrootnick); + let evRootCA = certdb.findCertByNickname(evrootnick); certdb.setCertTrust(evRootCA, nsIX509Cert.CA_CERT, Ci.nsIX509CertDB.TRUSTED_SSL | Ci.nsIX509CertDB.TRUSTED_EMAIL | @@ -240,7 +240,7 @@ function run_test() { ocspResponder.stop(function () { // without net it must be able to EV verify let failingOcspResponder = failingOCSPResponder(); - let cert = certdb.findCertByNickname(null, "ev-valid"); + let cert = certdb.findCertByNickname("ev-valid"); let hasEVPolicy = {}; let verifiedChain = {}; let flags = Ci.nsIX509CertDB.FLAG_LOCAL_ONLY | @@ -321,7 +321,7 @@ function run_test() { function check_no_ocsp_requests(cert_name, expected_error) { clearOCSPCache(); let ocspResponder = failingOCSPResponder(); - let cert = certdb.findCertByNickname(null, cert_name); + let cert = certdb.findCertByNickname(cert_name); let hasEVPolicy = {}; let verifiedChain = {}; let flags = Ci.nsIX509CertDB.FLAG_LOCAL_ONLY | diff --git a/security/manager/ssl/tests/unit/test_getchain.js b/security/manager/ssl/tests/unit/test_getchain.js index 60c73e09811..d8a901fd97d 100644 --- a/security/manager/ssl/tests/unit/test_getchain.js +++ b/security/manager/ssl/tests/unit/test_getchain.js @@ -71,7 +71,7 @@ function run_test() { addCertFromFile(certdb, `test_getchain/${cert}.pem`, ",,"); } - let ee_cert = certdb.findCertByNickname(null, 'ee'); + let ee_cert = certdb.findCertByNickname('ee'); notEqual(ee_cert, null, "EE cert should be in the cert DB"); let ca = get_ca_array(); From 6d15eaf2cdc6bac07f841ecb0c6ac571b6c9b917 Mon Sep 17 00:00:00 2001 From: Nicholas Hurley Date: Mon, 1 Feb 2016 09:46:24 -0800 Subject: [PATCH 064/117] Bug 1244505 - Allow spaces in cookie names. r=mcmanus --- netwerk/cookie/nsCookieService.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netwerk/cookie/nsCookieService.cpp b/netwerk/cookie/nsCookieService.cpp index 70323e8dc22..24464593b44 100644 --- a/netwerk/cookie/nsCookieService.cpp +++ b/netwerk/cookie/nsCookieService.cpp @@ -3194,7 +3194,7 @@ nsCookieService::SetCookieInternal(nsIURI *aHostURI, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, - 0x1F, 0x20, 0x00 }; + 0x1F, 0x00 }; if (cookieAttributes.name.FindCharInSet(illegalNameCharacters, 0) != -1) { COOKIE_LOGFAILURE(SET_COOKIE, aHostURI, savedCookieHeader, "invalid name character"); return newCookie; From 10a67126383db68f43d319d5ae121763a12a3387 Mon Sep 17 00:00:00 2001 From: Steven Englehardt Date: Tue, 2 Feb 2016 11:14:36 -0800 Subject: [PATCH 065/117] Bug 1244887: Fixing userContext label on awesomebar, r=baku --- browser/modules/UserContextUI.jsm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/browser/modules/UserContextUI.jsm b/browser/modules/UserContextUI.jsm index ef60380aa73..3c3ca098e59 100644 --- a/browser/modules/UserContextUI.jsm +++ b/browser/modules/UserContextUI.jsm @@ -15,14 +15,14 @@ XPCOMUtils.defineLazyGetter(this, "gBrowserBundle", function() { this.UserContextUI = { getUserContextLabel(userContextId) { - switch (userContextId) { + switch (parseInt(userContextId)) { // No UserContext: case 0: return ""; case 1: return gBrowserBundle.GetStringFromName("usercontext.personal.label"); case 2: return gBrowserBundle.GetStringFromName("usercontext.work.label"); - case 3: return gBrowserBundle.GetStringFromName("usercontext.shopping.label"); - case 4: return gBrowserBundle.GetStringFromName("usercontext.banking.label"); + case 3: return gBrowserBundle.GetStringFromName("usercontext.banking.label"); + case 4: return gBrowserBundle.GetStringFromName("usercontext.shopping.label"); // Display the context IDs for values outside the pre-defined range. // Used for debugging, no localization necessary. From ddc7eb4ee2ece7297de8ff06fb3149f18de8a6fe Mon Sep 17 00:00:00 2001 From: Francois Marier Date: Tue, 2 Feb 2016 15:07:06 -0500 Subject: [PATCH 066/117] Bug 1237856 - Add prefs to honor/ignore Application Reputation verdicts. r=gcp --- b2g/app/b2g.js | 4 ++++ browser/app/profile/firefox.js | 4 ++++ mobile/android/app/mobile.js | 4 ++++ mobile/android/b2gdroid/app/b2gdroid.js | 4 ++++ .../downloads/ApplicationReputation.cpp | 19 ++++++++++++++++--- 5 files changed, 32 insertions(+), 3 deletions(-) diff --git a/b2g/app/b2g.js b/b2g/app/b2g.js index a4199208798..b76bcd5dc20 100644 --- a/b2g/app/b2g.js +++ b/b2g/app/b2g.js @@ -355,6 +355,10 @@ pref("browser.safebrowsing.downloads.enabled", true); pref("browser.safebrowsing.downloads.remote.enabled", true); pref("browser.safebrowsing.downloads.remote.timeout_ms", 10000); pref("browser.safebrowsing.downloads.remote.url", "https://sb-ssl.google.com/safebrowsing/clientreport/download?key=%GOOGLE_API_KEY%"); +pref("browser.safebrowsing.downloads.remote.block_dangerous", true); +pref("browser.safebrowsing.downloads.remote.block_dangerous_host", true); +pref("browser.safebrowsing.downloads.remote.block_potentially_unwanted", false); +pref("browser.safebrowsing.downloads.remote.block_uncommon", false); pref("browser.safebrowsing.debug", false); pref("browser.safebrowsing.provider.google.lists", "goog-badbinurl-shavar,goog-downloadwhite-digest256,goog-phish-shavar,goog-malware-shavar,goog-unwanted-shavar"); diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index d023f345969..fd4daab321f 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -953,6 +953,10 @@ pref("browser.safebrowsing.downloads.enabled", true); pref("browser.safebrowsing.downloads.remote.enabled", true); pref("browser.safebrowsing.downloads.remote.timeout_ms", 10000); pref("browser.safebrowsing.downloads.remote.url", "https://sb-ssl.google.com/safebrowsing/clientreport/download?key=%GOOGLE_API_KEY%"); +pref("browser.safebrowsing.downloads.remote.block_dangerous", true); +pref("browser.safebrowsing.downloads.remote.block_dangerous_host", true); +pref("browser.safebrowsing.downloads.remote.block_potentially_unwanted", false); +pref("browser.safebrowsing.downloads.remote.block_uncommon", false); pref("browser.safebrowsing.debug", false); pref("browser.safebrowsing.provider.google.lists", "goog-badbinurl-shavar,goog-downloadwhite-digest256,goog-phish-shavar,goog-malware-shavar,goog-unwanted-shavar"); diff --git a/mobile/android/app/mobile.js b/mobile/android/app/mobile.js index dd9a4bcc00e..3a652a21eec 100644 --- a/mobile/android/app/mobile.js +++ b/mobile/android/app/mobile.js @@ -639,6 +639,10 @@ pref("browser.safebrowsing.downloads.enabled", true); pref("browser.safebrowsing.downloads.remote.enabled", true); pref("browser.safebrowsing.downloads.remote.timeout_ms", 10000); pref("browser.safebrowsing.downloads.remote.url", "https://sb-ssl.google.com/safebrowsing/clientreport/download?key=%GOOGLE_API_KEY%"); +pref("browser.safebrowsing.downloads.remote.block_dangerous", true); +pref("browser.safebrowsing.downloads.remote.block_dangerous_host", true); +pref("browser.safebrowsing.downloads.remote.block_potentially_unwanted", false); +pref("browser.safebrowsing.downloads.remote.block_uncommon", false); pref("browser.safebrowsing.debug", false); pref("browser.safebrowsing.provider.google.lists", "goog-badbinurl-shavar,goog-downloadwhite-digest256,goog-phish-shavar,goog-malware-shavar,goog-unwanted-shavar"); diff --git a/mobile/android/b2gdroid/app/b2gdroid.js b/mobile/android/b2gdroid/app/b2gdroid.js index 1a140c756b7..3fd96342a3c 100644 --- a/mobile/android/b2gdroid/app/b2gdroid.js +++ b/mobile/android/b2gdroid/app/b2gdroid.js @@ -611,6 +611,10 @@ pref("browser.safebrowsing.downloads.enabled", false); pref("browser.safebrowsing.downloads.remote.enabled", false); pref("browser.safebrowsing.downloads.remote.timeout_ms", 10000); pref("browser.safebrowsing.downloads.remote.url", "https://sb-ssl.google.com/safebrowsing/clientreport/download?key=%GOOGLE_API_KEY%"); +pref("browser.safebrowsing.downloads.remote.block_dangerous", true); +pref("browser.safebrowsing.downloads.remote.block_dangerous_host", true); +pref("browser.safebrowsing.downloads.remote.block_potentially_unwanted", false); +pref("browser.safebrowsing.downloads.remote.block_uncommon", false); pref("browser.safebrowsing.debug", false); pref("browser.safebrowsing.provider.google.lists", "goog-badbinurl-shavar,goog-downloadwhite-digest256,goog-phish-shavar,goog-malware-shavar,goog-unwanted-shavar"); diff --git a/toolkit/components/downloads/ApplicationReputation.cpp b/toolkit/components/downloads/ApplicationReputation.cpp index d187e3550f3..a34652f1f98 100644 --- a/toolkit/components/downloads/ApplicationReputation.cpp +++ b/toolkit/components/downloads/ApplicationReputation.cpp @@ -71,6 +71,12 @@ using safe_browsing::ClientDownloadRequest_SignatureInfo; #define PREF_DOWNLOAD_BLOCK_TABLE "urlclassifier.downloadBlockTable" #define PREF_DOWNLOAD_ALLOW_TABLE "urlclassifier.downloadAllowTable" +// Preferences that are needed to action the verdict. +#define PREF_BLOCK_DANGEROUS "browser.safebrowsing.downloads.remote.block_dangerous" +#define PREF_BLOCK_DANGEROUS_HOST "browser.safebrowsing.downloads.remote.block_dangerous_host" +#define PREF_BLOCK_POTENTIALLY_UNWANTED "browser.safebrowsing.downloads.remote.block_potentially_unwanted" +#define PREF_BLOCK_UNCOMMON "browser.safebrowsing.downloads.remote.block_uncommon" + // NSPR_LOG_MODULES=ApplicationReputation:5 PRLogModuleInfo *ApplicationReputationService::prlog = nullptr; #define LOG(args) MOZ_LOG(ApplicationReputationService::prlog, mozilla::LogLevel::Debug, args) @@ -1098,8 +1104,6 @@ PendingLookup::OnStopRequestInternal(nsIRequest *aRequest, return NS_ERROR_CANNOT_CONVERT_DATA; } - // There are several more verdicts, but we only respect DANGEROUS and - // DANGEROUS_HOST for now and treat everything else as SAFE. Accumulate(mozilla::Telemetry::APPLICATION_REPUTATION_SERVER, SERVER_RESPONSE_VALID); // Clamp responses 0-7, we only know about 0-4 for now. @@ -1107,10 +1111,19 @@ PendingLookup::OnStopRequestInternal(nsIRequest *aRequest, std::min(response.verdict(), 7)); switch(response.verdict()) { case safe_browsing::ClientDownloadResponse::DANGEROUS: + *aShouldBlock = Preferences::GetBool(PREF_BLOCK_DANGEROUS, true); + break; case safe_browsing::ClientDownloadResponse::DANGEROUS_HOST: - *aShouldBlock = true; + *aShouldBlock = Preferences::GetBool(PREF_BLOCK_DANGEROUS_HOST, true); + break; + case safe_browsing::ClientDownloadResponse::POTENTIALLY_UNWANTED: + *aShouldBlock = Preferences::GetBool(PREF_BLOCK_POTENTIALLY_UNWANTED, false); + break; + case safe_browsing::ClientDownloadResponse::UNCOMMON: + *aShouldBlock = Preferences::GetBool(PREF_BLOCK_UNCOMMON, false); break; default: + // Treat everything else as safe break; } From b5f0a8fa22628518c79c576aec64c6d98b0c429c Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 2 Feb 2016 12:30:54 -0800 Subject: [PATCH 067/117] Bug 1244571 - BaldrMonkey: Implement the unary operators. r=luke --- js/src/asmjs/Wasm.cpp | 24 ++++++ js/src/asmjs/WasmBinary.h | 4 +- js/src/asmjs/WasmIonCompile.cpp | 4 +- js/src/asmjs/WasmText.cpp | 93 ++++++++++++++++++++- js/src/jit-test/tests/wasm/basic-float.js | 25 ++++++ js/src/jit-test/tests/wasm/basic-integer.js | 11 +++ 6 files changed, 154 insertions(+), 7 deletions(-) diff --git a/js/src/asmjs/Wasm.cpp b/js/src/asmjs/Wasm.cpp index 5d90fbacf48..18cf6a1e3d2 100644 --- a/js/src/asmjs/Wasm.cpp +++ b/js/src/asmjs/Wasm.cpp @@ -266,6 +266,12 @@ DecodeBlock(FunctionDecoder& f, ExprType expected) return true; } +static bool +DecodeUnaryOperator(FunctionDecoder& f, ExprType expected) +{ + return DecodeExpr(f, expected); +} + static bool DecodeBinaryOperator(FunctionDecoder& f, ExprType expected) { @@ -295,6 +301,24 @@ DecodeExpr(FunctionDecoder& f, ExprType expected) return DecodeSetLocal(f, expected); case Expr::Block: return DecodeBlock(f, expected); + case Expr::I32Clz: + case Expr::I32Ctz: + case Expr::I32Popcnt: + case Expr::F32Abs: + case Expr::F32Neg: + case Expr::F32Ceil: + case Expr::F32Floor: + case Expr::F32Trunc: + case Expr::F32Nearest: + case Expr::F32Sqrt: + case Expr::F64Abs: + case Expr::F64Neg: + case Expr::F64Ceil: + case Expr::F64Floor: + case Expr::F64Trunc: + case Expr::F64Nearest: + case Expr::F64Sqrt: + return DecodeUnaryOperator(f, expected); case Expr::I32Add: case Expr::I32Sub: case Expr::I32Mul: diff --git a/js/src/asmjs/WasmBinary.h b/js/src/asmjs/WasmBinary.h index 2b70effc5e1..f204c24ee80 100644 --- a/js/src/asmjs/WasmBinary.h +++ b/js/src/asmjs/WasmBinary.h @@ -122,7 +122,7 @@ enum class Expr : uint16_t F32Ceil, F32Floor, F32Trunc, - F32NearestInt, + F32Nearest, F32Sqrt, F32Eq, F32Ne, @@ -144,7 +144,7 @@ enum class Expr : uint16_t F64Ceil, F64Floor, F64Trunc, - F64NearestInt, + F64Nearest, F64Sqrt, F64Eq, F64Ne, diff --git a/js/src/asmjs/WasmIonCompile.cpp b/js/src/asmjs/WasmIonCompile.cpp index 7eb7ea08290..ed7880e9ca5 100644 --- a/js/src/asmjs/WasmIonCompile.cpp +++ b/js/src/asmjs/WasmIonCompile.cpp @@ -2916,9 +2916,9 @@ EmitExpr(FunctionCompiler& f, ExprType type, MDefinition** def, LabelVector* may case Expr::I32Popcnt: case Expr::F32CopySign: case Expr::F32Trunc: - case Expr::F32NearestInt: + case Expr::F32Nearest: case Expr::F64CopySign: - case Expr::F64NearestInt: + case Expr::F64Nearest: case Expr::F64Trunc: case Expr::I32UConvertF32: case Expr::I32UConvertF64: diff --git a/js/src/asmjs/WasmText.cpp b/js/src/asmjs/WasmText.cpp index 7c75a7c9cd3..579c592f8d4 100644 --- a/js/src/asmjs/WasmText.cpp +++ b/js/src/asmjs/WasmText.cpp @@ -99,7 +99,8 @@ enum class WasmAstExprKind Const, GetLocal, Nop, - SetLocal + SetLocal, + UnaryOperator, }; class WasmAstExpr : public WasmAstNode @@ -312,6 +313,22 @@ class WasmAstModule : public WasmAstNode } }; +class WasmAstUnaryOperator final : public WasmAstExpr +{ + Expr expr_; + WasmAstExpr* op_; + + public: + static const WasmAstExprKind Kind = WasmAstExprKind::UnaryOperator; + explicit WasmAstUnaryOperator(Expr expr, WasmAstExpr* op) + : WasmAstExpr(Kind), + expr_(expr), op_(op) + {} + + Expr expr() const { return expr_; } + WasmAstExpr* op() const { return op_; } +}; + class WasmAstBinaryOperator final : public WasmAstExpr { Expr expr_; @@ -360,6 +377,7 @@ class WasmToken Result, SetLocal, Text, + UnaryOpcode, ValueType }; private: @@ -404,7 +422,7 @@ class WasmToken end_(end) { MOZ_ASSERT(begin != end); - MOZ_ASSERT(kind_ == BinaryOpcode); + MOZ_ASSERT(kind_ == UnaryOpcode || kind_ == BinaryOpcode); u.expr_ = expr; } explicit WasmToken(const char16_t* begin) @@ -437,7 +455,7 @@ class WasmToken return u.valueType_; } Expr expr() const { - MOZ_ASSERT(kind_ == BinaryOpcode); + MOZ_ASSERT(kind_ == UnaryOpcode || kind_ == BinaryOpcode); return u.expr_; } }; @@ -578,10 +596,14 @@ class WasmTokenStream switch (*cur_) { case 'a': + if (consume(MOZ_UTF16("abs"))) + return WasmToken(WasmToken::UnaryOpcode, Expr::F32Abs, begin, cur_); if (consume(MOZ_UTF16("add"))) return WasmToken(WasmToken::BinaryOpcode, Expr::F32Add, begin, cur_); break; case 'c': + if (consume(MOZ_UTF16("ceil"))) + return WasmToken(WasmToken::UnaryOpcode, Expr::F32Ceil, begin, cur_); if (consume(MOZ_UTF16("const"))) return WasmToken(WasmToken::Const, ValType::F32, begin, cur_); if (consume(MOZ_UTF16("copysign"))) @@ -591,6 +613,10 @@ class WasmTokenStream if (consume(MOZ_UTF16("div"))) return WasmToken(WasmToken::BinaryOpcode, Expr::F32Div, begin, cur_); break; + case 'f': + if (consume(MOZ_UTF16("floor"))) + return WasmToken(WasmToken::UnaryOpcode, Expr::F32Floor, begin, cur_); + break; case 'm': if (consume(MOZ_UTF16("max"))) return WasmToken(WasmToken::BinaryOpcode, Expr::F32Max, begin, cur_); @@ -599,10 +625,22 @@ class WasmTokenStream if (consume(MOZ_UTF16("mul"))) return WasmToken(WasmToken::BinaryOpcode, Expr::F32Mul, begin, cur_); break; + case 'n': + if (consume(MOZ_UTF16("nearest"))) + return WasmToken(WasmToken::UnaryOpcode, Expr::F32Nearest, begin, cur_); + if (consume(MOZ_UTF16("neg"))) + return WasmToken(WasmToken::UnaryOpcode, Expr::F32Neg, begin, cur_); + break; case 's': + if (consume(MOZ_UTF16("sqrt"))) + return WasmToken(WasmToken::UnaryOpcode, Expr::F32Sqrt, begin, cur_); if (consume(MOZ_UTF16("sub"))) return WasmToken(WasmToken::BinaryOpcode, Expr::F32Sub, begin, cur_); break; + case 't': + if (consume(MOZ_UTF16("trunc"))) + return WasmToken(WasmToken::UnaryOpcode, Expr::F32Trunc, begin, cur_); + break; } break; } @@ -612,10 +650,14 @@ class WasmTokenStream switch (*cur_) { case 'a': + if (consume(MOZ_UTF16("abs"))) + return WasmToken(WasmToken::UnaryOpcode, Expr::F64Abs, begin, cur_); if (consume(MOZ_UTF16("add"))) return WasmToken(WasmToken::BinaryOpcode, Expr::F64Add, begin, cur_); break; case 'c': + if (consume(MOZ_UTF16("ceil"))) + return WasmToken(WasmToken::UnaryOpcode, Expr::F64Ceil, begin, cur_); if (consume(MOZ_UTF16("const"))) return WasmToken(WasmToken::Const, ValType::F64, begin, cur_); if (consume(MOZ_UTF16("copysign"))) @@ -625,6 +667,10 @@ class WasmTokenStream if (consume(MOZ_UTF16("div"))) return WasmToken(WasmToken::BinaryOpcode, Expr::F64Div, begin, cur_); break; + case 'f': + if (consume(MOZ_UTF16("floor"))) + return WasmToken(WasmToken::UnaryOpcode, Expr::F64Floor, begin, cur_); + break; case 'm': if (consume(MOZ_UTF16("max"))) return WasmToken(WasmToken::BinaryOpcode, Expr::F64Max, begin, cur_); @@ -633,10 +679,22 @@ class WasmTokenStream if (consume(MOZ_UTF16("mul"))) return WasmToken(WasmToken::BinaryOpcode, Expr::F64Mul, begin, cur_); break; + case 'n': + if (consume(MOZ_UTF16("nearest"))) + return WasmToken(WasmToken::UnaryOpcode, Expr::F64Nearest, begin, cur_); + if (consume(MOZ_UTF16("neg"))) + return WasmToken(WasmToken::UnaryOpcode, Expr::F64Neg, begin, cur_); + break; case 's': + if (consume(MOZ_UTF16("sqrt"))) + return WasmToken(WasmToken::UnaryOpcode, Expr::F64Sqrt, begin, cur_); if (consume(MOZ_UTF16("sub"))) return WasmToken(WasmToken::BinaryOpcode, Expr::F64Sub, begin, cur_); break; + case 't': + if (consume(MOZ_UTF16("trunc"))) + return WasmToken(WasmToken::UnaryOpcode, Expr::F64Trunc, begin, cur_); + break; } } break; @@ -661,6 +719,10 @@ class WasmTokenStream case 'c': if (consume(MOZ_UTF16("const"))) return WasmToken(WasmToken::Const, ValType::I32, begin, cur_); + if (consume(MOZ_UTF16("clz"))) + return WasmToken(WasmToken::UnaryOpcode, Expr::I32Clz, begin, cur_); + if (consume(MOZ_UTF16("ctz"))) + return WasmToken(WasmToken::UnaryOpcode, Expr::I32Ctz, begin, cur_); break; case 'd': if (consume(MOZ_UTF16("div_s"))) @@ -682,6 +744,10 @@ class WasmTokenStream if (consume(MOZ_UTF16("rem_u"))) return WasmToken(WasmToken::BinaryOpcode, Expr::I32RemU, begin, cur_); break; + case 'p': + if (consume(MOZ_UTF16("popcnt"))) + return WasmToken(WasmToken::UnaryOpcode, Expr::I32Popcnt, begin, cur_); + break; case 's': if (consume(MOZ_UTF16("sub"))) return WasmToken(WasmToken::BinaryOpcode, Expr::I32Sub, begin, cur_); @@ -922,6 +988,16 @@ ParseSetLocal(WasmParseContext& c) return new(c.lifo) WasmAstSetLocal(localIndex.integer(), *value); } +static WasmAstUnaryOperator* +ParseUnaryOperator(WasmParseContext& c, Expr expr) +{ + WasmAstExpr* op = ParseExpr(c); + if (!op) + return nullptr; + + return new(c.lifo) WasmAstUnaryOperator(expr, op); +} + static WasmAstBinaryOperator* ParseBinaryOperator(WasmParseContext& c, Expr expr) { @@ -958,6 +1034,8 @@ ParseExprInsideParens(WasmParseContext& c) return ParseGetLocal(c); case WasmToken::SetLocal: return ParseSetLocal(c); + case WasmToken::UnaryOpcode: + return ParseUnaryOperator(c, token.expr()); default: c.ts.generateError(token, c.error); return nullptr; @@ -1205,6 +1283,13 @@ EncodeSetLocal(Encoder& e, WasmAstSetLocal& sl) EncodeExpr(e, sl.value()); } +static bool +EncodeUnaryOperator(Encoder& e, WasmAstUnaryOperator& b) +{ + return e.writeExpr(b.expr()) && + EncodeExpr(e, *b.op()); +} + static bool EncodeBinaryOperator(Encoder& e, WasmAstBinaryOperator& b) { @@ -1231,6 +1316,8 @@ EncodeExpr(Encoder& e, WasmAstExpr& expr) return EncodeGetLocal(e, expr.as()); case WasmAstExprKind::SetLocal: return EncodeSetLocal(e, expr.as()); + case WasmAstExprKind::UnaryOperator: + return EncodeUnaryOperator(e, expr.as()); default:; } MOZ_CRASH("Bad expr kind"); diff --git a/js/src/jit-test/tests/wasm/basic-float.js b/js/src/jit-test/tests/wasm/basic-float.js index 61c90acc02b..75d4edfd147 100644 --- a/js/src/jit-test/tests/wasm/basic-float.js +++ b/js/src/jit-test/tests/wasm/basic-float.js @@ -8,10 +8,22 @@ function mismatchError(actual, expect) { return RegExp(str); } +function testUnary(type, opcode, op, expect) { + assertEq(wasmEvalText('(module (func (param ' + type + ') (result ' + type + ') (' + type + '.' + opcode + ' (get_local 0))) (export "" 0))')(op), expect); +} + function testBinary(type, opcode, lhs, rhs, expect) { assertEq(wasmEvalText('(module (func (param ' + type + ') (param ' + type + ') (result ' + type + ') (' + type + '.' + opcode + ' (get_local 0) (get_local 1))) (export "" 0))')(lhs, rhs), expect); } +testUnary('f32', 'abs', -40, 40); +testUnary('f32', 'neg', 40, -40); +testUnary('f32', 'floor', 40.9, 40); +testUnary('f32', 'ceil', 40.1, 41); +//testUnary('f32', 'nearest', -41.5, -42); // TODO: NYI +//testUnary('f32', 'trunc', -41.5, -41); // TODO: NYI +testUnary('f32', 'sqrt', 40, 6.324555397033691); + testBinary('f32', 'add', 40, 2, 42); testBinary('f32', 'sub', 40, 2, 38); testBinary('f32', 'mul', 40, 2, 80); @@ -20,6 +32,14 @@ testBinary('f32', 'div', 40, 3, 13.333333015441895); //testBinary('f32', 'max', 40, 2, 40); // TODO: NYI //testBinary('f32', 'copysign', 40, -2, -40); // TODO: NYI +testUnary('f64', 'abs', -40, 40); +testUnary('f64', 'neg', 40, -40); +testUnary('f64', 'floor', 40.9, 40); +testUnary('f64', 'ceil', 40.1, 41); +//testUnary('f64', 'nearest', -41.5, -42); // TODO: NYI +//testUnary('f64', 'trunc', -41.5, -41); // TODO: NYI +testUnary('f64', 'sqrt', 40, 6.324555320336759); + testBinary('f64', 'add', 40, 2, 42); testBinary('f64', 'sub', 40, 2, 38); testBinary('f64', 'mul', 40, 2, 80); @@ -28,6 +48,11 @@ testBinary('f64', 'div', 40, 3, 13.333333333333334); //testBinary('f64', 'max', 40, 2, 40); // TODO: NYI //testBinary('f64', 'copysign', 40, -2, -40); // TODO: NYI +assertErrorMessage(() => wasmEvalText('(module (func (param i32) (result f32) (f32.sqrt (get_local 0))))'), TypeError, mismatchError("i32", "f32")); +assertErrorMessage(() => wasmEvalText('(module (func (param f32) (result i32) (f32.sqrt (get_local 0))))'), TypeError, mismatchError("f32", "i32")); +assertErrorMessage(() => wasmEvalText('(module (func (param i32) (result f64) (f64.sqrt (get_local 0))))'), TypeError, mismatchError("i32", "f64")); +assertErrorMessage(() => wasmEvalText('(module (func (param f64) (result i32) (f64.sqrt (get_local 0))))'), TypeError, mismatchError("f64", "i32")); + assertErrorMessage(() => wasmEvalText('(module (func (param i32) (param f32) (result f32) (f32.add (get_local 0) (get_local 1))))'), TypeError, mismatchError("i32", "f32")); assertErrorMessage(() => wasmEvalText('(module (func (param f32) (param i32) (result f32) (f32.add (get_local 0) (get_local 1))))'), TypeError, mismatchError("i32", "f32")); assertErrorMessage(() => wasmEvalText('(module (func (param f32) (param f32) (result i32) (f32.add (get_local 0) (get_local 1))))'), TypeError, mismatchError("f32", "i32")); diff --git a/js/src/jit-test/tests/wasm/basic-integer.js b/js/src/jit-test/tests/wasm/basic-integer.js index 1d5ed96600d..8df03f398a6 100644 --- a/js/src/jit-test/tests/wasm/basic-integer.js +++ b/js/src/jit-test/tests/wasm/basic-integer.js @@ -8,10 +8,18 @@ function mismatchError(actual, expect) { return RegExp(str); } +function testUnary(type, opcode, op, expect) { + assertEq(wasmEvalText('(module (func (param ' + type + ') (result ' + type + ') (' + type + '.' + opcode + ' (get_local 0))) (export "" 0))')(op), expect); +} + function testBinary(type, opcode, lhs, rhs, expect) { assertEq(wasmEvalText('(module (func (param ' + type + ') (param ' + type + ') (result ' + type + ') (' + type + '.' + opcode + ' (get_local 0) (get_local 1))) (export "" 0))')(lhs, rhs), expect); } +testUnary('i32', 'clz', 40, 26); +//testUnary('i32', 'ctz', 40, 0); // TODO: NYI +//testUnary('i32', 'popcnt', 40, 0); // TODO: NYI + testBinary('i32', 'add', 40, 2, 42); testBinary('i32', 'sub', 40, 2, 38); testBinary('i32', 'mul', 40, 2, 80); @@ -26,6 +34,9 @@ testBinary('i32', 'shl', 40, 2, 160); testBinary('i32', 'shr_s', -40, 2, -10); testBinary('i32', 'shr_u', -40, 2, 1073741814); +assertErrorMessage(() => wasmEvalText('(module (func (param f32) (result i32) (i32.popcnt (get_local 0))))'), TypeError, mismatchError("f32", "i32")); +assertErrorMessage(() => wasmEvalText('(module (func (param i32) (result f32) (i32.popcnt (get_local 0))))'), TypeError, mismatchError("i32", "f32")); + assertErrorMessage(() => wasmEvalText('(module (func (param f32) (param i32) (result i32) (i32.add (get_local 0) (get_local 1))))'), TypeError, mismatchError("f32", "i32")); assertErrorMessage(() => wasmEvalText('(module (func (param i32) (param f32) (result i32) (i32.add (get_local 0) (get_local 1))))'), TypeError, mismatchError("f32", "i32")); assertErrorMessage(() => wasmEvalText('(module (func (param i32) (param i32) (result f32) (i32.add (get_local 0) (get_local 1))))'), TypeError, mismatchError("i32", "f32")); From 28f194b814cc3c16447cc05f4fcd98ab4681a15d Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 2 Feb 2016 12:30:54 -0800 Subject: [PATCH 068/117] Bug 1244571 - BaldrMonkey: Implement the comparison operators. r=luke --- js/src/asmjs/Wasm.cpp | 33 ++++++ js/src/asmjs/WasmText.cpp | 114 +++++++++++++++++++- js/src/jit-test/tests/wasm/basic-float.js | 25 +++++ js/src/jit-test/tests/wasm/basic-integer.js | 19 ++++ 4 files changed, 189 insertions(+), 2 deletions(-) diff --git a/js/src/asmjs/Wasm.cpp b/js/src/asmjs/Wasm.cpp index 18cf6a1e3d2..a81a93bcd1b 100644 --- a/js/src/asmjs/Wasm.cpp +++ b/js/src/asmjs/Wasm.cpp @@ -279,6 +279,14 @@ DecodeBinaryOperator(FunctionDecoder& f, ExprType expected) DecodeExpr(f, expected); } +static bool +DecodeComparisonOperator(FunctionDecoder& f, ExprType expected, ExprType type) +{ + return CheckType(f, ExprType::I32, expected) && + DecodeExpr(f, type) && + DecodeExpr(f, type); +} + static bool DecodeExpr(FunctionDecoder& f, ExprType expected) { @@ -347,6 +355,31 @@ DecodeExpr(FunctionDecoder& f, ExprType expected) case Expr::F64Max: case Expr::F64CopySign: return DecodeBinaryOperator(f, expected); + case Expr::I32Eq: + case Expr::I32Ne: + case Expr::I32LtS: + case Expr::I32LtU: + case Expr::I32LeS: + case Expr::I32LeU: + case Expr::I32GtS: + case Expr::I32GtU: + case Expr::I32GeS: + case Expr::I32GeU: + return DecodeComparisonOperator(f, expected, ExprType::I32); + case Expr::F32Eq: + case Expr::F32Ne: + case Expr::F32Lt: + case Expr::F32Le: + case Expr::F32Gt: + case Expr::F32Ge: + return DecodeComparisonOperator(f, expected, ExprType::F32); + case Expr::F64Eq: + case Expr::F64Ne: + case Expr::F64Lt: + case Expr::F64Le: + case Expr::F64Gt: + case Expr::F64Ge: + return DecodeComparisonOperator(f, expected, ExprType::F64); default: break; } diff --git a/js/src/asmjs/WasmText.cpp b/js/src/asmjs/WasmText.cpp index 579c592f8d4..c446df31141 100644 --- a/js/src/asmjs/WasmText.cpp +++ b/js/src/asmjs/WasmText.cpp @@ -96,6 +96,7 @@ enum class WasmAstExprKind BinaryOperator, Block, Call, + ComparisonOperator, Const, GetLocal, Nop, @@ -347,6 +348,24 @@ class WasmAstBinaryOperator final : public WasmAstExpr WasmAstExpr* rhs() const { return rhs_; } }; +class WasmAstComparisonOperator final : public WasmAstExpr +{ + Expr expr_; + WasmAstExpr* lhs_; + WasmAstExpr* rhs_; + + public: + static const WasmAstExprKind Kind = WasmAstExprKind::ComparisonOperator; + explicit WasmAstComparisonOperator(Expr expr, WasmAstExpr* lhs, WasmAstExpr* rhs) + : WasmAstExpr(Kind), + expr_(expr), lhs_(lhs), rhs_(rhs) + {} + + Expr expr() const { return expr_; } + WasmAstExpr* lhs() const { return lhs_; } + WasmAstExpr* rhs() const { return rhs_; } +}; + /*****************************************************************************/ // wasm text token stream @@ -360,6 +379,7 @@ class WasmToken Call, CallImport, CloseParen, + ComparisonOpcode, Const, EndOfFile, Error, @@ -422,7 +442,7 @@ class WasmToken end_(end) { MOZ_ASSERT(begin != end); - MOZ_ASSERT(kind_ == UnaryOpcode || kind_ == BinaryOpcode); + MOZ_ASSERT(kind_ == UnaryOpcode || kind_ == BinaryOpcode || kind_ == ComparisonOpcode); u.expr_ = expr; } explicit WasmToken(const char16_t* begin) @@ -455,7 +475,7 @@ class WasmToken return u.valueType_; } Expr expr() const { - MOZ_ASSERT(kind_ == UnaryOpcode || kind_ == BinaryOpcode); + MOZ_ASSERT(kind_ == UnaryOpcode || kind_ == BinaryOpcode || kind_ == ComparisonOpcode); return u.expr_; } }; @@ -613,10 +633,26 @@ class WasmTokenStream if (consume(MOZ_UTF16("div"))) return WasmToken(WasmToken::BinaryOpcode, Expr::F32Div, begin, cur_); break; + case 'e': + if (consume(MOZ_UTF16("eq"))) + return WasmToken(WasmToken::ComparisonOpcode, Expr::F32Eq, begin, cur_); + break; case 'f': if (consume(MOZ_UTF16("floor"))) return WasmToken(WasmToken::UnaryOpcode, Expr::F32Floor, begin, cur_); break; + case 'g': + if (consume(MOZ_UTF16("ge"))) + return WasmToken(WasmToken::ComparisonOpcode, Expr::F32Ge, begin, cur_); + if (consume(MOZ_UTF16("gt"))) + return WasmToken(WasmToken::ComparisonOpcode, Expr::F32Gt, begin, cur_); + break; + case 'l': + if (consume(MOZ_UTF16("le"))) + return WasmToken(WasmToken::ComparisonOpcode, Expr::F32Le, begin, cur_); + if (consume(MOZ_UTF16("lt"))) + return WasmToken(WasmToken::ComparisonOpcode, Expr::F32Lt, begin, cur_); + break; case 'm': if (consume(MOZ_UTF16("max"))) return WasmToken(WasmToken::BinaryOpcode, Expr::F32Max, begin, cur_); @@ -630,6 +666,8 @@ class WasmTokenStream return WasmToken(WasmToken::UnaryOpcode, Expr::F32Nearest, begin, cur_); if (consume(MOZ_UTF16("neg"))) return WasmToken(WasmToken::UnaryOpcode, Expr::F32Neg, begin, cur_); + if (consume(MOZ_UTF16("ne"))) + return WasmToken(WasmToken::ComparisonOpcode, Expr::F32Ne, begin, cur_); break; case 's': if (consume(MOZ_UTF16("sqrt"))) @@ -667,10 +705,26 @@ class WasmTokenStream if (consume(MOZ_UTF16("div"))) return WasmToken(WasmToken::BinaryOpcode, Expr::F64Div, begin, cur_); break; + case 'e': + if (consume(MOZ_UTF16("eq"))) + return WasmToken(WasmToken::ComparisonOpcode, Expr::F64Eq, begin, cur_); + break; case 'f': if (consume(MOZ_UTF16("floor"))) return WasmToken(WasmToken::UnaryOpcode, Expr::F64Floor, begin, cur_); break; + case 'g': + if (consume(MOZ_UTF16("ge"))) + return WasmToken(WasmToken::ComparisonOpcode, Expr::F64Ge, begin, cur_); + if (consume(MOZ_UTF16("gt"))) + return WasmToken(WasmToken::ComparisonOpcode, Expr::F64Gt, begin, cur_); + break; + case 'l': + if (consume(MOZ_UTF16("le"))) + return WasmToken(WasmToken::ComparisonOpcode, Expr::F64Le, begin, cur_); + if (consume(MOZ_UTF16("lt"))) + return WasmToken(WasmToken::ComparisonOpcode, Expr::F64Lt, begin, cur_); + break; case 'm': if (consume(MOZ_UTF16("max"))) return WasmToken(WasmToken::BinaryOpcode, Expr::F64Max, begin, cur_); @@ -684,6 +738,8 @@ class WasmTokenStream return WasmToken(WasmToken::UnaryOpcode, Expr::F64Nearest, begin, cur_); if (consume(MOZ_UTF16("neg"))) return WasmToken(WasmToken::UnaryOpcode, Expr::F64Neg, begin, cur_); + if (consume(MOZ_UTF16("ne"))) + return WasmToken(WasmToken::ComparisonOpcode, Expr::F64Ne, begin, cur_); break; case 's': if (consume(MOZ_UTF16("sqrt"))) @@ -730,10 +786,38 @@ class WasmTokenStream if (consume(MOZ_UTF16("div_u"))) return WasmToken(WasmToken::BinaryOpcode, Expr::I32DivU, begin, cur_); break; + case 'e': + if (consume(MOZ_UTF16("eq"))) + return WasmToken(WasmToken::ComparisonOpcode, Expr::I32Eq, begin, cur_); + break; + case 'g': + if (consume(MOZ_UTF16("ge_s"))) + return WasmToken(WasmToken::ComparisonOpcode, Expr::I32GeS, begin, cur_); + if (consume(MOZ_UTF16("ge_u"))) + return WasmToken(WasmToken::ComparisonOpcode, Expr::I32GeU, begin, cur_); + if (consume(MOZ_UTF16("gt_s"))) + return WasmToken(WasmToken::ComparisonOpcode, Expr::I32GtS, begin, cur_); + if (consume(MOZ_UTF16("gt_u"))) + return WasmToken(WasmToken::ComparisonOpcode, Expr::I32GtU, begin, cur_); + break; + case 'l': + if (consume(MOZ_UTF16("le_s"))) + return WasmToken(WasmToken::ComparisonOpcode, Expr::I32LeS, begin, cur_); + if (consume(MOZ_UTF16("le_u"))) + return WasmToken(WasmToken::ComparisonOpcode, Expr::I32LeU, begin, cur_); + if (consume(MOZ_UTF16("lt_s"))) + return WasmToken(WasmToken::ComparisonOpcode, Expr::I32LtS, begin, cur_); + if (consume(MOZ_UTF16("lt_u"))) + return WasmToken(WasmToken::ComparisonOpcode, Expr::I32LtU, begin, cur_); + break; case 'm': if (consume(MOZ_UTF16("mul"))) return WasmToken(WasmToken::BinaryOpcode, Expr::I32Mul, begin, cur_); break; + case 'n': + if (consume(MOZ_UTF16("ne"))) + return WasmToken(WasmToken::ComparisonOpcode, Expr::I32Ne, begin, cur_); + break; case 'o': if (consume(MOZ_UTF16("or"))) return WasmToken(WasmToken::BinaryOpcode, Expr::I32Or, begin, cur_); @@ -1012,6 +1096,20 @@ ParseBinaryOperator(WasmParseContext& c, Expr expr) return new(c.lifo) WasmAstBinaryOperator(expr, lhs, rhs); } +static WasmAstComparisonOperator* +ParseComparisonOperator(WasmParseContext& c, Expr expr) +{ + WasmAstExpr* lhs = ParseExpr(c); + if (!lhs) + return nullptr; + + WasmAstExpr* rhs = ParseExpr(c); + if (!rhs) + return nullptr; + + return new(c.lifo) WasmAstComparisonOperator(expr, lhs, rhs); +} + static WasmAstExpr* ParseExprInsideParens(WasmParseContext& c) { @@ -1030,6 +1128,8 @@ ParseExprInsideParens(WasmParseContext& c) return ParseCall(c, Expr::CallImport); case WasmToken::Const: return ParseConst(c, token); + case WasmToken::ComparisonOpcode: + return ParseComparisonOperator(c, token.expr()); case WasmToken::GetLocal: return ParseGetLocal(c); case WasmToken::SetLocal: @@ -1298,6 +1398,14 @@ EncodeBinaryOperator(Encoder& e, WasmAstBinaryOperator& b) EncodeExpr(e, *b.rhs()); } +static bool +EncodeComparisonOperator(Encoder& e, WasmAstComparisonOperator& b) +{ + return e.writeExpr(b.expr()) && + EncodeExpr(e, *b.lhs()) && + EncodeExpr(e, *b.rhs()); +} + static bool EncodeExpr(Encoder& e, WasmAstExpr& expr) { @@ -1310,6 +1418,8 @@ EncodeExpr(Encoder& e, WasmAstExpr& expr) return EncodeBlock(e, expr.as()); case WasmAstExprKind::Call: return EncodeCall(e, expr.as()); + case WasmAstExprKind::ComparisonOperator: + return EncodeComparisonOperator(e, expr.as()); case WasmAstExprKind::Const: return EncodeConst(e, expr.as()); case WasmAstExprKind::GetLocal: diff --git a/js/src/jit-test/tests/wasm/basic-float.js b/js/src/jit-test/tests/wasm/basic-float.js index 75d4edfd147..f00cf8b1764 100644 --- a/js/src/jit-test/tests/wasm/basic-float.js +++ b/js/src/jit-test/tests/wasm/basic-float.js @@ -16,6 +16,10 @@ function testBinary(type, opcode, lhs, rhs, expect) { assertEq(wasmEvalText('(module (func (param ' + type + ') (param ' + type + ') (result ' + type + ') (' + type + '.' + opcode + ' (get_local 0) (get_local 1))) (export "" 0))')(lhs, rhs), expect); } +function testComparison(type, opcode, lhs, rhs, expect) { + assertEq(wasmEvalText('(module (func (param ' + type + ') (param ' + type + ') (result i32) (' + type + '.' + opcode + ' (get_local 0) (get_local 1))) (export "" 0))')(lhs, rhs), expect); +} + testUnary('f32', 'abs', -40, 40); testUnary('f32', 'neg', 40, -40); testUnary('f32', 'floor', 40.9, 40); @@ -32,6 +36,13 @@ testBinary('f32', 'div', 40, 3, 13.333333015441895); //testBinary('f32', 'max', 40, 2, 40); // TODO: NYI //testBinary('f32', 'copysign', 40, -2, -40); // TODO: NYI +testComparison('f32', 'eq', 40, 40, 1); +testComparison('f32', 'ne', 40, 40, 0); +testComparison('f32', 'lt', 40, 40, 0); +testComparison('f32', 'le', 40, 40, 1); +testComparison('f32', 'gt', 40, 40, 0); +testComparison('f32', 'ge', 40, 40, 1); + testUnary('f64', 'abs', -40, 40); testUnary('f64', 'neg', 40, -40); testUnary('f64', 'floor', 40.9, 40); @@ -48,6 +59,13 @@ testBinary('f64', 'div', 40, 3, 13.333333333333334); //testBinary('f64', 'max', 40, 2, 40); // TODO: NYI //testBinary('f64', 'copysign', 40, -2, -40); // TODO: NYI +testComparison('f64', 'eq', 40, 40, 1); +testComparison('f64', 'ne', 40, 40, 0); +testComparison('f64', 'lt', 40, 40, 0); +testComparison('f64', 'le', 40, 40, 1); +testComparison('f64', 'gt', 40, 40, 0); +testComparison('f64', 'ge', 40, 40, 1); + assertErrorMessage(() => wasmEvalText('(module (func (param i32) (result f32) (f32.sqrt (get_local 0))))'), TypeError, mismatchError("i32", "f32")); assertErrorMessage(() => wasmEvalText('(module (func (param f32) (result i32) (f32.sqrt (get_local 0))))'), TypeError, mismatchError("f32", "i32")); assertErrorMessage(() => wasmEvalText('(module (func (param i32) (result f64) (f64.sqrt (get_local 0))))'), TypeError, mismatchError("i32", "f64")); @@ -59,3 +77,10 @@ assertErrorMessage(() => wasmEvalText('(module (func (param f32) (param f32) (re assertErrorMessage(() => wasmEvalText('(module (func (param i32) (param f64) (result f64) (f64.add (get_local 0) (get_local 1))))'), TypeError, mismatchError("i32", "f64")); assertErrorMessage(() => wasmEvalText('(module (func (param f64) (param i32) (result f64) (f64.add (get_local 0) (get_local 1))))'), TypeError, mismatchError("i32", "f64")); assertErrorMessage(() => wasmEvalText('(module (func (param f64) (param f64) (result i32) (f64.add (get_local 0) (get_local 1))))'), TypeError, mismatchError("f64", "i32")); + +assertErrorMessage(() => wasmEvalText('(module (func (param i32) (param f32) (result f32) (f32.eq (get_local 0) (get_local 1))))'), TypeError, mismatchError("i32", "f32")); +assertErrorMessage(() => wasmEvalText('(module (func (param f32) (param i32) (result f32) (f32.eq (get_local 0) (get_local 1))))'), TypeError, mismatchError("i32", "f32")); +assertErrorMessage(() => wasmEvalText('(module (func (param f32) (param f32) (result f32) (f32.eq (get_local 0) (get_local 1))))'), TypeError, mismatchError("i32", "f32")); +assertErrorMessage(() => wasmEvalText('(module (func (param i32) (param f64) (result f64) (f64.eq (get_local 0) (get_local 1))))'), TypeError, mismatchError("i32", "f64")); +assertErrorMessage(() => wasmEvalText('(module (func (param f64) (param i32) (result f64) (f64.eq (get_local 0) (get_local 1))))'), TypeError, mismatchError("i32", "f64")); +assertErrorMessage(() => wasmEvalText('(module (func (param f64) (param f64) (result f64) (f64.eq (get_local 0) (get_local 1))))'), TypeError, mismatchError("i32", "f64")); diff --git a/js/src/jit-test/tests/wasm/basic-integer.js b/js/src/jit-test/tests/wasm/basic-integer.js index 8df03f398a6..8b17bf1f095 100644 --- a/js/src/jit-test/tests/wasm/basic-integer.js +++ b/js/src/jit-test/tests/wasm/basic-integer.js @@ -16,6 +16,10 @@ function testBinary(type, opcode, lhs, rhs, expect) { assertEq(wasmEvalText('(module (func (param ' + type + ') (param ' + type + ') (result ' + type + ') (' + type + '.' + opcode + ' (get_local 0) (get_local 1))) (export "" 0))')(lhs, rhs), expect); } +function testComparison(type, opcode, lhs, rhs, expect) { + assertEq(wasmEvalText('(module (func (param ' + type + ') (param ' + type + ') (result i32) (' + type + '.' + opcode + ' (get_local 0) (get_local 1))) (export "" 0))')(lhs, rhs), expect); +} + testUnary('i32', 'clz', 40, 26); //testUnary('i32', 'ctz', 40, 0); // TODO: NYI //testUnary('i32', 'popcnt', 40, 0); // TODO: NYI @@ -34,9 +38,24 @@ testBinary('i32', 'shl', 40, 2, 160); testBinary('i32', 'shr_s', -40, 2, -10); testBinary('i32', 'shr_u', -40, 2, 1073741814); +testComparison('i32', 'eq', 40, 40, 1); +testComparison('i32', 'ne', 40, 40, 0); +testComparison('i32', 'lt_s', 40, 40, 0); +testComparison('i32', 'lt_u', 40, 40, 0); +testComparison('i32', 'le_s', 40, 40, 1); +testComparison('i32', 'le_u', 40, 40, 1); +testComparison('i32', 'gt_s', 40, 40, 0); +testComparison('i32', 'gt_u', 40, 40, 0); +testComparison('i32', 'ge_s', 40, 40, 1); +testComparison('i32', 'ge_u', 40, 40, 1); + assertErrorMessage(() => wasmEvalText('(module (func (param f32) (result i32) (i32.popcnt (get_local 0))))'), TypeError, mismatchError("f32", "i32")); assertErrorMessage(() => wasmEvalText('(module (func (param i32) (result f32) (i32.popcnt (get_local 0))))'), TypeError, mismatchError("i32", "f32")); assertErrorMessage(() => wasmEvalText('(module (func (param f32) (param i32) (result i32) (i32.add (get_local 0) (get_local 1))))'), TypeError, mismatchError("f32", "i32")); assertErrorMessage(() => wasmEvalText('(module (func (param i32) (param f32) (result i32) (i32.add (get_local 0) (get_local 1))))'), TypeError, mismatchError("f32", "i32")); assertErrorMessage(() => wasmEvalText('(module (func (param i32) (param i32) (result f32) (i32.add (get_local 0) (get_local 1))))'), TypeError, mismatchError("i32", "f32")); + +assertErrorMessage(() => wasmEvalText('(module (func (param f32) (param i32) (result i32) (i32.eq (get_local 0) (get_local 1))))'), TypeError, mismatchError("f32", "i32")); +assertErrorMessage(() => wasmEvalText('(module (func (param i32) (param f32) (result i32) (i32.eq (get_local 0) (get_local 1))))'), TypeError, mismatchError("f32", "i32")); +assertErrorMessage(() => wasmEvalText('(module (func (param i32) (param i32) (result f32) (i32.eq (get_local 0) (get_local 1))))'), TypeError, mismatchError("i32", "f32")); From edfdb7586e38b81712eca3cf934d61b6ab164996 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 2 Feb 2016 12:30:54 -0800 Subject: [PATCH 069/117] Bug 1244571 - BaldrMonkey: Type-check the unary and binary operators. r=luke --- js/src/asmjs/Wasm.cpp | 20 +++++++++++++------- js/src/jit-test/tests/wasm/basic-float.js | 4 ++++ js/src/jit-test/tests/wasm/basic-integer.js | 2 ++ 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/js/src/asmjs/Wasm.cpp b/js/src/asmjs/Wasm.cpp index a81a93bcd1b..ddfaca313f7 100644 --- a/js/src/asmjs/Wasm.cpp +++ b/js/src/asmjs/Wasm.cpp @@ -267,16 +267,18 @@ DecodeBlock(FunctionDecoder& f, ExprType expected) } static bool -DecodeUnaryOperator(FunctionDecoder& f, ExprType expected) +DecodeUnaryOperator(FunctionDecoder& f, ExprType expected, ExprType type) { - return DecodeExpr(f, expected); + return CheckType(f, type, expected) && + DecodeExpr(f, expected); } static bool -DecodeBinaryOperator(FunctionDecoder& f, ExprType expected) +DecodeBinaryOperator(FunctionDecoder& f, ExprType expected, ExprType type) { - return DecodeExpr(f, expected) && - DecodeExpr(f, expected); + return CheckType(f, type, expected) && + DecodeExpr(f, type) && + DecodeExpr(f, type); } static bool @@ -312,6 +314,7 @@ DecodeExpr(FunctionDecoder& f, ExprType expected) case Expr::I32Clz: case Expr::I32Ctz: case Expr::I32Popcnt: + return DecodeUnaryOperator(f, expected, ExprType::I32); case Expr::F32Abs: case Expr::F32Neg: case Expr::F32Ceil: @@ -319,6 +322,7 @@ DecodeExpr(FunctionDecoder& f, ExprType expected) case Expr::F32Trunc: case Expr::F32Nearest: case Expr::F32Sqrt: + return DecodeUnaryOperator(f, expected, ExprType::F32); case Expr::F64Abs: case Expr::F64Neg: case Expr::F64Ceil: @@ -326,7 +330,7 @@ DecodeExpr(FunctionDecoder& f, ExprType expected) case Expr::F64Trunc: case Expr::F64Nearest: case Expr::F64Sqrt: - return DecodeUnaryOperator(f, expected); + return DecodeUnaryOperator(f, expected, ExprType::F64); case Expr::I32Add: case Expr::I32Sub: case Expr::I32Mul: @@ -340,6 +344,7 @@ DecodeExpr(FunctionDecoder& f, ExprType expected) case Expr::I32Shl: case Expr::I32ShrS: case Expr::I32ShrU: + return DecodeBinaryOperator(f, expected, ExprType::I32); case Expr::F32Add: case Expr::F32Sub: case Expr::F32Mul: @@ -347,6 +352,7 @@ DecodeExpr(FunctionDecoder& f, ExprType expected) case Expr::F32Min: case Expr::F32Max: case Expr::F32CopySign: + return DecodeBinaryOperator(f, expected, ExprType::F32); case Expr::F64Add: case Expr::F64Sub: case Expr::F64Mul: @@ -354,7 +360,7 @@ DecodeExpr(FunctionDecoder& f, ExprType expected) case Expr::F64Min: case Expr::F64Max: case Expr::F64CopySign: - return DecodeBinaryOperator(f, expected); + return DecodeBinaryOperator(f, expected, ExprType::F64); case Expr::I32Eq: case Expr::I32Ne: case Expr::I32LtS: diff --git a/js/src/jit-test/tests/wasm/basic-float.js b/js/src/jit-test/tests/wasm/basic-float.js index f00cf8b1764..12f8b51d1aa 100644 --- a/js/src/jit-test/tests/wasm/basic-float.js +++ b/js/src/jit-test/tests/wasm/basic-float.js @@ -68,15 +68,19 @@ testComparison('f64', 'ge', 40, 40, 1); assertErrorMessage(() => wasmEvalText('(module (func (param i32) (result f32) (f32.sqrt (get_local 0))))'), TypeError, mismatchError("i32", "f32")); assertErrorMessage(() => wasmEvalText('(module (func (param f32) (result i32) (f32.sqrt (get_local 0))))'), TypeError, mismatchError("f32", "i32")); +assertErrorMessage(() => wasmEvalText('(module (func (param i32) (result i32) (f32.sqrt (get_local 0))))'), TypeError, mismatchError("f32", "i32")); assertErrorMessage(() => wasmEvalText('(module (func (param i32) (result f64) (f64.sqrt (get_local 0))))'), TypeError, mismatchError("i32", "f64")); assertErrorMessage(() => wasmEvalText('(module (func (param f64) (result i32) (f64.sqrt (get_local 0))))'), TypeError, mismatchError("f64", "i32")); +assertErrorMessage(() => wasmEvalText('(module (func (param i32) (result i32) (f64.sqrt (get_local 0))))'), TypeError, mismatchError("f64", "i32")); assertErrorMessage(() => wasmEvalText('(module (func (param i32) (param f32) (result f32) (f32.add (get_local 0) (get_local 1))))'), TypeError, mismatchError("i32", "f32")); assertErrorMessage(() => wasmEvalText('(module (func (param f32) (param i32) (result f32) (f32.add (get_local 0) (get_local 1))))'), TypeError, mismatchError("i32", "f32")); assertErrorMessage(() => wasmEvalText('(module (func (param f32) (param f32) (result i32) (f32.add (get_local 0) (get_local 1))))'), TypeError, mismatchError("f32", "i32")); +assertErrorMessage(() => wasmEvalText('(module (func (param i32) (param i32) (result i32) (f32.add (get_local 0) (get_local 1))))'), TypeError, mismatchError("f32", "i32")); assertErrorMessage(() => wasmEvalText('(module (func (param i32) (param f64) (result f64) (f64.add (get_local 0) (get_local 1))))'), TypeError, mismatchError("i32", "f64")); assertErrorMessage(() => wasmEvalText('(module (func (param f64) (param i32) (result f64) (f64.add (get_local 0) (get_local 1))))'), TypeError, mismatchError("i32", "f64")); assertErrorMessage(() => wasmEvalText('(module (func (param f64) (param f64) (result i32) (f64.add (get_local 0) (get_local 1))))'), TypeError, mismatchError("f64", "i32")); +assertErrorMessage(() => wasmEvalText('(module (func (param i32) (param i32) (result i32) (f64.add (get_local 0) (get_local 1))))'), TypeError, mismatchError("f64", "i32")); assertErrorMessage(() => wasmEvalText('(module (func (param i32) (param f32) (result f32) (f32.eq (get_local 0) (get_local 1))))'), TypeError, mismatchError("i32", "f32")); assertErrorMessage(() => wasmEvalText('(module (func (param f32) (param i32) (result f32) (f32.eq (get_local 0) (get_local 1))))'), TypeError, mismatchError("i32", "f32")); diff --git a/js/src/jit-test/tests/wasm/basic-integer.js b/js/src/jit-test/tests/wasm/basic-integer.js index 8b17bf1f095..f9aac3b5b4d 100644 --- a/js/src/jit-test/tests/wasm/basic-integer.js +++ b/js/src/jit-test/tests/wasm/basic-integer.js @@ -51,10 +51,12 @@ testComparison('i32', 'ge_u', 40, 40, 1); assertErrorMessage(() => wasmEvalText('(module (func (param f32) (result i32) (i32.popcnt (get_local 0))))'), TypeError, mismatchError("f32", "i32")); assertErrorMessage(() => wasmEvalText('(module (func (param i32) (result f32) (i32.popcnt (get_local 0))))'), TypeError, mismatchError("i32", "f32")); +assertErrorMessage(() => wasmEvalText('(module (func (param f32) (result f32) (i32.popcnt (get_local 0))))'), TypeError, mismatchError("i32", "f32")); assertErrorMessage(() => wasmEvalText('(module (func (param f32) (param i32) (result i32) (i32.add (get_local 0) (get_local 1))))'), TypeError, mismatchError("f32", "i32")); assertErrorMessage(() => wasmEvalText('(module (func (param i32) (param f32) (result i32) (i32.add (get_local 0) (get_local 1))))'), TypeError, mismatchError("f32", "i32")); assertErrorMessage(() => wasmEvalText('(module (func (param i32) (param i32) (result f32) (i32.add (get_local 0) (get_local 1))))'), TypeError, mismatchError("i32", "f32")); +assertErrorMessage(() => wasmEvalText('(module (func (param f32) (param f32) (result f32) (i32.add (get_local 0) (get_local 1))))'), TypeError, mismatchError("i32", "f32")); assertErrorMessage(() => wasmEvalText('(module (func (param f32) (param i32) (result i32) (i32.eq (get_local 0) (get_local 1))))'), TypeError, mismatchError("f32", "i32")); assertErrorMessage(() => wasmEvalText('(module (func (param i32) (param f32) (result i32) (i32.eq (get_local 0) (get_local 1))))'), TypeError, mismatchError("f32", "i32")); From 44a4088c14a83b687f516286314ac783481464c1 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 2 Feb 2016 12:30:55 -0800 Subject: [PATCH 070/117] Bug 1244571 - BaldrMonkey: Implement parsing, encoding, and decoding for the conversion operators. r=luke --- js/src/asmjs/AsmJS.cpp | 16 +-- js/src/asmjs/Wasm.cpp | 26 +++++ js/src/asmjs/WasmBinary.h | 44 +++++---- js/src/asmjs/WasmIonCompile.cpp | 42 ++++---- js/src/asmjs/WasmText.cpp | 99 +++++++++++++++++-- .../jit-test/tests/wasm/basic-conversion.js | 41 ++++++++ 6 files changed, 216 insertions(+), 52 deletions(-) create mode 100644 js/src/jit-test/tests/wasm/basic-conversion.js diff --git a/js/src/asmjs/AsmJS.cpp b/js/src/asmjs/AsmJS.cpp index d0fe96c6cee..4e8a0f21ba6 100644 --- a/js/src/asmjs/AsmJS.cpp +++ b/js/src/asmjs/AsmJS.cpp @@ -4564,15 +4564,15 @@ CheckFloatCoercionArg(FunctionValidator& f, ParseNode* inputNode, Type inputType size_t opcodeAt) { if (inputType.isMaybeDouble()) { - f.patchOp(opcodeAt, Expr::F32FromF64); + f.patchOp(opcodeAt, Expr::F32DemoteF64); return true; } if (inputType.isSigned()) { - f.patchOp(opcodeAt, Expr::F32FromS32); + f.patchOp(opcodeAt, Expr::F32ConvertSI32); return true; } if (inputType.isUnsigned()) { - f.patchOp(opcodeAt, Expr::F32FromU32); + f.patchOp(opcodeAt, Expr::F32ConvertUI32); return true; } if (inputType.isFloatish()) { @@ -4820,7 +4820,7 @@ class CheckSimdScalarArgs // We emitted a double literal and actually want a float32. MOZ_ASSERT(patchAt != size_t(-1)); - f.patchOp(patchAt, Expr::F32FromF64); + f.patchOp(patchAt, Expr::F32DemoteF64); return true; } @@ -5411,11 +5411,11 @@ CoerceResult(FunctionValidator& f, ParseNode* expr, ExprType expected, Type actu if (actual.isMaybeDouble()) f.patchOp(patchAt, Expr::Id); else if (actual.isMaybeFloat()) - f.patchOp(patchAt, Expr::F64FromF32); + f.patchOp(patchAt, Expr::F64PromoteF32); else if (actual.isSigned()) - f.patchOp(patchAt, Expr::F64FromS32); + f.patchOp(patchAt, Expr::F64ConvertSI32); else if (actual.isUnsigned()) - f.patchOp(patchAt, Expr::F64FromU32); + f.patchOp(patchAt, Expr::F64ConvertUI32); else return f.failf(expr, "%s is not a subtype of double?, float?, signed or unsigned", actual.toChars()); break; @@ -5631,7 +5631,7 @@ CheckCoerceToInt(FunctionValidator& f, ParseNode* expr, Type* type) return false; if (operandType.isMaybeDouble() || operandType.isMaybeFloat()) { - Expr opcode = operandType.isMaybeDouble() ? Expr::I32SConvertF64 : Expr::I32SConvertF32; + Expr opcode = operandType.isMaybeDouble() ? Expr::I32TruncSF64 : Expr::I32TruncSF32; f.patchOp(opcodeAt, opcode); *type = Type::Signed; return true; diff --git a/js/src/asmjs/Wasm.cpp b/js/src/asmjs/Wasm.cpp index ddfaca313f7..139cb053ee5 100644 --- a/js/src/asmjs/Wasm.cpp +++ b/js/src/asmjs/Wasm.cpp @@ -289,6 +289,14 @@ DecodeComparisonOperator(FunctionDecoder& f, ExprType expected, ExprType type) DecodeExpr(f, type); } +static bool +DecodeConversionOperator(FunctionDecoder& f, ExprType expected, + ExprType dstType, ExprType srcType) +{ + return CheckType(f, dstType, expected) && + DecodeExpr(f, srcType); +} + static bool DecodeExpr(FunctionDecoder& f, ExprType expected) { @@ -386,6 +394,24 @@ DecodeExpr(FunctionDecoder& f, ExprType expected) case Expr::F64Gt: case Expr::F64Ge: return DecodeComparisonOperator(f, expected, ExprType::F64); + case Expr::I32TruncSF32: + case Expr::I32TruncUF32: + case Expr::I32ReinterpretF32: + return DecodeConversionOperator(f, expected, ExprType::I32, ExprType::F32); + case Expr::I32TruncSF64: + case Expr::I32TruncUF64: + return DecodeConversionOperator(f, expected, ExprType::I32, ExprType::F64); + case Expr::F32ConvertSI32: + case Expr::F32ConvertUI32: + case Expr::F32ReinterpretI32: + return DecodeConversionOperator(f, expected, ExprType::F32, ExprType::I32); + case Expr::F32DemoteF64: + return DecodeConversionOperator(f, expected, ExprType::F32, ExprType::F64); + case Expr::F64ConvertSI32: + case Expr::F64ConvertUI32: + return DecodeConversionOperator(f, expected, ExprType::F64, ExprType::I32); + case Expr::F64PromoteF32: + return DecodeConversionOperator(f, expected, ExprType::F64, ExprType::F32); default: break; } diff --git a/js/src/asmjs/WasmBinary.h b/js/src/asmjs/WasmBinary.h index f204c24ee80..a80501bc38b 100644 --- a/js/src/asmjs/WasmBinary.h +++ b/js/src/asmjs/WasmBinary.h @@ -154,17 +154,31 @@ enum class Expr : uint16_t F64Ge, // Conversions - I32SConvertF32, - I32SConvertF64, - I32UConvertF32, - I32UConvertF64, - I32ConvertI64, - I64SConvertF32, - I64SConvertF64, - I64UConvertF32, - I64UConvertF64, - I64SConvertI32, - I64UConvertI32, + I32WrapI64, + I64ExtendSI32, + I64ExtendUI32, + I32TruncSF32, + I32TruncSF64, + I32TruncUF32, + I32TruncUF64, + I64TruncSF32, + I64TruncSF64, + I64TruncUF32, + I64TruncUF64, + F32ConvertSI32, + F32ConvertUI32, + F64ConvertSI32, + F64ConvertUI32, + F32ConvertSI64, + F32ConvertUI64, + F64ConvertSI64, + F64ConvertUI64, + F32DemoteF64, + F64PromoteF32, + I32ReinterpretF32, + F32ReinterpretI32, + I64ReinterpretF64, + F64ReinterpretI64, // Load/store operations I32LoadMem8S, @@ -251,10 +265,6 @@ enum class Expr : uint16_t I32Abs, // F32 asm.js opcodes - F32FromF64, - F32FromS32, - F32FromU32, - F32StoreMemF64, // F64 asm.js opcodes @@ -271,10 +281,6 @@ enum class Expr : uint16_t F64Pow, F64Atan2, - F64FromF32, - F64FromS32, - F64FromU32, - F64StoreMemF32, Limit diff --git a/js/src/asmjs/WasmIonCompile.cpp b/js/src/asmjs/WasmIonCompile.cpp index ed7880e9ca5..c64538c3916 100644 --- a/js/src/asmjs/WasmIonCompile.cpp +++ b/js/src/asmjs/WasmIonCompile.cpp @@ -2726,9 +2726,11 @@ EmitExpr(FunctionCompiler& f, ExprType type, MDefinition** def, LabelVector* may return EmitMathMinMax(f, ExprType::I32, IsMax(true), def); case Expr::I32Not: return EmitUnary(f, ExprType::I32, def); - case Expr::I32SConvertF32: + case Expr::I32TruncSF32: + case Expr::I32TruncUF32: return EmitUnary(f, ExprType::F32, def); - case Expr::I32SConvertF64: + case Expr::I32TruncSF64: + case Expr::I32TruncUF64: return EmitUnary(f, ExprType::F64, def); case Expr::I32Clz: return EmitUnary(f, ExprType::I32, def); @@ -2823,11 +2825,11 @@ EmitExpr(FunctionCompiler& f, ExprType type, MDefinition** def, LabelVector* may case Expr::F32Ceil: case Expr::F32Floor: return EmitF32MathBuiltinCall(f, op, def); - case Expr::F32FromF64: + case Expr::F32DemoteF64: return EmitUnary(f, ExprType::F64, def); - case Expr::F32FromS32: + case Expr::F32ConvertSI32: return EmitUnary(f, ExprType::I32, def); - case Expr::F32FromU32: + case Expr::F32ConvertUI32: return EmitUnary(f, ExprType::I32, def); case Expr::F32LoadMem: return EmitLoadArray(f, Scalar::Float32, def); @@ -2871,11 +2873,11 @@ EmitExpr(FunctionCompiler& f, ExprType type, MDefinition** def, LabelVector* may case Expr::F64Pow: case Expr::F64Atan2: return EmitF64MathBuiltinCall(f, op, def); - case Expr::F64FromF32: + case Expr::F64PromoteF32: return EmitUnary(f, ExprType::F32, def); - case Expr::F64FromS32: + case Expr::F64ConvertSI32: return EmitUnary(f, ExprType::I32, def); - case Expr::F64FromU32: + case Expr::F64ConvertUI32: return EmitUnary(f, ExprType::I32, def); case Expr::F64LoadMem: return EmitLoadArray(f, Scalar::Float64, def); @@ -2920,16 +2922,22 @@ EmitExpr(FunctionCompiler& f, ExprType type, MDefinition** def, LabelVector* may case Expr::F64CopySign: case Expr::F64Nearest: case Expr::F64Trunc: - case Expr::I32UConvertF32: - case Expr::I32UConvertF64: - case Expr::I32ConvertI64: + case Expr::I32WrapI64: case Expr::I64Const: - case Expr::I64SConvertI32: - case Expr::I64UConvertI32: - case Expr::I64SConvertF32: - case Expr::I64SConvertF64: - case Expr::I64UConvertF32: - case Expr::I64UConvertF64: + case Expr::I64ExtendSI32: + case Expr::I64ExtendUI32: + case Expr::I64TruncSF32: + case Expr::I64TruncSF64: + case Expr::I64TruncUF32: + case Expr::I64TruncUF64: + case Expr::F32ConvertSI64: + case Expr::F32ConvertUI64: + case Expr::F64ConvertSI64: + case Expr::F64ConvertUI64: + case Expr::I64ReinterpretF64: + case Expr::F64ReinterpretI64: + case Expr::I32ReinterpretF32: + case Expr::F32ReinterpretI32: case Expr::I64LoadMem8S: case Expr::I64LoadMem16S: case Expr::I64LoadMem32S: diff --git a/js/src/asmjs/WasmText.cpp b/js/src/asmjs/WasmText.cpp index c446df31141..cd213ec2fa4 100644 --- a/js/src/asmjs/WasmText.cpp +++ b/js/src/asmjs/WasmText.cpp @@ -98,6 +98,7 @@ enum class WasmAstExprKind Call, ComparisonOperator, Const, + ConversionOperator, GetLocal, Nop, SetLocal, @@ -366,6 +367,22 @@ class WasmAstComparisonOperator final : public WasmAstExpr WasmAstExpr* rhs() const { return rhs_; } }; +class WasmAstConversionOperator final : public WasmAstExpr +{ + Expr expr_; + WasmAstExpr* op_; + + public: + static const WasmAstExprKind Kind = WasmAstExprKind::ConversionOperator; + explicit WasmAstConversionOperator(Expr expr, WasmAstExpr* op) + : WasmAstExpr(Kind), + expr_(expr), op_(op) + {} + + Expr expr() const { return expr_; } + WasmAstExpr* op() const { return op_; } +}; + /*****************************************************************************/ // wasm text token stream @@ -381,6 +398,7 @@ class WasmToken CloseParen, ComparisonOpcode, Const, + ConversionOpcode, EndOfFile, Error, Export, @@ -442,7 +460,8 @@ class WasmToken end_(end) { MOZ_ASSERT(begin != end); - MOZ_ASSERT(kind_ == UnaryOpcode || kind_ == BinaryOpcode || kind_ == ComparisonOpcode); + MOZ_ASSERT(kind_ == UnaryOpcode || kind_ == BinaryOpcode || kind_ == ComparisonOpcode || + kind_ == ConversionOpcode); u.expr_ = expr; } explicit WasmToken(const char16_t* begin) @@ -475,7 +494,8 @@ class WasmToken return u.valueType_; } Expr expr() const { - MOZ_ASSERT(kind_ == UnaryOpcode || kind_ == BinaryOpcode || kind_ == ComparisonOpcode); + MOZ_ASSERT(kind_ == UnaryOpcode || kind_ == BinaryOpcode || kind_ == ComparisonOpcode || + kind_ == ConversionOpcode); return u.expr_; } }; @@ -626,10 +646,19 @@ class WasmTokenStream return WasmToken(WasmToken::UnaryOpcode, Expr::F32Ceil, begin, cur_); if (consume(MOZ_UTF16("const"))) return WasmToken(WasmToken::Const, ValType::F32, begin, cur_); + if (consume(MOZ_UTF16("convert_s/i32"))) + return WasmToken(WasmToken::ConversionOpcode, Expr::F32ConvertSI32, + begin, cur_); + if (consume(MOZ_UTF16("convert_u/i32"))) + return WasmToken(WasmToken::ConversionOpcode, Expr::F32ConvertUI32, + begin, cur_); if (consume(MOZ_UTF16("copysign"))) return WasmToken(WasmToken::BinaryOpcode, Expr::F32CopySign, begin, cur_); break; case 'd': + if (consume(MOZ_UTF16("demote/f64"))) + return WasmToken(WasmToken::ConversionOpcode, Expr::F32DemoteF64, + begin, cur_); if (consume(MOZ_UTF16("div"))) return WasmToken(WasmToken::BinaryOpcode, Expr::F32Div, begin, cur_); break; @@ -669,6 +698,11 @@ class WasmTokenStream if (consume(MOZ_UTF16("ne"))) return WasmToken(WasmToken::ComparisonOpcode, Expr::F32Ne, begin, cur_); break; + case 'r': + if (consume(MOZ_UTF16("reinterpret/i32"))) + return WasmToken(WasmToken::ConversionOpcode, Expr::F32ReinterpretI32, + begin, cur_); + break; case 's': if (consume(MOZ_UTF16("sqrt"))) return WasmToken(WasmToken::UnaryOpcode, Expr::F32Sqrt, begin, cur_); @@ -698,6 +732,12 @@ class WasmTokenStream return WasmToken(WasmToken::UnaryOpcode, Expr::F64Ceil, begin, cur_); if (consume(MOZ_UTF16("const"))) return WasmToken(WasmToken::Const, ValType::F64, begin, cur_); + if (consume(MOZ_UTF16("convert_s/i32"))) + return WasmToken(WasmToken::ConversionOpcode, Expr::F64ConvertSI32, + begin, cur_); + if (consume(MOZ_UTF16("convert_u/i32"))) + return WasmToken(WasmToken::ConversionOpcode, Expr::F64ConvertUI32, + begin, cur_); if (consume(MOZ_UTF16("copysign"))) return WasmToken(WasmToken::BinaryOpcode, Expr::F64CopySign, begin, cur_); break; @@ -741,6 +781,11 @@ class WasmTokenStream if (consume(MOZ_UTF16("ne"))) return WasmToken(WasmToken::ComparisonOpcode, Expr::F64Ne, begin, cur_); break; + case 'p': + if (consume(MOZ_UTF16("promote/f32"))) + return WasmToken(WasmToken::ConversionOpcode, Expr::F64PromoteF32, + begin, cur_); + break; case 's': if (consume(MOZ_UTF16("sqrt"))) return WasmToken(WasmToken::UnaryOpcode, Expr::F64Sqrt, begin, cur_); @@ -822,16 +867,19 @@ class WasmTokenStream if (consume(MOZ_UTF16("or"))) return WasmToken(WasmToken::BinaryOpcode, Expr::I32Or, begin, cur_); break; + case 'p': + if (consume(MOZ_UTF16("popcnt"))) + return WasmToken(WasmToken::UnaryOpcode, Expr::I32Popcnt, begin, cur_); + break; case 'r': + if (consume(MOZ_UTF16("reinterpret/f32"))) + return WasmToken(WasmToken::UnaryOpcode, Expr::I32ReinterpretF32, + begin, cur_); if (consume(MOZ_UTF16("rem_s"))) return WasmToken(WasmToken::BinaryOpcode, Expr::I32RemS, begin, cur_); if (consume(MOZ_UTF16("rem_u"))) return WasmToken(WasmToken::BinaryOpcode, Expr::I32RemU, begin, cur_); break; - case 'p': - if (consume(MOZ_UTF16("popcnt"))) - return WasmToken(WasmToken::UnaryOpcode, Expr::I32Popcnt, begin, cur_); - break; case 's': if (consume(MOZ_UTF16("sub"))) return WasmToken(WasmToken::BinaryOpcode, Expr::I32Sub, begin, cur_); @@ -842,6 +890,20 @@ class WasmTokenStream if (consume(MOZ_UTF16("shr_u"))) return WasmToken(WasmToken::BinaryOpcode, Expr::I32ShrU, begin, cur_); break; + case 't': + if (consume(MOZ_UTF16("trunc_s/f32"))) + return WasmToken(WasmToken::ConversionOpcode, Expr::I32TruncSF32, + begin, cur_); + if (consume(MOZ_UTF16("trunc_s/f64"))) + return WasmToken(WasmToken::ConversionOpcode, Expr::I32TruncSF64, + begin, cur_); + if (consume(MOZ_UTF16("trunc_u/f32"))) + return WasmToken(WasmToken::ConversionOpcode, Expr::I32TruncUF32, + begin, cur_); + if (consume(MOZ_UTF16("trunc_u/f64"))) + return WasmToken(WasmToken::ConversionOpcode, Expr::I32TruncUF64, + begin, cur_); + break; case 'x': if (consume(MOZ_UTF16("xor"))) return WasmToken(WasmToken::BinaryOpcode, Expr::I32Xor, begin, cur_); @@ -1110,6 +1172,16 @@ ParseComparisonOperator(WasmParseContext& c, Expr expr) return new(c.lifo) WasmAstComparisonOperator(expr, lhs, rhs); } +static WasmAstConversionOperator* +ParseConversionOperator(WasmParseContext& c, Expr expr) +{ + WasmAstExpr* op = ParseExpr(c); + if (!op) + return nullptr; + + return new(c.lifo) WasmAstConversionOperator(expr, op); +} + static WasmAstExpr* ParseExprInsideParens(WasmParseContext& c) { @@ -1126,10 +1198,12 @@ ParseExprInsideParens(WasmParseContext& c) return ParseCall(c, Expr::Call); case WasmToken::CallImport: return ParseCall(c, Expr::CallImport); - case WasmToken::Const: - return ParseConst(c, token); case WasmToken::ComparisonOpcode: return ParseComparisonOperator(c, token.expr()); + case WasmToken::Const: + return ParseConst(c, token); + case WasmToken::ConversionOpcode: + return ParseConversionOperator(c, token.expr()); case WasmToken::GetLocal: return ParseGetLocal(c); case WasmToken::SetLocal: @@ -1406,6 +1480,13 @@ EncodeComparisonOperator(Encoder& e, WasmAstComparisonOperator& b) EncodeExpr(e, *b.rhs()); } +static bool +EncodeConversionOperator(Encoder& e, WasmAstConversionOperator& b) +{ + return e.writeExpr(b.expr()) && + EncodeExpr(e, *b.op()); +} + static bool EncodeExpr(Encoder& e, WasmAstExpr& expr) { @@ -1422,6 +1503,8 @@ EncodeExpr(Encoder& e, WasmAstExpr& expr) return EncodeComparisonOperator(e, expr.as()); case WasmAstExprKind::Const: return EncodeConst(e, expr.as()); + case WasmAstExprKind::ConversionOperator: + return EncodeConversionOperator(e, expr.as()); case WasmAstExprKind::GetLocal: return EncodeGetLocal(e, expr.as()); case WasmAstExprKind::SetLocal: diff --git a/js/src/jit-test/tests/wasm/basic-conversion.js b/js/src/jit-test/tests/wasm/basic-conversion.js new file mode 100644 index 00000000000..0ac245d791d --- /dev/null +++ b/js/src/jit-test/tests/wasm/basic-conversion.js @@ -0,0 +1,41 @@ +load(libdir + "wasm.js"); + +if (!wasmIsSupported()) + quit(); + +function mismatchError(actual, expect) { + var str = "type mismatch: expression has type " + actual + " but expected " + expect; + return RegExp(str); +} + +function testConversion(resultType, opcode, paramType, op, expect) { + assertEq(wasmEvalText('(module (func (param ' + paramType + ') (result ' + resultType + ') (' + resultType + '.' + opcode + '/' + paramType + ' (get_local 0))) (export "" 0))')(op), expect); + + for (var bad of ['i32', 'f32', 'f64']) { + if (bad != resultType) + assertErrorMessage(() => wasmEvalText('(module (func (param ' + paramType + ') (result ' + bad + ') (' + resultType + '.' + opcode + '/' + paramType + ' (get_local 0))))'), + TypeError, + mismatchError(resultType, bad) + ); + if (bad != paramType) + assertErrorMessage(() => wasmEvalText('(module (func (param ' + bad + ') (result ' + resultType + ') (' + resultType + '.' + opcode + '/' + paramType + ' (get_local 0))))'), + TypeError, + mismatchError(bad, paramType) + ); + } +} + +testConversion('i32', 'trunc_s', 'f32', 40.1, 40); +testConversion('i32', 'trunc_u', 'f32', 40.1, 40); +testConversion('i32', 'trunc_s', 'f64', 40.1, 40); +testConversion('i32', 'trunc_u', 'f64', 40.1, 40); +//testConversion('i32', 'reinterpret', 'f32', 40.1, 1109419622); // TODO: NYI + +testConversion('f32', 'convert_s', 'i32', 40, 40); +testConversion('f32', 'convert_u', 'i32', 40, 40); +testConversion('f32', 'demote', 'f64', 40.1, 40.099998474121094); +//testConversion('f32', 'reinterpret', 'i32', 40, 5.605193857299268e-44); // TODO: NYI + +testConversion('f64', 'convert_s', 'i32', 40, 40); +testConversion('f64', 'convert_u', 'i32', 40, 40); +testConversion('f64', 'promote', 'f32', 40.1, 40.099998474121094); From e6aa0fb4530088d52cc1da3f179a730a807161aa Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 2 Feb 2016 12:30:55 -0800 Subject: [PATCH 071/117] Bug 1244571 - BaldrMonkey: Remove obsolete opcodes. r=luke --- js/src/asmjs/WasmBinary.h | 1 - js/src/asmjs/WasmIonCompile.cpp | 1 - 2 files changed, 2 deletions(-) diff --git a/js/src/asmjs/WasmBinary.h b/js/src/asmjs/WasmBinary.h index a80501bc38b..62c66c069df 100644 --- a/js/src/asmjs/WasmBinary.h +++ b/js/src/asmjs/WasmBinary.h @@ -71,7 +71,6 @@ enum class Expr : uint16_t CallImport, // Constants and calls - I8Const, I32Const, I64Const, F64Const, diff --git a/js/src/asmjs/WasmIonCompile.cpp b/js/src/asmjs/WasmIonCompile.cpp index c64538c3916..885f4705a65 100644 --- a/js/src/asmjs/WasmIonCompile.cpp +++ b/js/src/asmjs/WasmIonCompile.cpp @@ -2913,7 +2913,6 @@ EmitExpr(FunctionCompiler& f, ExprType type, MDefinition** def, LabelVector* may case Expr::Select: case Expr::Br: case Expr::BrIf: - case Expr::I8Const: case Expr::I32Ctz: case Expr::I32Popcnt: case Expr::F32CopySign: From f48cf9356834e1c738950da4320c6d7c5e4abdfb Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 2 Feb 2016 12:30:55 -0800 Subject: [PATCH 072/117] Bug 1244571 - BaldrMonkey: Implement parsing, encoding, and decoding for i64 operators. r=luke --- js/src/asmjs/Wasm.cpp | 48 ++++++++ js/src/asmjs/WasmBinary.h | 28 +++++ js/src/asmjs/WasmIonCompile.cpp | 26 +++++ js/src/asmjs/WasmText.cpp | 104 ++++++++++++++++++ .../jit-test/tests/wasm/basic-conversion.js | 15 +++ js/src/jit-test/tests/wasm/basic-integer.js | 29 +++++ 6 files changed, 250 insertions(+) diff --git a/js/src/asmjs/Wasm.cpp b/js/src/asmjs/Wasm.cpp index 139cb053ee5..f0c31fa87ce 100644 --- a/js/src/asmjs/Wasm.cpp +++ b/js/src/asmjs/Wasm.cpp @@ -323,6 +323,10 @@ DecodeExpr(FunctionDecoder& f, ExprType expected) case Expr::I32Ctz: case Expr::I32Popcnt: return DecodeUnaryOperator(f, expected, ExprType::I32); + case Expr::I64Clz: + case Expr::I64Ctz: + case Expr::I64Popcnt: + return DecodeUnaryOperator(f, expected, ExprType::I64); case Expr::F32Abs: case Expr::F32Neg: case Expr::F32Ceil: @@ -353,6 +357,20 @@ DecodeExpr(FunctionDecoder& f, ExprType expected) case Expr::I32ShrS: case Expr::I32ShrU: return DecodeBinaryOperator(f, expected, ExprType::I32); + case Expr::I64Add: + case Expr::I64Sub: + case Expr::I64Mul: + case Expr::I64DivS: + case Expr::I64DivU: + case Expr::I64RemS: + case Expr::I64RemU: + case Expr::I64And: + case Expr::I64Or: + case Expr::I64Xor: + case Expr::I64Shl: + case Expr::I64ShrS: + case Expr::I64ShrU: + return DecodeBinaryOperator(f, expected, ExprType::I64); case Expr::F32Add: case Expr::F32Sub: case Expr::F32Mul: @@ -380,6 +398,17 @@ DecodeExpr(FunctionDecoder& f, ExprType expected) case Expr::I32GeS: case Expr::I32GeU: return DecodeComparisonOperator(f, expected, ExprType::I32); + case Expr::I64Eq: + case Expr::I64Ne: + case Expr::I64LtS: + case Expr::I64LtU: + case Expr::I64LeS: + case Expr::I64LeU: + case Expr::I64GtS: + case Expr::I64GtU: + case Expr::I64GeS: + case Expr::I64GeU: + return DecodeComparisonOperator(f, expected, ExprType::I64); case Expr::F32Eq: case Expr::F32Ne: case Expr::F32Lt: @@ -394,6 +423,8 @@ DecodeExpr(FunctionDecoder& f, ExprType expected) case Expr::F64Gt: case Expr::F64Ge: return DecodeComparisonOperator(f, expected, ExprType::F64); + case Expr::I32WrapI64: + return DecodeConversionOperator(f, expected, ExprType::I32, ExprType::I64); case Expr::I32TruncSF32: case Expr::I32TruncUF32: case Expr::I32ReinterpretF32: @@ -401,15 +432,32 @@ DecodeExpr(FunctionDecoder& f, ExprType expected) case Expr::I32TruncSF64: case Expr::I32TruncUF64: return DecodeConversionOperator(f, expected, ExprType::I32, ExprType::F64); + case Expr::I64ExtendSI32: + case Expr::I64ExtendUI32: + return DecodeConversionOperator(f, expected, ExprType::I64, ExprType::I32); + case Expr::I64TruncSF32: + case Expr::I64TruncUF32: + return DecodeConversionOperator(f, expected, ExprType::I64, ExprType::F32); + case Expr::I64TruncSF64: + case Expr::I64TruncUF64: + case Expr::I64ReinterpretF64: + return DecodeConversionOperator(f, expected, ExprType::I64, ExprType::F64); case Expr::F32ConvertSI32: case Expr::F32ConvertUI32: case Expr::F32ReinterpretI32: return DecodeConversionOperator(f, expected, ExprType::F32, ExprType::I32); + case Expr::F32ConvertSI64: + case Expr::F32ConvertUI64: + return DecodeConversionOperator(f, expected, ExprType::F32, ExprType::I64); case Expr::F32DemoteF64: return DecodeConversionOperator(f, expected, ExprType::F32, ExprType::F64); case Expr::F64ConvertSI32: case Expr::F64ConvertUI32: return DecodeConversionOperator(f, expected, ExprType::F64, ExprType::I32); + case Expr::F64ConvertSI64: + case Expr::F64ConvertUI64: + case Expr::F64ReinterpretI64: + return DecodeConversionOperator(f, expected, ExprType::F64, ExprType::I64); case Expr::F64PromoteF32: return DecodeConversionOperator(f, expected, ExprType::F64, ExprType::F32); default: diff --git a/js/src/asmjs/WasmBinary.h b/js/src/asmjs/WasmBinary.h index 62c66c069df..72cc560a9c2 100644 --- a/js/src/asmjs/WasmBinary.h +++ b/js/src/asmjs/WasmBinary.h @@ -108,6 +108,34 @@ enum class Expr : uint16_t I32Ctz, I32Popcnt, + // I64 opcodes + I64Add, + I64Sub, + I64Mul, + I64DivS, + I64DivU, + I64RemS, + I64RemU, + I64Or, + I64And, + I64Xor, + I64Shl, + I64ShrU, + I64ShrS, + I64Eq, + I64Ne, + I64LtS, + I64LeS, + I64LtU, + I64LeU, + I64GtS, + I64GeS, + I64GtU, + I64GeU, + I64Clz, + I64Ctz, + I64Popcnt, + // F32 opcodes F32Add, F32Sub, diff --git a/js/src/asmjs/WasmIonCompile.cpp b/js/src/asmjs/WasmIonCompile.cpp index 885f4705a65..50b9cdf5062 100644 --- a/js/src/asmjs/WasmIonCompile.cpp +++ b/js/src/asmjs/WasmIonCompile.cpp @@ -2948,6 +2948,32 @@ EmitExpr(FunctionCompiler& f, ExprType type, MDefinition** def, LabelVector* may case Expr::I64StoreMem16: case Expr::I64StoreMem32: case Expr::I64StoreMem: + case Expr::I64Clz: + case Expr::I64Ctz: + case Expr::I64Popcnt: + case Expr::I64Add: + case Expr::I64Sub: + case Expr::I64Mul: + case Expr::I64DivS: + case Expr::I64DivU: + case Expr::I64RemS: + case Expr::I64RemU: + case Expr::I64Or: + case Expr::I64And: + case Expr::I64Xor: + case Expr::I64Shl: + case Expr::I64ShrU: + case Expr::I64ShrS: + case Expr::I64Eq: + case Expr::I64Ne: + case Expr::I64LtS: + case Expr::I64LeS: + case Expr::I64LtU: + case Expr::I64LeU: + case Expr::I64GtS: + case Expr::I64GeS: + case Expr::I64GtU: + case Expr::I64GeU: MOZ_CRASH("NYI"); case Expr::Unreachable: break; diff --git a/js/src/asmjs/WasmText.cpp b/js/src/asmjs/WasmText.cpp index cd213ec2fa4..f8d56951caa 100644 --- a/js/src/asmjs/WasmText.cpp +++ b/js/src/asmjs/WasmText.cpp @@ -904,6 +904,11 @@ class WasmTokenStream return WasmToken(WasmToken::ConversionOpcode, Expr::I32TruncUF64, begin, cur_); break; + case 'w': + if (consume(MOZ_UTF16("wrap/i64"))) + return WasmToken(WasmToken::ConversionOpcode, Expr::I32WrapI64, + begin, cur_); + break; case 'x': if (consume(MOZ_UTF16("xor"))) return WasmToken(WasmToken::BinaryOpcode, Expr::I32Xor, begin, cur_); @@ -916,9 +921,108 @@ class WasmTokenStream return WasmToken(WasmToken::ValueType, ValType::I64, begin, cur_); switch (*cur_) { + case 'a': + if (consume(MOZ_UTF16("add"))) + return WasmToken(WasmToken::BinaryOpcode, Expr::I64Add, begin, cur_); + if (consume(MOZ_UTF16("and"))) + return WasmToken(WasmToken::BinaryOpcode, Expr::I64And, begin, cur_); + break; case 'c': if (consume(MOZ_UTF16("const"))) return WasmToken(WasmToken::Const, ValType::I64, begin, cur_); + if (consume(MOZ_UTF16("clz"))) + return WasmToken(WasmToken::UnaryOpcode, Expr::I64Clz, begin, cur_); + if (consume(MOZ_UTF16("ctz"))) + return WasmToken(WasmToken::UnaryOpcode, Expr::I64Ctz, begin, cur_); + break; + case 'd': + if (consume(MOZ_UTF16("div_s"))) + return WasmToken(WasmToken::BinaryOpcode, Expr::I64DivS, begin, cur_); + if (consume(MOZ_UTF16("div_u"))) + return WasmToken(WasmToken::BinaryOpcode, Expr::I64DivU, begin, cur_); + break; + case 'e': + if (consume(MOZ_UTF16("eq"))) + return WasmToken(WasmToken::ComparisonOpcode, Expr::I64Eq, begin, cur_); + if (consume(MOZ_UTF16("extend_s/i32"))) + return WasmToken(WasmToken::ConversionOpcode, Expr::I64ExtendSI32, + begin, cur_); + if (consume(MOZ_UTF16("extend_u/i32"))) + return WasmToken(WasmToken::ConversionOpcode, Expr::I64ExtendUI32, + begin, cur_); + break; + case 'g': + if (consume(MOZ_UTF16("ge_s"))) + return WasmToken(WasmToken::ComparisonOpcode, Expr::I64GeS, begin, cur_); + if (consume(MOZ_UTF16("ge_u"))) + return WasmToken(WasmToken::ComparisonOpcode, Expr::I64GeU, begin, cur_); + if (consume(MOZ_UTF16("gt_s"))) + return WasmToken(WasmToken::ComparisonOpcode, Expr::I64GtS, begin, cur_); + if (consume(MOZ_UTF16("gt_u"))) + return WasmToken(WasmToken::ComparisonOpcode, Expr::I64GtU, begin, cur_); + break; + case 'l': + if (consume(MOZ_UTF16("le_s"))) + return WasmToken(WasmToken::ComparisonOpcode, Expr::I64LeS, begin, cur_); + if (consume(MOZ_UTF16("le_u"))) + return WasmToken(WasmToken::ComparisonOpcode, Expr::I64LeU, begin, cur_); + if (consume(MOZ_UTF16("lt_s"))) + return WasmToken(WasmToken::ComparisonOpcode, Expr::I64LtS, begin, cur_); + if (consume(MOZ_UTF16("lt_u"))) + return WasmToken(WasmToken::ComparisonOpcode, Expr::I64LtU, begin, cur_); + break; + case 'm': + if (consume(MOZ_UTF16("mul"))) + return WasmToken(WasmToken::BinaryOpcode, Expr::I64Mul, begin, cur_); + break; + case 'n': + if (consume(MOZ_UTF16("ne"))) + return WasmToken(WasmToken::ComparisonOpcode, Expr::I64Ne, begin, cur_); + break; + case 'o': + if (consume(MOZ_UTF16("or"))) + return WasmToken(WasmToken::BinaryOpcode, Expr::I64Or, begin, cur_); + break; + case 'p': + if (consume(MOZ_UTF16("popcnt"))) + return WasmToken(WasmToken::UnaryOpcode, Expr::I64Popcnt, begin, cur_); + break; + case 'r': + if (consume(MOZ_UTF16("reinterpret/f64"))) + return WasmToken(WasmToken::UnaryOpcode, Expr::I64ReinterpretF64, + begin, cur_); + if (consume(MOZ_UTF16("rem_s"))) + return WasmToken(WasmToken::BinaryOpcode, Expr::I64RemS, begin, cur_); + if (consume(MOZ_UTF16("rem_u"))) + return WasmToken(WasmToken::BinaryOpcode, Expr::I64RemU, begin, cur_); + break; + case 's': + if (consume(MOZ_UTF16("sub"))) + return WasmToken(WasmToken::BinaryOpcode, Expr::I64Sub, begin, cur_); + if (consume(MOZ_UTF16("shl"))) + return WasmToken(WasmToken::BinaryOpcode, Expr::I64Shl, begin, cur_); + if (consume(MOZ_UTF16("shr_s"))) + return WasmToken(WasmToken::BinaryOpcode, Expr::I64ShrS, begin, cur_); + if (consume(MOZ_UTF16("shr_u"))) + return WasmToken(WasmToken::BinaryOpcode, Expr::I64ShrU, begin, cur_); + break; + case 't': + if (consume(MOZ_UTF16("trunc_s/f32"))) + return WasmToken(WasmToken::ConversionOpcode, Expr::I64TruncSF32, + begin, cur_); + if (consume(MOZ_UTF16("trunc_s/f64"))) + return WasmToken(WasmToken::ConversionOpcode, Expr::I64TruncSF64, + begin, cur_); + if (consume(MOZ_UTF16("trunc_u/f32"))) + return WasmToken(WasmToken::ConversionOpcode, Expr::I64TruncUF32, + begin, cur_); + if (consume(MOZ_UTF16("trunc_u/f64"))) + return WasmToken(WasmToken::ConversionOpcode, Expr::I64TruncUF64, + begin, cur_); + break; + case 'x': + if (consume(MOZ_UTF16("xor"))) + return WasmToken(WasmToken::BinaryOpcode, Expr::I64Xor, begin, cur_); break; } break; diff --git a/js/src/jit-test/tests/wasm/basic-conversion.js b/js/src/jit-test/tests/wasm/basic-conversion.js index 0ac245d791d..61bb83ed355 100644 --- a/js/src/jit-test/tests/wasm/basic-conversion.js +++ b/js/src/jit-test/tests/wasm/basic-conversion.js @@ -11,6 +11,7 @@ function mismatchError(actual, expect) { function testConversion(resultType, opcode, paramType, op, expect) { assertEq(wasmEvalText('(module (func (param ' + paramType + ') (result ' + resultType + ') (' + resultType + '.' + opcode + '/' + paramType + ' (get_local 0))) (export "" 0))')(op), expect); + // TODO: i64 NYI for (var bad of ['i32', 'f32', 'f64']) { if (bad != resultType) assertErrorMessage(() => wasmEvalText('(module (func (param ' + paramType + ') (result ' + bad + ') (' + resultType + '.' + opcode + '/' + paramType + ' (get_local 0))))'), @@ -25,17 +26,31 @@ function testConversion(resultType, opcode, paramType, op, expect) { } } +//testConversion('i32', 'wrap', 'i64', 4294967336, 40); // TODO: NYI testConversion('i32', 'trunc_s', 'f32', 40.1, 40); testConversion('i32', 'trunc_u', 'f32', 40.1, 40); testConversion('i32', 'trunc_s', 'f64', 40.1, 40); testConversion('i32', 'trunc_u', 'f64', 40.1, 40); //testConversion('i32', 'reinterpret', 'f32', 40.1, 1109419622); // TODO: NYI +//testConversion('i64', 'extend_s', 'i32', -2, -2); / TODO: NYI +//testConversion('i64', 'extend_u', 'i32', -2, 0xfffffffffffffffc); / TODO: NYI +//testConversion('i64', 'trunc_s', 'f32', 40.1, 40); // TODO: NYI +//testConversion('i64', 'trunc_u', 'f32', 40.1, 40); // TODO: NYI +//testConversion('i64', 'trunc_s', 'f64', 40.1, 40); // TODO: NYI +//testConversion('i64', 'trunc_u', 'f64', 40.1, 40); // TODO: NYI +//testConversion('i64', 'reinterpret', 'f64', 40.1, 1109419622); // TODO: NYI + testConversion('f32', 'convert_s', 'i32', 40, 40); testConversion('f32', 'convert_u', 'i32', 40, 40); +//testConversion('f32', 'convert_s', 'i64', 40, 40); // TODO: NYI +//testConversion('f32', 'convert_u', 'i64', 40, 40); // TODO: NYI testConversion('f32', 'demote', 'f64', 40.1, 40.099998474121094); //testConversion('f32', 'reinterpret', 'i32', 40, 5.605193857299268e-44); // TODO: NYI testConversion('f64', 'convert_s', 'i32', 40, 40); testConversion('f64', 'convert_u', 'i32', 40, 40); +//testConversion('f64', 'convert_s', 'i64', 40, 40); // TODO: NYI +//testConversion('f64', 'convert_u', 'i64', 40, 40); // TODO: NYI testConversion('f64', 'promote', 'f32', 40.1, 40.099998474121094); +//testConversion('f64', 'reinterpret', 'i64', 40.1, 4630840390592548045); // TODO: NYI diff --git a/js/src/jit-test/tests/wasm/basic-integer.js b/js/src/jit-test/tests/wasm/basic-integer.js index f9aac3b5b4d..953dd52493a 100644 --- a/js/src/jit-test/tests/wasm/basic-integer.js +++ b/js/src/jit-test/tests/wasm/basic-integer.js @@ -49,6 +49,35 @@ testComparison('i32', 'gt_u', 40, 40, 0); testComparison('i32', 'ge_s', 40, 40, 1); testComparison('i32', 'ge_u', 40, 40, 1); +//testUnary('i64', 'clz', 40, 58); // TODO: NYI +//testUnary('i64', 'ctz', 40, 0); // TODO: NYI +//testUnary('i64', 'popcnt', 40, 0); // TODO: NYI + +//testBinary('i64', 'add', 40, 2, 42); // TODO: NYI +//testBinary('i64', 'sub', 40, 2, 38); // TODO: NYI +//testBinary('i64', 'mul', 40, 2, 80); // TODO: NYI +//testBinary('i64', 'div_s', -40, 2, -20); // TODO: NYI +//testBinary('i64', 'div_u', -40, 2, 2147483628); // TODO: NYI +//testBinary('i64', 'rem_s', 40, -3, 1); // TODO: NYI +//testBinary('i64', 'rem_u', 40, -3, 40); // TODO: NYI +//testBinary('i64', 'and', 42, 6, 2); // TODO: NYI +//testBinary('i64', 'or', 42, 6, 46); // TODO: NYI +//testBinary('i64', 'xor', 42, 2, 40); // TODO: NYI +//testBinary('i64', 'shl', 40, 2, 160); // TODO: NYI +//testBinary('i64', 'shr_s', -40, 2, -10); // TODO: NYI +//testBinary('i64', 'shr_u', -40, 2, 1073741814); // TODO: NYI + +//testComparison('i64', 'eq', 40, 40, 1); // TODO: NYI +//testComparison('i64', 'ne', 40, 40, 0); // TODO: NYI +//testComparison('i64', 'lt_s', 40, 40, 0); // TODO: NYI +//testComparison('i64', 'lt_u', 40, 40, 0); // TODO: NYI +//testComparison('i64', 'le_s', 40, 40, 1); // TODO: NYI +//testComparison('i64', 'le_u', 40, 40, 1); // TODO: NYI +//testComparison('i64', 'gt_s', 40, 40, 0); // TODO: NYI +//testComparison('i64', 'gt_u', 40, 40, 0); // TODO: NYI +//testComparison('i64', 'ge_s', 40, 40, 1); // TODO: NYI +//testComparison('i64', 'ge_u', 40, 40, 1); // TODO: NYI + assertErrorMessage(() => wasmEvalText('(module (func (param f32) (result i32) (i32.popcnt (get_local 0))))'), TypeError, mismatchError("f32", "i32")); assertErrorMessage(() => wasmEvalText('(module (func (param i32) (result f32) (i32.popcnt (get_local 0))))'), TypeError, mismatchError("i32", "f32")); assertErrorMessage(() => wasmEvalText('(module (func (param f32) (result f32) (i32.popcnt (get_local 0))))'), TypeError, mismatchError("i32", "f32")); From 7ae50d65899e6a1d0261eae0933e7783861b3f52 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 2 Feb 2016 12:30:55 -0800 Subject: [PATCH 073/117] Bug 1244571 - BaldrMonkey: Improve the readability of the parser code. r=luke --- js/src/asmjs/WasmText.cpp | 41 ++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/js/src/asmjs/WasmText.cpp b/js/src/asmjs/WasmText.cpp index f8d56951caa..f65ee64d410 100644 --- a/js/src/asmjs/WasmText.cpp +++ b/js/src/asmjs/WasmText.cpp @@ -575,9 +575,10 @@ class WasmTokenStream if (cur_ == end_) return WasmToken(WasmToken::EndOfFile, cur_, cur_); - const char16_t* begin = cur_++; + const char16_t* begin = cur_; switch (*begin) { case '"': + cur_++; do { if (cur_ == end_) return fail(begin); @@ -585,19 +586,22 @@ class WasmTokenStream return WasmToken(WasmToken::Text, begin, cur_); case '$': + cur_++; while (cur_ != end_ && IsNameAfterDollar(*cur_)) cur_++; return WasmToken(WasmToken::Name, begin, cur_); case '(': + cur_++; return WasmToken(WasmToken::OpenParen, begin, cur_); case ')': + cur_++; return WasmToken(WasmToken::CloseParen, begin, cur_); case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { - CheckedInt u32 = *begin - '0'; + CheckedInt u32 = 0; while (cur_ != end_ && IsWasmDigit(*cur_)) { u32 *= 10; u32 += *cur_ - '0'; @@ -609,12 +613,12 @@ class WasmTokenStream } case 'b': - if (consume(MOZ_UTF16("lock"))) + if (consume(MOZ_UTF16("block"))) return WasmToken(WasmToken::Block, begin, cur_); break; case 'c': - if (consume(MOZ_UTF16("all"))) { + if (consume(MOZ_UTF16("call"))) { if (consume(MOZ_UTF16("_import"))) return WasmToken(WasmToken::CallImport, begin, cur_); return WasmToken(WasmToken::Call, begin, cur_); @@ -622,15 +626,15 @@ class WasmTokenStream break; case 'e': - if (consume(MOZ_UTF16("xport"))) + if (consume(MOZ_UTF16("export"))) return WasmToken(WasmToken::Export, begin, cur_); break; case 'f': - if (consume(MOZ_UTF16("unc"))) + if (consume(MOZ_UTF16("func"))) return WasmToken(WasmToken::Func, begin, cur_); - if (consume(MOZ_UTF16("32"))) { + if (consume(MOZ_UTF16("f32"))) { if (!consume(MOZ_UTF16("."))) return WasmToken(WasmToken::ValueType, ValType::F32, begin, cur_); @@ -716,7 +720,7 @@ class WasmTokenStream } break; } - if (consume(MOZ_UTF16("64"))) { + if (consume(MOZ_UTF16("f64"))) { if (!consume(MOZ_UTF16("."))) return WasmToken(WasmToken::ValueType, ValType::F64, begin, cur_); @@ -797,16 +801,17 @@ class WasmTokenStream return WasmToken(WasmToken::UnaryOpcode, Expr::F64Trunc, begin, cur_); break; } + break; } break; case 'g': - if (consume(MOZ_UTF16("et_local"))) + if (consume(MOZ_UTF16("get_local"))) return WasmToken(WasmToken::GetLocal, begin, cur_); break; case 'i': - if (consume(MOZ_UTF16("32"))) { + if (consume(MOZ_UTF16("i32"))) { if (!consume(MOZ_UTF16("."))) return WasmToken(WasmToken::ValueType, ValType::I32, begin, cur_); @@ -916,7 +921,7 @@ class WasmTokenStream } break; } - if (consume(MOZ_UTF16("64"))) { + if (consume(MOZ_UTF16("i64"))) { if (!consume(MOZ_UTF16("."))) return WasmToken(WasmToken::ValueType, ValType::I64, begin, cur_); @@ -1027,37 +1032,37 @@ class WasmTokenStream } break; } - if (consume(MOZ_UTF16("mport"))) + if (consume(MOZ_UTF16("import"))) return WasmToken(WasmToken::Import, begin, cur_); break; case 'l': - if (consume(MOZ_UTF16("ocal"))) + if (consume(MOZ_UTF16("local"))) return WasmToken(WasmToken::Local, begin, cur_); break; case 'm': - if (consume(MOZ_UTF16("odule"))) + if (consume(MOZ_UTF16("module"))) return WasmToken(WasmToken::Module, begin, cur_); break; case 'n': - if (consume(MOZ_UTF16("op"))) + if (consume(MOZ_UTF16("nop"))) return WasmToken(WasmToken::Nop, begin, cur_); break; case 'p': - if (consume(MOZ_UTF16("aram"))) + if (consume(MOZ_UTF16("param"))) return WasmToken(WasmToken::Param, begin, cur_); break; case 'r': - if (consume(MOZ_UTF16("esult"))) + if (consume(MOZ_UTF16("result"))) return WasmToken(WasmToken::Result, begin, cur_); break; case 's': - if (consume(MOZ_UTF16("et_local"))) + if (consume(MOZ_UTF16("set_local"))) return WasmToken(WasmToken::SetLocal, begin, cur_); break; From 93cef4aafd1cd240369cdcae19149f7406a2092b Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 2 Feb 2016 12:34:29 -0800 Subject: [PATCH 074/117] Bug 1244571 - BaldrMonkey: Fail decoding for operators which are not yet implemented r=luke --- js/src/asmjs/Wasm.cpp | 59 ++++++++++++++------- js/src/jit-test/tests/wasm/basic-integer.js | 6 +-- 2 files changed, 43 insertions(+), 22 deletions(-) diff --git a/js/src/asmjs/Wasm.cpp b/js/src/asmjs/Wasm.cpp index f0c31fa87ce..8611a3fe7a0 100644 --- a/js/src/asmjs/Wasm.cpp +++ b/js/src/asmjs/Wasm.cpp @@ -320,29 +320,36 @@ DecodeExpr(FunctionDecoder& f, ExprType expected) case Expr::Block: return DecodeBlock(f, expected); case Expr::I32Clz: - case Expr::I32Ctz: - case Expr::I32Popcnt: return DecodeUnaryOperator(f, expected, ExprType::I32); + case Expr::I32Ctz: + return f.fail("NYI: ctz"); + case Expr::I32Popcnt: + return f.fail("NYI: popcnt"); case Expr::I64Clz: case Expr::I64Ctz: case Expr::I64Popcnt: - return DecodeUnaryOperator(f, expected, ExprType::I64); + return f.fail("NYI: i64") && + DecodeUnaryOperator(f, expected, ExprType::I64); case Expr::F32Abs: case Expr::F32Neg: case Expr::F32Ceil: case Expr::F32Floor: - case Expr::F32Trunc: - case Expr::F32Nearest: case Expr::F32Sqrt: return DecodeUnaryOperator(f, expected, ExprType::F32); + case Expr::F32Trunc: + return f.fail("NYI: trunc"); + case Expr::F32Nearest: + return f.fail("NYI: nearest"); case Expr::F64Abs: case Expr::F64Neg: case Expr::F64Ceil: case Expr::F64Floor: - case Expr::F64Trunc: - case Expr::F64Nearest: case Expr::F64Sqrt: return DecodeUnaryOperator(f, expected, ExprType::F64); + case Expr::F64Trunc: + return f.fail("NYI: trunc"); + case Expr::F64Nearest: + return f.fail("NYI: nearest"); case Expr::I32Add: case Expr::I32Sub: case Expr::I32Mul: @@ -370,23 +377,28 @@ DecodeExpr(FunctionDecoder& f, ExprType expected) case Expr::I64Shl: case Expr::I64ShrS: case Expr::I64ShrU: - return DecodeBinaryOperator(f, expected, ExprType::I64); + return f.fail("NYI: i64") && + DecodeBinaryOperator(f, expected, ExprType::I64); case Expr::F32Add: case Expr::F32Sub: case Expr::F32Mul: case Expr::F32Div: + return DecodeBinaryOperator(f, expected, ExprType::F32); case Expr::F32Min: case Expr::F32Max: + return f.fail("NYI: min/max"); case Expr::F32CopySign: - return DecodeBinaryOperator(f, expected, ExprType::F32); + return f.fail("NYI: copysign"); case Expr::F64Add: case Expr::F64Sub: case Expr::F64Mul: case Expr::F64Div: + return DecodeBinaryOperator(f, expected, ExprType::F64); case Expr::F64Min: case Expr::F64Max: + return f.fail("NYI: min/max"); case Expr::F64CopySign: - return DecodeBinaryOperator(f, expected, ExprType::F64); + return f.fail("NYI: copysign"); case Expr::I32Eq: case Expr::I32Ne: case Expr::I32LtS: @@ -408,7 +420,8 @@ DecodeExpr(FunctionDecoder& f, ExprType expected) case Expr::I64GtU: case Expr::I64GeS: case Expr::I64GeU: - return DecodeComparisonOperator(f, expected, ExprType::I64); + return f.fail("NYI: i64") && + DecodeComparisonOperator(f, expected, ExprType::I64); case Expr::F32Eq: case Expr::F32Ne: case Expr::F32Lt: @@ -424,31 +437,38 @@ DecodeExpr(FunctionDecoder& f, ExprType expected) case Expr::F64Ge: return DecodeComparisonOperator(f, expected, ExprType::F64); case Expr::I32WrapI64: - return DecodeConversionOperator(f, expected, ExprType::I32, ExprType::I64); + return f.fail("NYI: i64") && + DecodeConversionOperator(f, expected, ExprType::I32, ExprType::I64); case Expr::I32TruncSF32: case Expr::I32TruncUF32: - case Expr::I32ReinterpretF32: return DecodeConversionOperator(f, expected, ExprType::I32, ExprType::F32); + case Expr::I32ReinterpretF32: + return f.fail("NYI: reinterpret"); case Expr::I32TruncSF64: case Expr::I32TruncUF64: return DecodeConversionOperator(f, expected, ExprType::I32, ExprType::F64); case Expr::I64ExtendSI32: case Expr::I64ExtendUI32: - return DecodeConversionOperator(f, expected, ExprType::I64, ExprType::I32); + return f.fail("NYI: i64") && + DecodeConversionOperator(f, expected, ExprType::I64, ExprType::I32); case Expr::I64TruncSF32: case Expr::I64TruncUF32: - return DecodeConversionOperator(f, expected, ExprType::I64, ExprType::F32); + return f.fail("NYI: i64") && + DecodeConversionOperator(f, expected, ExprType::I64, ExprType::F32); case Expr::I64TruncSF64: case Expr::I64TruncUF64: case Expr::I64ReinterpretF64: - return DecodeConversionOperator(f, expected, ExprType::I64, ExprType::F64); + return f.fail("NYI: i64") && + DecodeConversionOperator(f, expected, ExprType::I64, ExprType::F64); case Expr::F32ConvertSI32: case Expr::F32ConvertUI32: - case Expr::F32ReinterpretI32: return DecodeConversionOperator(f, expected, ExprType::F32, ExprType::I32); + case Expr::F32ReinterpretI32: + return f.fail("NYI: reinterpret"); case Expr::F32ConvertSI64: case Expr::F32ConvertUI64: - return DecodeConversionOperator(f, expected, ExprType::F32, ExprType::I64); + return f.fail("NYI: i64") && + DecodeConversionOperator(f, expected, ExprType::F32, ExprType::I64); case Expr::F32DemoteF64: return DecodeConversionOperator(f, expected, ExprType::F32, ExprType::F64); case Expr::F64ConvertSI32: @@ -457,7 +477,8 @@ DecodeExpr(FunctionDecoder& f, ExprType expected) case Expr::F64ConvertSI64: case Expr::F64ConvertUI64: case Expr::F64ReinterpretI64: - return DecodeConversionOperator(f, expected, ExprType::F64, ExprType::I64); + return f.fail("NYI: i64") && + DecodeConversionOperator(f, expected, ExprType::F64, ExprType::I64); case Expr::F64PromoteF32: return DecodeConversionOperator(f, expected, ExprType::F64, ExprType::F32); default: diff --git a/js/src/jit-test/tests/wasm/basic-integer.js b/js/src/jit-test/tests/wasm/basic-integer.js index 953dd52493a..99a1c9e7515 100644 --- a/js/src/jit-test/tests/wasm/basic-integer.js +++ b/js/src/jit-test/tests/wasm/basic-integer.js @@ -78,9 +78,9 @@ testComparison('i32', 'ge_u', 40, 40, 1); //testComparison('i64', 'ge_s', 40, 40, 1); // TODO: NYI //testComparison('i64', 'ge_u', 40, 40, 1); // TODO: NYI -assertErrorMessage(() => wasmEvalText('(module (func (param f32) (result i32) (i32.popcnt (get_local 0))))'), TypeError, mismatchError("f32", "i32")); -assertErrorMessage(() => wasmEvalText('(module (func (param i32) (result f32) (i32.popcnt (get_local 0))))'), TypeError, mismatchError("i32", "f32")); -assertErrorMessage(() => wasmEvalText('(module (func (param f32) (result f32) (i32.popcnt (get_local 0))))'), TypeError, mismatchError("i32", "f32")); +assertErrorMessage(() => wasmEvalText('(module (func (param f32) (result i32) (i32.clz (get_local 0))))'), TypeError, mismatchError("f32", "i32")); +assertErrorMessage(() => wasmEvalText('(module (func (param i32) (result f32) (i32.clz (get_local 0))))'), TypeError, mismatchError("i32", "f32")); +assertErrorMessage(() => wasmEvalText('(module (func (param f32) (result f32) (i32.clz (get_local 0))))'), TypeError, mismatchError("i32", "f32")); assertErrorMessage(() => wasmEvalText('(module (func (param f32) (param i32) (result i32) (i32.add (get_local 0) (get_local 1))))'), TypeError, mismatchError("f32", "i32")); assertErrorMessage(() => wasmEvalText('(module (func (param i32) (param f32) (result i32) (i32.add (get_local 0) (get_local 1))))'), TypeError, mismatchError("f32", "i32")); From 46391970edeef6dcf36324bcf392846f1011d4cb Mon Sep 17 00:00:00 2001 From: Tobias Schneider Date: Wed, 20 Jan 2016 10:09:05 -0800 Subject: [PATCH 075/117] Bug 1207914: Add some debug logging to mochitest test_bug632379.xul, to help diagnose its timeouts. --- layout/generic/test/test_bug632379.xul | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/layout/generic/test/test_bug632379.xul b/layout/generic/test/test_bug632379.xul index 4a5292e1b03..9c153eabd43 100644 --- a/layout/generic/test/test_bug632379.xul +++ b/layout/generic/test/test_bug632379.xul @@ -165,6 +165,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=632379 From 9fcf50251935f61f5951201de4323d73be25225c Mon Sep 17 00:00:00 2001 From: Nicholas Hurley Date: Mon, 1 Feb 2016 10:03:24 -0800 Subject: [PATCH 076/117] Bug 1241896 - Fix netaddr deserialization for AF_UNSPEC and AF_LOCAL. r=mcmanus --- netwerk/ipc/NeckoMessageUtils.h | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/netwerk/ipc/NeckoMessageUtils.h b/netwerk/ipc/NeckoMessageUtils.h index d2edcb8e842..f99b89df2b8 100644 --- a/netwerk/ipc/NeckoMessageUtils.h +++ b/netwerk/ipc/NeckoMessageUtils.h @@ -108,9 +108,12 @@ struct ParamTraits return false; if (aResult->raw.family == AF_UNSPEC) { - return aMsg->ReadBytes(aIter, - reinterpret_cast(&aResult->raw.data), - sizeof(aResult->raw.data)); + const char *tmp; + if (aMsg->ReadBytes(aIter, &tmp, sizeof(aResult->raw.data))) { + memcpy(&(aResult->raw.data), tmp, sizeof(aResult->raw.data)); + return true; + } + return false; } else if (aResult->raw.family == AF_INET) { return ReadParam(aMsg, aIter, &aResult->inet.port) && ReadParam(aMsg, aIter, &aResult->inet.ip); @@ -122,9 +125,12 @@ struct ParamTraits ReadParam(aMsg, aIter, &aResult->inet6.scope_id); #if defined(XP_UNIX) } else if (aResult->raw.family == AF_LOCAL) { - return aMsg->ReadBytes(aIter, - reinterpret_cast(&aResult->local.path), - sizeof(aResult->local.path)); + const char *tmp; + if (aMsg->ReadBytes(aIter, &tmp, sizeof(aResult->local.path))) { + memcpy(&(aResult->local.path), tmp, sizeof(aResult->local.path)); + return true; + } + return false; #endif } From 443753e20a220153b61655fdbf0f22cfa4df178b Mon Sep 17 00:00:00 2001 From: Blake Kaplan Date: Tue, 2 Feb 2016 13:44:11 -0800 Subject: [PATCH 077/117] Bug 1242472 - Properly propagate mTopWindowURI through redirects. r=francois/ckerschb --- netwerk/protocol/http/HttpBaseChannel.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/netwerk/protocol/http/HttpBaseChannel.cpp b/netwerk/protocol/http/HttpBaseChannel.cpp index 17bdc05cf12..359e7a72ac4 100644 --- a/netwerk/protocol/http/HttpBaseChannel.cpp +++ b/netwerk/protocol/http/HttpBaseChannel.cpp @@ -2732,6 +2732,12 @@ HttpBaseChannel::SetupReplacementChannel(nsIURI *newURI, httpInternal->SetAllowSpdy(mAllowSpdy); httpInternal->SetAllowAltSvc(mAllowAltSvc); + RefPtr realChannel; + CallQueryInterface(newChannel, realChannel.StartAssignment()); + if (realChannel) { + realChannel->SetTopWindowURI(mTopWindowURI); + } + // update the DocumentURI indicator since we are being redirected. // if this was a top-level document channel, then the new channel // should have its mDocumentURI point to newURI; otherwise, we From 2406442dad1b0a25c7a3445c20ad2fe898ca7aa3 Mon Sep 17 00:00:00 2001 From: Blake Kaplan Date: Tue, 2 Feb 2016 13:44:11 -0800 Subject: [PATCH 078/117] Bug 1243928 - Make these tests work in e10s. r=felipe --- .../privatebrowsing/test/browser/browser.ini | 3 - .../browser_privatebrowsing_windowtitle.js | 99 +++++++------------ .../browser/browser_privatebrowsing_zoom.js | 69 +++++-------- .../browser_privatebrowsing_zoomrestore.js | 76 ++++++-------- .../BrowserTestUtils/BrowserTestUtils.jsm | 49 ++++++++- .../test/browser/browser_aboutCrashes.js | 57 +++++------ 6 files changed, 161 insertions(+), 192 deletions(-) diff --git a/browser/components/privatebrowsing/test/browser/browser.ini b/browser/components/privatebrowsing/test/browser/browser.ini index 3c10a2d4388..8b16c8b8432 100644 --- a/browser/components/privatebrowsing/test/browser/browser.ini +++ b/browser/components/privatebrowsing/test/browser/browser.ini @@ -42,9 +42,6 @@ tags = trackingprotection [browser_privatebrowsing_ui.js] [browser_privatebrowsing_urlbarfocus.js] [browser_privatebrowsing_windowtitle.js] -skip-if = e10s [browser_privatebrowsing_zoom.js] -skip-if = e10s [browser_privatebrowsing_zoomrestore.js] -skip-if = e10s [browser_privatebrowsing_newtab_from_popup.js] diff --git a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_windowtitle.js b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_windowtitle.js index 5197940206f..bdd1a37e6f2 100644 --- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_windowtitle.js +++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_windowtitle.js @@ -5,10 +5,9 @@ // This test makes sure that the window title changes correctly while switching // from and to private browsing mode. -function test() { +add_task(function test() { const testPageURL = "http://mochi.test:8888/browser/" + "browser/components/privatebrowsing/test/browser/browser_privatebrowsing_windowtitle_page.html"; - waitForExplicitFinish(); requestLongerTimeout(2); // initialization of expected titles @@ -38,69 +37,41 @@ function test() { pb_about_pb_title = "You're browsing privately - " + app_name + " (Private Browsing)"; } - function testTabTitle(aWindow, url, insidePB, expected_title, funcNext) { - executeSoon(function () { - let tab = aWindow.gBrowser.selectedTab = aWindow.gBrowser.addTab(); - let browser = aWindow.gBrowser.selectedBrowser; - browser.stop(); - // ensure that the test is run after the titlebar has been updated - browser.addEventListener("load", function () { - browser.removeEventListener("load", arguments.callee, true); - executeSoon(function () { - if (aWindow.document.title != expected_title) { - executeSoon(arguments.callee); - return; - } - is(aWindow.document.title, expected_title, "The window title for " + url + - " is correct (" + (insidePB ? "inside" : "outside") + - " private browsing mode)"); + function* testTabTitle(aWindow, url, insidePB, expected_title) { + let tab = (yield BrowserTestUtils.openNewForegroundTab(aWindow.gBrowser)); + yield BrowserTestUtils.loadURI(tab.linkedBrowser, url); + yield BrowserTestUtils.browserLoaded(tab.linkedBrowser); - let win = aWindow.gBrowser.replaceTabWithWindow(tab); - win.addEventListener("load", function() { - win.removeEventListener("load", arguments.callee, false); - executeSoon(function() { - if (win.document.title != expected_title) { - executeSoon(arguments.callee); - return; - } - is(win.document.title, expected_title, "The window title for " + url + - " detached tab is correct (" + (insidePB ? "inside" : "outside") + - " private browsing mode)"); - win.close(); - aWindow.close(); - - setTimeout(funcNext, 0); - }); - }, false); - }); - }, true); - - browser.loadURI(url); + yield BrowserTestUtils.waitForCondition(() => { + return aWindow.document.title === expected_title; }); + + is(aWindow.document.title, expected_title, "The window title for " + url + + " is correct (" + (insidePB ? "inside" : "outside") + + " private browsing mode)"); + + let win = aWindow.gBrowser.replaceTabWithWindow(tab); + yield BrowserTestUtils.waitForEvent(win, "load", false); + + yield BrowserTestUtils.waitForCondition(() => { + return win.document.title === expected_title; + }); + + is(win.document.title, expected_title, "The window title for " + url + + " detached tab is correct (" + (insidePB ? "inside" : "outside") + + " private browsing mode)"); + + yield Promise.all([ BrowserTestUtils.closeWindow(win), + BrowserTestUtils.closeWindow(aWindow) ]); } - whenNewWindowLoaded({private: false}, function(win) { - testTabTitle(win, "about:blank", false, page_without_title, function() { - whenNewWindowLoaded({private: false}, function(win) { - testTabTitle(win, testPageURL, false, page_with_title, function() { - whenNewWindowLoaded({private: false}, function(win) { - testTabTitle(win, "about:privatebrowsing", false, about_pb_title, function() { - whenNewWindowLoaded({private: true}, function(win) { - testTabTitle(win, "about:blank", true, pb_page_without_title, function() { - whenNewWindowLoaded({private: true}, function(win) { - testTabTitle(win, testPageURL, true, pb_page_with_title, function() { - whenNewWindowLoaded({private: true}, function(win) { - testTabTitle(win, "about:privatebrowsing", true, pb_about_pb_title, finish); - }); - }); - }); - }); - }); - }); - }); - }); - }); - }); - }); - return; -} + function openWin(private) { + return BrowserTestUtils.openNewBrowserWindow({ private }); + } + yield Task.spawn(testTabTitle((yield openWin(false)), "about:blank", false, page_without_title)); + yield Task.spawn(testTabTitle((yield openWin(false)), testPageURL, false, page_with_title)); + yield Task.spawn(testTabTitle((yield openWin(false)), "about:privatebrowsing", false, about_pb_title)); + yield Task.spawn(testTabTitle((yield openWin(true)), "about:blank", true, pb_page_without_title)); + yield Task.spawn(testTabTitle((yield openWin(true)), testPageURL, true, pb_page_with_title)); + yield Task.spawn(testTabTitle((yield openWin(true)), "about:privatebrowsing", true, pb_about_pb_title)); +}); diff --git a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_zoom.js b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_zoom.js index 8ed67de181f..f5afcbd61c8 100644 --- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_zoom.js +++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_zoom.js @@ -5,56 +5,33 @@ // This test makes sure that private browsing turns off doesn't cause zoom // settings to be reset on tab switch (bug 464962) -function test() { - waitForExplicitFinish(); +add_task(function* test() { + let win = (yield BrowserTestUtils.openNewBrowserWindow({ private: true })); + let tabAbout = (yield BrowserTestUtils.openNewForegroundTab(win.gBrowser, "about:")); + let tabMozilla = (yield BrowserTestUtils.openNewForegroundTab(win.gBrowser, "about:")); - function testZoom(aWindow, aCallback) { - executeSoon(function() { - let tabAbout = aWindow.gBrowser.addTab(); - aWindow.gBrowser.selectedTab = tabAbout; + let mozillaZoom = win.ZoomManager.zoom; - let aboutBrowser = aWindow.gBrowser.getBrowserForTab(tabAbout); - aboutBrowser.addEventListener("load", function onAboutBrowserLoad() { - aboutBrowser.removeEventListener("load", onAboutBrowserLoad, true); - let tabMozilla = aWindow.gBrowser.addTab(); - aWindow.gBrowser.selectedTab = tabMozilla; + // change the zoom on the mozilla page + win.FullZoom.enlarge(); + // make sure the zoom level has been changed + isnot(win.ZoomManager.zoom, mozillaZoom, "Zoom level can be changed"); + mozillaZoom = win.ZoomManager.zoom; - let mozillaBrowser = aWindow.gBrowser.getBrowserForTab(tabMozilla); - mozillaBrowser.addEventListener("load", function onMozillaBrowserLoad() { - mozillaBrowser.removeEventListener("load", onMozillaBrowserLoad, true); - let mozillaZoom = aWindow.ZoomManager.zoom; + // switch to about: tab + yield BrowserTestUtils.switchTab(win.gBrowser, tabAbout); - // change the zoom on the mozilla page - aWindow.FullZoom.enlarge(); - // make sure the zoom level has been changed - isnot(aWindow.ZoomManager.zoom, mozillaZoom, "Zoom level can be changed"); - mozillaZoom = aWindow.ZoomManager.zoom; + // switch back to mozilla tab + yield BrowserTestUtils.switchTab(win.gBrowser, tabMozilla); - // switch to about: tab - aWindow.gBrowser.selectedTab = tabAbout; + // make sure the zoom level has not changed + is(win.ZoomManager.zoom, mozillaZoom, + "Entering private browsing should not reset the zoom on a tab"); - // switch back to mozilla tab - aWindow.gBrowser.selectedTab = tabMozilla; + // cleanup + win.FullZoom.reset(); + yield Promise.all([ BrowserTestUtils.removeTab(tabMozilla), + BrowserTestUtils.removeTab(tabAbout) ]); - // make sure the zoom level has not changed - is(aWindow.ZoomManager.zoom, mozillaZoom, - "Entering private browsing should not reset the zoom on a tab"); - - // cleanup - aWindow.FullZoom.reset(); - aWindow.gBrowser.removeTab(tabMozilla); - aWindow.gBrowser.removeTab(tabAbout); - aWindow.close(); - aCallback(); - - }, true); - mozillaBrowser.contentWindow.location = "about:mozilla"; - }, true); - aboutBrowser.contentWindow.location = "about:"; - }); - } - - whenNewWindowLoaded({private: true}, function(privateWindow) { - testZoom(privateWindow, finish); - }); -} + yield BrowserTestUtils.closeWindow(win); +}); diff --git a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_zoomrestore.js b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_zoomrestore.js index a2f0c6d2d58..b67bfc22958 100644 --- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_zoomrestore.js +++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_zoomrestore.js @@ -5,76 +5,60 @@ // This test makes sure that about:privatebrowsing does not appear zoomed in // if there is already a zoom site pref for about:blank (bug 487656). -function test() { +add_task(function* test() { // initialization - waitForExplicitFinish(); let windowsToClose = []; let windowsToReset = []; - function doTestWhenReady(aIsZoomedWindow, aWindow, aCallback) { + function promiseLocationChange() { + return new Promise(resolve => { + Services.obs.addObserver(function onLocationChange(subj, topic, data) { + Services.obs.removeObserver(onLocationChange, topic); + resolve(); + }, "browser-fullZoom:location-change", false); + }); + } + + function promiseTestReady(aIsZoomedWindow, aWindow) { // Need to wait on two things, the ordering of which is not guaranteed: // (1) the page load, and (2) FullZoom's update to the new page's zoom // level. FullZoom broadcasts "browser-fullZoom:location-change" when its // update is done. (See bug 856366 for details.) - let n = 0; let browser = aWindow.gBrowser.selectedBrowser; - browser.addEventListener("load", function onLoad() { - browser.removeEventListener("load", onLoad, true); - if (++n == 2) - doTest(aIsZoomedWindow, aWindow, aCallback); - }, true); - - Services.obs.addObserver(function onLocationChange(subj, topic, data) { - Services.obs.removeObserver(onLocationChange, topic); - if (++n == 2) - doTest(aIsZoomedWindow, aWindow, aCallback); - }, "browser-fullZoom:location-change", false); - - browser.loadURI("about:blank"); + return BrowserTestUtils.loadURI(browser, "about:blank").then(() => { + return Promise.all([ BrowserTestUtils.browserLoaded(browser), + promiseLocationChange() ]); + }).then(() => doTest(aIsZoomedWindow, aWindow)); } - function doTest(aIsZoomedWindow, aWindow, aCallback) { + function doTest(aIsZoomedWindow, aWindow) { if (aIsZoomedWindow) { is(aWindow.ZoomManager.zoom, 1, "Zoom level for freshly loaded about:blank should be 1"); // change the zoom on the blank page aWindow.FullZoom.enlarge(); isnot(aWindow.ZoomManager.zoom, 1, "Zoom level for about:blank should be changed"); - aCallback(); return; } + // make sure the zoom level is set to 1 is(aWindow.ZoomManager.zoom, 1, "Zoom level for about:privatebrowsing should be reset"); - aCallback(); - } - - function finishTest() { - // cleanup - windowsToReset.forEach(function(win) { - win.FullZoom.reset(); - }); - windowsToClose.forEach(function(win) { - win.close(); - }); - finish(); } function testOnWindow(options, callback) { - let win = whenNewWindowLoaded(options, - function(win) { - windowsToClose.push(win); - windowsToReset.push(win); - executeSoon(function() { callback(win); }); - }); - }; - - testOnWindow({}, function(win) { - doTestWhenReady(true, win, function() { - testOnWindow({private: true}, function(win) { - doTestWhenReady(false, win, finishTest); - }); + return BrowserTestUtils.openNewBrowserWindow(options).then((win) => { + windowsToClose.push(win); + windowsToReset.push(win); + return win; }); - }); -} + } + + yield testOnWindow({}).then(win => promiseTestReady(true, win)); + yield testOnWindow({private: true}).then(win => promiseTestReady(false, win)); + + // cleanup + windowsToReset.forEach((win) => win.FullZoom.reset()); + yield Promise.all(windowsToClose.map(win => BrowserTestUtils.closeWindow(win))); +}); diff --git a/testing/mochitest/BrowserTestUtils/BrowserTestUtils.jsm b/testing/mochitest/BrowserTestUtils/BrowserTestUtils.jsm index 7656fe56d95..bd41cd18177 100644 --- a/testing/mochitest/BrowserTestUtils/BrowserTestUtils.jsm +++ b/testing/mochitest/BrowserTestUtils/BrowserTestUtils.jsm @@ -746,5 +746,52 @@ this.BrowserTestUtils = { seq: seq }); }); - } + }, + + /** + * Will poll a condition function until it returns true. + * + * @param condition + * A condition function that must return true or false. If the + * condition ever throws, this is also treated as a false. + * @param interval + * The time interval to poll the condition function. Defaults + * to 100ms. + * @param attempts + * The number of times to poll before giving up and rejecting + * if the condition has not yet returned true. Defaults to 50 + * (~5 seconds for 100ms intervals) + * @return Promise + * Resolves when condition is true. + * Rejects if timeout is exceeded or condition ever throws. + */ + waitForCondition(condition, msg, interval=100, maxTries=50) { + return new Promise((resolve, reject) => { + let tries = 0; + let intervalID = setInterval(() => { + if (tries >= maxTries) { + clearInterval(intervalID); + msg += ` - timed out after ${maxTries} tries.`; + reject(msg); + return; + } + + let conditionPassed = false; + try { + conditionPassed = condition(); + } catch(e) { + msg += ` - threw exception: ${e}`; + clearInterval(intervalID); + reject(msg); + return; + } + + if (conditionPassed) { + clearInterval(intervalID); + resolve(); + } + tries++; + }, interval); + }); + }, }; diff --git a/toolkit/crashreporter/test/browser/browser_aboutCrashes.js b/toolkit/crashreporter/test/browser/browser_aboutCrashes.js index c38eb10dd3d..4ab587f7571 100644 --- a/toolkit/crashreporter/test/browser/browser_aboutCrashes.js +++ b/toolkit/crashreporter/test/browser/browser_aboutCrashes.js @@ -1,32 +1,25 @@ -function check_crash_list(tab, crashes) { - let doc = gBrowser.getBrowserForTab(tab).contentDocument; - let crashlinks = doc.getElementById("tbody").getElementsByTagName("a"); - is(crashlinks.length, crashes.length, "about:crashes lists correct number of crash reports"); - for(let i = 0; i < crashes.length; i++) { - is(crashlinks[i].firstChild.textContent, crashes[i].id, i + ": crash ID is correct"); - } - cleanup_fake_appdir(); - gBrowser.removeTab(tab); - finish(); -} - -function test() { - waitForExplicitFinish(); - let appD = make_fake_appdir(); - let crD = appD.clone(); - crD.append("Crash Reports"); - let crashes = add_fake_crashes(crD, 5); - // sanity check - let dirSvc = Components.classes["@mozilla.org/file/directory_service;1"] - .getService(Components.interfaces.nsIProperties); - let appDtest = dirSvc.get("UAppData", Components.interfaces.nsILocalFile); - ok(appD.equals(appDtest), "directory service provider registered ok"); - let tab = gBrowser.selectedTab = gBrowser.addTab("about:blank"); - let browser = gBrowser.getBrowserForTab(tab); - browser.addEventListener("load", function() { - browser.removeEventListener("load", arguments.callee, true); - ok(true, "about:crashes loaded"); - executeSoon(function() { check_crash_list(tab, crashes); }); - }, true); - browser.loadURI("about:crashes", null, null); -} +add_task(function* test() { + let appD = make_fake_appdir(); + let crD = appD.clone(); + crD.append("Crash Reports"); + let crashes = add_fake_crashes(crD, 5); + // sanity check + let dirSvc = Components.classes["@mozilla.org/file/directory_service;1"] + .getService(Components.interfaces.nsIProperties); + let appDtest = dirSvc.get("UAppData", Components.interfaces.nsILocalFile); + ok(appD.equals(appDtest), "directory service provider registered ok"); + + yield BrowserTestUtils.withNewTab({ gBrowser, url: "about:crashes" }, function (browser) { + info("about:crashes loaded"); + return ContentTask.spawn(browser, crashes, function (crashes) { + let doc = content.document; + let crashlinks = doc.getElementById("tbody").getElementsByTagName("a"); + is(crashlinks.length, crashes.length, "about:crashes lists correct number of crash reports"); + for(let i = 0; i < crashes.length; i++) { + is(crashlinks[i].firstChild.textContent, crashes[i].id, i + ": crash ID is correct"); + } + }); + }); + + cleanup_fake_appdir(); +}); From 7983503950629841dbc09a3572a82da8089d6bf6 Mon Sep 17 00:00:00 2001 From: Blake Kaplan Date: Tue, 2 Feb 2016 13:44:11 -0800 Subject: [PATCH 079/117] Bug 1212019 - Fix an intermittent orange with promises. r=felipe --- .../content/test/general/browser_bug724239.js | 36 ++++--------------- 1 file changed, 7 insertions(+), 29 deletions(-) diff --git a/browser/base/content/test/general/browser_bug724239.js b/browser/base/content/test/general/browser_bug724239.js index 766002ecaa5..430751b911c 100644 --- a/browser/base/content/test/general/browser_bug724239.js +++ b/browser/base/content/test/general/browser_bug724239.js @@ -1,33 +1,11 @@ /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ -function test() { - waitForExplicitFinish(); - BrowserOpenTab(); - - let tab = gBrowser.selectedTab; - let browser = tab.linkedBrowser; - - registerCleanupFunction(function () { gBrowser.removeTab(tab); }); - - whenBrowserLoaded(browser, function () { - browser.loadURI("http://example.com/"); - - whenBrowserLoaded(browser, function () { - ok(!gBrowser.canGoBack, "about:newtab wasn't added to the session history"); - finish(); - }); +add_task(function* test() { + yield BrowserTestUtils.withNewTab({ gBrowser, url: "about:blank" }, + function* (browser) { + BrowserTestUtils.loadURI(browser, "http://example.com"); + yield BrowserTestUtils.browserLoaded(browser); + ok(!gBrowser.canGoBack, "about:newtab wasn't added to the session history"); }); -} - -function whenBrowserLoaded(aBrowser, aCallback) { - if (aBrowser.contentDocument.readyState == "complete") { - executeSoon(aCallback); - return; - } - - aBrowser.addEventListener("load", function onLoad() { - aBrowser.removeEventListener("load", onLoad, true); - executeSoon(aCallback); - }, true); -} +}); From d3b96a82bcc699a210a5d68085a012a447bca66d Mon Sep 17 00:00:00 2001 From: Blake Kaplan Date: Tue, 2 Feb 2016 13:44:11 -0800 Subject: [PATCH 080/117] Bug 1242208 - Fix cached form history results with a datalist present. r=MattN --- .../components/satchel/nsFormAutoComplete.js | 31 ++-- toolkit/components/satchel/test/mochitest.ini | 1 + .../satchel/test_datalist_with_caching.html | 139 ++++++++++++++++++ 3 files changed, 158 insertions(+), 13 deletions(-) create mode 100644 toolkit/components/satchel/test_datalist_with_caching.html diff --git a/toolkit/components/satchel/nsFormAutoComplete.js b/toolkit/components/satchel/nsFormAutoComplete.js index cca6e04ace6..02108ce10b8 100644 --- a/toolkit/components/satchel/nsFormAutoComplete.js +++ b/toolkit/components/satchel/nsFormAutoComplete.js @@ -214,23 +214,26 @@ FormAutoComplete.prototype = { // If there were datalist results result is a FormAutoCompleteResult // as defined in nsFormAutoCompleteResult.jsm with the entire list // of results in wrappedResult._values and only the results from - // form history in wrappedResults.entries. + // form history in wrappedResult.entries. // First, grab the entire list of old results. let allResults = wrappedResult._labels; let datalistResults, datalistLabels; if (allResults) { // We have datalist results, extract them from the values array. - datalistLabels = allResults.slice(wrappedResult.entries.length); - let filtered = []; + // Both allResults and values arrays are in the form of: + // |--wR.entries--| + // + let oldLabels = allResults.slice(wrappedResult.entries.length); + let oldValues = wrappedResult._values.slice(wrappedResult.entries.length); + + datalistLabels = []; datalistResults = []; - for (let i = 0; i < datalistLabels.length; ++i) { - if (datalistLabels[i].toLowerCase().includes(searchString)) { - filtered.push(datalistLabels[i]); - datalistResults.push(wrappedResult._values[i]); + for (let i = 0; i < oldLabels.length; ++i) { + if (oldLabels[i].toLowerCase().includes(searchString)) { + datalistLabels.push(oldLabels[i]); + datalistResults.push(oldValues[i]); } } - - datalistLabels = filtered; } let searchTokens = searchString.split(/\s+/); @@ -260,6 +263,9 @@ FormAutoComplete.prototype = { let comments = new Array(filteredEntries.length + datalistResults.length).fill(""); comments[filteredEntries.length] = "separator"; + // History entries don't have labels (their labels would be read + // from their values). Pad out the labels array so the datalist + // results (which do have separate values and labels) line up. datalistLabels = new Array(filteredEntries.length).fill("").concat(datalistLabels); wrappedResult._values = filteredEntries.concat(datalistResults); wrappedResult._labels = datalistLabels; @@ -301,19 +307,18 @@ FormAutoComplete.prototype = { mergeResults(historyResult, datalistResult) { let values = datalistResult.wrappedJSObject._values; let labels = datalistResult.wrappedJSObject._labels; - let comments = []; + let comments = new Array(values.length).fill(""); - // formHistoryResult will be null if form autocomplete is disabled. We + // historyResult will be null if form autocomplete is disabled. We // still want the list values to display. let entries = historyResult.wrappedJSObject.entries; - let historyResults = entries.map(function(entry) { return entry.text }); + let historyResults = entries.map(entry => entry.text); let historyComments = new Array(entries.length).fill(""); // fill out the comment column for the suggestions // if we have any suggestions, put a label at the top if (values.length) { comments[0] = "separator"; - comments.fill(1, ""); } // now put the history results above the datalist suggestions diff --git a/toolkit/components/satchel/test/mochitest.ini b/toolkit/components/satchel/test/mochitest.ini index c649b9aac72..1517152e069 100644 --- a/toolkit/components/satchel/test/mochitest.ini +++ b/toolkit/components/satchel/test/mochitest.ini @@ -10,6 +10,7 @@ support-files = skip-if = e10s # bug 1162338 (needs refactoring to talk to the autocomplete popup) [test_bug_787624.html] skip-if = e10s # bug 1162338 (needs refactoring to talk to the autocomplete popup) +[test_datalist_with_caching.html] [test_form_autocomplete.html] skip-if = e10s # bug 1162329 or bug 1162338 [test_form_autocomplete_with_list.html] diff --git a/toolkit/components/satchel/test_datalist_with_caching.html b/toolkit/components/satchel/test_datalist_with_caching.html new file mode 100644 index 00000000000..8445cb15910 --- /dev/null +++ b/toolkit/components/satchel/test_datalist_with_caching.html @@ -0,0 +1,139 @@ + + + + Test for Form History Autocomplete + + + + + + + +Form History test: form field autocomplete +

    + + +
    + + +
    + + +
    + + + + + + +
    + +
    +
    +
    + + From db35c8cebf74f45fd49894aabb814eea8e3e8bdf Mon Sep 17 00:00:00 2001 From: Blake Kaplan Date: Tue, 2 Feb 2016 13:54:31 -0800 Subject: [PATCH 081/117] Bug 1242208 followup, move this file where it should be r=mattn --- .../components/satchel/{ => test}/test_datalist_with_caching.html | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename toolkit/components/satchel/{ => test}/test_datalist_with_caching.html (100%) diff --git a/toolkit/components/satchel/test_datalist_with_caching.html b/toolkit/components/satchel/test/test_datalist_with_caching.html similarity index 100% rename from toolkit/components/satchel/test_datalist_with_caching.html rename to toolkit/components/satchel/test/test_datalist_with_caching.html From 964fca228bf14d6cde627e0c11be6a3ce03e545a Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 2 Feb 2016 14:01:07 -0800 Subject: [PATCH 082/117] Bug 1245250 - BaldrMonkey: Refacfor min/max to make variadicity AsmJS-specific r=luke --- js/src/asmjs/AsmJS.cpp | 16 +++++++++------- js/src/asmjs/Wasm.cpp | 6 ++---- js/src/asmjs/WasmIonCompile.cpp | 17 ++++++----------- js/src/jit-test/tests/wasm/basic-float.js | 8 ++++---- 4 files changed, 21 insertions(+), 26 deletions(-) diff --git a/js/src/asmjs/AsmJS.cpp b/js/src/asmjs/AsmJS.cpp index 4e8a0f21ba6..02964e962e6 100644 --- a/js/src/asmjs/AsmJS.cpp +++ b/js/src/asmjs/AsmJS.cpp @@ -4011,8 +4011,7 @@ CheckMathMinMax(FunctionValidator& f, ParseNode* callNode, bool isMax, Type* typ return f.fail(callNode, "Math.min/max must be passed at least 2 arguments"); size_t opcodeAt; - size_t numArgsAt; - if (!f.tempOp(&opcodeAt) || !f.tempU8(&numArgsAt)) + if (!f.tempOp(&opcodeAt)) return false; ParseNode* firstArg = CallArgList(callNode); @@ -4020,28 +4019,31 @@ CheckMathMinMax(FunctionValidator& f, ParseNode* callNode, bool isMax, Type* typ if (!CheckExpr(f, firstArg, &firstType)) return false; + Expr expr; if (firstType.isMaybeDouble()) { *type = Type::Double; firstType = Type::MaybeDouble; - f.patchOp(opcodeAt, isMax ? Expr::F64Max : Expr::F64Min); + expr = isMax ? Expr::F64Max : Expr::F64Min; } else if (firstType.isMaybeFloat()) { *type = Type::Float; firstType = Type::MaybeFloat; - f.patchOp(opcodeAt, isMax ? Expr::F32Max : Expr::F32Min); + expr = isMax ? Expr::F32Max : Expr::F32Min; } else if (firstType.isSigned()) { *type = Type::Signed; firstType = Type::Signed; - f.patchOp(opcodeAt, isMax ? Expr::I32Max : Expr::I32Min); + expr = isMax ? Expr::I32Max : Expr::I32Min; } else { return f.failf(firstArg, "%s is not a subtype of double?, float? or signed", firstType.toChars()); } + f.patchOp(opcodeAt, expr); unsigned numArgs = CallArgListLength(callNode); - f.patchU8(numArgsAt, numArgs); - ParseNode* nextArg = NextNode(firstArg); for (unsigned i = 1; i < numArgs; i++, nextArg = NextNode(nextArg)) { + if (i != numArgs - 1 && !f.writeOp(expr)) + return false; + Type nextType; if (!CheckExpr(f, nextArg, &nextType)) return false; diff --git a/js/src/asmjs/Wasm.cpp b/js/src/asmjs/Wasm.cpp index 8611a3fe7a0..cd03a5bdb82 100644 --- a/js/src/asmjs/Wasm.cpp +++ b/js/src/asmjs/Wasm.cpp @@ -383,20 +383,18 @@ DecodeExpr(FunctionDecoder& f, ExprType expected) case Expr::F32Sub: case Expr::F32Mul: case Expr::F32Div: - return DecodeBinaryOperator(f, expected, ExprType::F32); case Expr::F32Min: case Expr::F32Max: - return f.fail("NYI: min/max"); + return DecodeBinaryOperator(f, expected, ExprType::F32); case Expr::F32CopySign: return f.fail("NYI: copysign"); case Expr::F64Add: case Expr::F64Sub: case Expr::F64Mul: case Expr::F64Div: - return DecodeBinaryOperator(f, expected, ExprType::F64); case Expr::F64Min: case Expr::F64Max: - return f.fail("NYI: min/max"); + return DecodeBinaryOperator(f, expected, ExprType::F64); case Expr::F64CopySign: return f.fail("NYI: copysign"); case Expr::I32Eq: diff --git a/js/src/asmjs/WasmIonCompile.cpp b/js/src/asmjs/WasmIonCompile.cpp index 50b9cdf5062..310f09367d0 100644 --- a/js/src/asmjs/WasmIonCompile.cpp +++ b/js/src/asmjs/WasmIonCompile.cpp @@ -1461,19 +1461,14 @@ typedef bool IsMax; static bool EmitMathMinMax(FunctionCompiler& f, ExprType type, bool isMax, MDefinition** def) { - size_t numArgs = f.readU8(); - MOZ_ASSERT(numArgs >= 2); - MDefinition* lastDef; - if (!EmitExpr(f, type, &lastDef)) + MDefinition* lhs; + if (!EmitExpr(f, type, &lhs)) + return false; + MDefinition* rhs; + if (!EmitExpr(f, type, &rhs)) return false; MIRType mirType = ToMIRType(type); - for (size_t i = 1; i < numArgs; i++) { - MDefinition* next; - if (!EmitExpr(f, type, &next)) - return false; - lastDef = f.minMax(lastDef, next, mirType, isMax); - } - *def = lastDef; + *def = f.minMax(lhs, rhs, mirType, isMax); return true; } diff --git a/js/src/jit-test/tests/wasm/basic-float.js b/js/src/jit-test/tests/wasm/basic-float.js index 12f8b51d1aa..3f85dc1fcb5 100644 --- a/js/src/jit-test/tests/wasm/basic-float.js +++ b/js/src/jit-test/tests/wasm/basic-float.js @@ -32,8 +32,8 @@ testBinary('f32', 'add', 40, 2, 42); testBinary('f32', 'sub', 40, 2, 38); testBinary('f32', 'mul', 40, 2, 80); testBinary('f32', 'div', 40, 3, 13.333333015441895); -//testBinary('f32', 'min', 40, 2, 2); // TODO: NYI -//testBinary('f32', 'max', 40, 2, 40); // TODO: NYI +testBinary('f32', 'min', 40, 2, 2); +testBinary('f32', 'max', 40, 2, 40); //testBinary('f32', 'copysign', 40, -2, -40); // TODO: NYI testComparison('f32', 'eq', 40, 40, 1); @@ -55,8 +55,8 @@ testBinary('f64', 'add', 40, 2, 42); testBinary('f64', 'sub', 40, 2, 38); testBinary('f64', 'mul', 40, 2, 80); testBinary('f64', 'div', 40, 3, 13.333333333333334); -//testBinary('f64', 'min', 40, 2, 2); // TODO: NYI -//testBinary('f64', 'max', 40, 2, 40); // TODO: NYI +testBinary('f64', 'min', 40, 2, 2); +testBinary('f64', 'max', 40, 2, 40); //testBinary('f64', 'copysign', 40, -2, -40); // TODO: NYI testComparison('f64', 'eq', 40, 40, 1); From 05a46d65c03576056c57aa4325b3c4fbad700f95 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 3 Feb 2016 09:11:07 +1100 Subject: [PATCH 083/117] Bug 1245233 - Avoid unnecessary RegExpObject clones in CopyScript(). r=luke. --- js/src/jsscript.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/jsscript.cpp b/js/src/jsscript.cpp index 0fd388a28ff..e404ea4dc69 100644 --- a/js/src/jsscript.cpp +++ b/js/src/jsscript.cpp @@ -3558,7 +3558,7 @@ js::detail::CopyScript(JSContext* cx, HandleObject scriptStaticScope, HandleScri /* RegExps */ AutoObjectVector regexps(cx); - for (unsigned i = 0; i < nregexps; i++) { + if (nregexps != 0) { HeapPtrObject* vector = src->regexps()->vector; for (unsigned i = 0; i < nregexps; i++) { JSObject* clone = CloneScriptRegExpObject(cx, vector[i]->as()); From 5a5aae62d31895df0797c4af0aeb6f82be892ec7 Mon Sep 17 00:00:00 2001 From: Shu-yu Guo Date: Tue, 2 Feb 2016 14:26:37 -0800 Subject: [PATCH 084/117] Bug 1243793 - Fix handling of labels when emitting hoisted function definitions. (r=jorendorff) --- js/src/frontend/BytecodeEmitter.cpp | 12 +++++++----- .../block-scoped-functions-deprecated-redecl.js | 12 ++++++++++++ 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitter.cpp index 482edf574a4..30660c59ce6 100644 --- a/js/src/frontend/BytecodeEmitter.cpp +++ b/js/src/frontend/BytecodeEmitter.cpp @@ -5383,15 +5383,17 @@ BytecodeEmitter::emitHoistedFunctionsInList(ParseNode* list) MOZ_ASSERT(list->pn_xflags & PNX_FUNCDEFS); for (ParseNode* pn = list->pn_head; pn; pn = pn->pn_next) { + ParseNode* maybeFun = pn; + if (!sc->strict()) { - while (pn->isKind(PNK_LABEL)) - pn = pn->as().statement(); + while (maybeFun->isKind(PNK_LABEL)) + maybeFun = maybeFun->as().statement(); } - if (pn->isKind(PNK_ANNEXB_FUNCTION) || - (pn->isKind(PNK_FUNCTION) && pn->functionIsHoisted())) + if (maybeFun->isKind(PNK_ANNEXB_FUNCTION) || + (maybeFun->isKind(PNK_FUNCTION) && maybeFun->functionIsHoisted())) { - if (!emitTree(pn)) + if (!emitTree(maybeFun)) return false; } } diff --git a/js/src/tests/ecma_6/LexicalEnvironment/block-scoped-functions-deprecated-redecl.js b/js/src/tests/ecma_6/LexicalEnvironment/block-scoped-functions-deprecated-redecl.js index 6f023b454a9..af32be5d3db 100644 --- a/js/src/tests/ecma_6/LexicalEnvironment/block-scoped-functions-deprecated-redecl.js +++ b/js/src/tests/ecma_6/LexicalEnvironment/block-scoped-functions-deprecated-redecl.js @@ -9,6 +9,18 @@ // Annex B still works. assertEq(f(), 4); +// The same thing with labels. +{ + assertEq(f(), 4); + function f() { return 3; } + assertEq(f(), 4); + l: function f() { return 4; } + assertEq(f(), 4); +} + +// Annex B still works. +assertEq(f(), 4); + function test() { { assertEq(f(), 2); From f623ea8db9c5a7137dcc4c8e6a7410145cc955bc Mon Sep 17 00:00:00 2001 From: Andrew McCreight Date: Tue, 2 Feb 2016 14:49:12 -0800 Subject: [PATCH 085/117] Bug 1219919 - Add suppressions for Windows-specific content process graphics leaks. r=erahm --- testing/mozbase/mozleak/mozleak/leaklog.py | 53 ++++++++++++++++++++-- 1 file changed, 49 insertions(+), 4 deletions(-) diff --git a/testing/mozbase/mozleak/mozleak/leaklog.py b/testing/mozbase/mozleak/mozleak/leaklog.py index 36c232760e1..c72de250778 100644 --- a/testing/mozbase/mozleak/mozleak/leaklog.py +++ b/testing/mozbase/mozleak/mozleak/leaklog.py @@ -61,10 +61,55 @@ def expectedTabProcessLeakCounts(): 'nsTArray_base': 2, }) - # Bug 1219369 - On Aurora, we leak a SyncObject in Windows. - appendExpectedLeakCounts({ - 'SyncObject': 1 - }) + # Bug 1215265 - Windows-specific graphics leaks, maybe related to + # CompositorChild and/or ImageBridgeChild not being shut down. + if mozinfo.isWin: + # Windows leaks comment to all content processes. + # 2696 bytes leaked total on Win7. + appendExpectedLeakCounts({ + 'AsyncTransactionTrackersHolder': 1, + 'CompositableChild': 1, + 'Mutex': 1, + 'PCompositableChild': 1, + 'PImageContainerChild': 1, + 'SyncObject': 1, + 'WeakReference': 2, + }) + + # Various additional graphics-related Windows leaks in Mochitests. + # M2 leaks in dom/media/tests/mochitest/ipc/ + # dt1 leaks in devtools/client/animationinspector/test/browser_animation_animated_properties_displayed.js + # dt1 leaks in devtools/client/debugger/test/mochitest/ (additional leaks are intermittent?) + # dt2 leaks in devtools/client/inspector/computed/test/ + # dt8 leaks in devtools/shared/worker/tests/browser/ (additional leaks are intermittent?) + # gl leaks in dom/canvas/test/webgl-mochitest/ + appendExpectedLeakCounts({ + 'AsyncTransactionTracker': 1, + 'AsyncTransactionTrackersHolder': 4, + 'AsyncTransactionWaiter': 1, + 'CompositableChild': 3, + 'CompositableClient': 3, + 'CondVar': 5, + 'DXGID3D9TextureData': 1, + 'FdObj': 2, + 'GfxTextureWasteTracker': 1, + 'IPC::Message': 1, + 'ITextureClientRecycleAllocator': 1, + 'LayerTransactionChild': 5, + 'Mutex': 7, + 'PCompositableChild': 3, + 'PImageContainerChild': 3, + 'PLayerTransactionChild': 5, + 'PTextureChild': 5, + 'RemoveTextureFromCompositableTracker': 1, + 'SharedMemory': 5, + 'SyncObject': 5, + 'TextureChild': 5, + 'TextureClientHolder': 1, + 'TextureData': 5, + 'WeakReference': 10, + 'nsTArray_base': 17, + }) return leaks From 565a9c1a438af23318c1992f4e7d68eaa3a9a24e Mon Sep 17 00:00:00 2001 From: Timothy Nikkel Date: Tue, 2 Feb 2016 16:51:52 -0600 Subject: [PATCH 086/117] Bug 1238337. If the intrinsic size of the image hasn't changed then we don't need to do a new predictive image decode. r=mats nsImageFrame::OnSizeAvailable will update the intrinsic ratio and ask for a reflow. Then nsImageFrame::NotifyNewCurrentRequest will be called when the image is finished loading. It previously would do a predictive decode if the intrinsic size hadn't changed. This was a mistake in http://hg.mozilla.org/mozilla-central/rev/146f1bea4147 (bug 1151359). OnSizeAvailable has this structure: if (intrinsicSizeChanged && gotInitialReflow) { if (!sizeConstrained) { requestReflow(); } } NotifyNewCurrentRequest has this structure: if (gotInitialReflow) { if (!sizeConstrained && intrinsicSizeChanged) { requestReflow(); } } Bug 1151359 added a predictive decode in a new else branch to both inner if statements. The meaning of this is obviously quite different. --- layout/generic/nsImageFrame.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/layout/generic/nsImageFrame.cpp b/layout/generic/nsImageFrame.cpp index 7256a013b07..20e6f551283 100644 --- a/layout/generic/nsImageFrame.cpp +++ b/layout/generic/nsImageFrame.cpp @@ -681,16 +681,18 @@ nsImageFrame::NotifyNewCurrentRequest(imgIRequest *aRequest, } if (mState & IMAGE_GOTINITIALREFLOW) { // do nothing if we haven't gotten the initial reflow yet - if (!(mState & IMAGE_SIZECONSTRAINED) && intrinsicSizeChanged) { - nsIPresShell *presShell = PresContext()->GetPresShell(); - if (presShell) { - presShell->FrameNeedsReflow(this, nsIPresShell::eStyleChange, - NS_FRAME_IS_DIRTY); + if (intrinsicSizeChanged) { + if (!(mState & IMAGE_SIZECONSTRAINED)) { + nsIPresShell *presShell = PresContext()->GetPresShell(); + if (presShell) { + presShell->FrameNeedsReflow(this, nsIPresShell::eStyleChange, + NS_FRAME_IS_DIRTY); + } + } else { + // We've already gotten the initial reflow, and our size hasn't changed, + // so we're ready to request a decode. + MaybeDecodeForPredictedSize(); } - } else { - // We've already gotten the initial reflow, and our size hasn't changed, - // so we're ready to request a decode. - MaybeDecodeForPredictedSize(); } // Update border+content to account for image change InvalidateFrame(); From fd458664cc2a2bc5a96dc3806145dddc05e5caa7 Mon Sep 17 00:00:00 2001 From: Mike Shal Date: Thu, 28 Jan 2016 14:30:00 -0500 Subject: [PATCH 087/117] Bug 1244239 - Fix __slots__ in mozbuild's data.py; r=gps --- python/mozbuild/mozbuild/frontend/data.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/python/mozbuild/mozbuild/frontend/data.py b/python/mozbuild/mozbuild/frontend/data.py index 4305ffa31b1..b4ead938910 100644 --- a/python/mozbuild/mozbuild/frontend/data.py +++ b/python/mozbuild/mozbuild/frontend/data.py @@ -34,6 +34,7 @@ from ..testing import ( class TreeMetadata(object): """Base class for all data being captured.""" + __slots__ = () class ContextDerived(TreeMetadata): @@ -44,13 +45,15 @@ class ContextDerived(TreeMetadata): """ __slots__ = ( - 'objdir', - 'relativedir', + 'context_main_path', 'context_all_paths', - 'context_path', - 'srcdir', - 'topobjdir', 'topsrcdir', + 'topobjdir', + 'relativedir', + 'srcdir', + 'objdir', + 'config', + '_context', ) def __init__(self, context): @@ -155,9 +158,10 @@ class XPIDLFile(ContextDerived): """Describes an XPIDL file to be compiled.""" __slots__ = ( - 'add_to_manifest', - 'basename', 'source_path', + 'basename', + 'module', + 'add_to_manifest', ) def __init__(self, context, source, module, add_to_manifest): @@ -787,7 +791,7 @@ class FinalTargetFiles(ContextDerived): this object fills that role. It just has a reference to the underlying HierarchicalStringList, which is created when parsing FINAL_TARGET_FILES. """ - __slots__ = ('files', 'target') + __slots__ = ('files') def __init__(self, sandbox, files): ContextDerived.__init__(self, sandbox) @@ -803,7 +807,7 @@ class FinalTargetPreprocessedFiles(ContextDerived): HierarchicalStringList, which is created when parsing FINAL_TARGET_PP_FILES. """ - __slots__ = ('files', 'target') + __slots__ = ('files') def __init__(self, sandbox, files): ContextDerived.__init__(self, sandbox) @@ -978,6 +982,7 @@ class ChromeManifestEntry(ContextDerived): """Represents a chrome.manifest entry.""" __slots__ = ( + 'path', 'entry', ) From 8bdd804fccfe10cfa82f73a06c2aec2253721b3a Mon Sep 17 00:00:00 2001 From: Felipe Gomes Date: Tue, 2 Feb 2016 21:13:26 -0200 Subject: [PATCH 088/117] Bug 1243882 - Block e10s for locales based on Firefox's locale, not the OS. r=ehsan --- toolkit/xre/nsAppRunner.cpp | 39 +++++++++++++++---------------------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp index a1a9cbc1dd9..88a324ee772 100644 --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp @@ -66,7 +66,6 @@ #include "nsIDOMWindow.h" #include "mozilla/ModuleUtils.h" #include "nsIIOService2.h" -#include "nsILocaleService.h" #include "nsIObserverService.h" #include "nsINativeAppSupport.h" #include "nsIProcess.h" @@ -4652,31 +4651,25 @@ mozilla::BrowserTabsRemoteAutostart() * which currently doesn't work well with e10s. */ bool disabledForBidi = false; - do { // to allow 'break' to abort this block if a call fails - nsresult rv; - nsCOMPtr ls = - do_GetService(NS_LOCALESERVICE_CONTRACTID, &rv); - if (NS_FAILED(rv)) - break; - nsCOMPtr appLocale; - rv = ls->GetApplicationLocale(getter_AddRefs(appLocale)); - if (NS_FAILED(rv)) - break; + nsAutoCString locale; + nsCOMPtr registry = + mozilla::services::GetXULChromeRegistryService(); + if (registry) { + registry->GetSelectedLocale(NS_LITERAL_CSTRING("global"), locale); + } - nsString localeStr; - rv = appLocale-> - GetCategory(NS_LITERAL_STRING(NSILOCALE_MESSAGE), localeStr); - if (NS_FAILED(rv)) - break; + int32_t index = locale.FindChar('-'); + if (index >= 0) { + locale.Truncate(index); + } - if (localeStr.EqualsLiteral("ar") || - localeStr.EqualsLiteral("fa") || - localeStr.EqualsLiteral("he") || - localeStr.EqualsLiteral("ur")) { - disabledForBidi = true; - } - } while (0); + if (locale.EqualsLiteral("ar") || + locale.EqualsLiteral("fa") || + locale.EqualsLiteral("he") || + locale.EqualsLiteral("ur")) { + disabledForBidi = true; + } bool optInPref = Preferences::GetBool("browser.tabs.remote.autostart", false); bool trialPref = Preferences::GetBool("browser.tabs.remote.autostart.2", false); From 11d217aaedf19fbe276878955be5fc262b652804 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Tue, 2 Feb 2016 14:10:06 +0900 Subject: [PATCH 089/117] Bug 1244997 - Remove TOOLKIT_EM_VERSION from toolkit/xre/Makefile.in. r=mshal Bug 383167 made it obsolete 8.5 years ago, and while bug 543150 kind of backed it out, it used GRE_MILESTONE instead of TOOLKIT_EM_VERSION. --- toolkit/xre/Makefile.in | 7 ------- 1 file changed, 7 deletions(-) diff --git a/toolkit/xre/Makefile.in b/toolkit/xre/Makefile.in index 9b0fb23fbea..a1f21d7637b 100644 --- a/toolkit/xre/Makefile.in +++ b/toolkit/xre/Makefile.in @@ -12,13 +12,6 @@ milestone_txt = $(topsrcdir)/config/milestone.txt include $(topsrcdir)/config/rules.mk -# Should version be optional or required ? -TOOLKIT_EM_VERSION=$(shell $(PYTHON) $(topsrcdir)/python/mozbuild/mozbuild/milestone.py --topsrcdir=$(topsrcdir)) -$(call warnIfEmpty,TOOLKIT_EM_VERSION) - -# Valid if null: {warn,error}IfEmpty -DEFINES += -DTOOLKIT_EM_VERSION='"$(TOOLKIT_EM_VERSION)"' - MOZ_SOURCE_STAMP ?= $(firstword $(shell hg -R $(topsrcdir) parent --template='{node}\n' 2>/dev/null)) ifdef MOZ_SOURCE_STAMP From 11459cce1483964bd11f63b19e7b16a90f8c1edd Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Tue, 2 Feb 2016 14:21:12 +0900 Subject: [PATCH 090/117] Bug 1244999 - Move icon-related DEFINES to moz.build in browser/app. r=mshal --- browser/app/Makefile.in | 8 -------- browser/app/moz.build | 4 ++++ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/browser/app/Makefile.in b/browser/app/Makefile.in index 17ea7581925..946efe8bded 100644 --- a/browser/app/Makefile.in +++ b/browser/app/Makefile.in @@ -7,14 +7,6 @@ dist_dest = $(DIST)/$(MOZ_MACBUNDLE_NAME) # hardcode en-US for the moment AB_CD = en-US -DEFINES += \ - -DFIREFOX_ICO='"$(DIST)/branding/firefox.ico"' \ - -DDOCUMENT_ICO='"$(DIST)/branding/document.ico"' \ - -DNEWWINDOW_ICO='"$(DIST)/branding/newwindow.ico"' \ - -DNEWTAB_ICO='"$(DIST)/branding/newtab.ico"' \ - -DPBMODE_ICO='"$(DIST)/branding/pbmode.ico"' \ - $(NULL) - # Build a binary bootstrapping with XRE_main ifndef MOZ_WINCONSOLE diff --git a/browser/app/moz.build b/browser/app/moz.build index e4d9d053200..bbe6b27bd43 100644 --- a/browser/app/moz.build +++ b/browser/app/moz.build @@ -73,3 +73,7 @@ if CONFIG['HAVE_CLOCK_MONOTONIC']: if CONFIG['GNU_CXX']: CXXFLAGS += ['-Wshadow'] + +for icon in ('firefox', 'document', 'newwindow', 'newtab', 'pbmode'): + DEFINES[icon.upper() + '_ICO'] = '%s/dist/branding/%s.ico' % ( + TOPOBJDIR, icon) From 650172c433ef2cd324f1be5da2aaed305742f5fe Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Tue, 2 Feb 2016 16:44:04 +0900 Subject: [PATCH 091/117] Bug 1245013 - Move CMFLAGS/CMMFLAGS from config.mk to configure. r=mshal We don't really care to set those in js/src/configure because the JS engine doesn't use ObjC. We also don't care to preserve the += behavior because there were no AC_SUBST in the first place, so it's unlikely anyone has an override in their mozconfig and expects it to work. --- config/config.mk | 13 ------------- configure.in | 13 +++++++++++++ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/config/config.mk b/config/config.mk index c56c754c12c..648b8c455b7 100644 --- a/config/config.mk +++ b/config/config.mk @@ -396,19 +396,6 @@ endif # MOZ_DEBUG endif # USE_STATIC_LIBS endif # WINNT && !GNU_CC -ifeq ($(OS_ARCH),Darwin) -# Compiling ObjC requires an Apple compiler anyway, so it's ok to set -# host CMFLAGS here. -HOST_CMFLAGS += -fobjc-exceptions -HOST_CMMFLAGS += -fobjc-exceptions -OS_COMPILE_CMFLAGS += -fobjc-exceptions -OS_COMPILE_CMMFLAGS += -fobjc-exceptions -ifeq ($(MOZ_WIDGET_TOOLKIT),uikit) -OS_COMPILE_CMFLAGS += -fobjc-abi-version=2 -fobjc-legacy-dispatch -OS_COMPILE_CMMFLAGS += -fobjc-abi-version=2 -fobjc-legacy-dispatch -endif -endif - COMPILE_CFLAGS = $(VISIBILITY_FLAGS) $(DEFINES) $(INCLUDES) $(OS_INCLUDES) $(DSO_CFLAGS) $(DSO_PIC_CFLAGS) $(RTL_FLAGS) $(OS_COMPILE_CFLAGS) $(_DEPEND_CFLAGS) $(CFLAGS) $(MOZBUILD_CFLAGS) COMPILE_CXXFLAGS = $(if $(DISABLE_STL_WRAPPING),,$(STL_FLAGS)) $(VISIBILITY_FLAGS) $(DEFINES) $(INCLUDES) $(OS_INCLUDES) $(DSO_CFLAGS) $(DSO_PIC_CFLAGS) $(RTL_FLAGS) $(OS_COMPILE_CXXFLAGS) $(_DEPEND_CFLAGS) $(CXXFLAGS) $(MOZBUILD_CXXFLAGS) COMPILE_CMFLAGS = $(OS_COMPILE_CMFLAGS) $(MOZBUILD_CMFLAGS) diff --git a/configure.in b/configure.in index fe132b74b0e..facf9f05895 100644 --- a/configure.in +++ b/configure.in @@ -8807,6 +8807,19 @@ AC_SUBST(MOZ_NATIVE_NSPR) AC_SUBST(MOZ_NATIVE_NSS) AC_SUBST(NSS_DISABLE_DBM) +HOST_CMFLAGS=-fobjc-exceptions +HOST_CMMFLAGS=-fobjc-exceptions +OS_COMPILE_CMFLAGS=-fobjc-exceptions +OS_COMPILE_CMMFLAGS=-fobjc-exceptions +if test "$MOZ_WIDGET_TOOLKIT" = uikit; then + OS_COMPILE_CMFLAGS="$OS_COMPILE_CMFLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch" + OS_COMPILE_CMMFLAGS="$OS_COMPILE_CMMFLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch" +fi +AC_SUBST(HOST_CMFLAGS) +AC_SUBST(HOST_CMMFLAGS) +AC_SUBST(OS_COMPILE_CMFLAGS) +AC_SUBST(OS_COMPILE_CMMFLAGS) + OS_CFLAGS="$CFLAGS" OS_CXXFLAGS="$CXXFLAGS" OS_CPPFLAGS="$CPPFLAGS" From c0c5bff79fe1ca7cd97847d411e2f32bd2ebb461 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Tue, 2 Feb 2016 16:51:59 +0900 Subject: [PATCH 092/117] Bug 1245015 - Properly handle ObjC sources in the CompileDB backend. r=mshal --- python/mozbuild/mozbuild/compilation/database.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/python/mozbuild/mozbuild/compilation/database.py b/python/mozbuild/mozbuild/compilation/database.py index c064708506f..978b638cc73 100644 --- a/python/mozbuild/mozbuild/compilation/database.py +++ b/python/mozbuild/mozbuild/compilation/database.py @@ -118,17 +118,17 @@ class CompileDBBackend(CommonBackend): def _build_db_line(self, objdir, cenv, filename, canonical_suffix, flags, ishost): # Distinguish between host and target files. prefix = 'HOST_' if ishost else '' - if canonical_suffix == '.c': + if canonical_suffix in ('.c', '.m'): compiler = cenv.substs[prefix + 'CC'] cflags = list(flags['COMPILE_CFLAGS']) # Add the Objective-C flags if needed. - if filename.endswith('.m'): + if canonical_suffix == '.m': cflags.extend(flags['COMPILE_CMFLAGS']) - elif canonical_suffix == '.cpp': + elif canonical_suffix in ('.cpp', '.mm'): compiler = cenv.substs[prefix + 'CXX'] cflags = list(flags['COMPILE_CXXFLAGS']) # Add the Objective-C++ flags if needed. - if filename.endswith('.mm'): + if canonical_suffix == '.mm': cflags.extend(flags['COMPILE_CMMFLAGS']) else: return From 4ee14cee6d10712394617916d8191c7e15ebbdba Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Tue, 2 Feb 2016 17:26:56 +0900 Subject: [PATCH 093/117] Bug 1245022 - Kill stlport's Makefile.in. r=mshal --- build/stlport/Makefile.in | 9 --------- build/stlport/moz.build | 4 ++++ 2 files changed, 4 insertions(+), 9 deletions(-) delete mode 100644 build/stlport/Makefile.in diff --git a/build/stlport/Makefile.in b/build/stlport/Makefile.in deleted file mode 100644 index ca11f307884..00000000000 --- a/build/stlport/Makefile.in +++ /dev/null @@ -1,9 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this file, -# You can obtain one at http://mozilla.org/MPL/2.0/. - -MODULES = stlport - -include $(topsrcdir)/config/rules.mk - -CXXFLAGS += -fuse-cxa-atexit diff --git a/build/stlport/moz.build b/build/stlport/moz.build index ef8627069a2..915b8c9ea2c 100644 --- a/build/stlport/moz.build +++ b/build/stlport/moz.build @@ -72,3 +72,7 @@ NO_EXPAND_LIBS = True # We allow warnings for third-party code that can be updated from upstream. ALLOW_COMPILER_WARNINGS = True + +CXXFLAGS += [ + '-fuse-cxa-atexit', +] From ed70e77c8ddb6d8fd606955e45ac56f738dce147 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Tue, 2 Feb 2016 17:41:04 +0900 Subject: [PATCH 094/117] Bug 1245027 - Move LOCAL_INCLUDES to moz.build in media/libvpx. r=mshal --- media/libvpx/Makefile.in | 7 ------- media/libvpx/moz.build | 6 ++++++ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/media/libvpx/Makefile.in b/media/libvpx/Makefile.in index 77c0fa4b7af..43815da06b7 100644 --- a/media/libvpx/Makefile.in +++ b/media/libvpx/Makefile.in @@ -8,13 +8,6 @@ AS=$(VPX_AS) ASM_SUFFIX=$(VPX_ASM_SUFFIX) ifdef VPX_ARM_ASM -# Building on an ARM platform with a supported assembler, include -# the optimized assembly in the build. - -ifeq ($(OS_TARGET),Android) -# For cpu-features.h -LOCAL_INCLUDES += -I$(ANDROID_NDK)/sources/android/cpufeatures -endif ifdef VPX_AS_CONVERSION # The ARM asm is written in ARM RVCT syntax, but we actually build it with diff --git a/media/libvpx/moz.build b/media/libvpx/moz.build index a787f194e59..46abb342fe5 100644 --- a/media/libvpx/moz.build +++ b/media/libvpx/moz.build @@ -45,6 +45,12 @@ if CONFIG['VPX_ARM_ASM']: if f.endswith('.c') and 'neon' in f: SOURCES[f].flags += CONFIG['VPX_ASFLAGS'] + if CONFIG['OS_TARGET'] == 'Android': + # For cpu-features.h + LOCAL_INCLUDES += [ + '%%%s/sources/android/cpufeatures' % CONFIG['ANDROID_NDK'], + ] + # boolhuff_armv5te.asm defines the same functions as boolhuff.c instead of # using RTCD, so we have to make sure we only add one of the two. if 'vp8/encoder/arm/armv5te/boolhuff_armv5te.asm' not in arm_asm_files: From ede9563425ce47917ce8d2dc4645ef19fba70c05 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Tue, 2 Feb 2016 18:16:48 +0900 Subject: [PATCH 095/117] Bug 1245035 - Move LOCAL_INCLUDES to moz.build in media/omx-plugin/lib/ics/libvideoeditorplayer. r=mshal --- .../lib/ics/libvideoeditorplayer/Makefile.in | 19 ------------------- .../lib/ics/libvideoeditorplayer/moz.build | 4 ++++ 2 files changed, 4 insertions(+), 19 deletions(-) delete mode 100644 media/omx-plugin/lib/ics/libvideoeditorplayer/Makefile.in diff --git a/media/omx-plugin/lib/ics/libvideoeditorplayer/Makefile.in b/media/omx-plugin/lib/ics/libvideoeditorplayer/Makefile.in deleted file mode 100644 index d5219102fe1..00000000000 --- a/media/omx-plugin/lib/ics/libvideoeditorplayer/Makefile.in +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2012 Mozilla Foundation and Mozilla contributors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -include $(topsrcdir)/config/rules.mk - -INCLUDES += \ - -I$(topsrcdir)/media/omx-plugin/include/ics \ - $(NULL) diff --git a/media/omx-plugin/lib/ics/libvideoeditorplayer/moz.build b/media/omx-plugin/lib/ics/libvideoeditorplayer/moz.build index 09a43e0588d..5604db5e647 100644 --- a/media/omx-plugin/lib/ics/libvideoeditorplayer/moz.build +++ b/media/omx-plugin/lib/ics/libvideoeditorplayer/moz.build @@ -15,3 +15,7 @@ SharedLibrary('videoeditorplayer') # Don't use STL wrappers; this isn't Gecko code DISABLE_STL_WRAPPING = True NO_VISIBILITY_FLAGS = True + +LOCAL_INCLUDES += [ + '/media/omx-plugin/include/ics', +] From a01e44dc89630fd4ece47b63e1513b1078c137d7 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Tue, 2 Feb 2016 18:08:53 +0900 Subject: [PATCH 096/117] Bug 1245055 - Remove toolkit/crashreporter/google-breakpad/src/client/linux/handler/Makefile.in. r=mshal The remains in this file come from bug 633436. I'm not sure what the toolchain was back then (5 years ago), but it doesn't appear what it was trying to work around happens nowadays, so just get rid of the workaround. --- .../src/client/linux/handler/Makefile.in | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 toolkit/crashreporter/google-breakpad/src/client/linux/handler/Makefile.in diff --git a/toolkit/crashreporter/google-breakpad/src/client/linux/handler/Makefile.in b/toolkit/crashreporter/google-breakpad/src/client/linux/handler/Makefile.in deleted file mode 100644 index bee9dea9cdf..00000000000 --- a/toolkit/crashreporter/google-breakpad/src/client/linux/handler/Makefile.in +++ /dev/null @@ -1,17 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -ifdef MOZ_THUMB2 #{ -# The syscall number is passed through r7 in the linux ARM ABI, but r7 -# is also the THUMB frame pointer. (Unfortunate, but ah well.) gcc -# complains if we store to r7, not unreasonably, but complains -# inconsistently. The generic syscall template pushes/stores to/pops -# r7 with no complaint from gcc, but the sys_clone() function marks r7 -# as a clobbered register yet gcc error's. The generated assembly for -# sys_clone() looks OK, so we chalk this up to a gcc/gas quirk and -# work around it by telling gcc that the THUMB frame pointer is a -# vanilla callee-save register. -OS_CXXFLAGS += -fomit-frame-pointer -MOZ_FRAMEPTR_FLAGS := -fomit-frame-pointer -endif #} From bf88b025d912f63b8acdb70032b396544d76b3f3 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Tue, 2 Feb 2016 19:52:17 +0900 Subject: [PATCH 097/117] Bug 1245055 - Remove gfx/skia/Makefile.in. r=mshal The remains in this file are related to bug 633436. But more than being apparently obsolete, they are also not used at all, because they don't appear after including config.mk, which resets CFLAGS and CXXFLAGS anyways, removing whatever the Makefile set. --- gfx/skia/Makefile.in | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 gfx/skia/Makefile.in diff --git a/gfx/skia/Makefile.in b/gfx/skia/Makefile.in deleted file mode 100644 index c2793d5889c..00000000000 --- a/gfx/skia/Makefile.in +++ /dev/null @@ -1,11 +0,0 @@ -# -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -ifeq ($(CPU_ARCH)_$(GNU_CC),arm_1) -# The assembly uses the frame pointer register (r7 in Thumb/r11 in -# ARM), the compiler doesn't like that. -CXXFLAGS := $(filter-out -fno-omit-frame-pointer,$(CXXFLAGS)) -fomit-frame-pointer -CFLAGS := $(filter-out -fno-omit-frame-pointer,$(CFLAGS)) -fomit-frame-pointer -endif From 415a8ffdf1ec2fc6b456d91fd05e1000407bad9a Mon Sep 17 00:00:00 2001 From: Jorg K Date: Tue, 2 Feb 2016 15:42:00 +0100 Subject: [PATCH 098/117] Bug 1245310 - Restore null check in GetFocusedNode(). r=khuey --- dom/base/nsPIDOMWindowInlines.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dom/base/nsPIDOMWindowInlines.h b/dom/base/nsPIDOMWindowInlines.h index 7fc629eb81c..fc4afa7ed2d 100644 --- a/dom/base/nsPIDOMWindowInlines.h +++ b/dom/base/nsPIDOMWindowInlines.h @@ -125,7 +125,7 @@ nsIContent* nsPIDOMWindow::GetFocusedNode() const { if (IsOuterWindow()) { - return mInnerWindow->GetFocusedNode(); + return mInnerWindow ? mInnerWindow->GetFocusedNode() : nullptr; } return mFocusedNode; From 4e914287c1bc0cf0be54f466e9832f0d0342bd2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabrice=20Desr=C3=A9?= Date: Tue, 2 Feb 2016 16:09:47 -0800 Subject: [PATCH 099/117] Bug 1245320 - Build broken by use of RESPATH in package-manifest.in r=me --- mobile/android/b2gdroid/installer/package-manifest.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mobile/android/b2gdroid/installer/package-manifest.in b/mobile/android/b2gdroid/installer/package-manifest.in index 983ebc65938..4a5960d066a 100644 --- a/mobile/android/b2gdroid/installer/package-manifest.in +++ b/mobile/android/b2gdroid/installer/package-manifest.in @@ -251,7 +251,7 @@ @BINPATH@/components/toolkit_finalizationwitness.xpt @BINPATH@/components/toolkit_formautofill.xpt @BINPATH@/components/toolkit_osfile.xpt -@RESPATH@/components/toolkit_securityreporter.xpt +@BINPATH@/components/toolkit_securityreporter.xpt #ifdef NIGHTLY_BUILD @BINPATH@/components/toolkit_perfmonitoring.xpt #endif @@ -468,8 +468,8 @@ #endif ; Security Reports -@RESPATH@/components/SecurityReporter.manifest -@RESPATH@/components/SecurityReporter.js +@BINPATH@/components/SecurityReporter.manifest +@BINPATH@/components/SecurityReporter.js ; [Browser Chrome Files] @BINPATH@/chrome/browser@JAREXT@ From 80e3dc0da445117c067aeafe40f78d37ad678088 Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Mon, 25 Jan 2016 16:25:59 -0500 Subject: [PATCH 100/117] Bug 1177599 - always pass --target to rustc; r=mshal rustc, unlike our typical C++ compilers, can target multiple platforms with ease through its use of the --target flag. To support cross-compiling, we just need to pass the appropriate --target option. rustc uses specific names for its accepted --target option, however, and they are slightly different from the values we get out of autoconf. So in addition to checking whether rustc can accept --target for our chosen platform, we also need to munge autoconf's idea of the target into something rustc understands. --- build/autoconf/rust.m4 | 82 ++++++++++++++++++++++++++++++++++++++++++ configure.in | 1 - 2 files changed, 82 insertions(+), 1 deletion(-) diff --git a/build/autoconf/rust.m4 b/build/autoconf/rust.m4 index 3cb948d0e9a..70a06e217ad 100644 --- a/build/autoconf/rust.m4 +++ b/build/autoconf/rust.m4 @@ -32,5 +32,87 @@ AC_DEFUN([MOZ_RUST_SUPPORT], [ first in your path. You can verify this by typing 'rustc --version'.]) fi + + if test -n "$RUSTC" -a -n "$MOZ_RUST"; then + # Rust's --target options are similar to, but not exactly the same + # as, the autoconf-derived targets we use. An example would be that + # Rust uses distinct target triples for targetting the GNU C++ ABI + # and the MSVC C++ ABI on Win32, whereas autoconf has a single + # triple and relies on the user to ensure that everything is + # compiled for the appropriate ABI. We need to perform appropriate + # munging to get the correct option to rustc. + # + # The canonical list of targets supported can be derived from: + # + # https://github.com/rust-lang/rust/tree/master/mk/cfg + rust_target= + case "$target" in + # Linux + i*86*linux-gnu) + rust_target=i686-unknown-linux-gnu + ;; + x86_64*linux-gnu) + rust_target=x86_64-unknown-linux-gnu + ;; + + # OS X and iOS + i*86-apple-darwin*) + rust_target=i686-apple-darwin + ;; + i*86-apple-ios*) + rust_target=i386-apple-ios + ;; + x86_64-apple-darwin*) + rust_target=x86_64-apple-darwin + ;; + + # Android + i*86*linux-android) + rust_target=i686-linux-android + ;; + arm*linux-android*) + rust_target=arm-linux-androideabi + ;; + + # Windows + i*86-pc-mingw32) + # XXX better detection of CXX needed here, to figure out whether + # we need i686-pc-windows-gnu instead, since mingw32 builds work. + rust_target=i686-pc-windows-msvc + ;; + x86_64-pc-mingw32) + # XXX and here as well + rust_target=x86_64-pc-windows-msvc + ;; + *) + AC_ERROR([don't know how to translate $target for rustc]) + esac + + # Check to see whether we need to pass --target to RUSTC. This can + # happen when building Firefox on Windows: js's configure will receive + # a RUSTC from the toplevel configure that already has --target added to + # it. + rustc_target_arg= + case "$RUSTC" in + *--target=${rust_target}*) + ;; + *) + rustc_target_arg=--target=${rust_target} + ;; + esac + + # Check to see whether our rustc has a reasonably functional stdlib + # for our chosen target. + echo 'pub extern fn hello() { println!("Hello world"); }' > conftest.rs + if AC_TRY_COMMAND(${RUSTC} --crate-type staticlib ${rustc_target_arg} -o conftest.rlib conftest.rs > /dev/null) && test -s conftest.rlib; then + RUSTC="${RUSTC} ${rustc_target_arg}" + else + AC_ERROR([cannot compile for ${rust_target} with ${RUSTC}]) + fi + rm -f conftest.rs conftest.rlib + fi + + # TODO: separate HOST_RUSTC and RUSTC variables + AC_SUBST(MOZ_RUST) ]) diff --git a/configure.in b/configure.in index facf9f05895..41b69e4e1f7 100644 --- a/configure.in +++ b/configure.in @@ -1637,7 +1637,6 @@ dnl ======================================================== if test -n "$MACOSX_DEPLOYMENT_TARGET" -a -n "$MOZ_RUST"; then AC_MSG_CHECKING([if we're targeting 32-bit]) if test -z "$HAVE_64BIT_BUILD"; then - RUSTC="$RUSTC --target=i686-apple-darwin" AC_MSG_RESULT([using $RUSTC]) else AC_MSG_RESULT([no]) From aa6cc042d44e142a09770d563e0196fbb42c32b4 Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Mon, 1 Feb 2016 09:33:39 -0500 Subject: [PATCH 101/117] Bug 1244261 - part 1 - tooltool cross-rustc packages for OSX-on-Linux builds; r=mshal --- .../macosx64/cross-releng.manifest | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/browser/config/tooltool-manifests/macosx64/cross-releng.manifest b/browser/config/tooltool-manifests/macosx64/cross-releng.manifest index 1c8d936fc82..1ad6cfe3143 100644 --- a/browser/config/tooltool-manifests/macosx64/cross-releng.manifest +++ b/browser/config/tooltool-manifests/macosx64/cross-releng.manifest @@ -47,5 +47,21 @@ "algorithm": "sha512", "unpack": true, "filename": "genisoimage.tar.xz" +}, +{ +"size": 60778437, +"visibility": "public", +"digest": "2d5d300dd0d829012953ca0dd70b0abfda4e848ff03450326cf0c10eac2a71e37275b824597641f0f536b97b754bc81b10f9dbbb73ff725412858a7c2b9df6a7", +"algorithm": "sha512", +"filename": "rust-std-lib.tar.bz2", +"unpack": true +}, +{ +"size": 36038146, +"visibility": "public", +"digest": "b967ba81cb08ce4c3a18e3f8411365ee775861df1ba7f60bcaccd03f940732ee9c4c622cd3163198abb36b2124cde550c61b5d153f1ae8a9107b382ddf660895", +"algorithm": "sha512", +"filename": "rustc-linux64.tar.bz2", +"unpack": true } ] From f6028c77f5810d93b0adf36c5316b18078a3f4d6 Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Mon, 1 Feb 2016 10:20:57 -0500 Subject: [PATCH 102/117] Bug 1244261 - part 2 - use common mozconfig.rust on OS X; r=mshal Now that we have cross-compilation tooltool packages for OS X, we can use the common mozconfig to enable Rust on all OS X builds, regardless of host OS. --- browser/config/mozconfigs/macosx-universal/nightly | 2 +- browser/config/mozconfigs/macosx64/debug | 2 +- browser/config/mozconfigs/macosx64/nightly | 2 +- browser/config/mozconfigs/macosx64/opt-static-analysis | 2 +- browser/config/mozconfigs/whitelist | 2 +- build/macosx/mozconfig.rust | 6 ------ 6 files changed, 5 insertions(+), 11 deletions(-) delete mode 100644 build/macosx/mozconfig.rust diff --git a/browser/config/mozconfigs/macosx-universal/nightly b/browser/config/mozconfigs/macosx-universal/nightly index 5832a3035f9..801ace4d49a 100644 --- a/browser/config/mozconfigs/macosx-universal/nightly +++ b/browser/config/mozconfigs/macosx-universal/nightly @@ -12,6 +12,6 @@ fi ac_add_options --with-branding=browser/branding/nightly -. "$topsrcdir/build/macosx/mozconfig.rust" +. "$topsrcdir/build/mozconfig.rust" . "$topsrcdir/build/mozconfig.common.override" . "$topsrcdir/build/mozconfig.cache" diff --git a/browser/config/mozconfigs/macosx64/debug b/browser/config/mozconfigs/macosx64/debug index d6028f65087..cb96acb1e69 100644 --- a/browser/config/mozconfigs/macosx64/debug +++ b/browser/config/mozconfigs/macosx64/debug @@ -20,6 +20,6 @@ export MOZ_PACKAGE_JSSHELL=1 ac_add_options --with-branding=browser/branding/nightly -. "$topsrcdir/build/macosx/mozconfig.rust" +. "$topsrcdir/build/mozconfig.rust" . "$topsrcdir/build/mozconfig.common.override" . "$topsrcdir/build/mozconfig.cache" diff --git a/browser/config/mozconfigs/macosx64/nightly b/browser/config/mozconfigs/macosx64/nightly index 18a6532a76d..bd312855599 100644 --- a/browser/config/mozconfigs/macosx64/nightly +++ b/browser/config/mozconfigs/macosx64/nightly @@ -18,6 +18,6 @@ export MOZ_PACKAGE_JSSHELL=1 ac_add_options --with-branding=browser/branding/nightly -. "$topsrcdir/build/macosx/mozconfig.rust" +. "$topsrcdir/build/mozconfig.rust" . "$topsrcdir/build/mozconfig.common.override" . "$topsrcdir/build/mozconfig.cache" diff --git a/browser/config/mozconfigs/macosx64/opt-static-analysis b/browser/config/mozconfigs/macosx64/opt-static-analysis index 90f9f9269c1..344a9ef4cf6 100644 --- a/browser/config/mozconfigs/macosx64/opt-static-analysis +++ b/browser/config/mozconfigs/macosx64/opt-static-analysis @@ -13,7 +13,7 @@ ac_add_options --enable-warnings-as-errors ac_add_options --enable-clang-plugin -. "$topsrcdir/build/macosx/mozconfig.rust" +. "$topsrcdir/build/mozconfig.rust" . "$topsrcdir/build/mozconfig.common.override" . "$topsrcdir/build/mozconfig.cache" diff --git a/browser/config/mozconfigs/whitelist b/browser/config/mozconfigs/whitelist index 4d85bc90d9c..02a33b0048b 100644 --- a/browser/config/mozconfigs/whitelist +++ b/browser/config/mozconfigs/whitelist @@ -53,7 +53,7 @@ whitelist['nightly']['macosx-universal'] += [ 'ac_add_options --disable-install-strip', 'ac_add_options --enable-instruments', 'ac_add_options --enable-dtrace', - '. "$topsrcdir/build/macosx/mozconfig.rust"', + '. "$topsrcdir/build/mozconfig.rust"', ] whitelist['nightly']['win32'] += [ diff --git a/build/macosx/mozconfig.rust b/build/macosx/mozconfig.rust deleted file mode 100644 index 92d9a608690..00000000000 --- a/build/macosx/mozconfig.rust +++ /dev/null @@ -1,6 +0,0 @@ -# Options to enable rust in automation builds. - -if test `uname -s` != Linux; then -RUSTC="$topsrcdir/rustc/bin/rustc" -ac_add_options --enable-rust -fi From ff71b5c17d3e4b970dac0c169cf552c1dacea5f6 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 2 Feb 2016 16:33:13 -0800 Subject: [PATCH 103/117] Add full mix-blend mode support to the D3D11 compositor. (bug 1238496, r=bas) --- gfx/layers/d3d11/BlendShaderConstants.h | 61 + gfx/layers/d3d11/BlendingHelpers.hlslh | 184 + gfx/layers/d3d11/CompositorD3D11.cpp | 182 +- gfx/layers/d3d11/CompositorD3D11.h | 12 +- gfx/layers/d3d11/CompositorD3D11.hlsl | 216 +- gfx/layers/d3d11/CompositorD3D11Shaders.h | 9568 +++++++++++++++------ gfx/layers/d3d11/genshaders.sh | 9 +- gfx/layers/opengl/CompositorOGL.cpp | 7 +- layout/reftests/css-blending/reftest.list | 8 +- 9 files changed, 7672 insertions(+), 2575 deletions(-) create mode 100644 gfx/layers/d3d11/BlendShaderConstants.h create mode 100644 gfx/layers/d3d11/BlendingHelpers.hlslh diff --git a/gfx/layers/d3d11/BlendShaderConstants.h b/gfx/layers/d3d11/BlendShaderConstants.h new file mode 100644 index 00000000000..b548e6e7efd --- /dev/null +++ b/gfx/layers/d3d11/BlendShaderConstants.h @@ -0,0 +1,61 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef MOZILLA_GFX_LAYERS_D3D11_BLENDSHADERCONSTANTS_H_ +#define MOZILLA_GFX_LAYERS_D3D11_BLENDSHADERCONSTANTS_H_ + +// These constants are shared between CompositorD3D11 and the blend pixel shader. +#define PS_LAYER_RGB 0 +#define PS_LAYER_RGBA 1 +#define PS_LAYER_YCBCR 2 +#define PS_LAYER_COLOR 3 + +// These must be in the same order as the Mask enum. +#define PS_MASK_NONE 0 +#define PS_MASK_2D 1 +#define PS_MASK_3D 2 + +// These must be in the same order as CompositionOp. +#define PS_BLEND_MULTIPLY 0 +#define PS_BLEND_SCREEN 1 +#define PS_BLEND_OVERLAY 2 +#define PS_BLEND_DARKEN 3 +#define PS_BLEND_LIGHTEN 4 +#define PS_BLEND_COLOR_DODGE 5 +#define PS_BLEND_COLOR_BURN 6 +#define PS_BLEND_HARD_LIGHT 7 +#define PS_BLEND_SOFT_LIGHT 8 +#define PS_BLEND_DIFFERENCE 9 +#define PS_BLEND_EXCLUSION 10 +#define PS_BLEND_HUE 11 +#define PS_BLEND_SATURATION 12 +#define PS_BLEND_COLOR 13 +#define PS_BLEND_LUMINOSITY 14 + +#if defined(__cplusplus) +namespace mozilla { +namespace layers { + +static inline int +BlendOpToShaderConstant(gfx::CompositionOp aOp) { + return int(aOp) - int(gfx::CompositionOp::OP_MULTIPLY); +} + +} // namespace layers +} // namespace mozilla + +// Sanity checks. +namespace { +static inline void BlendShaderConstantAsserts() { + static_assert(PS_MASK_NONE == int(mozilla::layers::MaskType::MaskNone), "shader constant is out of sync"); + static_assert(PS_MASK_2D == int(mozilla::layers::MaskType::Mask2d), "shader constant is out of sync"); + static_assert(PS_MASK_3D == int(mozilla::layers::MaskType::Mask3d), "shader constant is out of sync"); + static_assert(int(mozilla::gfx::CompositionOp::OP_LUMINOSITY) - int(mozilla::gfx::CompositionOp::OP_MULTIPLY) == 14, + "shader constants are out of sync"); +} +} // anonymous namespace +#endif + +#endif // MOZILLA_GFX_LAYERS_D3D11_BLENDSHADERCONSTANTS_H_ diff --git a/gfx/layers/d3d11/BlendingHelpers.hlslh b/gfx/layers/d3d11/BlendingHelpers.hlslh new file mode 100644 index 00000000000..57d27b23b25 --- /dev/null +++ b/gfx/layers/d3d11/BlendingHelpers.hlslh @@ -0,0 +1,184 @@ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +// Helper functions. +float hardlight(float dest, float src) { + if (src <= 0.5) { + return dest * (2.0 * src); + } else { + // Note: we substitute (2*src-1) into the screen formula below. + return 2.0 * dest + 2.0 * src - 1.0 - 2.0 * dest * src; + } +} + +float dodge(float dest, float src) { + if (dest == 0.0) { + return 0.0; + } else if (src == 1.0) { + return 1.0; + } else { + return min(1.0, dest / (1.0 - src)); + } +} + +float burn(float dest, float src) { + if (dest == 1.0) { + return 1.0; + } else if (src == 0.0) { + return 0.0; + } else { + return 1.0 - min(1.0, (1.0 - dest) / src); + } +} + +float darken(float dest) { + if (dest <= 0.25) { + return ((16.0 * dest - 12.0) * dest + 4.0) * dest; + } else { + return sqrt(dest); + } +} + +float softlight(float dest, float src) { + if (src <= 0.5) { + return dest - (1.0 - 2.0 * src) * dest * (1.0 - dest); + } else { + return dest + (2.0 * src - 1.0) * (darken(dest) - dest); + } +} + +float Lum(float3 c) { + return dot(float3(0.3, 0.59, 0.11), c); +} + +float3 ClipColor(float3 c) { + float L = Lum(c); + float n = min(min(c.r, c.g), c.b); + float x = max(max(c.r, c.g), c.b); + if (n < 0.0) { + c = L + (((c - L) * L) / (L - n)); + } + if (x > 1.0) { + c = L + (((c - L) * (1.0 - L)) / (x - L)); + } + return c; +} + +float3 SetLum(float3 c, float L) { + float d = L - Lum(c); + return ClipColor(float3( + c.r + d, + c.g + d, + c.b + d)); +} + +float Sat(float3 c) { + return max(max(c.r, c.g), c.b) - min(min(c.r, c.g), c.b); +} + +// To use this helper, re-arrange rgb such that r=min, g=mid, and b=max. +float3 SetSatInner(float3 c, float s) { + if (c.b > c.r) { + c.g = (((c.g - c.r) * s) / (c.b - c.r)); + c.b = s; + } else { + c.gb = float2(0.0, 0.0); + } + return float3(0.0, c.g, c.b); +} + +float3 SetSat(float3 c, float s) { + if (c.r <= c.g) { + if (c.g <= c.b) { + c.rgb = SetSatInner(c.rgb, s); + } else if (c.r <= c.b) { + c.rbg = SetSatInner(c.rbg, s); + } else { + c.brg = SetSatInner(c.brg, s); + } + } else if (c.r <= c.b) { + c.grb = SetSatInner(c.grb, s); + } else if (c.g <= c.b) { + c.gbr = SetSatInner(c.gbr, s); + } else { + c.bgr = SetSatInner(c.bgr, s); + } + return c; +} + +float3 BlendMultiply(float3 dest, float3 src) { + return dest * src; +} + +float3 BlendScreen(float3 dest, float3 src) { + return dest + src - (dest * src); +} + +float3 BlendOverlay(float3 dest, float3 src) { + return float3( + hardlight(src.r, dest.r), + hardlight(src.g, dest.g), + hardlight(src.b, dest.b)); +} + +float3 BlendDarken(float3 dest, float3 src) { + return min(dest, src); +} + +float3 BlendLighten(float3 dest, float3 src) { + return max(dest, src); +} + +float3 BlendColorDodge(float3 dest, float3 src) { + return float3( + dodge(dest.r, src.r), + dodge(dest.g, src.g), + dodge(dest.b, src.b)); +} + +float3 BlendColorBurn(float3 dest, float3 src) { + return float3( + burn(dest.r, src.r), + burn(dest.g, src.g), + burn(dest.b, src.b)); +} + +float3 BlendHardLight(float3 dest, float3 src) { + return float3( + hardlight(dest.r, src.r), + hardlight(dest.g, src.g), + hardlight(dest.b, src.b)); +} + +float3 BlendSoftLight(float3 dest, float3 src) { + return float3( + softlight(dest.r, src.r), + softlight(dest.g, src.g), + softlight(dest.b, src.b)); +} + +float3 BlendDifference(float3 dest, float3 src) { + return abs(dest - src); +} + +float3 BlendExclusion(float3 dest, float3 src) { + return dest + src - 2.0 * dest * src; +} + +float3 BlendHue(float3 dest, float3 src) { + return SetLum(SetSat(src, Sat(dest)), Lum(dest)); +} + +float3 BlendSaturation(float3 dest, float3 src) { + return SetLum(SetSat(dest, Sat(src)), Lum(dest)); +} + +float3 BlendColor(float3 dest, float3 src) { + return SetLum(src, Lum(dest)); +} + +float3 BlendLuminosity(float3 dest, float3 src) { + return SetLum(dest, Lum(src)); +} diff --git a/gfx/layers/d3d11/CompositorD3D11.cpp b/gfx/layers/d3d11/CompositorD3D11.cpp index 46815a59d26..065164f0088 100644 --- a/gfx/layers/d3d11/CompositorD3D11.cpp +++ b/gfx/layers/d3d11/CompositorD3D11.cpp @@ -24,6 +24,7 @@ #include "mozilla/EnumeratedArray.h" #include "mozilla/Telemetry.h" +#include "BlendShaderConstants.h" #include @@ -47,6 +48,16 @@ static const GUID sLayerManagerCount = const FLOAT sBlendFactor[] = { 0, 0, 0, 0 }; +namespace TexSlot { + static const int RGB = 0; + static const int Y = 1; + static const int Cb = 2; + static const int Cr = 3; + static const int RGBWhite = 4; + static const int Mask = 5; + static const int Backdrop = 6; +} + struct DeviceAttachmentsD3D11 { DeviceAttachmentsD3D11(ID3D11Device* device) @@ -67,11 +78,13 @@ struct DeviceAttachmentsD3D11 RefPtr mVertexBuffer; VertexShaderArray mVSQuadShader; + VertexShaderArray mVSQuadBlendShader; PixelShaderArray mSolidColorShader; PixelShaderArray mRGBAShader; PixelShaderArray mRGBShader; PixelShaderArray mYCbCrShader; PixelShaderArray mComponentAlphaShader; + PixelShaderArray mBlendShader; RefPtr mPSConstantBuffer; RefPtr mVSConstantBuffer; RefPtr mRasterizerState; @@ -447,6 +460,11 @@ CompositorD3D11::GetTextureFactoryIdentifier() ident.mParentProcessId = XRE_GetProcessType(); ident.mParentBackend = LayersBackend::LAYERS_D3D11; ident.mSyncHandle = mAttachments->mSyncHandle; + for (uint8_t op = 0; op < uint8_t(gfx::CompositionOp::OP_COUNT); op++) { + if (BlendOpIsMixBlendMode(gfx::CompositionOp(op))) { + ident.mSupportedBlendModes += gfx::CompositionOp(op); + } + } return ident; } @@ -503,10 +521,10 @@ CompositorD3D11::CreateRenderTarget(const gfx::IntRect& aRect, return rt.forget(); } -already_AddRefed -CompositorD3D11::CreateRenderTargetFromSource(const gfx::IntRect &aRect, - const CompositingRenderTarget* aSource, - const gfx::IntPoint &aSourcePoint) +RefPtr +CompositorD3D11::CreateTexture(const gfx::IntRect& aRect, + const CompositingRenderTarget* aSource, + const gfx::IntPoint& aSourcePoint) { MOZ_ASSERT(aRect.width != 0 && aRect.height != 0); @@ -524,7 +542,7 @@ CompositorD3D11::CreateRenderTargetFromSource(const gfx::IntRect &aRect, RefPtr texture; HRESULT hr = mDevice->CreateTexture2D(&desc, nullptr, getter_AddRefs(texture)); - NS_ASSERTION(texture, "Could not create texture"); + if (FAILED(hr) || !texture) { gfxCriticalNote << "Failed in CreateRenderTargetFromSource " << hexa(hr); HandleError(hr); @@ -559,6 +577,19 @@ CompositorD3D11::CreateRenderTargetFromSource(const gfx::IntRect &aRect, } } + return texture; +} + +already_AddRefed +CompositorD3D11::CreateRenderTargetFromSource(const gfx::IntRect &aRect, + const CompositingRenderTarget* aSource, + const gfx::IntPoint &aSourcePoint) +{ + RefPtr texture = CreateTexture(aRect, aSource, aSourcePoint); + if (!texture) { + return nullptr; + } + RefPtr rt = new CompositingRenderTargetD3D11(texture, aRect.TopLeft()); rt->SetSize(aRect.Size()); @@ -566,6 +597,29 @@ CompositorD3D11::CreateRenderTargetFromSource(const gfx::IntRect &aRect, return rt.forget(); } +bool +CompositorD3D11::CopyBackdrop(const gfx::IntRect& aRect, + RefPtr* aOutTexture, + RefPtr* aOutView) +{ + RefPtr texture = CreateTexture(aRect, mCurrentRT, aRect.TopLeft()); + if (!texture) { + return false; + } + + CD3D11_SHADER_RESOURCE_VIEW_DESC desc(D3D11_SRV_DIMENSION_TEXTURE2D, DXGI_FORMAT_B8G8R8A8_UNORM); + + RefPtr srv; + HRESULT hr = mDevice->CreateShaderResourceView(texture, &desc, getter_AddRefs(srv)); + if (FAILED(hr) || !srv) { + return false; + } + + *aOutTexture = texture.forget(); + *aOutView = srv.forget(); + return true; +} + void CompositorD3D11::SetRenderTarget(CompositingRenderTarget* aRenderTarget) { @@ -588,30 +642,27 @@ CompositorD3D11::SetRenderTarget(CompositingRenderTarget* aRenderTarget) } } -void -CompositorD3D11::SetPSForEffect(Effect* aEffect, MaskType aMaskType, gfx::SurfaceFormat aFormat) +ID3D11PixelShader* +CompositorD3D11::GetPSForEffect(Effect* aEffect, MaskType aMaskType) { switch (aEffect->mType) { case EffectTypes::SOLID_COLOR: - mContext->PSSetShader(mAttachments->mSolidColorShader[aMaskType], nullptr, 0); - return; + return mAttachments->mSolidColorShader[aMaskType]; case EffectTypes::RENDER_TARGET: - mContext->PSSetShader(mAttachments->mRGBAShader[aMaskType], nullptr, 0); - return; - case EffectTypes::RGB: - mContext->PSSetShader((aFormat == SurfaceFormat::B8G8R8A8 || aFormat == SurfaceFormat::R8G8B8A8) - ? mAttachments->mRGBAShader[aMaskType] - : mAttachments->mRGBShader[aMaskType], nullptr, 0); - return; + return mAttachments->mRGBAShader[aMaskType]; + case EffectTypes::RGB: { + SurfaceFormat format = static_cast(aEffect)->mTexture->GetFormat(); + return (format == SurfaceFormat::B8G8R8A8 || format == SurfaceFormat::R8G8B8A8) + ? mAttachments->mRGBAShader[aMaskType] + : mAttachments->mRGBShader[aMaskType]; + } case EffectTypes::YCBCR: - mContext->PSSetShader(mAttachments->mYCbCrShader[aMaskType], nullptr, 0); - return; + return mAttachments->mYCbCrShader[aMaskType]; case EffectTypes::COMPONENT_ALPHA: - mContext->PSSetShader(mAttachments->mComponentAlphaShader[aMaskType], nullptr, 0); - return; + return mAttachments->mComponentAlphaShader[aMaskType]; default: NS_WARNING("No shader to load"); - return; + return nullptr; } } @@ -798,6 +849,37 @@ CompositorD3D11::DrawVRDistortion(const gfx::Rect& aRect, mContext->IASetInputLayout(mAttachments->mInputLayout); } +static inline bool +EffectHasPremultipliedAlpha(Effect* aEffect) +{ + if (aEffect->mType == EffectTypes::RGB) { + return static_cast(aEffect)->mPremultiplied; + } + return true; +} + +static inline int +EffectToBlendLayerType(Effect* aEffect) +{ + switch (aEffect->mType) { + case EffectTypes::SOLID_COLOR: + return PS_LAYER_COLOR; + case EffectTypes::RGB: { + gfx::SurfaceFormat format = static_cast(aEffect)->mTexture->GetFormat(); + return (format == gfx::SurfaceFormat::B8G8R8A8 || format == gfx::SurfaceFormat::R8G8B8A8) + ? PS_LAYER_RGBA + : PS_LAYER_RGB; + } + case EffectTypes::RENDER_TARGET: + return PS_LAYER_RGBA; + case EffectTypes::YCBCR: + return PS_LAYER_YCBCR; + default: + MOZ_ASSERT_UNREACHABLE("blending not supported for this layer type"); + return 0; + } +} + void CompositorD3D11::DrawQuad(const gfx::Rect& aRect, const gfx::Rect& aClipRect, @@ -846,7 +928,7 @@ CompositorD3D11::DrawQuad(const gfx::Rect& aRect, } ID3D11ShaderResourceView* srView = source->GetShaderResourceView(); - mContext->PSSetShaderResources(3, 1, &srView); + mContext->PSSetShaderResources(TexSlot::Mask, 1, &srView); const gfx::Matrix4x4& maskTransform = maskEffect->mMaskTransform; NS_ASSERTION(maskTransform.Is2D(), "How did we end up with a 3D transform here?!"); @@ -871,16 +953,49 @@ CompositorD3D11::DrawQuad(const gfx::Rect& aRect, scissor.top = clipRect.y; scissor.bottom = clipRect.YMost(); + RefPtr vertexShader = mAttachments->mVSQuadShader[maskType]; + RefPtr pixelShader = GetPSForEffect(aEffectChain.mPrimaryEffect, maskType); + + RefPtr mixBlendBackdrop; + gfx::CompositionOp blendMode = gfx::CompositionOp::OP_OVER; + if (aEffectChain.mSecondaryEffects[EffectTypes::BLEND_MODE]) { + EffectBlendMode *blendEffect = + static_cast(aEffectChain.mSecondaryEffects[EffectTypes::BLEND_MODE].get()); + blendMode = blendEffect->mBlendMode; + + // If the blend operation needs to read from the backdrop, copy the + // current render target into a new texture and bind it now. + if (BlendOpIsMixBlendMode(blendMode)) { + gfx::Matrix4x4 backdropTransform; + gfx::IntRect rect = ComputeBackdropCopyRect(aRect, aClipRect, aTransform, &backdropTransform); + + RefPtr srv; + if (CopyBackdrop(rect, &mixBlendBackdrop, &srv)) { + vertexShader = mAttachments->mVSQuadBlendShader[maskType]; + pixelShader = mAttachments->mBlendShader[MaskType::MaskNone]; + + ID3D11ShaderResourceView* srView = srv.get(); + mContext->PSSetShaderResources(TexSlot::Backdrop, 1, &srView); + + memcpy(&mVSConstants.backdropTransform, &backdropTransform._11, 64); + + mPSConstants.blendConfig[0] = EffectToBlendLayerType(aEffectChain.mPrimaryEffect); + mPSConstants.blendConfig[1] = int(maskType); + mPSConstants.blendConfig[2] = BlendOpToShaderConstant(blendMode); + mPSConstants.blendConfig[3] = EffectHasPremultipliedAlpha(aEffectChain.mPrimaryEffect); + } + } + } + mContext->RSSetScissorRects(1, &scissor); mContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP); - mContext->VSSetShader(mAttachments->mVSQuadShader[maskType], nullptr, 0); + mContext->VSSetShader(vertexShader, nullptr, 0); + mContext->PSSetShader(pixelShader, nullptr, 0); const Rect* pTexCoordRect = nullptr; switch (aEffectChain.mPrimaryEffect->mType) { case EffectTypes::SOLID_COLOR: { - SetPSForEffect(aEffectChain.mPrimaryEffect, maskType, SurfaceFormat::UNKNOWN); - Color color = static_cast(aEffectChain.mPrimaryEffect.get())->mColor; mPSConstants.layerColor[0] = color.r * color.a * aOpacity; @@ -904,10 +1019,8 @@ CompositorD3D11::DrawQuad(const gfx::Rect& aRect, return; } - SetPSForEffect(aEffectChain.mPrimaryEffect, maskType, texturedEffect->mTexture->GetFormat()); - ID3D11ShaderResourceView* srView = source->GetShaderResourceView(); - mContext->PSSetShaderResources(0, 1, &srView); + mContext->PSSetShaderResources(TexSlot::RGB, 1, &srView); if (!texturedEffect->mPremultiplied) { mContext->OMSetBlendState(mAttachments->mNonPremulBlendState, sBlendFactor, 0xFFFFFFFF); @@ -933,8 +1046,6 @@ CompositorD3D11::DrawQuad(const gfx::Rect& aRect, return; } - SetPSForEffect(aEffectChain.mPrimaryEffect, maskType, ycbcrEffect->mTexture->GetFormat()); - if (!source->GetSubSource(Y) || !source->GetSubSource(Cb) || !source->GetSubSource(Cr)) { // This can happen if we failed to upload the textures, most likely // because of unsupported dimensions (we don't tile YCbCr textures). @@ -948,7 +1059,7 @@ CompositorD3D11::DrawQuad(const gfx::Rect& aRect, ID3D11ShaderResourceView* srViews[3] = { sourceY->GetShaderResourceView(), sourceCb->GetShaderResourceView(), sourceCr->GetShaderResourceView() }; - mContext->PSSetShaderResources(0, 3, srViews); + mContext->PSSetShaderResources(TexSlot::Y, 3, srViews); } break; case EffectTypes::COMPONENT_ALPHA: @@ -966,15 +1077,14 @@ CompositorD3D11::DrawQuad(const gfx::Rect& aRect, return; } - SetPSForEffect(aEffectChain.mPrimaryEffect, maskType, effectComponentAlpha->mOnWhite->GetFormat()); - SetSamplerForFilter(effectComponentAlpha->mFilter); pTexCoordRect = &effectComponentAlpha->mTextureCoords; ID3D11ShaderResourceView* srViews[2] = { sourceOnBlack->GetShaderResourceView(), sourceOnWhite->GetShaderResourceView() }; - mContext->PSSetShaderResources(0, 2, srViews); + mContext->PSSetShaderResources(TexSlot::RGB, 1, &srViews[0]); + mContext->PSSetShaderResources(TexSlot::RGBWhite, 1, &srViews[1]); mContext->OMSetBlendState(mAttachments->mComponentBlendState, sBlendFactor, 0xFFFFFFFF); restoreBlendMode = true; @@ -1386,6 +1496,9 @@ DeviceAttachmentsD3D11::CreateShaders() InitVertexShader(sLayerQuadVS, mVSQuadShader, MaskType::MaskNone); InitVertexShader(sLayerQuadMaskVS, mVSQuadShader, MaskType::Mask2d); InitVertexShader(sLayerQuadMask3DVS, mVSQuadShader, MaskType::Mask3d); + InitVertexShader(sLayerQuadBlendVS, mVSQuadBlendShader, MaskType::MaskNone); + InitVertexShader(sLayerQuadBlendMaskVS, mVSQuadBlendShader, MaskType::Mask2d); + InitVertexShader(sLayerQuadBlendMask3DVS, mVSQuadBlendShader, MaskType::Mask3d); InitPixelShader(sSolidColorShader, mSolidColorShader, MaskType::MaskNone); InitPixelShader(sSolidColorShaderMask, mSolidColorShader, MaskType::Mask2d); @@ -1396,6 +1509,7 @@ DeviceAttachmentsD3D11::CreateShaders() InitPixelShader(sRGBAShaderMask3D, mRGBAShader, MaskType::Mask3d); InitPixelShader(sYCbCrShader, mYCbCrShader, MaskType::MaskNone); InitPixelShader(sYCbCrShaderMask, mYCbCrShader, MaskType::Mask2d); + InitPixelShader(sBlendShader, mBlendShader, MaskType::MaskNone); if (gfxPrefs::ComponentAlphaEnabled()) { InitPixelShader(sComponentAlphaShader, mComponentAlphaShader, MaskType::MaskNone); InitPixelShader(sComponentAlphaShaderMask, mComponentAlphaShader, MaskType::Mask2d); diff --git a/gfx/layers/d3d11/CompositorD3D11.h b/gfx/layers/d3d11/CompositorD3D11.h index a328f474645..1621e039182 100644 --- a/gfx/layers/d3d11/CompositorD3D11.h +++ b/gfx/layers/d3d11/CompositorD3D11.h @@ -27,14 +27,14 @@ struct VertexShaderConstants gfx::Rect textureCoords; gfx::Rect layerQuad; gfx::Rect maskQuad; - float vrEyeToSourceUVScale[2]; - float vrEyeToSourceUVOffset[2]; + float backdropTransform[4][4]; }; struct PixelShaderConstants { float layerColor[4]; float layerOpacity[4]; + int blendConfig[4]; }; struct DeviceAttachmentsD3D11; @@ -168,8 +168,14 @@ private: bool UpdateRenderTarget(); bool UpdateConstantBuffers(); void SetSamplerForFilter(gfx::Filter aFilter); - void SetPSForEffect(Effect *aEffect, MaskType aMaskType, gfx::SurfaceFormat aFormat); + ID3D11PixelShader* GetPSForEffect(Effect *aEffect, MaskType aMaskType); void PaintToTarget(); + RefPtr CreateTexture(const gfx::IntRect& aRect, + const CompositingRenderTarget* aSource, + const gfx::IntPoint& aSourcePoint); + bool CopyBackdrop(const gfx::IntRect& aRect, + RefPtr* aOutTexture, + RefPtr* aOutView); RefPtr mContext; RefPtr mDevice; diff --git a/gfx/layers/d3d11/CompositorD3D11.hlsl b/gfx/layers/d3d11/CompositorD3D11.hlsl index 50fc120b0be..953c090c152 100644 --- a/gfx/layers/d3d11/CompositorD3D11.hlsl +++ b/gfx/layers/d3d11/CompositorD3D11.hlsl @@ -3,6 +3,9 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include "BlendingHelpers.hlslh" +#include "BlendShaderConstants.h" + typedef float4 rect; float4x4 mLayerTransform : register(vs, c0); @@ -11,19 +14,28 @@ float4 vRenderTargetOffset : register(vs, c8); rect vTextureCoords : register(vs, c9); rect vLayerQuad : register(vs, c10); rect vMaskQuad : register(vs, c11); +float4x4 mBackdropTransform : register(vs, c12); float4 fLayerColor : register(ps, c0); float fLayerOpacity : register(ps, c1); +// x = layer type +// y = mask type +// z = blend op +// w = is premultiplied +uint4 iBlendConfig : register(ps, c2); + sampler sSampler : register(ps, s0); -Texture2D tRGB; -Texture2D tY; -Texture2D tCb; -Texture2D tCr; -Texture2D tRGBWhite; -// Always bind this to slot 3 since this is always available! -Texture2D tMask : register(ps, t3); +// The mix-blend mega shader uses all variables, so we have to make sure they +// are assigned fixed slots. +Texture2D tRGB : register(ps, t0); +Texture2D tY : register(ps, t1); +Texture2D tCb : register(ps, t2); +Texture2D tCr : register(ps, t3); +Texture2D tRGBWhite : register(ps, t4); +Texture2D tMask : register(ps, t5); +Texture2D tBackdrop : register(ps, t6); struct VS_INPUT { float2 vPosition : POSITION; @@ -46,6 +58,14 @@ struct VS_MASK_3D_OUTPUT { float3 vMaskCoords : TEXCOORD1; }; +// Combined struct for the mix-blend compatible vertex shaders. +struct VS_BLEND_OUTPUT { + float4 vPosition : SV_Position; + float2 vTexCoords : TEXCOORD0; + float3 vMaskCoords : TEXCOORD1; + float2 vBackdropCoords : TEXCOORD2; +}; + struct PS_OUTPUT { float4 vSrc; float4 vAlpha; @@ -102,6 +122,16 @@ float4 VertexPosition(float4 aTransformedPosition) return result; } +float2 BackdropPosition(float4 aPosition) +{ + // Move the position from clip space (-1,1) into 0..1 space. + float2 pos; + pos.x = (aPosition.x + 1.0) / 2.0; + pos.y = 1.0 - (aPosition.y + 1.0) / 2.0; + + return mul(mBackdropTransform, float4(pos.xy, 0, 1.0)).xy; +} + VS_OUTPUT LayerQuadVS(const VS_INPUT aVertex) { VS_OUTPUT outp; @@ -163,13 +193,6 @@ float4 RGBAShaderMask(const VS_MASK_OUTPUT aVertex) : SV_Target return tRGB.Sample(sSampler, aVertex.vTexCoords) * fLayerOpacity * mask; } -float4 RGBAShaderMaskPremul(const VS_MASK_OUTPUT aVertex) : SV_Target -{ - float4 result = RGBAShaderMask(aVertex); - result.rgb *= result.a; - return result; -} - float4 RGBAShaderMask3D(const VS_MASK_3D_OUTPUT aVertex) : SV_Target { float2 maskCoords = aVertex.vMaskCoords.xy / aVertex.vMaskCoords.z; @@ -177,13 +200,6 @@ float4 RGBAShaderMask3D(const VS_MASK_3D_OUTPUT aVertex) : SV_Target return tRGB.Sample(sSampler, aVertex.vTexCoords) * fLayerOpacity * mask; } -float4 RGBAShaderMask3DPremul(const VS_MASK_3D_OUTPUT aVertex) : SV_Target -{ - float4 result = RGBAShaderMask3D(aVertex); - result.rgb *= result.a; - return result; -} - float4 RGBShaderMask(const VS_MASK_OUTPUT aVertex) : SV_Target { float4 result; @@ -262,13 +278,6 @@ float4 RGBAShader(const VS_OUTPUT aVertex) : SV_Target return tRGB.Sample(sSampler, aVertex.vTexCoords) * fLayerOpacity; } -float4 RGBAShaderPremul(const VS_OUTPUT aVertex) : SV_Target -{ - float4 result = RGBAShader(aVertex); - result.rgb *= result.a; - return result; -} - float4 RGBShader(const VS_OUTPUT aVertex) : SV_Target { float4 result; @@ -298,3 +307,154 @@ float4 SolidColorShader(const VS_OUTPUT aVertex) : SV_Target { return fLayerColor; } + +// Mix-blend compatible vertex shaders. +VS_BLEND_OUTPUT LayerQuadBlendVS(const VS_INPUT aVertex) +{ + VS_OUTPUT v = LayerQuadVS(aVertex); + + VS_BLEND_OUTPUT o; + o.vPosition = v.vPosition; + o.vTexCoords = v.vTexCoords; + o.vMaskCoords = float3(0, 0, 0); + o.vBackdropCoords = BackdropPosition(v.vPosition); + return o; +} + +VS_BLEND_OUTPUT LayerQuadBlendMaskVS(const VS_INPUT aVertex) +{ + VS_MASK_OUTPUT v = LayerQuadMaskVS(aVertex); + + VS_BLEND_OUTPUT o; + o.vPosition = v.vPosition; + o.vTexCoords = v.vTexCoords; + o.vMaskCoords = float3(v.vMaskCoords, 0); + o.vBackdropCoords = BackdropPosition(v.vPosition); + return o; +} + +VS_BLEND_OUTPUT LayerQuadBlendMask3DVS(const VS_INPUT aVertex) +{ + VS_MASK_3D_OUTPUT v = LayerQuadMask3DVS(aVertex); + + VS_BLEND_OUTPUT o; + o.vPosition = v.vPosition; + o.vTexCoords = v.vTexCoords; + o.vMaskCoords = v.vMaskCoords; + o.vBackdropCoords = BackdropPosition(v.vPosition); + return o; +} + +// The layer type and mask type are specified as constants. We use these to +// call the correct pixel shader to determine the source color for blending. +// Unfortunately this also requires some boilerplate to convert VS_BLEND_OUTPUT +// to a compatible pixel shader input. +float4 ComputeBlendSourceColor(const VS_BLEND_OUTPUT aVertex) +{ + if (iBlendConfig.y == PS_MASK_NONE) { + VS_OUTPUT tmp; + tmp.vPosition = aVertex.vPosition; + tmp.vTexCoords = aVertex.vTexCoords; + if (iBlendConfig.x == PS_LAYER_RGB) { + return RGBShader(tmp); + } else if (iBlendConfig.x == PS_LAYER_RGBA) { + return RGBAShader(tmp); + } else if (iBlendConfig.x == PS_LAYER_YCBCR) { + return YCbCrShader(tmp); + } + return SolidColorShader(tmp); + } else if (iBlendConfig.y == PS_MASK_2D) { + VS_MASK_OUTPUT tmp; + tmp.vPosition = aVertex.vPosition; + tmp.vTexCoords = aVertex.vTexCoords; + tmp.vMaskCoords = aVertex.vMaskCoords.xy; + + if (iBlendConfig.x == PS_LAYER_RGB) { + return RGBShaderMask(tmp); + } else if (iBlendConfig.x == PS_LAYER_RGBA) { + return RGBAShaderMask(tmp); + } else if (iBlendConfig.x == PS_LAYER_YCBCR) { + return YCbCrShaderMask(tmp); + } + return SolidColorShaderMask(tmp); + } else if (iBlendConfig.y == PS_MASK_3D) { + // The only Mask 3D shader is RGBA. + VS_MASK_3D_OUTPUT tmp; + tmp.vPosition = aVertex.vPosition; + tmp.vTexCoords = aVertex.vTexCoords; + tmp.vMaskCoords = aVertex.vMaskCoords; + return RGBAShaderMask3D(tmp); + } + + return float4(0.0, 0.0, 0.0, 1.0); +} + +float3 ChooseBlendFunc(float3 dest, float3 src) +{ + [flatten] switch (iBlendConfig.z) { + case PS_BLEND_MULTIPLY: + return BlendMultiply(dest, src); + case PS_BLEND_SCREEN: + return BlendScreen(dest, src); + case PS_BLEND_OVERLAY: + return BlendOverlay(dest, src); + case PS_BLEND_DARKEN: + return BlendDarken(dest, src); + case PS_BLEND_LIGHTEN: + return BlendLighten(dest, src); + case PS_BLEND_COLOR_DODGE: + return BlendColorDodge(dest, src); + case PS_BLEND_COLOR_BURN: + return BlendColorBurn(dest, src); + case PS_BLEND_HARD_LIGHT: + return BlendHardLight(dest, src); + case PS_BLEND_SOFT_LIGHT: + return BlendSoftLight(dest, src); + case PS_BLEND_DIFFERENCE: + return BlendDifference(dest, src); + case PS_BLEND_EXCLUSION: + return BlendExclusion(dest, src); + case PS_BLEND_HUE: + return BlendHue(dest, src); + case PS_BLEND_SATURATION: + return BlendSaturation(dest, src); + case PS_BLEND_COLOR: + return BlendColor(dest, src); + case PS_BLEND_LUMINOSITY: + return BlendLuminosity(dest, src); + default: + return float3(0, 0, 0); + } +} + +float4 BlendShader(const VS_BLEND_OUTPUT aVertex) : SV_Target +{ + float4 backdrop = tBackdrop.Sample(sSampler, aVertex.vBackdropCoords.xy); + float4 source = ComputeBlendSourceColor(aVertex); + + // Shortcut when the backdrop or source alpha is 0, otherwise we may leak + // infinity into the blend function and return incorrect results. + if (backdrop.a == 0.0) { + return source; + } + if (source.a == 0.0) { + return backdrop; + } + + // The spec assumes there is no premultiplied alpha. The backdrop is always + // premultiplied, so undo the premultiply. If the source is premultiplied we + // must fix that as well. + backdrop.rgb /= backdrop.a; + if (iBlendConfig.w) { + source.rgb /= source.a; + } + + float4 result; + result.rgb = ChooseBlendFunc(backdrop.rgb, source.rgb); + result.a = source.a; + + // Factor backdrop alpha, then premultiply for the final OP_OVER. + result.rgb = (1.0 - backdrop.a) * source.rgb + backdrop.a * result.rgb; + result.rgb *= result.a; + return result; +} diff --git a/gfx/layers/d3d11/CompositorD3D11Shaders.h b/gfx/layers/d3d11/CompositorD3D11Shaders.h index 3a348988580..87881303259 100644 --- a/gfx/layers/d3d11/CompositorD3D11Shaders.h +++ b/gfx/layers/d3d11/CompositorD3D11Shaders.h @@ -15,8 +15,10 @@ struct ShaderBytes { const void* mData; size_t mLength; }; // float4 vTextureCoords; // Offset: 144 Size: 16 // float4 vLayerQuad; // Offset: 160 Size: 16 // float4 vMaskQuad; // Offset: 176 Size: 16 [unused] -// float4 fLayerColor; // Offset: 192 Size: 16 [unused] -// float fLayerOpacity; // Offset: 208 Size: 4 [unused] +// float4x4 mBackdropTransform; // Offset: 192 Size: 64 [unused] +// float4 fLayerColor; // Offset: 256 Size: 16 [unused] +// float fLayerOpacity; // Offset: 272 Size: 4 [unused] +// uint4 iBlendConfig; // Offset: 288 Size: 16 [unused] // // } // @@ -104,15 +106,15 @@ ret const BYTE LayerQuadVS[] = { - 68, 88, 66, 67, 200, 251, - 64, 251, 166, 240, 101, 137, - 191, 140, 75, 217, 9, 168, - 61, 163, 1, 0, 0, 0, - 180, 6, 0, 0, 6, 0, + 68, 88, 66, 67, 141, 229, + 88, 115, 31, 138, 49, 78, + 16, 5, 63, 222, 239, 137, + 213, 18, 1, 0, 0, 0, + 24, 7, 0, 0, 6, 0, 0, 0, 56, 0, 0, 0, 152, 1, 0, 0, 160, 3, 0, 0, 28, 4, 0, 0, - 40, 6, 0, 0, 92, 6, + 140, 6, 0, 0, 192, 6, 0, 0, 65, 111, 110, 57, 88, 1, 0, 0, 88, 1, 0, 0, 0, 2, 254, 255, @@ -280,11 +282,11 @@ const BYTE LayerQuadVS[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 68, 69, 70, - 4, 2, 0, 0, 1, 0, + 104, 2, 0, 0, 1, 0, 0, 0, 72, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0, 0, 4, 254, 255, - 0, 1, 0, 0, 208, 1, + 0, 1, 0, 0, 52, 2, 0, 0, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -293,41 +295,49 @@ const BYTE LayerQuadVS[] = 0, 0, 0, 0, 36, 71, 108, 111, 98, 97, 108, 115, 0, 171, 171, 171, 60, 0, - 0, 0, 8, 0, 0, 0, - 96, 0, 0, 0, 224, 0, + 0, 0, 10, 0, 0, 0, + 96, 0, 0, 0, 48, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 32, 1, + 0, 0, 0, 0, 80, 1, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 2, 0, - 0, 0, 48, 1, 0, 0, - 0, 0, 0, 0, 64, 1, - 0, 0, 64, 0, 0, 0, - 64, 0, 0, 0, 2, 0, - 0, 0, 48, 1, 0, 0, - 0, 0, 0, 0, 76, 1, - 0, 0, 128, 0, 0, 0, - 16, 0, 0, 0, 2, 0, 0, 0, 96, 1, 0, 0, 0, 0, 0, 0, 112, 1, + 0, 0, 64, 0, 0, 0, + 64, 0, 0, 0, 2, 0, + 0, 0, 96, 1, 0, 0, + 0, 0, 0, 0, 124, 1, + 0, 0, 128, 0, 0, 0, + 16, 0, 0, 0, 2, 0, + 0, 0, 144, 1, 0, 0, + 0, 0, 0, 0, 160, 1, 0, 0, 144, 0, 0, 0, 16, 0, 0, 0, 2, 0, - 0, 0, 128, 1, 0, 0, - 0, 0, 0, 0, 144, 1, + 0, 0, 176, 1, 0, 0, + 0, 0, 0, 0, 192, 1, 0, 0, 160, 0, 0, 0, 16, 0, 0, 0, 2, 0, - 0, 0, 128, 1, 0, 0, - 0, 0, 0, 0, 155, 1, + 0, 0, 176, 1, 0, 0, + 0, 0, 0, 0, 203, 1, 0, 0, 176, 0, 0, 0, 16, 0, 0, 0, 0, 0, - 0, 0, 128, 1, 0, 0, - 0, 0, 0, 0, 165, 1, + 0, 0, 176, 1, 0, 0, + 0, 0, 0, 0, 213, 1, 0, 0, 192, 0, 0, 0, - 16, 0, 0, 0, 0, 0, + 64, 0, 0, 0, 0, 0, 0, 0, 96, 1, 0, 0, - 0, 0, 0, 0, 177, 1, - 0, 0, 208, 0, 0, 0, + 0, 0, 0, 0, 232, 1, + 0, 0, 0, 1, 0, 0, + 16, 0, 0, 0, 0, 0, + 0, 0, 144, 1, 0, 0, + 0, 0, 0, 0, 244, 1, + 0, 0, 16, 1, 0, 0, 4, 0, 0, 0, 0, 0, - 0, 0, 192, 1, 0, 0, + 0, 0, 4, 2, 0, 0, + 0, 0, 0, 0, 20, 2, + 0, 0, 32, 1, 0, 0, + 16, 0, 0, 0, 0, 0, + 0, 0, 36, 2, 0, 0, 0, 0, 0, 0, 109, 76, 97, 121, 101, 114, 84, 114, 97, 110, 115, 102, 111, 114, @@ -350,46 +360,55 @@ const BYTE LayerQuadVS[] = 0, 0, 118, 76, 97, 121, 101, 114, 81, 117, 97, 100, 0, 118, 77, 97, 115, 107, - 81, 117, 97, 100, 0, 102, - 76, 97, 121, 101, 114, 67, - 111, 108, 111, 114, 0, 102, - 76, 97, 121, 101, 114, 79, - 112, 97, 99, 105, 116, 121, - 0, 171, 0, 0, 3, 0, - 1, 0, 1, 0, 0, 0, + 81, 117, 97, 100, 0, 109, + 66, 97, 99, 107, 100, 114, + 111, 112, 84, 114, 97, 110, + 115, 102, 111, 114, 109, 0, + 102, 76, 97, 121, 101, 114, + 67, 111, 108, 111, 114, 0, + 102, 76, 97, 121, 101, 114, + 79, 112, 97, 99, 105, 116, + 121, 0, 171, 171, 0, 0, + 3, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 77, 105, 99, 114, 111, 115, - 111, 102, 116, 32, 40, 82, - 41, 32, 72, 76, 83, 76, - 32, 83, 104, 97, 100, 101, - 114, 32, 67, 111, 109, 112, - 105, 108, 101, 114, 32, 54, - 46, 51, 46, 57, 54, 48, - 48, 46, 49, 54, 51, 56, - 52, 0, 171, 171, 73, 83, - 71, 78, 44, 0, 0, 0, - 1, 0, 0, 0, 8, 0, - 0, 0, 32, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, - 0, 0, 0, 0, 3, 3, - 0, 0, 80, 79, 83, 73, - 84, 73, 79, 78, 0, 171, - 171, 171, 79, 83, 71, 78, - 80, 0, 0, 0, 2, 0, + 0, 0, 105, 66, 108, 101, + 110, 100, 67, 111, 110, 102, + 105, 103, 0, 171, 171, 171, + 1, 0, 19, 0, 1, 0, + 4, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 77, 105, + 99, 114, 111, 115, 111, 102, + 116, 32, 40, 82, 41, 32, + 72, 76, 83, 76, 32, 83, + 104, 97, 100, 101, 114, 32, + 67, 111, 109, 112, 105, 108, + 101, 114, 32, 54, 46, 51, + 46, 57, 54, 48, 48, 46, + 49, 54, 51, 56, 52, 0, + 171, 171, 73, 83, 71, 78, + 44, 0, 0, 0, 1, 0, 0, 0, 8, 0, 0, 0, - 56, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 3, 0, 0, 0, 0, 0, - 0, 0, 15, 0, 0, 0, - 68, 0, 0, 0, 0, 0, + 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 1, 0, - 0, 0, 3, 12, 0, 0, - 83, 86, 95, 80, 111, 115, - 105, 116, 105, 111, 110, 0, - 84, 69, 88, 67, 79, 79, - 82, 68, 0, 171, 171, 171 + 3, 0, 0, 0, 0, 0, + 0, 0, 3, 3, 0, 0, + 80, 79, 83, 73, 84, 73, + 79, 78, 0, 171, 171, 171, + 79, 83, 71, 78, 80, 0, + 0, 0, 2, 0, 0, 0, + 8, 0, 0, 0, 56, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 68, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 1, 0, 0, 0, + 3, 12, 0, 0, 83, 86, + 95, 80, 111, 115, 105, 116, + 105, 111, 110, 0, 84, 69, + 88, 67, 79, 79, 82, 68, + 0, 171, 171, 171 }; ShaderBytes sLayerQuadVS = { LayerQuadVS, sizeof(LayerQuadVS) }; #if 0 @@ -404,12 +423,14 @@ ShaderBytes sLayerQuadVS = { LayerQuadVS, sizeof(LayerQuadVS) }; // // float4 fLayerColor; // Offset: 0 Size: 16 // float fLayerOpacity; // Offset: 16 Size: 4 [unused] -// float4x4 mLayerTransform; // Offset: 32 Size: 64 [unused] -// float4x4 mProjection; // Offset: 96 Size: 64 [unused] -// float4 vRenderTargetOffset; // Offset: 160 Size: 16 [unused] -// float4 vTextureCoords; // Offset: 176 Size: 16 [unused] -// float4 vLayerQuad; // Offset: 192 Size: 16 [unused] -// float4 vMaskQuad; // Offset: 208 Size: 16 [unused] +// uint4 iBlendConfig; // Offset: 32 Size: 16 [unused] +// float4x4 mLayerTransform; // Offset: 48 Size: 64 [unused] +// float4x4 mProjection; // Offset: 112 Size: 64 [unused] +// float4 vRenderTargetOffset; // Offset: 176 Size: 16 [unused] +// float4 vTextureCoords; // Offset: 192 Size: 16 [unused] +// float4 vLayerQuad; // Offset: 208 Size: 16 [unused] +// float4 vMaskQuad; // Offset: 224 Size: 16 [unused] +// float4x4 mBackdropTransform; // Offset: 240 Size: 64 [unused] // // } // @@ -460,15 +481,15 @@ ret const BYTE SolidColorShader[] = { - 68, 88, 66, 67, 30, 148, - 104, 202, 165, 39, 58, 182, - 100, 205, 95, 195, 52, 137, - 197, 241, 1, 0, 0, 0, - 224, 3, 0, 0, 6, 0, + 68, 88, 66, 67, 46, 104, + 157, 133, 222, 110, 60, 127, + 132, 226, 126, 208, 247, 164, + 42, 238, 1, 0, 0, 0, + 68, 4, 0, 0, 6, 0, 0, 0, 56, 0, 0, 0, 132, 0, 0, 0, 204, 0, 0, 0, 72, 1, 0, 0, - 84, 3, 0, 0, 172, 3, + 184, 3, 0, 0, 16, 4, 0, 0, 65, 111, 110, 57, 68, 0, 0, 0, 68, 0, 0, 0, 0, 2, 255, 255, @@ -515,12 +536,12 @@ const BYTE SolidColorShader[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 68, - 69, 70, 4, 2, 0, 0, + 69, 70, 104, 2, 0, 0, 1, 0, 0, 0, 72, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0, 0, 4, 255, 255, 0, 1, 0, 0, - 209, 1, 0, 0, 60, 0, + 52, 2, 0, 0, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -528,41 +549,49 @@ const BYTE SolidColorShader[] = 0, 0, 0, 0, 0, 0, 36, 71, 108, 111, 98, 97, 108, 115, 0, 171, 171, 171, - 60, 0, 0, 0, 8, 0, + 60, 0, 0, 0, 10, 0, 0, 0, 96, 0, 0, 0, - 224, 0, 0, 0, 0, 0, + 48, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 32, 1, 0, 0, 0, 0, + 80, 1, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, - 2, 0, 0, 0, 44, 1, + 2, 0, 0, 0, 92, 1, 0, 0, 0, 0, 0, 0, - 60, 1, 0, 0, 16, 0, + 108, 1, 0, 0, 16, 0, 0, 0, 4, 0, 0, 0, - 0, 0, 0, 0, 76, 1, + 0, 0, 0, 0, 124, 1, 0, 0, 0, 0, 0, 0, - 92, 1, 0, 0, 32, 0, + 140, 1, 0, 0, 32, 0, + 0, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 156, 1, + 0, 0, 0, 0, 0, 0, + 172, 1, 0, 0, 48, 0, 0, 0, 64, 0, 0, 0, - 0, 0, 0, 0, 108, 1, + 0, 0, 0, 0, 188, 1, 0, 0, 0, 0, 0, 0, - 124, 1, 0, 0, 96, 0, + 204, 1, 0, 0, 112, 0, 0, 0, 64, 0, 0, 0, - 0, 0, 0, 0, 108, 1, + 0, 0, 0, 0, 188, 1, 0, 0, 0, 0, 0, 0, - 136, 1, 0, 0, 160, 0, + 216, 1, 0, 0, 176, 0, 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 44, 1, + 0, 0, 0, 0, 92, 1, 0, 0, 0, 0, 0, 0, - 156, 1, 0, 0, 176, 0, + 236, 1, 0, 0, 192, 0, 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 172, 1, + 0, 0, 0, 0, 252, 1, 0, 0, 0, 0, 0, 0, - 188, 1, 0, 0, 192, 0, + 12, 2, 0, 0, 208, 0, 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 172, 1, + 0, 0, 0, 0, 252, 1, 0, 0, 0, 0, 0, 0, - 199, 1, 0, 0, 208, 0, + 23, 2, 0, 0, 224, 0, 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 172, 1, + 0, 0, 0, 0, 252, 1, + 0, 0, 0, 0, 0, 0, + 33, 2, 0, 0, 240, 0, + 0, 0, 64, 0, 0, 0, + 0, 0, 0, 0, 188, 1, 0, 0, 0, 0, 0, 0, 102, 76, 97, 121, 101, 114, 67, 111, 108, 111, 114, 0, @@ -574,58 +603,66 @@ const BYTE SolidColorShader[] = 171, 171, 0, 0, 3, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 109, 76, 97, 121, 101, 114, - 84, 114, 97, 110, 115, 102, - 111, 114, 109, 0, 3, 0, - 3, 0, 4, 0, 4, 0, + 105, 66, 108, 101, 110, 100, + 67, 111, 110, 102, 105, 103, + 0, 171, 171, 171, 1, 0, + 19, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 109, 80, 114, 111, - 106, 101, 99, 116, 105, 111, - 110, 0, 118, 82, 101, 110, - 100, 101, 114, 84, 97, 114, - 103, 101, 116, 79, 102, 102, - 115, 101, 116, 0, 118, 84, - 101, 120, 116, 117, 114, 101, - 67, 111, 111, 114, 100, 115, - 0, 171, 1, 0, 3, 0, - 1, 0, 4, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 118, 76, 97, 121, 101, 114, - 81, 117, 97, 100, 0, 118, - 77, 97, 115, 107, 81, 117, - 97, 100, 0, 77, 105, 99, - 114, 111, 115, 111, 102, 116, - 32, 40, 82, 41, 32, 72, - 76, 83, 76, 32, 83, 104, - 97, 100, 101, 114, 32, 67, - 111, 109, 112, 105, 108, 101, - 114, 32, 54, 46, 51, 46, - 57, 54, 48, 48, 46, 49, - 54, 51, 56, 52, 0, 171, - 73, 83, 71, 78, 80, 0, - 0, 0, 2, 0, 0, 0, - 8, 0, 0, 0, 56, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 3, 0, - 0, 0, 0, 0, 0, 0, - 15, 0, 0, 0, 68, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 3, 0, - 0, 0, 1, 0, 0, 0, - 3, 0, 0, 0, 83, 86, - 95, 80, 111, 115, 105, 116, - 105, 111, 110, 0, 84, 69, - 88, 67, 79, 79, 82, 68, - 0, 171, 171, 171, 79, 83, - 71, 78, 44, 0, 0, 0, - 1, 0, 0, 0, 8, 0, - 0, 0, 32, 0, 0, 0, + 0, 0, 109, 76, 97, 121, + 101, 114, 84, 114, 97, 110, + 115, 102, 111, 114, 109, 0, + 3, 0, 3, 0, 4, 0, + 4, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 109, 80, + 114, 111, 106, 101, 99, 116, + 105, 111, 110, 0, 118, 82, + 101, 110, 100, 101, 114, 84, + 97, 114, 103, 101, 116, 79, + 102, 102, 115, 101, 116, 0, + 118, 84, 101, 120, 116, 117, + 114, 101, 67, 111, 111, 114, + 100, 115, 0, 171, 1, 0, + 3, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 118, 76, 97, 121, + 101, 114, 81, 117, 97, 100, + 0, 118, 77, 97, 115, 107, + 81, 117, 97, 100, 0, 109, + 66, 97, 99, 107, 100, 114, + 111, 112, 84, 114, 97, 110, + 115, 102, 111, 114, 109, 0, + 77, 105, 99, 114, 111, 115, + 111, 102, 116, 32, 40, 82, + 41, 32, 72, 76, 83, 76, + 32, 83, 104, 97, 100, 101, + 114, 32, 67, 111, 109, 112, + 105, 108, 101, 114, 32, 54, + 46, 51, 46, 57, 54, 48, + 48, 46, 49, 54, 51, 56, + 52, 0, 171, 171, 73, 83, + 71, 78, 80, 0, 0, 0, + 2, 0, 0, 0, 8, 0, + 0, 0, 56, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 0, - 0, 0, 83, 86, 95, 84, - 97, 114, 103, 101, 116, 0, - 171, 171 + 0, 0, 68, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 1, 0, 0, 0, 3, 0, + 0, 0, 83, 86, 95, 80, + 111, 115, 105, 116, 105, 111, + 110, 0, 84, 69, 88, 67, + 79, 79, 82, 68, 0, 171, + 171, 171, 79, 83, 71, 78, + 44, 0, 0, 0, 1, 0, + 0, 0, 8, 0, 0, 0, + 32, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 15, 0, 0, 0, + 83, 86, 95, 84, 97, 114, + 103, 101, 116, 0, 171, 171 }; ShaderBytes sSolidColorShader = { SolidColorShader, sizeof(SolidColorShader) }; #if 0 @@ -640,12 +677,14 @@ ShaderBytes sSolidColorShader = { SolidColorShader, sizeof(SolidColorShader) }; // // float4 fLayerColor; // Offset: 0 Size: 16 [unused] // float fLayerOpacity; // Offset: 16 Size: 4 -// float4x4 mLayerTransform; // Offset: 32 Size: 64 [unused] -// float4x4 mProjection; // Offset: 96 Size: 64 [unused] -// float4 vRenderTargetOffset; // Offset: 160 Size: 16 [unused] -// float4 vTextureCoords; // Offset: 176 Size: 16 [unused] -// float4 vLayerQuad; // Offset: 192 Size: 16 [unused] -// float4 vMaskQuad; // Offset: 208 Size: 16 [unused] +// uint4 iBlendConfig; // Offset: 32 Size: 16 [unused] +// float4x4 mLayerTransform; // Offset: 48 Size: 64 [unused] +// float4x4 mProjection; // Offset: 112 Size: 64 [unused] +// float4 vRenderTargetOffset; // Offset: 176 Size: 16 [unused] +// float4 vTextureCoords; // Offset: 192 Size: 16 [unused] +// float4 vLayerQuad; // Offset: 208 Size: 16 [unused] +// float4 vMaskQuad; // Offset: 224 Size: 16 [unused] +// float4x4 mBackdropTransform; // Offset: 240 Size: 64 [unused] // // } // @@ -716,15 +755,15 @@ ret const BYTE RGBShader[] = { - 68, 88, 66, 67, 239, 198, - 87, 206, 69, 92, 245, 30, - 125, 195, 239, 77, 37, 241, - 175, 187, 1, 0, 0, 0, - 232, 4, 0, 0, 6, 0, + 68, 88, 66, 67, 65, 119, + 74, 180, 122, 23, 76, 16, + 140, 81, 225, 186, 127, 137, + 70, 249, 1, 0, 0, 0, + 76, 5, 0, 0, 6, 0, 0, 0, 56, 0, 0, 0, 204, 0, 0, 0, 136, 1, 0, 0, 4, 2, 0, 0, - 92, 4, 0, 0, 180, 4, + 192, 4, 0, 0, 24, 5, 0, 0, 65, 111, 110, 57, 140, 0, 0, 0, 140, 0, 0, 0, 0, 2, 255, 255, @@ -802,12 +841,12 @@ const BYTE RGBShader[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 82, 68, 69, 70, 80, 2, + 82, 68, 69, 70, 180, 2, 0, 0, 1, 0, 0, 0, 148, 0, 0, 0, 3, 0, 0, 0, 28, 0, 0, 0, 0, 4, 255, 255, 0, 1, - 0, 0, 29, 2, 0, 0, + 0, 0, 128, 2, 0, 0, 124, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -818,7 +857,7 @@ const BYTE RGBShader[] = 0, 0, 4, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 1, 0, 0, 0, - 12, 0, 0, 0, 138, 0, + 13, 0, 0, 0, 138, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -828,41 +867,49 @@ const BYTE RGBShader[] = 101, 114, 0, 116, 82, 71, 66, 0, 36, 71, 108, 111, 98, 97, 108, 115, 0, 171, - 138, 0, 0, 0, 8, 0, + 138, 0, 0, 0, 10, 0, 0, 0, 172, 0, 0, 0, - 224, 0, 0, 0, 0, 0, + 48, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 108, 1, 0, 0, 0, 0, + 156, 1, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 120, 1, + 0, 0, 0, 0, 168, 1, 0, 0, 0, 0, 0, 0, - 136, 1, 0, 0, 16, 0, + 184, 1, 0, 0, 16, 0, 0, 0, 4, 0, 0, 0, - 2, 0, 0, 0, 152, 1, + 2, 0, 0, 0, 200, 1, 0, 0, 0, 0, 0, 0, - 168, 1, 0, 0, 32, 0, + 216, 1, 0, 0, 32, 0, + 0, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 232, 1, + 0, 0, 0, 0, 0, 0, + 248, 1, 0, 0, 48, 0, 0, 0, 64, 0, 0, 0, - 0, 0, 0, 0, 184, 1, + 0, 0, 0, 0, 8, 2, 0, 0, 0, 0, 0, 0, - 200, 1, 0, 0, 96, 0, + 24, 2, 0, 0, 112, 0, 0, 0, 64, 0, 0, 0, - 0, 0, 0, 0, 184, 1, + 0, 0, 0, 0, 8, 2, 0, 0, 0, 0, 0, 0, - 212, 1, 0, 0, 160, 0, + 36, 2, 0, 0, 176, 0, 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 120, 1, + 0, 0, 0, 0, 168, 1, 0, 0, 0, 0, 0, 0, - 232, 1, 0, 0, 176, 0, + 56, 2, 0, 0, 192, 0, 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 248, 1, + 0, 0, 0, 0, 72, 2, 0, 0, 0, 0, 0, 0, - 8, 2, 0, 0, 192, 0, + 88, 2, 0, 0, 208, 0, 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 248, 1, + 0, 0, 0, 0, 72, 2, 0, 0, 0, 0, 0, 0, - 19, 2, 0, 0, 208, 0, + 99, 2, 0, 0, 224, 0, 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 248, 1, + 0, 0, 0, 0, 72, 2, + 0, 0, 0, 0, 0, 0, + 109, 2, 0, 0, 240, 0, + 0, 0, 64, 0, 0, 0, + 0, 0, 0, 0, 8, 2, 0, 0, 0, 0, 0, 0, 102, 76, 97, 121, 101, 114, 67, 111, 108, 111, 114, 0, @@ -874,58 +921,66 @@ const BYTE RGBShader[] = 171, 171, 0, 0, 3, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 109, 76, 97, 121, 101, 114, - 84, 114, 97, 110, 115, 102, - 111, 114, 109, 0, 3, 0, - 3, 0, 4, 0, 4, 0, + 105, 66, 108, 101, 110, 100, + 67, 111, 110, 102, 105, 103, + 0, 171, 171, 171, 1, 0, + 19, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 109, 80, 114, 111, - 106, 101, 99, 116, 105, 111, - 110, 0, 118, 82, 101, 110, - 100, 101, 114, 84, 97, 114, - 103, 101, 116, 79, 102, 102, - 115, 101, 116, 0, 118, 84, - 101, 120, 116, 117, 114, 101, - 67, 111, 111, 114, 100, 115, - 0, 171, 1, 0, 3, 0, - 1, 0, 4, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 118, 76, 97, 121, 101, 114, - 81, 117, 97, 100, 0, 118, - 77, 97, 115, 107, 81, 117, - 97, 100, 0, 77, 105, 99, - 114, 111, 115, 111, 102, 116, - 32, 40, 82, 41, 32, 72, - 76, 83, 76, 32, 83, 104, - 97, 100, 101, 114, 32, 67, - 111, 109, 112, 105, 108, 101, - 114, 32, 54, 46, 51, 46, - 57, 54, 48, 48, 46, 49, - 54, 51, 56, 52, 0, 171, - 73, 83, 71, 78, 80, 0, - 0, 0, 2, 0, 0, 0, - 8, 0, 0, 0, 56, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 3, 0, - 0, 0, 0, 0, 0, 0, - 15, 0, 0, 0, 68, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 3, 0, - 0, 0, 1, 0, 0, 0, - 3, 3, 0, 0, 83, 86, - 95, 80, 111, 115, 105, 116, - 105, 111, 110, 0, 84, 69, - 88, 67, 79, 79, 82, 68, - 0, 171, 171, 171, 79, 83, - 71, 78, 44, 0, 0, 0, - 1, 0, 0, 0, 8, 0, - 0, 0, 32, 0, 0, 0, + 0, 0, 109, 76, 97, 121, + 101, 114, 84, 114, 97, 110, + 115, 102, 111, 114, 109, 0, + 3, 0, 3, 0, 4, 0, + 4, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 109, 80, + 114, 111, 106, 101, 99, 116, + 105, 111, 110, 0, 118, 82, + 101, 110, 100, 101, 114, 84, + 97, 114, 103, 101, 116, 79, + 102, 102, 115, 101, 116, 0, + 118, 84, 101, 120, 116, 117, + 114, 101, 67, 111, 111, 114, + 100, 115, 0, 171, 1, 0, + 3, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 118, 76, 97, 121, + 101, 114, 81, 117, 97, 100, + 0, 118, 77, 97, 115, 107, + 81, 117, 97, 100, 0, 109, + 66, 97, 99, 107, 100, 114, + 111, 112, 84, 114, 97, 110, + 115, 102, 111, 114, 109, 0, + 77, 105, 99, 114, 111, 115, + 111, 102, 116, 32, 40, 82, + 41, 32, 72, 76, 83, 76, + 32, 83, 104, 97, 100, 101, + 114, 32, 67, 111, 109, 112, + 105, 108, 101, 114, 32, 54, + 46, 51, 46, 57, 54, 48, + 48, 46, 49, 54, 51, 56, + 52, 0, 171, 171, 73, 83, + 71, 78, 80, 0, 0, 0, + 2, 0, 0, 0, 8, 0, + 0, 0, 56, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 0, - 0, 0, 83, 86, 95, 84, - 97, 114, 103, 101, 116, 0, - 171, 171 + 0, 0, 68, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 1, 0, 0, 0, 3, 3, + 0, 0, 83, 86, 95, 80, + 111, 115, 105, 116, 105, 111, + 110, 0, 84, 69, 88, 67, + 79, 79, 82, 68, 0, 171, + 171, 171, 79, 83, 71, 78, + 44, 0, 0, 0, 1, 0, + 0, 0, 8, 0, 0, 0, + 32, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 15, 0, 0, 0, + 83, 86, 95, 84, 97, 114, + 103, 101, 116, 0, 171, 171 }; ShaderBytes sRGBShader = { RGBShader, sizeof(RGBShader) }; #if 0 @@ -940,12 +995,14 @@ ShaderBytes sRGBShader = { RGBShader, sizeof(RGBShader) }; // // float4 fLayerColor; // Offset: 0 Size: 16 [unused] // float fLayerOpacity; // Offset: 16 Size: 4 -// float4x4 mLayerTransform; // Offset: 32 Size: 64 [unused] -// float4x4 mProjection; // Offset: 96 Size: 64 [unused] -// float4 vRenderTargetOffset; // Offset: 160 Size: 16 [unused] -// float4 vTextureCoords; // Offset: 176 Size: 16 [unused] -// float4 vLayerQuad; // Offset: 192 Size: 16 [unused] -// float4 vMaskQuad; // Offset: 208 Size: 16 [unused] +// uint4 iBlendConfig; // Offset: 32 Size: 16 [unused] +// float4x4 mLayerTransform; // Offset: 48 Size: 64 [unused] +// float4x4 mProjection; // Offset: 112 Size: 64 [unused] +// float4 vRenderTargetOffset; // Offset: 176 Size: 16 [unused] +// float4 vTextureCoords; // Offset: 192 Size: 16 [unused] +// float4 vLayerQuad; // Offset: 208 Size: 16 [unused] +// float4 vMaskQuad; // Offset: 224 Size: 16 [unused] +// float4x4 mBackdropTransform; // Offset: 240 Size: 64 [unused] // // } // @@ -1014,15 +1071,15 @@ ret const BYTE RGBAShader[] = { - 68, 88, 66, 67, 230, 59, - 90, 23, 60, 77, 18, 113, - 14, 129, 183, 152, 233, 55, - 111, 42, 1, 0, 0, 0, - 196, 4, 0, 0, 6, 0, + 68, 88, 66, 67, 134, 186, + 102, 217, 28, 249, 237, 84, + 31, 38, 2, 143, 235, 216, + 237, 103, 1, 0, 0, 0, + 40, 5, 0, 0, 6, 0, 0, 0, 56, 0, 0, 0, 192, 0, 0, 0, 100, 1, 0, 0, 224, 1, 0, 0, - 56, 4, 0, 0, 144, 4, + 156, 4, 0, 0, 244, 4, 0, 0, 65, 111, 110, 57, 128, 0, 0, 0, 128, 0, 0, 0, 0, 2, 255, 255, @@ -1094,12 +1151,12 @@ const BYTE RGBAShader[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 82, 68, 69, 70, 80, 2, + 82, 68, 69, 70, 180, 2, 0, 0, 1, 0, 0, 0, 148, 0, 0, 0, 3, 0, 0, 0, 28, 0, 0, 0, 0, 4, 255, 255, 0, 1, - 0, 0, 29, 2, 0, 0, + 0, 0, 128, 2, 0, 0, 124, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1110,7 +1167,7 @@ const BYTE RGBAShader[] = 0, 0, 4, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 1, 0, 0, 0, - 12, 0, 0, 0, 138, 0, + 13, 0, 0, 0, 138, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1120,41 +1177,49 @@ const BYTE RGBAShader[] = 101, 114, 0, 116, 82, 71, 66, 0, 36, 71, 108, 111, 98, 97, 108, 115, 0, 171, - 138, 0, 0, 0, 8, 0, + 138, 0, 0, 0, 10, 0, 0, 0, 172, 0, 0, 0, - 224, 0, 0, 0, 0, 0, + 48, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 108, 1, 0, 0, 0, 0, + 156, 1, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 120, 1, + 0, 0, 0, 0, 168, 1, 0, 0, 0, 0, 0, 0, - 136, 1, 0, 0, 16, 0, + 184, 1, 0, 0, 16, 0, 0, 0, 4, 0, 0, 0, - 2, 0, 0, 0, 152, 1, + 2, 0, 0, 0, 200, 1, 0, 0, 0, 0, 0, 0, - 168, 1, 0, 0, 32, 0, + 216, 1, 0, 0, 32, 0, + 0, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 232, 1, + 0, 0, 0, 0, 0, 0, + 248, 1, 0, 0, 48, 0, 0, 0, 64, 0, 0, 0, - 0, 0, 0, 0, 184, 1, + 0, 0, 0, 0, 8, 2, 0, 0, 0, 0, 0, 0, - 200, 1, 0, 0, 96, 0, + 24, 2, 0, 0, 112, 0, 0, 0, 64, 0, 0, 0, - 0, 0, 0, 0, 184, 1, + 0, 0, 0, 0, 8, 2, 0, 0, 0, 0, 0, 0, - 212, 1, 0, 0, 160, 0, + 36, 2, 0, 0, 176, 0, 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 120, 1, + 0, 0, 0, 0, 168, 1, 0, 0, 0, 0, 0, 0, - 232, 1, 0, 0, 176, 0, + 56, 2, 0, 0, 192, 0, 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 248, 1, + 0, 0, 0, 0, 72, 2, 0, 0, 0, 0, 0, 0, - 8, 2, 0, 0, 192, 0, + 88, 2, 0, 0, 208, 0, 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 248, 1, + 0, 0, 0, 0, 72, 2, 0, 0, 0, 0, 0, 0, - 19, 2, 0, 0, 208, 0, + 99, 2, 0, 0, 224, 0, 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 248, 1, + 0, 0, 0, 0, 72, 2, + 0, 0, 0, 0, 0, 0, + 109, 2, 0, 0, 240, 0, + 0, 0, 64, 0, 0, 0, + 0, 0, 0, 0, 8, 2, 0, 0, 0, 0, 0, 0, 102, 76, 97, 121, 101, 114, 67, 111, 108, 111, 114, 0, @@ -1166,340 +1231,43 @@ const BYTE RGBAShader[] = 171, 171, 0, 0, 3, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 109, 76, 97, 121, 101, 114, - 84, 114, 97, 110, 115, 102, - 111, 114, 109, 0, 3, 0, - 3, 0, 4, 0, 4, 0, + 105, 66, 108, 101, 110, 100, + 67, 111, 110, 102, 105, 103, + 0, 171, 171, 171, 1, 0, + 19, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 109, 80, 114, 111, - 106, 101, 99, 116, 105, 111, - 110, 0, 118, 82, 101, 110, - 100, 101, 114, 84, 97, 114, - 103, 101, 116, 79, 102, 102, - 115, 101, 116, 0, 118, 84, - 101, 120, 116, 117, 114, 101, - 67, 111, 111, 114, 100, 115, - 0, 171, 1, 0, 3, 0, - 1, 0, 4, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 118, 76, 97, 121, 101, 114, - 81, 117, 97, 100, 0, 118, - 77, 97, 115, 107, 81, 117, - 97, 100, 0, 77, 105, 99, - 114, 111, 115, 111, 102, 116, - 32, 40, 82, 41, 32, 72, - 76, 83, 76, 32, 83, 104, - 97, 100, 101, 114, 32, 67, - 111, 109, 112, 105, 108, 101, - 114, 32, 54, 46, 51, 46, - 57, 54, 48, 48, 46, 49, - 54, 51, 56, 52, 0, 171, - 73, 83, 71, 78, 80, 0, - 0, 0, 2, 0, 0, 0, - 8, 0, 0, 0, 56, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 3, 0, - 0, 0, 0, 0, 0, 0, - 15, 0, 0, 0, 68, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 3, 0, - 0, 0, 1, 0, 0, 0, - 3, 3, 0, 0, 83, 86, - 95, 80, 111, 115, 105, 116, - 105, 111, 110, 0, 84, 69, - 88, 67, 79, 79, 82, 68, - 0, 171, 171, 171, 79, 83, - 71, 78, 44, 0, 0, 0, - 1, 0, 0, 0, 8, 0, - 0, 0, 32, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, - 0, 0, 0, 0, 15, 0, - 0, 0, 83, 86, 95, 84, - 97, 114, 103, 101, 116, 0, - 171, 171 -}; -ShaderBytes sRGBAShader = { RGBAShader, sizeof(RGBAShader) }; -#if 0 -// -// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 -// -// -// Buffer Definitions: -// -// cbuffer $Globals -// { -// -// float4 fLayerColor; // Offset: 0 Size: 16 [unused] -// float fLayerOpacity; // Offset: 16 Size: 4 -// float4x4 mLayerTransform; // Offset: 32 Size: 64 [unused] -// float4x4 mProjection; // Offset: 96 Size: 64 [unused] -// float4 vRenderTargetOffset; // Offset: 160 Size: 16 [unused] -// float4 vTextureCoords; // Offset: 176 Size: 16 [unused] -// float4 vLayerQuad; // Offset: 192 Size: 16 [unused] -// float4 vMaskQuad; // Offset: 208 Size: 16 [unused] -// -// } -// -// -// Resource Bindings: -// -// Name Type Format Dim Slot Elements -// ------------------------------ ---------- ------- ----------- ---- -------- -// sSampler sampler NA NA 0 1 -// tRGB texture float4 2d 0 1 -// $Globals cbuffer NA NA 0 1 -// -// -// -// Input signature: -// -// Name Index Mask Register SysValue Format Used -// -------------------- ----- ------ -------- -------- ------- ------ -// SV_Position 0 xyzw 0 POS float -// TEXCOORD 0 xy 1 NONE float xy -// -// -// Output signature: -// -// Name Index Mask Register SysValue Format Used -// -------------------- ----- ------ -------- -------- ------- ------ -// SV_Target 0 xyzw 0 TARGET float xyzw -// -// -// Constant buffer to DX9 shader constant mappings: -// -// Target Reg Buffer Start Reg # of Regs Data Conversion -// ---------- ------- --------- --------- ---------------------- -// c0 cb0 1 1 ( FLT, FLT, FLT, FLT) -// -// -// Sampler/Resource to DX9 shader sampler mappings: -// -// Target Sampler Source Sampler Source Resource -// -------------- --------------- ---------------- -// s0 s0 t0 -// -// -// Level9 shader bytecode: -// - ps_2_x - dcl t0.xy - dcl_2d s0 - texld r0, t0, s0 - mul r0, r0, c0.x - mul r0.xyz, r0.w, r0 - mov oC0, r0 - -// approximately 4 instruction slots used (1 texture, 3 arithmetic) -ps_4_0 -dcl_constantbuffer cb0[2], immediateIndexed -dcl_sampler s0, mode_default -dcl_resource_texture2d (float,float,float,float) t0 -dcl_input_ps linear v1.xy -dcl_output o0.xyzw -dcl_temps 1 -sample r0.xyzw, v1.xyxx, t0.xyzw, s0 -mul r0.xyzw, r0.xyzw, cb0[1].xxxx -mul o0.xyz, r0.wwww, r0.xyzx -mov o0.w, r0.w -ret -// Approximately 5 instruction slots used -#endif - -const BYTE RGBAShaderPremul[] = -{ - 68, 88, 66, 67, 9, 19, - 234, 250, 161, 24, 191, 52, - 148, 34, 157, 98, 40, 39, - 76, 48, 1, 0, 0, 0, - 4, 5, 0, 0, 6, 0, - 0, 0, 56, 0, 0, 0, - 208, 0, 0, 0, 164, 1, - 0, 0, 32, 2, 0, 0, - 120, 4, 0, 0, 208, 4, - 0, 0, 65, 111, 110, 57, - 144, 0, 0, 0, 144, 0, - 0, 0, 0, 2, 255, 255, - 92, 0, 0, 0, 52, 0, - 0, 0, 1, 0, 40, 0, - 0, 0, 52, 0, 0, 0, - 52, 0, 1, 0, 36, 0, - 0, 0, 52, 0, 0, 0, - 0, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 0, 0, - 0, 0, 1, 2, 255, 255, - 31, 0, 0, 2, 0, 0, - 0, 128, 0, 0, 3, 176, - 31, 0, 0, 2, 0, 0, - 0, 144, 0, 8, 15, 160, - 66, 0, 0, 3, 0, 0, - 15, 128, 0, 0, 228, 176, - 0, 8, 228, 160, 5, 0, - 0, 3, 0, 0, 15, 128, - 0, 0, 228, 128, 0, 0, - 0, 160, 5, 0, 0, 3, - 0, 0, 7, 128, 0, 0, - 255, 128, 0, 0, 228, 128, - 1, 0, 0, 2, 0, 8, - 15, 128, 0, 0, 228, 128, - 255, 255, 0, 0, 83, 72, - 68, 82, 204, 0, 0, 0, - 64, 0, 0, 0, 51, 0, - 0, 0, 89, 0, 0, 4, - 70, 142, 32, 0, 0, 0, - 0, 0, 2, 0, 0, 0, - 90, 0, 0, 3, 0, 96, - 16, 0, 0, 0, 0, 0, - 88, 24, 0, 4, 0, 112, - 16, 0, 0, 0, 0, 0, - 85, 85, 0, 0, 98, 16, - 0, 3, 50, 16, 16, 0, - 1, 0, 0, 0, 101, 0, - 0, 3, 242, 32, 16, 0, - 0, 0, 0, 0, 104, 0, - 0, 2, 1, 0, 0, 0, - 69, 0, 0, 9, 242, 0, - 16, 0, 0, 0, 0, 0, - 70, 16, 16, 0, 1, 0, - 0, 0, 70, 126, 16, 0, - 0, 0, 0, 0, 0, 96, - 16, 0, 0, 0, 0, 0, - 56, 0, 0, 8, 242, 0, - 16, 0, 0, 0, 0, 0, - 70, 14, 16, 0, 0, 0, - 0, 0, 6, 128, 32, 0, - 0, 0, 0, 0, 1, 0, - 0, 0, 56, 0, 0, 7, - 114, 32, 16, 0, 0, 0, - 0, 0, 246, 15, 16, 0, - 0, 0, 0, 0, 70, 2, - 16, 0, 0, 0, 0, 0, - 54, 0, 0, 5, 130, 32, - 16, 0, 0, 0, 0, 0, - 58, 0, 16, 0, 0, 0, - 0, 0, 62, 0, 0, 1, - 83, 84, 65, 84, 116, 0, - 0, 0, 5, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 0, 0, 2, 0, 0, 0, - 2, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 82, 68, - 69, 70, 80, 2, 0, 0, - 1, 0, 0, 0, 148, 0, - 0, 0, 3, 0, 0, 0, - 28, 0, 0, 0, 0, 4, - 255, 255, 0, 1, 0, 0, - 29, 2, 0, 0, 124, 0, - 0, 0, 3, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, - 0, 0, 1, 0, 0, 0, - 133, 0, 0, 0, 2, 0, - 0, 0, 5, 0, 0, 0, - 4, 0, 0, 0, 255, 255, - 255, 255, 0, 0, 0, 0, - 1, 0, 0, 0, 12, 0, - 0, 0, 138, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 115, 83, - 97, 109, 112, 108, 101, 114, - 0, 116, 82, 71, 66, 0, - 36, 71, 108, 111, 98, 97, - 108, 115, 0, 171, 138, 0, - 0, 0, 8, 0, 0, 0, - 172, 0, 0, 0, 224, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 108, 1, - 0, 0, 0, 0, 0, 0, - 16, 0, 0, 0, 0, 0, - 0, 0, 120, 1, 0, 0, - 0, 0, 0, 0, 136, 1, - 0, 0, 16, 0, 0, 0, - 4, 0, 0, 0, 2, 0, - 0, 0, 152, 1, 0, 0, - 0, 0, 0, 0, 168, 1, - 0, 0, 32, 0, 0, 0, - 64, 0, 0, 0, 0, 0, - 0, 0, 184, 1, 0, 0, - 0, 0, 0, 0, 200, 1, - 0, 0, 96, 0, 0, 0, - 64, 0, 0, 0, 0, 0, - 0, 0, 184, 1, 0, 0, - 0, 0, 0, 0, 212, 1, - 0, 0, 160, 0, 0, 0, - 16, 0, 0, 0, 0, 0, - 0, 0, 120, 1, 0, 0, - 0, 0, 0, 0, 232, 1, - 0, 0, 176, 0, 0, 0, - 16, 0, 0, 0, 0, 0, - 0, 0, 248, 1, 0, 0, - 0, 0, 0, 0, 8, 2, - 0, 0, 192, 0, 0, 0, - 16, 0, 0, 0, 0, 0, - 0, 0, 248, 1, 0, 0, - 0, 0, 0, 0, 19, 2, - 0, 0, 208, 0, 0, 0, - 16, 0, 0, 0, 0, 0, - 0, 0, 248, 1, 0, 0, - 0, 0, 0, 0, 102, 76, - 97, 121, 101, 114, 67, 111, - 108, 111, 114, 0, 1, 0, + 0, 0, 109, 76, 97, 121, + 101, 114, 84, 114, 97, 110, + 115, 102, 111, 114, 109, 0, + 3, 0, 3, 0, 4, 0, + 4, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 109, 80, + 114, 111, 106, 101, 99, 116, + 105, 111, 110, 0, 118, 82, + 101, 110, 100, 101, 114, 84, + 97, 114, 103, 101, 116, 79, + 102, 102, 115, 101, 116, 0, + 118, 84, 101, 120, 116, 117, + 114, 101, 67, 111, 111, 114, + 100, 115, 0, 171, 1, 0, 3, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 102, 76, 97, 121, - 101, 114, 79, 112, 97, 99, - 105, 116, 121, 0, 171, 171, - 0, 0, 3, 0, 1, 0, - 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 109, 76, - 97, 121, 101, 114, 84, 114, - 97, 110, 115, 102, 111, 114, - 109, 0, 3, 0, 3, 0, - 4, 0, 4, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 109, 80, 114, 111, 106, 101, - 99, 116, 105, 111, 110, 0, - 118, 82, 101, 110, 100, 101, - 114, 84, 97, 114, 103, 101, - 116, 79, 102, 102, 115, 101, - 116, 0, 118, 84, 101, 120, - 116, 117, 114, 101, 67, 111, - 111, 114, 100, 115, 0, 171, - 1, 0, 3, 0, 1, 0, - 4, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 118, 76, - 97, 121, 101, 114, 81, 117, - 97, 100, 0, 118, 77, 97, - 115, 107, 81, 117, 97, 100, - 0, 77, 105, 99, 114, 111, - 115, 111, 102, 116, 32, 40, - 82, 41, 32, 72, 76, 83, - 76, 32, 83, 104, 97, 100, - 101, 114, 32, 67, 111, 109, - 112, 105, 108, 101, 114, 32, - 54, 46, 51, 46, 57, 54, - 48, 48, 46, 49, 54, 51, - 56, 52, 0, 171, 73, 83, + 0, 0, 118, 76, 97, 121, + 101, 114, 81, 117, 97, 100, + 0, 118, 77, 97, 115, 107, + 81, 117, 97, 100, 0, 109, + 66, 97, 99, 107, 100, 114, + 111, 112, 84, 114, 97, 110, + 115, 102, 111, 114, 109, 0, + 77, 105, 99, 114, 111, 115, + 111, 102, 116, 32, 40, 82, + 41, 32, 72, 76, 83, 76, + 32, 83, 104, 97, 100, 101, + 114, 32, 67, 111, 109, 112, + 105, 108, 101, 114, 32, 54, + 46, 51, 46, 57, 54, 48, + 48, 46, 49, 54, 51, 56, + 52, 0, 171, 171, 73, 83, 71, 78, 80, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 56, 0, 0, 0, @@ -1524,7 +1292,7 @@ const BYTE RGBAShaderPremul[] = 83, 86, 95, 84, 97, 114, 103, 101, 116, 0, 171, 171 }; -ShaderBytes sRGBAShaderPremul = { RGBAShaderPremul, sizeof(RGBAShaderPremul) }; +ShaderBytes sRGBAShader = { RGBAShader, sizeof(RGBAShader) }; #if 0 // // Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 @@ -1537,12 +1305,14 @@ ShaderBytes sRGBAShaderPremul = { RGBAShaderPremul, sizeof(RGBAShaderPremul) }; // // float4 fLayerColor; // Offset: 0 Size: 16 [unused] // float fLayerOpacity; // Offset: 16 Size: 4 -// float4x4 mLayerTransform; // Offset: 32 Size: 64 [unused] -// float4x4 mProjection; // Offset: 96 Size: 64 [unused] -// float4 vRenderTargetOffset; // Offset: 160 Size: 16 [unused] -// float4 vTextureCoords; // Offset: 176 Size: 16 [unused] -// float4 vLayerQuad; // Offset: 192 Size: 16 [unused] -// float4 vMaskQuad; // Offset: 208 Size: 16 [unused] +// uint4 iBlendConfig; // Offset: 32 Size: 16 [unused] +// float4x4 mLayerTransform; // Offset: 48 Size: 64 [unused] +// float4x4 mProjection; // Offset: 112 Size: 64 [unused] +// float4 vRenderTargetOffset; // Offset: 176 Size: 16 [unused] +// float4 vTextureCoords; // Offset: 192 Size: 16 [unused] +// float4 vLayerQuad; // Offset: 208 Size: 16 [unused] +// float4 vMaskQuad; // Offset: 224 Size: 16 [unused] +// float4x4 mBackdropTransform; // Offset: 240 Size: 64 [unused] // // } // @@ -1553,7 +1323,7 @@ ShaderBytes sRGBAShaderPremul = { RGBAShaderPremul, sizeof(RGBAShaderPremul) }; // ------------------------------ ---------- ------- ----------- ---- -------- // sSampler sampler NA NA 0 1 // tRGB texture float4 2d 0 1 -// tRGBWhite texture float4 2d 1 1 +// tRGBWhite texture float4 2d 4 1 // $Globals cbuffer NA NA 0 1 // // @@ -1586,7 +1356,7 @@ ShaderBytes sRGBAShaderPremul = { RGBAShaderPremul, sizeof(RGBAShaderPremul) }; // Target Sampler Source Sampler Source Resource // -------------- --------------- ---------------- // s0 s0 t0 -// s1 s0 t1 +// s1 s0 t4 // // // Level9 shader bytecode: @@ -1611,12 +1381,12 @@ ps_4_0 dcl_constantbuffer cb0[2], immediateIndexed dcl_sampler s0, mode_default dcl_resource_texture2d (float,float,float,float) t0 -dcl_resource_texture2d (float,float,float,float) t1 +dcl_resource_texture2d (float,float,float,float) t4 dcl_input_ps linear v1.xy dcl_output o0.xyzw dcl_output o1.xyzw dcl_temps 2 -sample r0.xyzw, v1.xyxx, t1.xyzw, s0 +sample r0.xyzw, v1.xyxx, t4.xyzw, s0 sample r1.xyzw, v1.xyxx, t0.xyzw, s0 add r0.xyzw, -r0.xyzw, r1.xyzw add r0.xyzw, r0.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000) @@ -1629,15 +1399,15 @@ ret const BYTE ComponentAlphaShader[] = { - 68, 88, 66, 67, 186, 162, - 72, 42, 69, 36, 160, 68, - 108, 121, 216, 238, 108, 37, - 6, 145, 1, 0, 0, 0, - 68, 6, 0, 0, 6, 0, + 68, 88, 66, 67, 70, 65, + 219, 11, 235, 82, 64, 151, + 37, 101, 86, 144, 19, 4, + 125, 155, 1, 0, 0, 0, + 168, 6, 0, 0, 6, 0, 0, 0, 56, 0, 0, 0, 64, 1, 0, 0, 160, 2, 0, 0, 28, 3, 0, 0, - 160, 5, 0, 0, 248, 5, + 4, 6, 0, 0, 92, 6, 0, 0, 65, 111, 110, 57, 0, 1, 0, 0, 0, 1, 0, 0, 0, 2, 255, 255, @@ -1646,7 +1416,7 @@ const BYTE ComponentAlphaShader[] = 0, 0, 56, 0, 0, 0, 56, 0, 2, 0, 36, 0, 0, 0, 56, 0, 0, 0, - 0, 0, 1, 0, 1, 0, + 0, 0, 4, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 2, 255, 255, 81, 0, @@ -1693,7 +1463,7 @@ const BYTE ComponentAlphaShader[] = 0, 4, 0, 112, 16, 0, 0, 0, 0, 0, 85, 85, 0, 0, 88, 24, 0, 4, - 0, 112, 16, 0, 1, 0, + 0, 112, 16, 0, 4, 0, 0, 0, 85, 85, 0, 0, 98, 16, 0, 3, 50, 16, 16, 0, 1, 0, 0, 0, @@ -1706,7 +1476,7 @@ const BYTE ComponentAlphaShader[] = 242, 0, 16, 0, 0, 0, 0, 0, 70, 16, 16, 0, 1, 0, 0, 0, 70, 126, - 16, 0, 1, 0, 0, 0, + 16, 0, 4, 0, 0, 0, 0, 96, 16, 0, 0, 0, 0, 0, 69, 0, 0, 9, 242, 0, 16, 0, 1, 0, @@ -1762,12 +1532,12 @@ const BYTE ComponentAlphaShader[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 68, - 69, 70, 124, 2, 0, 0, + 69, 70, 224, 2, 0, 0, 1, 0, 0, 0, 192, 0, 0, 0, 4, 0, 0, 0, 28, 0, 0, 0, 0, 4, 255, 255, 0, 1, 0, 0, - 73, 2, 0, 0, 156, 0, + 172, 2, 0, 0, 156, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1777,13 +1547,13 @@ const BYTE ComponentAlphaShader[] = 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, - 1, 0, 0, 0, 12, 0, + 1, 0, 0, 0, 13, 0, 0, 0, 170, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, - 255, 255, 255, 255, 1, 0, + 255, 255, 255, 255, 4, 0, 0, 0, 1, 0, 0, 0, - 12, 0, 0, 0, 180, 0, + 13, 0, 0, 0, 180, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -1795,41 +1565,49 @@ const BYTE ComponentAlphaShader[] = 87, 104, 105, 116, 101, 0, 36, 71, 108, 111, 98, 97, 108, 115, 0, 171, 171, 171, - 180, 0, 0, 0, 8, 0, + 180, 0, 0, 0, 10, 0, 0, 0, 216, 0, 0, 0, - 224, 0, 0, 0, 0, 0, + 48, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 152, 1, 0, 0, 0, 0, + 200, 1, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 164, 1, + 0, 0, 0, 0, 212, 1, 0, 0, 0, 0, 0, 0, - 180, 1, 0, 0, 16, 0, + 228, 1, 0, 0, 16, 0, 0, 0, 4, 0, 0, 0, - 2, 0, 0, 0, 196, 1, + 2, 0, 0, 0, 244, 1, 0, 0, 0, 0, 0, 0, - 212, 1, 0, 0, 32, 0, + 4, 2, 0, 0, 32, 0, + 0, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 20, 2, + 0, 0, 0, 0, 0, 0, + 36, 2, 0, 0, 48, 0, 0, 0, 64, 0, 0, 0, - 0, 0, 0, 0, 228, 1, + 0, 0, 0, 0, 52, 2, 0, 0, 0, 0, 0, 0, - 244, 1, 0, 0, 96, 0, + 68, 2, 0, 0, 112, 0, 0, 0, 64, 0, 0, 0, - 0, 0, 0, 0, 228, 1, + 0, 0, 0, 0, 52, 2, 0, 0, 0, 0, 0, 0, - 0, 2, 0, 0, 160, 0, + 80, 2, 0, 0, 176, 0, 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 164, 1, + 0, 0, 0, 0, 212, 1, 0, 0, 0, 0, 0, 0, - 20, 2, 0, 0, 176, 0, + 100, 2, 0, 0, 192, 0, 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 36, 2, + 0, 0, 0, 0, 116, 2, 0, 0, 0, 0, 0, 0, - 52, 2, 0, 0, 192, 0, + 132, 2, 0, 0, 208, 0, 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 36, 2, + 0, 0, 0, 0, 116, 2, 0, 0, 0, 0, 0, 0, - 63, 2, 0, 0, 208, 0, + 143, 2, 0, 0, 224, 0, 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 36, 2, + 0, 0, 0, 0, 116, 2, + 0, 0, 0, 0, 0, 0, + 153, 2, 0, 0, 240, 0, + 0, 0, 64, 0, 0, 0, + 0, 0, 0, 0, 52, 2, 0, 0, 0, 0, 0, 0, 102, 76, 97, 121, 101, 114, 67, 111, 108, 111, 114, 0, @@ -1841,62 +1619,70 @@ const BYTE ComponentAlphaShader[] = 171, 171, 0, 0, 3, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 109, 76, 97, 121, 101, 114, - 84, 114, 97, 110, 115, 102, - 111, 114, 109, 0, 3, 0, - 3, 0, 4, 0, 4, 0, + 105, 66, 108, 101, 110, 100, + 67, 111, 110, 102, 105, 103, + 0, 171, 171, 171, 1, 0, + 19, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 109, 80, 114, 111, - 106, 101, 99, 116, 105, 111, - 110, 0, 118, 82, 101, 110, - 100, 101, 114, 84, 97, 114, - 103, 101, 116, 79, 102, 102, - 115, 101, 116, 0, 118, 84, - 101, 120, 116, 117, 114, 101, - 67, 111, 111, 114, 100, 115, - 0, 171, 1, 0, 3, 0, - 1, 0, 4, 0, 0, 0, + 0, 0, 109, 76, 97, 121, + 101, 114, 84, 114, 97, 110, + 115, 102, 111, 114, 109, 0, + 3, 0, 3, 0, 4, 0, + 4, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 109, 80, + 114, 111, 106, 101, 99, 116, + 105, 111, 110, 0, 118, 82, + 101, 110, 100, 101, 114, 84, + 97, 114, 103, 101, 116, 79, + 102, 102, 115, 101, 116, 0, + 118, 84, 101, 120, 116, 117, + 114, 101, 67, 111, 111, 114, + 100, 115, 0, 171, 1, 0, + 3, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, - 118, 76, 97, 121, 101, 114, - 81, 117, 97, 100, 0, 118, - 77, 97, 115, 107, 81, 117, - 97, 100, 0, 77, 105, 99, - 114, 111, 115, 111, 102, 116, - 32, 40, 82, 41, 32, 72, - 76, 83, 76, 32, 83, 104, - 97, 100, 101, 114, 32, 67, - 111, 109, 112, 105, 108, 101, - 114, 32, 54, 46, 51, 46, - 57, 54, 48, 48, 46, 49, - 54, 51, 56, 52, 0, 171, - 73, 83, 71, 78, 80, 0, - 0, 0, 2, 0, 0, 0, - 8, 0, 0, 0, 56, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 3, 0, - 0, 0, 0, 0, 0, 0, - 15, 0, 0, 0, 68, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 3, 0, - 0, 0, 1, 0, 0, 0, - 3, 3, 0, 0, 83, 86, - 95, 80, 111, 115, 105, 116, - 105, 111, 110, 0, 84, 69, - 88, 67, 79, 79, 82, 68, - 0, 171, 171, 171, 79, 83, - 71, 78, 68, 0, 0, 0, + 0, 0, 118, 76, 97, 121, + 101, 114, 81, 117, 97, 100, + 0, 118, 77, 97, 115, 107, + 81, 117, 97, 100, 0, 109, + 66, 97, 99, 107, 100, 114, + 111, 112, 84, 114, 97, 110, + 115, 102, 111, 114, 109, 0, + 77, 105, 99, 114, 111, 115, + 111, 102, 116, 32, 40, 82, + 41, 32, 72, 76, 83, 76, + 32, 83, 104, 97, 100, 101, + 114, 32, 67, 111, 109, 112, + 105, 108, 101, 114, 32, 54, + 46, 51, 46, 57, 54, 48, + 48, 46, 49, 54, 51, 56, + 52, 0, 171, 171, 73, 83, + 71, 78, 80, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 56, 0, 0, 0, - 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 0, - 0, 0, 56, 0, 0, 0, - 1, 0, 0, 0, 0, 0, + 0, 0, 68, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, - 1, 0, 0, 0, 15, 0, - 0, 0, 83, 86, 95, 84, - 97, 114, 103, 101, 116, 0, - 171, 171 + 1, 0, 0, 0, 3, 3, + 0, 0, 83, 86, 95, 80, + 111, 115, 105, 116, 105, 111, + 110, 0, 84, 69, 88, 67, + 79, 79, 82, 68, 0, 171, + 171, 171, 79, 83, 71, 78, + 68, 0, 0, 0, 2, 0, + 0, 0, 8, 0, 0, 0, + 56, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 15, 0, 0, 0, + 56, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 1, 0, + 0, 0, 15, 0, 0, 0, + 83, 86, 95, 84, 97, 114, + 103, 101, 116, 0, 171, 171 }; ShaderBytes sComponentAlphaShader = { ComponentAlphaShader, sizeof(ComponentAlphaShader) }; #if 0 @@ -1911,12 +1697,14 @@ ShaderBytes sComponentAlphaShader = { ComponentAlphaShader, sizeof(ComponentAlph // // float4 fLayerColor; // Offset: 0 Size: 16 [unused] // float fLayerOpacity; // Offset: 16 Size: 4 -// float4x4 mLayerTransform; // Offset: 32 Size: 64 [unused] -// float4x4 mProjection; // Offset: 96 Size: 64 [unused] -// float4 vRenderTargetOffset; // Offset: 160 Size: 16 [unused] -// float4 vTextureCoords; // Offset: 176 Size: 16 [unused] -// float4 vLayerQuad; // Offset: 192 Size: 16 [unused] -// float4 vMaskQuad; // Offset: 208 Size: 16 [unused] +// uint4 iBlendConfig; // Offset: 32 Size: 16 [unused] +// float4x4 mLayerTransform; // Offset: 48 Size: 64 [unused] +// float4x4 mProjection; // Offset: 112 Size: 64 [unused] +// float4 vRenderTargetOffset; // Offset: 176 Size: 16 [unused] +// float4 vTextureCoords; // Offset: 192 Size: 16 [unused] +// float4 vLayerQuad; // Offset: 208 Size: 16 [unused] +// float4 vMaskQuad; // Offset: 224 Size: 16 [unused] +// float4x4 mBackdropTransform; // Offset: 240 Size: 64 [unused] // // } // @@ -1926,9 +1714,9 @@ ShaderBytes sComponentAlphaShader = { ComponentAlphaShader, sizeof(ComponentAlph // Name Type Format Dim Slot Elements // ------------------------------ ---------- ------- ----------- ---- -------- // sSampler sampler NA NA 0 1 -// tY texture float4 2d 0 1 -// tCb texture float4 2d 1 1 -// tCr texture float4 2d 2 1 +// tY texture float4 2d 1 1 +// tCb texture float4 2d 2 1 +// tCr texture float4 2d 3 1 // $Globals cbuffer NA NA 0 1 // // @@ -1959,9 +1747,9 @@ ShaderBytes sComponentAlphaShader = { ComponentAlphaShader, sizeof(ComponentAlph // // Target Sampler Source Sampler Source Resource // -------------- --------------- ---------------- -// s0 s0 t0 -// s1 s0 t1 -// s2 s0 t2 +// s0 s0 t1 +// s1 s0 t2 +// s2 s0 t3 // // // Level9 shader bytecode: @@ -1993,20 +1781,20 @@ ShaderBytes sComponentAlphaShader = { ComponentAlphaShader, sizeof(ComponentAlph ps_4_0 dcl_constantbuffer cb0[2], immediateIndexed dcl_sampler s0, mode_default -dcl_resource_texture2d (float,float,float,float) t0 dcl_resource_texture2d (float,float,float,float) t1 dcl_resource_texture2d (float,float,float,float) t2 +dcl_resource_texture2d (float,float,float,float) t3 dcl_input_ps linear v1.xy dcl_output o0.xyzw dcl_temps 3 -sample r0.xyzw, v1.xyxx, t2.xyzw, s0 +sample r0.xyzw, v1.xyxx, t3.xyzw, s0 add r0.x, r0.x, l(-0.501960) mul r0.xy, r0.xxxx, l(1.596030, 0.812970, 0.000000, 0.000000) -sample r1.xyzw, v1.xyxx, t0.xyzw, s0 +sample r1.xyzw, v1.xyxx, t1.xyzw, s0 add r0.z, r1.x, l(-0.062750) mad r0.y, r0.z, l(1.164380), -r0.y mad r1.x, r0.z, l(1.164380), r0.x -sample r2.xyzw, v1.xyxx, t1.xyzw, s0 +sample r2.xyzw, v1.xyxx, t2.xyzw, s0 add r0.x, r2.x, l(-0.501960) mad r1.y, -r0.x, l(0.391760), r0.y mul r0.x, r0.x, l(2.017230) @@ -2019,15 +1807,15 @@ ret const BYTE YCbCrShader[] = { - 68, 88, 66, 67, 127, 202, - 65, 67, 171, 51, 222, 111, - 252, 139, 60, 115, 30, 112, - 240, 10, 1, 0, 0, 0, - 212, 7, 0, 0, 6, 0, + 68, 88, 66, 67, 17, 182, + 131, 145, 148, 37, 135, 136, + 214, 75, 157, 57, 87, 83, + 119, 226, 1, 0, 0, 0, + 56, 8, 0, 0, 6, 0, 0, 0, 56, 0, 0, 0, 220, 1, 0, 0, 44, 4, 0, 0, 168, 4, 0, 0, - 72, 7, 0, 0, 160, 7, + 172, 7, 0, 0, 4, 8, 0, 0, 65, 111, 110, 57, 156, 1, 0, 0, 156, 1, 0, 0, 0, 2, 255, 255, @@ -2035,9 +1823,9 @@ const BYTE YCbCrShader[] = 0, 0, 1, 0, 48, 0, 0, 0, 60, 0, 0, 0, 60, 0, 3, 0, 36, 0, - 0, 0, 60, 0, 0, 0, - 0, 0, 1, 0, 1, 0, - 2, 0, 2, 0, 0, 0, + 0, 0, 60, 0, 1, 0, + 0, 0, 2, 0, 1, 0, + 3, 0, 2, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 2, 255, 255, 81, 0, 0, 5, @@ -2107,12 +1895,12 @@ const BYTE YCbCrShader[] = 0, 3, 0, 96, 16, 0, 0, 0, 0, 0, 88, 24, 0, 4, 0, 112, 16, 0, - 0, 0, 0, 0, 85, 85, + 1, 0, 0, 0, 85, 85, 0, 0, 88, 24, 0, 4, - 0, 112, 16, 0, 1, 0, + 0, 112, 16, 0, 2, 0, 0, 0, 85, 85, 0, 0, 88, 24, 0, 4, 0, 112, - 16, 0, 2, 0, 0, 0, + 16, 0, 3, 0, 0, 0, 85, 85, 0, 0, 98, 16, 0, 3, 50, 16, 16, 0, 1, 0, 0, 0, 101, 0, @@ -2123,7 +1911,7 @@ const BYTE YCbCrShader[] = 16, 0, 0, 0, 0, 0, 70, 16, 16, 0, 1, 0, 0, 0, 70, 126, 16, 0, - 2, 0, 0, 0, 0, 96, + 3, 0, 0, 0, 0, 96, 16, 0, 0, 0, 0, 0, 0, 0, 0, 7, 18, 0, 16, 0, 0, 0, 0, 0, @@ -2140,7 +1928,7 @@ const BYTE YCbCrShader[] = 242, 0, 16, 0, 1, 0, 0, 0, 70, 16, 16, 0, 1, 0, 0, 0, 70, 126, - 16, 0, 0, 0, 0, 0, + 16, 0, 1, 0, 0, 0, 0, 96, 16, 0, 0, 0, 0, 0, 0, 0, 0, 7, 66, 0, 16, 0, 0, 0, @@ -2163,7 +1951,7 @@ const BYTE YCbCrShader[] = 0, 9, 242, 0, 16, 0, 2, 0, 0, 0, 70, 16, 16, 0, 1, 0, 0, 0, - 70, 126, 16, 0, 1, 0, + 70, 126, 16, 0, 2, 0, 0, 0, 0, 96, 16, 0, 0, 0, 0, 0, 0, 0, 0, 7, 18, 0, 16, 0, @@ -2218,12 +2006,12 @@ const BYTE YCbCrShader[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 68, - 69, 70, 152, 2, 0, 0, + 69, 70, 252, 2, 0, 0, 1, 0, 0, 0, 220, 0, 0, 0, 5, 0, 0, 0, 28, 0, 0, 0, 0, 4, 255, 255, 0, 1, 0, 0, - 101, 2, 0, 0, 188, 0, + 200, 2, 0, 0, 188, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -2232,19 +2020,19 @@ const BYTE YCbCrShader[] = 197, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, 255, 255, - 255, 255, 0, 0, 0, 0, - 1, 0, 0, 0, 12, 0, + 255, 255, 1, 0, 0, 0, + 1, 0, 0, 0, 13, 0, 0, 0, 200, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, - 255, 255, 255, 255, 1, 0, + 255, 255, 255, 255, 2, 0, 0, 0, 1, 0, 0, 0, - 12, 0, 0, 0, 204, 0, + 13, 0, 0, 0, 204, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, 255, 255, 255, 255, - 2, 0, 0, 0, 1, 0, - 0, 0, 12, 0, 0, 0, + 3, 0, 0, 0, 1, 0, + 0, 0, 13, 0, 0, 0, 208, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -2256,41 +2044,49 @@ const BYTE YCbCrShader[] = 116, 67, 114, 0, 36, 71, 108, 111, 98, 97, 108, 115, 0, 171, 171, 171, 208, 0, - 0, 0, 8, 0, 0, 0, - 244, 0, 0, 0, 224, 0, + 0, 0, 10, 0, 0, 0, + 244, 0, 0, 0, 48, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 180, 1, + 0, 0, 0, 0, 228, 1, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, - 0, 0, 192, 1, 0, 0, - 0, 0, 0, 0, 208, 1, + 0, 0, 240, 1, 0, 0, + 0, 0, 0, 0, 0, 2, 0, 0, 16, 0, 0, 0, 4, 0, 0, 0, 2, 0, - 0, 0, 224, 1, 0, 0, - 0, 0, 0, 0, 240, 1, + 0, 0, 16, 2, 0, 0, + 0, 0, 0, 0, 32, 2, 0, 0, 32, 0, 0, 0, - 64, 0, 0, 0, 0, 0, - 0, 0, 0, 2, 0, 0, - 0, 0, 0, 0, 16, 2, - 0, 0, 96, 0, 0, 0, - 64, 0, 0, 0, 0, 0, - 0, 0, 0, 2, 0, 0, - 0, 0, 0, 0, 28, 2, - 0, 0, 160, 0, 0, 0, 16, 0, 0, 0, 0, 0, - 0, 0, 192, 1, 0, 0, - 0, 0, 0, 0, 48, 2, + 0, 0, 48, 2, 0, 0, + 0, 0, 0, 0, 64, 2, + 0, 0, 48, 0, 0, 0, + 64, 0, 0, 0, 0, 0, + 0, 0, 80, 2, 0, 0, + 0, 0, 0, 0, 96, 2, + 0, 0, 112, 0, 0, 0, + 64, 0, 0, 0, 0, 0, + 0, 0, 80, 2, 0, 0, + 0, 0, 0, 0, 108, 2, 0, 0, 176, 0, 0, 0, 16, 0, 0, 0, 0, 0, - 0, 0, 64, 2, 0, 0, - 0, 0, 0, 0, 80, 2, + 0, 0, 240, 1, 0, 0, + 0, 0, 0, 0, 128, 2, 0, 0, 192, 0, 0, 0, 16, 0, 0, 0, 0, 0, - 0, 0, 64, 2, 0, 0, - 0, 0, 0, 0, 91, 2, + 0, 0, 144, 2, 0, 0, + 0, 0, 0, 0, 160, 2, 0, 0, 208, 0, 0, 0, 16, 0, 0, 0, 0, 0, - 0, 0, 64, 2, 0, 0, + 0, 0, 144, 2, 0, 0, + 0, 0, 0, 0, 171, 2, + 0, 0, 224, 0, 0, 0, + 16, 0, 0, 0, 0, 0, + 0, 0, 144, 2, 0, 0, + 0, 0, 0, 0, 181, 2, + 0, 0, 240, 0, 0, 0, + 64, 0, 0, 0, 0, 0, + 0, 0, 80, 2, 0, 0, 0, 0, 0, 0, 102, 76, 97, 121, 101, 114, 67, 111, 108, 111, 114, 0, 1, 0, @@ -2301,58 +2097,67 @@ const BYTE YCbCrShader[] = 105, 116, 121, 0, 171, 171, 0, 0, 3, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 109, 76, - 97, 121, 101, 114, 84, 114, - 97, 110, 115, 102, 111, 114, - 109, 0, 3, 0, 3, 0, - 4, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 105, 66, + 108, 101, 110, 100, 67, 111, + 110, 102, 105, 103, 0, 171, + 171, 171, 1, 0, 19, 0, + 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 109, 80, 114, 111, 106, 101, - 99, 116, 105, 111, 110, 0, - 118, 82, 101, 110, 100, 101, - 114, 84, 97, 114, 103, 101, - 116, 79, 102, 102, 115, 101, - 116, 0, 118, 84, 101, 120, - 116, 117, 114, 101, 67, 111, - 111, 114, 100, 115, 0, 171, - 1, 0, 3, 0, 1, 0, - 4, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 118, 76, - 97, 121, 101, 114, 81, 117, - 97, 100, 0, 118, 77, 97, - 115, 107, 81, 117, 97, 100, - 0, 77, 105, 99, 114, 111, - 115, 111, 102, 116, 32, 40, - 82, 41, 32, 72, 76, 83, - 76, 32, 83, 104, 97, 100, - 101, 114, 32, 67, 111, 109, - 112, 105, 108, 101, 114, 32, - 54, 46, 51, 46, 57, 54, - 48, 48, 46, 49, 54, 51, - 56, 52, 0, 171, 73, 83, - 71, 78, 80, 0, 0, 0, - 2, 0, 0, 0, 8, 0, - 0, 0, 56, 0, 0, 0, - 0, 0, 0, 0, 1, 0, - 0, 0, 3, 0, 0, 0, - 0, 0, 0, 0, 15, 0, - 0, 0, 68, 0, 0, 0, + 109, 76, 97, 121, 101, 114, + 84, 114, 97, 110, 115, 102, + 111, 114, 109, 0, 3, 0, + 3, 0, 4, 0, 4, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, - 1, 0, 0, 0, 3, 3, - 0, 0, 83, 86, 95, 80, - 111, 115, 105, 116, 105, 111, - 110, 0, 84, 69, 88, 67, - 79, 79, 82, 68, 0, 171, - 171, 171, 79, 83, 71, 78, - 44, 0, 0, 0, 1, 0, + 0, 0, 109, 80, 114, 111, + 106, 101, 99, 116, 105, 111, + 110, 0, 118, 82, 101, 110, + 100, 101, 114, 84, 97, 114, + 103, 101, 116, 79, 102, 102, + 115, 101, 116, 0, 118, 84, + 101, 120, 116, 117, 114, 101, + 67, 111, 111, 114, 100, 115, + 0, 171, 1, 0, 3, 0, + 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 118, 76, 97, 121, 101, 114, + 81, 117, 97, 100, 0, 118, + 77, 97, 115, 107, 81, 117, + 97, 100, 0, 109, 66, 97, + 99, 107, 100, 114, 111, 112, + 84, 114, 97, 110, 115, 102, + 111, 114, 109, 0, 77, 105, + 99, 114, 111, 115, 111, 102, + 116, 32, 40, 82, 41, 32, + 72, 76, 83, 76, 32, 83, + 104, 97, 100, 101, 114, 32, + 67, 111, 109, 112, 105, 108, + 101, 114, 32, 54, 46, 51, + 46, 57, 54, 48, 48, 46, + 49, 54, 51, 56, 52, 0, + 171, 171, 73, 83, 71, 78, + 80, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, - 32, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, + 56, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, - 83, 86, 95, 84, 97, 114, - 103, 101, 116, 0, 171, 171 + 68, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 1, 0, + 0, 0, 3, 3, 0, 0, + 83, 86, 95, 80, 111, 115, + 105, 116, 105, 111, 110, 0, + 84, 69, 88, 67, 79, 79, + 82, 68, 0, 171, 171, 171, + 79, 83, 71, 78, 44, 0, + 0, 0, 1, 0, 0, 0, + 8, 0, 0, 0, 32, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 83, 86, + 95, 84, 97, 114, 103, 101, + 116, 0, 171, 171 }; ShaderBytes sYCbCrShader = { YCbCrShader, sizeof(YCbCrShader) }; #if 0 @@ -2371,8 +2176,10 @@ ShaderBytes sYCbCrShader = { YCbCrShader, sizeof(YCbCrShader) }; // float4 vTextureCoords; // Offset: 144 Size: 16 // float4 vLayerQuad; // Offset: 160 Size: 16 // float4 vMaskQuad; // Offset: 176 Size: 16 -// float4 fLayerColor; // Offset: 192 Size: 16 [unused] -// float fLayerOpacity; // Offset: 208 Size: 4 [unused] +// float4x4 mBackdropTransform; // Offset: 192 Size: 64 [unused] +// float4 fLayerColor; // Offset: 256 Size: 16 [unused] +// float fLayerOpacity; // Offset: 272 Size: 4 [unused] +// uint4 iBlendConfig; // Offset: 288 Size: 16 [unused] // // } // @@ -2470,15 +2277,15 @@ ret const BYTE LayerQuadMaskVS[] = { - 68, 88, 66, 67, 223, 251, - 10, 17, 13, 90, 47, 25, - 119, 198, 20, 157, 124, 193, - 251, 234, 1, 0, 0, 0, - 120, 7, 0, 0, 6, 0, + 68, 88, 66, 67, 117, 253, + 188, 162, 139, 208, 50, 178, + 49, 2, 251, 153, 144, 237, + 178, 212, 1, 0, 0, 0, + 220, 7, 0, 0, 6, 0, 0, 0, 56, 0, 0, 0, 224, 1, 0, 0, 76, 4, 0, 0, 200, 4, 0, 0, - 212, 6, 0, 0, 8, 7, + 56, 7, 0, 0, 108, 7, 0, 0, 65, 111, 110, 57, 160, 1, 0, 0, 160, 1, 0, 0, 0, 2, 254, 255, @@ -2674,12 +2481,12 @@ const BYTE LayerQuadMaskVS[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 82, 68, 69, 70, 4, 2, + 82, 68, 69, 70, 104, 2, 0, 0, 1, 0, 0, 0, 72, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0, 0, 4, 254, 255, 0, 1, - 0, 0, 208, 1, 0, 0, + 0, 0, 52, 2, 0, 0, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -2688,41 +2495,49 @@ const BYTE LayerQuadMaskVS[] = 0, 0, 36, 71, 108, 111, 98, 97, 108, 115, 0, 171, 171, 171, 60, 0, 0, 0, - 8, 0, 0, 0, 96, 0, - 0, 0, 224, 0, 0, 0, + 10, 0, 0, 0, 96, 0, + 0, 0, 48, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 32, 1, 0, 0, + 0, 0, 80, 1, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 2, 0, 0, 0, - 48, 1, 0, 0, 0, 0, - 0, 0, 64, 1, 0, 0, - 64, 0, 0, 0, 64, 0, - 0, 0, 2, 0, 0, 0, - 48, 1, 0, 0, 0, 0, - 0, 0, 76, 1, 0, 0, - 128, 0, 0, 0, 16, 0, - 0, 0, 2, 0, 0, 0, 96, 1, 0, 0, 0, 0, 0, 0, 112, 1, 0, 0, + 64, 0, 0, 0, 64, 0, + 0, 0, 2, 0, 0, 0, + 96, 1, 0, 0, 0, 0, + 0, 0, 124, 1, 0, 0, + 128, 0, 0, 0, 16, 0, + 0, 0, 2, 0, 0, 0, + 144, 1, 0, 0, 0, 0, + 0, 0, 160, 1, 0, 0, 144, 0, 0, 0, 16, 0, 0, 0, 2, 0, 0, 0, - 128, 1, 0, 0, 0, 0, - 0, 0, 144, 1, 0, 0, + 176, 1, 0, 0, 0, 0, + 0, 0, 192, 1, 0, 0, 160, 0, 0, 0, 16, 0, 0, 0, 2, 0, 0, 0, - 128, 1, 0, 0, 0, 0, - 0, 0, 155, 1, 0, 0, + 176, 1, 0, 0, 0, 0, + 0, 0, 203, 1, 0, 0, 176, 0, 0, 0, 16, 0, 0, 0, 2, 0, 0, 0, - 128, 1, 0, 0, 0, 0, - 0, 0, 165, 1, 0, 0, - 192, 0, 0, 0, 16, 0, + 176, 1, 0, 0, 0, 0, + 0, 0, 213, 1, 0, 0, + 192, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 96, 1, 0, 0, 0, 0, - 0, 0, 177, 1, 0, 0, - 208, 0, 0, 0, 4, 0, + 0, 0, 232, 1, 0, 0, + 0, 1, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, - 192, 1, 0, 0, 0, 0, + 144, 1, 0, 0, 0, 0, + 0, 0, 244, 1, 0, 0, + 16, 1, 0, 0, 4, 0, + 0, 0, 0, 0, 0, 0, + 4, 2, 0, 0, 0, 0, + 0, 0, 20, 2, 0, 0, + 32, 1, 0, 0, 16, 0, + 0, 0, 0, 0, 0, 0, + 36, 2, 0, 0, 0, 0, 0, 0, 109, 76, 97, 121, 101, 114, 84, 114, 97, 110, 115, 102, 111, 114, 109, 0, @@ -2745,50 +2560,59 @@ const BYTE LayerQuadMaskVS[] = 118, 76, 97, 121, 101, 114, 81, 117, 97, 100, 0, 118, 77, 97, 115, 107, 81, 117, - 97, 100, 0, 102, 76, 97, - 121, 101, 114, 67, 111, 108, - 111, 114, 0, 102, 76, 97, - 121, 101, 114, 79, 112, 97, - 99, 105, 116, 121, 0, 171, - 0, 0, 3, 0, 1, 0, - 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 77, 105, - 99, 114, 111, 115, 111, 102, - 116, 32, 40, 82, 41, 32, - 72, 76, 83, 76, 32, 83, - 104, 97, 100, 101, 114, 32, - 67, 111, 109, 112, 105, 108, - 101, 114, 32, 54, 46, 51, - 46, 57, 54, 48, 48, 46, - 49, 54, 51, 56, 52, 0, - 171, 171, 73, 83, 71, 78, - 44, 0, 0, 0, 1, 0, - 0, 0, 8, 0, 0, 0, - 32, 0, 0, 0, 0, 0, + 97, 100, 0, 109, 66, 97, + 99, 107, 100, 114, 111, 112, + 84, 114, 97, 110, 115, 102, + 111, 114, 109, 0, 102, 76, + 97, 121, 101, 114, 67, 111, + 108, 111, 114, 0, 102, 76, + 97, 121, 101, 114, 79, 112, + 97, 99, 105, 116, 121, 0, + 171, 171, 0, 0, 3, 0, + 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 0, 0, - 0, 0, 3, 3, 0, 0, - 80, 79, 83, 73, 84, 73, - 79, 78, 0, 171, 171, 171, - 79, 83, 71, 78, 104, 0, + 105, 66, 108, 101, 110, 100, + 67, 111, 110, 102, 105, 103, + 0, 171, 171, 171, 1, 0, + 19, 0, 1, 0, 4, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 77, 105, 99, 114, + 111, 115, 111, 102, 116, 32, + 40, 82, 41, 32, 72, 76, + 83, 76, 32, 83, 104, 97, + 100, 101, 114, 32, 67, 111, + 109, 112, 105, 108, 101, 114, + 32, 54, 46, 51, 46, 57, + 54, 48, 48, 46, 49, 54, + 51, 56, 52, 0, 171, 171, + 73, 83, 71, 78, 44, 0, + 0, 0, 1, 0, 0, 0, + 8, 0, 0, 0, 32, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 3, 3, 0, 0, 80, 79, + 83, 73, 84, 73, 79, 78, + 0, 171, 171, 171, 79, 83, + 71, 78, 104, 0, 0, 0, + 3, 0, 0, 0, 8, 0, + 0, 0, 80, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, - 8, 0, 0, 0, 80, 0, + 0, 0, 0, 0, 15, 0, + 0, 0, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 3, 0, - 0, 0, 0, 0, 0, 0, - 15, 0, 0, 0, 92, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 3, 0, - 0, 0, 1, 0, 0, 0, - 3, 12, 0, 0, 92, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 3, 0, - 0, 0, 1, 0, 0, 0, - 12, 3, 0, 0, 83, 86, - 95, 80, 111, 115, 105, 116, - 105, 111, 110, 0, 84, 69, - 88, 67, 79, 79, 82, 68, - 0, 171, 171, 171 + 0, 0, 3, 0, 0, 0, + 1, 0, 0, 0, 3, 12, + 0, 0, 92, 0, 0, 0, + 1, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 1, 0, 0, 0, 12, 3, + 0, 0, 83, 86, 95, 80, + 111, 115, 105, 116, 105, 111, + 110, 0, 84, 69, 88, 67, + 79, 79, 82, 68, 0, 171, + 171, 171 }; ShaderBytes sLayerQuadMaskVS = { LayerQuadMaskVS, sizeof(LayerQuadMaskVS) }; #if 0 @@ -2807,8 +2631,10 @@ ShaderBytes sLayerQuadMaskVS = { LayerQuadMaskVS, sizeof(LayerQuadMaskVS) }; // float4 vTextureCoords; // Offset: 144 Size: 16 // float4 vLayerQuad; // Offset: 160 Size: 16 // float4 vMaskQuad; // Offset: 176 Size: 16 -// float4 fLayerColor; // Offset: 192 Size: 16 [unused] -// float fLayerOpacity; // Offset: 208 Size: 4 [unused] +// float4x4 mBackdropTransform; // Offset: 192 Size: 64 [unused] +// float4 fLayerColor; // Offset: 256 Size: 16 [unused] +// float fLayerOpacity; // Offset: 272 Size: 4 [unused] +// uint4 iBlendConfig; // Offset: 288 Size: 16 [unused] // // } // @@ -2910,15 +2736,15 @@ ret const BYTE LayerQuadMask3DVS[] = { - 68, 88, 66, 67, 151, 141, - 11, 11, 111, 244, 17, 242, - 119, 116, 248, 53, 235, 192, - 38, 193, 1, 0, 0, 0, - 204, 7, 0, 0, 6, 0, + 68, 88, 66, 67, 124, 99, + 104, 27, 0, 223, 159, 8, + 231, 86, 180, 224, 50, 178, + 27, 163, 1, 0, 0, 0, + 48, 8, 0, 0, 6, 0, 0, 0, 56, 0, 0, 0, 24, 2, 0, 0, 160, 4, 0, 0, 28, 5, 0, 0, - 40, 7, 0, 0, 92, 7, + 140, 7, 0, 0, 192, 7, 0, 0, 65, 111, 110, 57, 216, 1, 0, 0, 216, 1, 0, 0, 0, 2, 254, 255, @@ -3128,12 +2954,12 @@ const BYTE LayerQuadMask3DVS[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 82, 68, 69, 70, 4, 2, + 82, 68, 69, 70, 104, 2, 0, 0, 1, 0, 0, 0, 72, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0, 0, 4, 254, 255, 0, 1, - 0, 0, 208, 1, 0, 0, + 0, 0, 52, 2, 0, 0, 60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -3142,41 +2968,49 @@ const BYTE LayerQuadMask3DVS[] = 0, 0, 36, 71, 108, 111, 98, 97, 108, 115, 0, 171, 171, 171, 60, 0, 0, 0, - 8, 0, 0, 0, 96, 0, - 0, 0, 224, 0, 0, 0, + 10, 0, 0, 0, 96, 0, + 0, 0, 48, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 32, 1, 0, 0, + 0, 0, 80, 1, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 2, 0, 0, 0, - 48, 1, 0, 0, 0, 0, - 0, 0, 64, 1, 0, 0, - 64, 0, 0, 0, 64, 0, - 0, 0, 2, 0, 0, 0, - 48, 1, 0, 0, 0, 0, - 0, 0, 76, 1, 0, 0, - 128, 0, 0, 0, 16, 0, - 0, 0, 2, 0, 0, 0, 96, 1, 0, 0, 0, 0, 0, 0, 112, 1, 0, 0, + 64, 0, 0, 0, 64, 0, + 0, 0, 2, 0, 0, 0, + 96, 1, 0, 0, 0, 0, + 0, 0, 124, 1, 0, 0, + 128, 0, 0, 0, 16, 0, + 0, 0, 2, 0, 0, 0, + 144, 1, 0, 0, 0, 0, + 0, 0, 160, 1, 0, 0, 144, 0, 0, 0, 16, 0, 0, 0, 2, 0, 0, 0, - 128, 1, 0, 0, 0, 0, - 0, 0, 144, 1, 0, 0, + 176, 1, 0, 0, 0, 0, + 0, 0, 192, 1, 0, 0, 160, 0, 0, 0, 16, 0, 0, 0, 2, 0, 0, 0, - 128, 1, 0, 0, 0, 0, - 0, 0, 155, 1, 0, 0, + 176, 1, 0, 0, 0, 0, + 0, 0, 203, 1, 0, 0, 176, 0, 0, 0, 16, 0, 0, 0, 2, 0, 0, 0, - 128, 1, 0, 0, 0, 0, - 0, 0, 165, 1, 0, 0, - 192, 0, 0, 0, 16, 0, + 176, 1, 0, 0, 0, 0, + 0, 0, 213, 1, 0, 0, + 192, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 96, 1, 0, 0, 0, 0, - 0, 0, 177, 1, 0, 0, - 208, 0, 0, 0, 4, 0, + 0, 0, 232, 1, 0, 0, + 0, 1, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, - 192, 1, 0, 0, 0, 0, + 144, 1, 0, 0, 0, 0, + 0, 0, 244, 1, 0, 0, + 16, 1, 0, 0, 4, 0, + 0, 0, 0, 0, 0, 0, + 4, 2, 0, 0, 0, 0, + 0, 0, 20, 2, 0, 0, + 32, 1, 0, 0, 16, 0, + 0, 0, 0, 0, 0, 0, + 36, 2, 0, 0, 0, 0, 0, 0, 109, 76, 97, 121, 101, 114, 84, 114, 97, 110, 115, 102, 111, 114, 109, 0, @@ -3199,50 +3033,59 @@ const BYTE LayerQuadMask3DVS[] = 118, 76, 97, 121, 101, 114, 81, 117, 97, 100, 0, 118, 77, 97, 115, 107, 81, 117, - 97, 100, 0, 102, 76, 97, - 121, 101, 114, 67, 111, 108, - 111, 114, 0, 102, 76, 97, - 121, 101, 114, 79, 112, 97, - 99, 105, 116, 121, 0, 171, - 0, 0, 3, 0, 1, 0, - 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 77, 105, - 99, 114, 111, 115, 111, 102, - 116, 32, 40, 82, 41, 32, - 72, 76, 83, 76, 32, 83, - 104, 97, 100, 101, 114, 32, - 67, 111, 109, 112, 105, 108, - 101, 114, 32, 54, 46, 51, - 46, 57, 54, 48, 48, 46, - 49, 54, 51, 56, 52, 0, - 171, 171, 73, 83, 71, 78, - 44, 0, 0, 0, 1, 0, - 0, 0, 8, 0, 0, 0, - 32, 0, 0, 0, 0, 0, + 97, 100, 0, 109, 66, 97, + 99, 107, 100, 114, 111, 112, + 84, 114, 97, 110, 115, 102, + 111, 114, 109, 0, 102, 76, + 97, 121, 101, 114, 67, 111, + 108, 111, 114, 0, 102, 76, + 97, 121, 101, 114, 79, 112, + 97, 99, 105, 116, 121, 0, + 171, 171, 0, 0, 3, 0, + 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 0, 0, - 0, 0, 3, 3, 0, 0, - 80, 79, 83, 73, 84, 73, - 79, 78, 0, 171, 171, 171, - 79, 83, 71, 78, 104, 0, + 105, 66, 108, 101, 110, 100, + 67, 111, 110, 102, 105, 103, + 0, 171, 171, 171, 1, 0, + 19, 0, 1, 0, 4, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 77, 105, 99, 114, + 111, 115, 111, 102, 116, 32, + 40, 82, 41, 32, 72, 76, + 83, 76, 32, 83, 104, 97, + 100, 101, 114, 32, 67, 111, + 109, 112, 105, 108, 101, 114, + 32, 54, 46, 51, 46, 57, + 54, 48, 48, 46, 49, 54, + 51, 56, 52, 0, 171, 171, + 73, 83, 71, 78, 44, 0, + 0, 0, 1, 0, 0, 0, + 8, 0, 0, 0, 32, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 3, 3, 0, 0, 80, 79, + 83, 73, 84, 73, 79, 78, + 0, 171, 171, 171, 79, 83, + 71, 78, 104, 0, 0, 0, + 3, 0, 0, 0, 8, 0, + 0, 0, 80, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, - 8, 0, 0, 0, 80, 0, + 0, 0, 0, 0, 15, 0, + 0, 0, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 3, 0, - 0, 0, 0, 0, 0, 0, - 15, 0, 0, 0, 92, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 3, 0, - 0, 0, 1, 0, 0, 0, - 3, 12, 0, 0, 92, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 3, 0, - 0, 0, 2, 0, 0, 0, - 7, 8, 0, 0, 83, 86, - 95, 80, 111, 115, 105, 116, - 105, 111, 110, 0, 84, 69, - 88, 67, 79, 79, 82, 68, - 0, 171, 171, 171 + 0, 0, 3, 0, 0, 0, + 1, 0, 0, 0, 3, 12, + 0, 0, 92, 0, 0, 0, + 1, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 2, 0, 0, 0, 7, 8, + 0, 0, 83, 86, 95, 80, + 111, 115, 105, 116, 105, 111, + 110, 0, 84, 69, 88, 67, + 79, 79, 82, 68, 0, 171, + 171, 171 }; ShaderBytes sLayerQuadMask3DVS = { LayerQuadMask3DVS, sizeof(LayerQuadMask3DVS) }; #if 0 @@ -3257,12 +3100,14 @@ ShaderBytes sLayerQuadMask3DVS = { LayerQuadMask3DVS, sizeof(LayerQuadMask3DVS) // // float4 fLayerColor; // Offset: 0 Size: 16 // float fLayerOpacity; // Offset: 16 Size: 4 [unused] -// float4x4 mLayerTransform; // Offset: 32 Size: 64 [unused] -// float4x4 mProjection; // Offset: 96 Size: 64 [unused] -// float4 vRenderTargetOffset; // Offset: 160 Size: 16 [unused] -// float4 vTextureCoords; // Offset: 176 Size: 16 [unused] -// float4 vLayerQuad; // Offset: 192 Size: 16 [unused] -// float4 vMaskQuad; // Offset: 208 Size: 16 [unused] +// uint4 iBlendConfig; // Offset: 32 Size: 16 [unused] +// float4x4 mLayerTransform; // Offset: 48 Size: 64 [unused] +// float4x4 mProjection; // Offset: 112 Size: 64 [unused] +// float4 vRenderTargetOffset; // Offset: 176 Size: 16 [unused] +// float4 vTextureCoords; // Offset: 192 Size: 16 [unused] +// float4 vLayerQuad; // Offset: 208 Size: 16 [unused] +// float4 vMaskQuad; // Offset: 224 Size: 16 [unused] +// float4x4 mBackdropTransform; // Offset: 240 Size: 64 [unused] // // } // @@ -3272,7 +3117,7 @@ ShaderBytes sLayerQuadMask3DVS = { LayerQuadMask3DVS, sizeof(LayerQuadMask3DVS) // Name Type Format Dim Slot Elements // ------------------------------ ---------- ------- ----------- ---- -------- // sSampler sampler NA NA 0 1 -// tMask texture float4 2d 3 1 +// tMask texture float4 2d 5 1 // $Globals cbuffer NA NA 0 1 // // @@ -3304,7 +3149,7 @@ ShaderBytes sLayerQuadMask3DVS = { LayerQuadMask3DVS, sizeof(LayerQuadMask3DVS) // // Target Sampler Source Sampler Source Resource // -------------- --------------- ---------------- -// s0 s0 t3 +// s0 s0 t5 // // // Level9 shader bytecode: @@ -3321,11 +3166,11 @@ ShaderBytes sLayerQuadMask3DVS = { LayerQuadMask3DVS, sizeof(LayerQuadMask3DVS) ps_4_0 dcl_constantbuffer cb0[1], immediateIndexed dcl_sampler s0, mode_default -dcl_resource_texture2d (float,float,float,float) t3 +dcl_resource_texture2d (float,float,float,float) t5 dcl_input_ps linear v1.zw dcl_output o0.xyzw dcl_temps 1 -sample r0.xyzw, v1.zwzz, t3.xyzw, s0 +sample r0.xyzw, v1.zwzz, t5.xyzw, s0 mul o0.xyzw, r0.xxxx, cb0[0].xyzw ret // Approximately 3 instruction slots used @@ -3333,15 +3178,15 @@ ret const BYTE SolidColorShaderMask[] = { - 68, 88, 66, 67, 189, 88, - 190, 169, 235, 115, 239, 219, - 181, 194, 113, 122, 250, 177, - 212, 243, 1, 0, 0, 0, - 232, 4, 0, 0, 6, 0, + 68, 88, 66, 67, 179, 163, + 177, 178, 96, 7, 246, 20, + 94, 198, 166, 18, 116, 245, + 163, 94, 1, 0, 0, 0, + 76, 5, 0, 0, 6, 0, 0, 0, 56, 0, 0, 0, 204, 0, 0, 0, 112, 1, 0, 0, 236, 1, 0, 0, - 68, 4, 0, 0, 180, 4, + 168, 4, 0, 0, 24, 5, 0, 0, 65, 111, 110, 57, 140, 0, 0, 0, 140, 0, 0, 0, 0, 2, 255, 255, @@ -3349,7 +3194,7 @@ const BYTE SolidColorShaderMask[] = 0, 0, 1, 0, 40, 0, 0, 0, 52, 0, 0, 0, 52, 0, 1, 0, 36, 0, - 0, 0, 52, 0, 3, 0, + 0, 0, 52, 0, 5, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 2, 255, 255, @@ -3375,7 +3220,7 @@ const BYTE SolidColorShaderMask[] = 0, 0, 90, 0, 0, 3, 0, 96, 16, 0, 0, 0, 0, 0, 88, 24, 0, 4, - 0, 112, 16, 0, 3, 0, + 0, 112, 16, 0, 5, 0, 0, 0, 85, 85, 0, 0, 98, 16, 0, 3, 194, 16, 16, 0, 1, 0, 0, 0, @@ -3386,7 +3231,7 @@ const BYTE SolidColorShaderMask[] = 242, 0, 16, 0, 0, 0, 0, 0, 230, 26, 16, 0, 1, 0, 0, 0, 70, 126, - 16, 0, 3, 0, 0, 0, + 16, 0, 5, 0, 0, 0, 0, 96, 16, 0, 0, 0, 0, 0, 56, 0, 0, 8, 242, 32, 16, 0, 0, 0, @@ -3415,12 +3260,12 @@ const BYTE SolidColorShaderMask[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 82, 68, 69, 70, 80, 2, + 82, 68, 69, 70, 180, 2, 0, 0, 1, 0, 0, 0, 148, 0, 0, 0, 3, 0, 0, 0, 28, 0, 0, 0, 0, 4, 255, 255, 0, 1, - 0, 0, 29, 2, 0, 0, + 0, 0, 128, 2, 0, 0, 124, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -3429,7 +3274,7 @@ const BYTE SolidColorShaderMask[] = 0, 0, 133, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, - 255, 255, 255, 255, 3, 0, + 255, 255, 255, 255, 5, 0, 0, 0, 1, 0, 0, 0, 13, 0, 0, 0, 139, 0, 0, 0, 0, 0, 0, 0, @@ -3441,41 +3286,49 @@ const BYTE SolidColorShaderMask[] = 101, 114, 0, 116, 77, 97, 115, 107, 0, 36, 71, 108, 111, 98, 97, 108, 115, 0, - 139, 0, 0, 0, 8, 0, + 139, 0, 0, 0, 10, 0, 0, 0, 172, 0, 0, 0, - 224, 0, 0, 0, 0, 0, + 48, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 108, 1, 0, 0, 0, 0, + 156, 1, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, - 2, 0, 0, 0, 120, 1, + 2, 0, 0, 0, 168, 1, 0, 0, 0, 0, 0, 0, - 136, 1, 0, 0, 16, 0, + 184, 1, 0, 0, 16, 0, 0, 0, 4, 0, 0, 0, - 0, 0, 0, 0, 152, 1, + 0, 0, 0, 0, 200, 1, 0, 0, 0, 0, 0, 0, - 168, 1, 0, 0, 32, 0, + 216, 1, 0, 0, 32, 0, + 0, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 232, 1, + 0, 0, 0, 0, 0, 0, + 248, 1, 0, 0, 48, 0, 0, 0, 64, 0, 0, 0, - 0, 0, 0, 0, 184, 1, + 0, 0, 0, 0, 8, 2, 0, 0, 0, 0, 0, 0, - 200, 1, 0, 0, 96, 0, + 24, 2, 0, 0, 112, 0, 0, 0, 64, 0, 0, 0, - 0, 0, 0, 0, 184, 1, + 0, 0, 0, 0, 8, 2, 0, 0, 0, 0, 0, 0, - 212, 1, 0, 0, 160, 0, + 36, 2, 0, 0, 176, 0, 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 120, 1, + 0, 0, 0, 0, 168, 1, 0, 0, 0, 0, 0, 0, - 232, 1, 0, 0, 176, 0, + 56, 2, 0, 0, 192, 0, 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 248, 1, + 0, 0, 0, 0, 72, 2, 0, 0, 0, 0, 0, 0, - 8, 2, 0, 0, 192, 0, + 88, 2, 0, 0, 208, 0, 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 248, 1, + 0, 0, 0, 0, 72, 2, 0, 0, 0, 0, 0, 0, - 19, 2, 0, 0, 208, 0, + 99, 2, 0, 0, 224, 0, 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 248, 1, + 0, 0, 0, 0, 72, 2, + 0, 0, 0, 0, 0, 0, + 109, 2, 0, 0, 240, 0, + 0, 0, 64, 0, 0, 0, + 0, 0, 0, 0, 8, 2, 0, 0, 0, 0, 0, 0, 102, 76, 97, 121, 101, 114, 67, 111, 108, 111, 114, 0, @@ -3487,62 +3340,70 @@ const BYTE SolidColorShaderMask[] = 171, 171, 0, 0, 3, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 109, 76, 97, 121, 101, 114, - 84, 114, 97, 110, 115, 102, - 111, 114, 109, 0, 3, 0, - 3, 0, 4, 0, 4, 0, + 105, 66, 108, 101, 110, 100, + 67, 111, 110, 102, 105, 103, + 0, 171, 171, 171, 1, 0, + 19, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 109, 80, 114, 111, - 106, 101, 99, 116, 105, 111, - 110, 0, 118, 82, 101, 110, - 100, 101, 114, 84, 97, 114, - 103, 101, 116, 79, 102, 102, - 115, 101, 116, 0, 118, 84, - 101, 120, 116, 117, 114, 101, - 67, 111, 111, 114, 100, 115, - 0, 171, 1, 0, 3, 0, - 1, 0, 4, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 118, 76, 97, 121, 101, 114, - 81, 117, 97, 100, 0, 118, - 77, 97, 115, 107, 81, 117, - 97, 100, 0, 77, 105, 99, - 114, 111, 115, 111, 102, 116, - 32, 40, 82, 41, 32, 72, - 76, 83, 76, 32, 83, 104, - 97, 100, 101, 114, 32, 67, - 111, 109, 112, 105, 108, 101, - 114, 32, 54, 46, 51, 46, - 57, 54, 48, 48, 46, 49, - 54, 51, 56, 52, 0, 171, - 73, 83, 71, 78, 104, 0, - 0, 0, 3, 0, 0, 0, - 8, 0, 0, 0, 80, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 3, 0, - 0, 0, 0, 0, 0, 0, - 15, 0, 0, 0, 92, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 3, 0, - 0, 0, 1, 0, 0, 0, - 3, 0, 0, 0, 92, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 3, 0, - 0, 0, 1, 0, 0, 0, - 12, 12, 0, 0, 83, 86, - 95, 80, 111, 115, 105, 116, - 105, 111, 110, 0, 84, 69, - 88, 67, 79, 79, 82, 68, - 0, 171, 171, 171, 79, 83, - 71, 78, 44, 0, 0, 0, - 1, 0, 0, 0, 8, 0, - 0, 0, 32, 0, 0, 0, + 0, 0, 109, 76, 97, 121, + 101, 114, 84, 114, 97, 110, + 115, 102, 111, 114, 109, 0, + 3, 0, 3, 0, 4, 0, + 4, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 109, 80, + 114, 111, 106, 101, 99, 116, + 105, 111, 110, 0, 118, 82, + 101, 110, 100, 101, 114, 84, + 97, 114, 103, 101, 116, 79, + 102, 102, 115, 101, 116, 0, + 118, 84, 101, 120, 116, 117, + 114, 101, 67, 111, 111, 114, + 100, 115, 0, 171, 1, 0, + 3, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 118, 76, 97, 121, + 101, 114, 81, 117, 97, 100, + 0, 118, 77, 97, 115, 107, + 81, 117, 97, 100, 0, 109, + 66, 97, 99, 107, 100, 114, + 111, 112, 84, 114, 97, 110, + 115, 102, 111, 114, 109, 0, + 77, 105, 99, 114, 111, 115, + 111, 102, 116, 32, 40, 82, + 41, 32, 72, 76, 83, 76, + 32, 83, 104, 97, 100, 101, + 114, 32, 67, 111, 109, 112, + 105, 108, 101, 114, 32, 54, + 46, 51, 46, 57, 54, 48, + 48, 46, 49, 54, 51, 56, + 52, 0, 171, 171, 73, 83, + 71, 78, 104, 0, 0, 0, + 3, 0, 0, 0, 8, 0, + 0, 0, 80, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 0, - 0, 0, 83, 86, 95, 84, - 97, 114, 103, 101, 116, 0, - 171, 171 + 0, 0, 92, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 1, 0, 0, 0, 3, 0, + 0, 0, 92, 0, 0, 0, + 1, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 1, 0, 0, 0, 12, 12, + 0, 0, 83, 86, 95, 80, + 111, 115, 105, 116, 105, 111, + 110, 0, 84, 69, 88, 67, + 79, 79, 82, 68, 0, 171, + 171, 171, 79, 83, 71, 78, + 44, 0, 0, 0, 1, 0, + 0, 0, 8, 0, 0, 0, + 32, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 15, 0, 0, 0, + 83, 86, 95, 84, 97, 114, + 103, 101, 116, 0, 171, 171 }; ShaderBytes sSolidColorShaderMask = { SolidColorShaderMask, sizeof(SolidColorShaderMask) }; #if 0 @@ -3557,12 +3418,14 @@ ShaderBytes sSolidColorShaderMask = { SolidColorShaderMask, sizeof(SolidColorSha // // float4 fLayerColor; // Offset: 0 Size: 16 [unused] // float fLayerOpacity; // Offset: 16 Size: 4 -// float4x4 mLayerTransform; // Offset: 32 Size: 64 [unused] -// float4x4 mProjection; // Offset: 96 Size: 64 [unused] -// float4 vRenderTargetOffset; // Offset: 160 Size: 16 [unused] -// float4 vTextureCoords; // Offset: 176 Size: 16 [unused] -// float4 vLayerQuad; // Offset: 192 Size: 16 [unused] -// float4 vMaskQuad; // Offset: 208 Size: 16 [unused] +// uint4 iBlendConfig; // Offset: 32 Size: 16 [unused] +// float4x4 mLayerTransform; // Offset: 48 Size: 64 [unused] +// float4x4 mProjection; // Offset: 112 Size: 64 [unused] +// float4 vRenderTargetOffset; // Offset: 176 Size: 16 [unused] +// float4 vTextureCoords; // Offset: 192 Size: 16 [unused] +// float4 vLayerQuad; // Offset: 208 Size: 16 [unused] +// float4 vMaskQuad; // Offset: 224 Size: 16 [unused] +// float4x4 mBackdropTransform; // Offset: 240 Size: 64 [unused] // // } // @@ -3573,7 +3436,7 @@ ShaderBytes sSolidColorShaderMask = { SolidColorShaderMask, sizeof(SolidColorSha // ------------------------------ ---------- ------- ----------- ---- -------- // sSampler sampler NA NA 0 1 // tRGB texture float4 2d 0 1 -// tMask texture float4 2d 3 1 +// tMask texture float4 2d 5 1 // $Globals cbuffer NA NA 0 1 // // @@ -3605,8 +3468,8 @@ ShaderBytes sSolidColorShaderMask = { SolidColorShaderMask, sizeof(SolidColorSha // // Target Sampler Source Sampler Source Resource // -------------- --------------- ---------------- -// s0 s0 t3 -// s1 s0 t0 +// s0 s0 t0 +// s1 s0 t5 // // // Level9 shader bytecode: @@ -3616,8 +3479,8 @@ ShaderBytes sSolidColorShaderMask = { SolidColorShaderMask, sizeof(SolidColorSha dcl_2d s0 dcl_2d s1 mov r0.xy, t0.wzzw - texld r1, t0, s1 - texld r0, r0, s0 + texld r1, t0, s0 + texld r0, r0, s1 mul r1.xyz, r1, c0.x mov r1.w, c0.x mul r0, r0.x, r1 @@ -3628,14 +3491,14 @@ ps_4_0 dcl_constantbuffer cb0[2], immediateIndexed dcl_sampler s0, mode_default dcl_resource_texture2d (float,float,float,float) t0 -dcl_resource_texture2d (float,float,float,float) t3 +dcl_resource_texture2d (float,float,float,float) t5 dcl_input_ps linear v1.xy dcl_input_ps linear v1.zw dcl_output o0.xyzw dcl_temps 2 sample r0.xyzw, v1.xyxx, t0.xyzw, s0 mul r0.xyz, r0.xyzx, cb0[1].xxxx -sample r1.xyzw, v1.zwzz, t3.xyzw, s0 +sample r1.xyzw, v1.zwzz, t5.xyzw, s0 mov r0.w, cb0[1].x mul o0.xyzw, r0.xyzw, r1.xxxx ret @@ -3644,15 +3507,15 @@ ret const BYTE RGBShaderMask[] = { - 68, 88, 66, 67, 151, 113, - 6, 167, 51, 154, 234, 112, - 72, 240, 46, 160, 193, 164, - 13, 255, 1, 0, 0, 0, - 192, 5, 0, 0, 6, 0, + 68, 88, 66, 67, 194, 201, + 10, 158, 40, 223, 107, 77, + 239, 65, 209, 32, 8, 192, + 127, 244, 1, 0, 0, 0, + 36, 6, 0, 0, 6, 0, 0, 0, 56, 0, 0, 0, 8, 1, 0, 0, 32, 2, 0, 0, 156, 2, 0, 0, - 28, 5, 0, 0, 140, 5, + 128, 5, 0, 0, 240, 5, 0, 0, 65, 111, 110, 57, 200, 0, 0, 0, 200, 0, 0, 0, 0, 2, 255, 255, @@ -3660,8 +3523,8 @@ const BYTE RGBShaderMask[] = 0, 0, 1, 0, 44, 0, 0, 0, 56, 0, 0, 0, 56, 0, 2, 0, 36, 0, - 0, 0, 56, 0, 3, 0, - 0, 0, 0, 0, 1, 0, + 0, 0, 56, 0, 0, 0, + 0, 0, 5, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 2, 255, 255, 31, 0, @@ -3674,10 +3537,10 @@ const BYTE RGBShaderMask[] = 0, 2, 0, 0, 3, 128, 0, 0, 235, 176, 66, 0, 0, 3, 1, 0, 15, 128, - 0, 0, 228, 176, 1, 8, + 0, 0, 228, 176, 0, 8, 228, 160, 66, 0, 0, 3, 0, 0, 15, 128, 0, 0, - 228, 128, 0, 8, 228, 160, + 228, 128, 1, 8, 228, 160, 5, 0, 0, 3, 1, 0, 7, 128, 1, 0, 228, 128, 0, 0, 0, 160, 1, 0, @@ -3699,7 +3562,7 @@ const BYTE RGBShaderMask[] = 0, 112, 16, 0, 0, 0, 0, 0, 85, 85, 0, 0, 88, 24, 0, 4, 0, 112, - 16, 0, 3, 0, 0, 0, + 16, 0, 5, 0, 0, 0, 85, 85, 0, 0, 98, 16, 0, 3, 50, 16, 16, 0, 1, 0, 0, 0, 98, 16, @@ -3723,7 +3586,7 @@ const BYTE RGBShaderMask[] = 242, 0, 16, 0, 1, 0, 0, 0, 230, 26, 16, 0, 1, 0, 0, 0, 70, 126, - 16, 0, 3, 0, 0, 0, + 16, 0, 5, 0, 0, 0, 0, 96, 16, 0, 0, 0, 0, 0, 54, 0, 0, 6, 130, 0, 16, 0, 0, 0, @@ -3756,11 +3619,11 @@ const BYTE RGBShaderMask[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 68, 69, 70, - 120, 2, 0, 0, 1, 0, + 220, 2, 0, 0, 1, 0, 0, 0, 188, 0, 0, 0, 4, 0, 0, 0, 28, 0, 0, 0, 0, 4, 255, 255, - 0, 1, 0, 0, 69, 2, + 0, 1, 0, 0, 168, 2, 0, 0, 156, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -3771,789 +3634,114 @@ const BYTE RGBShaderMask[] = 5, 0, 0, 0, 4, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 1, 0, - 0, 0, 12, 0, 0, 0, - 170, 0, 0, 0, 2, 0, - 0, 0, 5, 0, 0, 0, - 4, 0, 0, 0, 255, 255, - 255, 255, 3, 0, 0, 0, - 1, 0, 0, 0, 13, 0, - 0, 0, 176, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 115, 83, - 97, 109, 112, 108, 101, 114, - 0, 116, 82, 71, 66, 0, - 116, 77, 97, 115, 107, 0, - 36, 71, 108, 111, 98, 97, - 108, 115, 0, 171, 171, 171, - 176, 0, 0, 0, 8, 0, - 0, 0, 212, 0, 0, 0, - 224, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 148, 1, 0, 0, 0, 0, - 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 160, 1, - 0, 0, 0, 0, 0, 0, - 176, 1, 0, 0, 16, 0, - 0, 0, 4, 0, 0, 0, - 2, 0, 0, 0, 192, 1, - 0, 0, 0, 0, 0, 0, - 208, 1, 0, 0, 32, 0, - 0, 0, 64, 0, 0, 0, - 0, 0, 0, 0, 224, 1, - 0, 0, 0, 0, 0, 0, - 240, 1, 0, 0, 96, 0, - 0, 0, 64, 0, 0, 0, - 0, 0, 0, 0, 224, 1, - 0, 0, 0, 0, 0, 0, - 252, 1, 0, 0, 160, 0, - 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 160, 1, - 0, 0, 0, 0, 0, 0, - 16, 2, 0, 0, 176, 0, - 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 32, 2, - 0, 0, 0, 0, 0, 0, - 48, 2, 0, 0, 192, 0, - 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 32, 2, - 0, 0, 0, 0, 0, 0, - 59, 2, 0, 0, 208, 0, - 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 32, 2, - 0, 0, 0, 0, 0, 0, - 102, 76, 97, 121, 101, 114, - 67, 111, 108, 111, 114, 0, - 1, 0, 3, 0, 1, 0, - 4, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 102, 76, - 97, 121, 101, 114, 79, 112, - 97, 99, 105, 116, 121, 0, - 171, 171, 0, 0, 3, 0, - 1, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 109, 76, 97, 121, 101, 114, - 84, 114, 97, 110, 115, 102, - 111, 114, 109, 0, 3, 0, - 3, 0, 4, 0, 4, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 109, 80, 114, 111, - 106, 101, 99, 116, 105, 111, - 110, 0, 118, 82, 101, 110, - 100, 101, 114, 84, 97, 114, - 103, 101, 116, 79, 102, 102, - 115, 101, 116, 0, 118, 84, - 101, 120, 116, 117, 114, 101, - 67, 111, 111, 114, 100, 115, - 0, 171, 1, 0, 3, 0, - 1, 0, 4, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 118, 76, 97, 121, 101, 114, - 81, 117, 97, 100, 0, 118, - 77, 97, 115, 107, 81, 117, - 97, 100, 0, 77, 105, 99, - 114, 111, 115, 111, 102, 116, - 32, 40, 82, 41, 32, 72, - 76, 83, 76, 32, 83, 104, - 97, 100, 101, 114, 32, 67, - 111, 109, 112, 105, 108, 101, - 114, 32, 54, 46, 51, 46, - 57, 54, 48, 48, 46, 49, - 54, 51, 56, 52, 0, 171, - 73, 83, 71, 78, 104, 0, - 0, 0, 3, 0, 0, 0, - 8, 0, 0, 0, 80, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 3, 0, - 0, 0, 0, 0, 0, 0, - 15, 0, 0, 0, 92, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 3, 0, - 0, 0, 1, 0, 0, 0, - 3, 3, 0, 0, 92, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 3, 0, - 0, 0, 1, 0, 0, 0, - 12, 12, 0, 0, 83, 86, - 95, 80, 111, 115, 105, 116, - 105, 111, 110, 0, 84, 69, - 88, 67, 79, 79, 82, 68, - 0, 171, 171, 171, 79, 83, - 71, 78, 44, 0, 0, 0, - 1, 0, 0, 0, 8, 0, - 0, 0, 32, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, - 0, 0, 0, 0, 15, 0, - 0, 0, 83, 86, 95, 84, - 97, 114, 103, 101, 116, 0, - 171, 171 -}; -ShaderBytes sRGBShaderMask = { RGBShaderMask, sizeof(RGBShaderMask) }; -#if 0 -// -// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 -// -// -// Buffer Definitions: -// -// cbuffer $Globals -// { -// -// float4 fLayerColor; // Offset: 0 Size: 16 [unused] -// float fLayerOpacity; // Offset: 16 Size: 4 -// float4x4 mLayerTransform; // Offset: 32 Size: 64 [unused] -// float4x4 mProjection; // Offset: 96 Size: 64 [unused] -// float4 vRenderTargetOffset; // Offset: 160 Size: 16 [unused] -// float4 vTextureCoords; // Offset: 176 Size: 16 [unused] -// float4 vLayerQuad; // Offset: 192 Size: 16 [unused] -// float4 vMaskQuad; // Offset: 208 Size: 16 [unused] -// -// } -// -// -// Resource Bindings: -// -// Name Type Format Dim Slot Elements -// ------------------------------ ---------- ------- ----------- ---- -------- -// sSampler sampler NA NA 0 1 -// tRGB texture float4 2d 0 1 -// tMask texture float4 2d 3 1 -// $Globals cbuffer NA NA 0 1 -// -// -// -// Input signature: -// -// Name Index Mask Register SysValue Format Used -// -------------------- ----- ------ -------- -------- ------- ------ -// SV_Position 0 xyzw 0 POS float -// TEXCOORD 0 xy 1 NONE float xy -// TEXCOORD 1 zw 1 NONE float zw -// -// -// Output signature: -// -// Name Index Mask Register SysValue Format Used -// -------------------- ----- ------ -------- -------- ------- ------ -// SV_Target 0 xyzw 0 TARGET float xyzw -// -// -// Constant buffer to DX9 shader constant mappings: -// -// Target Reg Buffer Start Reg # of Regs Data Conversion -// ---------- ------- --------- --------- ---------------------- -// c0 cb0 1 1 ( FLT, FLT, FLT, FLT) -// -// -// Sampler/Resource to DX9 shader sampler mappings: -// -// Target Sampler Source Sampler Source Resource -// -------------- --------------- ---------------- -// s0 s0 t3 -// s1 s0 t0 -// -// -// Level9 shader bytecode: -// - ps_2_x - dcl t0 - dcl_2d s0 - dcl_2d s1 - mov r0.xy, t0.wzzw - texld r1, t0, s1 - texld r0, r0, s0 - mul r1, r1, c0.x - mul r0, r0.x, r1 - mov oC0, r0 - -// approximately 6 instruction slots used (2 texture, 4 arithmetic) -ps_4_0 -dcl_constantbuffer cb0[2], immediateIndexed -dcl_sampler s0, mode_default -dcl_resource_texture2d (float,float,float,float) t0 -dcl_resource_texture2d (float,float,float,float) t3 -dcl_input_ps linear v1.xy -dcl_input_ps linear v1.zw -dcl_output o0.xyzw -dcl_temps 2 -sample r0.xyzw, v1.xyxx, t0.xyzw, s0 -mul r0.xyzw, r0.xyzw, cb0[1].xxxx -sample r1.xyzw, v1.zwzz, t3.xyzw, s0 -mul o0.xyzw, r0.xyzw, r1.xxxx -ret -// Approximately 5 instruction slots used -#endif - -const BYTE RGBAShaderMask[] = -{ - 68, 88, 66, 67, 182, 158, - 23, 70, 121, 188, 140, 117, - 148, 125, 14, 205, 185, 113, - 155, 74, 1, 0, 0, 0, - 156, 5, 0, 0, 6, 0, - 0, 0, 56, 0, 0, 0, - 252, 0, 0, 0, 252, 1, - 0, 0, 120, 2, 0, 0, - 248, 4, 0, 0, 104, 5, - 0, 0, 65, 111, 110, 57, - 188, 0, 0, 0, 188, 0, - 0, 0, 0, 2, 255, 255, - 132, 0, 0, 0, 56, 0, - 0, 0, 1, 0, 44, 0, - 0, 0, 56, 0, 0, 0, - 56, 0, 2, 0, 36, 0, - 0, 0, 56, 0, 3, 0, - 0, 0, 0, 0, 1, 0, - 0, 0, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 1, 2, 255, 255, 31, 0, - 0, 2, 0, 0, 0, 128, - 0, 0, 15, 176, 31, 0, - 0, 2, 0, 0, 0, 144, - 0, 8, 15, 160, 31, 0, - 0, 2, 0, 0, 0, 144, - 1, 8, 15, 160, 1, 0, - 0, 2, 0, 0, 3, 128, - 0, 0, 235, 176, 66, 0, - 0, 3, 1, 0, 15, 128, - 0, 0, 228, 176, 1, 8, - 228, 160, 66, 0, 0, 3, - 0, 0, 15, 128, 0, 0, - 228, 128, 0, 8, 228, 160, - 5, 0, 0, 3, 1, 0, - 15, 128, 1, 0, 228, 128, - 0, 0, 0, 160, 5, 0, - 0, 3, 0, 0, 15, 128, - 0, 0, 0, 128, 1, 0, - 228, 128, 1, 0, 0, 2, - 0, 8, 15, 128, 0, 0, - 228, 128, 255, 255, 0, 0, - 83, 72, 68, 82, 248, 0, - 0, 0, 64, 0, 0, 0, - 62, 0, 0, 0, 89, 0, - 0, 4, 70, 142, 32, 0, - 0, 0, 0, 0, 2, 0, - 0, 0, 90, 0, 0, 3, - 0, 96, 16, 0, 0, 0, - 0, 0, 88, 24, 0, 4, - 0, 112, 16, 0, 0, 0, - 0, 0, 85, 85, 0, 0, - 88, 24, 0, 4, 0, 112, - 16, 0, 3, 0, 0, 0, - 85, 85, 0, 0, 98, 16, - 0, 3, 50, 16, 16, 0, - 1, 0, 0, 0, 98, 16, - 0, 3, 194, 16, 16, 0, - 1, 0, 0, 0, 101, 0, - 0, 3, 242, 32, 16, 0, - 0, 0, 0, 0, 104, 0, - 0, 2, 2, 0, 0, 0, - 69, 0, 0, 9, 242, 0, - 16, 0, 0, 0, 0, 0, - 70, 16, 16, 0, 1, 0, - 0, 0, 70, 126, 16, 0, - 0, 0, 0, 0, 0, 96, - 16, 0, 0, 0, 0, 0, - 56, 0, 0, 8, 242, 0, - 16, 0, 0, 0, 0, 0, - 70, 14, 16, 0, 0, 0, - 0, 0, 6, 128, 32, 0, - 0, 0, 0, 0, 1, 0, - 0, 0, 69, 0, 0, 9, - 242, 0, 16, 0, 1, 0, - 0, 0, 230, 26, 16, 0, - 1, 0, 0, 0, 70, 126, - 16, 0, 3, 0, 0, 0, - 0, 96, 16, 0, 0, 0, - 0, 0, 56, 0, 0, 7, - 242, 32, 16, 0, 0, 0, - 0, 0, 70, 14, 16, 0, - 0, 0, 0, 0, 6, 0, - 16, 0, 1, 0, 0, 0, - 62, 0, 0, 1, 83, 84, - 65, 84, 116, 0, 0, 0, - 5, 0, 0, 0, 2, 0, - 0, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 2, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 2, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 82, 68, 69, 70, - 120, 2, 0, 0, 1, 0, - 0, 0, 188, 0, 0, 0, - 4, 0, 0, 0, 28, 0, - 0, 0, 0, 4, 255, 255, - 0, 1, 0, 0, 69, 2, - 0, 0, 156, 0, 0, 0, - 3, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 1, 0, 0, 0, 165, 0, - 0, 0, 2, 0, 0, 0, - 5, 0, 0, 0, 4, 0, - 0, 0, 255, 255, 255, 255, - 0, 0, 0, 0, 1, 0, - 0, 0, 12, 0, 0, 0, - 170, 0, 0, 0, 2, 0, - 0, 0, 5, 0, 0, 0, - 4, 0, 0, 0, 255, 255, - 255, 255, 3, 0, 0, 0, - 1, 0, 0, 0, 13, 0, - 0, 0, 176, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 115, 83, - 97, 109, 112, 108, 101, 114, - 0, 116, 82, 71, 66, 0, - 116, 77, 97, 115, 107, 0, - 36, 71, 108, 111, 98, 97, - 108, 115, 0, 171, 171, 171, - 176, 0, 0, 0, 8, 0, - 0, 0, 212, 0, 0, 0, - 224, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 148, 1, 0, 0, 0, 0, - 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 160, 1, - 0, 0, 0, 0, 0, 0, - 176, 1, 0, 0, 16, 0, - 0, 0, 4, 0, 0, 0, - 2, 0, 0, 0, 192, 1, - 0, 0, 0, 0, 0, 0, - 208, 1, 0, 0, 32, 0, - 0, 0, 64, 0, 0, 0, - 0, 0, 0, 0, 224, 1, - 0, 0, 0, 0, 0, 0, - 240, 1, 0, 0, 96, 0, - 0, 0, 64, 0, 0, 0, - 0, 0, 0, 0, 224, 1, - 0, 0, 0, 0, 0, 0, - 252, 1, 0, 0, 160, 0, - 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 160, 1, - 0, 0, 0, 0, 0, 0, - 16, 2, 0, 0, 176, 0, - 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 32, 2, - 0, 0, 0, 0, 0, 0, - 48, 2, 0, 0, 192, 0, - 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 32, 2, - 0, 0, 0, 0, 0, 0, - 59, 2, 0, 0, 208, 0, - 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 32, 2, - 0, 0, 0, 0, 0, 0, - 102, 76, 97, 121, 101, 114, - 67, 111, 108, 111, 114, 0, - 1, 0, 3, 0, 1, 0, - 4, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 102, 76, - 97, 121, 101, 114, 79, 112, - 97, 99, 105, 116, 121, 0, - 171, 171, 0, 0, 3, 0, - 1, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 109, 76, 97, 121, 101, 114, - 84, 114, 97, 110, 115, 102, - 111, 114, 109, 0, 3, 0, - 3, 0, 4, 0, 4, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 109, 80, 114, 111, - 106, 101, 99, 116, 105, 111, - 110, 0, 118, 82, 101, 110, - 100, 101, 114, 84, 97, 114, - 103, 101, 116, 79, 102, 102, - 115, 101, 116, 0, 118, 84, - 101, 120, 116, 117, 114, 101, - 67, 111, 111, 114, 100, 115, - 0, 171, 1, 0, 3, 0, - 1, 0, 4, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 118, 76, 97, 121, 101, 114, - 81, 117, 97, 100, 0, 118, - 77, 97, 115, 107, 81, 117, - 97, 100, 0, 77, 105, 99, - 114, 111, 115, 111, 102, 116, - 32, 40, 82, 41, 32, 72, - 76, 83, 76, 32, 83, 104, - 97, 100, 101, 114, 32, 67, - 111, 109, 112, 105, 108, 101, - 114, 32, 54, 46, 51, 46, - 57, 54, 48, 48, 46, 49, - 54, 51, 56, 52, 0, 171, - 73, 83, 71, 78, 104, 0, - 0, 0, 3, 0, 0, 0, - 8, 0, 0, 0, 80, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 3, 0, - 0, 0, 0, 0, 0, 0, - 15, 0, 0, 0, 92, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 3, 0, - 0, 0, 1, 0, 0, 0, - 3, 3, 0, 0, 92, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 3, 0, - 0, 0, 1, 0, 0, 0, - 12, 12, 0, 0, 83, 86, - 95, 80, 111, 115, 105, 116, - 105, 111, 110, 0, 84, 69, - 88, 67, 79, 79, 82, 68, - 0, 171, 171, 171, 79, 83, - 71, 78, 44, 0, 0, 0, - 1, 0, 0, 0, 8, 0, - 0, 0, 32, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, - 0, 0, 0, 0, 15, 0, - 0, 0, 83, 86, 95, 84, - 97, 114, 103, 101, 116, 0, - 171, 171 -}; -ShaderBytes sRGBAShaderMask = { RGBAShaderMask, sizeof(RGBAShaderMask) }; -#if 0 -// -// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 -// -// -// Buffer Definitions: -// -// cbuffer $Globals -// { -// -// float4 fLayerColor; // Offset: 0 Size: 16 [unused] -// float fLayerOpacity; // Offset: 16 Size: 4 -// float4x4 mLayerTransform; // Offset: 32 Size: 64 [unused] -// float4x4 mProjection; // Offset: 96 Size: 64 [unused] -// float4 vRenderTargetOffset; // Offset: 160 Size: 16 [unused] -// float4 vTextureCoords; // Offset: 176 Size: 16 [unused] -// float4 vLayerQuad; // Offset: 192 Size: 16 [unused] -// float4 vMaskQuad; // Offset: 208 Size: 16 [unused] -// -// } -// -// -// Resource Bindings: -// -// Name Type Format Dim Slot Elements -// ------------------------------ ---------- ------- ----------- ---- -------- -// sSampler sampler NA NA 0 1 -// tRGB texture float4 2d 0 1 -// tMask texture float4 2d 3 1 -// $Globals cbuffer NA NA 0 1 -// -// -// -// Input signature: -// -// Name Index Mask Register SysValue Format Used -// -------------------- ----- ------ -------- -------- ------- ------ -// SV_Position 0 xyzw 0 POS float -// TEXCOORD 0 xy 1 NONE float xy -// TEXCOORD 1 zw 1 NONE float zw -// -// -// Output signature: -// -// Name Index Mask Register SysValue Format Used -// -------------------- ----- ------ -------- -------- ------- ------ -// SV_Target 0 xyzw 0 TARGET float xyzw -// -// -// Constant buffer to DX9 shader constant mappings: -// -// Target Reg Buffer Start Reg # of Regs Data Conversion -// ---------- ------- --------- --------- ---------------------- -// c0 cb0 1 1 ( FLT, FLT, FLT, FLT) -// -// -// Sampler/Resource to DX9 shader sampler mappings: -// -// Target Sampler Source Sampler Source Resource -// -------------- --------------- ---------------- -// s0 s0 t3 -// s1 s0 t0 -// -// -// Level9 shader bytecode: -// - ps_2_x - dcl t0 - dcl_2d s0 - dcl_2d s1 - mov r0.xy, t0.wzzw - texld r1, t0, s1 - texld r0, r0, s0 - mul r1, r1, c0.x - mul r0, r0.x, r1 - mul r0.xyz, r0.w, r0 - mov oC0, r0 - -// approximately 7 instruction slots used (2 texture, 5 arithmetic) -ps_4_0 -dcl_constantbuffer cb0[2], immediateIndexed -dcl_sampler s0, mode_default -dcl_resource_texture2d (float,float,float,float) t0 -dcl_resource_texture2d (float,float,float,float) t3 -dcl_input_ps linear v1.xy -dcl_input_ps linear v1.zw -dcl_output o0.xyzw -dcl_temps 2 -sample r0.xyzw, v1.xyxx, t0.xyzw, s0 -mul r0.xyzw, r0.xyzw, cb0[1].xxxx -sample r1.xyzw, v1.zwzz, t3.xyzw, s0 -mul r0.xyzw, r0.xyzw, r1.xxxx -mul o0.xyz, r0.wwww, r0.xyzx -mov o0.w, r0.w -ret -// Approximately 7 instruction slots used -#endif - -const BYTE RGBAShaderMaskPremul[] = -{ - 68, 88, 66, 67, 170, 142, - 83, 183, 24, 153, 194, 125, - 42, 169, 16, 185, 222, 43, - 161, 111, 1, 0, 0, 0, - 220, 5, 0, 0, 6, 0, - 0, 0, 56, 0, 0, 0, - 12, 1, 0, 0, 60, 2, - 0, 0, 184, 2, 0, 0, - 56, 5, 0, 0, 168, 5, - 0, 0, 65, 111, 110, 57, - 204, 0, 0, 0, 204, 0, - 0, 0, 0, 2, 255, 255, - 148, 0, 0, 0, 56, 0, - 0, 0, 1, 0, 44, 0, - 0, 0, 56, 0, 0, 0, - 56, 0, 2, 0, 36, 0, - 0, 0, 56, 0, 3, 0, - 0, 0, 0, 0, 1, 0, - 0, 0, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 1, 2, 255, 255, 31, 0, - 0, 2, 0, 0, 0, 128, - 0, 0, 15, 176, 31, 0, - 0, 2, 0, 0, 0, 144, - 0, 8, 15, 160, 31, 0, - 0, 2, 0, 0, 0, 144, - 1, 8, 15, 160, 1, 0, - 0, 2, 0, 0, 3, 128, - 0, 0, 235, 176, 66, 0, - 0, 3, 1, 0, 15, 128, - 0, 0, 228, 176, 1, 8, - 228, 160, 66, 0, 0, 3, - 0, 0, 15, 128, 0, 0, - 228, 128, 0, 8, 228, 160, - 5, 0, 0, 3, 1, 0, - 15, 128, 1, 0, 228, 128, - 0, 0, 0, 160, 5, 0, - 0, 3, 0, 0, 15, 128, - 0, 0, 0, 128, 1, 0, - 228, 128, 5, 0, 0, 3, - 0, 0, 7, 128, 0, 0, - 255, 128, 0, 0, 228, 128, - 1, 0, 0, 2, 0, 8, - 15, 128, 0, 0, 228, 128, - 255, 255, 0, 0, 83, 72, - 68, 82, 40, 1, 0, 0, - 64, 0, 0, 0, 74, 0, - 0, 0, 89, 0, 0, 4, - 70, 142, 32, 0, 0, 0, - 0, 0, 2, 0, 0, 0, - 90, 0, 0, 3, 0, 96, - 16, 0, 0, 0, 0, 0, - 88, 24, 0, 4, 0, 112, - 16, 0, 0, 0, 0, 0, - 85, 85, 0, 0, 88, 24, - 0, 4, 0, 112, 16, 0, - 3, 0, 0, 0, 85, 85, - 0, 0, 98, 16, 0, 3, - 50, 16, 16, 0, 1, 0, - 0, 0, 98, 16, 0, 3, - 194, 16, 16, 0, 1, 0, - 0, 0, 101, 0, 0, 3, - 242, 32, 16, 0, 0, 0, - 0, 0, 104, 0, 0, 2, - 2, 0, 0, 0, 69, 0, - 0, 9, 242, 0, 16, 0, - 0, 0, 0, 0, 70, 16, - 16, 0, 1, 0, 0, 0, - 70, 126, 16, 0, 0, 0, - 0, 0, 0, 96, 16, 0, - 0, 0, 0, 0, 56, 0, - 0, 8, 242, 0, 16, 0, - 0, 0, 0, 0, 70, 14, - 16, 0, 0, 0, 0, 0, - 6, 128, 32, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 69, 0, 0, 9, 242, 0, - 16, 0, 1, 0, 0, 0, - 230, 26, 16, 0, 1, 0, - 0, 0, 70, 126, 16, 0, - 3, 0, 0, 0, 0, 96, - 16, 0, 0, 0, 0, 0, - 56, 0, 0, 7, 242, 0, - 16, 0, 0, 0, 0, 0, - 70, 14, 16, 0, 0, 0, - 0, 0, 6, 0, 16, 0, - 1, 0, 0, 0, 56, 0, - 0, 7, 114, 32, 16, 0, - 0, 0, 0, 0, 246, 15, - 16, 0, 0, 0, 0, 0, - 70, 2, 16, 0, 0, 0, - 0, 0, 54, 0, 0, 5, - 130, 32, 16, 0, 0, 0, - 0, 0, 58, 0, 16, 0, - 0, 0, 0, 0, 62, 0, - 0, 1, 83, 84, 65, 84, - 116, 0, 0, 0, 7, 0, - 0, 0, 2, 0, 0, 0, - 0, 0, 0, 0, 3, 0, - 0, 0, 3, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 2, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 82, 68, 69, 70, 120, 2, - 0, 0, 1, 0, 0, 0, - 188, 0, 0, 0, 4, 0, - 0, 0, 28, 0, 0, 0, - 0, 4, 255, 255, 0, 1, - 0, 0, 69, 2, 0, 0, - 156, 0, 0, 0, 3, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 0, 0, 165, 0, 0, 0, - 2, 0, 0, 0, 5, 0, - 0, 0, 4, 0, 0, 0, - 255, 255, 255, 255, 0, 0, - 0, 0, 1, 0, 0, 0, - 12, 0, 0, 0, 170, 0, - 0, 0, 2, 0, 0, 0, - 5, 0, 0, 0, 4, 0, - 0, 0, 255, 255, 255, 255, - 3, 0, 0, 0, 1, 0, 0, 0, 13, 0, 0, 0, - 176, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 0, 0, 115, 83, 97, 109, - 112, 108, 101, 114, 0, 116, - 82, 71, 66, 0, 116, 77, - 97, 115, 107, 0, 36, 71, - 108, 111, 98, 97, 108, 115, - 0, 171, 171, 171, 176, 0, - 0, 0, 8, 0, 0, 0, - 212, 0, 0, 0, 224, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 148, 1, - 0, 0, 0, 0, 0, 0, - 16, 0, 0, 0, 0, 0, - 0, 0, 160, 1, 0, 0, - 0, 0, 0, 0, 176, 1, - 0, 0, 16, 0, 0, 0, - 4, 0, 0, 0, 2, 0, - 0, 0, 192, 1, 0, 0, - 0, 0, 0, 0, 208, 1, - 0, 0, 32, 0, 0, 0, - 64, 0, 0, 0, 0, 0, - 0, 0, 224, 1, 0, 0, - 0, 0, 0, 0, 240, 1, - 0, 0, 96, 0, 0, 0, - 64, 0, 0, 0, 0, 0, - 0, 0, 224, 1, 0, 0, - 0, 0, 0, 0, 252, 1, - 0, 0, 160, 0, 0, 0, - 16, 0, 0, 0, 0, 0, - 0, 0, 160, 1, 0, 0, - 0, 0, 0, 0, 16, 2, + 170, 0, 0, 0, 2, 0, + 0, 0, 5, 0, 0, 0, + 4, 0, 0, 0, 255, 255, + 255, 255, 5, 0, 0, 0, + 1, 0, 0, 0, 13, 0, 0, 0, 176, 0, 0, 0, - 16, 0, 0, 0, 0, 0, - 0, 0, 32, 2, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 115, 83, + 97, 109, 112, 108, 101, 114, + 0, 116, 82, 71, 66, 0, + 116, 77, 97, 115, 107, 0, + 36, 71, 108, 111, 98, 97, + 108, 115, 0, 171, 171, 171, + 176, 0, 0, 0, 10, 0, + 0, 0, 212, 0, 0, 0, + 48, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 196, 1, 0, 0, 0, 0, + 0, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 208, 1, + 0, 0, 0, 0, 0, 0, + 224, 1, 0, 0, 16, 0, + 0, 0, 4, 0, 0, 0, + 2, 0, 0, 0, 240, 1, + 0, 0, 0, 0, 0, 0, + 0, 2, 0, 0, 32, 0, + 0, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 16, 2, + 0, 0, 0, 0, 0, 0, + 32, 2, 0, 0, 48, 0, + 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 48, 2, - 0, 0, 192, 0, 0, 0, - 16, 0, 0, 0, 0, 0, - 0, 0, 32, 2, 0, 0, - 0, 0, 0, 0, 59, 2, - 0, 0, 208, 0, 0, 0, - 16, 0, 0, 0, 0, 0, - 0, 0, 32, 2, 0, 0, + 0, 0, 0, 0, 0, 0, + 64, 2, 0, 0, 112, 0, + 0, 0, 64, 0, 0, 0, + 0, 0, 0, 0, 48, 2, + 0, 0, 0, 0, 0, 0, + 76, 2, 0, 0, 176, 0, + 0, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 208, 1, + 0, 0, 0, 0, 0, 0, + 96, 2, 0, 0, 192, 0, + 0, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 112, 2, + 0, 0, 0, 0, 0, 0, + 128, 2, 0, 0, 208, 0, + 0, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 112, 2, + 0, 0, 0, 0, 0, 0, + 139, 2, 0, 0, 224, 0, + 0, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 112, 2, + 0, 0, 0, 0, 0, 0, + 149, 2, 0, 0, 240, 0, + 0, 0, 64, 0, 0, 0, + 0, 0, 0, 0, 48, 2, + 0, 0, 0, 0, 0, 0, + 102, 76, 97, 121, 101, 114, + 67, 111, 108, 111, 114, 0, + 1, 0, 3, 0, 1, 0, + 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 102, 76, - 97, 121, 101, 114, 67, 111, - 108, 111, 114, 0, 1, 0, + 97, 121, 101, 114, 79, 112, + 97, 99, 105, 116, 121, 0, + 171, 171, 0, 0, 3, 0, + 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 105, 66, 108, 101, 110, 100, + 67, 111, 110, 102, 105, 103, + 0, 171, 171, 171, 1, 0, + 19, 0, 1, 0, 4, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 109, 76, 97, 121, + 101, 114, 84, 114, 97, 110, + 115, 102, 111, 114, 109, 0, + 3, 0, 3, 0, 4, 0, + 4, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 109, 80, + 114, 111, 106, 101, 99, 116, + 105, 111, 110, 0, 118, 82, + 101, 110, 100, 101, 114, 84, + 97, 114, 103, 101, 116, 79, + 102, 102, 115, 101, 116, 0, + 118, 84, 101, 120, 116, 117, + 114, 101, 67, 111, 111, 114, + 100, 115, 0, 171, 1, 0, 3, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 102, 76, 97, 121, - 101, 114, 79, 112, 97, 99, - 105, 116, 121, 0, 171, 171, - 0, 0, 3, 0, 1, 0, - 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 109, 76, - 97, 121, 101, 114, 84, 114, - 97, 110, 115, 102, 111, 114, - 109, 0, 3, 0, 3, 0, - 4, 0, 4, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 109, 80, 114, 111, 106, 101, - 99, 116, 105, 111, 110, 0, - 118, 82, 101, 110, 100, 101, - 114, 84, 97, 114, 103, 101, - 116, 79, 102, 102, 115, 101, - 116, 0, 118, 84, 101, 120, - 116, 117, 114, 101, 67, 111, - 111, 114, 100, 115, 0, 171, - 1, 0, 3, 0, 1, 0, - 4, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 118, 76, - 97, 121, 101, 114, 81, 117, - 97, 100, 0, 118, 77, 97, - 115, 107, 81, 117, 97, 100, - 0, 77, 105, 99, 114, 111, - 115, 111, 102, 116, 32, 40, - 82, 41, 32, 72, 76, 83, - 76, 32, 83, 104, 97, 100, - 101, 114, 32, 67, 111, 109, - 112, 105, 108, 101, 114, 32, - 54, 46, 51, 46, 57, 54, - 48, 48, 46, 49, 54, 51, - 56, 52, 0, 171, 73, 83, + 0, 0, 118, 76, 97, 121, + 101, 114, 81, 117, 97, 100, + 0, 118, 77, 97, 115, 107, + 81, 117, 97, 100, 0, 109, + 66, 97, 99, 107, 100, 114, + 111, 112, 84, 114, 97, 110, + 115, 102, 111, 114, 109, 0, + 77, 105, 99, 114, 111, 115, + 111, 102, 116, 32, 40, 82, + 41, 32, 72, 76, 83, 76, + 32, 83, 104, 97, 100, 101, + 114, 32, 67, 111, 109, 112, + 105, 108, 101, 114, 32, 54, + 46, 51, 46, 57, 54, 48, + 48, 46, 49, 54, 51, 56, + 52, 0, 171, 171, 73, 83, 71, 78, 104, 0, 0, 0, 3, 0, 0, 0, 8, 0, 0, 0, 80, 0, 0, 0, @@ -4582,7 +3770,7 @@ const BYTE RGBAShaderMaskPremul[] = 83, 86, 95, 84, 97, 114, 103, 101, 116, 0, 171, 171 }; -ShaderBytes sRGBAShaderMaskPremul = { RGBAShaderMaskPremul, sizeof(RGBAShaderMaskPremul) }; +ShaderBytes sRGBShaderMask = { RGBShaderMask, sizeof(RGBShaderMask) }; #if 0 // // Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 @@ -4595,12 +3783,371 @@ ShaderBytes sRGBAShaderMaskPremul = { RGBAShaderMaskPremul, sizeof(RGBAShaderMas // // float4 fLayerColor; // Offset: 0 Size: 16 [unused] // float fLayerOpacity; // Offset: 16 Size: 4 -// float4x4 mLayerTransform; // Offset: 32 Size: 64 [unused] -// float4x4 mProjection; // Offset: 96 Size: 64 [unused] -// float4 vRenderTargetOffset; // Offset: 160 Size: 16 [unused] -// float4 vTextureCoords; // Offset: 176 Size: 16 [unused] -// float4 vLayerQuad; // Offset: 192 Size: 16 [unused] -// float4 vMaskQuad; // Offset: 208 Size: 16 [unused] +// uint4 iBlendConfig; // Offset: 32 Size: 16 [unused] +// float4x4 mLayerTransform; // Offset: 48 Size: 64 [unused] +// float4x4 mProjection; // Offset: 112 Size: 64 [unused] +// float4 vRenderTargetOffset; // Offset: 176 Size: 16 [unused] +// float4 vTextureCoords; // Offset: 192 Size: 16 [unused] +// float4 vLayerQuad; // Offset: 208 Size: 16 [unused] +// float4 vMaskQuad; // Offset: 224 Size: 16 [unused] +// float4x4 mBackdropTransform; // Offset: 240 Size: 64 [unused] +// +// } +// +// +// Resource Bindings: +// +// Name Type Format Dim Slot Elements +// ------------------------------ ---------- ------- ----------- ---- -------- +// sSampler sampler NA NA 0 1 +// tRGB texture float4 2d 0 1 +// tMask texture float4 2d 5 1 +// $Globals cbuffer NA NA 0 1 +// +// +// +// Input signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// SV_Position 0 xyzw 0 POS float +// TEXCOORD 0 xy 1 NONE float xy +// TEXCOORD 1 zw 1 NONE float zw +// +// +// Output signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// SV_Target 0 xyzw 0 TARGET float xyzw +// +// +// Constant buffer to DX9 shader constant mappings: +// +// Target Reg Buffer Start Reg # of Regs Data Conversion +// ---------- ------- --------- --------- ---------------------- +// c0 cb0 1 1 ( FLT, FLT, FLT, FLT) +// +// +// Sampler/Resource to DX9 shader sampler mappings: +// +// Target Sampler Source Sampler Source Resource +// -------------- --------------- ---------------- +// s0 s0 t0 +// s1 s0 t5 +// +// +// Level9 shader bytecode: +// + ps_2_x + dcl t0 + dcl_2d s0 + dcl_2d s1 + mov r0.xy, t0.wzzw + texld r1, t0, s0 + texld r0, r0, s1 + mul r1, r1, c0.x + mul r0, r0.x, r1 + mov oC0, r0 + +// approximately 6 instruction slots used (2 texture, 4 arithmetic) +ps_4_0 +dcl_constantbuffer cb0[2], immediateIndexed +dcl_sampler s0, mode_default +dcl_resource_texture2d (float,float,float,float) t0 +dcl_resource_texture2d (float,float,float,float) t5 +dcl_input_ps linear v1.xy +dcl_input_ps linear v1.zw +dcl_output o0.xyzw +dcl_temps 2 +sample r0.xyzw, v1.xyxx, t0.xyzw, s0 +mul r0.xyzw, r0.xyzw, cb0[1].xxxx +sample r1.xyzw, v1.zwzz, t5.xyzw, s0 +mul o0.xyzw, r0.xyzw, r1.xxxx +ret +// Approximately 5 instruction slots used +#endif + +const BYTE RGBAShaderMask[] = +{ + 68, 88, 66, 67, 4, 189, + 159, 243, 83, 63, 56, 82, + 222, 120, 117, 50, 17, 240, + 195, 36, 1, 0, 0, 0, + 0, 6, 0, 0, 6, 0, + 0, 0, 56, 0, 0, 0, + 252, 0, 0, 0, 252, 1, + 0, 0, 120, 2, 0, 0, + 92, 5, 0, 0, 204, 5, + 0, 0, 65, 111, 110, 57, + 188, 0, 0, 0, 188, 0, + 0, 0, 0, 2, 255, 255, + 132, 0, 0, 0, 56, 0, + 0, 0, 1, 0, 44, 0, + 0, 0, 56, 0, 0, 0, + 56, 0, 2, 0, 36, 0, + 0, 0, 56, 0, 0, 0, + 0, 0, 5, 0, 1, 0, + 0, 0, 1, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 1, 2, 255, 255, 31, 0, + 0, 2, 0, 0, 0, 128, + 0, 0, 15, 176, 31, 0, + 0, 2, 0, 0, 0, 144, + 0, 8, 15, 160, 31, 0, + 0, 2, 0, 0, 0, 144, + 1, 8, 15, 160, 1, 0, + 0, 2, 0, 0, 3, 128, + 0, 0, 235, 176, 66, 0, + 0, 3, 1, 0, 15, 128, + 0, 0, 228, 176, 0, 8, + 228, 160, 66, 0, 0, 3, + 0, 0, 15, 128, 0, 0, + 228, 128, 1, 8, 228, 160, + 5, 0, 0, 3, 1, 0, + 15, 128, 1, 0, 228, 128, + 0, 0, 0, 160, 5, 0, + 0, 3, 0, 0, 15, 128, + 0, 0, 0, 128, 1, 0, + 228, 128, 1, 0, 0, 2, + 0, 8, 15, 128, 0, 0, + 228, 128, 255, 255, 0, 0, + 83, 72, 68, 82, 248, 0, + 0, 0, 64, 0, 0, 0, + 62, 0, 0, 0, 89, 0, + 0, 4, 70, 142, 32, 0, + 0, 0, 0, 0, 2, 0, + 0, 0, 90, 0, 0, 3, + 0, 96, 16, 0, 0, 0, + 0, 0, 88, 24, 0, 4, + 0, 112, 16, 0, 0, 0, + 0, 0, 85, 85, 0, 0, + 88, 24, 0, 4, 0, 112, + 16, 0, 5, 0, 0, 0, + 85, 85, 0, 0, 98, 16, + 0, 3, 50, 16, 16, 0, + 1, 0, 0, 0, 98, 16, + 0, 3, 194, 16, 16, 0, + 1, 0, 0, 0, 101, 0, + 0, 3, 242, 32, 16, 0, + 0, 0, 0, 0, 104, 0, + 0, 2, 2, 0, 0, 0, + 69, 0, 0, 9, 242, 0, + 16, 0, 0, 0, 0, 0, + 70, 16, 16, 0, 1, 0, + 0, 0, 70, 126, 16, 0, + 0, 0, 0, 0, 0, 96, + 16, 0, 0, 0, 0, 0, + 56, 0, 0, 8, 242, 0, + 16, 0, 0, 0, 0, 0, + 70, 14, 16, 0, 0, 0, + 0, 0, 6, 128, 32, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 69, 0, 0, 9, + 242, 0, 16, 0, 1, 0, + 0, 0, 230, 26, 16, 0, + 1, 0, 0, 0, 70, 126, + 16, 0, 5, 0, 0, 0, + 0, 96, 16, 0, 0, 0, + 0, 0, 56, 0, 0, 7, + 242, 32, 16, 0, 0, 0, + 0, 0, 70, 14, 16, 0, + 0, 0, 0, 0, 6, 0, + 16, 0, 1, 0, 0, 0, + 62, 0, 0, 1, 83, 84, + 65, 84, 116, 0, 0, 0, + 5, 0, 0, 0, 2, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 2, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 82, 68, 69, 70, + 220, 2, 0, 0, 1, 0, + 0, 0, 188, 0, 0, 0, + 4, 0, 0, 0, 28, 0, + 0, 0, 0, 4, 255, 255, + 0, 1, 0, 0, 168, 2, + 0, 0, 156, 0, 0, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, + 1, 0, 0, 0, 165, 0, + 0, 0, 2, 0, 0, 0, + 5, 0, 0, 0, 4, 0, + 0, 0, 255, 255, 255, 255, + 0, 0, 0, 0, 1, 0, + 0, 0, 13, 0, 0, 0, + 170, 0, 0, 0, 2, 0, + 0, 0, 5, 0, 0, 0, + 4, 0, 0, 0, 255, 255, + 255, 255, 5, 0, 0, 0, + 1, 0, 0, 0, 13, 0, + 0, 0, 176, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 115, 83, + 97, 109, 112, 108, 101, 114, + 0, 116, 82, 71, 66, 0, + 116, 77, 97, 115, 107, 0, + 36, 71, 108, 111, 98, 97, + 108, 115, 0, 171, 171, 171, + 176, 0, 0, 0, 10, 0, + 0, 0, 212, 0, 0, 0, + 48, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 196, 1, 0, 0, 0, 0, + 0, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 208, 1, + 0, 0, 0, 0, 0, 0, + 224, 1, 0, 0, 16, 0, + 0, 0, 4, 0, 0, 0, + 2, 0, 0, 0, 240, 1, + 0, 0, 0, 0, 0, 0, + 0, 2, 0, 0, 32, 0, + 0, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 16, 2, + 0, 0, 0, 0, 0, 0, + 32, 2, 0, 0, 48, 0, + 0, 0, 64, 0, 0, 0, + 0, 0, 0, 0, 48, 2, + 0, 0, 0, 0, 0, 0, + 64, 2, 0, 0, 112, 0, + 0, 0, 64, 0, 0, 0, + 0, 0, 0, 0, 48, 2, + 0, 0, 0, 0, 0, 0, + 76, 2, 0, 0, 176, 0, + 0, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 208, 1, + 0, 0, 0, 0, 0, 0, + 96, 2, 0, 0, 192, 0, + 0, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 112, 2, + 0, 0, 0, 0, 0, 0, + 128, 2, 0, 0, 208, 0, + 0, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 112, 2, + 0, 0, 0, 0, 0, 0, + 139, 2, 0, 0, 224, 0, + 0, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 112, 2, + 0, 0, 0, 0, 0, 0, + 149, 2, 0, 0, 240, 0, + 0, 0, 64, 0, 0, 0, + 0, 0, 0, 0, 48, 2, + 0, 0, 0, 0, 0, 0, + 102, 76, 97, 121, 101, 114, + 67, 111, 108, 111, 114, 0, + 1, 0, 3, 0, 1, 0, + 4, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 102, 76, + 97, 121, 101, 114, 79, 112, + 97, 99, 105, 116, 121, 0, + 171, 171, 0, 0, 3, 0, + 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 105, 66, 108, 101, 110, 100, + 67, 111, 110, 102, 105, 103, + 0, 171, 171, 171, 1, 0, + 19, 0, 1, 0, 4, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 109, 76, 97, 121, + 101, 114, 84, 114, 97, 110, + 115, 102, 111, 114, 109, 0, + 3, 0, 3, 0, 4, 0, + 4, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 109, 80, + 114, 111, 106, 101, 99, 116, + 105, 111, 110, 0, 118, 82, + 101, 110, 100, 101, 114, 84, + 97, 114, 103, 101, 116, 79, + 102, 102, 115, 101, 116, 0, + 118, 84, 101, 120, 116, 117, + 114, 101, 67, 111, 111, 114, + 100, 115, 0, 171, 1, 0, + 3, 0, 1, 0, 4, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 118, 76, 97, 121, + 101, 114, 81, 117, 97, 100, + 0, 118, 77, 97, 115, 107, + 81, 117, 97, 100, 0, 109, + 66, 97, 99, 107, 100, 114, + 111, 112, 84, 114, 97, 110, + 115, 102, 111, 114, 109, 0, + 77, 105, 99, 114, 111, 115, + 111, 102, 116, 32, 40, 82, + 41, 32, 72, 76, 83, 76, + 32, 83, 104, 97, 100, 101, + 114, 32, 67, 111, 109, 112, + 105, 108, 101, 114, 32, 54, + 46, 51, 46, 57, 54, 48, + 48, 46, 49, 54, 51, 56, + 52, 0, 171, 171, 73, 83, + 71, 78, 104, 0, 0, 0, + 3, 0, 0, 0, 8, 0, + 0, 0, 80, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 15, 0, + 0, 0, 92, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 1, 0, 0, 0, 3, 3, + 0, 0, 92, 0, 0, 0, + 1, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 1, 0, 0, 0, 12, 12, + 0, 0, 83, 86, 95, 80, + 111, 115, 105, 116, 105, 111, + 110, 0, 84, 69, 88, 67, + 79, 79, 82, 68, 0, 171, + 171, 171, 79, 83, 71, 78, + 44, 0, 0, 0, 1, 0, + 0, 0, 8, 0, 0, 0, + 32, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 15, 0, 0, 0, + 83, 86, 95, 84, 97, 114, + 103, 101, 116, 0, 171, 171 +}; +ShaderBytes sRGBAShaderMask = { RGBAShaderMask, sizeof(RGBAShaderMask) }; +#if 0 +// +// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 +// +// +// Buffer Definitions: +// +// cbuffer $Globals +// { +// +// float4 fLayerColor; // Offset: 0 Size: 16 [unused] +// float fLayerOpacity; // Offset: 16 Size: 4 +// uint4 iBlendConfig; // Offset: 32 Size: 16 [unused] +// float4x4 mLayerTransform; // Offset: 48 Size: 64 [unused] +// float4x4 mProjection; // Offset: 112 Size: 64 [unused] +// float4 vRenderTargetOffset; // Offset: 176 Size: 16 [unused] +// float4 vTextureCoords; // Offset: 192 Size: 16 [unused] +// float4 vLayerQuad; // Offset: 208 Size: 16 [unused] +// float4 vMaskQuad; // Offset: 224 Size: 16 [unused] +// float4x4 mBackdropTransform; // Offset: 240 Size: 64 [unused] // // } // @@ -4612,7 +4159,7 @@ ShaderBytes sRGBAShaderMaskPremul = { RGBAShaderMaskPremul, sizeof(RGBAShaderMas // sSampler sampler NA NA 0 1 // LayerTextureSamplerLinear sampler NA NA 1 1 // tRGB texture float4 2d 0 1 -// tMask texture float4 2d 3 1 +// tMask texture float4 2d 5 1 // $Globals cbuffer NA NA 0 1 // // @@ -4645,7 +4192,7 @@ ShaderBytes sRGBAShaderMaskPremul = { RGBAShaderMaskPremul, sizeof(RGBAShaderMas // Target Sampler Source Sampler Source Resource // -------------- --------------- ---------------- // s0 s0 t0 -// s1 s1 t3 +// s1 s1 t5 // // // Level9 shader bytecode: @@ -4669,13 +4216,13 @@ dcl_constantbuffer cb0[2], immediateIndexed dcl_sampler s0, mode_default dcl_sampler s1, mode_default dcl_resource_texture2d (float,float,float,float) t0 -dcl_resource_texture2d (float,float,float,float) t3 +dcl_resource_texture2d (float,float,float,float) t5 dcl_input_ps linear v1.xy dcl_input_ps linear v2.xyz dcl_output o0.xyzw dcl_temps 2 div r0.xy, v2.xyxx, v2.zzzz -sample r0.xyzw, r0.xyxx, t3.xyzw, s1 +sample r0.xyzw, r0.xyxx, t5.xyzw, s1 sample r1.xyzw, v1.xyxx, t0.xyzw, s0 mul r1.xyzw, r1.xyzw, cb0[1].xxxx mul o0.xyzw, r0.xxxx, r1.xyzw @@ -4685,15 +4232,15 @@ ret const BYTE RGBAShaderMask3D[] = { - 68, 88, 66, 67, 216, 42, - 250, 215, 154, 11, 43, 24, - 15, 254, 10, 66, 72, 210, - 238, 215, 1, 0, 0, 0, - 24, 6, 0, 0, 6, 0, + 68, 88, 66, 67, 3, 204, + 183, 228, 12, 40, 73, 204, + 169, 156, 99, 236, 238, 160, + 185, 204, 1, 0, 0, 0, + 124, 6, 0, 0, 6, 0, 0, 0, 56, 0, 0, 0, 24, 1, 0, 0, 64, 2, 0, 0, 188, 2, 0, 0, - 116, 5, 0, 0, 228, 5, + 216, 5, 0, 0, 72, 6, 0, 0, 65, 111, 110, 57, 216, 0, 0, 0, 216, 0, 0, 0, 0, 2, 255, 255, @@ -4702,7 +4249,7 @@ const BYTE RGBAShaderMask3D[] = 0, 0, 56, 0, 0, 0, 56, 0, 2, 0, 36, 0, 0, 0, 56, 0, 0, 0, - 0, 0, 3, 1, 1, 0, + 0, 0, 5, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 2, 255, 255, 31, 0, @@ -4745,7 +4292,7 @@ const BYTE RGBAShaderMask3D[] = 16, 0, 0, 0, 0, 0, 85, 85, 0, 0, 88, 24, 0, 4, 0, 112, 16, 0, - 3, 0, 0, 0, 85, 85, + 5, 0, 0, 0, 85, 85, 0, 0, 98, 16, 0, 3, 50, 16, 16, 0, 1, 0, 0, 0, 98, 16, 0, 3, @@ -4762,7 +4309,7 @@ const BYTE RGBAShaderMask3D[] = 242, 0, 16, 0, 0, 0, 0, 0, 70, 0, 16, 0, 0, 0, 0, 0, 70, 126, - 16, 0, 3, 0, 0, 0, + 16, 0, 5, 0, 0, 0, 0, 96, 16, 0, 1, 0, 0, 0, 69, 0, 0, 9, 242, 0, 16, 0, 1, 0, @@ -4802,12 +4349,12 @@ const BYTE RGBAShaderMask3D[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 68, - 69, 70, 176, 2, 0, 0, + 69, 70, 20, 3, 0, 0, 1, 0, 0, 0, 244, 0, 0, 0, 5, 0, 0, 0, 28, 0, 0, 0, 0, 4, 255, 255, 0, 1, 0, 0, - 125, 2, 0, 0, 188, 0, + 224, 2, 0, 0, 188, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -4823,11 +4370,11 @@ const BYTE RGBAShaderMask3D[] = 0, 0, 4, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 1, 0, 0, 0, - 12, 0, 0, 0, 228, 0, + 13, 0, 0, 0, 228, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, 255, 255, 255, 255, - 3, 0, 0, 0, 1, 0, + 5, 0, 0, 0, 1, 0, 0, 0, 13, 0, 0, 0, 234, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -4844,41 +4391,49 @@ const BYTE RGBAShaderMask3D[] = 116, 77, 97, 115, 107, 0, 36, 71, 108, 111, 98, 97, 108, 115, 0, 171, 234, 0, - 0, 0, 8, 0, 0, 0, - 12, 1, 0, 0, 224, 0, + 0, 0, 10, 0, 0, 0, + 12, 1, 0, 0, 48, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 204, 1, + 0, 0, 0, 0, 252, 1, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, - 0, 0, 216, 1, 0, 0, - 0, 0, 0, 0, 232, 1, + 0, 0, 8, 2, 0, 0, + 0, 0, 0, 0, 24, 2, 0, 0, 16, 0, 0, 0, 4, 0, 0, 0, 2, 0, - 0, 0, 248, 1, 0, 0, - 0, 0, 0, 0, 8, 2, + 0, 0, 40, 2, 0, 0, + 0, 0, 0, 0, 56, 2, 0, 0, 32, 0, 0, 0, - 64, 0, 0, 0, 0, 0, - 0, 0, 24, 2, 0, 0, - 0, 0, 0, 0, 40, 2, - 0, 0, 96, 0, 0, 0, - 64, 0, 0, 0, 0, 0, - 0, 0, 24, 2, 0, 0, - 0, 0, 0, 0, 52, 2, - 0, 0, 160, 0, 0, 0, 16, 0, 0, 0, 0, 0, - 0, 0, 216, 1, 0, 0, - 0, 0, 0, 0, 72, 2, + 0, 0, 72, 2, 0, 0, + 0, 0, 0, 0, 88, 2, + 0, 0, 48, 0, 0, 0, + 64, 0, 0, 0, 0, 0, + 0, 0, 104, 2, 0, 0, + 0, 0, 0, 0, 120, 2, + 0, 0, 112, 0, 0, 0, + 64, 0, 0, 0, 0, 0, + 0, 0, 104, 2, 0, 0, + 0, 0, 0, 0, 132, 2, 0, 0, 176, 0, 0, 0, 16, 0, 0, 0, 0, 0, - 0, 0, 88, 2, 0, 0, - 0, 0, 0, 0, 104, 2, + 0, 0, 8, 2, 0, 0, + 0, 0, 0, 0, 152, 2, 0, 0, 192, 0, 0, 0, 16, 0, 0, 0, 0, 0, - 0, 0, 88, 2, 0, 0, - 0, 0, 0, 0, 115, 2, + 0, 0, 168, 2, 0, 0, + 0, 0, 0, 0, 184, 2, 0, 0, 208, 0, 0, 0, 16, 0, 0, 0, 0, 0, - 0, 0, 88, 2, 0, 0, + 0, 0, 168, 2, 0, 0, + 0, 0, 0, 0, 195, 2, + 0, 0, 224, 0, 0, 0, + 16, 0, 0, 0, 0, 0, + 0, 0, 168, 2, 0, 0, + 0, 0, 0, 0, 205, 2, + 0, 0, 240, 0, 0, 0, + 64, 0, 0, 0, 0, 0, + 0, 0, 104, 2, 0, 0, 0, 0, 0, 0, 102, 76, 97, 121, 101, 114, 67, 111, 108, 111, 114, 0, 1, 0, @@ -4889,413 +4444,44 @@ const BYTE RGBAShaderMask3D[] = 105, 116, 121, 0, 171, 171, 0, 0, 3, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 109, 76, - 97, 121, 101, 114, 84, 114, - 97, 110, 115, 102, 111, 114, - 109, 0, 3, 0, 3, 0, - 4, 0, 4, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 109, 80, 114, 111, 106, 101, - 99, 116, 105, 111, 110, 0, - 118, 82, 101, 110, 100, 101, - 114, 84, 97, 114, 103, 101, - 116, 79, 102, 102, 115, 101, - 116, 0, 118, 84, 101, 120, - 116, 117, 114, 101, 67, 111, - 111, 114, 100, 115, 0, 171, - 1, 0, 3, 0, 1, 0, - 4, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 118, 76, - 97, 121, 101, 114, 81, 117, - 97, 100, 0, 118, 77, 97, - 115, 107, 81, 117, 97, 100, - 0, 77, 105, 99, 114, 111, - 115, 111, 102, 116, 32, 40, - 82, 41, 32, 72, 76, 83, - 76, 32, 83, 104, 97, 100, - 101, 114, 32, 67, 111, 109, - 112, 105, 108, 101, 114, 32, - 54, 46, 51, 46, 57, 54, - 48, 48, 46, 49, 54, 51, - 56, 52, 0, 171, 73, 83, - 71, 78, 104, 0, 0, 0, - 3, 0, 0, 0, 8, 0, - 0, 0, 80, 0, 0, 0, - 0, 0, 0, 0, 1, 0, - 0, 0, 3, 0, 0, 0, - 0, 0, 0, 0, 15, 0, - 0, 0, 92, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, - 1, 0, 0, 0, 3, 3, - 0, 0, 92, 0, 0, 0, - 1, 0, 0, 0, 0, 0, - 0, 0, 3, 0, 0, 0, - 2, 0, 0, 0, 7, 7, - 0, 0, 83, 86, 95, 80, - 111, 115, 105, 116, 105, 111, - 110, 0, 84, 69, 88, 67, - 79, 79, 82, 68, 0, 171, - 171, 171, 79, 83, 71, 78, - 44, 0, 0, 0, 1, 0, - 0, 0, 8, 0, 0, 0, - 32, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 0, 0, - 0, 0, 15, 0, 0, 0, - 83, 86, 95, 84, 97, 114, - 103, 101, 116, 0, 171, 171 -}; -ShaderBytes sRGBAShaderMask3D = { RGBAShaderMask3D, sizeof(RGBAShaderMask3D) }; -#if 0 -// -// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 -// -// -// Buffer Definitions: -// -// cbuffer $Globals -// { -// -// float4 fLayerColor; // Offset: 0 Size: 16 [unused] -// float fLayerOpacity; // Offset: 16 Size: 4 -// float4x4 mLayerTransform; // Offset: 32 Size: 64 [unused] -// float4x4 mProjection; // Offset: 96 Size: 64 [unused] -// float4 vRenderTargetOffset; // Offset: 160 Size: 16 [unused] -// float4 vTextureCoords; // Offset: 176 Size: 16 [unused] -// float4 vLayerQuad; // Offset: 192 Size: 16 [unused] -// float4 vMaskQuad; // Offset: 208 Size: 16 [unused] -// -// } -// -// -// Resource Bindings: -// -// Name Type Format Dim Slot Elements -// ------------------------------ ---------- ------- ----------- ---- -------- -// sSampler sampler NA NA 0 1 -// LayerTextureSamplerLinear sampler NA NA 1 1 -// tRGB texture float4 2d 0 1 -// tMask texture float4 2d 3 1 -// $Globals cbuffer NA NA 0 1 -// -// -// -// Input signature: -// -// Name Index Mask Register SysValue Format Used -// -------------------- ----- ------ -------- -------- ------- ------ -// SV_Position 0 xyzw 0 POS float -// TEXCOORD 0 xy 1 NONE float xy -// TEXCOORD 1 xyz 2 NONE float xyz -// -// -// Output signature: -// -// Name Index Mask Register SysValue Format Used -// -------------------- ----- ------ -------- -------- ------- ------ -// SV_Target 0 xyzw 0 TARGET float xyzw -// -// -// Constant buffer to DX9 shader constant mappings: -// -// Target Reg Buffer Start Reg # of Regs Data Conversion -// ---------- ------- --------- --------- ---------------------- -// c0 cb0 1 1 ( FLT, FLT, FLT, FLT) -// -// -// Sampler/Resource to DX9 shader sampler mappings: -// -// Target Sampler Source Sampler Source Resource -// -------------- --------------- ---------------- -// s0 s0 t0 -// s1 s1 t3 -// -// -// Level9 shader bytecode: -// - ps_2_x - dcl t0.xy - dcl t1.xyz - dcl_2d s0 - dcl_2d s1 - rcp r0.w, t1.z - mul r0.xy, r0.w, t1 - texld r1, t0, s0 - texld r0, r0, s1 - mul r1, r1, c0.x - mul r0, r0.x, r1 - mul r0.xyz, r0.w, r0 - mov oC0, r0 - -// approximately 8 instruction slots used (2 texture, 6 arithmetic) -ps_4_0 -dcl_constantbuffer cb0[2], immediateIndexed -dcl_sampler s0, mode_default -dcl_sampler s1, mode_default -dcl_resource_texture2d (float,float,float,float) t0 -dcl_resource_texture2d (float,float,float,float) t3 -dcl_input_ps linear v1.xy -dcl_input_ps linear v2.xyz -dcl_output o0.xyzw -dcl_temps 2 -div r0.xy, v2.xyxx, v2.zzzz -sample r0.xyzw, r0.xyxx, t3.xyzw, s1 -sample r1.xyzw, v1.xyxx, t0.xyzw, s0 -mul r1.xyzw, r1.xyzw, cb0[1].xxxx -mul r0.xyzw, r0.xxxx, r1.xyzw -mul o0.xyz, r0.wwww, r0.xyzx -mov o0.w, r0.w -ret -// Approximately 8 instruction slots used -#endif - -const BYTE RGBAShaderMask3DPremul[] = -{ - 68, 88, 66, 67, 55, 2, - 221, 89, 65, 95, 19, 52, - 117, 31, 78, 231, 8, 20, - 150, 44, 1, 0, 0, 0, - 88, 6, 0, 0, 6, 0, - 0, 0, 56, 0, 0, 0, - 40, 1, 0, 0, 128, 2, - 0, 0, 252, 2, 0, 0, - 180, 5, 0, 0, 36, 6, - 0, 0, 65, 111, 110, 57, - 232, 0, 0, 0, 232, 0, - 0, 0, 0, 2, 255, 255, - 176, 0, 0, 0, 56, 0, - 0, 0, 1, 0, 44, 0, - 0, 0, 56, 0, 0, 0, - 56, 0, 2, 0, 36, 0, - 0, 0, 56, 0, 0, 0, - 0, 0, 3, 1, 1, 0, - 0, 0, 1, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 1, 2, 255, 255, 31, 0, - 0, 2, 0, 0, 0, 128, - 0, 0, 3, 176, 31, 0, - 0, 2, 0, 0, 0, 128, - 1, 0, 7, 176, 31, 0, - 0, 2, 0, 0, 0, 144, - 0, 8, 15, 160, 31, 0, - 0, 2, 0, 0, 0, 144, - 1, 8, 15, 160, 6, 0, - 0, 2, 0, 0, 8, 128, - 1, 0, 170, 176, 5, 0, - 0, 3, 0, 0, 3, 128, - 0, 0, 255, 128, 1, 0, - 228, 176, 66, 0, 0, 3, - 1, 0, 15, 128, 0, 0, - 228, 176, 0, 8, 228, 160, - 66, 0, 0, 3, 0, 0, - 15, 128, 0, 0, 228, 128, - 1, 8, 228, 160, 5, 0, - 0, 3, 1, 0, 15, 128, - 1, 0, 228, 128, 0, 0, - 0, 160, 5, 0, 0, 3, - 0, 0, 15, 128, 0, 0, - 0, 128, 1, 0, 228, 128, - 5, 0, 0, 3, 0, 0, - 7, 128, 0, 0, 255, 128, - 0, 0, 228, 128, 1, 0, - 0, 2, 0, 8, 15, 128, - 0, 0, 228, 128, 255, 255, - 0, 0, 83, 72, 68, 82, - 80, 1, 0, 0, 64, 0, - 0, 0, 84, 0, 0, 0, - 89, 0, 0, 4, 70, 142, - 32, 0, 0, 0, 0, 0, - 2, 0, 0, 0, 90, 0, - 0, 3, 0, 96, 16, 0, - 0, 0, 0, 0, 90, 0, - 0, 3, 0, 96, 16, 0, - 1, 0, 0, 0, 88, 24, - 0, 4, 0, 112, 16, 0, - 0, 0, 0, 0, 85, 85, - 0, 0, 88, 24, 0, 4, - 0, 112, 16, 0, 3, 0, - 0, 0, 85, 85, 0, 0, - 98, 16, 0, 3, 50, 16, - 16, 0, 1, 0, 0, 0, - 98, 16, 0, 3, 114, 16, - 16, 0, 2, 0, 0, 0, - 101, 0, 0, 3, 242, 32, - 16, 0, 0, 0, 0, 0, - 104, 0, 0, 2, 2, 0, - 0, 0, 14, 0, 0, 7, - 50, 0, 16, 0, 0, 0, - 0, 0, 70, 16, 16, 0, - 2, 0, 0, 0, 166, 26, - 16, 0, 2, 0, 0, 0, - 69, 0, 0, 9, 242, 0, - 16, 0, 0, 0, 0, 0, - 70, 0, 16, 0, 0, 0, - 0, 0, 70, 126, 16, 0, - 3, 0, 0, 0, 0, 96, - 16, 0, 1, 0, 0, 0, - 69, 0, 0, 9, 242, 0, - 16, 0, 1, 0, 0, 0, - 70, 16, 16, 0, 1, 0, - 0, 0, 70, 126, 16, 0, - 0, 0, 0, 0, 0, 96, - 16, 0, 0, 0, 0, 0, - 56, 0, 0, 8, 242, 0, - 16, 0, 1, 0, 0, 0, - 70, 14, 16, 0, 1, 0, - 0, 0, 6, 128, 32, 0, - 0, 0, 0, 0, 1, 0, - 0, 0, 56, 0, 0, 7, - 242, 0, 16, 0, 0, 0, - 0, 0, 6, 0, 16, 0, - 0, 0, 0, 0, 70, 14, - 16, 0, 1, 0, 0, 0, - 56, 0, 0, 7, 114, 32, - 16, 0, 0, 0, 0, 0, - 246, 15, 16, 0, 0, 0, - 0, 0, 70, 2, 16, 0, - 0, 0, 0, 0, 54, 0, - 0, 5, 130, 32, 16, 0, - 0, 0, 0, 0, 58, 0, - 16, 0, 0, 0, 0, 0, - 62, 0, 0, 1, 83, 84, - 65, 84, 116, 0, 0, 0, - 8, 0, 0, 0, 2, 0, - 0, 0, 0, 0, 0, 0, - 3, 0, 0, 0, 4, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 2, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 82, 68, 69, 70, - 176, 2, 0, 0, 1, 0, - 0, 0, 244, 0, 0, 0, - 5, 0, 0, 0, 28, 0, - 0, 0, 0, 4, 255, 255, - 0, 1, 0, 0, 125, 2, - 0, 0, 188, 0, 0, 0, - 3, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 1, 0, 0, 0, - 1, 0, 0, 0, 197, 0, - 0, 0, 3, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 223, 0, 0, 0, 2, 0, - 0, 0, 5, 0, 0, 0, - 4, 0, 0, 0, 255, 255, - 255, 255, 0, 0, 0, 0, - 1, 0, 0, 0, 12, 0, - 0, 0, 228, 0, 0, 0, - 2, 0, 0, 0, 5, 0, - 0, 0, 4, 0, 0, 0, - 255, 255, 255, 255, 3, 0, - 0, 0, 1, 0, 0, 0, - 13, 0, 0, 0, 234, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, - 0, 0, 0, 0, 0, 0, - 115, 83, 97, 109, 112, 108, - 101, 114, 0, 76, 97, 121, - 101, 114, 84, 101, 120, 116, - 117, 114, 101, 83, 97, 109, - 112, 108, 101, 114, 76, 105, - 110, 101, 97, 114, 0, 116, - 82, 71, 66, 0, 116, 77, - 97, 115, 107, 0, 36, 71, - 108, 111, 98, 97, 108, 115, - 0, 171, 234, 0, 0, 0, - 8, 0, 0, 0, 12, 1, - 0, 0, 224, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 204, 1, 0, 0, - 0, 0, 0, 0, 16, 0, - 0, 0, 0, 0, 0, 0, - 216, 1, 0, 0, 0, 0, - 0, 0, 232, 1, 0, 0, - 16, 0, 0, 0, 4, 0, - 0, 0, 2, 0, 0, 0, - 248, 1, 0, 0, 0, 0, - 0, 0, 8, 2, 0, 0, - 32, 0, 0, 0, 64, 0, - 0, 0, 0, 0, 0, 0, - 24, 2, 0, 0, 0, 0, - 0, 0, 40, 2, 0, 0, - 96, 0, 0, 0, 64, 0, - 0, 0, 0, 0, 0, 0, - 24, 2, 0, 0, 0, 0, - 0, 0, 52, 2, 0, 0, - 160, 0, 0, 0, 16, 0, - 0, 0, 0, 0, 0, 0, - 216, 1, 0, 0, 0, 0, - 0, 0, 72, 2, 0, 0, - 176, 0, 0, 0, 16, 0, - 0, 0, 0, 0, 0, 0, - 88, 2, 0, 0, 0, 0, - 0, 0, 104, 2, 0, 0, - 192, 0, 0, 0, 16, 0, - 0, 0, 0, 0, 0, 0, - 88, 2, 0, 0, 0, 0, - 0, 0, 115, 2, 0, 0, - 208, 0, 0, 0, 16, 0, - 0, 0, 0, 0, 0, 0, - 88, 2, 0, 0, 0, 0, - 0, 0, 102, 76, 97, 121, - 101, 114, 67, 111, 108, 111, - 114, 0, 1, 0, 3, 0, + 0, 0, 0, 0, 105, 66, + 108, 101, 110, 100, 67, 111, + 110, 102, 105, 103, 0, 171, + 171, 171, 1, 0, 19, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 102, 76, 97, 121, 101, 114, - 79, 112, 97, 99, 105, 116, - 121, 0, 171, 171, 0, 0, - 3, 0, 1, 0, 1, 0, + 109, 76, 97, 121, 101, 114, + 84, 114, 97, 110, 115, 102, + 111, 114, 109, 0, 3, 0, + 3, 0, 4, 0, 4, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 109, 76, 97, 121, - 101, 114, 84, 114, 97, 110, - 115, 102, 111, 114, 109, 0, - 3, 0, 3, 0, 4, 0, - 4, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 109, 80, - 114, 111, 106, 101, 99, 116, - 105, 111, 110, 0, 118, 82, - 101, 110, 100, 101, 114, 84, - 97, 114, 103, 101, 116, 79, - 102, 102, 115, 101, 116, 0, - 118, 84, 101, 120, 116, 117, - 114, 101, 67, 111, 111, 114, - 100, 115, 0, 171, 1, 0, - 3, 0, 1, 0, 4, 0, + 0, 0, 109, 80, 114, 111, + 106, 101, 99, 116, 105, 111, + 110, 0, 118, 82, 101, 110, + 100, 101, 114, 84, 97, 114, + 103, 101, 116, 79, 102, 102, + 115, 101, 116, 0, 118, 84, + 101, 120, 116, 117, 114, 101, + 67, 111, 111, 114, 100, 115, + 0, 171, 1, 0, 3, 0, + 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 118, 76, 97, 121, - 101, 114, 81, 117, 97, 100, - 0, 118, 77, 97, 115, 107, - 81, 117, 97, 100, 0, 77, - 105, 99, 114, 111, 115, 111, - 102, 116, 32, 40, 82, 41, - 32, 72, 76, 83, 76, 32, - 83, 104, 97, 100, 101, 114, - 32, 67, 111, 109, 112, 105, - 108, 101, 114, 32, 54, 46, - 51, 46, 57, 54, 48, 48, - 46, 49, 54, 51, 56, 52, - 0, 171, 73, 83, 71, 78, + 118, 76, 97, 121, 101, 114, + 81, 117, 97, 100, 0, 118, + 77, 97, 115, 107, 81, 117, + 97, 100, 0, 109, 66, 97, + 99, 107, 100, 114, 111, 112, + 84, 114, 97, 110, 115, 102, + 111, 114, 109, 0, 77, 105, + 99, 114, 111, 115, 111, 102, + 116, 32, 40, 82, 41, 32, + 72, 76, 83, 76, 32, 83, + 104, 97, 100, 101, 114, 32, + 67, 111, 109, 112, 105, 108, + 101, 114, 32, 54, 46, 51, + 46, 57, 54, 48, 48, 46, + 49, 54, 51, 56, 52, 0, + 171, 171, 73, 83, 71, 78, 104, 0, 0, 0, 3, 0, 0, 0, 8, 0, 0, 0, 80, 0, 0, 0, 0, 0, @@ -5324,7 +4510,7 @@ const BYTE RGBAShaderMask3DPremul[] = 95, 84, 97, 114, 103, 101, 116, 0, 171, 171 }; -ShaderBytes sRGBAShaderMask3DPremul = { RGBAShaderMask3DPremul, sizeof(RGBAShaderMask3DPremul) }; +ShaderBytes sRGBAShaderMask3D = { RGBAShaderMask3D, sizeof(RGBAShaderMask3D) }; #if 0 // // Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 @@ -5337,12 +4523,14 @@ ShaderBytes sRGBAShaderMask3DPremul = { RGBAShaderMask3DPremul, sizeof(RGBAShade // // float4 fLayerColor; // Offset: 0 Size: 16 [unused] // float fLayerOpacity; // Offset: 16 Size: 4 -// float4x4 mLayerTransform; // Offset: 32 Size: 64 [unused] -// float4x4 mProjection; // Offset: 96 Size: 64 [unused] -// float4 vRenderTargetOffset; // Offset: 160 Size: 16 [unused] -// float4 vTextureCoords; // Offset: 176 Size: 16 [unused] -// float4 vLayerQuad; // Offset: 192 Size: 16 [unused] -// float4 vMaskQuad; // Offset: 208 Size: 16 [unused] +// uint4 iBlendConfig; // Offset: 32 Size: 16 [unused] +// float4x4 mLayerTransform; // Offset: 48 Size: 64 [unused] +// float4x4 mProjection; // Offset: 112 Size: 64 [unused] +// float4 vRenderTargetOffset; // Offset: 176 Size: 16 [unused] +// float4 vTextureCoords; // Offset: 192 Size: 16 [unused] +// float4 vLayerQuad; // Offset: 208 Size: 16 [unused] +// float4 vMaskQuad; // Offset: 224 Size: 16 [unused] +// float4x4 mBackdropTransform; // Offset: 240 Size: 64 [unused] // // } // @@ -5352,10 +4540,10 @@ ShaderBytes sRGBAShaderMask3DPremul = { RGBAShaderMask3DPremul, sizeof(RGBAShade // Name Type Format Dim Slot Elements // ------------------------------ ---------- ------- ----------- ---- -------- // sSampler sampler NA NA 0 1 -// tY texture float4 2d 0 1 -// tCb texture float4 2d 1 1 -// tCr texture float4 2d 2 1 -// tMask texture float4 2d 3 1 +// tY texture float4 2d 1 1 +// tCb texture float4 2d 2 1 +// tCr texture float4 2d 3 1 +// tMask texture float4 2d 5 1 // $Globals cbuffer NA NA 0 1 // // @@ -5387,10 +4575,10 @@ ShaderBytes sRGBAShaderMask3DPremul = { RGBAShaderMask3DPremul, sizeof(RGBAShade // // Target Sampler Source Sampler Source Resource // -------------- --------------- ---------------- -// s0 s0 t3 -// s1 s0 t0 -// s2 s0 t1 -// s3 s0 t2 +// s0 s0 t1 +// s1 s0 t2 +// s2 s0 t3 +// s3 s0 t5 // // // Level9 shader bytecode: @@ -5403,16 +4591,16 @@ ShaderBytes sRGBAShaderMask3DPremul = { RGBAShaderMask3DPremul, sizeof(RGBAShade dcl_2d s1 dcl_2d s2 dcl_2d s3 - texld r0, t0, s1 - texld r1, t0, s3 + texld r0, t0, s0 + texld r1, t0, s2 add r0.y, r1.x, c1.x mul r0.yz, r0.y, c1.xzww add r0.x, r0.x, c1.y mad r0.z, r0.x, c2.x, -r0.z mad r1.x, r0.x, c2.x, r0.y mov r2.xy, t0.wzzw - texld r3, t0, s2 - texld r2, r2, s0 + texld r3, t0, s1 + texld r2, r2, s3 add r0.y, r3.x, c1.x mad r1.y, r0.y, -c2.z, r0.z mul r0.y, r0.y, c2.y @@ -5426,29 +4614,29 @@ ShaderBytes sRGBAShaderMask3DPremul = { RGBAShaderMask3DPremul, sizeof(RGBAShade ps_4_0 dcl_constantbuffer cb0[2], immediateIndexed dcl_sampler s0, mode_default -dcl_resource_texture2d (float,float,float,float) t0 dcl_resource_texture2d (float,float,float,float) t1 dcl_resource_texture2d (float,float,float,float) t2 dcl_resource_texture2d (float,float,float,float) t3 +dcl_resource_texture2d (float,float,float,float) t5 dcl_input_ps linear v1.xy dcl_input_ps linear v1.zw dcl_output o0.xyzw dcl_temps 3 -sample r0.xyzw, v1.xyxx, t2.xyzw, s0 +sample r0.xyzw, v1.xyxx, t3.xyzw, s0 add r0.x, r0.x, l(-0.501960) mul r0.xy, r0.xxxx, l(1.596030, 0.812970, 0.000000, 0.000000) -sample r1.xyzw, v1.xyxx, t0.xyzw, s0 +sample r1.xyzw, v1.xyxx, t1.xyzw, s0 add r0.z, r1.x, l(-0.062750) mad r0.y, r0.z, l(1.164380), -r0.y mad r1.x, r0.z, l(1.164380), r0.x -sample r2.xyzw, v1.xyxx, t1.xyzw, s0 +sample r2.xyzw, v1.xyxx, t2.xyzw, s0 add r0.x, r2.x, l(-0.501960) mad r1.y, -r0.x, l(0.391760), r0.y mul r0.x, r0.x, l(2.017230) mad r1.z, r0.z, l(1.164380), r0.x mov r1.w, l(1.000000) mul r0.xyzw, r1.xyzw, cb0[1].xxxx -sample r1.xyzw, v1.zwzz, t3.xyzw, s0 +sample r1.xyzw, v1.zwzz, t5.xyzw, s0 mul o0.xyzw, r0.xyzw, r1.xxxx ret // Approximately 17 instruction slots used @@ -5456,15 +4644,15 @@ ret const BYTE YCbCrShaderMask[] = { - 68, 88, 66, 67, 154, 30, - 246, 171, 67, 224, 184, 33, - 20, 150, 106, 233, 226, 126, - 80, 130, 1, 0, 0, 0, - 168, 8, 0, 0, 6, 0, + 68, 88, 66, 67, 221, 32, + 127, 20, 214, 189, 35, 93, + 175, 146, 75, 225, 8, 148, + 130, 206, 1, 0, 0, 0, + 12, 9, 0, 0, 6, 0, 0, 0, 56, 0, 0, 0, 24, 2, 0, 0, 196, 4, 0, 0, 64, 5, 0, 0, - 4, 8, 0, 0, 116, 8, + 104, 8, 0, 0, 216, 8, 0, 0, 65, 111, 110, 57, 216, 1, 0, 0, 216, 1, 0, 0, 0, 2, 255, 255, @@ -5472,9 +4660,9 @@ const BYTE YCbCrShaderMask[] = 0, 0, 1, 0, 52, 0, 0, 0, 64, 0, 0, 0, 64, 0, 4, 0, 36, 0, - 0, 0, 64, 0, 3, 0, - 0, 0, 0, 0, 1, 0, - 1, 0, 2, 0, 2, 0, + 0, 0, 64, 0, 1, 0, + 0, 0, 2, 0, 1, 0, + 3, 0, 2, 0, 5, 0, 3, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 2, 255, 255, @@ -5498,9 +4686,9 @@ const BYTE YCbCrShaderMask[] = 0, 144, 3, 8, 15, 160, 66, 0, 0, 3, 0, 0, 15, 128, 0, 0, 228, 176, - 1, 8, 228, 160, 66, 0, + 0, 8, 228, 160, 66, 0, 0, 3, 1, 0, 15, 128, - 0, 0, 228, 176, 3, 8, + 0, 0, 228, 176, 2, 8, 228, 160, 2, 0, 0, 3, 0, 0, 2, 128, 1, 0, 0, 128, 1, 0, 0, 160, @@ -5520,9 +4708,9 @@ const BYTE YCbCrShaderMask[] = 3, 128, 0, 0, 235, 176, 66, 0, 0, 3, 3, 0, 15, 128, 0, 0, 228, 176, - 2, 8, 228, 160, 66, 0, + 1, 8, 228, 160, 66, 0, 0, 3, 2, 0, 15, 128, - 2, 0, 228, 128, 0, 8, + 2, 0, 228, 128, 3, 8, 228, 160, 2, 0, 0, 3, 0, 0, 2, 128, 3, 0, 0, 128, 1, 0, 0, 160, @@ -5554,15 +4742,15 @@ const BYTE YCbCrShaderMask[] = 0, 3, 0, 96, 16, 0, 0, 0, 0, 0, 88, 24, 0, 4, 0, 112, 16, 0, - 0, 0, 0, 0, 85, 85, + 1, 0, 0, 0, 85, 85, 0, 0, 88, 24, 0, 4, - 0, 112, 16, 0, 1, 0, + 0, 112, 16, 0, 2, 0, 0, 0, 85, 85, 0, 0, 88, 24, 0, 4, 0, 112, - 16, 0, 2, 0, 0, 0, + 16, 0, 3, 0, 0, 0, 85, 85, 0, 0, 88, 24, 0, 4, 0, 112, 16, 0, - 3, 0, 0, 0, 85, 85, + 5, 0, 0, 0, 85, 85, 0, 0, 98, 16, 0, 3, 50, 16, 16, 0, 1, 0, 0, 0, 98, 16, 0, 3, @@ -5574,7 +4762,7 @@ const BYTE YCbCrShaderMask[] = 0, 9, 242, 0, 16, 0, 0, 0, 0, 0, 70, 16, 16, 0, 1, 0, 0, 0, - 70, 126, 16, 0, 2, 0, + 70, 126, 16, 0, 3, 0, 0, 0, 0, 96, 16, 0, 0, 0, 0, 0, 0, 0, 0, 7, 18, 0, 16, 0, @@ -5592,7 +4780,7 @@ const BYTE YCbCrShaderMask[] = 16, 0, 1, 0, 0, 0, 70, 16, 16, 0, 1, 0, 0, 0, 70, 126, 16, 0, - 0, 0, 0, 0, 0, 96, + 1, 0, 0, 0, 0, 96, 16, 0, 0, 0, 0, 0, 0, 0, 0, 7, 66, 0, 16, 0, 0, 0, 0, 0, @@ -5615,7 +4803,7 @@ const BYTE YCbCrShaderMask[] = 242, 0, 16, 0, 2, 0, 0, 0, 70, 16, 16, 0, 1, 0, 0, 0, 70, 126, - 16, 0, 1, 0, 0, 0, + 16, 0, 2, 0, 0, 0, 0, 96, 16, 0, 0, 0, 0, 0, 0, 0, 0, 7, 18, 0, 16, 0, 0, 0, @@ -5652,7 +4840,7 @@ const BYTE YCbCrShaderMask[] = 16, 0, 1, 0, 0, 0, 230, 26, 16, 0, 1, 0, 0, 0, 70, 126, 16, 0, - 3, 0, 0, 0, 0, 96, + 5, 0, 0, 0, 0, 96, 16, 0, 0, 0, 0, 0, 56, 0, 0, 7, 242, 32, 16, 0, 0, 0, 0, 0, @@ -5680,12 +4868,12 @@ const BYTE YCbCrShaderMask[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 82, 68, 69, 70, 188, 2, + 82, 68, 69, 70, 32, 3, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 6, 0, 0, 0, 28, 0, 0, 0, 0, 4, 255, 255, 0, 1, - 0, 0, 137, 2, 0, 0, + 0, 0, 236, 2, 0, 0, 220, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -5694,23 +4882,23 @@ const BYTE YCbCrShaderMask[] = 0, 0, 229, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, - 255, 255, 255, 255, 0, 0, + 255, 255, 255, 255, 1, 0, 0, 0, 1, 0, 0, 0, - 12, 0, 0, 0, 232, 0, + 13, 0, 0, 0, 232, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, 255, 255, 255, 255, - 1, 0, 0, 0, 1, 0, - 0, 0, 12, 0, 0, 0, + 2, 0, 0, 0, 1, 0, + 0, 0, 13, 0, 0, 0, 236, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, 255, 255, - 255, 255, 2, 0, 0, 0, - 1, 0, 0, 0, 12, 0, + 255, 255, 3, 0, 0, 0, + 1, 0, 0, 0, 13, 0, 0, 0, 240, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, - 255, 255, 255, 255, 3, 0, + 255, 255, 255, 255, 5, 0, 0, 0, 1, 0, 0, 0, 13, 0, 0, 0, 246, 0, 0, 0, 0, 0, 0, 0, @@ -5724,41 +4912,49 @@ const BYTE YCbCrShaderMask[] = 114, 0, 116, 77, 97, 115, 107, 0, 36, 71, 108, 111, 98, 97, 108, 115, 0, 171, - 246, 0, 0, 0, 8, 0, + 246, 0, 0, 0, 10, 0, 0, 0, 24, 1, 0, 0, - 224, 0, 0, 0, 0, 0, + 48, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 216, 1, 0, 0, 0, 0, + 8, 2, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 228, 1, + 0, 0, 0, 0, 20, 2, 0, 0, 0, 0, 0, 0, - 244, 1, 0, 0, 16, 0, + 36, 2, 0, 0, 16, 0, 0, 0, 4, 0, 0, 0, - 2, 0, 0, 0, 4, 2, + 2, 0, 0, 0, 52, 2, 0, 0, 0, 0, 0, 0, - 20, 2, 0, 0, 32, 0, + 68, 2, 0, 0, 32, 0, + 0, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 84, 2, + 0, 0, 0, 0, 0, 0, + 100, 2, 0, 0, 48, 0, 0, 0, 64, 0, 0, 0, - 0, 0, 0, 0, 36, 2, + 0, 0, 0, 0, 116, 2, 0, 0, 0, 0, 0, 0, - 52, 2, 0, 0, 96, 0, + 132, 2, 0, 0, 112, 0, 0, 0, 64, 0, 0, 0, - 0, 0, 0, 0, 36, 2, + 0, 0, 0, 0, 116, 2, 0, 0, 0, 0, 0, 0, - 64, 2, 0, 0, 160, 0, + 144, 2, 0, 0, 176, 0, 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 228, 1, + 0, 0, 0, 0, 20, 2, 0, 0, 0, 0, 0, 0, - 84, 2, 0, 0, 176, 0, + 164, 2, 0, 0, 192, 0, 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 100, 2, + 0, 0, 0, 0, 180, 2, 0, 0, 0, 0, 0, 0, - 116, 2, 0, 0, 192, 0, + 196, 2, 0, 0, 208, 0, 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 100, 2, + 0, 0, 0, 0, 180, 2, 0, 0, 0, 0, 0, 0, - 127, 2, 0, 0, 208, 0, + 207, 2, 0, 0, 224, 0, 0, 0, 16, 0, 0, 0, - 0, 0, 0, 0, 100, 2, + 0, 0, 0, 0, 180, 2, + 0, 0, 0, 0, 0, 0, + 217, 2, 0, 0, 240, 0, + 0, 0, 64, 0, 0, 0, + 0, 0, 0, 0, 116, 2, 0, 0, 0, 0, 0, 0, 102, 76, 97, 121, 101, 114, 67, 111, 108, 111, 114, 0, @@ -5770,62 +4966,70 @@ const BYTE YCbCrShaderMask[] = 171, 171, 0, 0, 3, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 109, 76, 97, 121, 101, 114, - 84, 114, 97, 110, 115, 102, - 111, 114, 109, 0, 3, 0, - 3, 0, 4, 0, 4, 0, + 105, 66, 108, 101, 110, 100, + 67, 111, 110, 102, 105, 103, + 0, 171, 171, 171, 1, 0, + 19, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 109, 80, 114, 111, - 106, 101, 99, 116, 105, 111, - 110, 0, 118, 82, 101, 110, - 100, 101, 114, 84, 97, 114, - 103, 101, 116, 79, 102, 102, - 115, 101, 116, 0, 118, 84, - 101, 120, 116, 117, 114, 101, - 67, 111, 111, 114, 100, 115, - 0, 171, 1, 0, 3, 0, - 1, 0, 4, 0, 0, 0, - 0, 0, 0, 0, 0, 0, - 118, 76, 97, 121, 101, 114, - 81, 117, 97, 100, 0, 118, - 77, 97, 115, 107, 81, 117, - 97, 100, 0, 77, 105, 99, - 114, 111, 115, 111, 102, 116, - 32, 40, 82, 41, 32, 72, - 76, 83, 76, 32, 83, 104, - 97, 100, 101, 114, 32, 67, - 111, 109, 112, 105, 108, 101, - 114, 32, 54, 46, 51, 46, - 57, 54, 48, 48, 46, 49, - 54, 51, 56, 52, 0, 171, - 73, 83, 71, 78, 104, 0, - 0, 0, 3, 0, 0, 0, - 8, 0, 0, 0, 80, 0, - 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 3, 0, - 0, 0, 0, 0, 0, 0, - 15, 0, 0, 0, 92, 0, - 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 3, 0, - 0, 0, 1, 0, 0, 0, - 3, 3, 0, 0, 92, 0, - 0, 0, 1, 0, 0, 0, - 0, 0, 0, 0, 3, 0, - 0, 0, 1, 0, 0, 0, - 12, 12, 0, 0, 83, 86, - 95, 80, 111, 115, 105, 116, - 105, 111, 110, 0, 84, 69, - 88, 67, 79, 79, 82, 68, - 0, 171, 171, 171, 79, 83, - 71, 78, 44, 0, 0, 0, - 1, 0, 0, 0, 8, 0, - 0, 0, 32, 0, 0, 0, + 0, 0, 109, 76, 97, 121, + 101, 114, 84, 114, 97, 110, + 115, 102, 111, 114, 109, 0, + 3, 0, 3, 0, 4, 0, + 4, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 109, 80, + 114, 111, 106, 101, 99, 116, + 105, 111, 110, 0, 118, 82, + 101, 110, 100, 101, 114, 84, + 97, 114, 103, 101, 116, 79, + 102, 102, 115, 101, 116, 0, + 118, 84, 101, 120, 116, 117, + 114, 101, 67, 111, 111, 114, + 100, 115, 0, 171, 1, 0, + 3, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 118, 76, 97, 121, + 101, 114, 81, 117, 97, 100, + 0, 118, 77, 97, 115, 107, + 81, 117, 97, 100, 0, 109, + 66, 97, 99, 107, 100, 114, + 111, 112, 84, 114, 97, 110, + 115, 102, 111, 114, 109, 0, + 77, 105, 99, 114, 111, 115, + 111, 102, 116, 32, 40, 82, + 41, 32, 72, 76, 83, 76, + 32, 83, 104, 97, 100, 101, + 114, 32, 67, 111, 109, 112, + 105, 108, 101, 114, 32, 54, + 46, 51, 46, 57, 54, 48, + 48, 46, 49, 54, 51, 56, + 52, 0, 171, 171, 73, 83, + 71, 78, 104, 0, 0, 0, + 3, 0, 0, 0, 8, 0, + 0, 0, 80, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 0, - 0, 0, 83, 86, 95, 84, - 97, 114, 103, 101, 116, 0, - 171, 171 + 0, 0, 92, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 1, 0, 0, 0, 3, 3, + 0, 0, 92, 0, 0, 0, + 1, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 1, 0, 0, 0, 12, 12, + 0, 0, 83, 86, 95, 80, + 111, 115, 105, 116, 105, 111, + 110, 0, 84, 69, 88, 67, + 79, 79, 82, 68, 0, 171, + 171, 171, 79, 83, 71, 78, + 44, 0, 0, 0, 1, 0, + 0, 0, 8, 0, 0, 0, + 32, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 15, 0, 0, 0, + 83, 86, 95, 84, 97, 114, + 103, 101, 116, 0, 171, 171 }; ShaderBytes sYCbCrShaderMask = { YCbCrShaderMask, sizeof(YCbCrShaderMask) }; #if 0 @@ -5840,12 +5044,14 @@ ShaderBytes sYCbCrShaderMask = { YCbCrShaderMask, sizeof(YCbCrShaderMask) }; // // float4 fLayerColor; // Offset: 0 Size: 16 [unused] // float fLayerOpacity; // Offset: 16 Size: 4 -// float4x4 mLayerTransform; // Offset: 32 Size: 64 [unused] -// float4x4 mProjection; // Offset: 96 Size: 64 [unused] -// float4 vRenderTargetOffset; // Offset: 160 Size: 16 [unused] -// float4 vTextureCoords; // Offset: 176 Size: 16 [unused] -// float4 vLayerQuad; // Offset: 192 Size: 16 [unused] -// float4 vMaskQuad; // Offset: 208 Size: 16 [unused] +// uint4 iBlendConfig; // Offset: 32 Size: 16 [unused] +// float4x4 mLayerTransform; // Offset: 48 Size: 64 [unused] +// float4x4 mProjection; // Offset: 112 Size: 64 [unused] +// float4 vRenderTargetOffset; // Offset: 176 Size: 16 [unused] +// float4 vTextureCoords; // Offset: 192 Size: 16 [unused] +// float4 vLayerQuad; // Offset: 208 Size: 16 [unused] +// float4 vMaskQuad; // Offset: 224 Size: 16 [unused] +// float4x4 mBackdropTransform; // Offset: 240 Size: 64 [unused] // // } // @@ -5856,8 +5062,8 @@ ShaderBytes sYCbCrShaderMask = { YCbCrShaderMask, sizeof(YCbCrShaderMask) }; // ------------------------------ ---------- ------- ----------- ---- -------- // sSampler sampler NA NA 0 1 // tRGB texture float4 2d 0 1 -// tRGBWhite texture float4 2d 1 1 -// tMask texture float4 2d 3 1 +// tRGBWhite texture float4 2d 4 1 +// tMask texture float4 2d 5 1 // $Globals cbuffer NA NA 0 1 // // @@ -5890,9 +5096,9 @@ ShaderBytes sYCbCrShaderMask = { YCbCrShaderMask, sizeof(YCbCrShaderMask) }; // // Target Sampler Source Sampler Source Resource // -------------- --------------- ---------------- -// s0 s0 t3 -// s1 s0 t0 -// s2 s0 t1 +// s0 s0 t0 +// s1 s0 t4 +// s2 s0 t5 // // // Level9 shader bytecode: @@ -5904,10 +5110,10 @@ ShaderBytes sYCbCrShaderMask = { YCbCrShaderMask, sizeof(YCbCrShaderMask) }; dcl_2d s1 dcl_2d s2 mov r0.xy, t0.wzzw - texld r0, r0, s0 + texld r0, r0, s2 mul r0.x, r0.x, c0.x - texld r1, t0, s1 - texld r2, t0, s2 + texld r1, t0, s0 + texld r2, t0, s1 add r2, r1, -r2 add r2, r2, c1.x mov r1.w, r2.y @@ -5921,19 +5127,19 @@ ps_4_0 dcl_constantbuffer cb0[2], immediateIndexed dcl_sampler s0, mode_default dcl_resource_texture2d (float,float,float,float) t0 -dcl_resource_texture2d (float,float,float,float) t1 -dcl_resource_texture2d (float,float,float,float) t3 +dcl_resource_texture2d (float,float,float,float) t4 +dcl_resource_texture2d (float,float,float,float) t5 dcl_input_ps linear v1.xy dcl_input_ps linear v1.zw dcl_output o0.xyzw dcl_output o1.xyzw dcl_temps 3 -sample r0.xyzw, v1.xyxx, t1.xyzw, s0 +sample r0.xyzw, v1.xyxx, t4.xyzw, s0 sample r1.xyzw, v1.xyxx, t0.xyzw, s0 add r0.xyzw, -r0.xyzw, r1.xyzw add r0.xyzw, r0.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000) mov r1.w, r0.y -sample r2.xyzw, v1.zwzz, t3.xyzw, s0 +sample r2.xyzw, v1.zwzz, t5.xyzw, s0 mul r2.x, r2.x, cb0[1].x mul o0.xyzw, r1.xyzw, r2.xxxx mul o1.xyzw, r0.xyzw, r2.xxxx @@ -5943,15 +5149,15 @@ ret const BYTE ComponentAlphaShaderMask[] = { - 68, 88, 66, 67, 102, 2, - 84, 222, 33, 141, 105, 188, - 152, 82, 64, 100, 57, 101, - 192, 110, 1, 0, 0, 0, - 20, 7, 0, 0, 6, 0, + 68, 88, 66, 67, 231, 247, + 98, 196, 91, 244, 200, 52, + 117, 97, 164, 190, 237, 87, + 108, 62, 1, 0, 0, 0, + 120, 7, 0, 0, 6, 0, 0, 0, 56, 0, 0, 0, 124, 1, 0, 0, 52, 3, 0, 0, 176, 3, 0, 0, - 88, 6, 0, 0, 200, 6, + 188, 6, 0, 0, 44, 7, 0, 0, 65, 111, 110, 57, 60, 1, 0, 0, 60, 1, 0, 0, 0, 2, 255, 255, @@ -5959,9 +5165,9 @@ const BYTE ComponentAlphaShaderMask[] = 0, 0, 1, 0, 48, 0, 0, 0, 60, 0, 0, 0, 60, 0, 3, 0, 36, 0, - 0, 0, 60, 0, 3, 0, - 0, 0, 0, 0, 1, 0, - 1, 0, 2, 0, 0, 0, + 0, 0, 60, 0, 0, 0, + 0, 0, 4, 0, 1, 0, + 5, 0, 2, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 2, 255, 255, 81, 0, 0, 5, @@ -5980,15 +5186,15 @@ const BYTE ComponentAlphaShaderMask[] = 0, 0, 3, 128, 0, 0, 235, 176, 66, 0, 0, 3, 0, 0, 15, 128, 0, 0, - 228, 128, 0, 8, 228, 160, + 228, 128, 2, 8, 228, 160, 5, 0, 0, 3, 0, 0, 1, 128, 0, 0, 0, 128, 0, 0, 0, 160, 66, 0, 0, 3, 1, 0, 15, 128, - 0, 0, 228, 176, 1, 8, + 0, 0, 228, 176, 0, 8, 228, 160, 66, 0, 0, 3, 2, 0, 15, 128, 0, 0, - 228, 176, 2, 8, 228, 160, + 228, 176, 1, 8, 228, 160, 2, 0, 0, 3, 2, 0, 15, 128, 1, 0, 228, 128, 2, 0, 228, 129, 2, 0, @@ -6017,10 +5223,10 @@ const BYTE ComponentAlphaShaderMask[] = 0, 4, 0, 112, 16, 0, 0, 0, 0, 0, 85, 85, 0, 0, 88, 24, 0, 4, - 0, 112, 16, 0, 1, 0, + 0, 112, 16, 0, 4, 0, 0, 0, 85, 85, 0, 0, 88, 24, 0, 4, 0, 112, - 16, 0, 3, 0, 0, 0, + 16, 0, 5, 0, 0, 0, 85, 85, 0, 0, 98, 16, 0, 3, 50, 16, 16, 0, 1, 0, 0, 0, 98, 16, @@ -6035,7 +5241,7 @@ const BYTE ComponentAlphaShaderMask[] = 16, 0, 0, 0, 0, 0, 70, 16, 16, 0, 1, 0, 0, 0, 70, 126, 16, 0, - 1, 0, 0, 0, 0, 96, + 4, 0, 0, 0, 0, 96, 16, 0, 0, 0, 0, 0, 69, 0, 0, 9, 242, 0, 16, 0, 1, 0, 0, 0, @@ -6062,7 +5268,7 @@ const BYTE ComponentAlphaShaderMask[] = 242, 0, 16, 0, 2, 0, 0, 0, 230, 26, 16, 0, 1, 0, 0, 0, 70, 126, - 16, 0, 3, 0, 0, 0, + 16, 0, 5, 0, 0, 0, 0, 96, 16, 0, 0, 0, 0, 0, 56, 0, 0, 8, 18, 0, 16, 0, 2, 0, @@ -6101,11 +5307,11 @@ const BYTE ComponentAlphaShaderMask[] = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 68, 69, 70, - 160, 2, 0, 0, 1, 0, + 4, 3, 0, 0, 1, 0, 0, 0, 228, 0, 0, 0, 5, 0, 0, 0, 28, 0, 0, 0, 0, 4, 255, 255, - 0, 1, 0, 0, 109, 2, + 0, 1, 0, 0, 208, 2, 0, 0, 188, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -6116,16 +5322,16 @@ const BYTE ComponentAlphaShaderMask[] = 5, 0, 0, 0, 4, 0, 0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 1, 0, - 0, 0, 12, 0, 0, 0, + 0, 0, 13, 0, 0, 0, 202, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, 255, 255, - 255, 255, 1, 0, 0, 0, - 1, 0, 0, 0, 12, 0, + 255, 255, 4, 0, 0, 0, + 1, 0, 0, 0, 13, 0, 0, 0, 212, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0, 0, - 255, 255, 255, 255, 3, 0, + 255, 255, 255, 255, 5, 0, 0, 0, 1, 0, 0, 0, 13, 0, 0, 0, 218, 0, 0, 0, 0, 0, 0, 0, @@ -6140,41 +5346,49 @@ const BYTE ComponentAlphaShaderMask[] = 116, 77, 97, 115, 107, 0, 36, 71, 108, 111, 98, 97, 108, 115, 0, 171, 218, 0, - 0, 0, 8, 0, 0, 0, - 252, 0, 0, 0, 224, 0, + 0, 0, 10, 0, 0, 0, + 252, 0, 0, 0, 48, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 188, 1, + 0, 0, 0, 0, 236, 1, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, - 0, 0, 200, 1, 0, 0, - 0, 0, 0, 0, 216, 1, + 0, 0, 248, 1, 0, 0, + 0, 0, 0, 0, 8, 2, 0, 0, 16, 0, 0, 0, 4, 0, 0, 0, 2, 0, - 0, 0, 232, 1, 0, 0, - 0, 0, 0, 0, 248, 1, + 0, 0, 24, 2, 0, 0, + 0, 0, 0, 0, 40, 2, 0, 0, 32, 0, 0, 0, - 64, 0, 0, 0, 0, 0, - 0, 0, 8, 2, 0, 0, - 0, 0, 0, 0, 24, 2, - 0, 0, 96, 0, 0, 0, - 64, 0, 0, 0, 0, 0, - 0, 0, 8, 2, 0, 0, - 0, 0, 0, 0, 36, 2, - 0, 0, 160, 0, 0, 0, 16, 0, 0, 0, 0, 0, - 0, 0, 200, 1, 0, 0, - 0, 0, 0, 0, 56, 2, + 0, 0, 56, 2, 0, 0, + 0, 0, 0, 0, 72, 2, + 0, 0, 48, 0, 0, 0, + 64, 0, 0, 0, 0, 0, + 0, 0, 88, 2, 0, 0, + 0, 0, 0, 0, 104, 2, + 0, 0, 112, 0, 0, 0, + 64, 0, 0, 0, 0, 0, + 0, 0, 88, 2, 0, 0, + 0, 0, 0, 0, 116, 2, 0, 0, 176, 0, 0, 0, 16, 0, 0, 0, 0, 0, - 0, 0, 72, 2, 0, 0, - 0, 0, 0, 0, 88, 2, + 0, 0, 248, 1, 0, 0, + 0, 0, 0, 0, 136, 2, 0, 0, 192, 0, 0, 0, 16, 0, 0, 0, 0, 0, - 0, 0, 72, 2, 0, 0, - 0, 0, 0, 0, 99, 2, + 0, 0, 152, 2, 0, 0, + 0, 0, 0, 0, 168, 2, 0, 0, 208, 0, 0, 0, 16, 0, 0, 0, 0, 0, - 0, 0, 72, 2, 0, 0, + 0, 0, 152, 2, 0, 0, + 0, 0, 0, 0, 179, 2, + 0, 0, 224, 0, 0, 0, + 16, 0, 0, 0, 0, 0, + 0, 0, 152, 2, 0, 0, + 0, 0, 0, 0, 189, 2, + 0, 0, 240, 0, 0, 0, + 64, 0, 0, 0, 0, 0, + 0, 0, 88, 2, 0, 0, 0, 0, 0, 0, 102, 76, 97, 121, 101, 114, 67, 111, 108, 111, 114, 0, 1, 0, @@ -6185,6 +5399,1060 @@ const BYTE ComponentAlphaShaderMask[] = 105, 116, 121, 0, 171, 171, 0, 0, 3, 0, 1, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 105, 66, + 108, 101, 110, 100, 67, 111, + 110, 102, 105, 103, 0, 171, + 171, 171, 1, 0, 19, 0, + 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 109, 76, 97, 121, 101, 114, + 84, 114, 97, 110, 115, 102, + 111, 114, 109, 0, 3, 0, + 3, 0, 4, 0, 4, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 109, 80, 114, 111, + 106, 101, 99, 116, 105, 111, + 110, 0, 118, 82, 101, 110, + 100, 101, 114, 84, 97, 114, + 103, 101, 116, 79, 102, 102, + 115, 101, 116, 0, 118, 84, + 101, 120, 116, 117, 114, 101, + 67, 111, 111, 114, 100, 115, + 0, 171, 1, 0, 3, 0, + 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 118, 76, 97, 121, 101, 114, + 81, 117, 97, 100, 0, 118, + 77, 97, 115, 107, 81, 117, + 97, 100, 0, 109, 66, 97, + 99, 107, 100, 114, 111, 112, + 84, 114, 97, 110, 115, 102, + 111, 114, 109, 0, 77, 105, + 99, 114, 111, 115, 111, 102, + 116, 32, 40, 82, 41, 32, + 72, 76, 83, 76, 32, 83, + 104, 97, 100, 101, 114, 32, + 67, 111, 109, 112, 105, 108, + 101, 114, 32, 54, 46, 51, + 46, 57, 54, 48, 48, 46, + 49, 54, 51, 56, 52, 0, + 171, 171, 73, 83, 71, 78, + 104, 0, 0, 0, 3, 0, + 0, 0, 8, 0, 0, 0, + 80, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 15, 0, 0, 0, + 92, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 1, 0, + 0, 0, 3, 3, 0, 0, + 92, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 1, 0, + 0, 0, 12, 12, 0, 0, + 83, 86, 95, 80, 111, 115, + 105, 116, 105, 111, 110, 0, + 84, 69, 88, 67, 79, 79, + 82, 68, 0, 171, 171, 171, + 79, 83, 71, 78, 68, 0, + 0, 0, 2, 0, 0, 0, + 8, 0, 0, 0, 56, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 56, 0, + 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 1, 0, 0, 0, + 15, 0, 0, 0, 83, 86, + 95, 84, 97, 114, 103, 101, + 116, 0, 171, 171 +}; +ShaderBytes sComponentAlphaShaderMask = { ComponentAlphaShaderMask, sizeof(ComponentAlphaShaderMask) }; +#if 0 +// +// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 +// +// +// Buffer Definitions: +// +// cbuffer $Globals +// { +// +// float4x4 mLayerTransform; // Offset: 0 Size: 64 +// float4x4 mProjection; // Offset: 64 Size: 64 +// float4 vRenderTargetOffset; // Offset: 128 Size: 16 +// float4 vTextureCoords; // Offset: 144 Size: 16 +// float4 vLayerQuad; // Offset: 160 Size: 16 +// float4 vMaskQuad; // Offset: 176 Size: 16 [unused] +// float4x4 mBackdropTransform; // Offset: 192 Size: 64 +// float4 fLayerColor; // Offset: 256 Size: 16 [unused] +// float fLayerOpacity; // Offset: 272 Size: 4 [unused] +// uint4 iBlendConfig; // Offset: 288 Size: 16 [unused] +// +// } +// +// +// Resource Bindings: +// +// Name Type Format Dim Slot Elements +// ------------------------------ ---------- ------- ----------- ---- -------- +// $Globals cbuffer NA NA 0 1 +// +// +// +// Input signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// POSITION 0 xy 0 NONE float xy +// +// +// Output signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// SV_Position 0 xyzw 0 POS float xyzw +// TEXCOORD 0 xy 1 NONE float xy +// TEXCOORD 2 zw 1 NONE float zw +// TEXCOORD 1 xyz 2 NONE float xyz +// +// +// Constant buffer to DX9 shader constant mappings: +// +// Target Reg Buffer Start Reg # of Regs Data Conversion +// ---------- ------- --------- --------- ---------------------- +// c1 cb0 0 2 ( FLT, FLT, FLT, FLT) +// c3 cb0 3 8 ( FLT, FLT, FLT, FLT) +// c11 cb0 12 2 ( FLT, FLT, FLT, FLT) +// c13 cb0 15 1 ( FLT, FLT, FLT, FLT) +// +// +// Runtime generated constant mappings: +// +// Target Reg Constant Description +// ---------- -------------------------------------------------- +// c0 Vertex Shader position offset +// +// +// Level9 shader bytecode: +// + vs_2_x + def c14, 1, 0.5, 0, 0 + dcl_texcoord v0 + mad oT0.xy, v0, c9.zwzw, c9 + mad r0.xy, v0, c10.zwzw, c10 + mul r1, r0.y, c2 + mad r0, c1, r0.x, r1 + add r0, r0, c3 + rcp r1.x, r0.w + mul r0.xyz, r0, r1.x + add r0, r0, -c8 + mul r0.xyz, r0.w, r0 + mul r1, r0.y, c5 + mad r1, c4, r0.x, r1 + mad r1, c6, r0.z, r1 + mad r0, c7, r0.w, r1 + add r1.xy, r0, c14.x + mad r1.y, r1.y, -c14.y, c14.x + mul r1.x, r1.x, c14.y + mul r1.yz, r1.y, c12.xyxw + mad r1.xy, c11.yxzw, r1.x, r1.yzzw + add oT0.zw, r1.xyxy, c13.xyyx + mad oPos.xy, r0.w, c0, r0 + mov oPos.zw, r0 + mov oT1.xyz, c14.z + +// approximately 22 instruction slots used +vs_4_0 +dcl_constantbuffer cb0[16], immediateIndexed +dcl_input v0.xy +dcl_output_siv o0.xyzw, position +dcl_output o1.xy +dcl_output o1.zw +dcl_output o2.xyz +dcl_temps 2 +mad r0.xy, v0.xyxx, cb0[10].zwzz, cb0[10].xyxx +mul r1.xyzw, r0.yyyy, cb0[1].xyzw +mad r0.xyzw, cb0[0].xyzw, r0.xxxx, r1.xyzw +add r0.xyzw, r0.xyzw, cb0[3].xyzw +div r0.xyz, r0.xyzx, r0.wwww +add r0.xyzw, r0.xyzw, -cb0[8].xyzw +mul r0.xyz, r0.wwww, r0.xyzx +mul r1.xyzw, r0.yyyy, cb0[5].xyzw +mad r1.xyzw, cb0[4].xyzw, r0.xxxx, r1.xyzw +mad r1.xyzw, cb0[6].xyzw, r0.zzzz, r1.xyzw +mad r0.xyzw, cb0[7].xyzw, r0.wwww, r1.xyzw +mov o0.xyzw, r0.xyzw +add r0.xy, r0.xyxx, l(1.000000, 1.000000, 0.000000, 0.000000) +mad r0.y, -r0.y, l(0.500000), l(1.000000) +mul r0.x, r0.x, l(0.500000) +mul r0.yz, r0.yyyy, cb0[13].xxyx +mad r0.xy, cb0[12].xyxx, r0.xxxx, r0.yzyy +add o1.zw, r0.xxxy, cb0[15].xxxy +mad o1.xy, v0.xyxx, cb0[9].zwzz, cb0[9].xyxx +mov o2.xyz, l(0,0,0,0) +ret +// Approximately 21 instruction slots used +#endif + +const BYTE LayerQuadBlendVS[] = +{ + 68, 88, 66, 67, 238, 0, + 14, 218, 242, 150, 72, 155, + 68, 134, 76, 43, 160, 82, + 75, 24, 1, 0, 0, 0, + 12, 9, 0, 0, 6, 0, + 0, 0, 56, 0, 0, 0, + 60, 2, 0, 0, 100, 5, + 0, 0, 224, 5, 0, 0, + 80, 8, 0, 0, 132, 8, + 0, 0, 65, 111, 110, 57, + 252, 1, 0, 0, 252, 1, + 0, 0, 0, 2, 254, 255, + 164, 1, 0, 0, 88, 0, + 0, 0, 4, 0, 36, 0, + 0, 0, 84, 0, 0, 0, + 84, 0, 0, 0, 36, 0, + 1, 0, 84, 0, 0, 0, + 0, 0, 2, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 8, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 12, 0, 2, 0, 11, 0, + 0, 0, 0, 0, 0, 0, + 15, 0, 1, 0, 13, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 1, 2, 254, 255, + 81, 0, 0, 5, 14, 0, + 15, 160, 0, 0, 128, 63, + 0, 0, 0, 63, 0, 0, + 0, 0, 0, 0, 0, 0, + 31, 0, 0, 2, 5, 0, + 0, 128, 0, 0, 15, 144, + 4, 0, 0, 4, 0, 0, + 3, 224, 0, 0, 228, 144, + 9, 0, 238, 160, 9, 0, + 228, 160, 4, 0, 0, 4, + 0, 0, 3, 128, 0, 0, + 228, 144, 10, 0, 238, 160, + 10, 0, 228, 160, 5, 0, + 0, 3, 1, 0, 15, 128, + 0, 0, 85, 128, 2, 0, + 228, 160, 4, 0, 0, 4, + 0, 0, 15, 128, 1, 0, + 228, 160, 0, 0, 0, 128, + 1, 0, 228, 128, 2, 0, + 0, 3, 0, 0, 15, 128, + 0, 0, 228, 128, 3, 0, + 228, 160, 6, 0, 0, 2, + 1, 0, 1, 128, 0, 0, + 255, 128, 5, 0, 0, 3, + 0, 0, 7, 128, 0, 0, + 228, 128, 1, 0, 0, 128, + 2, 0, 0, 3, 0, 0, + 15, 128, 0, 0, 228, 128, + 8, 0, 228, 161, 5, 0, + 0, 3, 0, 0, 7, 128, + 0, 0, 255, 128, 0, 0, + 228, 128, 5, 0, 0, 3, + 1, 0, 15, 128, 0, 0, + 85, 128, 5, 0, 228, 160, + 4, 0, 0, 4, 1, 0, + 15, 128, 4, 0, 228, 160, + 0, 0, 0, 128, 1, 0, + 228, 128, 4, 0, 0, 4, + 1, 0, 15, 128, 6, 0, + 228, 160, 0, 0, 170, 128, + 1, 0, 228, 128, 4, 0, + 0, 4, 0, 0, 15, 128, + 7, 0, 228, 160, 0, 0, + 255, 128, 1, 0, 228, 128, + 2, 0, 0, 3, 1, 0, + 3, 128, 0, 0, 228, 128, + 14, 0, 0, 160, 4, 0, + 0, 4, 1, 0, 2, 128, + 1, 0, 85, 128, 14, 0, + 85, 161, 14, 0, 0, 160, + 5, 0, 0, 3, 1, 0, + 1, 128, 1, 0, 0, 128, + 14, 0, 85, 160, 5, 0, + 0, 3, 1, 0, 6, 128, + 1, 0, 85, 128, 12, 0, + 196, 160, 4, 0, 0, 4, + 1, 0, 3, 128, 11, 0, + 225, 160, 1, 0, 0, 128, + 1, 0, 233, 128, 2, 0, + 0, 3, 0, 0, 12, 224, + 1, 0, 68, 128, 13, 0, + 20, 160, 4, 0, 0, 4, + 0, 0, 3, 192, 0, 0, + 255, 128, 0, 0, 228, 160, + 0, 0, 228, 128, 1, 0, + 0, 2, 0, 0, 12, 192, + 0, 0, 228, 128, 1, 0, + 0, 2, 1, 0, 7, 224, + 14, 0, 170, 160, 255, 255, + 0, 0, 83, 72, 68, 82, + 32, 3, 0, 0, 64, 0, + 1, 0, 200, 0, 0, 0, + 89, 0, 0, 4, 70, 142, + 32, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 95, 0, + 0, 3, 50, 16, 16, 0, + 0, 0, 0, 0, 103, 0, + 0, 4, 242, 32, 16, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 101, 0, 0, 3, + 50, 32, 16, 0, 1, 0, + 0, 0, 101, 0, 0, 3, + 194, 32, 16, 0, 1, 0, + 0, 0, 101, 0, 0, 3, + 114, 32, 16, 0, 2, 0, + 0, 0, 104, 0, 0, 2, + 2, 0, 0, 0, 50, 0, + 0, 11, 50, 0, 16, 0, + 0, 0, 0, 0, 70, 16, + 16, 0, 0, 0, 0, 0, + 230, 138, 32, 0, 0, 0, + 0, 0, 10, 0, 0, 0, + 70, 128, 32, 0, 0, 0, + 0, 0, 10, 0, 0, 0, + 56, 0, 0, 8, 242, 0, + 16, 0, 1, 0, 0, 0, + 86, 5, 16, 0, 0, 0, + 0, 0, 70, 142, 32, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 50, 0, 0, 10, + 242, 0, 16, 0, 0, 0, + 0, 0, 70, 142, 32, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 6, 0, 16, 0, + 0, 0, 0, 0, 70, 14, + 16, 0, 1, 0, 0, 0, + 0, 0, 0, 8, 242, 0, + 16, 0, 0, 0, 0, 0, + 70, 14, 16, 0, 0, 0, + 0, 0, 70, 142, 32, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 14, 0, 0, 7, + 114, 0, 16, 0, 0, 0, + 0, 0, 70, 2, 16, 0, + 0, 0, 0, 0, 246, 15, + 16, 0, 0, 0, 0, 0, + 0, 0, 0, 9, 242, 0, + 16, 0, 0, 0, 0, 0, + 70, 14, 16, 0, 0, 0, + 0, 0, 70, 142, 32, 128, + 65, 0, 0, 0, 0, 0, + 0, 0, 8, 0, 0, 0, + 56, 0, 0, 7, 114, 0, + 16, 0, 0, 0, 0, 0, + 246, 15, 16, 0, 0, 0, + 0, 0, 70, 2, 16, 0, + 0, 0, 0, 0, 56, 0, + 0, 8, 242, 0, 16, 0, + 1, 0, 0, 0, 86, 5, + 16, 0, 0, 0, 0, 0, + 70, 142, 32, 0, 0, 0, + 0, 0, 5, 0, 0, 0, + 50, 0, 0, 10, 242, 0, + 16, 0, 1, 0, 0, 0, + 70, 142, 32, 0, 0, 0, + 0, 0, 4, 0, 0, 0, + 6, 0, 16, 0, 0, 0, + 0, 0, 70, 14, 16, 0, + 1, 0, 0, 0, 50, 0, + 0, 10, 242, 0, 16, 0, + 1, 0, 0, 0, 70, 142, + 32, 0, 0, 0, 0, 0, + 6, 0, 0, 0, 166, 10, + 16, 0, 0, 0, 0, 0, + 70, 14, 16, 0, 1, 0, + 0, 0, 50, 0, 0, 10, + 242, 0, 16, 0, 0, 0, + 0, 0, 70, 142, 32, 0, + 0, 0, 0, 0, 7, 0, + 0, 0, 246, 15, 16, 0, + 0, 0, 0, 0, 70, 14, + 16, 0, 1, 0, 0, 0, + 54, 0, 0, 5, 242, 32, + 16, 0, 0, 0, 0, 0, + 70, 14, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 10, + 50, 0, 16, 0, 0, 0, + 0, 0, 70, 0, 16, 0, + 0, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 128, 63, + 0, 0, 128, 63, 0, 0, + 0, 0, 0, 0, 0, 0, + 50, 0, 0, 10, 34, 0, + 16, 0, 0, 0, 0, 0, + 26, 0, 16, 128, 65, 0, + 0, 0, 0, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 0, 63, 1, 64, 0, 0, + 0, 0, 128, 63, 56, 0, + 0, 7, 18, 0, 16, 0, + 0, 0, 0, 0, 10, 0, + 16, 0, 0, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 0, 63, 56, 0, 0, 8, + 98, 0, 16, 0, 0, 0, + 0, 0, 86, 5, 16, 0, + 0, 0, 0, 0, 6, 129, + 32, 0, 0, 0, 0, 0, + 13, 0, 0, 0, 50, 0, + 0, 10, 50, 0, 16, 0, + 0, 0, 0, 0, 70, 128, + 32, 0, 0, 0, 0, 0, + 12, 0, 0, 0, 6, 0, + 16, 0, 0, 0, 0, 0, + 150, 5, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 8, + 194, 32, 16, 0, 1, 0, + 0, 0, 6, 4, 16, 0, + 0, 0, 0, 0, 6, 132, + 32, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 50, 0, + 0, 11, 50, 32, 16, 0, + 1, 0, 0, 0, 70, 16, + 16, 0, 0, 0, 0, 0, + 230, 138, 32, 0, 0, 0, + 0, 0, 9, 0, 0, 0, + 70, 128, 32, 0, 0, 0, + 0, 0, 9, 0, 0, 0, + 54, 0, 0, 8, 114, 32, + 16, 0, 2, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 62, 0, 0, 1, + 83, 84, 65, 84, 116, 0, + 0, 0, 21, 0, 0, 0, + 2, 0, 0, 0, 0, 0, + 0, 0, 5, 0, 0, 0, + 18, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 82, 68, + 69, 70, 104, 2, 0, 0, + 1, 0, 0, 0, 72, 0, + 0, 0, 1, 0, 0, 0, + 28, 0, 0, 0, 0, 4, + 254, 255, 0, 1, 0, 0, + 52, 2, 0, 0, 60, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 36, 71, 108, 111, 98, 97, + 108, 115, 0, 171, 171, 171, + 60, 0, 0, 0, 10, 0, + 0, 0, 96, 0, 0, 0, + 48, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 80, 1, 0, 0, 0, 0, + 0, 0, 64, 0, 0, 0, + 2, 0, 0, 0, 96, 1, + 0, 0, 0, 0, 0, 0, + 112, 1, 0, 0, 64, 0, + 0, 0, 64, 0, 0, 0, + 2, 0, 0, 0, 96, 1, + 0, 0, 0, 0, 0, 0, + 124, 1, 0, 0, 128, 0, + 0, 0, 16, 0, 0, 0, + 2, 0, 0, 0, 144, 1, + 0, 0, 0, 0, 0, 0, + 160, 1, 0, 0, 144, 0, + 0, 0, 16, 0, 0, 0, + 2, 0, 0, 0, 176, 1, + 0, 0, 0, 0, 0, 0, + 192, 1, 0, 0, 160, 0, + 0, 0, 16, 0, 0, 0, + 2, 0, 0, 0, 176, 1, + 0, 0, 0, 0, 0, 0, + 203, 1, 0, 0, 176, 0, + 0, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 176, 1, + 0, 0, 0, 0, 0, 0, + 213, 1, 0, 0, 192, 0, + 0, 0, 64, 0, 0, 0, + 2, 0, 0, 0, 96, 1, + 0, 0, 0, 0, 0, 0, + 232, 1, 0, 0, 0, 1, + 0, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 144, 1, + 0, 0, 0, 0, 0, 0, + 244, 1, 0, 0, 16, 1, + 0, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 4, 2, + 0, 0, 0, 0, 0, 0, + 20, 2, 0, 0, 32, 1, + 0, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 36, 2, + 0, 0, 0, 0, 0, 0, + 109, 76, 97, 121, 101, 114, + 84, 114, 97, 110, 115, 102, + 111, 114, 109, 0, 3, 0, + 3, 0, 4, 0, 4, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 109, 80, 114, 111, + 106, 101, 99, 116, 105, 111, + 110, 0, 118, 82, 101, 110, + 100, 101, 114, 84, 97, 114, + 103, 101, 116, 79, 102, 102, + 115, 101, 116, 0, 1, 0, + 3, 0, 1, 0, 4, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 118, 84, 101, 120, + 116, 117, 114, 101, 67, 111, + 111, 114, 100, 115, 0, 171, + 1, 0, 3, 0, 1, 0, + 4, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 118, 76, + 97, 121, 101, 114, 81, 117, + 97, 100, 0, 118, 77, 97, + 115, 107, 81, 117, 97, 100, + 0, 109, 66, 97, 99, 107, + 100, 114, 111, 112, 84, 114, + 97, 110, 115, 102, 111, 114, + 109, 0, 102, 76, 97, 121, + 101, 114, 67, 111, 108, 111, + 114, 0, 102, 76, 97, 121, + 101, 114, 79, 112, 97, 99, + 105, 116, 121, 0, 171, 171, + 0, 0, 3, 0, 1, 0, + 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 105, 66, + 108, 101, 110, 100, 67, 111, + 110, 102, 105, 103, 0, 171, + 171, 171, 1, 0, 19, 0, + 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 77, 105, 99, 114, 111, 115, + 111, 102, 116, 32, 40, 82, + 41, 32, 72, 76, 83, 76, + 32, 83, 104, 97, 100, 101, + 114, 32, 67, 111, 109, 112, + 105, 108, 101, 114, 32, 54, + 46, 51, 46, 57, 54, 48, + 48, 46, 49, 54, 51, 56, + 52, 0, 171, 171, 73, 83, + 71, 78, 44, 0, 0, 0, + 1, 0, 0, 0, 8, 0, + 0, 0, 32, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 3, 3, + 0, 0, 80, 79, 83, 73, + 84, 73, 79, 78, 0, 171, + 171, 171, 79, 83, 71, 78, + 128, 0, 0, 0, 4, 0, + 0, 0, 8, 0, 0, 0, + 104, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 15, 0, 0, 0, + 116, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 1, 0, + 0, 0, 3, 12, 0, 0, + 116, 0, 0, 0, 2, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 1, 0, + 0, 0, 12, 3, 0, 0, + 116, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 2, 0, + 0, 0, 7, 8, 0, 0, + 83, 86, 95, 80, 111, 115, + 105, 116, 105, 111, 110, 0, + 84, 69, 88, 67, 79, 79, + 82, 68, 0, 171, 171, 171 +}; +ShaderBytes sLayerQuadBlendVS = { LayerQuadBlendVS, sizeof(LayerQuadBlendVS) }; +#if 0 +// +// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 +// +// +// Buffer Definitions: +// +// cbuffer $Globals +// { +// +// float4x4 mLayerTransform; // Offset: 0 Size: 64 +// float4x4 mProjection; // Offset: 64 Size: 64 +// float4 vRenderTargetOffset; // Offset: 128 Size: 16 +// float4 vTextureCoords; // Offset: 144 Size: 16 +// float4 vLayerQuad; // Offset: 160 Size: 16 +// float4 vMaskQuad; // Offset: 176 Size: 16 +// float4x4 mBackdropTransform; // Offset: 192 Size: 64 +// float4 fLayerColor; // Offset: 256 Size: 16 [unused] +// float fLayerOpacity; // Offset: 272 Size: 4 [unused] +// uint4 iBlendConfig; // Offset: 288 Size: 16 [unused] +// +// } +// +// +// Resource Bindings: +// +// Name Type Format Dim Slot Elements +// ------------------------------ ---------- ------- ----------- ---- -------- +// $Globals cbuffer NA NA 0 1 +// +// +// +// Input signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// POSITION 0 xy 0 NONE float xy +// +// +// Output signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// SV_Position 0 xyzw 0 POS float xyzw +// TEXCOORD 0 xy 1 NONE float xy +// TEXCOORD 2 zw 1 NONE float zw +// TEXCOORD 1 xyz 2 NONE float xyz +// +// +// Constant buffer to DX9 shader constant mappings: +// +// Target Reg Buffer Start Reg # of Regs Data Conversion +// ---------- ------- --------- --------- ---------------------- +// c1 cb0 0 2 ( FLT, FLT, FLT, FLT) +// c3 cb0 3 11 ( FLT, FLT, FLT, FLT) +// c14 cb0 15 1 ( FLT, FLT, FLT, FLT) +// +// +// Runtime generated constant mappings: +// +// Target Reg Constant Description +// ---------- -------------------------------------------------- +// c0 Vertex Shader position offset +// +// +// Level9 shader bytecode: +// + vs_2_x + def c15, 1, 0.5, 0, 0 + dcl_texcoord v0 + rcp r0.x, c11.z + mad r0.yz, v0.xxyw, c10.xzww, c10.xxyw + mul r1, r0.z, c2 + mad r1, c1, r0.y, r1 + add r1, r1, c3 + add r0.yz, r1.xxyw, -c11.xxyw + mul oT1.x, r0.x, r0.y + rcp r0.x, c11.w + mul oT1.y, r0.x, r0.z + mad oT0.xy, v0, c9.zwzw, c9 + rcp r0.x, r1.w + mul r1.xyz, r0.x, r1 + add r0, r1, -c8 + mul r0.xyz, r0.w, r0 + mul r1, r0.y, c5 + mad r1, c4, r0.x, r1 + mad r1, c6, r0.z, r1 + mad r0, c7, r0.w, r1 + add r1.xy, r0, c15.x + mad r1.y, r1.y, -c15.y, c15.x + mul r1.x, r1.x, c15.y + mul r1.yz, r1.y, c13.xyxw + mad r1.xy, c12.yxzw, r1.x, r1.yzzw + add oT0.zw, r1.xyxy, c14.xyyx + mad oPos.xy, r0.w, c0, r0 + mov oPos.zw, r0 + mov oT1.z, c15.z + +// approximately 27 instruction slots used +vs_4_0 +dcl_constantbuffer cb0[16], immediateIndexed +dcl_input v0.xy +dcl_output_siv o0.xyzw, position +dcl_output o1.xy +dcl_output o1.zw +dcl_output o2.xyz +dcl_temps 2 +mad r0.xy, v0.xyxx, cb0[10].zwzz, cb0[10].xyxx +mul r1.xyzw, r0.yyyy, cb0[1].xyzw +mad r0.xyzw, cb0[0].xyzw, r0.xxxx, r1.xyzw +add r0.xyzw, r0.xyzw, cb0[3].xyzw +div r1.xyz, r0.xyzx, r0.wwww +mov r1.w, r0.w +add r0.xy, r0.xyxx, -cb0[11].xyxx +div o2.xy, r0.xyxx, cb0[11].zwzz +add r0.xyzw, r1.xyzw, -cb0[8].xyzw +mul r0.xyz, r0.wwww, r0.xyzx +mul r1.xyzw, r0.yyyy, cb0[5].xyzw +mad r1.xyzw, cb0[4].xyzw, r0.xxxx, r1.xyzw +mad r1.xyzw, cb0[6].xyzw, r0.zzzz, r1.xyzw +mad r0.xyzw, cb0[7].xyzw, r0.wwww, r1.xyzw +mov o0.xyzw, r0.xyzw +add r0.xy, r0.xyxx, l(1.000000, 1.000000, 0.000000, 0.000000) +mad r0.y, -r0.y, l(0.500000), l(1.000000) +mul r0.x, r0.x, l(0.500000) +mul r0.yz, r0.yyyy, cb0[13].xxyx +mad r0.xy, cb0[12].xyxx, r0.xxxx, r0.yzyy +add o1.zw, r0.xxxy, cb0[15].xxxy +mad o1.xy, v0.xyxx, cb0[9].zwzz, cb0[9].xyxx +mov o2.z, l(0) +ret +// Approximately 24 instruction slots used +#endif + +const BYTE LayerQuadBlendMaskVS[] = +{ + 68, 88, 66, 67, 120, 167, + 168, 154, 138, 114, 232, 254, + 144, 109, 183, 6, 132, 16, + 244, 173, 1, 0, 0, 0, + 148, 9, 0, 0, 6, 0, + 0, 0, 56, 0, 0, 0, + 120, 2, 0, 0, 236, 5, + 0, 0, 104, 6, 0, 0, + 216, 8, 0, 0, 12, 9, + 0, 0, 65, 111, 110, 57, + 56, 2, 0, 0, 56, 2, + 0, 0, 0, 2, 254, 255, + 236, 1, 0, 0, 76, 0, + 0, 0, 3, 0, 36, 0, + 0, 0, 72, 0, 0, 0, + 72, 0, 0, 0, 36, 0, + 1, 0, 72, 0, 0, 0, + 0, 0, 2, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 11, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 15, 0, 1, 0, 14, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 1, 2, 254, 255, + 81, 0, 0, 5, 15, 0, + 15, 160, 0, 0, 128, 63, + 0, 0, 0, 63, 0, 0, + 0, 0, 0, 0, 0, 0, + 31, 0, 0, 2, 5, 0, + 0, 128, 0, 0, 15, 144, + 6, 0, 0, 2, 0, 0, + 1, 128, 11, 0, 170, 160, + 4, 0, 0, 4, 0, 0, + 6, 128, 0, 0, 208, 144, + 10, 0, 248, 160, 10, 0, + 208, 160, 5, 0, 0, 3, + 1, 0, 15, 128, 0, 0, + 170, 128, 2, 0, 228, 160, + 4, 0, 0, 4, 1, 0, + 15, 128, 1, 0, 228, 160, + 0, 0, 85, 128, 1, 0, + 228, 128, 2, 0, 0, 3, + 1, 0, 15, 128, 1, 0, + 228, 128, 3, 0, 228, 160, + 2, 0, 0, 3, 0, 0, + 6, 128, 1, 0, 208, 128, + 11, 0, 208, 161, 5, 0, + 0, 3, 1, 0, 1, 224, + 0, 0, 0, 128, 0, 0, + 85, 128, 6, 0, 0, 2, + 0, 0, 1, 128, 11, 0, + 255, 160, 5, 0, 0, 3, + 1, 0, 2, 224, 0, 0, + 0, 128, 0, 0, 170, 128, + 4, 0, 0, 4, 0, 0, + 3, 224, 0, 0, 228, 144, + 9, 0, 238, 160, 9, 0, + 228, 160, 6, 0, 0, 2, + 0, 0, 1, 128, 1, 0, + 255, 128, 5, 0, 0, 3, + 1, 0, 7, 128, 0, 0, + 0, 128, 1, 0, 228, 128, + 2, 0, 0, 3, 0, 0, + 15, 128, 1, 0, 228, 128, + 8, 0, 228, 161, 5, 0, + 0, 3, 0, 0, 7, 128, + 0, 0, 255, 128, 0, 0, + 228, 128, 5, 0, 0, 3, + 1, 0, 15, 128, 0, 0, + 85, 128, 5, 0, 228, 160, + 4, 0, 0, 4, 1, 0, + 15, 128, 4, 0, 228, 160, + 0, 0, 0, 128, 1, 0, + 228, 128, 4, 0, 0, 4, + 1, 0, 15, 128, 6, 0, + 228, 160, 0, 0, 170, 128, + 1, 0, 228, 128, 4, 0, + 0, 4, 0, 0, 15, 128, + 7, 0, 228, 160, 0, 0, + 255, 128, 1, 0, 228, 128, + 2, 0, 0, 3, 1, 0, + 3, 128, 0, 0, 228, 128, + 15, 0, 0, 160, 4, 0, + 0, 4, 1, 0, 2, 128, + 1, 0, 85, 128, 15, 0, + 85, 161, 15, 0, 0, 160, + 5, 0, 0, 3, 1, 0, + 1, 128, 1, 0, 0, 128, + 15, 0, 85, 160, 5, 0, + 0, 3, 1, 0, 6, 128, + 1, 0, 85, 128, 13, 0, + 196, 160, 4, 0, 0, 4, + 1, 0, 3, 128, 12, 0, + 225, 160, 1, 0, 0, 128, + 1, 0, 233, 128, 2, 0, + 0, 3, 0, 0, 12, 224, + 1, 0, 68, 128, 14, 0, + 20, 160, 4, 0, 0, 4, + 0, 0, 3, 192, 0, 0, + 255, 128, 0, 0, 228, 160, + 0, 0, 228, 128, 1, 0, + 0, 2, 0, 0, 12, 192, + 0, 0, 228, 128, 1, 0, + 0, 2, 1, 0, 4, 224, + 15, 0, 170, 160, 255, 255, + 0, 0, 83, 72, 68, 82, + 108, 3, 0, 0, 64, 0, + 1, 0, 219, 0, 0, 0, + 89, 0, 0, 4, 70, 142, + 32, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 95, 0, + 0, 3, 50, 16, 16, 0, + 0, 0, 0, 0, 103, 0, + 0, 4, 242, 32, 16, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 101, 0, 0, 3, + 50, 32, 16, 0, 1, 0, + 0, 0, 101, 0, 0, 3, + 194, 32, 16, 0, 1, 0, + 0, 0, 101, 0, 0, 3, + 114, 32, 16, 0, 2, 0, + 0, 0, 104, 0, 0, 2, + 2, 0, 0, 0, 50, 0, + 0, 11, 50, 0, 16, 0, + 0, 0, 0, 0, 70, 16, + 16, 0, 0, 0, 0, 0, + 230, 138, 32, 0, 0, 0, + 0, 0, 10, 0, 0, 0, + 70, 128, 32, 0, 0, 0, + 0, 0, 10, 0, 0, 0, + 56, 0, 0, 8, 242, 0, + 16, 0, 1, 0, 0, 0, + 86, 5, 16, 0, 0, 0, + 0, 0, 70, 142, 32, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 50, 0, 0, 10, + 242, 0, 16, 0, 0, 0, + 0, 0, 70, 142, 32, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 6, 0, 16, 0, + 0, 0, 0, 0, 70, 14, + 16, 0, 1, 0, 0, 0, + 0, 0, 0, 8, 242, 0, + 16, 0, 0, 0, 0, 0, + 70, 14, 16, 0, 0, 0, + 0, 0, 70, 142, 32, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 14, 0, 0, 7, + 114, 0, 16, 0, 1, 0, + 0, 0, 70, 2, 16, 0, + 0, 0, 0, 0, 246, 15, + 16, 0, 0, 0, 0, 0, + 54, 0, 0, 5, 130, 0, + 16, 0, 1, 0, 0, 0, + 58, 0, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 9, + 50, 0, 16, 0, 0, 0, + 0, 0, 70, 0, 16, 0, + 0, 0, 0, 0, 70, 128, + 32, 128, 65, 0, 0, 0, + 0, 0, 0, 0, 11, 0, + 0, 0, 14, 0, 0, 8, + 50, 32, 16, 0, 2, 0, + 0, 0, 70, 0, 16, 0, + 0, 0, 0, 0, 230, 138, + 32, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 0, 0, + 0, 9, 242, 0, 16, 0, + 0, 0, 0, 0, 70, 14, + 16, 0, 1, 0, 0, 0, + 70, 142, 32, 128, 65, 0, + 0, 0, 0, 0, 0, 0, + 8, 0, 0, 0, 56, 0, + 0, 7, 114, 0, 16, 0, + 0, 0, 0, 0, 246, 15, + 16, 0, 0, 0, 0, 0, + 70, 2, 16, 0, 0, 0, + 0, 0, 56, 0, 0, 8, + 242, 0, 16, 0, 1, 0, + 0, 0, 86, 5, 16, 0, + 0, 0, 0, 0, 70, 142, + 32, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 50, 0, + 0, 10, 242, 0, 16, 0, + 1, 0, 0, 0, 70, 142, + 32, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 6, 0, + 16, 0, 0, 0, 0, 0, + 70, 14, 16, 0, 1, 0, + 0, 0, 50, 0, 0, 10, + 242, 0, 16, 0, 1, 0, + 0, 0, 70, 142, 32, 0, + 0, 0, 0, 0, 6, 0, + 0, 0, 166, 10, 16, 0, + 0, 0, 0, 0, 70, 14, + 16, 0, 1, 0, 0, 0, + 50, 0, 0, 10, 242, 0, + 16, 0, 0, 0, 0, 0, + 70, 142, 32, 0, 0, 0, + 0, 0, 7, 0, 0, 0, + 246, 15, 16, 0, 0, 0, + 0, 0, 70, 14, 16, 0, + 1, 0, 0, 0, 54, 0, + 0, 5, 242, 32, 16, 0, + 0, 0, 0, 0, 70, 14, + 16, 0, 0, 0, 0, 0, + 0, 0, 0, 10, 50, 0, + 16, 0, 0, 0, 0, 0, + 70, 0, 16, 0, 0, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 128, 63, 0, 0, + 128, 63, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 0, + 0, 10, 34, 0, 16, 0, + 0, 0, 0, 0, 26, 0, + 16, 128, 65, 0, 0, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 0, 63, + 1, 64, 0, 0, 0, 0, + 128, 63, 56, 0, 0, 7, + 18, 0, 16, 0, 0, 0, + 0, 0, 10, 0, 16, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 0, 63, + 56, 0, 0, 8, 98, 0, + 16, 0, 0, 0, 0, 0, + 86, 5, 16, 0, 0, 0, + 0, 0, 6, 129, 32, 0, + 0, 0, 0, 0, 13, 0, + 0, 0, 50, 0, 0, 10, + 50, 0, 16, 0, 0, 0, + 0, 0, 70, 128, 32, 0, + 0, 0, 0, 0, 12, 0, + 0, 0, 6, 0, 16, 0, + 0, 0, 0, 0, 150, 5, + 16, 0, 0, 0, 0, 0, + 0, 0, 0, 8, 194, 32, + 16, 0, 1, 0, 0, 0, + 6, 4, 16, 0, 0, 0, + 0, 0, 6, 132, 32, 0, + 0, 0, 0, 0, 15, 0, + 0, 0, 50, 0, 0, 11, + 50, 32, 16, 0, 1, 0, + 0, 0, 70, 16, 16, 0, + 0, 0, 0, 0, 230, 138, + 32, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 70, 128, + 32, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 54, 0, + 0, 5, 66, 32, 16, 0, + 2, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 0, 0, + 62, 0, 0, 1, 83, 84, + 65, 84, 116, 0, 0, 0, + 24, 0, 0, 0, 2, 0, + 0, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 20, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 82, 68, 69, 70, + 104, 2, 0, 0, 1, 0, + 0, 0, 72, 0, 0, 0, + 1, 0, 0, 0, 28, 0, + 0, 0, 0, 4, 254, 255, + 0, 1, 0, 0, 52, 2, + 0, 0, 60, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 36, 71, + 108, 111, 98, 97, 108, 115, + 0, 171, 171, 171, 60, 0, + 0, 0, 10, 0, 0, 0, + 96, 0, 0, 0, 48, 1, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 80, 1, + 0, 0, 0, 0, 0, 0, + 64, 0, 0, 0, 2, 0, + 0, 0, 96, 1, 0, 0, + 0, 0, 0, 0, 112, 1, + 0, 0, 64, 0, 0, 0, + 64, 0, 0, 0, 2, 0, + 0, 0, 96, 1, 0, 0, + 0, 0, 0, 0, 124, 1, + 0, 0, 128, 0, 0, 0, + 16, 0, 0, 0, 2, 0, + 0, 0, 144, 1, 0, 0, + 0, 0, 0, 0, 160, 1, + 0, 0, 144, 0, 0, 0, + 16, 0, 0, 0, 2, 0, + 0, 0, 176, 1, 0, 0, + 0, 0, 0, 0, 192, 1, + 0, 0, 160, 0, 0, 0, + 16, 0, 0, 0, 2, 0, + 0, 0, 176, 1, 0, 0, + 0, 0, 0, 0, 203, 1, + 0, 0, 176, 0, 0, 0, + 16, 0, 0, 0, 2, 0, + 0, 0, 176, 1, 0, 0, + 0, 0, 0, 0, 213, 1, + 0, 0, 192, 0, 0, 0, + 64, 0, 0, 0, 2, 0, + 0, 0, 96, 1, 0, 0, + 0, 0, 0, 0, 232, 1, + 0, 0, 0, 1, 0, 0, + 16, 0, 0, 0, 0, 0, + 0, 0, 144, 1, 0, 0, + 0, 0, 0, 0, 244, 1, + 0, 0, 16, 1, 0, 0, + 4, 0, 0, 0, 0, 0, + 0, 0, 4, 2, 0, 0, + 0, 0, 0, 0, 20, 2, + 0, 0, 32, 1, 0, 0, + 16, 0, 0, 0, 0, 0, + 0, 0, 36, 2, 0, 0, 0, 0, 0, 0, 109, 76, 97, 121, 101, 114, 84, 114, 97, 110, 115, 102, 111, 114, @@ -6196,54 +6464,4354 @@ const BYTE ComponentAlphaShaderMask[] = 118, 82, 101, 110, 100, 101, 114, 84, 97, 114, 103, 101, 116, 79, 102, 102, 115, 101, - 116, 0, 118, 84, 101, 120, - 116, 117, 114, 101, 67, 111, - 111, 114, 100, 115, 0, 171, + 116, 0, 1, 0, 3, 0, + 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 118, 84, 101, 120, 116, 117, + 114, 101, 67, 111, 111, 114, + 100, 115, 0, 171, 1, 0, + 3, 0, 1, 0, 4, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 118, 76, 97, 121, + 101, 114, 81, 117, 97, 100, + 0, 118, 77, 97, 115, 107, + 81, 117, 97, 100, 0, 109, + 66, 97, 99, 107, 100, 114, + 111, 112, 84, 114, 97, 110, + 115, 102, 111, 114, 109, 0, + 102, 76, 97, 121, 101, 114, + 67, 111, 108, 111, 114, 0, + 102, 76, 97, 121, 101, 114, + 79, 112, 97, 99, 105, 116, + 121, 0, 171, 171, 0, 0, + 3, 0, 1, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 105, 66, 108, 101, + 110, 100, 67, 111, 110, 102, + 105, 103, 0, 171, 171, 171, + 1, 0, 19, 0, 1, 0, + 4, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 77, 105, + 99, 114, 111, 115, 111, 102, + 116, 32, 40, 82, 41, 32, + 72, 76, 83, 76, 32, 83, + 104, 97, 100, 101, 114, 32, + 67, 111, 109, 112, 105, 108, + 101, 114, 32, 54, 46, 51, + 46, 57, 54, 48, 48, 46, + 49, 54, 51, 56, 52, 0, + 171, 171, 73, 83, 71, 78, + 44, 0, 0, 0, 1, 0, + 0, 0, 8, 0, 0, 0, + 32, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 3, 3, 0, 0, + 80, 79, 83, 73, 84, 73, + 79, 78, 0, 171, 171, 171, + 79, 83, 71, 78, 128, 0, + 0, 0, 4, 0, 0, 0, + 8, 0, 0, 0, 104, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 116, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 1, 0, 0, 0, + 3, 12, 0, 0, 116, 0, + 0, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 1, 0, 0, 0, + 12, 3, 0, 0, 116, 0, + 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 2, 0, 0, 0, + 7, 8, 0, 0, 83, 86, + 95, 80, 111, 115, 105, 116, + 105, 111, 110, 0, 84, 69, + 88, 67, 79, 79, 82, 68, + 0, 171, 171, 171 +}; +ShaderBytes sLayerQuadBlendMaskVS = { LayerQuadBlendMaskVS, sizeof(LayerQuadBlendMaskVS) }; +#if 0 +// +// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 +// +// +// Buffer Definitions: +// +// cbuffer $Globals +// { +// +// float4x4 mLayerTransform; // Offset: 0 Size: 64 +// float4x4 mProjection; // Offset: 64 Size: 64 +// float4 vRenderTargetOffset; // Offset: 128 Size: 16 +// float4 vTextureCoords; // Offset: 144 Size: 16 +// float4 vLayerQuad; // Offset: 160 Size: 16 +// float4 vMaskQuad; // Offset: 176 Size: 16 +// float4x4 mBackdropTransform; // Offset: 192 Size: 64 +// float4 fLayerColor; // Offset: 256 Size: 16 [unused] +// float fLayerOpacity; // Offset: 272 Size: 4 [unused] +// uint4 iBlendConfig; // Offset: 288 Size: 16 [unused] +// +// } +// +// +// Resource Bindings: +// +// Name Type Format Dim Slot Elements +// ------------------------------ ---------- ------- ----------- ---- -------- +// $Globals cbuffer NA NA 0 1 +// +// +// +// Input signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// POSITION 0 xy 0 NONE float xy +// +// +// Output signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// SV_Position 0 xyzw 0 POS float xyzw +// TEXCOORD 0 xy 1 NONE float xy +// TEXCOORD 2 zw 1 NONE float zw +// TEXCOORD 1 xyz 2 NONE float xyz +// +// +// Constant buffer to DX9 shader constant mappings: +// +// Target Reg Buffer Start Reg # of Regs Data Conversion +// ---------- ------- --------- --------- ---------------------- +// c1 cb0 0 2 ( FLT, FLT, FLT, FLT) +// c3 cb0 3 11 ( FLT, FLT, FLT, FLT) +// c14 cb0 15 1 ( FLT, FLT, FLT, FLT) +// +// +// Runtime generated constant mappings: +// +// Target Reg Constant Description +// ---------- -------------------------------------------------- +// c0 Vertex Shader position offset +// +// +// Level9 shader bytecode: +// + vs_2_x + def c15, 1, 0.5, 0, 0 + dcl_texcoord v0 + mov r0.z, c15.x + rcp r0.w, c11.z + mad r1.xy, v0, c10.zwzw, c10 + mul r2, r1.y, c2 + mad r1, c1, r1.x, r2 + add r1, r1, c3 + rcp r2.x, r1.w + mad r2.yz, r1.xxyw, r2.x, -c11.xxyw + mul r1.xyz, r1, r2.x + mul r0.x, r0.w, r2.y + rcp r0.w, c11.w + mul r0.y, r0.w, r2.z + mul oT1.xyz, r0, r1.w + add r0, r1, -c8 + mad oT0.xy, v0, c9.zwzw, c9 + mul r0.xyz, r0.w, r0 + mul r1, r0.y, c5 + mad r1, c4, r0.x, r1 + mad r1, c6, r0.z, r1 + mad r0, c7, r0.w, r1 + add r1.xy, r0, c15.x + mad r1.y, r1.y, -c15.y, c15.x + mul r1.x, r1.x, c15.y + mul r1.yz, r1.y, c13.xyxw + mad r1.xy, c12.yxzw, r1.x, r1.yzzw + add oT0.zw, r1.xyxy, c14.xyyx + mad oPos.xy, r0.w, c0, r0 + mov oPos.zw, r0 + +// approximately 28 instruction slots used +vs_4_0 +dcl_constantbuffer cb0[16], immediateIndexed +dcl_input v0.xy +dcl_output_siv o0.xyzw, position +dcl_output o1.xy +dcl_output o1.zw +dcl_output o2.xyz +dcl_temps 3 +mad r0.xy, v0.xyxx, cb0[10].zwzz, cb0[10].xyxx +mul r1.xyzw, r0.yyyy, cb0[1].xyzw +mad r0.xyzw, cb0[0].xyzw, r0.xxxx, r1.xyzw +add r0.xyzw, r0.xyzw, cb0[3].xyzw +div r0.xyz, r0.xyzx, r0.wwww +add r1.xyzw, r0.xyzw, -cb0[8].xyzw +add r0.xy, r0.xyxx, -cb0[11].xyxx +div r0.xy, r0.xyxx, cb0[11].zwzz +mul r1.xyz, r1.wwww, r1.xyzx +mul r2.xyzw, r1.yyyy, cb0[5].xyzw +mad r2.xyzw, cb0[4].xyzw, r1.xxxx, r2.xyzw +mad r2.xyzw, cb0[6].xyzw, r1.zzzz, r2.xyzw +mad r1.xyzw, cb0[7].xyzw, r1.wwww, r2.xyzw +mov o0.xyzw, r1.xyzw +add r1.xy, r1.xyxx, l(1.000000, 1.000000, 0.000000, 0.000000) +mad r1.y, -r1.y, l(0.500000), l(1.000000) +mul r1.x, r1.x, l(0.500000) +mul r1.yz, r1.yyyy, cb0[13].xxyx +mad r1.xy, cb0[12].xyxx, r1.xxxx, r1.yzyy +add o1.zw, r1.xxxy, cb0[15].xxxy +mad o1.xy, v0.xyxx, cb0[9].zwzz, cb0[9].xyxx +mov r0.z, l(1.000000) +mul o2.xyz, r0.wwww, r0.xyzx +ret +// Approximately 24 instruction slots used +#endif + +const BYTE LayerQuadBlendMask3DVS[] = +{ + 68, 88, 66, 67, 114, 33, + 168, 234, 171, 245, 21, 91, + 164, 147, 216, 15, 58, 222, + 28, 166, 1, 0, 0, 0, + 176, 9, 0, 0, 6, 0, + 0, 0, 56, 0, 0, 0, + 140, 2, 0, 0, 8, 6, + 0, 0, 132, 6, 0, 0, + 244, 8, 0, 0, 40, 9, + 0, 0, 65, 111, 110, 57, + 76, 2, 0, 0, 76, 2, + 0, 0, 0, 2, 254, 255, + 0, 2, 0, 0, 76, 0, + 0, 0, 3, 0, 36, 0, + 0, 0, 72, 0, 0, 0, + 72, 0, 0, 0, 36, 0, + 1, 0, 72, 0, 0, 0, + 0, 0, 2, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 11, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 15, 0, 1, 0, 14, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 1, 2, 254, 255, + 81, 0, 0, 5, 15, 0, + 15, 160, 0, 0, 128, 63, + 0, 0, 0, 63, 0, 0, + 0, 0, 0, 0, 0, 0, + 31, 0, 0, 2, 5, 0, + 0, 128, 0, 0, 15, 144, + 1, 0, 0, 2, 0, 0, + 4, 128, 15, 0, 0, 160, + 6, 0, 0, 2, 0, 0, + 8, 128, 11, 0, 170, 160, + 4, 0, 0, 4, 1, 0, + 3, 128, 0, 0, 228, 144, + 10, 0, 238, 160, 10, 0, + 228, 160, 5, 0, 0, 3, + 2, 0, 15, 128, 1, 0, + 85, 128, 2, 0, 228, 160, + 4, 0, 0, 4, 1, 0, + 15, 128, 1, 0, 228, 160, + 1, 0, 0, 128, 2, 0, + 228, 128, 2, 0, 0, 3, + 1, 0, 15, 128, 1, 0, + 228, 128, 3, 0, 228, 160, + 6, 0, 0, 2, 2, 0, + 1, 128, 1, 0, 255, 128, + 4, 0, 0, 4, 2, 0, + 6, 128, 1, 0, 208, 128, + 2, 0, 0, 128, 11, 0, + 208, 161, 5, 0, 0, 3, + 1, 0, 7, 128, 1, 0, + 228, 128, 2, 0, 0, 128, + 5, 0, 0, 3, 0, 0, + 1, 128, 0, 0, 255, 128, + 2, 0, 85, 128, 6, 0, + 0, 2, 0, 0, 8, 128, + 11, 0, 255, 160, 5, 0, + 0, 3, 0, 0, 2, 128, + 0, 0, 255, 128, 2, 0, + 170, 128, 5, 0, 0, 3, + 1, 0, 7, 224, 0, 0, + 228, 128, 1, 0, 255, 128, + 2, 0, 0, 3, 0, 0, + 15, 128, 1, 0, 228, 128, + 8, 0, 228, 161, 4, 0, + 0, 4, 0, 0, 3, 224, + 0, 0, 228, 144, 9, 0, + 238, 160, 9, 0, 228, 160, + 5, 0, 0, 3, 0, 0, + 7, 128, 0, 0, 255, 128, + 0, 0, 228, 128, 5, 0, + 0, 3, 1, 0, 15, 128, + 0, 0, 85, 128, 5, 0, + 228, 160, 4, 0, 0, 4, + 1, 0, 15, 128, 4, 0, + 228, 160, 0, 0, 0, 128, + 1, 0, 228, 128, 4, 0, + 0, 4, 1, 0, 15, 128, + 6, 0, 228, 160, 0, 0, + 170, 128, 1, 0, 228, 128, + 4, 0, 0, 4, 0, 0, + 15, 128, 7, 0, 228, 160, + 0, 0, 255, 128, 1, 0, + 228, 128, 2, 0, 0, 3, + 1, 0, 3, 128, 0, 0, + 228, 128, 15, 0, 0, 160, + 4, 0, 0, 4, 1, 0, + 2, 128, 1, 0, 85, 128, + 15, 0, 85, 161, 15, 0, + 0, 160, 5, 0, 0, 3, + 1, 0, 1, 128, 1, 0, + 0, 128, 15, 0, 85, 160, + 5, 0, 0, 3, 1, 0, + 6, 128, 1, 0, 85, 128, + 13, 0, 196, 160, 4, 0, + 0, 4, 1, 0, 3, 128, + 12, 0, 225, 160, 1, 0, + 0, 128, 1, 0, 233, 128, + 2, 0, 0, 3, 0, 0, + 12, 224, 1, 0, 68, 128, + 14, 0, 20, 160, 4, 0, + 0, 4, 0, 0, 3, 192, + 0, 0, 255, 128, 0, 0, + 228, 160, 0, 0, 228, 128, + 1, 0, 0, 2, 0, 0, + 12, 192, 0, 0, 228, 128, + 255, 255, 0, 0, 83, 72, + 68, 82, 116, 3, 0, 0, + 64, 0, 1, 0, 221, 0, + 0, 0, 89, 0, 0, 4, + 70, 142, 32, 0, 0, 0, + 0, 0, 16, 0, 0, 0, + 95, 0, 0, 3, 50, 16, + 16, 0, 0, 0, 0, 0, + 103, 0, 0, 4, 242, 32, + 16, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 101, 0, + 0, 3, 50, 32, 16, 0, + 1, 0, 0, 0, 101, 0, + 0, 3, 194, 32, 16, 0, + 1, 0, 0, 0, 101, 0, + 0, 3, 114, 32, 16, 0, + 2, 0, 0, 0, 104, 0, + 0, 2, 3, 0, 0, 0, + 50, 0, 0, 11, 50, 0, + 16, 0, 0, 0, 0, 0, + 70, 16, 16, 0, 0, 0, + 0, 0, 230, 138, 32, 0, + 0, 0, 0, 0, 10, 0, + 0, 0, 70, 128, 32, 0, + 0, 0, 0, 0, 10, 0, + 0, 0, 56, 0, 0, 8, + 242, 0, 16, 0, 1, 0, + 0, 0, 86, 5, 16, 0, + 0, 0, 0, 0, 70, 142, + 32, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 50, 0, + 0, 10, 242, 0, 16, 0, + 0, 0, 0, 0, 70, 142, + 32, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 6, 0, + 16, 0, 0, 0, 0, 0, + 70, 14, 16, 0, 1, 0, + 0, 0, 0, 0, 0, 8, + 242, 0, 16, 0, 0, 0, + 0, 0, 70, 14, 16, 0, + 0, 0, 0, 0, 70, 142, + 32, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 14, 0, + 0, 7, 114, 0, 16, 0, + 0, 0, 0, 0, 70, 2, + 16, 0, 0, 0, 0, 0, + 246, 15, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 9, + 242, 0, 16, 0, 1, 0, + 0, 0, 70, 14, 16, 0, + 0, 0, 0, 0, 70, 142, + 32, 128, 65, 0, 0, 0, + 0, 0, 0, 0, 8, 0, + 0, 0, 0, 0, 0, 9, + 50, 0, 16, 0, 0, 0, + 0, 0, 70, 0, 16, 0, + 0, 0, 0, 0, 70, 128, + 32, 128, 65, 0, 0, 0, + 0, 0, 0, 0, 11, 0, + 0, 0, 14, 0, 0, 8, + 50, 0, 16, 0, 0, 0, + 0, 0, 70, 0, 16, 0, + 0, 0, 0, 0, 230, 138, + 32, 0, 0, 0, 0, 0, + 11, 0, 0, 0, 56, 0, + 0, 7, 114, 0, 16, 0, + 1, 0, 0, 0, 246, 15, + 16, 0, 1, 0, 0, 0, + 70, 2, 16, 0, 1, 0, + 0, 0, 56, 0, 0, 8, + 242, 0, 16, 0, 2, 0, + 0, 0, 86, 5, 16, 0, + 1, 0, 0, 0, 70, 142, + 32, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 50, 0, + 0, 10, 242, 0, 16, 0, + 2, 0, 0, 0, 70, 142, + 32, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 6, 0, + 16, 0, 1, 0, 0, 0, + 70, 14, 16, 0, 2, 0, + 0, 0, 50, 0, 0, 10, + 242, 0, 16, 0, 2, 0, + 0, 0, 70, 142, 32, 0, + 0, 0, 0, 0, 6, 0, + 0, 0, 166, 10, 16, 0, + 1, 0, 0, 0, 70, 14, + 16, 0, 2, 0, 0, 0, + 50, 0, 0, 10, 242, 0, + 16, 0, 1, 0, 0, 0, + 70, 142, 32, 0, 0, 0, + 0, 0, 7, 0, 0, 0, + 246, 15, 16, 0, 1, 0, + 0, 0, 70, 14, 16, 0, + 2, 0, 0, 0, 54, 0, + 0, 5, 242, 32, 16, 0, + 0, 0, 0, 0, 70, 14, + 16, 0, 1, 0, 0, 0, + 0, 0, 0, 10, 50, 0, + 16, 0, 1, 0, 0, 0, + 70, 0, 16, 0, 1, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 128, 63, 0, 0, + 128, 63, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 0, + 0, 10, 34, 0, 16, 0, + 1, 0, 0, 0, 26, 0, + 16, 128, 65, 0, 0, 0, + 1, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 0, 63, + 1, 64, 0, 0, 0, 0, + 128, 63, 56, 0, 0, 7, + 18, 0, 16, 0, 1, 0, + 0, 0, 10, 0, 16, 0, + 1, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 0, 63, + 56, 0, 0, 8, 98, 0, + 16, 0, 1, 0, 0, 0, + 86, 5, 16, 0, 1, 0, + 0, 0, 6, 129, 32, 0, + 0, 0, 0, 0, 13, 0, + 0, 0, 50, 0, 0, 10, + 50, 0, 16, 0, 1, 0, + 0, 0, 70, 128, 32, 0, + 0, 0, 0, 0, 12, 0, + 0, 0, 6, 0, 16, 0, + 1, 0, 0, 0, 150, 5, + 16, 0, 1, 0, 0, 0, + 0, 0, 0, 8, 194, 32, + 16, 0, 1, 0, 0, 0, + 6, 4, 16, 0, 1, 0, + 0, 0, 6, 132, 32, 0, + 0, 0, 0, 0, 15, 0, + 0, 0, 50, 0, 0, 11, + 50, 32, 16, 0, 1, 0, + 0, 0, 70, 16, 16, 0, + 0, 0, 0, 0, 230, 138, + 32, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 70, 128, + 32, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 54, 0, + 0, 5, 66, 0, 16, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 63, + 56, 0, 0, 7, 114, 32, + 16, 0, 2, 0, 0, 0, + 246, 15, 16, 0, 0, 0, + 0, 0, 70, 2, 16, 0, + 0, 0, 0, 0, 62, 0, + 0, 1, 83, 84, 65, 84, + 116, 0, 0, 0, 24, 0, + 0, 0, 3, 0, 0, 0, + 0, 0, 0, 0, 5, 0, + 0, 0, 21, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 2, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 82, 68, 69, 70, 104, 2, + 0, 0, 1, 0, 0, 0, + 72, 0, 0, 0, 1, 0, + 0, 0, 28, 0, 0, 0, + 0, 4, 254, 255, 0, 1, + 0, 0, 52, 2, 0, 0, + 60, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 0, 0, + 0, 0, 36, 71, 108, 111, + 98, 97, 108, 115, 0, 171, + 171, 171, 60, 0, 0, 0, + 10, 0, 0, 0, 96, 0, + 0, 0, 48, 1, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 80, 1, 0, 0, + 0, 0, 0, 0, 64, 0, + 0, 0, 2, 0, 0, 0, + 96, 1, 0, 0, 0, 0, + 0, 0, 112, 1, 0, 0, + 64, 0, 0, 0, 64, 0, + 0, 0, 2, 0, 0, 0, + 96, 1, 0, 0, 0, 0, + 0, 0, 124, 1, 0, 0, + 128, 0, 0, 0, 16, 0, + 0, 0, 2, 0, 0, 0, + 144, 1, 0, 0, 0, 0, + 0, 0, 160, 1, 0, 0, + 144, 0, 0, 0, 16, 0, + 0, 0, 2, 0, 0, 0, + 176, 1, 0, 0, 0, 0, + 0, 0, 192, 1, 0, 0, + 160, 0, 0, 0, 16, 0, + 0, 0, 2, 0, 0, 0, + 176, 1, 0, 0, 0, 0, + 0, 0, 203, 1, 0, 0, + 176, 0, 0, 0, 16, 0, + 0, 0, 2, 0, 0, 0, + 176, 1, 0, 0, 0, 0, + 0, 0, 213, 1, 0, 0, + 192, 0, 0, 0, 64, 0, + 0, 0, 2, 0, 0, 0, + 96, 1, 0, 0, 0, 0, + 0, 0, 232, 1, 0, 0, + 0, 1, 0, 0, 16, 0, + 0, 0, 0, 0, 0, 0, + 144, 1, 0, 0, 0, 0, + 0, 0, 244, 1, 0, 0, + 16, 1, 0, 0, 4, 0, + 0, 0, 0, 0, 0, 0, + 4, 2, 0, 0, 0, 0, + 0, 0, 20, 2, 0, 0, + 32, 1, 0, 0, 16, 0, + 0, 0, 0, 0, 0, 0, + 36, 2, 0, 0, 0, 0, + 0, 0, 109, 76, 97, 121, + 101, 114, 84, 114, 97, 110, + 115, 102, 111, 114, 109, 0, + 3, 0, 3, 0, 4, 0, + 4, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 109, 80, + 114, 111, 106, 101, 99, 116, + 105, 111, 110, 0, 118, 82, + 101, 110, 100, 101, 114, 84, + 97, 114, 103, 101, 116, 79, + 102, 102, 115, 101, 116, 0, 1, 0, 3, 0, 1, 0, 4, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 118, 76, - 97, 121, 101, 114, 81, 117, - 97, 100, 0, 118, 77, 97, - 115, 107, 81, 117, 97, 100, - 0, 77, 105, 99, 114, 111, - 115, 111, 102, 116, 32, 40, - 82, 41, 32, 72, 76, 83, - 76, 32, 83, 104, 97, 100, - 101, 114, 32, 67, 111, 109, - 112, 105, 108, 101, 114, 32, - 54, 46, 51, 46, 57, 54, - 48, 48, 46, 49, 54, 51, - 56, 52, 0, 171, 73, 83, - 71, 78, 104, 0, 0, 0, - 3, 0, 0, 0, 8, 0, - 0, 0, 80, 0, 0, 0, + 0, 0, 0, 0, 118, 84, + 101, 120, 116, 117, 114, 101, + 67, 111, 111, 114, 100, 115, + 0, 171, 1, 0, 3, 0, + 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 118, 76, 97, 121, 101, 114, + 81, 117, 97, 100, 0, 118, + 77, 97, 115, 107, 81, 117, + 97, 100, 0, 109, 66, 97, + 99, 107, 100, 114, 111, 112, + 84, 114, 97, 110, 115, 102, + 111, 114, 109, 0, 102, 76, + 97, 121, 101, 114, 67, 111, + 108, 111, 114, 0, 102, 76, + 97, 121, 101, 114, 79, 112, + 97, 99, 105, 116, 121, 0, + 171, 171, 0, 0, 3, 0, + 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 105, 66, 108, 101, 110, 100, + 67, 111, 110, 102, 105, 103, + 0, 171, 171, 171, 1, 0, + 19, 0, 1, 0, 4, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 77, 105, 99, 114, + 111, 115, 111, 102, 116, 32, + 40, 82, 41, 32, 72, 76, + 83, 76, 32, 83, 104, 97, + 100, 101, 114, 32, 67, 111, + 109, 112, 105, 108, 101, 114, + 32, 54, 46, 51, 46, 57, + 54, 48, 48, 46, 49, 54, + 51, 56, 52, 0, 171, 171, + 73, 83, 71, 78, 44, 0, + 0, 0, 1, 0, 0, 0, + 8, 0, 0, 0, 32, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 3, 3, 0, 0, 80, 79, + 83, 73, 84, 73, 79, 78, + 0, 171, 171, 171, 79, 83, + 71, 78, 128, 0, 0, 0, + 4, 0, 0, 0, 8, 0, + 0, 0, 104, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 0, - 0, 0, 92, 0, 0, 0, + 0, 0, 116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, - 1, 0, 0, 0, 3, 3, - 0, 0, 92, 0, 0, 0, + 1, 0, 0, 0, 3, 12, + 0, 0, 116, 0, 0, 0, + 2, 0, 0, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 1, 0, 0, 0, 12, 3, + 0, 0, 116, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, - 1, 0, 0, 0, 12, 12, + 2, 0, 0, 0, 7, 8, 0, 0, 83, 86, 95, 80, 111, 115, 105, 116, 105, 111, 110, 0, 84, 69, 88, 67, 79, 79, 82, 68, 0, 171, - 171, 171, 79, 83, 71, 78, - 68, 0, 0, 0, 2, 0, - 0, 0, 8, 0, 0, 0, - 56, 0, 0, 0, 0, 0, + 171, 171 +}; +ShaderBytes sLayerQuadBlendMask3DVS = { LayerQuadBlendMask3DVS, sizeof(LayerQuadBlendMask3DVS) }; +#if 0 +// +// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384 +// +// +// Buffer Definitions: +// +// cbuffer $Globals +// { +// +// float4 fLayerColor; // Offset: 0 Size: 16 +// float fLayerOpacity; // Offset: 16 Size: 4 +// uint4 iBlendConfig; // Offset: 32 Size: 16 +// float4x4 mLayerTransform; // Offset: 48 Size: 64 [unused] +// float4x4 mProjection; // Offset: 112 Size: 64 [unused] +// float4 vRenderTargetOffset; // Offset: 176 Size: 16 [unused] +// float4 vTextureCoords; // Offset: 192 Size: 16 [unused] +// float4 vLayerQuad; // Offset: 208 Size: 16 [unused] +// float4 vMaskQuad; // Offset: 224 Size: 16 [unused] +// float4x4 mBackdropTransform; // Offset: 240 Size: 64 [unused] +// +// } +// +// +// Resource Bindings: +// +// Name Type Format Dim Slot Elements +// ------------------------------ ---------- ------- ----------- ---- -------- +// sSampler sampler NA NA 0 1 +// LayerTextureSamplerLinear sampler NA NA 1 1 +// tRGB texture float4 2d 0 1 +// tY texture float4 2d 1 1 +// tCb texture float4 2d 2 1 +// tCr texture float4 2d 3 1 +// tMask texture float4 2d 5 1 +// tBackdrop texture float4 2d 6 1 +// $Globals cbuffer NA NA 0 1 +// +// +// +// Input signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// SV_Position 0 xyzw 0 POS float +// TEXCOORD 0 xy 1 NONE float xy +// TEXCOORD 2 zw 1 NONE float zw +// TEXCOORD 1 xyz 2 NONE float xyz +// +// +// Output signature: +// +// Name Index Mask Register SysValue Format Used +// -------------------- ----- ------ -------- -------- ------- ------ +// SV_Target 0 xyzw 0 TARGET float xyzw +// +// +// Constant buffer to DX9 shader constant mappings: +// +// Target Reg Buffer Start Reg # of Regs Data Conversion +// ---------- ------- --------- --------- ---------------------- +// c0 cb0 0 2 ( FLT, FLT, FLT, FLT) +// c2 cb0 2 1 (UINT,UINT,UINT,UINT) +// +// +// Sampler/Resource to DX9 shader sampler mappings: +// +// Target Sampler Source Sampler Source Resource +// -------------- --------------- ---------------- +// s0 s0 t0 +// s1 s0 t1 +// s2 s0 t2 +// s3 s0 t3 +// s4 s0 t5 +// s5 s0 t6 +// s6 s1 t5 +// +// +// Level9 shader bytecode: +// + ps_2_x + def c3, -1, -2, -0.50195998, -0.0627499968 + def c4, 1.59603, 0.812969983, 1.16437995, 2.01723003 + def c5, -1, -2, -3, -4 + def c6, -5, -6, -7, -8 + def c7, 1, 0.25, 2, -1 + def c8, 16, -12, -13, -14 + def c9, -9, -10, -11, -12 + def c10, 0.300000012, 0.589999974, 0.109999999, 0 + def c11, 0.391759992, -1, -0, -0.5 + dcl t0 + dcl t1.xyz + dcl_2d s0 + dcl_2d s1 + dcl_2d s2 + dcl_2d s3 + dcl_2d s4 + dcl_2d s5 + dcl_2d s6 + mov r0.x, -c11.z + mov r1.x, -c11.z + mov r2.z, -c11.z + texld r3, t0, s1 + texld r4, t0, s3 + add r0.w, r4.x, c3.z + mul r3.yz, r0.w, c4.xxyw + add r0.w, r3.x, c3.w + mad r1.w, r0.w, c4.z, -r3.z + mad r3.x, r0.w, c4.z, r3.y + texld r4, t1, s4 + texld r5, t0, s2 + add r2.w, r5.x, c3.z + mad r3.y, r2.w, -c11.x, r1.w + mul r1.w, r2.w, c4.w + mad r3.z, r0.w, c4.z, r1.w + mov r3.w, -c3.x + mul r3, r3, c1.x + mul r5, r4.x, r3 + rcp r0.w, t1.z + mul r6.xy, r0.w, t1 + texld r7, t0, s0 + texld r6, r6, s6 + mul r7, r7, c1.x + mul r8, r4.x, r7 + mov r9.xy, c3 + add r10, r9.xyxy, c2.xxyy + mul r10, r10, r10 + cmp r5, -r10.x, r8, r5 + mov r8.xyz, r7 + mov r8.w, c1.x + mul r11, r4.x, r8 + mul r4, r4.x, c0 + cmp r5, -c2.x, r11, r5 + cmp r6.yz, -r10.xyww, c11.y, c11.z + cmp r6.yz, -r10.xxzw, c3.x, r6 + cmp r6.yz, -c2.xxyw, r9.x, r6 + cmp r4, r6.y, r4, r5 + mul r5, r6.x, r7 + cmp r3, -r10.x, r7, r3 + cmp r4, -r10.z, r4, r5 + cmp r3, -c2.x, r8, r3 + cmp r3, r6.y, c0, r3 + cmp r3, -c2.y, r3, r4 + cmp r3, r6.z, -c11.zzzy, r3 + rcp r0.w, r3.w + mul r4.xyz, r0.w, r3 + cmp r4.xyz, -c2.w, r3, r4 + add r5.xy, -r4.yzzw, r4 + cmp r5.zw, r5.x, r4.xyxy, r4.xyyx + max r0.w, r5.z, r4.z + min r1.w, r4.z, r5.w + add r6.w, r0.w, -r1.w + mov r7.xy, t0.wzzw + texld r7, r7, s5 + rcp r0.w, r7.w + mul r8.xyz, r0.w, r7 + mad r5.zw, r7.xyzy, r0.w, -r8.xyxz + mul r9.xy, r6.w, r5.zwzw + mad r10, r7.yxxz, r0.w, -r8.xzyy + rcp r1.w, r10.x + mul r6.y, r1.w, r9.x + cmp r1.yz, r10.z, -c11.z, r6.xwyw + mul r11, r6.w, r10 + rcp r1.w, r5.w + mul r6.x, r1.w, r11.y + cmp r2.xy, r10.w, -c11.z, r6.xwzw + cmp r1.xyz, r5.z, r1, r2 + rcp r1.w, r5.z + mul r6.z, r1.w, r11.x + cmp r0.yz, r10.y, -c11.z, r6.xzww + cmp r0.xyz, r10.w, r0, r1 + mov r1.y, -c11.z + mov r2.y, -c11.z + mov r12.z, -c11.z + rcp r1.w, r10.z + mul r6.y, r1.w, r11.w + cmp r2.xz, r10.x, -c11.z, r6.wyyw + rcp r1.w, r10.y + mul r6.x, r1.w, r9.y + cmp r12.xy, r5.z, -c11.z, r6.wxzw + cmp r2.xyz, r10.w, r2, r12 + rcp r1.w, r10.w + mul r6.z, r1.w, r11.z + cmp r1.xz, r5.w, -c11.z, r6.zyww + cmp r1.xyz, r5.z, r1, r2 + cmp r0.xyz, r10.x, r0, r1 + cmp r1.xy, r10.z, r8, r8.yxzw + dp3 r4.w, c10, r0 + dp3 r8.w, c10, r8 + add r4.w, -r4.w, r8.w + add r0.xyz, r0, r4.w + add r4.w, -r0.y, r0.x + cmp r1.zw, r4.w, r0.xyyx, r0.xyxy + min r4.w, r0.z, r1.z + max r2.x, r1.w, r0.z + dp3 r1.z, c10, r0 + add r1.w, -r4.w, r1.z + rcp r1.w, r1.w + add r2.yzw, r0.xxyz, -r1.z + mul r2.yzw, r1.z, r2 + mad r2.yzw, r2, r1.w, r1.z + cmp r0.xyz, r4.w, r0, r2.yzww + add r2.yzw, -r1.z, r0.xxyz + add r1.w, -r1.z, -c3.x + mul r2.yzw, r1.w, r2 + add r1.w, -r1.z, r2.x + add r4.w, -r2.x, -c3.x + rcp r1.w, r1.w + mad r2.xyz, r2.yzww, r1.w, r1.z + cmp r0.xyz, r4.w, r0, r2 + mov r4.w, c2.z + add r1.zw, r4.w, c8 + mul r1.zw, r1, r1 + dp3 r2.x, c10, r4 + add r2.y, -r8.w, r2.x + add r2.x, -r2.x, r8.w + add r2.xzw, r2.x, r4.xyyz + mad r6.xyz, r7, r0.w, r2.y + add r6.w, -r6.y, r6.x + cmp r5.zw, r6.w, r6.xyyx, r6.xyxy + min r2.y, r6.z, r5.z + max r9.x, r5.w, r6.z + dp3 r6.w, c10, r6 + add r5.z, -r2.y, r6.w + rcp r5.z, r5.z + add r9.yzw, -r6.w, r6.xxyz + mul r9.yzw, r6.w, r9 + mad r9.yzw, r9, r5.z, r6.w + cmp r6.xyz, r2.y, r6, r9.yzww + add r9.yzw, -r6.w, r6.xxyz + add r2.y, -r6.w, -c3.x + mul r9.yzw, r2.y, r9 + add r2.y, -r6.w, r9.x + add r5.z, -r9.x, -c3.x + rcp r5.w, r2.y + mad r9.xyz, r9.yzww, r5.w, r6.w + cmp r6.xyz, r5.z, r6, r9 + cmp r6.xyz, -r1.w, r6, -c11.z + add r1.w, -r2.z, r2.x + cmp r5.zw, r1.w, r2.xyzx, r2.xyxz + min r1.w, r2.w, r5.z + max r6.w, r5.w, r2.w + dp3 r2.y, c10, r2.xzww + add r5.z, -r1.w, r2.y + rcp r5.z, r5.z + add r9.xyz, -r2.y, r2.xzww + mul r9.xyz, r2.y, r9 + mad r9.xyz, r9, r5.z, r2.y + cmp r2.xzw, r1.w, r2, r9.xyyz + add r9.xyz, -r2.y, r2.xzww + add r1.w, -r2.y, -c3.x + mul r9.xyz, r1.w, r9 + add r1.w, -r2.y, r6.w + add r6.w, -r6.w, -c3.x + rcp r1.w, r1.w + mad r9.xyz, r9, r1.w, r2.y + cmp r2.xyz, r6.w, r2.xzww, r9 + cmp r2.xyz, -r1.z, r2, r6 + add r6, r4.w, c9 + mul r6, r6, r6 + cmp r0.xyz, -r6.w, r0, r2 + add r2, -r4.xxzy, r4.yzxz + mov r9.y, -c11.z + mov r10.y, -c11.z + mov r11.z, -c11.z + rcp r6.w, r2.z + max r9.w, r1.x, r8.z + min r10.w, r8.z, r1.y + add r1.w, r9.w, -r10.w + mul r5.zw, r1.w, r5.xyxy + mul r1.x, r6.w, r5.w + cmp r11.xy, r2.y, -c11.z, r1.wxzw + rcp r5.w, r5.x + mul r12, r1.w, r2 + mul r1.y, r5.w, r12.w + cmp r10.xz, r2.x, -c11.z, r1.wyyw + cmp r10.xyz, r2.w, r10, r11 + rcp r5.w, r2.w + mul r1.z, r5.w, r5.z + cmp r9.xz, r5.y, -c11.z, r1.zyww + cmp r9.xyz, r2.y, r9, r10 + mov r10.x, -c11.z + mov r11.x, -c11.z + mov r13.z, -c11.z + rcp r6.w, r2.x + mul r1.y, r6.w, r12.y + cmp r11.yz, r5.x, -c11.z, r1.xwyw + rcp r6.w, r5.y + mul r1.x, r6.w, r12.z + cmp r13.xy, r2.w, -c11.z, r1.xwzw + cmp r5.xyz, r2.y, r11, r13 + rcp r5.w, r2.y + mul r1.z, r5.w, r12.x + cmp r10.yz, r2.z, -c11.z, r1.xzww + cmp r1.xyz, r2.w, r10, r5 + cmp r1.xyz, r2.x, r1, r9 + dp3 r1.w, c10, r1 + add r1.w, -r1.w, r8.w + add r1.xyz, r1.w, r1 + add r1.w, -r1.y, r1.x + cmp r2.xy, r1.w, r1.yxzw, r1 + min r6.w, r1.z, r2.x + max r8.w, r2.y, r1.z + dp3 r1.w, c10, r1 + add r2.x, -r6.w, r1.w + rcp r2.x, r2.x + add r2.yzw, -r1.w, r1.xxyz + mul r2.yzw, r1.w, r2 + mad r2.xyz, r2.yzww, r2.x, r1.w + cmp r1.xyz, r6.w, r1, r2 + add r2.xyz, -r1.w, r1 + add r2.w, -r1.w, -c3.x + mul r2.xyz, r2.w, r2 + add r2.w, -r1.w, r8.w + add r6.w, -r8.w, -c3.x + rcp r2.w, r2.w + mad r2.xyz, r2, r2.w, r1.w + cmp r1.xyz, r6.w, r1, r2 + cmp r0.xyz, -r6.z, r1, r0 + mad r1.xyz, r7, r0.w, r4 + mul r2.xyz, r4, r8 + mad r5.xyz, r2, c3.y, r1 + mad r1.xyz, r8, -r4, r1 + cmp r0.xyz, -r6.y, r5, r0 + mad r5.xyz, r7, r0.w, -r4 + abs r5.xyz, r5 + cmp r0.xyz, -r6.x, r5, r0 + add r5.xy, -r4.yzzw, -c11.w + mad r6.xyz, r4, c7.z, c7.w + mad r1.w, r7.z, -r0.w, c7.y + mad r9.xyz, r8, c8.x, c8.y + mad r9.xyz, r9, r8, -c5.w + mul r9.xyz, r8, r9 + rsq r2.w, r8.z + rcp r2.w, r2.w + cmp r1.w, r1.w, r9.z, r2.w + mad r1.w, r7.z, -r0.w, r1.w + mad r1.w, r6.z, r1.w, r8.z + mad r10.xyz, r4, c3.y, -c3.x + mul r10.xyz, r8, r10 + mad r11, r7.yzxy, -r0.w, c7.xxyy + mad r5.zw, r10.xyyz, -r11.xyxy, r8.xyyz + cmp r12.z, r5.y, r5.w, r1.w + rsq r1.w, r8.y + rcp r1.w, r1.w + cmp r1.w, r11.w, r9.y, r1.w + mad r1.w, r7.y, -r0.w, r1.w + mad r1.w, r6.y, r1.w, r8.y + cmp r12.y, r5.x, r5.z, r1.w + add r13, r4.w, c6 + mul r13, r13, r13 + add r14, -r4.xyzx, -c11.yyyw + rsq r1.w, r8.x + rcp r1.w, r1.w + cmp r1.w, r11.z, r9.x, r1.w + mad r1.w, r7.x, -r0.w, r1.w + mad r1.w, r6.x, r1.w, r8.x + mad r6, r7.xyzx, -r0.w, -c11.wwwy + mad r9.xyz, r7, r0.w, c3.x + mul r9.xyz, r9, r9 + mad r0.w, r10.x, -r6.w, r8.x + cmp r12.x, r14.w, r0.w, r1.w + cmp r0.xyz, -r13.w, r12, r0 + add r10.xyz, r8, r8 + mad r12.xyz, r4, -c3.y, r10 + add r12.xyz, r12, c3.x + mad r15.xyz, r4, -r10, r12 + mul r10.xyz, r4, r10 + add r16.xyz, r4, r4 + mul r17.xyz, r8, r16 + mad r12.xyz, r16, -r8, r12 + cmp r6.xyz, r6, r10, r12 + cmp r5.yz, r5.xxyw, r17, r15 + cmp r5.x, r14.w, r17.x, r15.x + cmp r0.xyz, -r13.z, r5, r0 + rcp r0.w, r4.x + mad r0.w, r6.w, -r0.w, -c3.x + max r1.w, r0.w, -c11.z + mul r5.xyz, r4, r4 + cmp r0.w, -r5.x, -c11.z, r1.w + cmp r10.x, -r9.x, -c3.x, r0.w + rcp r0.w, r4.y + mad r0.w, r11.x, -r0.w, -c3.x + max r1.w, r0.w, -c11.z + cmp r0.w, -r5.y, -c11.z, r1.w + cmp r10.y, -r9.y, -c3.x, r0.w + rcp r0.w, r4.z + mad r0.w, r11.y, -r0.w, -c3.x + max r1.w, r0.w, -c11.z + cmp r0.w, -r5.z, -c11.z, r1.w + cmp r10.z, -r9.z, -c3.x, r0.w + cmp r0.xyz, -r13.y, r10, r0 + add r5.xyz, r4, c3.x + mul r5.xyz, r5, r5 + rcp r0.w, r14.x + mul r0.w, r0.w, r8.x + min r1.w, r0.w, -c3.x + cmp r0.w, -r5.x, -c3.x, r1.w + mul r9.xyz, r8, r8 + cmp r10.x, -r9.x, -c11.z, r0.w + rcp r0.w, r14.y + rcp r1.w, r14.z + mul r1.w, r1.w, r8.z + min r2.w, r1.w, -c3.x + cmp r1.w, -r5.z, -c3.x, r2.w + cmp r10.z, -r9.z, -c11.z, r1.w + mul r0.w, r0.w, r8.y + min r1.w, r0.w, -c3.x + cmp r0.w, -r5.y, -c3.x, r1.w + cmp r10.y, -r9.y, -c11.z, r0.w + cmp r0.xyz, -r13.x, r10, r0 + add r5, r4.w, c5 + mul r5, r5, r5 + max r9.xyz, r8, r4 + min r10.xyz, r4, r8 + cmp r0.xyz, -r5.w, r9, r0 + cmp r0.xyz, -r5.z, r10, r0 + cmp r0.xyz, -r5.y, r6, r0 + cmp r0.xyz, -r5.x, r1, r0 + cmp r0.xyz, -c2.z, r2, r0 + lrp r1.xyz, r7.w, r0, r4 + mul r0.xyz, r3.w, r1 + mul r1.x, r3.w, r3.w + mov r0.w, r3.w + cmp r0, -r1.x, r7, r0 + mul r1.x, r7.w, r7.w + cmp r0, -r1.x, r3, r0 + mov oC0, r0 + +// approximately 329 instruction slots used (7 texture, 322 arithmetic) +ps_4_0 +dcl_constantbuffer cb0[3], immediateIndexed +dcl_sampler s0, mode_default +dcl_sampler s1, mode_default +dcl_resource_texture2d (float,float,float,float) t0 +dcl_resource_texture2d (float,float,float,float) t1 +dcl_resource_texture2d (float,float,float,float) t2 +dcl_resource_texture2d (float,float,float,float) t3 +dcl_resource_texture2d (float,float,float,float) t5 +dcl_resource_texture2d (float,float,float,float) t6 +dcl_input_ps linear v1.xy +dcl_input_ps linear v1.zw +dcl_input_ps linear v2.xyz +dcl_output o0.xyzw +dcl_temps 22 +sample r0.xyzw, v1.zwzz, t6.xyzw, s0 +if_z cb0[2].y + if_z cb0[2].x + sample r1.xyzw, v1.xyxx, t0.xyzw, s0 + mul r1.xyz, r1.xyzx, cb0[1].xxxx + mov r1.w, cb0[1].x + mov r2.x, l(-1) + else + ieq r2.y, l(1), cb0[2].x + if_nz r2.y + sample r3.xyzw, v1.xyxx, t0.xyzw, s0 + mul r1.xyzw, r3.xyzw, cb0[1].xxxx + mov r2.x, l(-1) + else + ieq r2.x, l(2), cb0[2].x + if_nz r2.x + sample r3.xyzw, v1.xyxx, t3.xyzw, s0 + add r2.y, r3.x, l(-0.501960) + sample r3.xyzw, v1.xyxx, t1.xyzw, s0 + add r2.z, r3.x, l(-0.062750) + sample r3.xyzw, v1.xyxx, t2.xyzw, s0 + add r2.w, r3.x, l(-0.501960) + mul r3.xy, r2.yyyy, l(1.596030, 0.812970, 0.000000, 0.000000) + mad r4.x, r2.z, l(1.164380), r3.x + mad r2.y, r2.z, l(1.164380), -r3.y + mul r3.x, r2.w, l(2.017230) + mad r4.y, -r2.w, l(0.391760), r2.y + mad r4.z, r2.z, l(1.164380), r3.x + mov r4.w, l(1.000000) + mul r1.xyzw, r4.xyzw, cb0[1].xxxx + endif + endif + endif + movc r1.xyzw, r2.xxxx, r1.xyzw, cb0[0].xyzw + mov r2.x, l(-1) +else + ieq r2.y, l(1), cb0[2].y + if_nz r2.y + if_z cb0[2].x + sample r3.xyzw, v1.xyxx, t0.xyzw, s0 + mul r3.xyz, r3.xyzx, cb0[1].xxxx + sample r4.xyzw, v2.xyxx, t5.xyzw, s0 + mov r3.w, cb0[1].x + mul r1.xyzw, r3.xyzw, r4.xxxx + mov r2.y, l(-1) + else + ieq r2.z, l(1), cb0[2].x + if_nz r2.z + sample r3.xyzw, v2.xyxx, t5.xyzw, s0 + sample r4.xyzw, v1.xyxx, t0.xyzw, s0 + mul r4.xyzw, r4.xyzw, cb0[1].xxxx + mul r1.xyzw, r3.xxxx, r4.xyzw + mov r2.y, l(-1) + else + ieq r2.y, l(2), cb0[2].x + if_nz r2.y + sample r3.xyzw, v2.xyxx, t5.xyzw, s0 + sample r4.xyzw, v1.xyxx, t3.xyzw, s0 + add r2.z, r4.x, l(-0.501960) + sample r4.xyzw, v1.xyxx, t1.xyzw, s0 + add r2.w, r4.x, l(-0.062750) + sample r4.xyzw, v1.xyxx, t2.xyzw, s0 + add r3.y, r4.x, l(-0.501960) + mul r3.zw, r2.zzzz, l(0.000000, 0.000000, 1.596030, 0.812970) + mad r4.x, r2.w, l(1.164380), r3.z + mad r2.z, r2.w, l(1.164380), -r3.w + mul r3.z, r3.y, l(2.017230) + mad r4.y, -r3.y, l(0.391760), r2.z + mad r4.z, r2.w, l(1.164380), r3.z + mov r4.w, l(1.000000) + mul r4.xyzw, r4.xyzw, cb0[1].xxxx + mul r1.xyzw, r3.xxxx, r4.xyzw + endif + endif + endif + if_z r2.y + sample r3.xyzw, v2.xyxx, t5.xyzw, s0 + mul r1.xyzw, r3.xxxx, cb0[0].xyzw + endif + mov r2.x, l(-1) + else + ieq r2.x, l(2), cb0[2].y + if_nz r2.x + div r2.yz, v2.xxyx, v2.zzzz + sample r3.xyzw, r2.yzyy, t5.xyzw, s1 + sample r4.xyzw, v1.xyxx, t0.xyzw, s0 + mul r4.xyzw, r4.xyzw, cb0[1].xxxx + mul r1.xyzw, r3.xxxx, r4.xyzw + endif + endif +endif +movc r1.xyzw, r2.xxxx, r1.xyzw, l(0,0,0,1.000000) +eq r2.x, r0.w, l(0.000000) +if_nz r2.x + mov o0.xyzw, r1.xyzw + ret +endif +eq r2.x, r1.w, l(0.000000) +if_nz r2.x + mov o0.xyzw, r0.xyzw + ret +endif +div r0.xyz, r0.xyzx, r0.wwww +div r2.xyz, r1.xyzx, r1.wwww +movc r1.xyz, cb0[2].wwww, r2.xyzx, r1.xyzx +mul r2.xyz, r0.xyzx, r1.xyzx +add r3.xyz, r0.xyzx, r1.xyzx +mad r4.xyz, -r0.xyzx, r1.xyzx, r3.xyzx +ge r5.xyzw, l(0.500000, 0.500000, 0.500000, 0.250000), r0.xyzx +add r6.xyz, r0.xyzx, r0.xyzx +mul r7.xyz, r1.xyzx, r6.xyzx +add r8.xyz, r1.xyzx, r1.xyzx +mad r9.xyz, r1.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), r6.xyzx +add r9.xyz, r9.xyzx, l(-1.000000, -1.000000, -1.000000, 0.000000) +mul r10.xyz, r0.xyzx, r8.xyzx +mad r8.xyz, -r8.xyzx, r0.xyzx, r9.xyzx +movc r5.xyz, r5.xyzx, r7.xyzx, r8.xyzx +min r7.xyz, r0.xyzx, r1.xyzx +ieq r8.xyzw, l(1, 2, 3, 4), cb0[2].zzzz +max r11.xyz, r0.xyzx, r1.xyzx +eq r12.xyzw, r0.xyzx, l(0.000000, 0.000000, 0.000000, 1.000000) +eq r13.xyzw, r1.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000) +add r14.xyz, -r1.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000) +div r14.xyz, r0.xyzx, r14.xyzx +min r14.xyz, r14.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000) +movc r13.xyz, r13.xyzx, l(1.000000,1.000000,1.000000,0), r14.xyzx +movc r12.xyz, r12.xyzx, l(0,0,0,0), r13.xyzx +add r13.xyz, -r0.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000) +div r14.xyz, r13.xyzx, r1.xyzx +min r14.xyz, r14.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000) +add r14.xyz, -r14.xyzx, l(1.000000, 1.000000, 1.000000, 0.000000) +movc r2.w, r13.w, l(0), r14.x +movc r15.x, r12.w, l(1.000000), r2.w +eq r14.xw, r0.yyyz, l(1.000000, 0.000000, 0.000000, 1.000000) +eq r16.xy, r1.yzyy, l(0.000000, 0.000000, 0.000000, 0.000000) +movc r14.yz, r16.xxyx, l(0,0,0,0), r14.yyzy +movc r15.yz, r14.xxwx, l(0,1.000000,1.000000,0), r14.yyzy +ge r14.xyz, l(0.500000, 0.500000, 0.500000, 0.000000), r1.xyzx +mad r6.xyz, -r1.xyzx, r6.xyzx, r9.xyzx +movc r6.xyz, r14.xyzx, r10.xyzx, r6.xyzx +ieq r9.xyzw, l(5, 6, 7, 8), cb0[2].zzzz +mad r10.xyz, -r1.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(1.000000, 1.000000, 1.000000, 0.000000) +mul r10.xyz, r0.xyzx, r10.xyzx +mad r10.xyz, -r10.xyzx, r13.xyzx, r0.xyzx +mad r13.xyz, r1.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000) +mad r16.xyz, r0.xyzx, l(16.000000, 16.000000, 16.000000, 0.000000), l(-12.000000, -12.000000, -12.000000, 0.000000) +mad r16.xyz, r16.xyzx, r0.xyzx, l(4.000000, 4.000000, 4.000000, 0.000000) +mul r16.xyz, r0.xyzx, r16.xyzx +sqrt r17.xyz, r0.xyzx +movc r2.w, r5.w, r16.x, r17.x +add r2.w, -r0.x, r2.w +mad r2.w, r13.x, r2.w, r0.x +movc r18.x, r14.x, r10.x, r2.w +ge r10.xw, l(0.250000, 0.000000, 0.000000, 0.250000), r0.yyyz +movc r10.xw, r10.xxxw, r16.yyyz, r17.yyyz +add r10.xw, -r0.yyyz, r10.xxxw +mad r10.xw, r13.yyyz, r10.xxxw, r0.yyyz +movc r18.yz, r14.yyzy, r10.yyzy, r10.xxwx +add r10.xyz, r0.xyzx, -r1.xyzx +mad r3.xyz, -r2.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), r3.xyzx +max r2.w, r0.y, r0.x +max r2.w, r0.z, r2.w +min r3.w, r0.y, r0.x +min r3.w, r0.z, r3.w +add r13.w, r2.w, -r3.w +ge r2.w, r1.y, r1.x +if_nz r2.w + lt r14.xyz, r1.xxzx, r1.zyyz + add r16.xyzw, -r1.xxzz, r1.yzxy + mul r17.xyz, r13.wwww, r16.xyzx + div r13.xyz, r17.xyzx, r16.yxwy + and r16.yz, r13.xxwx, r14.xxxx + ge r14.xw, r1.zzzz, r1.yyyx + and r17.yz, r13.wwyw, r14.yyyy + and r19.xy, r13.zwzz, r14.zzzz + mov r17.x, l(0) + mov r19.z, l(0) + movc r14.yzw, r14.wwww, r17.xxyz, r19.xxyz + mov r16.x, l(0) + movc r14.xyz, r14.xxxx, r16.xyzx, r14.yzwy +else + lt r16.xyz, r1.yyzy, r1.zxxz + add r17.xyzw, -r1.yyzz, r1.xzyx + mul r19.xyz, r13.wwww, r17.xyzx + div r13.xyz, r19.xyzx, r17.yxwy + and r17.xz, r13.xxwx, r16.xxxx + ge r16.xw, r1.zzzz, r1.xxxy + and r19.xz, r13.wwyw, r16.yyyy + and r13.xy, r13.wzww, r16.zzzz + mov r19.y, l(0) + mov r13.z, l(0) + movc r13.xyz, r16.wwww, r19.xyzx, r13.xyzx + mov r17.y, l(0) + movc r14.xyz, r16.xxxx, r17.xyzx, r13.xyzx +endif +dp3 r2.w, l(0.300000, 0.590000, 0.110000, 0.000000), r0.xyzx +dp3 r3.w, l(0.300000, 0.590000, 0.110000, 0.000000), r14.xyzx +add r3.w, r2.w, -r3.w +add r13.xyz, r3.wwww, r14.xyzx +dp3 r3.w, l(0.300000, 0.590000, 0.110000, 0.000000), r13.xyzx +min r4.w, r13.y, r13.x +min r4.w, r13.z, r4.w +max r5.w, r13.y, r13.x +max r5.w, r13.z, r5.w +lt r6.w, r4.w, l(0.000000) +add r14.xyz, -r3.wwww, r13.xyzx +mul r14.xyz, r3.wwww, r14.xyzx +add r4.w, r3.w, -r4.w +div r14.xyz, r14.xyzx, r4.wwww +add r14.xyz, r3.wwww, r14.xyzx +movc r13.xyz, r6.wwww, r14.xyzx, r13.xyzx +lt r4.w, l(1.000000), r5.w +add r14.xyz, -r3.wwww, r13.xyzx +add r6.w, -r3.w, l(1.000000) +mul r14.xyz, r6.wwww, r14.xyzx +add r5.w, -r3.w, r5.w +div r14.xyz, r14.xyzx, r5.wwww +add r14.xyz, r3.wwww, r14.xyzx +movc r13.xyz, r4.wwww, r14.xyzx, r13.xyzx +ieq r14.xyzw, l(9, 10, 11, 12), cb0[2].zzzz +max r3.w, r1.y, r1.x +max r3.w, r1.z, r3.w +min r4.w, r1.y, r1.x +min r4.w, r1.z, r4.w +add r16.w, r3.w, -r4.w +ge r3.w, r0.y, r0.x +if_nz r3.w + lt r17.xyz, r0.xxzx, r0.zyyz + add r19.xyzw, -r0.xxzz, r0.yzxy + mul r20.xyz, r16.wwww, r19.xyzx + div r16.xyz, r20.xyzx, r19.yxwy + and r19.yz, r16.xxwx, r17.xxxx + ge r17.xw, r0.zzzz, r0.yyyx + and r20.yz, r16.wwyw, r17.yyyy + and r21.xy, r16.zwzz, r17.zzzz + mov r20.x, l(0) + mov r21.z, l(0) + movc r17.yzw, r17.wwww, r20.xxyz, r21.xxyz + mov r19.x, l(0) + movc r17.xyz, r17.xxxx, r19.xyzx, r17.yzwy +else + lt r19.xyz, r0.yyzy, r0.zxxz + add r20.xyzw, -r0.yyzz, r0.xzyx + mul r21.xyz, r16.wwww, r20.xyzx + div r16.xyz, r21.xyzx, r20.yxwy + and r20.xz, r16.xxwx, r19.xxxx + ge r19.xw, r0.zzzz, r0.xxxy + and r21.xz, r16.wwyw, r19.yyyy + and r16.xy, r16.wzww, r19.zzzz + mov r21.y, l(0) + mov r16.z, l(0) + movc r16.xyz, r19.wwww, r21.xyzx, r16.xyzx + mov r20.y, l(0) + movc r17.xyz, r19.xxxx, r20.xyzx, r16.xyzx +endif +dp3 r3.w, l(0.300000, 0.590000, 0.110000, 0.000000), r17.xyzx +add r3.w, r2.w, -r3.w +add r16.xyz, r3.wwww, r17.xyzx +dp3 r3.w, l(0.300000, 0.590000, 0.110000, 0.000000), r16.xyzx +min r4.w, r16.y, r16.x +min r4.w, r16.z, r4.w +max r5.w, r16.y, r16.x +max r5.w, r16.z, r5.w +lt r6.w, r4.w, l(0.000000) +add r17.xyz, -r3.wwww, r16.xyzx +mul r17.xyz, r3.wwww, r17.xyzx +add r4.w, r3.w, -r4.w +div r17.xyz, r17.xyzx, r4.wwww +add r17.xyz, r3.wwww, r17.xyzx +movc r16.xyz, r6.wwww, r17.xyzx, r16.xyzx +lt r4.w, l(1.000000), r5.w +add r17.xyz, -r3.wwww, r16.xyzx +add r6.w, -r3.w, l(1.000000) +mul r17.xyz, r6.wwww, r17.xyzx +add r5.w, -r3.w, r5.w +div r17.xyz, r17.xyzx, r5.wwww +add r17.xyz, r3.wwww, r17.xyzx +movc r16.xyz, r4.wwww, r17.xyzx, r16.xyzx +dp3 r3.w, l(0.300000, 0.590000, 0.110000, 0.000000), r1.xyzx +add r4.w, r2.w, -r3.w +add r17.xyz, r1.xyzx, r4.wwww +dp3 r4.w, l(0.300000, 0.590000, 0.110000, 0.000000), r17.xyzx +min r5.w, r17.y, r17.x +min r5.w, r17.z, r5.w +max r6.w, r17.y, r17.x +max r6.w, r17.z, r6.w +lt r7.w, r5.w, l(0.000000) +add r19.xyz, -r4.wwww, r17.xyzx +mul r19.xyz, r4.wwww, r19.xyzx +add r5.w, r4.w, -r5.w +div r19.xyz, r19.xyzx, r5.wwww +add r19.xyz, r4.wwww, r19.xyzx +movc r17.xyz, r7.wwww, r19.xyzx, r17.xyzx +lt r5.w, l(1.000000), r6.w +add r19.xyz, -r4.wwww, r17.xyzx +add r7.w, -r4.w, l(1.000000) +mul r19.xyz, r7.wwww, r19.xyzx +add r6.w, -r4.w, r6.w +div r19.xyz, r19.xyzx, r6.wwww +add r19.xyz, r4.wwww, r19.xyzx +movc r17.xyz, r5.wwww, r19.xyzx, r17.xyzx +ieq r19.xy, l(13, 14, 0, 0), cb0[2].zzzz +add r2.w, -r2.w, r3.w +add r0.xyz, r0.xyzx, r2.wwww +dp3 r2.w, l(0.300000, 0.590000, 0.110000, 0.000000), r0.xyzx +min r3.w, r0.y, r0.x +min r3.w, r0.z, r3.w +max r4.w, r0.y, r0.x +max r4.w, r0.z, r4.w +lt r5.w, r3.w, l(0.000000) +add r20.xyz, r0.xyzx, -r2.wwww +mul r20.xyz, r2.wwww, r20.xyzx +add r3.w, r2.w, -r3.w +div r20.xyz, r20.xyzx, r3.wwww +add r20.xyz, r2.wwww, r20.xyzx +movc r0.xyz, r5.wwww, r20.xyzx, r0.xyzx +lt r3.w, l(1.000000), r4.w +add r20.xyz, -r2.wwww, r0.xyzx +add r5.w, -r2.w, l(1.000000) +mul r20.xyz, r5.wwww, r20.xyzx +add r4.w, -r2.w, r4.w +div r20.xyz, r20.xyzx, r4.wwww +add r20.xyz, r2.wwww, r20.xyzx +movc r0.xyz, r3.wwww, r20.xyzx, r0.xyzx +and r0.xyz, r0.xyzx, r19.yyyy +movc r0.xyz, r19.xxxx, r17.xyzx, r0.xyzx +movc r0.xyz, r14.wwww, r16.xyzx, r0.xyzx +movc r0.xyz, r14.zzzz, r13.xyzx, r0.xyzx +movc r0.xyz, r14.yyyy, r3.xyzx, r0.xyzx +movc r0.xyz, r14.xxxx, |r10.xyzx|, r0.xyzx +movc r0.xyz, r9.wwww, r18.xyzx, r0.xyzx +movc r0.xyz, r9.zzzz, r6.xyzx, r0.xyzx +movc r0.xyz, r9.yyyy, r15.xyzx, r0.xyzx +movc r0.xyz, r9.xxxx, r12.xyzx, r0.xyzx +movc r0.xyz, r8.wwww, r11.xyzx, r0.xyzx +movc r0.xyz, r8.zzzz, r7.xyzx, r0.xyzx +movc r0.xyz, r8.yyyy, r5.xyzx, r0.xyzx +movc r0.xyz, r8.xxxx, r4.xyzx, r0.xyzx +movc r0.xyz, cb0[2].zzzz, r0.xyzx, r2.xyzx +add r2.x, -r0.w, l(1.000000) +mul r0.xyz, r0.xyzx, r0.wwww +mad r0.xyz, r2.xxxx, r1.xyzx, r0.xyzx +mul o0.xyz, r1.wwww, r0.xyzx +mov o0.w, r1.w +ret +// Approximately 345 instruction slots used +#endif + +const BYTE BlendShader[] = +{ + 68, 88, 66, 67, 121, 58, + 99, 114, 236, 21, 118, 177, + 57, 125, 153, 182, 56, 164, + 101, 220, 1, 0, 0, 0, + 176, 68, 0, 0, 6, 0, + 0, 0, 56, 0, 0, 0, + 152, 23, 0, 0, 200, 63, + 0, 0, 68, 64, 0, 0, + 244, 67, 0, 0, 124, 68, + 0, 0, 65, 111, 110, 57, + 88, 23, 0, 0, 88, 23, + 0, 0, 0, 2, 255, 255, + 0, 23, 0, 0, 88, 0, + 0, 0, 2, 0, 64, 0, + 0, 0, 88, 0, 0, 0, + 88, 0, 7, 0, 36, 0, + 0, 0, 88, 0, 0, 0, + 0, 0, 1, 0, 1, 0, + 2, 0, 2, 0, 3, 0, + 3, 0, 5, 0, 4, 0, + 6, 0, 5, 0, 5, 1, + 6, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 2, 0, + 1, 0, 2, 0, 3, 3, + 3, 3, 1, 2, 255, 255, + 81, 0, 0, 5, 3, 0, + 15, 160, 0, 0, 128, 191, + 0, 0, 0, 192, 115, 128, + 0, 191, 18, 131, 128, 189, + 81, 0, 0, 5, 4, 0, + 15, 160, 182, 74, 204, 63, + 205, 30, 80, 63, 103, 10, + 149, 63, 76, 26, 1, 64, + 81, 0, 0, 5, 5, 0, + 15, 160, 0, 0, 128, 191, + 0, 0, 0, 192, 0, 0, + 64, 192, 0, 0, 128, 192, + 81, 0, 0, 5, 6, 0, + 15, 160, 0, 0, 160, 192, + 0, 0, 192, 192, 0, 0, + 224, 192, 0, 0, 0, 193, + 81, 0, 0, 5, 7, 0, + 15, 160, 0, 0, 128, 63, + 0, 0, 128, 62, 0, 0, + 0, 64, 0, 0, 128, 191, + 81, 0, 0, 5, 8, 0, + 15, 160, 0, 0, 128, 65, + 0, 0, 64, 193, 0, 0, + 80, 193, 0, 0, 96, 193, + 81, 0, 0, 5, 9, 0, + 15, 160, 0, 0, 16, 193, + 0, 0, 32, 193, 0, 0, + 48, 193, 0, 0, 64, 193, + 81, 0, 0, 5, 10, 0, + 15, 160, 154, 153, 153, 62, + 61, 10, 23, 63, 174, 71, + 225, 61, 0, 0, 0, 0, + 81, 0, 0, 5, 11, 0, + 15, 160, 196, 148, 200, 62, + 0, 0, 128, 191, 0, 0, + 0, 128, 0, 0, 0, 191, + 31, 0, 0, 2, 0, 0, + 0, 128, 0, 0, 15, 176, + 31, 0, 0, 2, 0, 0, + 0, 128, 1, 0, 7, 176, + 31, 0, 0, 2, 0, 0, + 0, 144, 0, 8, 15, 160, + 31, 0, 0, 2, 0, 0, + 0, 144, 1, 8, 15, 160, + 31, 0, 0, 2, 0, 0, + 0, 144, 2, 8, 15, 160, + 31, 0, 0, 2, 0, 0, + 0, 144, 3, 8, 15, 160, + 31, 0, 0, 2, 0, 0, + 0, 144, 4, 8, 15, 160, + 31, 0, 0, 2, 0, 0, + 0, 144, 5, 8, 15, 160, + 31, 0, 0, 2, 0, 0, + 0, 144, 6, 8, 15, 160, + 1, 0, 0, 2, 0, 0, + 1, 128, 11, 0, 170, 161, + 1, 0, 0, 2, 1, 0, + 1, 128, 11, 0, 170, 161, + 1, 0, 0, 2, 2, 0, + 4, 128, 11, 0, 170, 161, + 66, 0, 0, 3, 3, 0, + 15, 128, 0, 0, 228, 176, + 1, 8, 228, 160, 66, 0, + 0, 3, 4, 0, 15, 128, + 0, 0, 228, 176, 3, 8, + 228, 160, 2, 0, 0, 3, + 0, 0, 8, 128, 4, 0, + 0, 128, 3, 0, 170, 160, + 5, 0, 0, 3, 3, 0, + 6, 128, 0, 0, 255, 128, + 4, 0, 208, 160, 2, 0, + 0, 3, 0, 0, 8, 128, + 3, 0, 0, 128, 3, 0, + 255, 160, 4, 0, 0, 4, + 1, 0, 8, 128, 0, 0, + 255, 128, 4, 0, 170, 160, + 3, 0, 170, 129, 4, 0, + 0, 4, 3, 0, 1, 128, + 0, 0, 255, 128, 4, 0, + 170, 160, 3, 0, 85, 128, + 66, 0, 0, 3, 4, 0, + 15, 128, 1, 0, 228, 176, + 4, 8, 228, 160, 66, 0, + 0, 3, 5, 0, 15, 128, + 0, 0, 228, 176, 2, 8, + 228, 160, 2, 0, 0, 3, + 2, 0, 8, 128, 5, 0, + 0, 128, 3, 0, 170, 160, + 4, 0, 0, 4, 3, 0, + 2, 128, 2, 0, 255, 128, + 11, 0, 0, 161, 1, 0, + 255, 128, 5, 0, 0, 3, + 1, 0, 8, 128, 2, 0, + 255, 128, 4, 0, 255, 160, + 4, 0, 0, 4, 3, 0, + 4, 128, 0, 0, 255, 128, + 4, 0, 170, 160, 1, 0, + 255, 128, 1, 0, 0, 2, + 3, 0, 8, 128, 3, 0, + 0, 161, 5, 0, 0, 3, + 3, 0, 15, 128, 3, 0, + 228, 128, 1, 0, 0, 160, + 5, 0, 0, 3, 5, 0, + 15, 128, 4, 0, 0, 128, + 3, 0, 228, 128, 6, 0, + 0, 2, 0, 0, 8, 128, + 1, 0, 170, 176, 5, 0, + 0, 3, 6, 0, 3, 128, + 0, 0, 255, 128, 1, 0, + 228, 176, 66, 0, 0, 3, + 7, 0, 15, 128, 0, 0, + 228, 176, 0, 8, 228, 160, + 66, 0, 0, 3, 6, 0, + 15, 128, 6, 0, 228, 128, + 6, 8, 228, 160, 5, 0, + 0, 3, 7, 0, 15, 128, + 7, 0, 228, 128, 1, 0, + 0, 160, 5, 0, 0, 3, + 8, 0, 15, 128, 4, 0, + 0, 128, 7, 0, 228, 128, + 1, 0, 0, 2, 9, 0, + 3, 128, 3, 0, 228, 160, + 2, 0, 0, 3, 10, 0, + 15, 128, 9, 0, 68, 128, + 2, 0, 80, 160, 5, 0, + 0, 3, 10, 0, 15, 128, + 10, 0, 228, 128, 10, 0, + 228, 128, 88, 0, 0, 4, + 5, 0, 15, 128, 10, 0, + 0, 129, 8, 0, 228, 128, + 5, 0, 228, 128, 1, 0, + 0, 2, 8, 0, 7, 128, + 7, 0, 228, 128, 1, 0, + 0, 2, 8, 0, 8, 128, + 1, 0, 0, 160, 5, 0, + 0, 3, 11, 0, 15, 128, + 4, 0, 0, 128, 8, 0, + 228, 128, 5, 0, 0, 3, + 4, 0, 15, 128, 4, 0, + 0, 128, 0, 0, 228, 160, + 88, 0, 0, 4, 5, 0, + 15, 128, 2, 0, 0, 161, + 11, 0, 228, 128, 5, 0, + 228, 128, 88, 0, 0, 4, + 6, 0, 6, 128, 10, 0, + 244, 129, 11, 0, 85, 160, + 11, 0, 170, 160, 88, 0, + 0, 4, 6, 0, 6, 128, + 10, 0, 224, 129, 3, 0, + 0, 160, 6, 0, 228, 128, + 88, 0, 0, 4, 6, 0, + 6, 128, 2, 0, 208, 161, + 9, 0, 0, 128, 6, 0, + 228, 128, 88, 0, 0, 4, + 4, 0, 15, 128, 6, 0, + 85, 128, 4, 0, 228, 128, + 5, 0, 228, 128, 5, 0, + 0, 3, 5, 0, 15, 128, + 6, 0, 0, 128, 7, 0, + 228, 128, 88, 0, 0, 4, + 3, 0, 15, 128, 10, 0, + 0, 129, 7, 0, 228, 128, + 3, 0, 228, 128, 88, 0, + 0, 4, 4, 0, 15, 128, + 10, 0, 170, 129, 4, 0, + 228, 128, 5, 0, 228, 128, + 88, 0, 0, 4, 3, 0, + 15, 128, 2, 0, 0, 161, + 8, 0, 228, 128, 3, 0, + 228, 128, 88, 0, 0, 4, + 3, 0, 15, 128, 6, 0, + 85, 128, 0, 0, 228, 160, + 3, 0, 228, 128, 88, 0, + 0, 4, 3, 0, 15, 128, + 2, 0, 85, 161, 3, 0, + 228, 128, 4, 0, 228, 128, + 88, 0, 0, 4, 3, 0, + 15, 128, 6, 0, 170, 128, + 11, 0, 106, 161, 3, 0, + 228, 128, 6, 0, 0, 2, + 0, 0, 8, 128, 3, 0, + 255, 128, 5, 0, 0, 3, + 4, 0, 7, 128, 0, 0, + 255, 128, 3, 0, 228, 128, + 88, 0, 0, 4, 4, 0, + 7, 128, 2, 0, 255, 161, + 3, 0, 228, 128, 4, 0, + 228, 128, 2, 0, 0, 3, + 5, 0, 3, 128, 4, 0, + 233, 129, 4, 0, 228, 128, + 88, 0, 0, 4, 5, 0, + 12, 128, 5, 0, 0, 128, + 4, 0, 68, 128, 4, 0, + 20, 128, 11, 0, 0, 3, + 0, 0, 8, 128, 5, 0, + 170, 128, 4, 0, 170, 128, + 10, 0, 0, 3, 1, 0, + 8, 128, 4, 0, 170, 128, + 5, 0, 255, 128, 2, 0, + 0, 3, 6, 0, 8, 128, + 0, 0, 255, 128, 1, 0, + 255, 129, 1, 0, 0, 2, + 7, 0, 3, 128, 0, 0, + 235, 176, 66, 0, 0, 3, + 7, 0, 15, 128, 7, 0, + 228, 128, 5, 8, 228, 160, + 6, 0, 0, 2, 0, 0, + 8, 128, 7, 0, 255, 128, + 5, 0, 0, 3, 8, 0, + 7, 128, 0, 0, 255, 128, + 7, 0, 228, 128, 4, 0, + 0, 4, 5, 0, 12, 128, + 7, 0, 100, 128, 0, 0, + 255, 128, 8, 0, 132, 129, + 5, 0, 0, 3, 9, 0, + 3, 128, 6, 0, 255, 128, + 5, 0, 238, 128, 4, 0, + 0, 4, 10, 0, 15, 128, + 7, 0, 129, 128, 0, 0, + 255, 128, 8, 0, 88, 129, + 6, 0, 0, 2, 1, 0, + 8, 128, 10, 0, 0, 128, + 5, 0, 0, 3, 6, 0, + 2, 128, 1, 0, 255, 128, + 9, 0, 0, 128, 88, 0, + 0, 4, 1, 0, 6, 128, + 10, 0, 170, 128, 11, 0, + 170, 161, 6, 0, 220, 128, + 5, 0, 0, 3, 11, 0, + 15, 128, 6, 0, 255, 128, + 10, 0, 228, 128, 6, 0, + 0, 2, 1, 0, 8, 128, + 5, 0, 255, 128, 5, 0, + 0, 3, 6, 0, 1, 128, + 1, 0, 255, 128, 11, 0, + 85, 128, 88, 0, 0, 4, + 2, 0, 3, 128, 10, 0, + 255, 128, 11, 0, 170, 161, + 6, 0, 236, 128, 88, 0, + 0, 4, 1, 0, 7, 128, + 5, 0, 170, 128, 1, 0, + 228, 128, 2, 0, 228, 128, + 6, 0, 0, 2, 1, 0, + 8, 128, 5, 0, 170, 128, + 5, 0, 0, 3, 6, 0, + 4, 128, 1, 0, 255, 128, + 11, 0, 0, 128, 88, 0, + 0, 4, 0, 0, 6, 128, + 10, 0, 85, 128, 11, 0, + 170, 161, 6, 0, 248, 128, + 88, 0, 0, 4, 0, 0, + 7, 128, 10, 0, 255, 128, + 0, 0, 228, 128, 1, 0, + 228, 128, 1, 0, 0, 2, + 1, 0, 2, 128, 11, 0, + 170, 161, 1, 0, 0, 2, + 2, 0, 2, 128, 11, 0, + 170, 161, 1, 0, 0, 2, + 12, 0, 4, 128, 11, 0, + 170, 161, 6, 0, 0, 2, + 1, 0, 8, 128, 10, 0, + 170, 128, 5, 0, 0, 3, + 6, 0, 2, 128, 1, 0, + 255, 128, 11, 0, 255, 128, + 88, 0, 0, 4, 2, 0, + 5, 128, 10, 0, 0, 128, + 11, 0, 170, 161, 6, 0, + 215, 128, 6, 0, 0, 2, + 1, 0, 8, 128, 10, 0, + 85, 128, 5, 0, 0, 3, + 6, 0, 1, 128, 1, 0, + 255, 128, 9, 0, 85, 128, + 88, 0, 0, 4, 12, 0, + 3, 128, 5, 0, 170, 128, + 11, 0, 170, 161, 6, 0, + 227, 128, 88, 0, 0, 4, + 2, 0, 7, 128, 10, 0, + 255, 128, 2, 0, 228, 128, + 12, 0, 228, 128, 6, 0, + 0, 2, 1, 0, 8, 128, + 10, 0, 255, 128, 5, 0, + 0, 3, 6, 0, 4, 128, + 1, 0, 255, 128, 11, 0, + 170, 128, 88, 0, 0, 4, + 1, 0, 5, 128, 5, 0, + 255, 128, 11, 0, 170, 161, + 6, 0, 246, 128, 88, 0, + 0, 4, 1, 0, 7, 128, + 5, 0, 170, 128, 1, 0, + 228, 128, 2, 0, 228, 128, + 88, 0, 0, 4, 0, 0, + 7, 128, 10, 0, 0, 128, + 0, 0, 228, 128, 1, 0, + 228, 128, 88, 0, 0, 4, + 1, 0, 3, 128, 10, 0, + 170, 128, 8, 0, 228, 128, + 8, 0, 225, 128, 8, 0, + 0, 3, 4, 0, 8, 128, + 10, 0, 228, 160, 0, 0, + 228, 128, 8, 0, 0, 3, + 8, 0, 8, 128, 10, 0, + 228, 160, 8, 0, 228, 128, + 2, 0, 0, 3, 4, 0, + 8, 128, 4, 0, 255, 129, + 8, 0, 255, 128, 2, 0, + 0, 3, 0, 0, 7, 128, + 0, 0, 228, 128, 4, 0, + 255, 128, 2, 0, 0, 3, + 4, 0, 8, 128, 0, 0, + 85, 129, 0, 0, 0, 128, + 88, 0, 0, 4, 1, 0, + 12, 128, 4, 0, 255, 128, + 0, 0, 20, 128, 0, 0, + 68, 128, 10, 0, 0, 3, + 4, 0, 8, 128, 0, 0, + 170, 128, 1, 0, 170, 128, + 11, 0, 0, 3, 2, 0, + 1, 128, 1, 0, 255, 128, + 0, 0, 170, 128, 8, 0, + 0, 3, 1, 0, 4, 128, + 10, 0, 228, 160, 0, 0, + 228, 128, 2, 0, 0, 3, + 1, 0, 8, 128, 4, 0, + 255, 129, 1, 0, 170, 128, + 6, 0, 0, 2, 1, 0, + 8, 128, 1, 0, 255, 128, + 2, 0, 0, 3, 2, 0, + 14, 128, 0, 0, 144, 128, + 1, 0, 170, 129, 5, 0, + 0, 3, 2, 0, 14, 128, + 1, 0, 170, 128, 2, 0, + 228, 128, 4, 0, 0, 4, + 2, 0, 14, 128, 2, 0, + 228, 128, 1, 0, 255, 128, + 1, 0, 170, 128, 88, 0, + 0, 4, 0, 0, 7, 128, + 4, 0, 255, 128, 0, 0, + 228, 128, 2, 0, 249, 128, + 2, 0, 0, 3, 2, 0, + 14, 128, 1, 0, 170, 129, + 0, 0, 144, 128, 2, 0, + 0, 3, 1, 0, 8, 128, + 1, 0, 170, 129, 3, 0, + 0, 161, 5, 0, 0, 3, + 2, 0, 14, 128, 1, 0, + 255, 128, 2, 0, 228, 128, + 2, 0, 0, 3, 1, 0, + 8, 128, 1, 0, 170, 129, + 2, 0, 0, 128, 2, 0, + 0, 3, 4, 0, 8, 128, + 2, 0, 0, 129, 3, 0, + 0, 161, 6, 0, 0, 2, + 1, 0, 8, 128, 1, 0, + 255, 128, 4, 0, 0, 4, + 2, 0, 7, 128, 2, 0, + 249, 128, 1, 0, 255, 128, + 1, 0, 170, 128, 88, 0, + 0, 4, 0, 0, 7, 128, + 4, 0, 255, 128, 0, 0, + 228, 128, 2, 0, 228, 128, + 1, 0, 0, 2, 4, 0, + 8, 128, 2, 0, 170, 160, + 2, 0, 0, 3, 1, 0, + 12, 128, 4, 0, 255, 128, + 8, 0, 228, 160, 5, 0, + 0, 3, 1, 0, 12, 128, + 1, 0, 228, 128, 1, 0, + 228, 128, 8, 0, 0, 3, + 2, 0, 1, 128, 10, 0, + 228, 160, 4, 0, 228, 128, + 2, 0, 0, 3, 2, 0, + 2, 128, 8, 0, 255, 129, + 2, 0, 0, 128, 2, 0, + 0, 3, 2, 0, 1, 128, + 2, 0, 0, 129, 8, 0, + 255, 128, 2, 0, 0, 3, + 2, 0, 13, 128, 2, 0, + 0, 128, 4, 0, 148, 128, + 4, 0, 0, 4, 6, 0, + 7, 128, 7, 0, 228, 128, + 0, 0, 255, 128, 2, 0, + 85, 128, 2, 0, 0, 3, + 6, 0, 8, 128, 6, 0, + 85, 129, 6, 0, 0, 128, + 88, 0, 0, 4, 5, 0, + 12, 128, 6, 0, 255, 128, + 6, 0, 20, 128, 6, 0, + 68, 128, 10, 0, 0, 3, + 2, 0, 2, 128, 6, 0, + 170, 128, 5, 0, 170, 128, + 11, 0, 0, 3, 9, 0, + 1, 128, 5, 0, 255, 128, + 6, 0, 170, 128, 8, 0, + 0, 3, 6, 0, 8, 128, + 10, 0, 228, 160, 6, 0, + 228, 128, 2, 0, 0, 3, + 5, 0, 4, 128, 2, 0, + 85, 129, 6, 0, 255, 128, + 6, 0, 0, 2, 5, 0, + 4, 128, 5, 0, 170, 128, + 2, 0, 0, 3, 9, 0, + 14, 128, 6, 0, 255, 129, + 6, 0, 144, 128, 5, 0, + 0, 3, 9, 0, 14, 128, + 6, 0, 255, 128, 9, 0, + 228, 128, 4, 0, 0, 4, + 9, 0, 14, 128, 9, 0, + 228, 128, 5, 0, 170, 128, + 6, 0, 255, 128, 88, 0, + 0, 4, 6, 0, 7, 128, + 2, 0, 85, 128, 6, 0, + 228, 128, 9, 0, 249, 128, + 2, 0, 0, 3, 9, 0, + 14, 128, 6, 0, 255, 129, + 6, 0, 144, 128, 2, 0, + 0, 3, 2, 0, 2, 128, + 6, 0, 255, 129, 3, 0, + 0, 161, 5, 0, 0, 3, + 9, 0, 14, 128, 2, 0, + 85, 128, 9, 0, 228, 128, + 2, 0, 0, 3, 2, 0, + 2, 128, 6, 0, 255, 129, + 9, 0, 0, 128, 2, 0, + 0, 3, 5, 0, 4, 128, + 9, 0, 0, 129, 3, 0, + 0, 161, 6, 0, 0, 2, + 5, 0, 8, 128, 2, 0, + 85, 128, 4, 0, 0, 4, + 9, 0, 7, 128, 9, 0, + 249, 128, 5, 0, 255, 128, + 6, 0, 255, 128, 88, 0, + 0, 4, 6, 0, 7, 128, + 5, 0, 170, 128, 6, 0, + 228, 128, 9, 0, 228, 128, + 88, 0, 0, 4, 6, 0, + 7, 128, 1, 0, 255, 129, + 6, 0, 228, 128, 11, 0, + 170, 161, 2, 0, 0, 3, + 1, 0, 8, 128, 2, 0, + 170, 129, 2, 0, 0, 128, + 88, 0, 0, 4, 5, 0, + 12, 128, 1, 0, 255, 128, + 2, 0, 36, 128, 2, 0, + 132, 128, 10, 0, 0, 3, + 1, 0, 8, 128, 2, 0, + 255, 128, 5, 0, 170, 128, + 11, 0, 0, 3, 6, 0, + 8, 128, 5, 0, 255, 128, + 2, 0, 255, 128, 8, 0, + 0, 3, 2, 0, 2, 128, + 10, 0, 228, 160, 2, 0, + 248, 128, 2, 0, 0, 3, + 5, 0, 4, 128, 1, 0, + 255, 129, 2, 0, 85, 128, + 6, 0, 0, 2, 5, 0, + 4, 128, 5, 0, 170, 128, + 2, 0, 0, 3, 9, 0, + 7, 128, 2, 0, 85, 129, + 2, 0, 248, 128, 5, 0, + 0, 3, 9, 0, 7, 128, + 2, 0, 85, 128, 9, 0, + 228, 128, 4, 0, 0, 4, + 9, 0, 7, 128, 9, 0, + 228, 128, 5, 0, 170, 128, + 2, 0, 85, 128, 88, 0, + 0, 4, 2, 0, 13, 128, + 1, 0, 255, 128, 2, 0, + 228, 128, 9, 0, 148, 128, + 2, 0, 0, 3, 9, 0, + 7, 128, 2, 0, 85, 129, + 2, 0, 248, 128, 2, 0, + 0, 3, 1, 0, 8, 128, + 2, 0, 85, 129, 3, 0, + 0, 161, 5, 0, 0, 3, + 9, 0, 7, 128, 1, 0, + 255, 128, 9, 0, 228, 128, + 2, 0, 0, 3, 1, 0, + 8, 128, 2, 0, 85, 129, + 6, 0, 255, 128, 2, 0, + 0, 3, 6, 0, 8, 128, + 6, 0, 255, 129, 3, 0, + 0, 161, 6, 0, 0, 2, + 1, 0, 8, 128, 1, 0, + 255, 128, 4, 0, 0, 4, + 9, 0, 7, 128, 9, 0, + 228, 128, 1, 0, 255, 128, + 2, 0, 85, 128, 88, 0, + 0, 4, 2, 0, 7, 128, + 6, 0, 255, 128, 2, 0, + 248, 128, 9, 0, 228, 128, + 88, 0, 0, 4, 2, 0, + 7, 128, 1, 0, 170, 129, + 2, 0, 228, 128, 6, 0, + 228, 128, 2, 0, 0, 3, + 6, 0, 15, 128, 4, 0, + 255, 128, 9, 0, 228, 160, + 5, 0, 0, 3, 6, 0, + 15, 128, 6, 0, 228, 128, + 6, 0, 228, 128, 88, 0, + 0, 4, 0, 0, 7, 128, + 6, 0, 255, 129, 0, 0, + 228, 128, 2, 0, 228, 128, + 2, 0, 0, 3, 2, 0, + 15, 128, 4, 0, 96, 129, + 4, 0, 137, 128, 1, 0, + 0, 2, 9, 0, 2, 128, + 11, 0, 170, 161, 1, 0, + 0, 2, 10, 0, 2, 128, + 11, 0, 170, 161, 1, 0, + 0, 2, 11, 0, 4, 128, + 11, 0, 170, 161, 6, 0, + 0, 2, 6, 0, 8, 128, + 2, 0, 170, 128, 11, 0, + 0, 3, 9, 0, 8, 128, + 1, 0, 0, 128, 8, 0, + 170, 128, 10, 0, 0, 3, + 10, 0, 8, 128, 8, 0, + 170, 128, 1, 0, 85, 128, + 2, 0, 0, 3, 1, 0, + 8, 128, 9, 0, 255, 128, + 10, 0, 255, 129, 5, 0, + 0, 3, 5, 0, 12, 128, + 1, 0, 255, 128, 5, 0, + 68, 128, 5, 0, 0, 3, + 1, 0, 1, 128, 6, 0, + 255, 128, 5, 0, 255, 128, + 88, 0, 0, 4, 11, 0, + 3, 128, 2, 0, 85, 128, + 11, 0, 170, 161, 1, 0, + 227, 128, 6, 0, 0, 2, + 5, 0, 8, 128, 5, 0, + 0, 128, 5, 0, 0, 3, + 12, 0, 15, 128, 1, 0, + 255, 128, 2, 0, 228, 128, + 5, 0, 0, 3, 1, 0, + 2, 128, 5, 0, 255, 128, + 12, 0, 255, 128, 88, 0, + 0, 4, 10, 0, 5, 128, + 2, 0, 0, 128, 11, 0, + 170, 161, 1, 0, 215, 128, + 88, 0, 0, 4, 10, 0, + 7, 128, 2, 0, 255, 128, + 10, 0, 228, 128, 11, 0, + 228, 128, 6, 0, 0, 2, + 5, 0, 8, 128, 2, 0, + 255, 128, 5, 0, 0, 3, + 1, 0, 4, 128, 5, 0, + 255, 128, 5, 0, 170, 128, + 88, 0, 0, 4, 9, 0, + 5, 128, 5, 0, 85, 128, + 11, 0, 170, 161, 1, 0, + 246, 128, 88, 0, 0, 4, + 9, 0, 7, 128, 2, 0, + 85, 128, 9, 0, 228, 128, + 10, 0, 228, 128, 1, 0, + 0, 2, 10, 0, 1, 128, + 11, 0, 170, 161, 1, 0, + 0, 2, 11, 0, 1, 128, + 11, 0, 170, 161, 1, 0, + 0, 2, 13, 0, 4, 128, + 11, 0, 170, 161, 6, 0, + 0, 2, 6, 0, 8, 128, + 2, 0, 0, 128, 5, 0, + 0, 3, 1, 0, 2, 128, + 6, 0, 255, 128, 12, 0, + 85, 128, 88, 0, 0, 4, + 11, 0, 6, 128, 5, 0, + 0, 128, 11, 0, 170, 161, + 1, 0, 220, 128, 6, 0, + 0, 2, 6, 0, 8, 128, + 5, 0, 85, 128, 5, 0, + 0, 3, 1, 0, 1, 128, + 6, 0, 255, 128, 12, 0, + 170, 128, 88, 0, 0, 4, + 13, 0, 3, 128, 2, 0, + 255, 128, 11, 0, 170, 161, + 1, 0, 236, 128, 88, 0, + 0, 4, 5, 0, 7, 128, + 2, 0, 85, 128, 11, 0, + 228, 128, 13, 0, 228, 128, + 6, 0, 0, 2, 5, 0, + 8, 128, 2, 0, 85, 128, + 5, 0, 0, 3, 1, 0, + 4, 128, 5, 0, 255, 128, + 12, 0, 0, 128, 88, 0, + 0, 4, 10, 0, 6, 128, + 2, 0, 170, 128, 11, 0, + 170, 161, 1, 0, 248, 128, + 88, 0, 0, 4, 1, 0, + 7, 128, 2, 0, 255, 128, + 10, 0, 228, 128, 5, 0, + 228, 128, 88, 0, 0, 4, + 1, 0, 7, 128, 2, 0, + 0, 128, 1, 0, 228, 128, + 9, 0, 228, 128, 8, 0, + 0, 3, 1, 0, 8, 128, + 10, 0, 228, 160, 1, 0, + 228, 128, 2, 0, 0, 3, + 1, 0, 8, 128, 1, 0, + 255, 129, 8, 0, 255, 128, + 2, 0, 0, 3, 1, 0, + 7, 128, 1, 0, 255, 128, + 1, 0, 228, 128, 2, 0, + 0, 3, 1, 0, 8, 128, + 1, 0, 85, 129, 1, 0, + 0, 128, 88, 0, 0, 4, + 2, 0, 3, 128, 1, 0, + 255, 128, 1, 0, 225, 128, + 1, 0, 228, 128, 10, 0, + 0, 3, 6, 0, 8, 128, + 1, 0, 170, 128, 2, 0, + 0, 128, 11, 0, 0, 3, + 8, 0, 8, 128, 2, 0, + 85, 128, 1, 0, 170, 128, + 8, 0, 0, 3, 1, 0, + 8, 128, 10, 0, 228, 160, + 1, 0, 228, 128, 2, 0, + 0, 3, 2, 0, 1, 128, + 6, 0, 255, 129, 1, 0, + 255, 128, 6, 0, 0, 2, + 2, 0, 1, 128, 2, 0, + 0, 128, 2, 0, 0, 3, + 2, 0, 14, 128, 1, 0, + 255, 129, 1, 0, 144, 128, + 5, 0, 0, 3, 2, 0, + 14, 128, 1, 0, 255, 128, + 2, 0, 228, 128, 4, 0, + 0, 4, 2, 0, 7, 128, + 2, 0, 249, 128, 2, 0, + 0, 128, 1, 0, 255, 128, + 88, 0, 0, 4, 1, 0, + 7, 128, 6, 0, 255, 128, + 1, 0, 228, 128, 2, 0, + 228, 128, 2, 0, 0, 3, + 2, 0, 7, 128, 1, 0, + 255, 129, 1, 0, 228, 128, + 2, 0, 0, 3, 2, 0, + 8, 128, 1, 0, 255, 129, + 3, 0, 0, 161, 5, 0, + 0, 3, 2, 0, 7, 128, + 2, 0, 255, 128, 2, 0, + 228, 128, 2, 0, 0, 3, + 2, 0, 8, 128, 1, 0, + 255, 129, 8, 0, 255, 128, + 2, 0, 0, 3, 6, 0, + 8, 128, 8, 0, 255, 129, + 3, 0, 0, 161, 6, 0, + 0, 2, 2, 0, 8, 128, + 2, 0, 255, 128, 4, 0, + 0, 4, 2, 0, 7, 128, + 2, 0, 228, 128, 2, 0, + 255, 128, 1, 0, 255, 128, + 88, 0, 0, 4, 1, 0, + 7, 128, 6, 0, 255, 128, + 1, 0, 228, 128, 2, 0, + 228, 128, 88, 0, 0, 4, + 0, 0, 7, 128, 6, 0, + 170, 129, 1, 0, 228, 128, + 0, 0, 228, 128, 4, 0, + 0, 4, 1, 0, 7, 128, + 7, 0, 228, 128, 0, 0, + 255, 128, 4, 0, 228, 128, + 5, 0, 0, 3, 2, 0, + 7, 128, 4, 0, 228, 128, + 8, 0, 228, 128, 4, 0, + 0, 4, 5, 0, 7, 128, + 2, 0, 228, 128, 3, 0, + 85, 160, 1, 0, 228, 128, + 4, 0, 0, 4, 1, 0, + 7, 128, 8, 0, 228, 128, + 4, 0, 228, 129, 1, 0, + 228, 128, 88, 0, 0, 4, + 0, 0, 7, 128, 6, 0, + 85, 129, 5, 0, 228, 128, + 0, 0, 228, 128, 4, 0, + 0, 4, 5, 0, 7, 128, + 7, 0, 228, 128, 0, 0, + 255, 128, 4, 0, 228, 129, + 35, 0, 0, 2, 5, 0, + 7, 128, 5, 0, 228, 128, + 88, 0, 0, 4, 0, 0, + 7, 128, 6, 0, 0, 129, + 5, 0, 228, 128, 0, 0, + 228, 128, 2, 0, 0, 3, + 5, 0, 3, 128, 4, 0, + 233, 129, 11, 0, 255, 161, + 4, 0, 0, 4, 6, 0, + 7, 128, 4, 0, 228, 128, + 7, 0, 170, 160, 7, 0, + 255, 160, 4, 0, 0, 4, + 1, 0, 8, 128, 7, 0, + 170, 128, 0, 0, 255, 129, + 7, 0, 85, 160, 4, 0, + 0, 4, 9, 0, 7, 128, + 8, 0, 228, 128, 8, 0, + 0, 160, 8, 0, 85, 160, + 4, 0, 0, 4, 9, 0, + 7, 128, 9, 0, 228, 128, + 8, 0, 228, 128, 5, 0, + 255, 161, 5, 0, 0, 3, + 9, 0, 7, 128, 8, 0, + 228, 128, 9, 0, 228, 128, + 7, 0, 0, 2, 2, 0, + 8, 128, 8, 0, 170, 128, + 6, 0, 0, 2, 2, 0, + 8, 128, 2, 0, 255, 128, + 88, 0, 0, 4, 1, 0, + 8, 128, 1, 0, 255, 128, + 9, 0, 170, 128, 2, 0, + 255, 128, 4, 0, 0, 4, + 1, 0, 8, 128, 7, 0, + 170, 128, 0, 0, 255, 129, + 1, 0, 255, 128, 4, 0, + 0, 4, 1, 0, 8, 128, + 6, 0, 170, 128, 1, 0, + 255, 128, 8, 0, 170, 128, + 4, 0, 0, 4, 10, 0, + 7, 128, 4, 0, 228, 128, + 3, 0, 85, 160, 3, 0, + 0, 161, 5, 0, 0, 3, + 10, 0, 7, 128, 8, 0, + 228, 128, 10, 0, 228, 128, + 4, 0, 0, 4, 11, 0, + 15, 128, 7, 0, 73, 128, + 0, 0, 255, 129, 7, 0, + 80, 160, 4, 0, 0, 4, + 5, 0, 12, 128, 10, 0, + 148, 128, 11, 0, 68, 129, + 8, 0, 148, 128, 88, 0, + 0, 4, 12, 0, 4, 128, + 5, 0, 85, 128, 5, 0, + 255, 128, 1, 0, 255, 128, + 7, 0, 0, 2, 1, 0, + 8, 128, 8, 0, 85, 128, + 6, 0, 0, 2, 1, 0, + 8, 128, 1, 0, 255, 128, + 88, 0, 0, 4, 1, 0, + 8, 128, 11, 0, 255, 128, + 9, 0, 85, 128, 1, 0, + 255, 128, 4, 0, 0, 4, + 1, 0, 8, 128, 7, 0, + 85, 128, 0, 0, 255, 129, + 1, 0, 255, 128, 4, 0, + 0, 4, 1, 0, 8, 128, + 6, 0, 85, 128, 1, 0, + 255, 128, 8, 0, 85, 128, + 88, 0, 0, 4, 12, 0, + 2, 128, 5, 0, 0, 128, + 5, 0, 170, 128, 1, 0, + 255, 128, 2, 0, 0, 3, + 13, 0, 15, 128, 4, 0, + 255, 128, 6, 0, 228, 160, + 5, 0, 0, 3, 13, 0, + 15, 128, 13, 0, 228, 128, + 13, 0, 228, 128, 2, 0, + 0, 3, 14, 0, 15, 128, + 4, 0, 36, 129, 11, 0, + 213, 161, 7, 0, 0, 2, + 1, 0, 8, 128, 8, 0, + 0, 128, 6, 0, 0, 2, + 1, 0, 8, 128, 1, 0, + 255, 128, 88, 0, 0, 4, + 1, 0, 8, 128, 11, 0, + 170, 128, 9, 0, 0, 128, + 1, 0, 255, 128, 4, 0, + 0, 4, 1, 0, 8, 128, + 7, 0, 0, 128, 0, 0, + 255, 129, 1, 0, 255, 128, + 4, 0, 0, 4, 1, 0, + 8, 128, 6, 0, 0, 128, + 1, 0, 255, 128, 8, 0, + 0, 128, 4, 0, 0, 4, + 6, 0, 15, 128, 7, 0, + 36, 128, 0, 0, 255, 129, + 11, 0, 127, 161, 4, 0, + 0, 4, 9, 0, 7, 128, + 7, 0, 228, 128, 0, 0, + 255, 128, 3, 0, 0, 160, + 5, 0, 0, 3, 9, 0, + 7, 128, 9, 0, 228, 128, + 9, 0, 228, 128, 4, 0, + 0, 4, 0, 0, 8, 128, + 10, 0, 0, 128, 6, 0, + 255, 129, 8, 0, 0, 128, + 88, 0, 0, 4, 12, 0, + 1, 128, 14, 0, 255, 128, + 0, 0, 255, 128, 1, 0, + 255, 128, 88, 0, 0, 4, + 0, 0, 7, 128, 13, 0, + 255, 129, 12, 0, 228, 128, + 0, 0, 228, 128, 2, 0, + 0, 3, 10, 0, 7, 128, + 8, 0, 228, 128, 8, 0, + 228, 128, 4, 0, 0, 4, + 12, 0, 7, 128, 4, 0, + 228, 128, 3, 0, 85, 161, + 10, 0, 228, 128, 2, 0, + 0, 3, 12, 0, 7, 128, + 12, 0, 228, 128, 3, 0, + 0, 160, 4, 0, 0, 4, + 15, 0, 7, 128, 4, 0, + 228, 128, 10, 0, 228, 129, + 12, 0, 228, 128, 5, 0, + 0, 3, 10, 0, 7, 128, + 4, 0, 228, 128, 10, 0, + 228, 128, 2, 0, 0, 3, + 16, 0, 7, 128, 4, 0, + 228, 128, 4, 0, 228, 128, + 5, 0, 0, 3, 17, 0, + 7, 128, 8, 0, 228, 128, + 16, 0, 228, 128, 4, 0, + 0, 4, 12, 0, 7, 128, + 16, 0, 228, 128, 8, 0, + 228, 129, 12, 0, 228, 128, + 88, 0, 0, 4, 6, 0, + 7, 128, 6, 0, 228, 128, + 10, 0, 228, 128, 12, 0, + 228, 128, 88, 0, 0, 4, + 5, 0, 6, 128, 5, 0, + 208, 128, 17, 0, 228, 128, + 15, 0, 228, 128, 88, 0, + 0, 4, 5, 0, 1, 128, + 14, 0, 255, 128, 17, 0, + 0, 128, 15, 0, 0, 128, + 88, 0, 0, 4, 0, 0, + 7, 128, 13, 0, 170, 129, + 5, 0, 228, 128, 0, 0, + 228, 128, 6, 0, 0, 2, + 0, 0, 8, 128, 4, 0, + 0, 128, 4, 0, 0, 4, + 0, 0, 8, 128, 6, 0, + 255, 128, 0, 0, 255, 129, + 3, 0, 0, 161, 11, 0, + 0, 3, 1, 0, 8, 128, + 0, 0, 255, 128, 11, 0, + 170, 161, 5, 0, 0, 3, + 5, 0, 7, 128, 4, 0, + 228, 128, 4, 0, 228, 128, + 88, 0, 0, 4, 0, 0, + 8, 128, 5, 0, 0, 129, + 11, 0, 170, 161, 1, 0, + 255, 128, 88, 0, 0, 4, + 10, 0, 1, 128, 9, 0, + 0, 129, 3, 0, 0, 161, + 0, 0, 255, 128, 6, 0, + 0, 2, 0, 0, 8, 128, + 4, 0, 85, 128, 4, 0, + 0, 4, 0, 0, 8, 128, + 11, 0, 0, 128, 0, 0, + 255, 129, 3, 0, 0, 161, + 11, 0, 0, 3, 1, 0, + 8, 128, 0, 0, 255, 128, + 11, 0, 170, 161, 88, 0, + 0, 4, 0, 0, 8, 128, + 5, 0, 85, 129, 11, 0, + 170, 161, 1, 0, 255, 128, + 88, 0, 0, 4, 10, 0, + 2, 128, 9, 0, 85, 129, + 3, 0, 0, 161, 0, 0, + 255, 128, 6, 0, 0, 2, + 0, 0, 8, 128, 4, 0, + 170, 128, 4, 0, 0, 4, + 0, 0, 8, 128, 11, 0, + 85, 128, 0, 0, 255, 129, + 3, 0, 0, 161, 11, 0, + 0, 3, 1, 0, 8, 128, + 0, 0, 255, 128, 11, 0, + 170, 161, 88, 0, 0, 4, + 0, 0, 8, 128, 5, 0, + 170, 129, 11, 0, 170, 161, + 1, 0, 255, 128, 88, 0, + 0, 4, 10, 0, 4, 128, + 9, 0, 170, 129, 3, 0, + 0, 161, 0, 0, 255, 128, + 88, 0, 0, 4, 0, 0, + 7, 128, 13, 0, 85, 129, + 10, 0, 228, 128, 0, 0, + 228, 128, 2, 0, 0, 3, + 5, 0, 7, 128, 4, 0, + 228, 128, 3, 0, 0, 160, + 5, 0, 0, 3, 5, 0, + 7, 128, 5, 0, 228, 128, + 5, 0, 228, 128, 6, 0, + 0, 2, 0, 0, 8, 128, + 14, 0, 0, 128, 5, 0, + 0, 3, 0, 0, 8, 128, + 0, 0, 255, 128, 8, 0, + 0, 128, 10, 0, 0, 3, + 1, 0, 8, 128, 0, 0, + 255, 128, 3, 0, 0, 161, + 88, 0, 0, 4, 0, 0, + 8, 128, 5, 0, 0, 129, + 3, 0, 0, 161, 1, 0, + 255, 128, 5, 0, 0, 3, + 9, 0, 7, 128, 8, 0, + 228, 128, 8, 0, 228, 128, + 88, 0, 0, 4, 10, 0, + 1, 128, 9, 0, 0, 129, + 11, 0, 170, 161, 0, 0, + 255, 128, 6, 0, 0, 2, + 0, 0, 8, 128, 14, 0, + 85, 128, 6, 0, 0, 2, + 1, 0, 8, 128, 14, 0, + 170, 128, 5, 0, 0, 3, + 1, 0, 8, 128, 1, 0, + 255, 128, 8, 0, 170, 128, + 10, 0, 0, 3, 2, 0, + 8, 128, 1, 0, 255, 128, + 3, 0, 0, 161, 88, 0, + 0, 4, 1, 0, 8, 128, + 5, 0, 170, 129, 3, 0, + 0, 161, 2, 0, 255, 128, + 88, 0, 0, 4, 10, 0, + 4, 128, 9, 0, 170, 129, + 11, 0, 170, 161, 1, 0, + 255, 128, 5, 0, 0, 3, + 0, 0, 8, 128, 0, 0, + 255, 128, 8, 0, 85, 128, + 10, 0, 0, 3, 1, 0, + 8, 128, 0, 0, 255, 128, + 3, 0, 0, 161, 88, 0, + 0, 4, 0, 0, 8, 128, + 5, 0, 85, 129, 3, 0, + 0, 161, 1, 0, 255, 128, + 88, 0, 0, 4, 10, 0, + 2, 128, 9, 0, 85, 129, + 11, 0, 170, 161, 0, 0, + 255, 128, 88, 0, 0, 4, + 0, 0, 7, 128, 13, 0, + 0, 129, 10, 0, 228, 128, + 0, 0, 228, 128, 2, 0, + 0, 3, 5, 0, 15, 128, + 4, 0, 255, 128, 5, 0, + 228, 160, 5, 0, 0, 3, + 5, 0, 15, 128, 5, 0, + 228, 128, 5, 0, 228, 128, + 11, 0, 0, 3, 9, 0, + 7, 128, 8, 0, 228, 128, + 4, 0, 228, 128, 10, 0, + 0, 3, 10, 0, 7, 128, + 4, 0, 228, 128, 8, 0, + 228, 128, 88, 0, 0, 4, + 0, 0, 7, 128, 5, 0, + 255, 129, 9, 0, 228, 128, + 0, 0, 228, 128, 88, 0, + 0, 4, 0, 0, 7, 128, + 5, 0, 170, 129, 10, 0, + 228, 128, 0, 0, 228, 128, + 88, 0, 0, 4, 0, 0, + 7, 128, 5, 0, 85, 129, + 6, 0, 228, 128, 0, 0, + 228, 128, 88, 0, 0, 4, + 0, 0, 7, 128, 5, 0, + 0, 129, 1, 0, 228, 128, + 0, 0, 228, 128, 88, 0, + 0, 4, 0, 0, 7, 128, + 2, 0, 170, 161, 2, 0, + 228, 128, 0, 0, 228, 128, + 18, 0, 0, 4, 1, 0, + 7, 128, 7, 0, 255, 128, + 0, 0, 228, 128, 4, 0, + 228, 128, 5, 0, 0, 3, + 0, 0, 7, 128, 3, 0, + 255, 128, 1, 0, 228, 128, + 5, 0, 0, 3, 1, 0, + 1, 128, 3, 0, 255, 128, + 3, 0, 255, 128, 1, 0, + 0, 2, 0, 0, 8, 128, + 3, 0, 255, 128, 88, 0, + 0, 4, 0, 0, 15, 128, + 1, 0, 0, 129, 7, 0, + 228, 128, 0, 0, 228, 128, + 5, 0, 0, 3, 1, 0, + 1, 128, 7, 0, 255, 128, + 7, 0, 255, 128, 88, 0, + 0, 4, 0, 0, 15, 128, + 1, 0, 0, 129, 3, 0, + 228, 128, 0, 0, 228, 128, + 1, 0, 0, 2, 0, 8, + 15, 128, 0, 0, 228, 128, + 255, 255, 0, 0, 83, 72, + 68, 82, 40, 40, 0, 0, + 64, 0, 0, 0, 10, 10, + 0, 0, 89, 0, 0, 4, + 70, 142, 32, 0, 0, 0, + 0, 0, 3, 0, 0, 0, + 90, 0, 0, 3, 0, 96, + 16, 0, 0, 0, 0, 0, + 90, 0, 0, 3, 0, 96, + 16, 0, 1, 0, 0, 0, + 88, 24, 0, 4, 0, 112, + 16, 0, 0, 0, 0, 0, + 85, 85, 0, 0, 88, 24, + 0, 4, 0, 112, 16, 0, + 1, 0, 0, 0, 85, 85, + 0, 0, 88, 24, 0, 4, + 0, 112, 16, 0, 2, 0, + 0, 0, 85, 85, 0, 0, + 88, 24, 0, 4, 0, 112, + 16, 0, 3, 0, 0, 0, + 85, 85, 0, 0, 88, 24, + 0, 4, 0, 112, 16, 0, + 5, 0, 0, 0, 85, 85, + 0, 0, 88, 24, 0, 4, + 0, 112, 16, 0, 6, 0, + 0, 0, 85, 85, 0, 0, + 98, 16, 0, 3, 50, 16, + 16, 0, 1, 0, 0, 0, + 98, 16, 0, 3, 194, 16, + 16, 0, 1, 0, 0, 0, + 98, 16, 0, 3, 114, 16, + 16, 0, 2, 0, 0, 0, + 101, 0, 0, 3, 242, 32, + 16, 0, 0, 0, 0, 0, + 104, 0, 0, 2, 22, 0, + 0, 0, 69, 0, 0, 9, + 242, 0, 16, 0, 0, 0, + 0, 0, 230, 26, 16, 0, + 1, 0, 0, 0, 70, 126, + 16, 0, 6, 0, 0, 0, + 0, 96, 16, 0, 0, 0, + 0, 0, 31, 0, 0, 4, + 26, 128, 32, 0, 0, 0, + 0, 0, 2, 0, 0, 0, + 31, 0, 0, 4, 10, 128, + 32, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 69, 0, + 0, 9, 242, 0, 16, 0, + 1, 0, 0, 0, 70, 16, + 16, 0, 1, 0, 0, 0, + 70, 126, 16, 0, 0, 0, + 0, 0, 0, 96, 16, 0, + 0, 0, 0, 0, 56, 0, + 0, 8, 114, 0, 16, 0, + 1, 0, 0, 0, 70, 2, + 16, 0, 1, 0, 0, 0, + 6, 128, 32, 0, 0, 0, + 0, 0, 1, 0, 0, 0, + 54, 0, 0, 6, 130, 0, + 16, 0, 1, 0, 0, 0, + 10, 128, 32, 0, 0, 0, + 0, 0, 1, 0, 0, 0, + 54, 0, 0, 5, 18, 0, + 16, 0, 2, 0, 0, 0, + 1, 64, 0, 0, 255, 255, + 255, 255, 18, 0, 0, 1, + 32, 0, 0, 8, 34, 0, + 16, 0, 2, 0, 0, 0, + 1, 64, 0, 0, 1, 0, + 0, 0, 10, 128, 32, 0, + 0, 0, 0, 0, 2, 0, + 0, 0, 31, 0, 4, 3, + 26, 0, 16, 0, 2, 0, + 0, 0, 69, 0, 0, 9, + 242, 0, 16, 0, 3, 0, + 0, 0, 70, 16, 16, 0, + 1, 0, 0, 0, 70, 126, + 16, 0, 0, 0, 0, 0, + 0, 96, 16, 0, 0, 0, + 0, 0, 56, 0, 0, 8, + 242, 0, 16, 0, 1, 0, + 0, 0, 70, 14, 16, 0, + 3, 0, 0, 0, 6, 128, + 32, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 54, 0, + 0, 5, 18, 0, 16, 0, + 2, 0, 0, 0, 1, 64, + 0, 0, 255, 255, 255, 255, + 18, 0, 0, 1, 32, 0, + 0, 8, 18, 0, 16, 0, + 2, 0, 0, 0, 1, 64, + 0, 0, 2, 0, 0, 0, + 10, 128, 32, 0, 0, 0, + 0, 0, 2, 0, 0, 0, + 31, 0, 4, 3, 10, 0, + 16, 0, 2, 0, 0, 0, + 69, 0, 0, 9, 242, 0, + 16, 0, 3, 0, 0, 0, + 70, 16, 16, 0, 1, 0, + 0, 0, 70, 126, 16, 0, + 3, 0, 0, 0, 0, 96, + 16, 0, 0, 0, 0, 0, + 0, 0, 0, 7, 34, 0, + 16, 0, 2, 0, 0, 0, + 10, 0, 16, 0, 3, 0, + 0, 0, 1, 64, 0, 0, + 115, 128, 0, 191, 69, 0, + 0, 9, 242, 0, 16, 0, + 3, 0, 0, 0, 70, 16, + 16, 0, 1, 0, 0, 0, + 70, 126, 16, 0, 1, 0, + 0, 0, 0, 96, 16, 0, 0, 0, 0, 0, 0, 0, + 0, 7, 66, 0, 16, 0, + 2, 0, 0, 0, 10, 0, + 16, 0, 3, 0, 0, 0, + 1, 64, 0, 0, 18, 131, + 128, 189, 69, 0, 0, 9, + 242, 0, 16, 0, 3, 0, + 0, 0, 70, 16, 16, 0, + 1, 0, 0, 0, 70, 126, + 16, 0, 2, 0, 0, 0, + 0, 96, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 7, + 130, 0, 16, 0, 2, 0, + 0, 0, 10, 0, 16, 0, + 3, 0, 0, 0, 1, 64, + 0, 0, 115, 128, 0, 191, + 56, 0, 0, 10, 50, 0, + 16, 0, 3, 0, 0, 0, + 86, 5, 16, 0, 2, 0, + 0, 0, 2, 64, 0, 0, + 182, 74, 204, 63, 205, 30, + 80, 63, 0, 0, 0, 0, + 0, 0, 0, 0, 50, 0, + 0, 9, 18, 0, 16, 0, + 4, 0, 0, 0, 42, 0, + 16, 0, 2, 0, 0, 0, + 1, 64, 0, 0, 103, 10, + 149, 63, 10, 0, 16, 0, + 3, 0, 0, 0, 50, 0, + 0, 10, 34, 0, 16, 0, + 2, 0, 0, 0, 42, 0, + 16, 0, 2, 0, 0, 0, + 1, 64, 0, 0, 103, 10, + 149, 63, 26, 0, 16, 128, + 65, 0, 0, 0, 3, 0, + 0, 0, 56, 0, 0, 7, + 18, 0, 16, 0, 3, 0, + 0, 0, 58, 0, 16, 0, + 2, 0, 0, 0, 1, 64, + 0, 0, 76, 26, 1, 64, + 50, 0, 0, 10, 34, 0, + 16, 0, 4, 0, 0, 0, + 58, 0, 16, 128, 65, 0, + 0, 0, 2, 0, 0, 0, + 1, 64, 0, 0, 196, 148, + 200, 62, 26, 0, 16, 0, + 2, 0, 0, 0, 50, 0, + 0, 9, 66, 0, 16, 0, + 4, 0, 0, 0, 42, 0, + 16, 0, 2, 0, 0, 0, + 1, 64, 0, 0, 103, 10, + 149, 63, 10, 0, 16, 0, + 3, 0, 0, 0, 54, 0, + 0, 5, 130, 0, 16, 0, + 4, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 63, + 56, 0, 0, 8, 242, 0, + 16, 0, 1, 0, 0, 0, + 70, 14, 16, 0, 4, 0, + 0, 0, 6, 128, 32, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 21, 0, 0, 1, + 21, 0, 0, 1, 21, 0, + 0, 1, 55, 0, 0, 10, + 242, 0, 16, 0, 1, 0, + 0, 0, 6, 0, 16, 0, + 2, 0, 0, 0, 70, 14, + 16, 0, 1, 0, 0, 0, + 70, 142, 32, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 54, 0, 0, 5, 18, 0, + 16, 0, 2, 0, 0, 0, + 1, 64, 0, 0, 255, 255, + 255, 255, 18, 0, 0, 1, + 32, 0, 0, 8, 34, 0, + 16, 0, 2, 0, 0, 0, + 1, 64, 0, 0, 1, 0, + 0, 0, 26, 128, 32, 0, + 0, 0, 0, 0, 2, 0, + 0, 0, 31, 0, 4, 3, + 26, 0, 16, 0, 2, 0, + 0, 0, 31, 0, 0, 4, + 10, 128, 32, 0, 0, 0, + 0, 0, 2, 0, 0, 0, + 69, 0, 0, 9, 242, 0, + 16, 0, 3, 0, 0, 0, + 70, 16, 16, 0, 1, 0, + 0, 0, 70, 126, 16, 0, + 0, 0, 0, 0, 0, 96, + 16, 0, 0, 0, 0, 0, + 56, 0, 0, 8, 114, 0, + 16, 0, 3, 0, 0, 0, + 70, 2, 16, 0, 3, 0, + 0, 0, 6, 128, 32, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 69, 0, 0, 9, + 242, 0, 16, 0, 4, 0, + 0, 0, 70, 16, 16, 0, + 2, 0, 0, 0, 70, 126, + 16, 0, 5, 0, 0, 0, + 0, 96, 16, 0, 0, 0, + 0, 0, 54, 0, 0, 6, + 130, 0, 16, 0, 3, 0, + 0, 0, 10, 128, 32, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 56, 0, 0, 7, + 242, 0, 16, 0, 1, 0, + 0, 0, 70, 14, 16, 0, + 3, 0, 0, 0, 6, 0, + 16, 0, 4, 0, 0, 0, + 54, 0, 0, 5, 34, 0, + 16, 0, 2, 0, 0, 0, + 1, 64, 0, 0, 255, 255, + 255, 255, 18, 0, 0, 1, + 32, 0, 0, 8, 66, 0, + 16, 0, 2, 0, 0, 0, + 1, 64, 0, 0, 1, 0, + 0, 0, 10, 128, 32, 0, + 0, 0, 0, 0, 2, 0, + 0, 0, 31, 0, 4, 3, + 42, 0, 16, 0, 2, 0, + 0, 0, 69, 0, 0, 9, + 242, 0, 16, 0, 3, 0, + 0, 0, 70, 16, 16, 0, + 2, 0, 0, 0, 70, 126, + 16, 0, 5, 0, 0, 0, + 0, 96, 16, 0, 0, 0, + 0, 0, 69, 0, 0, 9, + 242, 0, 16, 0, 4, 0, + 0, 0, 70, 16, 16, 0, + 1, 0, 0, 0, 70, 126, + 16, 0, 0, 0, 0, 0, + 0, 96, 16, 0, 0, 0, + 0, 0, 56, 0, 0, 8, + 242, 0, 16, 0, 4, 0, + 0, 0, 70, 14, 16, 0, + 4, 0, 0, 0, 6, 128, + 32, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 56, 0, + 0, 7, 242, 0, 16, 0, + 1, 0, 0, 0, 6, 0, + 16, 0, 3, 0, 0, 0, + 70, 14, 16, 0, 4, 0, + 0, 0, 54, 0, 0, 5, + 34, 0, 16, 0, 2, 0, + 0, 0, 1, 64, 0, 0, + 255, 255, 255, 255, 18, 0, + 0, 1, 32, 0, 0, 8, + 34, 0, 16, 0, 2, 0, + 0, 0, 1, 64, 0, 0, + 2, 0, 0, 0, 10, 128, + 32, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 31, 0, + 4, 3, 26, 0, 16, 0, + 2, 0, 0, 0, 69, 0, + 0, 9, 242, 0, 16, 0, + 3, 0, 0, 0, 70, 16, + 16, 0, 2, 0, 0, 0, + 70, 126, 16, 0, 5, 0, + 0, 0, 0, 96, 16, 0, + 0, 0, 0, 0, 69, 0, + 0, 9, 242, 0, 16, 0, + 4, 0, 0, 0, 70, 16, + 16, 0, 1, 0, 0, 0, + 70, 126, 16, 0, 3, 0, + 0, 0, 0, 96, 16, 0, + 0, 0, 0, 0, 0, 0, + 0, 7, 66, 0, 16, 0, + 2, 0, 0, 0, 10, 0, + 16, 0, 4, 0, 0, 0, + 1, 64, 0, 0, 115, 128, + 0, 191, 69, 0, 0, 9, + 242, 0, 16, 0, 4, 0, + 0, 0, 70, 16, 16, 0, + 1, 0, 0, 0, 70, 126, + 16, 0, 1, 0, 0, 0, + 0, 96, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 7, + 130, 0, 16, 0, 2, 0, + 0, 0, 10, 0, 16, 0, + 4, 0, 0, 0, 1, 64, + 0, 0, 18, 131, 128, 189, + 69, 0, 0, 9, 242, 0, + 16, 0, 4, 0, 0, 0, + 70, 16, 16, 0, 1, 0, + 0, 0, 70, 126, 16, 0, + 2, 0, 0, 0, 0, 96, + 16, 0, 0, 0, 0, 0, + 0, 0, 0, 7, 34, 0, + 16, 0, 3, 0, 0, 0, + 10, 0, 16, 0, 4, 0, + 0, 0, 1, 64, 0, 0, + 115, 128, 0, 191, 56, 0, + 0, 10, 194, 0, 16, 0, + 3, 0, 0, 0, 166, 10, + 16, 0, 2, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 182, 74, 204, 63, 205, 30, + 80, 63, 50, 0, 0, 9, + 18, 0, 16, 0, 4, 0, + 0, 0, 58, 0, 16, 0, + 2, 0, 0, 0, 1, 64, + 0, 0, 103, 10, 149, 63, + 42, 0, 16, 0, 3, 0, + 0, 0, 50, 0, 0, 10, + 66, 0, 16, 0, 2, 0, + 0, 0, 58, 0, 16, 0, + 2, 0, 0, 0, 1, 64, + 0, 0, 103, 10, 149, 63, + 58, 0, 16, 128, 65, 0, + 0, 0, 3, 0, 0, 0, + 56, 0, 0, 7, 66, 0, + 16, 0, 3, 0, 0, 0, + 26, 0, 16, 0, 3, 0, + 0, 0, 1, 64, 0, 0, + 76, 26, 1, 64, 50, 0, + 0, 10, 34, 0, 16, 0, + 4, 0, 0, 0, 26, 0, + 16, 128, 65, 0, 0, 0, + 3, 0, 0, 0, 1, 64, + 0, 0, 196, 148, 200, 62, + 42, 0, 16, 0, 2, 0, + 0, 0, 50, 0, 0, 9, + 66, 0, 16, 0, 4, 0, + 0, 0, 58, 0, 16, 0, + 2, 0, 0, 0, 1, 64, + 0, 0, 103, 10, 149, 63, + 42, 0, 16, 0, 3, 0, + 0, 0, 54, 0, 0, 5, + 130, 0, 16, 0, 4, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 128, 63, 56, 0, + 0, 8, 242, 0, 16, 0, + 4, 0, 0, 0, 70, 14, + 16, 0, 4, 0, 0, 0, + 6, 128, 32, 0, 0, 0, + 0, 0, 1, 0, 0, 0, + 56, 0, 0, 7, 242, 0, + 16, 0, 1, 0, 0, 0, + 6, 0, 16, 0, 3, 0, + 0, 0, 70, 14, 16, 0, + 4, 0, 0, 0, 21, 0, + 0, 1, 21, 0, 0, 1, + 21, 0, 0, 1, 31, 0, + 0, 3, 26, 0, 16, 0, + 2, 0, 0, 0, 69, 0, + 0, 9, 242, 0, 16, 0, + 3, 0, 0, 0, 70, 16, + 16, 0, 2, 0, 0, 0, + 70, 126, 16, 0, 5, 0, + 0, 0, 0, 96, 16, 0, + 0, 0, 0, 0, 56, 0, + 0, 8, 242, 0, 16, 0, + 1, 0, 0, 0, 6, 0, + 16, 0, 3, 0, 0, 0, + 70, 142, 32, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 21, 0, 0, 1, 54, 0, + 0, 5, 18, 0, 16, 0, + 2, 0, 0, 0, 1, 64, + 0, 0, 255, 255, 255, 255, + 18, 0, 0, 1, 32, 0, + 0, 8, 18, 0, 16, 0, + 2, 0, 0, 0, 1, 64, + 0, 0, 2, 0, 0, 0, + 26, 128, 32, 0, 0, 0, + 0, 0, 2, 0, 0, 0, + 31, 0, 4, 3, 10, 0, + 16, 0, 2, 0, 0, 0, + 14, 0, 0, 7, 98, 0, + 16, 0, 2, 0, 0, 0, + 6, 17, 16, 0, 2, 0, + 0, 0, 166, 26, 16, 0, + 2, 0, 0, 0, 69, 0, + 0, 9, 242, 0, 16, 0, + 3, 0, 0, 0, 150, 5, + 16, 0, 2, 0, 0, 0, + 70, 126, 16, 0, 5, 0, + 0, 0, 0, 96, 16, 0, + 1, 0, 0, 0, 69, 0, + 0, 9, 242, 0, 16, 0, + 4, 0, 0, 0, 70, 16, + 16, 0, 1, 0, 0, 0, + 70, 126, 16, 0, 0, 0, + 0, 0, 0, 96, 16, 0, + 0, 0, 0, 0, 56, 0, + 0, 8, 242, 0, 16, 0, + 4, 0, 0, 0, 70, 14, + 16, 0, 4, 0, 0, 0, + 6, 128, 32, 0, 0, 0, + 0, 0, 1, 0, 0, 0, + 56, 0, 0, 7, 242, 0, + 16, 0, 1, 0, 0, 0, + 6, 0, 16, 0, 3, 0, + 0, 0, 70, 14, 16, 0, + 4, 0, 0, 0, 21, 0, + 0, 1, 21, 0, 0, 1, + 21, 0, 0, 1, 55, 0, + 0, 12, 242, 0, 16, 0, + 1, 0, 0, 0, 6, 0, + 16, 0, 2, 0, 0, 0, + 70, 14, 16, 0, 1, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 128, 63, 24, 0, + 0, 7, 18, 0, 16, 0, + 2, 0, 0, 0, 58, 0, + 16, 0, 0, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 0, 0, 31, 0, 4, 3, + 10, 0, 16, 0, 2, 0, + 0, 0, 54, 0, 0, 5, + 242, 32, 16, 0, 0, 0, + 0, 0, 70, 14, 16, 0, + 1, 0, 0, 0, 62, 0, + 0, 1, 21, 0, 0, 1, + 24, 0, 0, 7, 18, 0, + 16, 0, 2, 0, 0, 0, + 58, 0, 16, 0, 1, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 0, 0, 31, 0, + 4, 3, 10, 0, 16, 0, + 2, 0, 0, 0, 54, 0, + 0, 5, 242, 32, 16, 0, + 0, 0, 0, 0, 70, 14, + 16, 0, 0, 0, 0, 0, + 62, 0, 0, 1, 21, 0, + 0, 1, 14, 0, 0, 7, + 114, 0, 16, 0, 0, 0, + 0, 0, 70, 2, 16, 0, + 0, 0, 0, 0, 246, 15, + 16, 0, 0, 0, 0, 0, + 14, 0, 0, 7, 114, 0, + 16, 0, 2, 0, 0, 0, + 70, 2, 16, 0, 1, 0, + 0, 0, 246, 15, 16, 0, + 1, 0, 0, 0, 55, 0, + 0, 10, 114, 0, 16, 0, + 1, 0, 0, 0, 246, 143, + 32, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 70, 2, + 16, 0, 2, 0, 0, 0, + 70, 2, 16, 0, 1, 0, + 0, 0, 56, 0, 0, 7, + 114, 0, 16, 0, 2, 0, + 0, 0, 70, 2, 16, 0, + 0, 0, 0, 0, 70, 2, + 16, 0, 1, 0, 0, 0, + 0, 0, 0, 7, 114, 0, + 16, 0, 3, 0, 0, 0, + 70, 2, 16, 0, 0, 0, + 0, 0, 70, 2, 16, 0, + 1, 0, 0, 0, 50, 0, + 0, 10, 114, 0, 16, 0, + 4, 0, 0, 0, 70, 2, + 16, 128, 65, 0, 0, 0, + 0, 0, 0, 0, 70, 2, + 16, 0, 1, 0, 0, 0, + 70, 2, 16, 0, 3, 0, + 0, 0, 29, 0, 0, 10, + 242, 0, 16, 0, 5, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 0, 63, 0, 0, + 0, 63, 0, 0, 0, 63, + 0, 0, 128, 62, 70, 2, + 16, 0, 0, 0, 0, 0, + 0, 0, 0, 7, 114, 0, + 16, 0, 6, 0, 0, 0, + 70, 2, 16, 0, 0, 0, + 0, 0, 70, 2, 16, 0, + 0, 0, 0, 0, 56, 0, + 0, 7, 114, 0, 16, 0, + 7, 0, 0, 0, 70, 2, + 16, 0, 1, 0, 0, 0, + 70, 2, 16, 0, 6, 0, + 0, 0, 0, 0, 0, 7, + 114, 0, 16, 0, 8, 0, + 0, 0, 70, 2, 16, 0, + 1, 0, 0, 0, 70, 2, + 16, 0, 1, 0, 0, 0, + 50, 0, 0, 12, 114, 0, + 16, 0, 9, 0, 0, 0, + 70, 2, 16, 0, 1, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 0, 64, 0, 0, + 0, 64, 0, 0, 0, 64, + 0, 0, 0, 0, 70, 2, + 16, 0, 6, 0, 0, 0, + 0, 0, 0, 10, 114, 0, + 16, 0, 9, 0, 0, 0, + 70, 2, 16, 0, 9, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 128, 191, 0, 0, + 128, 191, 0, 0, 128, 191, + 0, 0, 0, 0, 56, 0, + 0, 7, 114, 0, 16, 0, + 10, 0, 0, 0, 70, 2, + 16, 0, 0, 0, 0, 0, + 70, 2, 16, 0, 8, 0, + 0, 0, 50, 0, 0, 10, + 114, 0, 16, 0, 8, 0, + 0, 0, 70, 2, 16, 128, + 65, 0, 0, 0, 8, 0, + 0, 0, 70, 2, 16, 0, + 0, 0, 0, 0, 70, 2, + 16, 0, 9, 0, 0, 0, + 55, 0, 0, 9, 114, 0, + 16, 0, 5, 0, 0, 0, + 70, 2, 16, 0, 5, 0, + 0, 0, 70, 2, 16, 0, + 7, 0, 0, 0, 70, 2, + 16, 0, 8, 0, 0, 0, + 51, 0, 0, 7, 114, 0, + 16, 0, 7, 0, 0, 0, + 70, 2, 16, 0, 0, 0, + 0, 0, 70, 2, 16, 0, + 1, 0, 0, 0, 32, 0, + 0, 11, 242, 0, 16, 0, + 8, 0, 0, 0, 2, 64, + 0, 0, 1, 0, 0, 0, + 2, 0, 0, 0, 3, 0, + 0, 0, 4, 0, 0, 0, + 166, 138, 32, 0, 0, 0, + 0, 0, 2, 0, 0, 0, + 52, 0, 0, 7, 114, 0, + 16, 0, 11, 0, 0, 0, + 70, 2, 16, 0, 0, 0, + 0, 0, 70, 2, 16, 0, + 1, 0, 0, 0, 24, 0, + 0, 10, 242, 0, 16, 0, + 12, 0, 0, 0, 70, 2, + 16, 0, 0, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 128, 63, 24, 0, 0, 10, + 242, 0, 16, 0, 13, 0, + 0, 0, 70, 2, 16, 0, + 1, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 128, 63, + 0, 0, 128, 63, 0, 0, + 128, 63, 0, 0, 0, 0, + 0, 0, 0, 11, 114, 0, + 16, 0, 14, 0, 0, 0, + 70, 2, 16, 128, 65, 0, + 0, 0, 1, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 128, 63, 0, 0, 128, 63, + 0, 0, 128, 63, 0, 0, + 0, 0, 14, 0, 0, 7, + 114, 0, 16, 0, 14, 0, + 0, 0, 70, 2, 16, 0, + 0, 0, 0, 0, 70, 2, + 16, 0, 14, 0, 0, 0, + 51, 0, 0, 10, 114, 0, + 16, 0, 14, 0, 0, 0, + 70, 2, 16, 0, 14, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 128, 63, 0, 0, + 128, 63, 0, 0, 128, 63, + 0, 0, 0, 0, 55, 0, + 0, 12, 114, 0, 16, 0, + 13, 0, 0, 0, 70, 2, + 16, 0, 13, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 128, 63, 0, 0, 128, 63, + 0, 0, 128, 63, 0, 0, + 0, 0, 70, 2, 16, 0, + 14, 0, 0, 0, 55, 0, + 0, 12, 114, 0, 16, 0, + 12, 0, 0, 0, 70, 2, + 16, 0, 12, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 70, 2, 16, 0, + 13, 0, 0, 0, 0, 0, + 0, 11, 114, 0, 16, 0, + 13, 0, 0, 0, 70, 2, + 16, 128, 65, 0, 0, 0, + 0, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 128, 63, + 0, 0, 128, 63, 0, 0, + 128, 63, 0, 0, 0, 0, + 14, 0, 0, 7, 114, 0, + 16, 0, 14, 0, 0, 0, + 70, 2, 16, 0, 13, 0, + 0, 0, 70, 2, 16, 0, + 1, 0, 0, 0, 51, 0, + 0, 10, 114, 0, 16, 0, + 14, 0, 0, 0, 70, 2, + 16, 0, 14, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 128, 63, 0, 0, 128, 63, + 0, 0, 128, 63, 0, 0, + 0, 0, 0, 0, 0, 11, + 114, 0, 16, 0, 14, 0, + 0, 0, 70, 2, 16, 128, + 65, 0, 0, 0, 14, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 128, 63, 0, 0, + 128, 63, 0, 0, 128, 63, + 0, 0, 0, 0, 55, 0, + 0, 9, 130, 0, 16, 0, + 2, 0, 0, 0, 58, 0, + 16, 0, 13, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 0, 0, 10, 0, 16, 0, + 14, 0, 0, 0, 55, 0, + 0, 9, 18, 0, 16, 0, + 15, 0, 0, 0, 58, 0, + 16, 0, 12, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 128, 63, 58, 0, 16, 0, + 2, 0, 0, 0, 24, 0, + 0, 10, 146, 0, 16, 0, + 14, 0, 0, 0, 86, 9, + 16, 0, 0, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 128, 63, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 128, 63, 24, 0, 0, 10, + 50, 0, 16, 0, 16, 0, + 0, 0, 150, 5, 16, 0, + 1, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 55, 0, 0, 12, 98, 0, + 16, 0, 14, 0, 0, 0, + 6, 1, 16, 0, 16, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 86, 6, + 16, 0, 14, 0, 0, 0, + 55, 0, 0, 12, 98, 0, + 16, 0, 15, 0, 0, 0, + 6, 3, 16, 0, 14, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 0, 0, 0, 0, + 128, 63, 0, 0, 128, 63, + 0, 0, 0, 0, 86, 6, + 16, 0, 14, 0, 0, 0, + 29, 0, 0, 10, 114, 0, + 16, 0, 14, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 63, 0, 0, 0, 63, + 0, 0, 0, 63, 0, 0, + 0, 0, 70, 2, 16, 0, + 1, 0, 0, 0, 50, 0, + 0, 10, 114, 0, 16, 0, + 6, 0, 0, 0, 70, 2, + 16, 128, 65, 0, 0, 0, + 1, 0, 0, 0, 70, 2, + 16, 0, 6, 0, 0, 0, + 70, 2, 16, 0, 9, 0, + 0, 0, 55, 0, 0, 9, + 114, 0, 16, 0, 6, 0, + 0, 0, 70, 2, 16, 0, + 14, 0, 0, 0, 70, 2, + 16, 0, 10, 0, 0, 0, + 70, 2, 16, 0, 6, 0, + 0, 0, 32, 0, 0, 11, + 242, 0, 16, 0, 9, 0, + 0, 0, 2, 64, 0, 0, + 5, 0, 0, 0, 6, 0, + 0, 0, 7, 0, 0, 0, + 8, 0, 0, 0, 166, 138, + 32, 0, 0, 0, 0, 0, + 2, 0, 0, 0, 50, 0, + 0, 16, 114, 0, 16, 0, + 10, 0, 0, 0, 70, 2, + 16, 128, 65, 0, 0, 0, + 1, 0, 0, 0, 2, 64, + 0, 0, 0, 0, 0, 64, + 0, 0, 0, 64, 0, 0, + 0, 64, 0, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 128, 63, 0, 0, 128, 63, + 0, 0, 128, 63, 0, 0, + 0, 0, 56, 0, 0, 7, + 114, 0, 16, 0, 10, 0, + 0, 0, 70, 2, 16, 0, + 0, 0, 0, 0, 70, 2, + 16, 0, 10, 0, 0, 0, + 50, 0, 0, 10, 114, 0, + 16, 0, 10, 0, 0, 0, + 70, 2, 16, 128, 65, 0, + 0, 0, 10, 0, 0, 0, + 70, 2, 16, 0, 13, 0, + 0, 0, 70, 2, 16, 0, + 0, 0, 0, 0, 50, 0, + 0, 15, 114, 0, 16, 0, + 13, 0, 0, 0, 70, 2, + 16, 0, 1, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 0, 64, 0, 0, 0, 64, + 0, 0, 0, 64, 0, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 128, 191, 0, 0, + 128, 191, 0, 0, 128, 191, + 0, 0, 0, 0, 50, 0, + 0, 15, 114, 0, 16, 0, + 16, 0, 0, 0, 70, 2, + 16, 0, 0, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 128, 65, 0, 0, 128, 65, + 0, 0, 128, 65, 0, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 64, 193, 0, 0, + 64, 193, 0, 0, 64, 193, + 0, 0, 0, 0, 50, 0, + 0, 12, 114, 0, 16, 0, + 16, 0, 0, 0, 70, 2, + 16, 0, 16, 0, 0, 0, + 70, 2, 16, 0, 0, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 128, 64, 0, 0, + 128, 64, 0, 0, 128, 64, + 0, 0, 0, 0, 56, 0, + 0, 7, 114, 0, 16, 0, + 16, 0, 0, 0, 70, 2, + 16, 0, 0, 0, 0, 0, + 70, 2, 16, 0, 16, 0, + 0, 0, 75, 0, 0, 5, + 114, 0, 16, 0, 17, 0, + 0, 0, 70, 2, 16, 0, + 0, 0, 0, 0, 55, 0, + 0, 9, 130, 0, 16, 0, + 2, 0, 0, 0, 58, 0, + 16, 0, 5, 0, 0, 0, + 10, 0, 16, 0, 16, 0, + 0, 0, 10, 0, 16, 0, + 17, 0, 0, 0, 0, 0, + 0, 8, 130, 0, 16, 0, + 2, 0, 0, 0, 10, 0, + 16, 128, 65, 0, 0, 0, + 0, 0, 0, 0, 58, 0, + 16, 0, 2, 0, 0, 0, + 50, 0, 0, 9, 130, 0, + 16, 0, 2, 0, 0, 0, + 10, 0, 16, 0, 13, 0, + 0, 0, 58, 0, 16, 0, + 2, 0, 0, 0, 10, 0, + 16, 0, 0, 0, 0, 0, + 55, 0, 0, 9, 18, 0, + 16, 0, 18, 0, 0, 0, + 10, 0, 16, 0, 14, 0, + 0, 0, 10, 0, 16, 0, + 10, 0, 0, 0, 58, 0, + 16, 0, 2, 0, 0, 0, + 29, 0, 0, 10, 146, 0, + 16, 0, 10, 0, 0, 0, + 2, 64, 0, 0, 0, 0, + 128, 62, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 128, 62, 86, 9, 16, 0, + 0, 0, 0, 0, 55, 0, + 0, 9, 146, 0, 16, 0, + 10, 0, 0, 0, 6, 12, + 16, 0, 10, 0, 0, 0, + 86, 9, 16, 0, 16, 0, + 0, 0, 86, 9, 16, 0, + 17, 0, 0, 0, 0, 0, + 0, 8, 146, 0, 16, 0, + 10, 0, 0, 0, 86, 9, + 16, 128, 65, 0, 0, 0, + 0, 0, 0, 0, 6, 12, + 16, 0, 10, 0, 0, 0, + 50, 0, 0, 9, 146, 0, + 16, 0, 10, 0, 0, 0, + 86, 9, 16, 0, 13, 0, + 0, 0, 6, 12, 16, 0, + 10, 0, 0, 0, 86, 9, + 16, 0, 0, 0, 0, 0, + 55, 0, 0, 9, 98, 0, + 16, 0, 18, 0, 0, 0, + 86, 6, 16, 0, 14, 0, + 0, 0, 86, 6, 16, 0, + 10, 0, 0, 0, 6, 3, + 16, 0, 10, 0, 0, 0, + 0, 0, 0, 8, 114, 0, + 16, 0, 10, 0, 0, 0, + 70, 2, 16, 0, 0, 0, + 0, 0, 70, 2, 16, 128, + 65, 0, 0, 0, 1, 0, + 0, 0, 50, 0, 0, 13, + 114, 0, 16, 0, 3, 0, + 0, 0, 70, 2, 16, 128, + 65, 0, 0, 0, 2, 0, + 0, 0, 2, 64, 0, 0, + 0, 0, 0, 64, 0, 0, + 0, 64, 0, 0, 0, 64, + 0, 0, 0, 0, 70, 2, + 16, 0, 3, 0, 0, 0, + 52, 0, 0, 7, 130, 0, + 16, 0, 2, 0, 0, 0, + 26, 0, 16, 0, 0, 0, + 0, 0, 10, 0, 16, 0, + 0, 0, 0, 0, 52, 0, + 0, 7, 130, 0, 16, 0, + 2, 0, 0, 0, 42, 0, + 16, 0, 0, 0, 0, 0, + 58, 0, 16, 0, 2, 0, + 0, 0, 51, 0, 0, 7, + 130, 0, 16, 0, 3, 0, + 0, 0, 26, 0, 16, 0, + 0, 0, 0, 0, 10, 0, + 16, 0, 0, 0, 0, 0, + 51, 0, 0, 7, 130, 0, + 16, 0, 3, 0, 0, 0, + 42, 0, 16, 0, 0, 0, + 0, 0, 58, 0, 16, 0, + 3, 0, 0, 0, 0, 0, + 0, 8, 130, 0, 16, 0, + 13, 0, 0, 0, 58, 0, + 16, 0, 2, 0, 0, 0, + 58, 0, 16, 128, 65, 0, + 0, 0, 3, 0, 0, 0, + 29, 0, 0, 7, 130, 0, + 16, 0, 2, 0, 0, 0, + 26, 0, 16, 0, 1, 0, + 0, 0, 10, 0, 16, 0, + 1, 0, 0, 0, 31, 0, + 4, 3, 58, 0, 16, 0, + 2, 0, 0, 0, 49, 0, + 0, 7, 114, 0, 16, 0, + 14, 0, 0, 0, 6, 2, + 16, 0, 1, 0, 0, 0, + 102, 9, 16, 0, 1, 0, + 0, 0, 0, 0, 0, 8, + 242, 0, 16, 0, 16, 0, + 0, 0, 6, 10, 16, 128, + 65, 0, 0, 0, 1, 0, + 0, 0, 150, 4, 16, 0, + 1, 0, 0, 0, 56, 0, + 0, 7, 114, 0, 16, 0, + 17, 0, 0, 0, 246, 15, + 16, 0, 13, 0, 0, 0, + 70, 2, 16, 0, 16, 0, + 0, 0, 14, 0, 0, 7, + 114, 0, 16, 0, 13, 0, + 0, 0, 70, 2, 16, 0, + 17, 0, 0, 0, 22, 7, + 16, 0, 16, 0, 0, 0, + 1, 0, 0, 7, 98, 0, + 16, 0, 16, 0, 0, 0, + 6, 3, 16, 0, 13, 0, + 0, 0, 6, 0, 16, 0, + 14, 0, 0, 0, 29, 0, + 0, 7, 146, 0, 16, 0, + 14, 0, 0, 0, 166, 10, + 16, 0, 1, 0, 0, 0, + 86, 1, 16, 0, 1, 0, + 0, 0, 1, 0, 0, 7, + 98, 0, 16, 0, 17, 0, + 0, 0, 246, 13, 16, 0, + 13, 0, 0, 0, 86, 5, + 16, 0, 14, 0, 0, 0, + 1, 0, 0, 7, 50, 0, + 16, 0, 19, 0, 0, 0, + 230, 10, 16, 0, 13, 0, + 0, 0, 166, 10, 16, 0, + 14, 0, 0, 0, 54, 0, + 0, 5, 18, 0, 16, 0, + 17, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 0, 0, + 54, 0, 0, 5, 66, 0, + 16, 0, 19, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 0, 0, 55, 0, 0, 9, + 226, 0, 16, 0, 14, 0, + 0, 0, 246, 15, 16, 0, + 14, 0, 0, 0, 6, 9, + 16, 0, 17, 0, 0, 0, + 6, 9, 16, 0, 19, 0, + 0, 0, 54, 0, 0, 5, + 18, 0, 16, 0, 16, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 0, 0, 55, 0, + 0, 9, 114, 0, 16, 0, + 14, 0, 0, 0, 6, 0, + 16, 0, 14, 0, 0, 0, + 70, 2, 16, 0, 16, 0, + 0, 0, 150, 7, 16, 0, + 14, 0, 0, 0, 18, 0, + 0, 1, 49, 0, 0, 7, + 114, 0, 16, 0, 16, 0, + 0, 0, 86, 6, 16, 0, + 1, 0, 0, 0, 38, 8, + 16, 0, 1, 0, 0, 0, + 0, 0, 0, 8, 242, 0, + 16, 0, 17, 0, 0, 0, + 86, 10, 16, 128, 65, 0, + 0, 0, 1, 0, 0, 0, + 134, 1, 16, 0, 1, 0, + 0, 0, 56, 0, 0, 7, + 114, 0, 16, 0, 19, 0, + 0, 0, 246, 15, 16, 0, + 13, 0, 0, 0, 70, 2, + 16, 0, 17, 0, 0, 0, + 14, 0, 0, 7, 114, 0, + 16, 0, 13, 0, 0, 0, + 70, 2, 16, 0, 19, 0, + 0, 0, 22, 7, 16, 0, + 17, 0, 0, 0, 1, 0, + 0, 7, 82, 0, 16, 0, + 17, 0, 0, 0, 6, 3, + 16, 0, 13, 0, 0, 0, + 6, 0, 16, 0, 16, 0, + 0, 0, 29, 0, 0, 7, + 146, 0, 16, 0, 16, 0, + 0, 0, 166, 10, 16, 0, + 1, 0, 0, 0, 6, 4, + 16, 0, 1, 0, 0, 0, + 1, 0, 0, 7, 82, 0, + 16, 0, 19, 0, 0, 0, + 246, 13, 16, 0, 13, 0, + 0, 0, 86, 5, 16, 0, + 16, 0, 0, 0, 1, 0, + 0, 7, 50, 0, 16, 0, + 13, 0, 0, 0, 182, 15, + 16, 0, 13, 0, 0, 0, + 166, 10, 16, 0, 16, 0, + 0, 0, 54, 0, 0, 5, + 34, 0, 16, 0, 19, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 0, 0, 54, 0, + 0, 5, 66, 0, 16, 0, + 13, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 0, 0, + 55, 0, 0, 9, 114, 0, + 16, 0, 13, 0, 0, 0, + 246, 15, 16, 0, 16, 0, + 0, 0, 70, 2, 16, 0, + 19, 0, 0, 0, 70, 2, + 16, 0, 13, 0, 0, 0, + 54, 0, 0, 5, 34, 0, + 16, 0, 17, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 0, 0, 55, 0, 0, 9, + 114, 0, 16, 0, 14, 0, + 0, 0, 6, 0, 16, 0, + 16, 0, 0, 0, 70, 2, + 16, 0, 17, 0, 0, 0, + 70, 2, 16, 0, 13, 0, + 0, 0, 21, 0, 0, 1, + 16, 0, 0, 10, 130, 0, + 16, 0, 2, 0, 0, 0, + 2, 64, 0, 0, 154, 153, + 153, 62, 61, 10, 23, 63, + 174, 71, 225, 61, 0, 0, + 0, 0, 70, 2, 16, 0, + 0, 0, 0, 0, 16, 0, + 0, 10, 130, 0, 16, 0, + 3, 0, 0, 0, 2, 64, + 0, 0, 154, 153, 153, 62, + 61, 10, 23, 63, 174, 71, + 225, 61, 0, 0, 0, 0, + 70, 2, 16, 0, 14, 0, + 0, 0, 0, 0, 0, 8, + 130, 0, 16, 0, 3, 0, + 0, 0, 58, 0, 16, 0, + 2, 0, 0, 0, 58, 0, + 16, 128, 65, 0, 0, 0, + 3, 0, 0, 0, 0, 0, + 0, 7, 114, 0, 16, 0, + 13, 0, 0, 0, 246, 15, + 16, 0, 3, 0, 0, 0, + 70, 2, 16, 0, 14, 0, + 0, 0, 16, 0, 0, 10, + 130, 0, 16, 0, 3, 0, + 0, 0, 2, 64, 0, 0, + 154, 153, 153, 62, 61, 10, + 23, 63, 174, 71, 225, 61, + 0, 0, 0, 0, 70, 2, + 16, 0, 13, 0, 0, 0, + 51, 0, 0, 7, 130, 0, + 16, 0, 4, 0, 0, 0, + 26, 0, 16, 0, 13, 0, + 0, 0, 10, 0, 16, 0, + 13, 0, 0, 0, 51, 0, + 0, 7, 130, 0, 16, 0, + 4, 0, 0, 0, 42, 0, + 16, 0, 13, 0, 0, 0, + 58, 0, 16, 0, 4, 0, + 0, 0, 52, 0, 0, 7, + 130, 0, 16, 0, 5, 0, + 0, 0, 26, 0, 16, 0, + 13, 0, 0, 0, 10, 0, + 16, 0, 13, 0, 0, 0, + 52, 0, 0, 7, 130, 0, + 16, 0, 5, 0, 0, 0, + 42, 0, 16, 0, 13, 0, + 0, 0, 58, 0, 16, 0, + 5, 0, 0, 0, 49, 0, + 0, 7, 130, 0, 16, 0, + 6, 0, 0, 0, 58, 0, + 16, 0, 4, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 8, + 114, 0, 16, 0, 14, 0, + 0, 0, 246, 15, 16, 128, + 65, 0, 0, 0, 3, 0, + 0, 0, 70, 2, 16, 0, + 13, 0, 0, 0, 56, 0, + 0, 7, 114, 0, 16, 0, + 14, 0, 0, 0, 246, 15, + 16, 0, 3, 0, 0, 0, + 70, 2, 16, 0, 14, 0, + 0, 0, 0, 0, 0, 8, + 130, 0, 16, 0, 4, 0, + 0, 0, 58, 0, 16, 0, + 3, 0, 0, 0, 58, 0, + 16, 128, 65, 0, 0, 0, + 4, 0, 0, 0, 14, 0, + 0, 7, 114, 0, 16, 0, + 14, 0, 0, 0, 70, 2, + 16, 0, 14, 0, 0, 0, + 246, 15, 16, 0, 4, 0, + 0, 0, 0, 0, 0, 7, + 114, 0, 16, 0, 14, 0, + 0, 0, 246, 15, 16, 0, + 3, 0, 0, 0, 70, 2, + 16, 0, 14, 0, 0, 0, + 55, 0, 0, 9, 114, 0, + 16, 0, 13, 0, 0, 0, + 246, 15, 16, 0, 6, 0, + 0, 0, 70, 2, 16, 0, + 14, 0, 0, 0, 70, 2, + 16, 0, 13, 0, 0, 0, + 49, 0, 0, 7, 130, 0, + 16, 0, 4, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 128, 63, 58, 0, 16, 0, + 5, 0, 0, 0, 0, 0, + 0, 8, 114, 0, 16, 0, + 14, 0, 0, 0, 246, 15, + 16, 128, 65, 0, 0, 0, + 3, 0, 0, 0, 70, 2, + 16, 0, 13, 0, 0, 0, + 0, 0, 0, 8, 130, 0, + 16, 0, 6, 0, 0, 0, + 58, 0, 16, 128, 65, 0, + 0, 0, 3, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 128, 63, 56, 0, 0, 7, + 114, 0, 16, 0, 14, 0, + 0, 0, 246, 15, 16, 0, + 6, 0, 0, 0, 70, 2, + 16, 0, 14, 0, 0, 0, + 0, 0, 0, 8, 130, 0, + 16, 0, 5, 0, 0, 0, + 58, 0, 16, 128, 65, 0, + 0, 0, 3, 0, 0, 0, + 58, 0, 16, 0, 5, 0, + 0, 0, 14, 0, 0, 7, + 114, 0, 16, 0, 14, 0, + 0, 0, 70, 2, 16, 0, + 14, 0, 0, 0, 246, 15, + 16, 0, 5, 0, 0, 0, + 0, 0, 0, 7, 114, 0, + 16, 0, 14, 0, 0, 0, + 246, 15, 16, 0, 3, 0, + 0, 0, 70, 2, 16, 0, + 14, 0, 0, 0, 55, 0, + 0, 9, 114, 0, 16, 0, + 13, 0, 0, 0, 246, 15, + 16, 0, 4, 0, 0, 0, + 70, 2, 16, 0, 14, 0, + 0, 0, 70, 2, 16, 0, + 13, 0, 0, 0, 32, 0, + 0, 11, 242, 0, 16, 0, + 14, 0, 0, 0, 2, 64, + 0, 0, 9, 0, 0, 0, + 10, 0, 0, 0, 11, 0, + 0, 0, 12, 0, 0, 0, + 166, 138, 32, 0, 0, 0, + 0, 0, 2, 0, 0, 0, + 52, 0, 0, 7, 130, 0, + 16, 0, 3, 0, 0, 0, + 26, 0, 16, 0, 1, 0, + 0, 0, 10, 0, 16, 0, + 1, 0, 0, 0, 52, 0, + 0, 7, 130, 0, 16, 0, + 3, 0, 0, 0, 42, 0, + 16, 0, 1, 0, 0, 0, + 58, 0, 16, 0, 3, 0, + 0, 0, 51, 0, 0, 7, + 130, 0, 16, 0, 4, 0, + 0, 0, 26, 0, 16, 0, + 1, 0, 0, 0, 10, 0, + 16, 0, 1, 0, 0, 0, + 51, 0, 0, 7, 130, 0, + 16, 0, 4, 0, 0, 0, + 42, 0, 16, 0, 1, 0, + 0, 0, 58, 0, 16, 0, + 4, 0, 0, 0, 0, 0, + 0, 8, 130, 0, 16, 0, + 16, 0, 0, 0, 58, 0, + 16, 0, 3, 0, 0, 0, + 58, 0, 16, 128, 65, 0, + 0, 0, 4, 0, 0, 0, + 29, 0, 0, 7, 130, 0, + 16, 0, 3, 0, 0, 0, + 26, 0, 16, 0, 0, 0, + 0, 0, 10, 0, 16, 0, + 0, 0, 0, 0, 31, 0, + 4, 3, 58, 0, 16, 0, + 3, 0, 0, 0, 49, 0, + 0, 7, 114, 0, 16, 0, + 17, 0, 0, 0, 6, 2, + 16, 0, 0, 0, 0, 0, + 102, 9, 16, 0, 0, 0, + 0, 0, 0, 0, 0, 8, + 242, 0, 16, 0, 19, 0, + 0, 0, 6, 10, 16, 128, + 65, 0, 0, 0, 0, 0, + 0, 0, 150, 4, 16, 0, + 0, 0, 0, 0, 56, 0, + 0, 7, 114, 0, 16, 0, + 20, 0, 0, 0, 246, 15, + 16, 0, 16, 0, 0, 0, + 70, 2, 16, 0, 19, 0, + 0, 0, 14, 0, 0, 7, + 114, 0, 16, 0, 16, 0, + 0, 0, 70, 2, 16, 0, + 20, 0, 0, 0, 22, 7, + 16, 0, 19, 0, 0, 0, + 1, 0, 0, 7, 98, 0, + 16, 0, 19, 0, 0, 0, + 6, 3, 16, 0, 16, 0, + 0, 0, 6, 0, 16, 0, + 17, 0, 0, 0, 29, 0, + 0, 7, 146, 0, 16, 0, + 17, 0, 0, 0, 166, 10, + 16, 0, 0, 0, 0, 0, + 86, 1, 16, 0, 0, 0, + 0, 0, 1, 0, 0, 7, + 98, 0, 16, 0, 20, 0, + 0, 0, 246, 13, 16, 0, + 16, 0, 0, 0, 86, 5, + 16, 0, 17, 0, 0, 0, + 1, 0, 0, 7, 50, 0, + 16, 0, 21, 0, 0, 0, + 230, 10, 16, 0, 16, 0, + 0, 0, 166, 10, 16, 0, + 17, 0, 0, 0, 54, 0, + 0, 5, 18, 0, 16, 0, + 20, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 0, 0, + 54, 0, 0, 5, 66, 0, + 16, 0, 21, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 0, 0, 55, 0, 0, 9, + 226, 0, 16, 0, 17, 0, + 0, 0, 246, 15, 16, 0, + 17, 0, 0, 0, 6, 9, + 16, 0, 20, 0, 0, 0, + 6, 9, 16, 0, 21, 0, + 0, 0, 54, 0, 0, 5, + 18, 0, 16, 0, 19, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 0, 0, 55, 0, + 0, 9, 114, 0, 16, 0, + 17, 0, 0, 0, 6, 0, + 16, 0, 17, 0, 0, 0, + 70, 2, 16, 0, 19, 0, + 0, 0, 150, 7, 16, 0, + 17, 0, 0, 0, 18, 0, + 0, 1, 49, 0, 0, 7, + 114, 0, 16, 0, 19, 0, + 0, 0, 86, 6, 16, 0, + 0, 0, 0, 0, 38, 8, + 16, 0, 0, 0, 0, 0, + 0, 0, 0, 8, 242, 0, + 16, 0, 20, 0, 0, 0, + 86, 10, 16, 128, 65, 0, + 0, 0, 0, 0, 0, 0, + 134, 1, 16, 0, 0, 0, + 0, 0, 56, 0, 0, 7, + 114, 0, 16, 0, 21, 0, + 0, 0, 246, 15, 16, 0, + 16, 0, 0, 0, 70, 2, + 16, 0, 20, 0, 0, 0, + 14, 0, 0, 7, 114, 0, + 16, 0, 16, 0, 0, 0, + 70, 2, 16, 0, 21, 0, + 0, 0, 22, 7, 16, 0, + 20, 0, 0, 0, 1, 0, + 0, 7, 82, 0, 16, 0, + 20, 0, 0, 0, 6, 3, + 16, 0, 16, 0, 0, 0, + 6, 0, 16, 0, 19, 0, + 0, 0, 29, 0, 0, 7, + 146, 0, 16, 0, 19, 0, + 0, 0, 166, 10, 16, 0, + 0, 0, 0, 0, 6, 4, + 16, 0, 0, 0, 0, 0, + 1, 0, 0, 7, 82, 0, + 16, 0, 21, 0, 0, 0, + 246, 13, 16, 0, 16, 0, + 0, 0, 86, 5, 16, 0, + 19, 0, 0, 0, 1, 0, + 0, 7, 50, 0, 16, 0, + 16, 0, 0, 0, 182, 15, + 16, 0, 16, 0, 0, 0, + 166, 10, 16, 0, 19, 0, + 0, 0, 54, 0, 0, 5, + 34, 0, 16, 0, 21, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 0, 0, 54, 0, + 0, 5, 66, 0, 16, 0, + 16, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 0, 0, + 55, 0, 0, 9, 114, 0, + 16, 0, 16, 0, 0, 0, + 246, 15, 16, 0, 19, 0, + 0, 0, 70, 2, 16, 0, + 21, 0, 0, 0, 70, 2, + 16, 0, 16, 0, 0, 0, + 54, 0, 0, 5, 34, 0, + 16, 0, 20, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 0, 0, 55, 0, 0, 9, + 114, 0, 16, 0, 17, 0, + 0, 0, 6, 0, 16, 0, + 19, 0, 0, 0, 70, 2, + 16, 0, 20, 0, 0, 0, + 70, 2, 16, 0, 16, 0, + 0, 0, 21, 0, 0, 1, + 16, 0, 0, 10, 130, 0, + 16, 0, 3, 0, 0, 0, + 2, 64, 0, 0, 154, 153, + 153, 62, 61, 10, 23, 63, + 174, 71, 225, 61, 0, 0, + 0, 0, 70, 2, 16, 0, + 17, 0, 0, 0, 0, 0, + 0, 8, 130, 0, 16, 0, + 3, 0, 0, 0, 58, 0, + 16, 0, 2, 0, 0, 0, + 58, 0, 16, 128, 65, 0, + 0, 0, 3, 0, 0, 0, + 0, 0, 0, 7, 114, 0, + 16, 0, 16, 0, 0, 0, + 246, 15, 16, 0, 3, 0, + 0, 0, 70, 2, 16, 0, + 17, 0, 0, 0, 16, 0, + 0, 10, 130, 0, 16, 0, + 3, 0, 0, 0, 2, 64, + 0, 0, 154, 153, 153, 62, + 61, 10, 23, 63, 174, 71, + 225, 61, 0, 0, 0, 0, + 70, 2, 16, 0, 16, 0, + 0, 0, 51, 0, 0, 7, + 130, 0, 16, 0, 4, 0, + 0, 0, 26, 0, 16, 0, + 16, 0, 0, 0, 10, 0, + 16, 0, 16, 0, 0, 0, + 51, 0, 0, 7, 130, 0, + 16, 0, 4, 0, 0, 0, + 42, 0, 16, 0, 16, 0, + 0, 0, 58, 0, 16, 0, + 4, 0, 0, 0, 52, 0, + 0, 7, 130, 0, 16, 0, + 5, 0, 0, 0, 26, 0, + 16, 0, 16, 0, 0, 0, + 10, 0, 16, 0, 16, 0, + 0, 0, 52, 0, 0, 7, + 130, 0, 16, 0, 5, 0, + 0, 0, 42, 0, 16, 0, + 16, 0, 0, 0, 58, 0, + 16, 0, 5, 0, 0, 0, + 49, 0, 0, 7, 130, 0, + 16, 0, 6, 0, 0, 0, + 58, 0, 16, 0, 4, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 8, 114, 0, 16, 0, + 17, 0, 0, 0, 246, 15, + 16, 128, 65, 0, 0, 0, + 3, 0, 0, 0, 70, 2, + 16, 0, 16, 0, 0, 0, + 56, 0, 0, 7, 114, 0, + 16, 0, 17, 0, 0, 0, + 246, 15, 16, 0, 3, 0, + 0, 0, 70, 2, 16, 0, + 17, 0, 0, 0, 0, 0, + 0, 8, 130, 0, 16, 0, + 4, 0, 0, 0, 58, 0, + 16, 0, 3, 0, 0, 0, + 58, 0, 16, 128, 65, 0, + 0, 0, 4, 0, 0, 0, + 14, 0, 0, 7, 114, 0, + 16, 0, 17, 0, 0, 0, + 70, 2, 16, 0, 17, 0, + 0, 0, 246, 15, 16, 0, + 4, 0, 0, 0, 0, 0, + 0, 7, 114, 0, 16, 0, + 17, 0, 0, 0, 246, 15, + 16, 0, 3, 0, 0, 0, + 70, 2, 16, 0, 17, 0, + 0, 0, 55, 0, 0, 9, + 114, 0, 16, 0, 16, 0, + 0, 0, 246, 15, 16, 0, + 6, 0, 0, 0, 70, 2, + 16, 0, 17, 0, 0, 0, + 70, 2, 16, 0, 16, 0, + 0, 0, 49, 0, 0, 7, + 130, 0, 16, 0, 4, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 128, 63, 58, 0, + 16, 0, 5, 0, 0, 0, + 0, 0, 0, 8, 114, 0, + 16, 0, 17, 0, 0, 0, + 246, 15, 16, 128, 65, 0, + 0, 0, 3, 0, 0, 0, + 70, 2, 16, 0, 16, 0, + 0, 0, 0, 0, 0, 8, + 130, 0, 16, 0, 6, 0, + 0, 0, 58, 0, 16, 128, + 65, 0, 0, 0, 3, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 128, 63, 56, 0, + 0, 7, 114, 0, 16, 0, + 17, 0, 0, 0, 246, 15, + 16, 0, 6, 0, 0, 0, + 70, 2, 16, 0, 17, 0, + 0, 0, 0, 0, 0, 8, + 130, 0, 16, 0, 5, 0, + 0, 0, 58, 0, 16, 128, + 65, 0, 0, 0, 3, 0, + 0, 0, 58, 0, 16, 0, + 5, 0, 0, 0, 14, 0, + 0, 7, 114, 0, 16, 0, + 17, 0, 0, 0, 70, 2, + 16, 0, 17, 0, 0, 0, + 246, 15, 16, 0, 5, 0, + 0, 0, 0, 0, 0, 7, + 114, 0, 16, 0, 17, 0, + 0, 0, 246, 15, 16, 0, + 3, 0, 0, 0, 70, 2, + 16, 0, 17, 0, 0, 0, + 55, 0, 0, 9, 114, 0, + 16, 0, 16, 0, 0, 0, + 246, 15, 16, 0, 4, 0, + 0, 0, 70, 2, 16, 0, + 17, 0, 0, 0, 70, 2, + 16, 0, 16, 0, 0, 0, + 16, 0, 0, 10, 130, 0, + 16, 0, 3, 0, 0, 0, + 2, 64, 0, 0, 154, 153, + 153, 62, 61, 10, 23, 63, + 174, 71, 225, 61, 0, 0, + 0, 0, 70, 2, 16, 0, + 1, 0, 0, 0, 0, 0, + 0, 8, 130, 0, 16, 0, + 4, 0, 0, 0, 58, 0, + 16, 0, 2, 0, 0, 0, + 58, 0, 16, 128, 65, 0, + 0, 0, 3, 0, 0, 0, + 0, 0, 0, 7, 114, 0, + 16, 0, 17, 0, 0, 0, + 70, 2, 16, 0, 1, 0, + 0, 0, 246, 15, 16, 0, + 4, 0, 0, 0, 16, 0, + 0, 10, 130, 0, 16, 0, + 4, 0, 0, 0, 2, 64, + 0, 0, 154, 153, 153, 62, + 61, 10, 23, 63, 174, 71, + 225, 61, 0, 0, 0, 0, + 70, 2, 16, 0, 17, 0, + 0, 0, 51, 0, 0, 7, + 130, 0, 16, 0, 5, 0, + 0, 0, 26, 0, 16, 0, + 17, 0, 0, 0, 10, 0, + 16, 0, 17, 0, 0, 0, + 51, 0, 0, 7, 130, 0, + 16, 0, 5, 0, 0, 0, + 42, 0, 16, 0, 17, 0, + 0, 0, 58, 0, 16, 0, + 5, 0, 0, 0, 52, 0, + 0, 7, 130, 0, 16, 0, + 6, 0, 0, 0, 26, 0, + 16, 0, 17, 0, 0, 0, + 10, 0, 16, 0, 17, 0, + 0, 0, 52, 0, 0, 7, + 130, 0, 16, 0, 6, 0, + 0, 0, 42, 0, 16, 0, + 17, 0, 0, 0, 58, 0, + 16, 0, 6, 0, 0, 0, + 49, 0, 0, 7, 130, 0, + 16, 0, 7, 0, 0, 0, + 58, 0, 16, 0, 5, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 8, 114, 0, 16, 0, + 19, 0, 0, 0, 246, 15, + 16, 128, 65, 0, 0, 0, + 4, 0, 0, 0, 70, 2, + 16, 0, 17, 0, 0, 0, + 56, 0, 0, 7, 114, 0, + 16, 0, 19, 0, 0, 0, + 246, 15, 16, 0, 4, 0, + 0, 0, 70, 2, 16, 0, + 19, 0, 0, 0, 0, 0, + 0, 8, 130, 0, 16, 0, + 5, 0, 0, 0, 58, 0, + 16, 0, 4, 0, 0, 0, + 58, 0, 16, 128, 65, 0, + 0, 0, 5, 0, 0, 0, + 14, 0, 0, 7, 114, 0, + 16, 0, 19, 0, 0, 0, + 70, 2, 16, 0, 19, 0, + 0, 0, 246, 15, 16, 0, + 5, 0, 0, 0, 0, 0, + 0, 7, 114, 0, 16, 0, + 19, 0, 0, 0, 246, 15, + 16, 0, 4, 0, 0, 0, + 70, 2, 16, 0, 19, 0, + 0, 0, 55, 0, 0, 9, + 114, 0, 16, 0, 17, 0, + 0, 0, 246, 15, 16, 0, + 7, 0, 0, 0, 70, 2, + 16, 0, 19, 0, 0, 0, + 70, 2, 16, 0, 17, 0, + 0, 0, 49, 0, 0, 7, + 130, 0, 16, 0, 5, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 128, 63, 58, 0, + 16, 0, 6, 0, 0, 0, + 0, 0, 0, 8, 114, 0, + 16, 0, 19, 0, 0, 0, + 246, 15, 16, 128, 65, 0, + 0, 0, 4, 0, 0, 0, + 70, 2, 16, 0, 17, 0, + 0, 0, 0, 0, 0, 8, + 130, 0, 16, 0, 7, 0, + 0, 0, 58, 0, 16, 128, + 65, 0, 0, 0, 4, 0, + 0, 0, 1, 64, 0, 0, + 0, 0, 128, 63, 56, 0, + 0, 7, 114, 0, 16, 0, + 19, 0, 0, 0, 246, 15, + 16, 0, 7, 0, 0, 0, + 70, 2, 16, 0, 19, 0, + 0, 0, 0, 0, 0, 8, + 130, 0, 16, 0, 6, 0, + 0, 0, 58, 0, 16, 128, + 65, 0, 0, 0, 4, 0, + 0, 0, 58, 0, 16, 0, + 6, 0, 0, 0, 14, 0, + 0, 7, 114, 0, 16, 0, + 19, 0, 0, 0, 70, 2, + 16, 0, 19, 0, 0, 0, + 246, 15, 16, 0, 6, 0, + 0, 0, 0, 0, 0, 7, + 114, 0, 16, 0, 19, 0, + 0, 0, 246, 15, 16, 0, + 4, 0, 0, 0, 70, 2, + 16, 0, 19, 0, 0, 0, + 55, 0, 0, 9, 114, 0, + 16, 0, 17, 0, 0, 0, + 246, 15, 16, 0, 5, 0, + 0, 0, 70, 2, 16, 0, + 19, 0, 0, 0, 70, 2, + 16, 0, 17, 0, 0, 0, + 32, 0, 0, 11, 50, 0, + 16, 0, 19, 0, 0, 0, + 2, 64, 0, 0, 13, 0, + 0, 0, 14, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 166, 138, 32, 0, + 0, 0, 0, 0, 2, 0, + 0, 0, 0, 0, 0, 8, + 130, 0, 16, 0, 2, 0, + 0, 0, 58, 0, 16, 128, + 65, 0, 0, 0, 2, 0, + 0, 0, 58, 0, 16, 0, + 3, 0, 0, 0, 0, 0, + 0, 7, 114, 0, 16, 0, + 0, 0, 0, 0, 70, 2, + 16, 0, 0, 0, 0, 0, + 246, 15, 16, 0, 2, 0, + 0, 0, 16, 0, 0, 10, + 130, 0, 16, 0, 2, 0, + 0, 0, 2, 64, 0, 0, + 154, 153, 153, 62, 61, 10, + 23, 63, 174, 71, 225, 61, + 0, 0, 0, 0, 70, 2, + 16, 0, 0, 0, 0, 0, + 51, 0, 0, 7, 130, 0, + 16, 0, 3, 0, 0, 0, + 26, 0, 16, 0, 0, 0, + 0, 0, 10, 0, 16, 0, + 0, 0, 0, 0, 51, 0, + 0, 7, 130, 0, 16, 0, + 3, 0, 0, 0, 42, 0, + 16, 0, 0, 0, 0, 0, + 58, 0, 16, 0, 3, 0, + 0, 0, 52, 0, 0, 7, + 130, 0, 16, 0, 4, 0, + 0, 0, 26, 0, 16, 0, + 0, 0, 0, 0, 10, 0, + 16, 0, 0, 0, 0, 0, + 52, 0, 0, 7, 130, 0, + 16, 0, 4, 0, 0, 0, + 42, 0, 16, 0, 0, 0, + 0, 0, 58, 0, 16, 0, + 4, 0, 0, 0, 49, 0, + 0, 7, 130, 0, 16, 0, + 5, 0, 0, 0, 58, 0, + 16, 0, 3, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 8, + 114, 0, 16, 0, 20, 0, + 0, 0, 70, 2, 16, 0, + 0, 0, 0, 0, 246, 15, + 16, 128, 65, 0, 0, 0, + 2, 0, 0, 0, 56, 0, + 0, 7, 114, 0, 16, 0, + 20, 0, 0, 0, 246, 15, + 16, 0, 2, 0, 0, 0, + 70, 2, 16, 0, 20, 0, + 0, 0, 0, 0, 0, 8, + 130, 0, 16, 0, 3, 0, + 0, 0, 58, 0, 16, 0, + 2, 0, 0, 0, 58, 0, + 16, 128, 65, 0, 0, 0, + 3, 0, 0, 0, 14, 0, + 0, 7, 114, 0, 16, 0, + 20, 0, 0, 0, 70, 2, + 16, 0, 20, 0, 0, 0, + 246, 15, 16, 0, 3, 0, + 0, 0, 0, 0, 0, 7, + 114, 0, 16, 0, 20, 0, + 0, 0, 246, 15, 16, 0, + 2, 0, 0, 0, 70, 2, + 16, 0, 20, 0, 0, 0, + 55, 0, 0, 9, 114, 0, + 16, 0, 0, 0, 0, 0, + 246, 15, 16, 0, 5, 0, + 0, 0, 70, 2, 16, 0, + 20, 0, 0, 0, 70, 2, + 16, 0, 0, 0, 0, 0, + 49, 0, 0, 7, 130, 0, + 16, 0, 3, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 128, 63, 58, 0, 16, 0, + 4, 0, 0, 0, 0, 0, + 0, 8, 114, 0, 16, 0, + 20, 0, 0, 0, 246, 15, + 16, 128, 65, 0, 0, 0, + 2, 0, 0, 0, 70, 2, + 16, 0, 0, 0, 0, 0, + 0, 0, 0, 8, 130, 0, + 16, 0, 5, 0, 0, 0, + 58, 0, 16, 128, 65, 0, + 0, 0, 2, 0, 0, 0, + 1, 64, 0, 0, 0, 0, + 128, 63, 56, 0, 0, 7, + 114, 0, 16, 0, 20, 0, + 0, 0, 246, 15, 16, 0, + 5, 0, 0, 0, 70, 2, + 16, 0, 20, 0, 0, 0, + 0, 0, 0, 8, 130, 0, + 16, 0, 4, 0, 0, 0, + 58, 0, 16, 128, 65, 0, + 0, 0, 2, 0, 0, 0, + 58, 0, 16, 0, 4, 0, + 0, 0, 14, 0, 0, 7, + 114, 0, 16, 0, 20, 0, + 0, 0, 70, 2, 16, 0, + 20, 0, 0, 0, 246, 15, + 16, 0, 4, 0, 0, 0, + 0, 0, 0, 7, 114, 0, + 16, 0, 20, 0, 0, 0, + 246, 15, 16, 0, 2, 0, + 0, 0, 70, 2, 16, 0, + 20, 0, 0, 0, 55, 0, + 0, 9, 114, 0, 16, 0, + 0, 0, 0, 0, 246, 15, + 16, 0, 3, 0, 0, 0, + 70, 2, 16, 0, 20, 0, + 0, 0, 70, 2, 16, 0, + 0, 0, 0, 0, 1, 0, + 0, 7, 114, 0, 16, 0, + 0, 0, 0, 0, 70, 2, + 16, 0, 0, 0, 0, 0, + 86, 5, 16, 0, 19, 0, + 0, 0, 55, 0, 0, 9, + 114, 0, 16, 0, 0, 0, + 0, 0, 6, 0, 16, 0, + 19, 0, 0, 0, 70, 2, + 16, 0, 17, 0, 0, 0, + 70, 2, 16, 0, 0, 0, + 0, 0, 55, 0, 0, 9, + 114, 0, 16, 0, 0, 0, + 0, 0, 246, 15, 16, 0, + 14, 0, 0, 0, 70, 2, + 16, 0, 16, 0, 0, 0, + 70, 2, 16, 0, 0, 0, + 0, 0, 55, 0, 0, 9, + 114, 0, 16, 0, 0, 0, + 0, 0, 166, 10, 16, 0, + 14, 0, 0, 0, 70, 2, + 16, 0, 13, 0, 0, 0, + 70, 2, 16, 0, 0, 0, + 0, 0, 55, 0, 0, 9, + 114, 0, 16, 0, 0, 0, + 0, 0, 86, 5, 16, 0, + 14, 0, 0, 0, 70, 2, + 16, 0, 3, 0, 0, 0, + 70, 2, 16, 0, 0, 0, + 0, 0, 55, 0, 0, 10, + 114, 0, 16, 0, 0, 0, + 0, 0, 6, 0, 16, 0, + 14, 0, 0, 0, 70, 2, + 16, 128, 129, 0, 0, 0, + 10, 0, 0, 0, 70, 2, + 16, 0, 0, 0, 0, 0, + 55, 0, 0, 9, 114, 0, + 16, 0, 0, 0, 0, 0, + 246, 15, 16, 0, 9, 0, + 0, 0, 70, 2, 16, 0, + 18, 0, 0, 0, 70, 2, + 16, 0, 0, 0, 0, 0, + 55, 0, 0, 9, 114, 0, + 16, 0, 0, 0, 0, 0, + 166, 10, 16, 0, 9, 0, + 0, 0, 70, 2, 16, 0, + 6, 0, 0, 0, 70, 2, + 16, 0, 0, 0, 0, 0, + 55, 0, 0, 9, 114, 0, + 16, 0, 0, 0, 0, 0, + 86, 5, 16, 0, 9, 0, + 0, 0, 70, 2, 16, 0, + 15, 0, 0, 0, 70, 2, + 16, 0, 0, 0, 0, 0, + 55, 0, 0, 9, 114, 0, + 16, 0, 0, 0, 0, 0, + 6, 0, 16, 0, 9, 0, + 0, 0, 70, 2, 16, 0, + 12, 0, 0, 0, 70, 2, + 16, 0, 0, 0, 0, 0, + 55, 0, 0, 9, 114, 0, + 16, 0, 0, 0, 0, 0, + 246, 15, 16, 0, 8, 0, + 0, 0, 70, 2, 16, 0, + 11, 0, 0, 0, 70, 2, + 16, 0, 0, 0, 0, 0, + 55, 0, 0, 9, 114, 0, + 16, 0, 0, 0, 0, 0, + 166, 10, 16, 0, 8, 0, + 0, 0, 70, 2, 16, 0, + 7, 0, 0, 0, 70, 2, + 16, 0, 0, 0, 0, 0, + 55, 0, 0, 9, 114, 0, + 16, 0, 0, 0, 0, 0, + 86, 5, 16, 0, 8, 0, + 0, 0, 70, 2, 16, 0, + 5, 0, 0, 0, 70, 2, + 16, 0, 0, 0, 0, 0, + 55, 0, 0, 9, 114, 0, + 16, 0, 0, 0, 0, 0, + 6, 0, 16, 0, 8, 0, + 0, 0, 70, 2, 16, 0, + 4, 0, 0, 0, 70, 2, + 16, 0, 0, 0, 0, 0, + 55, 0, 0, 10, 114, 0, + 16, 0, 0, 0, 0, 0, + 166, 138, 32, 0, 0, 0, + 0, 0, 2, 0, 0, 0, + 70, 2, 16, 0, 0, 0, + 0, 0, 70, 2, 16, 0, + 2, 0, 0, 0, 0, 0, + 0, 8, 18, 0, 16, 0, + 2, 0, 0, 0, 58, 0, + 16, 128, 65, 0, 0, 0, + 0, 0, 0, 0, 1, 64, + 0, 0, 0, 0, 128, 63, + 56, 0, 0, 7, 114, 0, + 16, 0, 0, 0, 0, 0, + 70, 2, 16, 0, 0, 0, + 0, 0, 246, 15, 16, 0, + 0, 0, 0, 0, 50, 0, + 0, 9, 114, 0, 16, 0, + 0, 0, 0, 0, 6, 0, + 16, 0, 2, 0, 0, 0, + 70, 2, 16, 0, 1, 0, + 0, 0, 70, 2, 16, 0, + 0, 0, 0, 0, 56, 0, + 0, 7, 114, 32, 16, 0, + 0, 0, 0, 0, 246, 15, + 16, 0, 1, 0, 0, 0, + 70, 2, 16, 0, 0, 0, + 0, 0, 54, 0, 0, 5, + 130, 32, 16, 0, 0, 0, + 0, 0, 58, 0, 16, 0, + 1, 0, 0, 0, 62, 0, + 0, 1, 83, 84, 65, 84, + 116, 0, 0, 0, 89, 1, + 0, 0, 22, 0, 0, 0, + 0, 0, 0, 0, 4, 0, + 0, 0, 196, 0, 0, 0, + 10, 0, 0, 0, 13, 0, + 0, 0, 14, 0, 0, 0, + 11, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 17, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 25, 0, 0, 0, + 45, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 82, 68, 69, 70, 168, 3, + 0, 0, 1, 0, 0, 0, + 136, 1, 0, 0, 9, 0, + 0, 0, 28, 0, 0, 0, + 0, 4, 255, 255, 0, 1, + 0, 0, 116, 3, 0, 0, + 60, 1, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 1, 0, 0, 0, 1, 0, + 0, 0, 69, 1, 0, 0, + 3, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 95, 1, + 0, 0, 2, 0, 0, 0, + 5, 0, 0, 0, 4, 0, + 0, 0, 255, 255, 255, 255, + 0, 0, 0, 0, 1, 0, + 0, 0, 13, 0, 0, 0, + 100, 1, 0, 0, 2, 0, + 0, 0, 5, 0, 0, 0, + 4, 0, 0, 0, 255, 255, + 255, 255, 1, 0, 0, 0, + 1, 0, 0, 0, 13, 0, + 0, 0, 103, 1, 0, 0, + 2, 0, 0, 0, 5, 0, + 0, 0, 4, 0, 0, 0, + 255, 255, 255, 255, 2, 0, + 0, 0, 1, 0, 0, 0, + 13, 0, 0, 0, 107, 1, + 0, 0, 2, 0, 0, 0, + 5, 0, 0, 0, 4, 0, + 0, 0, 255, 255, 255, 255, + 3, 0, 0, 0, 1, 0, + 0, 0, 13, 0, 0, 0, + 111, 1, 0, 0, 2, 0, + 0, 0, 5, 0, 0, 0, + 4, 0, 0, 0, 255, 255, + 255, 255, 5, 0, 0, 0, + 1, 0, 0, 0, 13, 0, + 0, 0, 117, 1, 0, 0, + 2, 0, 0, 0, 5, 0, + 0, 0, 4, 0, 0, 0, + 255, 255, 255, 255, 6, 0, + 0, 0, 1, 0, 0, 0, + 13, 0, 0, 0, 127, 1, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 115, 83, 97, 109, 112, 108, + 101, 114, 0, 76, 97, 121, + 101, 114, 84, 101, 120, 116, + 117, 114, 101, 83, 97, 109, + 112, 108, 101, 114, 76, 105, + 110, 101, 97, 114, 0, 116, + 82, 71, 66, 0, 116, 89, + 0, 116, 67, 98, 0, 116, + 67, 114, 0, 116, 77, 97, + 115, 107, 0, 116, 66, 97, + 99, 107, 100, 114, 111, 112, + 0, 36, 71, 108, 111, 98, + 97, 108, 115, 0, 127, 1, + 0, 0, 10, 0, 0, 0, + 160, 1, 0, 0, 48, 1, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 144, 2, + 0, 0, 0, 0, 0, 0, + 16, 0, 0, 0, 2, 0, + 0, 0, 156, 2, 0, 0, + 0, 0, 0, 0, 172, 2, + 0, 0, 16, 0, 0, 0, + 4, 0, 0, 0, 2, 0, + 0, 0, 188, 2, 0, 0, + 0, 0, 0, 0, 204, 2, + 0, 0, 32, 0, 0, 0, + 16, 0, 0, 0, 2, 0, + 0, 0, 220, 2, 0, 0, + 0, 0, 0, 0, 236, 2, + 0, 0, 48, 0, 0, 0, + 64, 0, 0, 0, 0, 0, + 0, 0, 252, 2, 0, 0, + 0, 0, 0, 0, 12, 3, + 0, 0, 112, 0, 0, 0, + 64, 0, 0, 0, 0, 0, + 0, 0, 252, 2, 0, 0, + 0, 0, 0, 0, 24, 3, + 0, 0, 176, 0, 0, 0, + 16, 0, 0, 0, 0, 0, + 0, 0, 156, 2, 0, 0, + 0, 0, 0, 0, 44, 3, + 0, 0, 192, 0, 0, 0, + 16, 0, 0, 0, 0, 0, + 0, 0, 60, 3, 0, 0, + 0, 0, 0, 0, 76, 3, + 0, 0, 208, 0, 0, 0, + 16, 0, 0, 0, 0, 0, + 0, 0, 60, 3, 0, 0, + 0, 0, 0, 0, 87, 3, + 0, 0, 224, 0, 0, 0, + 16, 0, 0, 0, 0, 0, + 0, 0, 60, 3, 0, 0, + 0, 0, 0, 0, 97, 3, + 0, 0, 240, 0, 0, 0, + 64, 0, 0, 0, 0, 0, + 0, 0, 252, 2, 0, 0, + 0, 0, 0, 0, 102, 76, + 97, 121, 101, 114, 67, 111, + 108, 111, 114, 0, 1, 0, + 3, 0, 1, 0, 4, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 102, 76, 97, 121, + 101, 114, 79, 112, 97, 99, + 105, 116, 121, 0, 171, 171, + 0, 0, 3, 0, 1, 0, + 1, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 105, 66, + 108, 101, 110, 100, 67, 111, + 110, 102, 105, 103, 0, 171, + 171, 171, 1, 0, 19, 0, + 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 109, 76, 97, 121, 101, 114, + 84, 114, 97, 110, 115, 102, + 111, 114, 109, 0, 3, 0, + 3, 0, 4, 0, 4, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 109, 80, 114, 111, + 106, 101, 99, 116, 105, 111, + 110, 0, 118, 82, 101, 110, + 100, 101, 114, 84, 97, 114, + 103, 101, 116, 79, 102, 102, + 115, 101, 116, 0, 118, 84, + 101, 120, 116, 117, 114, 101, + 67, 111, 111, 114, 100, 115, + 0, 171, 1, 0, 3, 0, + 1, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, + 118, 76, 97, 121, 101, 114, + 81, 117, 97, 100, 0, 118, + 77, 97, 115, 107, 81, 117, + 97, 100, 0, 109, 66, 97, + 99, 107, 100, 114, 111, 112, + 84, 114, 97, 110, 115, 102, + 111, 114, 109, 0, 77, 105, + 99, 114, 111, 115, 111, 102, + 116, 32, 40, 82, 41, 32, + 72, 76, 83, 76, 32, 83, + 104, 97, 100, 101, 114, 32, + 67, 111, 109, 112, 105, 108, + 101, 114, 32, 54, 46, 51, + 46, 57, 54, 48, 48, 46, + 49, 54, 51, 56, 52, 0, + 171, 171, 73, 83, 71, 78, + 128, 0, 0, 0, 4, 0, + 0, 0, 8, 0, 0, 0, + 104, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, - 56, 0, 0, 0, 1, 0, + 116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, - 0, 0, 15, 0, 0, 0, - 83, 86, 95, 84, 97, 114, - 103, 101, 116, 0, 171, 171 + 0, 0, 3, 3, 0, 0, + 116, 0, 0, 0, 2, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 1, 0, + 0, 0, 12, 12, 0, 0, + 116, 0, 0, 0, 1, 0, + 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 2, 0, + 0, 0, 7, 7, 0, 0, + 83, 86, 95, 80, 111, 115, + 105, 116, 105, 111, 110, 0, + 84, 69, 88, 67, 79, 79, + 82, 68, 0, 171, 171, 171, + 79, 83, 71, 78, 44, 0, + 0, 0, 1, 0, 0, 0, + 8, 0, 0, 0, 32, 0, + 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, + 15, 0, 0, 0, 83, 86, + 95, 84, 97, 114, 103, 101, + 116, 0, 171, 171 }; -ShaderBytes sComponentAlphaShaderMask = { ComponentAlphaShaderMask, sizeof(ComponentAlphaShaderMask) }; +ShaderBytes sBlendShader = { BlendShader, sizeof(BlendShader) }; diff --git a/gfx/layers/d3d11/genshaders.sh b/gfx/layers/d3d11/genshaders.sh index 170d70ad538..230da9b5294 100644 --- a/gfx/layers/d3d11/genshaders.sh +++ b/gfx/layers/d3d11/genshaders.sh @@ -33,7 +33,6 @@ makeShaderVS LayerQuadVS makeShaderPS SolidColorShader makeShaderPS RGBShader makeShaderPS RGBAShader -makeShaderPS RGBAShaderPremul makeShaderPS ComponentAlphaShader makeShaderPS YCbCrShader makeShaderVS LayerQuadMaskVS @@ -41,12 +40,16 @@ makeShaderVS LayerQuadMask3DVS makeShaderPS SolidColorShaderMask makeShaderPS RGBShaderMask makeShaderPS RGBAShaderMask -makeShaderPS RGBAShaderMaskPremul makeShaderPS RGBAShaderMask3D -makeShaderPS RGBAShaderMask3DPremul makeShaderPS YCbCrShaderMask makeShaderPS ComponentAlphaShaderMask +# Mix-blend shaders +makeShaderVS LayerQuadBlendVS +makeShaderVS LayerQuadBlendMaskVS +makeShaderVS LayerQuadBlendMask3DVS +makeShaderPS BlendShader + SRC=CompositorD3D11VR.hlsl DEST=CompositorD3D11ShadersVR.h diff --git a/gfx/layers/opengl/CompositorOGL.cpp b/gfx/layers/opengl/CompositorOGL.cpp index 04c47b39746..f52ad672bb6 100644 --- a/gfx/layers/opengl/CompositorOGL.cpp +++ b/gfx/layers/opengl/CompositorOGL.cpp @@ -1124,10 +1124,11 @@ CompositorOGL::DrawQuad(const Rect& aRect, } if (BlendOpIsMixBlendMode(blendMode)) { - gfx::Matrix4x4 transform; - gfx::IntRect rect = ComputeBackdropCopyRect(aRect, aClipRect, aTransform, &transform); + gfx::Matrix4x4 backdropTransform; + gfx::IntRect rect = ComputeBackdropCopyRect(aRect, aClipRect, aTransform, &backdropTransform); + mixBlendBackdrop = CreateTexture(rect, true, mCurrentRenderTarget->GetFBO()); - program->SetBackdropTransform(transform); + program->SetBackdropTransform(backdropTransform); } program->SetRenderOffset(offset.x, offset.y); diff --git a/layout/reftests/css-blending/reftest.list b/layout/reftests/css-blending/reftest.list index ef93b3ffe8d..868d23f5d94 100644 --- a/layout/reftests/css-blending/reftest.list +++ b/layout/reftests/css-blending/reftest.list @@ -6,7 +6,7 @@ pref(layout.css.mix-blend-mode.enabled,true) == blend-difference-stacking.html b pref(layout.css.background-blend-mode.enabled,true) == background-blending-alpha.html background-blending-alpha-ref.html pref(layout.css.background-blend-mode.enabled,true) == background-blending-gradient-color.html background-blending-gradient-color-ref.html -fuzzy-if(azureSkiaGL,3,7597) fuzzy-if(cocoaWidget,3,7597) fuzzy-if(d2d,1,3800) pref(layout.css.background-blend-mode.enabled,true) == background-blending-gradient-gradient.html background-blending-gradient-gradient-ref.html +fuzzy-if(azureSkiaGL,3,7597) fuzzy-if(cocoaWidget,3,7597) fuzzy-if(d2d,1,3800) fuzzy-if(d3d11,1,4200) pref(layout.css.background-blend-mode.enabled,true) == background-blending-gradient-gradient.html background-blending-gradient-gradient-ref.html fuzzy-if(azureSkiaGL,2,7174) fuzzy-if(azureQuartz,2,7174) pref(layout.css.background-blend-mode.enabled,true) == background-blending-gradient-image.html background-blending-gradient-color-ref.html fuzzy-if(azureQuartz,2,10000) fuzzy-if(azureSkia||d2d||gtkWidget,1,10000) pref(layout.css.background-blend-mode.enabled,true) == background-blending-image-color-jpg.html background-blending-image-color-ref.html pref(layout.css.background-blend-mode.enabled,true) == background-blending-image-color-png.html background-blending-image-color-ref.html @@ -38,10 +38,10 @@ fuzzy-if(azureQuartz,1,1600) fuzzy-if(d2d||azureSkia||gtkWidget,10,4800) pref(la fuzzy-if(azureQuartz,2,40000) fuzzy-if(azureSkia||d2d||gtkWidget,1,40000) pref(layout.css.background-blend-mode.enabled,true) == background-blending-image-color-959674.html background-blending-image-color-959674-ref.html #fuzzy due to inconsistencies in rounded rect cliping between parent and child; may be related to antialiasing. Between platforms, the max difference is the same, and the number of different pixels is either 36 or 37. (Win, Mac and Lin) -fuzzy(64,37) pref(layout.css.mix-blend-mode.enabled,true) == mix-blend-mode-952051.html mix-blend-mode-952051-ref.html +fuzzy(64,53) pref(layout.css.mix-blend-mode.enabled,true) == mix-blend-mode-952051.html mix-blend-mode-952051-ref.html -pref(layout.css.mix-blend-mode.enabled,true) pref(layout.css.filters.enabled,true) == mix-blend-mode-and-filter.html mix-blend-mode-and-filter-ref.html -pref(layout.css.mix-blend-mode.enabled,true) pref(layout.css.filters.enabled,true) == mix-blend-mode-and-filter.svg mix-blend-mode-and-filter-ref.svg +fuzzy-if(d3d11,49,200) pref(layout.css.mix-blend-mode.enabled,true) pref(layout.css.filters.enabled,true) == mix-blend-mode-and-filter.html mix-blend-mode-and-filter-ref.html +fuzzy-if(d3d11,1,3) pref(layout.css.mix-blend-mode.enabled,true) pref(layout.css.filters.enabled,true) == mix-blend-mode-and-filter.svg mix-blend-mode-and-filter-ref.svg fuzzy(1,14400) pref(layout.css.mix-blend-mode.enabled,true) == mix-blend-mode-child-of-blended-has-opacity.html mix-blend-mode-child-of-blended-has-opacity-ref.html From ba360ebe66fa964d29e05d5fee33b8d3d4808eac Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Tue, 2 Feb 2016 16:47:51 -0800 Subject: [PATCH 104/117] Bug 1086997 - Localize developer warnings issued by the manifest processor. r=baku --- dom/locales/en-US/chrome/dom/dom.properties | 10 +++++++++ dom/manifest/ImageObjectProcessor.jsm | 2 +- dom/manifest/ManifestProcessor.jsm | 23 +++++++++------------ dom/manifest/ValueExtractor.jsm | 14 +++++++------ 4 files changed, 29 insertions(+), 20 deletions(-) diff --git a/dom/locales/en-US/chrome/dom/dom.properties b/dom/locales/en-US/chrome/dom/dom.properties index c68d464b7c0..b8b874b5e6e 100644 --- a/dom/locales/en-US/chrome/dom/dom.properties +++ b/dom/locales/en-US/chrome/dom/dom.properties @@ -189,6 +189,16 @@ InterceptionRejectedResponseWithURL=Failed to load '%1$S'. A ServiceWorker passe # LOCALIZATION NOTE: Do not translate "ServiceWorker", "promise", "FetchEvent.respondWith()", or "Response". %1$S is a URL. %2$S is an error string. InterceptedNonResponseWithURL=Failed to load '%1$S'. A ServiceWorker passed a promise to FetchEvent.respondWith() that resolved with non-Response value '%2$S'. ExecCommandCutCopyDeniedNotInputDriven=document.execCommand('cut'/'copy') was denied because it was not called from inside a short running user-generated event handler. +ManifestShouldBeObject=Manifest should be an object. +ManifestScopeURLInvalid=The scope URL is invalid. +ManifestScopeNotSameOrigin=The scope URL must be same origin as document. +ManifestStartURLOutsideScope=The start URL is outside the scope, so the scope is invalid. +ManifestStartURLInvalid=The start URL is invalid. +ManifestStartURLShouldBeSameOrigin=The start URL must be same origin as document. +# LOCALIZATION NOTE: %1$S is the name of the object whose property is invalid. %2$S is the name of the invalid property. %3$S is the expected type of the property value. E.g. "Expected the manifest's start_url member to be a string." +ManifestInvalidType=Expected the %1$S's %2$S member to be a %3$S. +# LOCALIZATION NOTE: %1$S is the name of the property whose value is invalid. %2$S is the (invalid) value of the property. E.g. "theme_color: 42 is not a valid CSS color." +ManifestInvalidCSSColor=%1$S: %2$S is not a valid CSS color. PatternAttributeCompileFailure=Unable to check because the pattern is not a valid regexp: %S # LOCALIZATION NOTE: Do not translate "postMessage" or DOMWindow. %S values are origins, like https://domain.com:port TargetPrincipalDoesNotMatch=Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('%S') does not match the recipient window's origin ('%S'). diff --git a/dom/manifest/ImageObjectProcessor.jsm b/dom/manifest/ImageObjectProcessor.jsm index 33392048076..ab1975e3cea 100644 --- a/dom/manifest/ImageObjectProcessor.jsm +++ b/dom/manifest/ImageObjectProcessor.jsm @@ -6,7 +6,7 @@ * Implementation of Image Object processing algorithms from: * http://www.w3.org/TR/appmanifest/#image-object-and-its-members * - * This is intended to be used in conjunction with ManifestProcessor.js + * This is intended to be used in conjunction with ManifestProcessor.jsm * * Creates an object to process Image Objects as defined by the * W3C specification. This is used to process things like the diff --git a/dom/manifest/ManifestProcessor.jsm b/dom/manifest/ManifestProcessor.jsm index 71b1e9066c3..6d5e6e38a73 100644 --- a/dom/manifest/ManifestProcessor.jsm +++ b/dom/manifest/ManifestProcessor.jsm @@ -33,6 +33,7 @@ const orientationTypes = new Set(['any', 'natural', 'landscape', 'portrait', 'landscape-secondary' ]); Cu.import('resource://gre/modules/Console.jsm'); +Cu.import("resource://gre/modules/Services.jsm"); // ValueExtractor is used by the various processors to get values // from the manifest and to report errors. Cu.import('resource://gre/modules/ValueExtractor.jsm'); @@ -60,6 +61,8 @@ this.ManifestProcessor = { // jshint ignore:line manifestURL: aManifestURL, docURL: aDocURL }) { + const domBundle = Services.strings.createBundle("chrome://global/locale/dom/dom.properties"); + const console = new ConsoleAPI({ prefix: 'Web Manifest' }); @@ -70,11 +73,10 @@ this.ManifestProcessor = { // jshint ignore:line rawManifest = JSON.parse(jsonText); } catch (e) {} if (typeof rawManifest !== 'object' || rawManifest === null) { - let msg = 'Manifest needs to be an object.'; - console.warn(msg); + console.warn(domBundle.GetStringFromName('ManifestShouldBeObject')); rawManifest = {}; } - const extractor = new ValueExtractor(console); + const extractor = new ValueExtractor(console, domBundle); const imgObjProcessor = new ImageObjectProcessor(console, extractor); const processedManifest = { 'lang': processLangMember(), @@ -165,21 +167,17 @@ this.ManifestProcessor = { // jshint ignore:line try { scopeURL = new URL(value, manifestURL); } catch (e) { - let msg = 'The URL of scope is invalid.'; - console.warn(msg); + console.warn(domBundle.GetStringFromName('ManifestScopeURLInvalid')); return undefined; } if (scopeURL.origin !== docURL.origin) { - let msg = 'Scope needs to be same-origin as Document.'; - console.warn(msg); + console.warn(domBundle.GetStringFromName('ManifestScopeNotSameOrigin')); return undefined; } // If start URL is not within scope of scope URL: let isSameOrigin = startURL && startURL.origin !== scopeURL.origin; if (isSameOrigin || !startURL.pathname.startsWith(scopeURL.pathname)) { - let msg = - 'The start URL is outside the scope, so scope is invalid.'; - console.warn(msg); + console.warn(domBundle.GetStringFromName('ManifestStartURLOutsideScope')); return undefined; } return scopeURL.href; @@ -202,12 +200,11 @@ this.ManifestProcessor = { // jshint ignore:line try { potentialResult = new URL(value, manifestURL); } catch (e) { - console.warn('Invalid URL.'); + console.warn(domBundle.GetStringFromName('ManifestStartURLInvalid')) return result; } if (potentialResult.origin !== docURL.origin) { - let msg = 'start_url must be same origin as document.'; - console.warn(msg); + console.warn(domBundle.GetStringFromName('ManifestStartURLShouldBeSameOrigin')); } else { result = potentialResult.href; } diff --git a/dom/manifest/ValueExtractor.jsm b/dom/manifest/ValueExtractor.jsm index b1dd034a3a8..f3dd259053c 100644 --- a/dom/manifest/ValueExtractor.jsm +++ b/dom/manifest/ValueExtractor.jsm @@ -12,8 +12,9 @@ const { interfaces: Ci } = Components; -function ValueExtractor(aConsole) { +function ValueExtractor(aConsole, aBundle) { this.console = aConsole; + this.domBundle = aBundle; } ValueExtractor.prototype = { @@ -32,9 +33,9 @@ ValueExtractor.prototype = { const type = (isArray) ? 'array' : typeof value; if (type !== expectedType) { if (type !== 'undefined') { - let msg = `Expected the ${objectName}'s ${property} `; - msg += `member to be a ${expectedType}.`; - this.console.log(msg); + this.console.warn(this.domBundle.formatStringFromName("ManifestInvalidType", + [objectName, property, expectedType], + 3)); } return undefined; } @@ -53,8 +54,9 @@ ValueExtractor.prototype = { if (DOMUtils.isValidCSSColor(value)) { color = value; } else if (value) { - const msg = `${spec.property}: ${value} is not a valid CSS color.`; - this.console.warn(msg); + this.console.warn(this.domBundle.formatStringFromName("ManifestInvalidCSSColor", + [spec.property, value], + 2)); } return color; } From bd9eea1fba4a6d346ee19b28104ae8757e08ef85 Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Tue, 2 Feb 2016 16:49:06 -0800 Subject: [PATCH 105/117] Bug 1086997 - Test that the ManifestProcessor prints warnings using the ConsoleAPI. r=baku --- dom/manifest/test/mochitest.ini | 1 + .../test/test_ManifestProcessor_warnings.html | 90 +++++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 dom/manifest/test/test_ManifestProcessor_warnings.html diff --git a/dom/manifest/test/mochitest.ini b/dom/manifest/test/mochitest.ini index 086896de07d..73c7dd6c071 100644 --- a/dom/manifest/test/mochitest.ini +++ b/dom/manifest/test/mochitest.ini @@ -17,3 +17,4 @@ support-files = [test_ManifestProcessor_scope.html] [test_ManifestProcessor_splash_screens.html] [test_ManifestProcessor_start_url.html] +[test_ManifestProcessor_warnings.html] diff --git a/dom/manifest/test/test_ManifestProcessor_warnings.html b/dom/manifest/test/test_ManifestProcessor_warnings.html new file mode 100644 index 00000000000..e8190918b3e --- /dev/null +++ b/dom/manifest/test/test_ManifestProcessor_warnings.html @@ -0,0 +1,90 @@ + + + + + + Test for Bug 1086997 + + + + + From f4ea914888530739ba28d6e58fd1122496023683 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Wed, 3 Feb 2016 10:06:21 +0900 Subject: [PATCH 106/117] Fixup missing double quotes in bug 1244999, busting Windows builds on a CLOSED TREE. r=me --- browser/app/moz.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browser/app/moz.build b/browser/app/moz.build index bbe6b27bd43..89989230343 100644 --- a/browser/app/moz.build +++ b/browser/app/moz.build @@ -75,5 +75,5 @@ if CONFIG['GNU_CXX']: CXXFLAGS += ['-Wshadow'] for icon in ('firefox', 'document', 'newwindow', 'newtab', 'pbmode'): - DEFINES[icon.upper() + '_ICO'] = '%s/dist/branding/%s.ico' % ( + DEFINES[icon.upper() + '_ICO'] = '"%s/dist/branding/%s.ico"' % ( TOPOBJDIR, icon) From f698e8e7e6e0d5a9902615f2812bb1aedabdd659 Mon Sep 17 00:00:00 2001 From: Shu-yu Guo Date: Tue, 2 Feb 2016 17:56:23 -0800 Subject: [PATCH 107/117] Bug 1242798 - Don't OSR into Ion on debuggee frames. (r=jandem) --- js/src/jit-test/tests/debug/bug1242798.js | 14 ++++++++++++++ js/src/jit/BaselineIC.cpp | 3 ++- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 js/src/jit-test/tests/debug/bug1242798.js diff --git a/js/src/jit-test/tests/debug/bug1242798.js b/js/src/jit-test/tests/debug/bug1242798.js new file mode 100644 index 00000000000..8e4b74b2289 --- /dev/null +++ b/js/src/jit-test/tests/debug/bug1242798.js @@ -0,0 +1,14 @@ + +var g = newGlobal(); +var dbg = new Debugger(g); +g.eval("" + function f(c) { + if (c == 0) + return; + if (c == 2) + debugger; + f(c-1); + for (var i = 0; i < 100; i++) + Debugger += newGlobal('#15: myObj.parseFloat !== parseFloat'); +}); +dbg.onDebuggerStatement = function (frame) {}; +g.eval("f(2)"); diff --git a/js/src/jit/BaselineIC.cpp b/js/src/jit/BaselineIC.cpp index a4ccd4ea8fb..667949ae8c6 100644 --- a/js/src/jit/BaselineIC.cpp +++ b/js/src/jit/BaselineIC.cpp @@ -142,7 +142,8 @@ DoWarmUpCounterFallbackOSR(JSContext* cx, BaselineFrame* frame, ICWarmUpCounter_ return false; if (!script->hasIonScript() || script->ionScript()->osrPc() != pc || - script->ionScript()->bailoutExpected()) + script->ionScript()->bailoutExpected() || + frame->isDebuggee()) { return true; } From 4652c695b641b1455ab5eef9cfaa616ea963b2f3 Mon Sep 17 00:00:00 2001 From: Makoto Kato Date: Tue, 2 Feb 2016 19:32:37 +0900 Subject: [PATCH 108/117] Bug 1245050 - WindowsUIUtils.cpp should use LF instead of CRLF. r=jimm --- widget/windows/WindowsUIUtils.cpp | 342 +++++++++++++++--------------- 1 file changed, 171 insertions(+), 171 deletions(-) diff --git a/widget/windows/WindowsUIUtils.cpp b/widget/windows/WindowsUIUtils.cpp index 85b2879a950..12e7ddc550a 100644 --- a/widget/windows/WindowsUIUtils.cpp +++ b/widget/windows/WindowsUIUtils.cpp @@ -1,174 +1,174 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - -#include -#include "mozwrlbase.h" -#include "nsServiceManagerUtils.h" - -#include "WindowsUIUtils.h" - -#include "nsIObserverService.h" -#include "nsIBaseWindow.h" +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include +#include "mozwrlbase.h" +#include "nsServiceManagerUtils.h" + +#include "WindowsUIUtils.h" + +#include "nsIObserverService.h" +#include "nsIBaseWindow.h" #include "nsIDocShell.h" -#include "nsIAppShellService.h" -#include "nsAppShellCID.h" -#include "nsIXULWindow.h" -#include "mozilla/Services.h" -#include "mozilla/WindowsVersion.h" -#include "nsString.h" -#include "nsIWidget.h" - -#include - -#pragma comment(lib, "runtimeobject.lib") - -using namespace mozilla; -using namespace ABI::Windows::UI; -using namespace ABI::Windows::UI::ViewManagement; -using namespace Microsoft::WRL; -using namespace Microsoft::WRL::Wrappers; -using namespace ABI::Windows::Foundation; - -/* All of this is win10 stuff and we're compiling against win81 headers - * for now, so we may need to do some legwork: */ +#include "nsIAppShellService.h" +#include "nsAppShellCID.h" +#include "nsIXULWindow.h" +#include "mozilla/Services.h" +#include "mozilla/WindowsVersion.h" +#include "nsString.h" +#include "nsIWidget.h" + +#include + +#pragma comment(lib, "runtimeobject.lib") + +using namespace mozilla; +using namespace ABI::Windows::UI; +using namespace ABI::Windows::UI::ViewManagement; +using namespace Microsoft::WRL; +using namespace Microsoft::WRL::Wrappers; +using namespace ABI::Windows::Foundation; + +/* All of this is win10 stuff and we're compiling against win81 headers + * for now, so we may need to do some legwork: */ #if MOZ_WINSDK_MAXVER < 0x0A000000 -namespace ABI { - namespace Windows { - namespace UI { - namespace ViewManagement { - enum UserInteractionMode { - UserInteractionMode_Mouse = 0, - UserInteractionMode_Touch = 1 - }; - } - } - } -} - -#endif - -#ifndef RuntimeClass_Windows_UI_ViewManagement_UIViewSettings -#define RuntimeClass_Windows_UI_ViewManagement_UIViewSettings L"Windows.UI.ViewManagement.UIViewSettings" -#endif - +namespace ABI { + namespace Windows { + namespace UI { + namespace ViewManagement { + enum UserInteractionMode { + UserInteractionMode_Mouse = 0, + UserInteractionMode_Touch = 1 + }; + } + } + } +} + +#endif + +#ifndef RuntimeClass_Windows_UI_ViewManagement_UIViewSettings +#define RuntimeClass_Windows_UI_ViewManagement_UIViewSettings L"Windows.UI.ViewManagement.UIViewSettings" +#endif + #if MOZ_WINSDK_MAXVER < 0x0A000000 -namespace ABI { - namespace Windows { - namespace UI { - namespace ViewManagement { - interface IUIViewSettings; - MIDL_INTERFACE("C63657F6-8850-470D-88F8-455E16EA2C26") - IUIViewSettings : public IInspectable - { - public: - virtual HRESULT STDMETHODCALLTYPE get_UserInteractionMode(UserInteractionMode *value) = 0; - }; - - extern const __declspec(selectany) IID & IID_IUIViewSettings = __uuidof(IUIViewSettings); - } - } - } -} -#endif - -#ifndef IUIViewSettingsInterop - -typedef interface IUIViewSettingsInterop IUIViewSettingsInterop; - -MIDL_INTERFACE("3694dbf9-8f68-44be-8ff5-195c98ede8a6") -IUIViewSettingsInterop : public IInspectable -{ -public: - virtual HRESULT STDMETHODCALLTYPE GetForWindow(HWND hwnd, REFIID riid, void **ppv) = 0; -}; -#endif - -WindowsUIUtils::WindowsUIUtils() : - mInTabletMode(eTabletModeUnknown) -{ -} - -WindowsUIUtils::~WindowsUIUtils() -{ -} - -/* - * Implement the nsISupports methods... - */ -NS_IMPL_ISUPPORTS(WindowsUIUtils, - nsIWindowsUIUtils) - -NS_IMETHODIMP -WindowsUIUtils::GetInTabletMode(bool* aResult) -{ - if (mInTabletMode == eTabletModeUnknown) { - UpdateTabletModeState(); - } - *aResult = mInTabletMode == eTabletModeOn; - return NS_OK; -} - -NS_IMETHODIMP -WindowsUIUtils::UpdateTabletModeState() -{ - if (!IsWin10OrLater()) { - return NS_OK; - } - - nsCOMPtr appShell(do_GetService(NS_APPSHELLSERVICE_CONTRACTID)); - nsCOMPtr hiddenWindow; - - nsresult rv = appShell->GetHiddenWindow(getter_AddRefs(hiddenWindow)); - if (NS_FAILED(rv)) { - return rv; - } - - nsCOMPtr docShell; - rv = hiddenWindow->GetDocShell(getter_AddRefs(docShell)); - if (NS_FAILED(rv) || !docShell) { - return rv; - } - - nsCOMPtr baseWindow(do_QueryInterface(docShell)); - - if (!baseWindow) - return NS_ERROR_FAILURE; - - nsCOMPtr widget; - baseWindow->GetMainWidget(getter_AddRefs(widget)); - - if (!widget) - return NS_ERROR_FAILURE; - - HWND winPtr = (HWND)widget->GetNativeData(NS_NATIVE_WINDOW); - ComPtr uiViewSettingsInterop; - - HRESULT hr = GetActivationFactory( - HStringReference(RuntimeClass_Windows_UI_ViewManagement_UIViewSettings).Get(), - &uiViewSettingsInterop); - if (SUCCEEDED(hr)) { - ComPtr uiViewSettings; - hr = uiViewSettingsInterop->GetForWindow(winPtr, IID_PPV_ARGS(&uiViewSettings)); - if (SUCCEEDED(hr)) { - UserInteractionMode mode; - hr = uiViewSettings->get_UserInteractionMode(&mode); - if (SUCCEEDED(hr)) { - TabletModeState oldTabletModeState = mInTabletMode; - mInTabletMode = (mode == UserInteractionMode_Touch) ? eTabletModeOn : eTabletModeOff; - if (mInTabletMode != oldTabletModeState) { - nsCOMPtr observerService = - mozilla::services::GetObserverService(); - NS_NAMED_LITERAL_STRING(tabletMode, "tablet-mode"); - NS_NAMED_LITERAL_STRING(normalMode, "normal-mode"); - observerService->NotifyObservers(nullptr, "tablet-mode-change", - ((mInTabletMode == eTabletModeOn) ? tabletMode.get() : normalMode.get())); - } - } - } - } - - return NS_OK; -} - +namespace ABI { + namespace Windows { + namespace UI { + namespace ViewManagement { + interface IUIViewSettings; + MIDL_INTERFACE("C63657F6-8850-470D-88F8-455E16EA2C26") + IUIViewSettings : public IInspectable + { + public: + virtual HRESULT STDMETHODCALLTYPE get_UserInteractionMode(UserInteractionMode *value) = 0; + }; + + extern const __declspec(selectany) IID & IID_IUIViewSettings = __uuidof(IUIViewSettings); + } + } + } +} +#endif + +#ifndef IUIViewSettingsInterop + +typedef interface IUIViewSettingsInterop IUIViewSettingsInterop; + +MIDL_INTERFACE("3694dbf9-8f68-44be-8ff5-195c98ede8a6") +IUIViewSettingsInterop : public IInspectable +{ +public: + virtual HRESULT STDMETHODCALLTYPE GetForWindow(HWND hwnd, REFIID riid, void **ppv) = 0; +}; +#endif + +WindowsUIUtils::WindowsUIUtils() : + mInTabletMode(eTabletModeUnknown) +{ +} + +WindowsUIUtils::~WindowsUIUtils() +{ +} + +/* + * Implement the nsISupports methods... + */ +NS_IMPL_ISUPPORTS(WindowsUIUtils, + nsIWindowsUIUtils) + +NS_IMETHODIMP +WindowsUIUtils::GetInTabletMode(bool* aResult) +{ + if (mInTabletMode == eTabletModeUnknown) { + UpdateTabletModeState(); + } + *aResult = mInTabletMode == eTabletModeOn; + return NS_OK; +} + +NS_IMETHODIMP +WindowsUIUtils::UpdateTabletModeState() +{ + if (!IsWin10OrLater()) { + return NS_OK; + } + + nsCOMPtr appShell(do_GetService(NS_APPSHELLSERVICE_CONTRACTID)); + nsCOMPtr hiddenWindow; + + nsresult rv = appShell->GetHiddenWindow(getter_AddRefs(hiddenWindow)); + if (NS_FAILED(rv)) { + return rv; + } + + nsCOMPtr docShell; + rv = hiddenWindow->GetDocShell(getter_AddRefs(docShell)); + if (NS_FAILED(rv) || !docShell) { + return rv; + } + + nsCOMPtr baseWindow(do_QueryInterface(docShell)); + + if (!baseWindow) + return NS_ERROR_FAILURE; + + nsCOMPtr widget; + baseWindow->GetMainWidget(getter_AddRefs(widget)); + + if (!widget) + return NS_ERROR_FAILURE; + + HWND winPtr = (HWND)widget->GetNativeData(NS_NATIVE_WINDOW); + ComPtr uiViewSettingsInterop; + + HRESULT hr = GetActivationFactory( + HStringReference(RuntimeClass_Windows_UI_ViewManagement_UIViewSettings).Get(), + &uiViewSettingsInterop); + if (SUCCEEDED(hr)) { + ComPtr uiViewSettings; + hr = uiViewSettingsInterop->GetForWindow(winPtr, IID_PPV_ARGS(&uiViewSettings)); + if (SUCCEEDED(hr)) { + UserInteractionMode mode; + hr = uiViewSettings->get_UserInteractionMode(&mode); + if (SUCCEEDED(hr)) { + TabletModeState oldTabletModeState = mInTabletMode; + mInTabletMode = (mode == UserInteractionMode_Touch) ? eTabletModeOn : eTabletModeOff; + if (mInTabletMode != oldTabletModeState) { + nsCOMPtr observerService = + mozilla::services::GetObserverService(); + NS_NAMED_LITERAL_STRING(tabletMode, "tablet-mode"); + NS_NAMED_LITERAL_STRING(normalMode, "normal-mode"); + observerService->NotifyObservers(nullptr, "tablet-mode-change", + ((mInTabletMode == eTabletModeOn) ? tabletMode.get() : normalMode.get())); + } + } + } + } + + return NS_OK; +} + From fd7f613d8007875611b68f5c4f30b03eb9fb004e Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Tue, 2 Feb 2016 14:31:49 +1100 Subject: [PATCH 109/117] Bug 1244982 - Fix minor double-reporting of memory in prefs code. r=erahm. --- modules/libpref/Preferences.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/libpref/Preferences.cpp b/modules/libpref/Preferences.cpp index 60ee556daad..80948250268 100644 --- a/modules/libpref/Preferences.cpp +++ b/modules/libpref/Preferences.cpp @@ -239,7 +239,6 @@ Preferences::SizeOfIncludingThisAndOtherStuff(mozilla::MallocSizeOf aMallocSizeO } } if (gObserverTable) { - n += aMallocSizeOf(gObserverTable); n += gObserverTable->ShallowSizeOfIncludingThis(aMallocSizeOf); for (auto iter = gObserverTable->Iter(); !iter.Done(); iter.Next()) { n += iter.Key()->mPrefName.SizeOfExcludingThisIfUnshared(aMallocSizeOf); From 5612abd4134eee2afdaea3c707b0e8aec9768de3 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Tue, 2 Feb 2016 15:18:16 +1100 Subject: [PATCH 110/117] Bug 1244992 - Avoid double-counting in various refcounted types related to nsCSSValue. r=heycam. Also, GridTemplateAreasValue::SizeOfIncludingThis() wasn't measuring |this|, so the patch fixes that. --- layout/style/nsCSSValue.cpp | 128 ++++++++++++++++++++++++------------ 1 file changed, 85 insertions(+), 43 deletions(-) diff --git a/layout/style/nsCSSValue.cpp b/layout/style/nsCSSValue.cpp index 870e13118f3..f855e879fda 100644 --- a/layout/style/nsCSSValue.cpp +++ b/layout/style/nsCSSValue.cpp @@ -2136,9 +2136,13 @@ nsCSSValueList::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const size_t nsCSSValueList_heap::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const { - size_t n = aMallocSizeOf(this); - n += mValue.SizeOfExcludingThis(aMallocSizeOf); - n += mNext ? mNext->SizeOfIncludingThis(aMallocSizeOf) : 0; + // Only measure it if it's unshared, to avoid double-counting. + size_t n = 0; + if (mRefCnt <= 1) { + n += aMallocSizeOf(this); + n += mValue.SizeOfExcludingThis(aMallocSizeOf); + n += mNext ? mNext->SizeOfIncludingThis(aMallocSizeOf) : 0; + } return n; } @@ -2171,9 +2175,12 @@ nsCSSValueSharedList::operator==(const nsCSSValueSharedList& aOther) const size_t nsCSSValueSharedList::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const { + // Only measure it if it's unshared, to avoid double-counting. size_t n = 0; - n += aMallocSizeOf(this); - n += mHead->SizeOfIncludingThis(aMallocSizeOf); + if (mRefCnt <= 1) { + n += aMallocSizeOf(this); + n += mHead->SizeOfIncludingThis(aMallocSizeOf); + } return n; } @@ -2246,11 +2253,15 @@ void nsCSSRect::SetAllSidesTo(const nsCSSValue& aValue) size_t nsCSSRect_heap::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const { - size_t n = aMallocSizeOf(this); - n += mTop .SizeOfExcludingThis(aMallocSizeOf); - n += mRight .SizeOfExcludingThis(aMallocSizeOf); - n += mBottom.SizeOfExcludingThis(aMallocSizeOf); - n += mLeft .SizeOfExcludingThis(aMallocSizeOf); + // Only measure it if it's unshared, to avoid double-counting. + size_t n = 0; + if (mRefCnt <= 1) { + n += aMallocSizeOf(this); + n += mTop .SizeOfExcludingThis(aMallocSizeOf); + n += mRight .SizeOfExcludingThis(aMallocSizeOf); + n += mBottom.SizeOfExcludingThis(aMallocSizeOf); + n += mLeft .SizeOfExcludingThis(aMallocSizeOf); + } return n; } @@ -2291,9 +2302,13 @@ nsCSSValuePair::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const size_t nsCSSValuePair_heap::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const { - size_t n = aMallocSizeOf(this); - n += mXValue.SizeOfExcludingThis(aMallocSizeOf); - n += mYValue.SizeOfExcludingThis(aMallocSizeOf); + // Only measure it if it's unshared, to avoid double-counting. + size_t n = 0; + if (mRefCnt <= 1) { + n += aMallocSizeOf(this); + n += mXValue.SizeOfExcludingThis(aMallocSizeOf); + n += mYValue.SizeOfExcludingThis(aMallocSizeOf); + } return n; } @@ -2318,10 +2333,14 @@ nsCSSValueTriplet::AppendToString(nsCSSProperty aProperty, size_t nsCSSValueTriplet_heap::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const { - size_t n = aMallocSizeOf(this); - n += mXValue.SizeOfExcludingThis(aMallocSizeOf); - n += mYValue.SizeOfExcludingThis(aMallocSizeOf); - n += mZValue.SizeOfExcludingThis(aMallocSizeOf); + // Only measure it if it's unshared, to avoid double-counting. + size_t n = 0; + if (mRefCnt <= 1) { + n += aMallocSizeOf(this); + n += mXValue.SizeOfExcludingThis(aMallocSizeOf); + n += mYValue.SizeOfExcludingThis(aMallocSizeOf); + n += mZValue.SizeOfExcludingThis(aMallocSizeOf); + } return n; } @@ -2412,10 +2431,14 @@ nsCSSValuePairList::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) con size_t nsCSSValuePairList_heap::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const { - size_t n = aMallocSizeOf(this); - n += mXValue.SizeOfExcludingThis(aMallocSizeOf); - n += mYValue.SizeOfExcludingThis(aMallocSizeOf); - n += mNext ? mNext->SizeOfIncludingThis(aMallocSizeOf) : 0; + // Only measure it if it's unshared, to avoid double-counting. + size_t n = 0; + if (mRefCnt <= 1) { + n += aMallocSizeOf(this); + n += mXValue.SizeOfExcludingThis(aMallocSizeOf); + n += mYValue.SizeOfExcludingThis(aMallocSizeOf); + n += mNext ? mNext->SizeOfIncludingThis(aMallocSizeOf) : 0; + } return n; } @@ -2502,16 +2525,18 @@ css::URLValue::GetURI() const size_t css::URLValue::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const { - size_t n = aMallocSizeOf(this); - - n += mString->SizeOfIncludingThisIfUnshared(aMallocSizeOf); - - // Measurement of the following members may be added later if DMD finds it is - // worthwhile: - // - mURI - // - mReferrer - // - mOriginPrincipal + // Only measure it if it's unshared, to avoid double-counting. + size_t n = 0; + if (mRefCnt <= 1) { + n += aMallocSizeOf(this); + n += mString->SizeOfIncludingThisIfUnshared(aMallocSizeOf); + // Measurement of the following members may be added later if DMD finds it + // is worthwhile: + // - mURI + // - mReferrer + // - mOriginPrincipal + } return n; } @@ -2604,14 +2629,18 @@ nsCSSValueGradient::nsCSSValueGradient(bool aIsRadial, size_t nsCSSValueGradient::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const { - size_t n = aMallocSizeOf(this); - n += mBgPos.SizeOfExcludingThis(aMallocSizeOf); - n += mAngle.SizeOfExcludingThis(aMallocSizeOf); - n += mRadialValues[0].SizeOfExcludingThis(aMallocSizeOf); - n += mRadialValues[1].SizeOfExcludingThis(aMallocSizeOf); - n += mStops.ShallowSizeOfExcludingThis(aMallocSizeOf); - for (uint32_t i = 0; i < mStops.Length(); i++) { - n += mStops[i].SizeOfExcludingThis(aMallocSizeOf); + // Only measure it if it's unshared, to avoid double-counting. + size_t n = 0; + if (mRefCnt <= 1) { + n += aMallocSizeOf(this); + n += mBgPos.SizeOfExcludingThis(aMallocSizeOf); + n += mAngle.SizeOfExcludingThis(aMallocSizeOf); + n += mRadialValues[0].SizeOfExcludingThis(aMallocSizeOf); + n += mRadialValues[1].SizeOfExcludingThis(aMallocSizeOf); + n += mStops.ShallowSizeOfExcludingThis(aMallocSizeOf); + for (uint32_t i = 0; i < mStops.Length(); i++) { + n += mStops[i].SizeOfExcludingThis(aMallocSizeOf); + } } return n; } @@ -2634,8 +2663,12 @@ nsCSSValueTokenStream::~nsCSSValueTokenStream() size_t nsCSSValueTokenStream::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const { - size_t n = aMallocSizeOf(this); - n += mTokenStream.SizeOfExcludingThisIfUnshared(aMallocSizeOf); + // Only measure it if it's unshared, to avoid double-counting. + size_t n = 0; + if (mRefCnt <= 1) { + n += aMallocSizeOf(this); + n += mTokenStream.SizeOfExcludingThisIfUnshared(aMallocSizeOf); + } return n; } @@ -2722,7 +2755,11 @@ size_t nsCSSValueFloatColor::SizeOfIncludingThis( mozilla::MallocSizeOf aMallocSizeOf) const { - size_t n = aMallocSizeOf(this); + // Only measure it if it's unshared, to avoid double-counting. + size_t n = 0; + if (mRefCnt <= 1) { + n += aMallocSizeOf(this); + } return n; } @@ -2770,7 +2807,12 @@ nsCSSCornerSizes::corners[4] = { size_t mozilla::css::GridTemplateAreasValue::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const { - size_t n = mNamedAreas.ShallowSizeOfExcludingThis(aMallocSizeOf); - n += mTemplates.ShallowSizeOfExcludingThis(aMallocSizeOf); + // Only measure it if it's unshared, to avoid double-counting. + size_t n = 0; + if (mRefCnt <= 1) { + n += aMallocSizeOf(this); + n += mNamedAreas.ShallowSizeOfExcludingThis(aMallocSizeOf); + n += mTemplates.ShallowSizeOfExcludingThis(aMallocSizeOf); + } return n; } From 29c22481865cb9e217faf4c2fb4463bb55d58480 Mon Sep 17 00:00:00 2001 From: Randell Jesup Date: Thu, 14 Jan 2016 00:16:49 -0500 Subject: [PATCH 111/117] Bug 1219339: switch GetStaticInstance to use IPC's Singleton impl r=froyd --- media/webrtc/signaling/test/FakeIPC.cpp | 35 +++++ media/webrtc/signaling/test/FakeIPC.h | 22 ++++ .../signaling/test/jsep_session_unittest.cpp | 3 + .../signaling/test/jsep_track_unittest.cpp | 3 + .../signaling/test/mediaconduit_unittests.cpp | 3 + .../signaling/test/mediapipeline_unittest.cpp | 3 + .../webrtc/signaling/test/sdp_file_parser.cpp | 3 + media/webrtc/signaling/test/sdp_unittests.cpp | 3 + .../signaling/test/signaling_unittests.cpp | 3 + .../modules/rtp_rtcp/source/ssrc_database.h | 2 +- .../interface/static_instance.h | 120 +----------------- .../source/condition_variable_native_win.cc | 13 +- .../system_wrappers/source/rw_lock_win.cc | 8 +- .../system_wrappers/source/trace_impl.cc | 8 +- 14 files changed, 106 insertions(+), 123 deletions(-) create mode 100644 media/webrtc/signaling/test/FakeIPC.cpp create mode 100644 media/webrtc/signaling/test/FakeIPC.h diff --git a/media/webrtc/signaling/test/FakeIPC.cpp b/media/webrtc/signaling/test/FakeIPC.cpp new file mode 100644 index 00000000000..767082c29e0 --- /dev/null +++ b/media/webrtc/signaling/test/FakeIPC.cpp @@ -0,0 +1,35 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "FakeIPC.h" +#include + +// The implementations can't be in the .h file for some annoying reason + +/* static */ void +PlatformThread:: YieldCurrentThread() +{ + sleep(1); +} + +namespace base { + +void AtExitManager::RegisterCallback(AtExitCallbackType func, void* param) +{ +} + +} + +// see atomicops_internals_x86_gcc.h +// This cheats to get the unittests to build + +struct AtomicOps_x86CPUFeatureStruct { + bool field1; + bool field2; +}; + +struct AtomicOps_x86CPUFeatureStruct AtomicOps_Internalx86CPUFeatures = { + false, + false, +}; diff --git a/media/webrtc/signaling/test/FakeIPC.h b/media/webrtc/signaling/test/FakeIPC.h new file mode 100644 index 00000000000..e13fc271d2b --- /dev/null +++ b/media/webrtc/signaling/test/FakeIPC.h @@ -0,0 +1,22 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this file, + * You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef FAKE_IPC_H_ +#define FAKE_IPC_H_ +#include + +class PlatformThread { +public: + static void YieldCurrentThread(); +}; + +namespace base { +class AtExitManager { +public: + typedef void (*AtExitCallbackType)(void*); + + static void RegisterCallback(AtExitCallbackType func, void* param); +}; +} +#endif diff --git a/media/webrtc/signaling/test/jsep_session_unittest.cpp b/media/webrtc/signaling/test/jsep_session_unittest.cpp index c548f746daa..4b8c834c3cc 100644 --- a/media/webrtc/signaling/test/jsep_session_unittest.cpp +++ b/media/webrtc/signaling/test/jsep_session_unittest.cpp @@ -32,6 +32,9 @@ #include "mtransport_test_utils.h" +#include "FakeIPC.h" +#include "FakeIPC.cpp" + namespace mozilla { static std::string kAEqualsCandidate("a=candidate:"); const static size_t kNumCandidatesPerComponent = 3; diff --git a/media/webrtc/signaling/test/jsep_track_unittest.cpp b/media/webrtc/signaling/test/jsep_track_unittest.cpp index 44d39ddfa5c..87f783c35f6 100644 --- a/media/webrtc/signaling/test/jsep_track_unittest.cpp +++ b/media/webrtc/signaling/test/jsep_track_unittest.cpp @@ -19,6 +19,9 @@ #include "mtransport_test_utils.h" +#include "FakeIPC.h" +#include "FakeIPC.cpp" + namespace mozilla { class JsepTrackTest : public ::testing::Test diff --git a/media/webrtc/signaling/test/mediaconduit_unittests.cpp b/media/webrtc/signaling/test/mediaconduit_unittests.cpp index c14dc373c77..3578e45d356 100644 --- a/media/webrtc/signaling/test/mediaconduit_unittests.cpp +++ b/media/webrtc/signaling/test/mediaconduit_unittests.cpp @@ -22,6 +22,9 @@ using namespace std; #include "runnable_utils.h" #include "signaling/src/common/EncodingConstraints.h" +#include "FakeIPC.h" +#include "FakeIPC.cpp" + #define GTEST_HAS_RTTI 0 #include "gtest/gtest.h" #include "gtest_utils.h" diff --git a/media/webrtc/signaling/test/mediapipeline_unittest.cpp b/media/webrtc/signaling/test/mediapipeline_unittest.cpp index ded6d20e541..e54c8abe844 100644 --- a/media/webrtc/signaling/test/mediapipeline_unittest.cpp +++ b/media/webrtc/signaling/test/mediapipeline_unittest.cpp @@ -36,6 +36,9 @@ #include "webrtc/modules/interface/module_common_types.h" +#include "FakeIPC.h" +#include "FakeIPC.cpp" + #define GTEST_HAS_RTTI 0 #include "gtest/gtest.h" #include "gtest_utils.h" diff --git a/media/webrtc/signaling/test/sdp_file_parser.cpp b/media/webrtc/signaling/test/sdp_file_parser.cpp index fe2f63b0039..3fb0c2f1ced 100644 --- a/media/webrtc/signaling/test/sdp_file_parser.cpp +++ b/media/webrtc/signaling/test/sdp_file_parser.cpp @@ -18,6 +18,9 @@ #include "signaling/src/sdp/SipccSdpParser.h" +#include "FakeIPC.h" +#include "FakeIPC.cpp" + namespace mozilla { const std::string kDefaultFilename((char *)"/tmp/sdp.bin"); diff --git a/media/webrtc/signaling/test/sdp_unittests.cpp b/media/webrtc/signaling/test/sdp_unittests.cpp index c13d87b8baa..fc4e58970c9 100644 --- a/media/webrtc/signaling/test/sdp_unittests.cpp +++ b/media/webrtc/signaling/test/sdp_unittests.cpp @@ -44,6 +44,9 @@ extern "C" { #endif #define CRLF "\r\n" +#include "FakeIPC.h" +#include "FakeIPC.cpp" + using namespace mozilla; namespace test { diff --git a/media/webrtc/signaling/test/signaling_unittests.cpp b/media/webrtc/signaling/test/signaling_unittests.cpp index c3817171ba1..92bf6a2a411 100644 --- a/media/webrtc/signaling/test/signaling_unittests.cpp +++ b/media/webrtc/signaling/test/signaling_unittests.cpp @@ -45,6 +45,9 @@ #include "PeerConnectionImplEnumsBinding.cpp" #endif +#include "FakeIPC.h" +#include "FakeIPC.cpp" + #include "ice_ctx.h" #include "ice_peer_ctx.h" diff --git a/media/webrtc/trunk/webrtc/modules/rtp_rtcp/source/ssrc_database.h b/media/webrtc/trunk/webrtc/modules/rtp_rtcp/source/ssrc_database.h index 2d4932afa7f..e95b8324d68 100644 --- a/media/webrtc/trunk/webrtc/modules/rtp_rtcp/source/ssrc_database.h +++ b/media/webrtc/trunk/webrtc/modules/rtp_rtcp/source/ssrc_database.h @@ -29,10 +29,10 @@ public: int32_t RegisterSSRC(const uint32_t ssrc); int32_t ReturnSSRC(const uint32_t ssrc); -protected: SSRCDatabase(); virtual ~SSRCDatabase(); +protected: static SSRCDatabase* CreateInstance() { return new SSRCDatabase(); } private: diff --git a/media/webrtc/trunk/webrtc/system_wrappers/interface/static_instance.h b/media/webrtc/trunk/webrtc/system_wrappers/interface/static_instance.h index dad9c52dc9f..071edabfa01 100644 --- a/media/webrtc/trunk/webrtc/system_wrappers/interface/static_instance.h +++ b/media/webrtc/trunk/webrtc/system_wrappers/interface/static_instance.h @@ -13,10 +13,10 @@ #include -#include "webrtc/system_wrappers/interface/critical_section_wrapper.h" -#ifdef _WIN32 -#include "webrtc/system_wrappers/interface/fix_interlocked_exchange_pointer_win.h" +#if defined(WEBRTC_ANDROID) || defined(WEBRTC_GONK) +#define OS_LINUX #endif +#include "base/singleton.h" namespace webrtc { @@ -35,119 +35,9 @@ template // Construct On First Use idiom. Avoids // "static initialization order fiasco". static T* GetStaticInstance(CountOperation count_operation) { - // TODO (hellner): use atomic wrapper instead. - static volatile long instance_count = 0; - static T* volatile instance = NULL; - CreateOperation state = kInstanceExists; -#ifndef _WIN32 - // This memory is staticly allocated once. The application does not try to - // free this memory. This approach is taken to avoid issues with - // destruction order for statically allocated memory. The memory will be - // reclaimed by the OS and memory leak tools will not recognize memory - // reachable from statics leaked so no noise is added by doing this. - static CriticalSectionWrapper* crit_sect( - CriticalSectionWrapper::CreateCriticalSection()); - CriticalSectionScoped lock(crit_sect); - - if (count_operation == - kAddRefNoCreate && instance_count == 0) { - return NULL; - } - if (count_operation == - kAddRef || - count_operation == kAddRefNoCreate) { - instance_count++; - if (instance_count == 1) { - state = kCreate; - } - } else { - instance_count--; - if (instance_count == 0) { - state = kDestroy; - } - } - if (state == kCreate) { - instance = T::CreateInstance(); - } else if (state == kDestroy) { - T* old_instance = instance; - instance = NULL; - // The state will not change past this point. Release the critical - // section while deleting the object in case it would be blocking on - // access back to this object. (This is the case for the tracing class - // since the thread owned by the tracing class also traces). - // TODO(hellner): this is a bit out of place but here goes, de-couple - // thread implementation with trace implementation. - crit_sect->Leave(); - if (old_instance) { - delete old_instance; - } - // Re-acquire the lock since the scoped critical section will release - // it. - crit_sect->Enter(); - return NULL; - } -#else // _WIN32 - if (count_operation == - kAddRefNoCreate && instance_count == 0) { - return NULL; - } - if (count_operation == kAddRefNoCreate) { - if (1 == InterlockedIncrement(&instance_count)) { - // The instance has been destroyed by some other thread. Rollback. - InterlockedDecrement(&instance_count); - assert(false); - return NULL; - } - // Sanity to catch corrupt state. - if (instance == NULL) { - assert(false); - InterlockedDecrement(&instance_count); - return NULL; - } - } else if (count_operation == kAddRef) { - if (instance_count == 0) { - state = kCreate; - } else { - if (1 == InterlockedIncrement(&instance_count)) { - // InterlockedDecrement because reference count should not be - // updated just yet (that's done when the instance is created). - InterlockedDecrement(&instance_count); - state = kCreate; - } - } - } else { - int new_value = InterlockedDecrement(&instance_count); - if (new_value == 0) { - state = kDestroy; - } - } - - if (state == kCreate) { - // Create instance and let whichever thread finishes first assign its - // local copy to the global instance. All other threads reclaim their - // local copy. - T* new_instance = T::CreateInstance(); - if (1 == InterlockedIncrement(&instance_count)) { - InterlockedExchangePointer(reinterpret_cast(&instance), - new_instance); - } else { - InterlockedDecrement(&instance_count); - if (new_instance) { - delete static_cast(new_instance); - } - } - } else if (state == kDestroy) { - T* old_value = static_cast(InterlockedExchangePointer( - reinterpret_cast(&instance), NULL)); - if (old_value) { - delete static_cast(old_value); - } - return NULL; - } -#endif // #ifndef _WIN32 - return instance; + // Simple solution since we don't use this for large objects anymore + return Singleton::get(); } - } // namspace webrtc #endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_STATIC_INSTANCE_H_ diff --git a/media/webrtc/trunk/webrtc/system_wrappers/source/condition_variable_native_win.cc b/media/webrtc/trunk/webrtc/system_wrappers/source/condition_variable_native_win.cc index 22ddb6f8fd0..b8c19a42703 100644 --- a/media/webrtc/trunk/webrtc/system_wrappers/source/condition_variable_native_win.cc +++ b/media/webrtc/trunk/webrtc/system_wrappers/source/condition_variable_native_win.cc @@ -52,7 +52,12 @@ bool ConditionVariableNativeWin::Init() { if (library) { // TODO(henrike): not thread safe as reading and writing to library is not // serialized. Fix. - WEBRTC_TRACE(kTraceStateInfo, kTraceUtility, -1, "Loaded Kernel.dll"); + + // Don't log here, since we may be creating a FileWrapper for + // the TraceImpl, from within GetStaticInstance. With singleton.h, you + // can't safely call GetStaticInstance on the same object from within + // creating that object. + //WEBRTC_TRACE(kTraceStateInfo, kTraceUtility, -1, "Loaded Kernel.dll"); PInitializeConditionVariable_ = (PInitializeConditionVariable) GetProcAddress( @@ -66,9 +71,9 @@ bool ConditionVariableNativeWin::Init() { if (PInitializeConditionVariable_ && PSleepConditionVariableCS_ && PWakeConditionVariable_ && PWakeAllConditionVariable_) { - WEBRTC_TRACE( - kTraceStateInfo, kTraceUtility, -1, - "Loaded native condition variables"); + //WEBRTC_TRACE( + // kTraceStateInfo, kTraceUtility, -1, + // "Loaded native condition variables"); win_support_condition_variables_primitive = true; } } diff --git a/media/webrtc/trunk/webrtc/system_wrappers/source/rw_lock_win.cc b/media/webrtc/trunk/webrtc/system_wrappers/source/rw_lock_win.cc index aea74fa4a37..a1d4b58195f 100644 --- a/media/webrtc/trunk/webrtc/system_wrappers/source/rw_lock_win.cc +++ b/media/webrtc/trunk/webrtc/system_wrappers/source/rw_lock_win.cc @@ -69,7 +69,11 @@ bool RWLockWin::LoadModule() { if (!library) { return false; } - WEBRTC_TRACE(kTraceStateInfo, kTraceUtility, -1, "Loaded Kernel.dll"); + // Don't log here, since we may be creating a FileWrapper for + // the TraceImpl, from within GetStaticInstance. With singleton.h, you + // can't safely call GetStaticInstance on the same object from within + // creating that object (go figure...) + //WEBRTC_TRACE(kTraceStateInfo, kTraceUtility, -1, "Loaded Kernel.dll"); initialize_srw_lock = (InitializeSRWLock)GetProcAddress(library, "InitializeSRWLock"); @@ -88,7 +92,7 @@ bool RWLockWin::LoadModule() { if (initialize_srw_lock && acquire_srw_lock_exclusive && release_srw_lock_exclusive && acquire_srw_lock_shared && release_srw_lock_shared) { - WEBRTC_TRACE(kTraceStateInfo, kTraceUtility, -1, "Loaded Native RW Lock"); + //WEBRTC_TRACE(kTraceStateInfo, kTraceUtility, -1, "Loaded Native RW Lock"); native_rw_locks_supported = true; } return native_rw_locks_supported; diff --git a/media/webrtc/trunk/webrtc/system_wrappers/source/trace_impl.cc b/media/webrtc/trunk/webrtc/system_wrappers/source/trace_impl.cc index 661aefd6831..4322603412d 100644 --- a/media/webrtc/trunk/webrtc/system_wrappers/source/trace_impl.cc +++ b/media/webrtc/trunk/webrtc/system_wrappers/source/trace_impl.cc @@ -14,6 +14,7 @@ #include #include #include +#include "base/singleton.h" #ifdef _WIN32 #include "webrtc/system_wrappers/source/trace_win.h" @@ -63,7 +64,12 @@ TraceImpl* TraceImpl::StaticInstance(CountOperation count_operation, } } TraceImpl* impl = - GetStaticInstance(count_operation); +#if defined(_WIN32) + GetStaticInstance(count_operation); +#else + GetStaticInstance(count_operation); +#endif + return impl; } From 0a34785bad15865140b3ffff6f85e3c079ad13bf Mon Sep 17 00:00:00 2001 From: Gerald Squelart Date: Wed, 3 Feb 2016 14:25:47 +1100 Subject: [PATCH 112/117] Bug 1143096 - Init all WebMBufferedParser members - r=kinetik Initialize all WebMBufferedParser members, mainly to remove compiler warnings. 'mClusterTimecode' and 'mClusterOffset' are probably genuine potential issues, see bug 1143096 comment 2 for details. --- dom/media/webm/WebMBufferedParser.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dom/media/webm/WebMBufferedParser.h b/dom/media/webm/WebMBufferedParser.h index c65897407d6..da422cba03f 100644 --- a/dom/media/webm/WebMBufferedParser.h +++ b/dom/media/webm/WebMBufferedParser.h @@ -60,10 +60,19 @@ struct WebMBufferedParser , mInitEndOffset(-1) , mBlockEndOffset(-1) , mState(READ_ELEMENT_ID) + , mNextState(READ_ELEMENT_ID) , mVIntRaw(false) , mLastInitStartOffset(-1) , mClusterSyncPos(0) + , mVIntLeft(0) + , mBlockSize(0) + , mClusterTimecode(0) + , mClusterOffset(0) , mClusterEndOffset(-1) + , mBlockOffset(0) + , mBlockTimecode(0) + , mBlockTimecodeLength(0) + , mSkipBytes(0) , mTimecodeScale(1000000) , mGotTimecodeScale(false) { From 44189c670b2ab0fbd962cb460b7051f5c369a777 Mon Sep 17 00:00:00 2001 From: Sotaro Ikeda Date: Tue, 2 Feb 2016 20:37:31 -0800 Subject: [PATCH 113/117] Bug 1241769 - Use Singleton pattern to nsScreenManagerGonk r=mwu --- widget/gonk/nsScreenManagerGonk.cpp | 25 ++++++++++++++++++++----- widget/gonk/nsWidgetFactory.cpp | 2 +- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/widget/gonk/nsScreenManagerGonk.cpp b/widget/gonk/nsScreenManagerGonk.cpp index 7498ed76c3e..e608db5c085 100644 --- a/widget/gonk/nsScreenManagerGonk.cpp +++ b/widget/gonk/nsScreenManagerGonk.cpp @@ -27,6 +27,7 @@ #include "HwcComposer2D.h" #include "VsyncSource.h" #include "nsWindow.h" +#include "mozilla/ClearOnShutdown.h" #include "mozilla/layers/CompositorParent.h" #include "mozilla/Services.h" #include "mozilla/ProcessPriorityManager.h" @@ -760,19 +761,33 @@ nsScreenManagerGonk::~nsScreenManagerGonk() { } +static StaticRefPtr sScreenManagerGonk; + /* static */ already_AddRefed nsScreenManagerGonk::GetInstance() { - nsCOMPtr manager; - manager = do_GetService("@mozilla.org/gfx/screenmanager;1"); - MOZ_ASSERT(manager); - return already_AddRefed( - static_cast(manager.forget().take())); + MOZ_ASSERT(NS_IsMainThread()); + + // Avoid creating nsScreenManagerGonk from content process. + if (!XRE_IsParentProcess()) { + MOZ_CRASH("Non-chrome processes should not get here."); + } + + // Avoid creating multiple nsScreenManagerGonk instance inside main process. + if (!sScreenManagerGonk) { + sScreenManagerGonk = new nsScreenManagerGonk(); + ClearOnShutdown(&sScreenManagerGonk); + } + + RefPtr screenMgr = sScreenManagerGonk.get(); + return screenMgr.forget(); } /* static */ already_AddRefed< nsScreenGonk> nsScreenManagerGonk::GetPrimaryScreen() { + MOZ_ASSERT(NS_IsMainThread()); + RefPtr manager = nsScreenManagerGonk::GetInstance(); nsCOMPtr screen; manager->GetPrimaryScreen(getter_AddRefs(screen)); diff --git a/widget/gonk/nsWidgetFactory.cpp b/widget/gonk/nsWidgetFactory.cpp index ddd116f5662..1c752554450 100644 --- a/widget/gonk/nsWidgetFactory.cpp +++ b/widget/gonk/nsWidgetFactory.cpp @@ -50,7 +50,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(GfxInfo, Init) } NS_GENERIC_FACTORY_CONSTRUCTOR(nsWindow) -NS_GENERIC_FACTORY_CONSTRUCTOR(nsScreenManagerGonk) +NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsScreenManagerGonk, nsScreenManagerGonk::GetInstance) NS_GENERIC_FACTORY_CONSTRUCTOR(PuppetScreenManager) NS_GENERIC_FACTORY_CONSTRUCTOR(nsHTMLFormatConverter) NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIdleServiceGonk, nsIdleServiceGonk::GetInstance) From 5a89bae2c9fbc2af03ce77e5d5021c44a6fcbd24 Mon Sep 17 00:00:00 2001 From: Christoph Kerschbaumer Date: Tue, 2 Feb 2016 20:35:02 -0800 Subject: [PATCH 114/117] Bug 1195173 - Use channel->ascynOpen2 layout/style/Loader.cpp (r=bz) --- dom/security/nsContentSecurityManager.cpp | 13 +- layout/style/Loader.cpp | 187 ++++++---------------- layout/style/Loader.h | 10 -- 3 files changed, 64 insertions(+), 146 deletions(-) diff --git a/dom/security/nsContentSecurityManager.cpp b/dom/security/nsContentSecurityManager.cpp index 12b0d800a02..9751c055af2 100644 --- a/dom/security/nsContentSecurityManager.cpp +++ b/dom/security/nsContentSecurityManager.cpp @@ -143,8 +143,17 @@ DoContentSecurityChecks(nsIURI* aURI, nsILoadInfo* aLoadInfo) break; } - case nsIContentPolicy::TYPE_IMAGE: - case nsIContentPolicy::TYPE_STYLESHEET: + case nsIContentPolicy::TYPE_IMAGE: { + MOZ_ASSERT(false, "contentPolicyType not supported yet"); + break; + } + + case nsIContentPolicy::TYPE_STYLESHEET: { + mimeTypeGuess = NS_LITERAL_CSTRING("text/css"); + requestingContext = aLoadInfo->LoadingNode(); + break; + } + case nsIContentPolicy::TYPE_OBJECT: case nsIContentPolicy::TYPE_DOCUMENT: { MOZ_ASSERT(false, "contentPolicyType not supported yet"); diff --git a/layout/style/Loader.cpp b/layout/style/Loader.cpp index ec87c3a0220..f28bc44c044 100644 --- a/layout/style/Loader.cpp +++ b/layout/style/Loader.cpp @@ -48,7 +48,6 @@ #include "nsThreadUtils.h" #include "nsGkAtoms.h" #include "nsIThreadInternal.h" -#include "nsCORSListenerProxy.h" #include "nsINetworkPredictor.h" #include "mozilla/dom/ShadowRoot.h" #include "mozilla/dom/URL.h" @@ -75,16 +74,14 @@ using namespace mozilla::dom; * The CSS Loader gets requests to load various sorts of style sheets: * inline style from