mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 815671 part 4. Remove some array copying in gfx code. r=roc
This commit is contained in:
parent
f1adcafb81
commit
4adc2730f3
@ -2173,7 +2173,8 @@ nsDOMWindowUtils::StopFrameTimeRecording(uint32_t *frameCount, float **frames)
|
||||
if (!mgr)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsTArray<float> frameTimes = mgr->StopFrameTimeRecording();
|
||||
nsTArray<float> frameTimes;
|
||||
mgr->StopFrameTimeRecording(frameTimes);
|
||||
|
||||
*frames = nullptr;
|
||||
*frameCount = frameTimes.Length();
|
||||
|
@ -196,7 +196,7 @@ static void DumpLayerList(nsTArray<Layer*>& aLayers)
|
||||
|
||||
static void DumpEdgeList(DirectedGraph<Layer*>& aGraph)
|
||||
{
|
||||
nsTArray<DirectedGraph<Layer*>::Edge> edges = aGraph.GetEdgeList();
|
||||
const nsTArray<DirectedGraph<Layer*>::Edge>& edges = aGraph.GetEdgeList();
|
||||
|
||||
for (uint32_t i = 0; i < edges.Length(); i++) {
|
||||
fprintf(stderr, "From: ");
|
||||
|
@ -446,7 +446,8 @@ Layer::SetAnimations(const AnimationArray& aAnimations)
|
||||
for (uint32_t i = 0; i < mAnimations.Length(); i++) {
|
||||
AnimData* data = mAnimationData.AppendElement();
|
||||
InfallibleTArray<css::ComputedTimingFunction*>& functions = data->mFunctions;
|
||||
nsTArray<AnimationSegment> segments = mAnimations.ElementAt(i).segments();
|
||||
const InfallibleTArray<AnimationSegment>& segments =
|
||||
mAnimations.ElementAt(i).segments();
|
||||
for (uint32_t j = 0; j < segments.Length(); j++) {
|
||||
TimingFunction tf = segments.ElementAt(j).sampleFn();
|
||||
css::ComputedTimingFunction* ctf = new css::ComputedTimingFunction();
|
||||
@ -884,13 +885,12 @@ LayerManager::PostPresent()
|
||||
}
|
||||
}
|
||||
|
||||
nsTArray<float>
|
||||
LayerManager::StopFrameTimeRecording()
|
||||
void
|
||||
LayerManager::StopFrameTimeRecording(nsTArray<float>& aTimes)
|
||||
{
|
||||
mLastFrameTime = TimeStamp();
|
||||
nsTArray<float> result = mFrameTimes;
|
||||
aTimes.SwapElements(mFrameTimes);
|
||||
mFrameTimes.Clear();
|
||||
return result;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -482,7 +482,7 @@ public:
|
||||
void LogSelf(const char* aPrefix="");
|
||||
|
||||
void StartFrameTimeRecording();
|
||||
nsTArray<float> StopFrameTimeRecording();
|
||||
void StopFrameTimeRecording(nsTArray<float>& aTimes);
|
||||
|
||||
void PostPresent();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user