Commit 8e297c1c authored by Bret Sepulveda's avatar Bret Sepulveda Committed by Commit Bot

Add trace events to window frame code, to measure performance.

Bug: 829137
Change-Id: I1bcce9e0a61d0528318d9c58814fba3de9377434
Reviewed-on: https://chromium-review.googlesource.com/998997Reviewed-by: default avatarBruce Dawson <brucedawson@chromium.org>
Commit-Queue: Bret Sepulveda <bsep@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548635}
parent 5e4c7d7b
......@@ -7,6 +7,7 @@
#include <dwmapi.h>
#include <utility>
#include "base/trace_event/common/trace_event_common.h"
#include "base/win/windows_version.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/app/chrome_dll_resource.h"
......@@ -419,6 +420,7 @@ bool GlassBrowserFrameView::IsMaximized() const {
// GlassBrowserFrameView, views::View overrides:
void GlassBrowserFrameView::OnPaint(gfx::Canvas* canvas) {
TRACE_EVENT0("views.frame", "GlassBrowserFrameView::OnPaint");
if (ShouldCustomDrawSystemTitlebar())
PaintTitlebar(canvas);
if (!browser_view()->IsTabStripVisible())
......@@ -430,6 +432,7 @@ void GlassBrowserFrameView::OnPaint(gfx::Canvas* canvas) {
}
void GlassBrowserFrameView::Layout() {
TRACE_EVENT0("views.frame", "GlassBrowserFrameView::Layout");
if (ShouldCustomDrawSystemTitlebar()) {
// The profile switcher button depends on the caption button layout, so this
// must be called prior to LayoutProfileSwitcher().
......@@ -606,6 +609,7 @@ Windows10CaptionButton* GlassBrowserFrameView::CreateCaptionButton(
}
void GlassBrowserFrameView::PaintTitlebar(gfx::Canvas* canvas) const {
TRACE_EVENT0("views.frame", "GlassBrowserFrameView::PaintTitlebar");
gfx::Rect tabstrip_bounds = GetBoundsForTabStrip(browser_view()->tabstrip());
cc::PaintFlags flags;
......@@ -784,6 +788,7 @@ void GlassBrowserFrameView::LayoutIncognitoIcon() {
}
void GlassBrowserFrameView::LayoutTitleBar() {
TRACE_EVENT0("views.frame", "GlassBrowserFrameView::LayoutTitleBar");
if (!ShowCustomIcon() && !ShowCustomTitle())
return;
......@@ -819,12 +824,14 @@ void GlassBrowserFrameView::LayoutTitleBar() {
void GlassBrowserFrameView::LayoutCaptionButton(Windows10CaptionButton* button,
int previous_button_x) {
TRACE_EVENT0("views.frame", "GlassBrowserFrameView::LayoutCaptionButton");
gfx::Size button_size = button->GetPreferredSize();
button->SetBounds(previous_button_x - button_size.width(), WindowTopY(),
button_size.width(), button_size.height());
}
void GlassBrowserFrameView::LayoutCaptionButtons() {
TRACE_EVENT0("views.frame", "GlassBrowserFrameView::LayoutCaptionButtons");
LayoutCaptionButton(close_button_, width());
LayoutCaptionButton(restore_button_, close_button_->x());
......
......@@ -455,6 +455,7 @@ bool OpaqueBrowserFrameView::UseCustomFrame() const {
// views::View:
void OpaqueBrowserFrameView::OnPaint(gfx::Canvas* canvas) {
TRACE_EVENT0("views.frame", "OpaqueBrowserFrameView::OnPaint");
if (frame()->IsFullscreen())
return; // Nothing is visible, so don't bother to paint.
......
......@@ -642,6 +642,7 @@ void OpaqueBrowserFrameViewLayout::SetView(int id, views::View* view) {
// OpaqueBrowserFrameViewLayout, views::LayoutManager:
void OpaqueBrowserFrameViewLayout::Layout(views::View* host) {
TRACE_EVENT0("views.frame", "OpaqueBrowserFrameViewLayout::Layout");
// Reset all our data so that everything is invisible.
int top_area_padding = TopAreaPadding();
leading_button_start_ = top_area_padding;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment