summaryrefslogtreecommitdiffstats
path: root/src/core/delegated_frame_host_client_qt.cpp
blob: ad1de91f624dee0c99ea4d8c817d68f0f5924ec1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Copyright (C) 2019 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

#include "delegated_frame_host_client_qt.h"

#include "render_widget_host_view_qt.h"

namespace QtWebEngineCore {

ui::Layer *DelegatedFrameHostClientQt::DelegatedFrameHostGetLayer() const
{
    return p->m_rootLayer.get();
}

bool DelegatedFrameHostClientQt::DelegatedFrameHostIsVisible() const
{
    return !p->host()->is_hidden();
}

SkColor DelegatedFrameHostClientQt::DelegatedFrameHostGetGutterColor() const
{
    return p->GetBackgroundColor().value_or(SK_ColorWHITE);
}

void DelegatedFrameHostClientQt::OnFrameTokenChanged(uint32_t frame_token, base::TimeTicks activation_time)
{
    p->OnFrameTokenChangedForView(frame_token, activation_time);
}

float DelegatedFrameHostClientQt::GetDeviceScaleFactor() const
{
    return p->GetScreenInfo().device_scale_factor;
}

void DelegatedFrameHostClientQt::InvalidateLocalSurfaceIdOnEviction()
{
    p->m_dfhLocalSurfaceIdAllocator.Invalidate();
}

std::vector<viz::SurfaceId> DelegatedFrameHostClientQt::CollectSurfaceIdsForEviction()
{
    return p->host()->CollectSurfaceIdsForEviction();
}

bool DelegatedFrameHostClientQt::ShouldShowStaleContentOnEviction()
{
    return p->host()->ShouldShowStaleContentOnEviction();
}

} // namespace QtWebEngineCore