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