| 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 "services/ui/demo/mus_demo.h" | 5 #include "services/ui/demo/mus_demo.h" |
| 6 | 6 |
| 7 #include "base/time/time.h" | 7 #include "base/time/time.h" |
| 8 #include "services/shell/public/cpp/connector.h" | 8 #include "services/shell/public/cpp/connector.h" |
| 9 #include "services/ui/demo/bitmap_uploader.h" | 9 #include "services/ui/demo/bitmap_uploader.h" |
| 10 #include "services/ui/public/cpp/gpu_service.h" | 10 #include "services/ui/public/cpp/gpu_service.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 | 58 |
| 59 } // namespace | 59 } // namespace |
| 60 | 60 |
| 61 MusDemo::MusDemo() {} | 61 MusDemo::MusDemo() {} |
| 62 | 62 |
| 63 MusDemo::~MusDemo() { | 63 MusDemo::~MusDemo() { |
| 64 delete window_tree_client_; | 64 delete window_tree_client_; |
| 65 } | 65 } |
| 66 | 66 |
| 67 void MusDemo::OnStart(const shell::Identity& identity) { | 67 void MusDemo::OnStart(const shell::Identity& identity) { |
| 68 gpu_service_ = GpuService::Initialize(connector()); | 68 gpu_service_ = GpuService::Create(connector()); |
| 69 window_tree_client_ = new WindowTreeClient(this, this, nullptr); | 69 window_tree_client_ = new WindowTreeClient(this, this, nullptr); |
| 70 window_tree_client_->ConnectAsWindowManager(connector()); | 70 window_tree_client_->ConnectAsWindowManager(connector()); |
| 71 } | 71 } |
| 72 | 72 |
| 73 bool MusDemo::OnConnect(const shell::Identity& remote_identity, | 73 bool MusDemo::OnConnect(const shell::Identity& remote_identity, |
| 74 shell::InterfaceRegistry* registry) { | 74 shell::InterfaceRegistry* registry) { |
| 75 return true; | 75 return true; |
| 76 } | 76 } |
| 77 | 77 |
| 78 void MusDemo::OnEmbed(Window* window) { | 78 void MusDemo::OnEmbed(Window* window) { |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 new std::vector<unsigned char>(addr, addr + bytes)); | 175 new std::vector<unsigned char>(addr, addr + bytes)); |
| 176 bitmap_.unlockPixels(); | 176 bitmap_.unlockPixels(); |
| 177 | 177 |
| 178 // Send frame to MUS via BitmapUploader. | 178 // Send frame to MUS via BitmapUploader. |
| 179 uploader_->SetBitmap(bounds.width(), bounds.height(), std::move(data), | 179 uploader_->SetBitmap(bounds.width(), bounds.height(), std::move(data), |
| 180 ui::BitmapUploader::BGRA); | 180 ui::BitmapUploader::BGRA); |
| 181 } | 181 } |
| 182 | 182 |
| 183 } // namespace demo | 183 } // namespace demo |
| 184 } // namespace ui | 184 } // namespace ui |
| OLD | NEW |