| 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();
|
| }
|
|
|
|
|