OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/wm/boot_splash_screen_chromeos.h" | 5 #include "ash/wm/boot_splash_screen_chromeos.h" |
6 | 6 |
7 #include "third_party/skia/include/core/SkBitmap.h" | 7 #include "third_party/skia/include/core/SkBitmap.h" |
8 #include "ui/aura/root_window.h" | 8 #include "ui/aura/root_window.h" |
9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
10 #include "ui/base/x/x11_util.h" | 10 #include "ui/base/x/x11_util.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 // ui::LayerDelegate overrides: | 29 // ui::LayerDelegate overrides: |
30 virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE { | 30 virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE { |
31 // It'd be safer to copy the area to a canvas in the constructor and then | 31 // It'd be safer to copy the area to a canvas in the constructor and then |
32 // copy from that canvas to this one here, but this appears to work (i.e. we | 32 // copy from that canvas to this one here, but this appears to work (i.e. we |
33 // only call this before we draw our first frame) and it saves us an extra | 33 // only call this before we draw our first frame) and it saves us an extra |
34 // copy. | 34 // copy. |
35 // TODO(derat): Instead of copying the data, use GLX_EXT_texture_from_pixmap | 35 // TODO(derat): Instead of copying the data, use GLX_EXT_texture_from_pixmap |
36 // to create a zero-copy texture (when possible): | 36 // to create a zero-copy texture (when possible): |
37 // https://codereview.chromium.org/10543125 | 37 // https://codereview.chromium.org/10543125 |
38 ui::CopyAreaToCanvas(root_window_->GetAcceleratedWidget(), | 38 ui::CopyAreaToCanvas(root_window_->host()->GetAcceleratedWidget(), |
39 gfx::Rect(root_window_->GetHostOrigin(), root_window_->GetHostSize()), | 39 root_window_->host()->GetBounds(), gfx::Point(), canvas); |
40 gfx::Point(), canvas); | |
41 } | 40 } |
42 | 41 |
43 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE {} | 42 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE {} |
44 | 43 |
45 virtual base::Closure PrepareForLayerBoundsChange() OVERRIDE { | 44 virtual base::Closure PrepareForLayerBoundsChange() OVERRIDE { |
46 return base::Closure(); | 45 return base::Closure(); |
47 } | 46 } |
48 | 47 |
49 private: | 48 private: |
50 aura::RootWindow* root_window_; // not owned | 49 aura::RootWindow* root_window_; // not owned |
(...skipping 17 matching lines...) Expand all Loading... |
68 | 67 |
69 void BootSplashScreen::StartHideAnimation(base::TimeDelta duration) { | 68 void BootSplashScreen::StartHideAnimation(base::TimeDelta duration) { |
70 ui::ScopedLayerAnimationSettings settings(layer_->GetAnimator()); | 69 ui::ScopedLayerAnimationSettings settings(layer_->GetAnimator()); |
71 settings.SetTransitionDuration(duration); | 70 settings.SetTransitionDuration(duration); |
72 settings.SetPreemptionStrategy(ui::LayerAnimator::REPLACE_QUEUED_ANIMATIONS); | 71 settings.SetPreemptionStrategy(ui::LayerAnimator::REPLACE_QUEUED_ANIMATIONS); |
73 layer_->SetOpacity(0.0f); | 72 layer_->SetOpacity(0.0f); |
74 } | 73 } |
75 | 74 |
76 } // namespace internal | 75 } // namespace internal |
77 } // namespace ash | 76 } // namespace ash |
OLD | NEW |