/src/mozilla-central/widget/headless/HeadlessCompositorWidget.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
3 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
4 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
5 | | |
6 | | #include "mozilla/widget/PlatformWidgetTypes.h" |
7 | | #include "HeadlessCompositorWidget.h" |
8 | | #include "VsyncDispatcher.h" |
9 | | |
10 | | namespace mozilla { |
11 | | namespace widget { |
12 | | |
13 | | HeadlessCompositorWidget::HeadlessCompositorWidget(const HeadlessCompositorWidgetInitData& aInitData, |
14 | | const layers::CompositorOptions& aOptions, |
15 | | HeadlessWidget* aWindow) |
16 | | : CompositorWidget(aOptions) |
17 | | , mWidget(aWindow) |
18 | 0 | { |
19 | 0 | mClientSize = aInitData.InitialClientSize(); |
20 | 0 | } |
21 | | |
22 | | void |
23 | | HeadlessCompositorWidget::ObserveVsync(VsyncObserver* aObserver) |
24 | 0 | { |
25 | 0 | if (RefPtr<CompositorVsyncDispatcher> cvd = mWidget->GetCompositorVsyncDispatcher()) { |
26 | 0 | cvd->SetCompositorVsyncObserver(aObserver); |
27 | 0 | } |
28 | 0 | } |
29 | | |
30 | | nsIWidget* HeadlessCompositorWidget::RealWidget() |
31 | 0 | { |
32 | 0 | return mWidget; |
33 | 0 | } |
34 | | |
35 | | void |
36 | | HeadlessCompositorWidget::NotifyClientSizeChanged(const LayoutDeviceIntSize& aClientSize) |
37 | 0 | { |
38 | 0 | mClientSize = aClientSize; |
39 | 0 | } |
40 | | |
41 | | LayoutDeviceIntSize |
42 | | HeadlessCompositorWidget::GetClientSize() |
43 | 0 | { |
44 | 0 | return mClientSize; |
45 | 0 | } |
46 | | |
47 | | uintptr_t |
48 | | HeadlessCompositorWidget::GetWidgetKey() |
49 | 0 | { |
50 | 0 | return reinterpret_cast<uintptr_t>(mWidget); |
51 | 0 | } |
52 | | |
53 | | } // namespace widget |
54 | | } // namespace mozilla |