| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/mus/demo/mus_demo.h" | 5 #include "components/mus/demo/mus_demo.h" |
| 6 | 6 |
| 7 #include "base/time/time.h" | 7 #include "base/time/time.h" |
| 8 #include "components/bitmap_uploader/bitmap_uploader.h" | 8 #include "components/bitmap_uploader/bitmap_uploader.h" |
| 9 #include "components/mus/public/cpp/window_tree_host_factory.h" | 9 #include "components/mus/public/cpp/window_tree_host_factory.h" |
| 10 #include "third_party/skia/include/core/SkCanvas.h" | 10 #include "third_party/skia/include/core/SkCanvas.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 timer_.Start(FROM_HERE, base::TimeDelta::FromMilliseconds(kFrameDelay), | 83 timer_.Start(FROM_HERE, base::TimeDelta::FromMilliseconds(kFrameDelay), |
| 84 base::Bind(&MusDemo::DrawFrame, base::Unretained(this))); | 84 base::Bind(&MusDemo::DrawFrame, base::Unretained(this))); |
| 85 } | 85 } |
| 86 | 86 |
| 87 void MusDemo::OnUnembed(mus::Window* root) {} | 87 void MusDemo::OnUnembed(mus::Window* root) {} |
| 88 | 88 |
| 89 void MusDemo::OnConnectionLost(mus::WindowTreeConnection* connection) { | 89 void MusDemo::OnConnectionLost(mus::WindowTreeConnection* connection) { |
| 90 timer_.Stop(); | 90 timer_.Stop(); |
| 91 } | 91 } |
| 92 | 92 |
| 93 void MusDemo::OnEventObserved(const ui::Event& event) {} |
| 94 |
| 93 void MusDemo::SetWindowManagerClient(mus::WindowManagerClient* client) {} | 95 void MusDemo::SetWindowManagerClient(mus::WindowManagerClient* client) {} |
| 94 | 96 |
| 95 bool MusDemo::OnWmSetBounds(mus::Window* window, gfx::Rect* bounds) { | 97 bool MusDemo::OnWmSetBounds(mus::Window* window, gfx::Rect* bounds) { |
| 96 return true; | 98 return true; |
| 97 } | 99 } |
| 98 | 100 |
| 99 bool MusDemo::OnWmSetProperty(mus::Window* window, | 101 bool MusDemo::OnWmSetProperty(mus::Window* window, |
| 100 const std::string& name, | 102 const std::string& name, |
| 101 std::unique_ptr<std::vector<uint8_t>>* new_data) { | 103 std::unique_ptr<std::vector<uint8_t>>* new_data) { |
| 102 return true; | 104 return true; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 std::unique_ptr<std::vector<unsigned char>> data( | 152 std::unique_ptr<std::vector<unsigned char>> data( |
| 151 new std::vector<unsigned char>(addr, addr + bytes)); | 153 new std::vector<unsigned char>(addr, addr + bytes)); |
| 152 bitmap_.unlockPixels(); | 154 bitmap_.unlockPixels(); |
| 153 | 155 |
| 154 // Send frame to MUS via BitmapUploader. | 156 // Send frame to MUS via BitmapUploader. |
| 155 uploader_->SetBitmap(bounds.width(), bounds.height(), std::move(data), | 157 uploader_->SetBitmap(bounds.width(), bounds.height(), std::move(data), |
| 156 bitmap_uploader::BitmapUploader::BGRA); | 158 bitmap_uploader::BitmapUploader::BGRA); |
| 157 } | 159 } |
| 158 | 160 |
| 159 } // namespace mus_demo | 161 } // namespace mus_demo |
| OLD | NEW |