提交 11dd5cad 编写于 作者: A Adam Barth 提交者: GitHub

Add trace events to swap buffers (#2823)

上级 d71a864e
......@@ -118,7 +118,11 @@ void RasterizerDirect::Draw(uint64_t layer_tree_ptr,
compositor_context_.AcquireFrame(ganesh_canvas_.gr_context(), *canvas);
canvas->clear(SK_ColorBLACK);
layer_tree->Raster(frame);
canvas->flush();
{
TRACE_EVENT0("flutter", "SkCanvas::Flush");
canvas->flush();
}
platform_view_->SwapBuffers();
}
......
......@@ -13,11 +13,12 @@
#include "base/bind.h"
#include "base/location.h"
#include "base/trace_event/trace_event.h"
#include "jni/FlutterView_jni.h"
#include "sky/engine/core/script/dart_service_isolate.h"
#include "sky/engine/wtf/MakeUnique.h"
#include "sky/shell/shell.h"
#include "sky/shell/shell_view.h"
#include "sky/shell/shell.h"
namespace sky {
namespace shell {
......@@ -339,6 +340,7 @@ bool PlatformViewAndroid::ContextMakeCurrent() {
}
bool PlatformViewAndroid::SwapBuffers() {
TRACE_EVENT0("flutter", "PlatformViewAndroid::SwapBuffers");
return context_ != nullptr ? context_->SwapBuffers() : false;
}
......
......@@ -2,9 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "sky/shell/platform/ios/platform_view_ios.h"
#include "base/mac/scoped_nsautorelease_pool.h"
#include "base/trace_event/trace_event.h"
#include "sky/engine/wtf/MakeUnique.h"
#include "sky/shell/platform/ios/platform_view_ios.h"
#import <OpenGLES/ES2/gl.h>
#import <OpenGLES/ES2/glext.h>
......@@ -284,6 +286,7 @@ bool PlatformViewIOS::ContextMakeCurrent() {
}
bool PlatformViewIOS::SwapBuffers() {
TRACE_EVENT0("flutter", "PlatformViewIOS::SwapBuffers");
return context_ != nullptr ? context_->PresentRenderBuffer() : false;
}
......
......@@ -6,6 +6,8 @@
#include <AppKit/AppKit.h>
#include "base/trace_event/trace_event.h"
namespace sky {
namespace shell {
......@@ -42,6 +44,8 @@ bool PlatformViewMac::ContextMakeCurrent() {
}
bool PlatformViewMac::SwapBuffers() {
TRACE_EVENT0("flutter", "PlatformViewMac::SwapBuffers");
if (!IsValid()) {
return false;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册