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/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 #include "services/service_manager/public/cpp/connector.h" | 9 #include "services/service_manager/public/cpp/connector.h" |
10 #include "services/ui/demo/bitmap_uploader.h" | 10 #include "services/ui/demo/bitmap_uploader.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 canvas->drawRect(rect, paint); | 57 canvas->drawRect(rect, paint); |
58 } | 58 } |
59 | 59 |
60 } // namespace | 60 } // namespace |
61 | 61 |
62 MusDemo::MusDemo() {} | 62 MusDemo::MusDemo() {} |
63 | 63 |
64 MusDemo::~MusDemo() {} | 64 MusDemo::~MusDemo() {} |
65 | 65 |
66 void MusDemo::OnStart(const shell::Identity& identity) { | 66 void MusDemo::OnStart(const service_manager::Identity& identity) { |
67 gpu_service_ = GpuService::Create(connector()); | 67 gpu_service_ = GpuService::Create(connector()); |
68 window_tree_client_ = base::MakeUnique<WindowTreeClient>(this, this); | 68 window_tree_client_ = base::MakeUnique<WindowTreeClient>(this, this); |
69 window_tree_client_->ConnectAsWindowManager(connector()); | 69 window_tree_client_->ConnectAsWindowManager(connector()); |
70 } | 70 } |
71 | 71 |
72 bool MusDemo::OnConnect(const shell::Identity& remote_identity, | 72 bool MusDemo::OnConnect(const service_manager::Identity& remote_identity, |
73 shell::InterfaceRegistry* registry) { | 73 service_manager::InterfaceRegistry* registry) { |
74 return true; | 74 return true; |
75 } | 75 } |
76 | 76 |
77 void MusDemo::OnEmbed(Window* window) { | 77 void MusDemo::OnEmbed(Window* window) { |
78 // Not called for the WindowManager. | 78 // Not called for the WindowManager. |
79 NOTREACHED(); | 79 NOTREACHED(); |
80 } | 80 } |
81 | 81 |
82 void MusDemo::OnEmbedRootDestroyed(Window* root) { | 82 void MusDemo::OnEmbedRootDestroyed(Window* root) { |
83 // Not called for the WindowManager. | 83 // Not called for the WindowManager. |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 new std::vector<unsigned char>(addr, addr + bytes)); | 184 new std::vector<unsigned char>(addr, addr + bytes)); |
185 bitmap_.unlockPixels(); | 185 bitmap_.unlockPixels(); |
186 | 186 |
187 // Send frame to MUS via BitmapUploader. | 187 // Send frame to MUS via BitmapUploader. |
188 uploader_->SetBitmap(bounds.width(), bounds.height(), std::move(data), | 188 uploader_->SetBitmap(bounds.width(), bounds.height(), std::move(data), |
189 BitmapUploader::BGRA); | 189 BitmapUploader::BGRA); |
190 } | 190 } |
191 | 191 |
192 } // namespace demo | 192 } // namespace demo |
193 } // namespace ui | 193 } // namespace ui |
OLD | NEW |