summaryrefslogtreecommitdiffstats
path: root/libs/hwui/FrameInfoVisualizer.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/FrameInfoVisualizer.h')
-rw-r--r--libs/hwui/FrameInfoVisualizer.h50
1 files changed, 12 insertions, 38 deletions
diff --git a/libs/hwui/FrameInfoVisualizer.h b/libs/hwui/FrameInfoVisualizer.h
index f62e34d..f1dc954 100644
--- a/libs/hwui/FrameInfoVisualizer.h
+++ b/libs/hwui/FrameInfoVisualizer.h
@@ -54,58 +54,32 @@ private:
void createData();
void destroyData();
- void addRect(Rect& r, float data, float* shapeOutput);
- void prepareShapes(const int baseline);
+ void initializeRects(const int baseline, const int width);
+ void nextBarSegment(FrameInfoIndex start, FrameInfoIndex end);
void drawGraph(OpenGLRenderer* canvas);
- void drawCurrentFrame(OpenGLRenderer* canvas);
void drawThreshold(OpenGLRenderer* canvas);
- static inline float duration(nsecs_t start, nsecs_t end) {
- float duration = ((end - start) * 0.000001f);
+ inline float duration(size_t index, FrameInfoIndex start, FrameInfoIndex end) {
+ nsecs_t ns_start = mFrameSource[index][start];
+ nsecs_t ns_end = mFrameSource[index][end];
+ float duration = ((ns_end - ns_start) * 0.000001f);
+ // Clamp to large to avoid spiking off the top of the screen
+ duration = duration > 50.0f ? 50.0f : duration;
return duration > 0.0f ? duration : 0.0f;
}
- inline float recordDuration(size_t index) {
- return duration(
- mFrameSource[index][FrameInfoIndex::kIntendedVsync],
- mFrameSource[index][FrameInfoIndex::kSyncStart]);
- }
-
- inline float prepareDuration(size_t index) {
- return duration(
- mFrameSource[index][FrameInfoIndex::kSyncStart],
- mFrameSource[index][FrameInfoIndex::kIssueDrawCommandsStart]);
- }
-
- inline float issueDrawDuration(size_t index) {
- return duration(
- mFrameSource[index][FrameInfoIndex::kIssueDrawCommandsStart],
- mFrameSource[index][FrameInfoIndex::kSwapBuffers]);
- }
-
- inline float swapBuffersDuration(size_t index) {
- return duration(
- mFrameSource[index][FrameInfoIndex::kSwapBuffers],
- mFrameSource[index][FrameInfoIndex::kFrameCompleted]);
- }
-
ProfileType mType = ProfileType::None;
float mDensity = 0;
FrameInfoSource& mFrameSource;
int mVerticalUnit = 0;
- int mHorizontalUnit = 0;
int mThresholdStroke = 0;
- /*
- * mRects represents an array of rect shapes, divided into NUM_ELEMENTS
- * groups such that each group is drawn with the same paint.
- * For example mRects[0] is the array of rect floats suitable for
- * OpenGLRenderer:drawRects() that makes up all the FrameTimingData:record
- * information.
- */
- std::unique_ptr<float*> mRects;
+ int mNumFastRects;
+ std::unique_ptr<float[]> mFastRects;
+ int mNumJankyRects;
+ std::unique_ptr<float[]> mJankyRects;
bool mShowDirtyRegions = false;
SkRect mDirtyRegion;