| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/android/vr_shell/textures/splash_screen_icon_texture.h" |
| 6 |
| 7 #include "ui/gfx/canvas.h" |
| 8 |
| 9 namespace vr_shell { |
| 10 |
| 11 SplashScreenIconTexture::SplashScreenIconTexture() = default; |
| 12 |
| 13 SplashScreenIconTexture::~SplashScreenIconTexture() = default; |
| 14 |
| 15 void SplashScreenIconTexture::SetSplashScreenIconBitmap( |
| 16 const SkBitmap& bitmap) { |
| 17 splash_screen_icon_ = SkImage::MakeFromBitmap(bitmap); |
| 18 set_dirty(); |
| 19 } |
| 20 |
| 21 void SplashScreenIconTexture::Draw(SkCanvas* sk_canvas, |
| 22 const gfx::Size& texture_size) { |
| 23 size_.set_width(texture_size.width()); |
| 24 size_.set_height(texture_size.height()); |
| 25 |
| 26 sk_canvas->drawImage(splash_screen_icon_, 0, 0); |
| 27 } |
| 28 |
| 29 gfx::Size SplashScreenIconTexture::GetPreferredTextureSize( |
| 30 int maximum_width) const { |
| 31 return gfx::Size(maximum_width, maximum_width); |
| 32 } |
| 33 |
| 34 gfx::SizeF SplashScreenIconTexture::GetDrawnSize() const { |
| 35 return size_; |
| 36 } |
| 37 |
| 38 } // namespace vr_shell |
| OLD | NEW |