Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
8734422b
Kaydet (Commit)
8734422b
authored
Şub 23, 2015
tarafından
Tomaž Vajngerl
Kaydeden (comit)
Miklos Vajna
Mar 02, 2015
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
android: remove DrawTimingQueue and PanningPerfAPI
Change-Id: I094c345524059030a157a940702ad47fad358176
üst
e3cd64d3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
188 deletions
+0
-188
DrawTimingQueue.java
...roid3/src/java/org/mozilla/gecko/gfx/DrawTimingQueue.java
+0
-95
PanningPerfAPI.java
...droid3/src/java/org/mozilla/gecko/gfx/PanningPerfAPI.java
+0
-93
No files found.
android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/DrawTimingQueue.java
deleted
100644 → 0
Dosyayı görüntüle @
e3cd64d3
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
* 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/. */
package
org
.
mozilla
.
gecko
.
gfx
;
import
android.os.SystemClock
;
/**
* A custom-built data structure to assist with measuring draw times.
*
* This class maintains a fixed-size circular buffer of DisplayPortMetrics
* objects and associated timestamps. It provides only three operations, which
* is all we require for our purposes of measuring draw times. Note
* in particular that the class is designed so that even though it is
* accessed from multiple threads, it does not require synchronization;
* any concurrency errors that result from this are handled gracefully.
*
* Assuming an unrolled buffer so that mTail is greater than mHead, the data
* stored in the buffer at entries [mHead, mTail) will never be modified, and
* so are "safe" to read. If this reading is done on the same thread that
* owns mHead, then reading the range [mHead, mTail) is guaranteed to be safe
* since the range itself will not shrink.
*/
final
class
DrawTimingQueue
{
private
static
final
String
LOGTAG
=
"GeckoDrawTimingQueue"
;
private
static
final
int
BUFFER_SIZE
=
16
;
private
final
DisplayPortMetrics
[]
mMetrics
;
private
final
long
[]
mTimestamps
;
private
int
mHead
;
private
int
mTail
;
DrawTimingQueue
()
{
mMetrics
=
new
DisplayPortMetrics
[
BUFFER_SIZE
];
mTimestamps
=
new
long
[
BUFFER_SIZE
];
mHead
=
BUFFER_SIZE
-
1
;
mTail
=
0
;
}
/**
* Add a new entry to the tail of the queue. If the buffer is full,
* do nothing. This must only be called from the Java UI thread.
*/
boolean
add
(
DisplayPortMetrics
metrics
)
{
if
(
mHead
==
mTail
)
{
return
false
;
}
mMetrics
[
mTail
]
=
metrics
;
mTimestamps
[
mTail
]
=
SystemClock
.
uptimeMillis
();
mTail
=
(
mTail
+
1
)
%
BUFFER_SIZE
;
return
true
;
}
/**
* Find the timestamp associated with the given metrics, AND remove
* all metrics objects from the start of the queue up to and including
* the one provided. Note that because of draw coalescing, the metrics
* object passed in here may not be the one at the head of the queue,
* and so we must iterate our way through the list to find it.
* This must only be called from the compositor thread.
*/
long
findTimeFor
(
DisplayPortMetrics
metrics
)
{
// keep a copy of the tail pointer so that we ignore new items
// added to the queue while we are searching. this is fine because
// the one we are looking for will either have been added already
// or will not be in the queue at all.
int
tail
=
mTail
;
// walk through the "safe" range from mHead to tail; these entries
// will not be modified unless we change mHead.
int
i
=
(
mHead
+
1
)
%
BUFFER_SIZE
;
while
(
i
!=
tail
)
{
if
(
mMetrics
[
i
].
fuzzyEquals
(
metrics
))
{
// found it, copy out the timestamp to a local var BEFORE
// changing mHead or add could clobber the timestamp.
long
timestamp
=
mTimestamps
[
i
];
mHead
=
i
;
return
timestamp
;
}
i
=
(
i
+
1
)
%
BUFFER_SIZE
;
}
return
-
1
;
}
/**
* Reset the buffer to empty.
* This must only be called from the compositor thread.
*/
void
reset
()
{
// we can only modify mHead on this thread.
mHead
=
(
mTail
+
BUFFER_SIZE
-
1
)
%
BUFFER_SIZE
;
}
}
android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/PanningPerfAPI.java
deleted
100644 → 0
Dosyayı görüntüle @
e3cd64d3
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
* 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/. */
package
org
.
mozilla
.
gecko
.
gfx
;
import
android.os.SystemClock
;
import
android.util.Log
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
PanningPerfAPI
{
private
static
final
String
LOGTAG
=
"GeckoPanningPerfAPI"
;
// make this large enough to avoid having to resize the frame time
// list, as that may be expensive and impact the thing we're trying
// to measure.
private
static
final
int
EXPECTED_FRAME_COUNT
=
2048
;
private
static
boolean
mRecordingFrames
=
false
;
private
static
List
<
Long
>
mFrameTimes
;
private
static
long
mFrameStartTime
;
private
static
boolean
mRecordingCheckerboard
=
false
;
private
static
List
<
Float
>
mCheckerboardAmounts
;
private
static
long
mCheckerboardStartTime
;
public
static
void
startFrameTimeRecording
()
{
if
(
mRecordingFrames
)
{
Log
.
e
(
LOGTAG
,
"Error: startFrameTimeRecording() called while already recording!"
);
return
;
}
mRecordingFrames
=
true
;
if
(
mFrameTimes
==
null
)
{
mFrameTimes
=
new
ArrayList
<
Long
>(
EXPECTED_FRAME_COUNT
);
}
else
{
mFrameTimes
.
clear
();
}
mFrameStartTime
=
SystemClock
.
uptimeMillis
();
}
public
static
List
<
Long
>
stopFrameTimeRecording
()
{
if
(!
mRecordingFrames
)
{
Log
.
e
(
LOGTAG
,
"Error: stopFrameTimeRecording() called when not recording!"
);
return
null
;
}
mRecordingFrames
=
false
;
return
mFrameTimes
;
}
public
static
void
recordFrameTime
()
{
// this will be called often, so try to make it as quick as possible
if
(
mRecordingFrames
)
{
mFrameTimes
.
add
(
SystemClock
.
uptimeMillis
()
-
mFrameStartTime
);
}
}
public
static
boolean
isRecordingCheckerboard
()
{
return
mRecordingCheckerboard
;
}
public
static
void
startCheckerboardRecording
()
{
if
(
mRecordingCheckerboard
)
{
Log
.
e
(
LOGTAG
,
"Error: startCheckerboardRecording() called while already recording!"
);
return
;
}
mRecordingCheckerboard
=
true
;
if
(
mCheckerboardAmounts
==
null
)
{
mCheckerboardAmounts
=
new
ArrayList
<
Float
>(
EXPECTED_FRAME_COUNT
);
}
else
{
mCheckerboardAmounts
.
clear
();
}
mCheckerboardStartTime
=
SystemClock
.
uptimeMillis
();
}
public
static
List
<
Float
>
stopCheckerboardRecording
()
{
if
(!
mRecordingCheckerboard
)
{
Log
.
e
(
LOGTAG
,
"Error: stopCheckerboardRecording() called when not recording!"
);
return
null
;
}
mRecordingCheckerboard
=
false
;
return
mCheckerboardAmounts
;
}
public
static
void
recordCheckerboard
(
float
amount
)
{
// this will be called often, so try to make it as quick as possible
if
(
mRecordingCheckerboard
)
{
mCheckerboardAmounts
.
add
(
amount
);
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment