diff options
author | Matt Sarett <msarett@google.com> | 2016-10-26 11:03:23 -0400 |
---|---|---|
committer | Matt Sarett <msarett@google.com> | 2016-11-03 21:42:58 -0400 |
commit | cf2c05c652190ddc66f873192c17d193478138a1 (patch) | |
tree | 5c7860deb0714ae58325d8d7b69403bf9481bccb /libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp | |
parent | 46998bc3b238bbf811ac0eab48ac20a5e709924e (diff) |
Add SkiaProfileRenderer to draw visual debugging info
This adds support for debug.hwui.profile and
debug.hwui.show_dirty_regions to the Skia pipelines.
There still may be some follow up work for profiling
with visual bars. The speed at which the renderer
is able to draw the rects in the graph is having a
noticeable effect on the actual data in the graphs.
Test: Verified that the features work as expected.
BUG:32370375
Change-Id: I24430da2bab3eb54f6a771f9c984f8ae0008a5a7
Diffstat (limited to 'libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp')
-rw-r--r-- | libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp b/libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp index 519de967794d..494f14d2a75b 100644 --- a/libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp +++ b/libs/hwui/pipeline/skia/SkiaOpenGLPipeline.cpp @@ -20,6 +20,8 @@ #include "renderthread/EglManager.h" #include "renderstate/RenderState.h" #include "Readback.h" +#include "SkiaPipeline.h" +#include "SkiaProfileRenderer.h" #include "utils/TraceUtils.h" #include <android/native_window.h> @@ -83,6 +85,16 @@ bool SkiaOpenGLPipeline::draw(const Frame& frame, const SkRect& screenDirty, SkiaPipeline::updateLighting(lightGeometry, lightInfo); renderFrame(*layerUpdateQueue, dirty, renderNodes, opaque, contentDrawBounds, surface); layerUpdateQueue->clear(); + + // Draw visual debugging features + if (CC_UNLIKELY(Properties::showDirtyRegions + || ProfileType::None == Properties::getProfileType())) { + SkCanvas* profileCanvas = surface->getCanvas(); + SkiaProfileRenderer profileRenderer(profileCanvas); + profiler->draw(profileRenderer); + profileCanvas->flush(); + } + return true; } |