提交 59c07578 编写于 作者: A Adam Barth

Merge pull request #2239 from abarth/trace_compositor

Add some more trace events to the compositor
......@@ -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
......
......@@ -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));
......
......@@ -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.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册