Add some trace events to Sky compositor

This CL adds some basic trace events to the Sky compositor so we can see what's
going on.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/757643002
This commit is contained in:
Adam Barth
2014-11-24 09:54:28 -08:00
parent a1b7d730ce
commit 448bfbe9e5
2 changed files with 9 additions and 0 deletions

View File

@@ -4,6 +4,7 @@
#include "sky/compositor/layer.h"
#include "base/debug/trace_event.h"
#include "mojo/skia/ganesh_surface.h"
#include "sky/compositor/layer_host.h"
#include "third_party/skia/include/core/SkCanvas.h"
@@ -25,6 +26,8 @@ void Layer::SetSize(const gfx::Size& size) {
}
void Layer::Display() {
TRACE_EVENT0("sky", "Layer::Display");
DCHECK(host_);
mojo::GaneshSurface surface(host_->ganesh_context(),

View File

@@ -4,6 +4,7 @@
#include "sky/compositor/layer_host.h"
#include "base/debug/trace_event.h"
#include "base/message_loop/message_loop.h"
#include "mojo/converters/geometry/geometry_type_converters.h"
#include "mojo/gpu/gl_context.h"
@@ -53,6 +54,9 @@ void LayerHost::ReturnResources(
void LayerHost::BeginFrame(base::TimeTicks frame_time,
base::TimeTicks deadline) {
TRACE_EVENT0("sky", "LayerHost::BeginFrame");
DCHECK_EQ(state_, kWaitingForBeginFrame);
state_ = kProducingFrame;
client_->BeginFrame(frame_time);
@@ -70,6 +74,8 @@ void LayerHost::BeginFrame(base::TimeTicks frame_time,
}
void LayerHost::Upload(Layer* layer) {
TRACE_EVENT0("sky", "LayerHost::Upload");
if (!surface_holder_.IsReadyForFrame()) {
if (state_ == kProducingFrame) {
// Currently we use a timer to drive the BeginFrame cycle, which means we