| Index: chrome/browser/android/vr_shell/textures/splash_screen_icon_texture.cc
|
| diff --git a/chrome/browser/android/vr_shell/textures/splash_screen_icon_texture.cc b/chrome/browser/android/vr_shell/textures/splash_screen_icon_texture.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..6bc62a4cf1633722a2ca2c241ae701f7becbeaeb
|
| --- /dev/null
|
| +++ b/chrome/browser/android/vr_shell/textures/splash_screen_icon_texture.cc
|
| @@ -0,0 +1,38 @@
|
| +// Copyright 2017 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "chrome/browser/android/vr_shell/textures/splash_screen_icon_texture.h"
|
| +
|
| +#include "ui/gfx/canvas.h"
|
| +
|
| +namespace vr_shell {
|
| +
|
| +SplashScreenIconTexture::SplashScreenIconTexture() = default;
|
| +
|
| +SplashScreenIconTexture::~SplashScreenIconTexture() = default;
|
| +
|
| +void SplashScreenIconTexture::SetSplashScreenIconBitmap(
|
| + const SkBitmap& bitmap) {
|
| + splash_screen_icon_ = SkImage::MakeFromBitmap(bitmap);
|
| + set_dirty();
|
| +}
|
| +
|
| +void SplashScreenIconTexture::Draw(SkCanvas* sk_canvas,
|
| + const gfx::Size& texture_size) {
|
| + size_.set_width(texture_size.width());
|
| + size_.set_height(texture_size.height());
|
| +
|
| + sk_canvas->drawImage(splash_screen_icon_, 0, 0);
|
| +}
|
| +
|
| +gfx::Size SplashScreenIconTexture::GetPreferredTextureSize(
|
| + int maximum_width) const {
|
| + return gfx::Size(maximum_width, maximum_width);
|
| +}
|
| +
|
| +gfx::SizeF SplashScreenIconTexture::GetDrawnSize() const {
|
| + return size_;
|
| +}
|
| +
|
| +} // namespace vr_shell
|
|
|