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) {} | 93 void MusDemo::OnEventObserved(const ui::Event& event, mus::Window* target) {} |
94 | 94 |
95 void MusDemo::SetWindowManagerClient(mus::WindowManagerClient* client) {} | 95 void MusDemo::SetWindowManagerClient(mus::WindowManagerClient* client) {} |
96 | 96 |
97 bool MusDemo::OnWmSetBounds(mus::Window* window, gfx::Rect* bounds) { | 97 bool MusDemo::OnWmSetBounds(mus::Window* window, gfx::Rect* bounds) { |
98 return true; | 98 return true; |
99 } | 99 } |
100 | 100 |
101 bool MusDemo::OnWmSetProperty(mus::Window* window, | 101 bool MusDemo::OnWmSetProperty(mus::Window* window, |
102 const std::string& name, | 102 const std::string& name, |
103 std::unique_ptr<std::vector<uint8_t>>* new_data) { | 103 std::unique_ptr<std::vector<uint8_t>>* new_data) { |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 std::unique_ptr<std::vector<unsigned char>> data( | 152 std::unique_ptr<std::vector<unsigned char>> data( |
153 new std::vector<unsigned char>(addr, addr + bytes)); | 153 new std::vector<unsigned char>(addr, addr + bytes)); |
154 bitmap_.unlockPixels(); | 154 bitmap_.unlockPixels(); |
155 | 155 |
156 // Send frame to MUS via BitmapUploader. | 156 // Send frame to MUS via BitmapUploader. |
157 uploader_->SetBitmap(bounds.width(), bounds.height(), std::move(data), | 157 uploader_->SetBitmap(bounds.width(), bounds.height(), std::move(data), |
158 bitmap_uploader::BitmapUploader::BGRA); | 158 bitmap_uploader::BitmapUploader::BGRA); |
159 } | 159 } |
160 | 160 |
161 } // namespace mus_demo | 161 } // namespace mus_demo |
OLD | NEW |