forked from MicrosoftEdge/WebView2Samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDCompTargetImpl.cpp
More file actions
32 lines (26 loc) · 808 Bytes
/
DCompTargetImpl.cpp
File metadata and controls
32 lines (26 loc) · 808 Bytes
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
// Copyright (C) Microsoft Corporation. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "stdafx.h"
#include "DCompTargetImpl.h"
DCompTargetImpl::DCompTargetImpl(ViewComponent* owner)
{
m_viewComponentOwner = owner;
}
void DCompTargetImpl::RemoveOwnerRef()
{
m_viewComponentOwner = nullptr;
}
HRESULT __stdcall DCompTargetImpl::SetRoot(IDCompositionVisual* visual)
{
HRESULT hr = S_OK;
if (m_viewComponentOwner)
{
hr = m_viewComponentOwner->m_dcompWebViewVisual->RemoveAllVisuals();
if (SUCCEEDED(hr) && visual)
{
hr = m_viewComponentOwner->m_dcompWebViewVisual->AddVisual(visual, FALSE, nullptr);
}
}
return hr;
}