Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Unified Diff: chrome/browser/android/vr_shell/textures/insecure_content_transient_texture.cc

Issue 2861343002: Enable gpu rasterization in the vr shell
Patch Set: additional trace instrumentation Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/vr_shell/textures/insecure_content_transient_texture.cc
diff --git a/chrome/browser/android/vr_shell/textures/insecure_content_transient_texture.cc b/chrome/browser/android/vr_shell/textures/insecure_content_transient_texture.cc
index bc2e99b6d93bb17f01b8adfaa5373ed6d9101bab..21b1a107a3733988c914e03ebd303c088d6bedfe 100644
--- a/chrome/browser/android/vr_shell/textures/insecure_content_transient_texture.cc
+++ b/chrome/browser/android/vr_shell/textures/insecure_content_transient_texture.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/android/vr_shell/textures/insecure_content_transient_texture.h"
+#include "base/trace_event/trace_event.h"
#include "cc/paint/skia_paint_canvas.h"
#include "components/strings/grit/components_strings.h"
#include "ui/base/l10n/l10n_util.h"
@@ -33,15 +34,22 @@ InsecureContentTransientTexture::~InsecureContentTransientTexture() = default;
void InsecureContentTransientTexture::Draw(gfx::Canvas* canvas,
const gfx::Size& texture_size) {
+ TRACE_EVENT0("gpu,vr", "InsecureContentTransientTexture::Draw");
size_.set_width(texture_size.width());
int max_height = texture_size.height();
cc::PaintFlags flags;
flags.setColor(kBackgroundColor);
+ TRACE_EVENT_BEGIN0("gpu,vr", "GetStringUTF16");
int text_flags = gfx::Canvas::TEXT_ALIGN_CENTER | gfx::Canvas::MULTI_LINE;
auto text =
l10n_util::GetStringUTF16(IDS_PAGE_INFO_INSECURE_WEBVR_CONTENT_TRANSIENT);
+ TRACE_EVENT_END0("gpu,vr", "GetStringUTF16");
+
+ TRACE_EVENT_BEGIN0("gpu,vr", "GetFontList");
auto fonts = GetFontList(size_.width() * kFontSizeFactor, text);
+ TRACE_EVENT_END0("gpu,vr", "GetFontList");
+
int text_width = size_.width() * kTextWidthFactor;
int text_height = 0; // Will be increased during text measurement.
gfx::Canvas::SizeStringInt(text, fonts, &text_width, &text_height, 0,
@@ -58,9 +66,12 @@ void InsecureContentTransientTexture::Draw(gfx::Canvas* canvas,
canvas->Save();
canvas->Translate(gfx::Vector2d(size_.width() * kBorderFactor,
size_.width() * kBorderFactor));
+
+ TRACE_EVENT_BEGIN0("gpu,vr", "DrawStringRectWithFlags");
canvas->DrawStringRectWithFlags(
text, fonts, kForegroundColor,
gfx::Rect(kTextWidthFactor * size_.width(), text_height), text_flags);
+ TRACE_EVENT_END0("gpu,vr", "DrawStringRectWithFlags");
canvas->Restore();
}

Powered by Google App Engine
This is Rietveld 408576698