| 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/window.h" | 8 #include "ui/aura/window.h" |
| 9 #include "ui/aura/window_tree_host.h" | 9 #include "ui/aura/window_tree_host.h" |
| 10 #include "ui/compositor/layer.h" | 10 #include "ui/compositor/layer.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 // ui::LayerDelegate overrides: | 35 // ui::LayerDelegate overrides: |
| 36 void OnPaintLayer(const ui::PaintContext& context) override { | 36 void OnPaintLayer(const ui::PaintContext& context) override { |
| 37 // It'd be safer to copy the area to a canvas in the constructor and then | 37 // It'd be safer to copy the area to a canvas in the constructor and then |
| 38 // copy from that canvas to this one here, but this appears to work (i.e. we | 38 // copy from that canvas to this one here, but this appears to work (i.e. we |
| 39 // only call this before we draw our first frame) and it saves us an extra | 39 // only call this before we draw our first frame) and it saves us an extra |
| 40 // copy. | 40 // copy. |
| 41 // TODO(derat): Instead of copying the data, use GLX_EXT_texture_from_pixmap | 41 // TODO(derat): Instead of copying the data, use GLX_EXT_texture_from_pixmap |
| 42 // to create a zero-copy texture (when possible): | 42 // to create a zero-copy texture (when possible): |
| 43 // https://codereview.chromium.org/10543125 | 43 // https://codereview.chromium.org/10543125 |
| 44 #if defined(USE_X11) | 44 #if defined(USE_X11) |
| 45 ui::PaintRecorder recorder(context, host_->GetBounds().size()); | 45 ui::PaintRecorder recorder(context, host_->GetBoundsInPixels().size()); |
| 46 ui::CopyAreaToCanvas(host_->GetAcceleratedWidget(), host_->GetBounds(), | 46 ui::CopyAreaToCanvas(host_->GetAcceleratedWidget(), |
| 47 gfx::Point(), recorder.canvas()); | 47 host_->GetBoundsInPixels(), gfx::Point(), |
| 48 recorder.canvas()); |
| 48 #else | 49 #else |
| 49 // TODO(spang): Figure out what to do here. | 50 // TODO(spang): Figure out what to do here. |
| 50 NOTIMPLEMENTED(); | 51 NOTIMPLEMENTED(); |
| 51 #endif | 52 #endif |
| 52 } | 53 } |
| 53 | 54 |
| 54 void OnDelegatedFrameDamage(const gfx::Rect& damage_rect_in_dip) override {} | 55 void OnDelegatedFrameDamage(const gfx::Rect& damage_rect_in_dip) override {} |
| 55 | 56 |
| 56 void OnDeviceScaleFactorChanged(float device_scale_factor) override {} | 57 void OnDeviceScaleFactorChanged(float device_scale_factor) override {} |
| 57 | 58 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 77 BootSplashScreen::~BootSplashScreen() {} | 78 BootSplashScreen::~BootSplashScreen() {} |
| 78 | 79 |
| 79 void BootSplashScreen::StartHideAnimation(base::TimeDelta duration) { | 80 void BootSplashScreen::StartHideAnimation(base::TimeDelta duration) { |
| 80 ui::ScopedLayerAnimationSettings settings(layer_->GetAnimator()); | 81 ui::ScopedLayerAnimationSettings settings(layer_->GetAnimator()); |
| 81 settings.SetTransitionDuration(duration); | 82 settings.SetTransitionDuration(duration); |
| 82 settings.SetPreemptionStrategy(ui::LayerAnimator::REPLACE_QUEUED_ANIMATIONS); | 83 settings.SetPreemptionStrategy(ui::LayerAnimator::REPLACE_QUEUED_ANIMATIONS); |
| 83 layer_->SetOpacity(0.0f); | 84 layer_->SetOpacity(0.0f); |
| 84 } | 85 } |
| 85 | 86 |
| 86 } // namespace ash | 87 } // namespace ash |
| OLD | NEW |