diff options
author | Chris Craik <ccraik@google.com> | 2014-11-20 17:50:20 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-11-20 17:50:20 +0000 |
commit | 57b641a2ed87f2827399c363053436cba88bee75 (patch) | |
tree | 2b1bc4b59c57754cec6f29562decc445f2ca9a5e /libs/hwui/OpenGLRenderer.cpp | |
parent | 6456513f6ff844fd15f3453a66fcc8fb439e1ef7 (diff) | |
parent | 3b2ba44be3699a4e133d7a09cb4ed182405d7ff9 (diff) | |
download | frameworks_base-57b641a2ed87f2827399c363053436cba88bee75.zip frameworks_base-57b641a2ed87f2827399c363053436cba88bee75.tar.gz frameworks_base-57b641a2ed87f2827399c363053436cba88bee75.tar.bz2 |
am 3b2ba44b: Merge "Improve logging around performance critical events" into lmp-mr1-dev
* commit '3b2ba44be3699a4e133d7a09cb4ed182405d7ff9':
Improve logging around performance critical events
Diffstat (limited to 'libs/hwui/OpenGLRenderer.cpp')
-rwxr-xr-x | libs/hwui/OpenGLRenderer.cpp | 32 |
1 files changed, 3 insertions, 29 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index d570b0d..80b4c2a 100755 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -42,6 +42,7 @@ #include "ShadowTessellator.h" #include "SkiaShader.h" #include "utils/GLUtils.h" +#include "utils/TraceUtils.h" #include "Vector.h" #include "VertexBuffer.h" @@ -51,21 +52,6 @@ #define EVENT_LOGD(...) #endif -static void atraceFormatBegin(const char* fmt, ...) { - const int BUFFER_SIZE = 256; - va_list ap; - char buf[BUFFER_SIZE]; - - va_start(ap, fmt); - vsnprintf(buf, BUFFER_SIZE, fmt, ap); - va_end(ap); - - ATRACE_BEGIN(buf); -} - -#define ATRACE_FORMAT_BEGIN(fmt, ...) \ - if (CC_UNLIKELY(ATRACE_ENABLED())) atraceFormatBegin(fmt, ##__VA_ARGS__) - namespace android { namespace uirenderer { @@ -466,8 +452,6 @@ void OpenGLRenderer::renderOverdraw() { bool OpenGLRenderer::updateLayer(Layer* layer, bool inFrame) { if (layer->deferredUpdateScheduled && layer->renderer && layer->renderNode.get() && layer->renderNode->isRenderable()) { - ATRACE_CALL(); - Rect& dirty = layer->dirtyRect; if (inFrame) { @@ -525,20 +509,10 @@ void OpenGLRenderer::flushLayers() { int count = mLayerUpdates.size(); if (count > 0) { startMark("Apply Layer Updates"); - char layerName[12]; // Note: it is very important to update the layers in order for (int i = 0; i < count; i++) { - Layer* layer = mLayerUpdates.itemAt(i).get(); - - sprintf(layerName, "Layer #%d", i); - startMark(layerName); - ATRACE_FORMAT_BEGIN("flushLayer %ux%u", layer->getWidth(), layer->getHeight()); - - layer->flush(); - - ATRACE_END(); - endMark(); + mLayerUpdates.itemAt(i)->flush(); } mLayerUpdates.clear(); @@ -575,7 +549,7 @@ void OpenGLRenderer::cancelLayerUpdate(Layer* layer) { } void OpenGLRenderer::flushLayerUpdates() { - ATRACE_CALL(); + ATRACE_NAME("Update HW Layers"); syncState(); updateLayers(); flushLayers(); |