Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(227)

Side by Side Diff: chrome/browser/android/vr_shell/textures/splash_screen_icon_texture.cc

Issue 2955483003: Show splash screen when entering VR from a deep-link (Closed)
Patch Set: . Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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::SetSplashScreenIcon(const SkBitmap& bitmap) {
16 splash_screen_icon_ = SkImage::MakeFromBitmap(bitmap);
17 set_dirty();
18 }
19
20 void SplashScreenIconTexture::Draw(SkCanvas* sk_canvas,
21 const gfx::Size& texture_size) {
22 size_.set_width(texture_size.width());
23 size_.set_height(texture_size.height());
24
25 sk_canvas->drawImage(splash_screen_icon_, 0, 0);
26 }
27
28 gfx::Size SplashScreenIconTexture::GetPreferredTextureSize(
29 int maximum_width) const {
30 return gfx::Size(maximum_width, maximum_width);
31 }
32
33 gfx::SizeF SplashScreenIconTexture::GetDrawnSize() const {
34 return size_;
35 }
36
37 } // namespace vr_shell
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698