| Index: chrome/browser/android/vr_shell/ui_elements/textured_element.cc
|
| diff --git a/chrome/browser/android/vr_shell/ui_elements/textured_element.cc b/chrome/browser/android/vr_shell/ui_elements/textured_element.cc
|
| index 3623c1e4529105dbc6381f1d1d13b609bc2b1fbb..3dc5b8b39d4e55bd402c695f2a0bb09de54d805a 100644
|
| --- a/chrome/browser/android/vr_shell/ui_elements/textured_element.cc
|
| +++ b/chrome/browser/android/vr_shell/ui_elements/textured_element.cc
|
| @@ -20,16 +20,20 @@ void TexturedElement::Initialize() {
|
| glGenTextures(1, &texture_handle_);
|
| DCHECK(GetTexture() != nullptr);
|
| texture_size_ = GetTexture()->GetPreferredTextureSize(maximum_width_);
|
| - sk_sp<SkSurface> surface = SkSurface::MakeRasterN32Premul(
|
| - texture_size_.width(), texture_size_.height());
|
| - GetTexture()->DrawAndLayout(surface->getCanvas(), texture_size_);
|
| - Flush(surface.get());
|
| + Update();
|
| set_fill(Fill::SELF);
|
| gfx::SizeF drawn_size = GetTexture()->GetDrawnSize();
|
| float y = drawn_size.height() / drawn_size.width() * size().x();
|
| set_size({size().x(), y, 1});
|
| }
|
|
|
| +void TexturedElement::Update() {
|
| + sk_sp<SkSurface> surface = SkSurface::MakeRasterN32Premul(
|
| + texture_size_.width(), texture_size_.height());
|
| + GetTexture()->DrawAndLayout(surface->getCanvas(), texture_size_);
|
| + Flush(surface.get());
|
| +}
|
| +
|
| void TexturedElement::Render(VrShellRenderer* renderer,
|
| vr::Mat4f view_proj_matrix) const {
|
| gfx::SizeF drawn_size = GetTexture()->GetDrawnSize();
|
|
|