Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(372)

Side by Side Diff: services/ui/demo/mus_demo.cc

Issue 2447303002: Scale client area, hit test mask and bounds by device_scale_factor. (Closed)
Patch Set: rebase Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « services/ui/demo/mus_demo.h ('k') | services/ui/public/cpp/tests/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/service_manager/public/cpp/service_context.h" 10 #include "services/service_manager/public/cpp/service_context.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 -SkFloatToScalar(canvas_size.height() * 0.5f)); 55 -SkFloatToScalar(canvas_size.height() * 0.5f));
56 } 56 }
57 57
58 canvas->drawRect(rect, paint); 58 canvas->drawRect(rect, paint);
59 } 59 }
60 60
61 } // namespace 61 } // namespace
62 62
63 MusDemo::MusDemo() {} 63 MusDemo::MusDemo() {}
64 64
65 MusDemo::~MusDemo() {} 65 MusDemo::~MusDemo() {
66 display::Screen::SetScreenInstance(nullptr);
67 }
66 68
67 void MusDemo::OnStart() { 69 void MusDemo::OnStart() {
70 screen_ = base::MakeUnique<display::ScreenBase>();
71 display::Screen::SetScreenInstance(screen_.get());
68 gpu_service_ = GpuService::Create(context()->connector()); 72 gpu_service_ = GpuService::Create(context()->connector());
69 window_tree_client_ = base::MakeUnique<WindowTreeClient>(this, this); 73 window_tree_client_ = base::MakeUnique<WindowTreeClient>(this, this);
70 window_tree_client_->ConnectAsWindowManager(context()->connector()); 74 window_tree_client_->ConnectAsWindowManager(context()->connector());
71 } 75 }
72 76
73 bool MusDemo::OnConnect(const service_manager::ServiceInfo& remote_info, 77 bool MusDemo::OnConnect(const service_manager::ServiceInfo& remote_info,
74 service_manager::InterfaceRegistry* registry) { 78 service_manager::InterfaceRegistry* registry) {
75 return true; 79 return true;
76 } 80 }
77 81
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 BitmapUploader::Format bitmap_format = BitmapUploader::BGRA; 204 BitmapUploader::Format bitmap_format = BitmapUploader::BGRA;
201 #endif 205 #endif
202 206
203 // Send frame to MUS via BitmapUploader. 207 // Send frame to MUS via BitmapUploader.
204 uploader_->SetBitmap(bounds.width(), bounds.height(), std::move(data), 208 uploader_->SetBitmap(bounds.width(), bounds.height(), std::move(data),
205 bitmap_format); 209 bitmap_format);
206 } 210 }
207 211
208 } // namespace demo 212 } // namespace demo
209 } // namespace ui 213 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/demo/mus_demo.h ('k') | services/ui/public/cpp/tests/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698