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

Unified Diff: chrome/browser/android/vr_shell/textures/insecure_content_permanent_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_permanent_texture.cc
diff --git a/chrome/browser/android/vr_shell/textures/insecure_content_permanent_texture.cc b/chrome/browser/android/vr_shell/textures/insecure_content_permanent_texture.cc
index c166797dac6814af3bc5bf2f068fba702a5fea0c..234815a65046e1a3e6af6822fa3ceb489262be66 100644
--- a/chrome/browser/android/vr_shell/textures/insecure_content_permanent_texture.cc
+++ b/chrome/browser/android/vr_shell/textures/insecure_content_permanent_texture.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/android/vr_shell/textures/insecure_content_permanent_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"
@@ -35,16 +36,23 @@ InsecureContentPermanentTexture::~InsecureContentPermanentTexture() = default;
void InsecureContentPermanentTexture::Draw(gfx::Canvas* canvas,
const gfx::Size& texture_size) {
+ TRACE_EVENT0("gpu,vr", "InsecureContentPermanentTexture::Draw");
DCHECK(texture_size.height() * 4 == texture_size.width());
size_.set_height(texture_size.height());
int max_width = texture_size.width();
cc::PaintFlags flags;
flags.setColor(kBackgroundColor);
+ TRACE_EVENT_BEGIN0("gpu,vr", "GetStringUTF16");
int text_flags = gfx::Canvas::TEXT_ALIGN_CENTER | gfx::Canvas::NO_ELLIPSIS;
auto text =
l10n_util::GetStringUTF16(IDS_PAGE_INFO_INSECURE_WEBVR_CONTENT_PERMANENT);
+ TRACE_EVENT_END0("gpu,vr", "GetStringUTF16");
+
+ TRACE_EVENT_BEGIN0("gpu,vr", "GetFontList");
auto fonts = GetFontList(size_.height() * kFontSizeFactor, text);
+ TRACE_EVENT_END0("gpu,vr", "GetFontList");
+
int text_height = kTextHeightFactor * size_.height();
int text_width = kTextWidthFactor * size_.height();
gfx::Canvas::SizeStringInt(text, fonts, &text_width, &text_height, 0,
@@ -73,9 +81,12 @@ void InsecureContentPermanentTexture::Draw(gfx::Canvas* canvas,
size_.height() *
(IsRTL() ? kBorderFactor : 2 * kBorderFactor + kIconSizeFactor),
size_.height() * kBorderFactor));
+
+ TRACE_EVENT_BEGIN0("gpu,vr", "DrawStringRectWithFlags");
canvas->DrawStringRectWithFlags(
text, fonts, kForegroundColor,
gfx::Rect(text_width, kTextHeightFactor * size_.height()), text_flags);
+ TRACE_EVENT_END0("gpu,vr", "DrawStringRectWithFlags");
canvas->Restore();
}

Powered by Google App Engine
This is Rietveld 408576698