Add some more trace events to the compositor

This commit is contained in:
Adam Barth 2016-01-09 00:48:42 -08:00
parent a72b88238a
commit 3cce3f0d7e
3 changed files with 19 additions and 4 deletions

View File

@ -4,6 +4,7 @@
#include "sky/compositor/layer_tree.h"
#include "base/trace_event/trace_event.h"
#include "sky/compositor/layer.h"
namespace sky {
@ -16,9 +17,16 @@ LayerTree::~LayerTree() {
}
void LayerTree::Raster(PaintContext::ScopedFrame& frame) {
Layer::PrerollContext context = { frame, SkRect::MakeEmpty() };
root_layer_->Preroll(&context, SkMatrix());
root_layer_->Paint(frame);
{
TRACE_EVENT0("flutter", "LayerTree::Preroll")
Layer::PrerollContext context = { frame, SkRect::MakeEmpty() };
root_layer_->Preroll(&context, SkMatrix());
}
{
TRACE_EVENT0("flutter", "LayerTree::Paint")
root_layer_->Paint(frame);
}
}
} // namespace compositor

View File

@ -4,8 +4,9 @@
#include "sky/compositor/raster_cache.h"
#include "sky/compositor/paint_context.h"
#include "base/logging.h"
#include "base/trace_event/trace_event.h"
#include "sky/compositor/paint_context.h"
#include "third_party/skia/include/core/SkImage.h"
#define ENABLE_RASTER_CACHE 0
@ -73,6 +74,9 @@ RefPtr<SkImage> RasterCache::GetPrerolledImage(GrContext* context,
entry.access_count = kRasterThreshold;
if (!entry.image && isWorthRasterizing(picture)) {
TRACE_EVENT2("flutter", "Rasterize picture layer",
"width", physical_size.width(),
"height", physical_size.height());
SkMatrix matrix = SkMatrix::MakeScale(scaleX, scaleY);
entry.image = adoptRef(SkImage::NewFromPicture(picture, physical_size,
&matrix, nullptr));

View File

@ -72,6 +72,9 @@ static const char* kDartArgs[] = {
// default profile period to 100Hz. This number is suitable for older
// Raspberry Pi devices but quite low for current smartphones.
"--profile_period=1000",
// Background compilation isn't quite ready, but this flag turns it on if we
// want to experiment with it.
// "--background_compilation",
#if (WTF_OS_IOS || WTF_OS_MACOSX)
// On platforms where LLDB is the primary debugger, SIGPROF signals
// overwhelm LLDB.