forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dc_layer_overlay_image.cc
54 lines (42 loc) · 1.72 KB
/
dc_layer_overlay_image.cc
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
51
52
53
54
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ui/gl/dc_layer_overlay_image.h"
#include <unknwn.h>
#include <d3d11.h>
#include <dcomp.h>
namespace gl {
DCLayerOverlayImage::DCLayerOverlayImage(
const gfx::Size& size,
Microsoft::WRL::ComPtr<ID3D11Texture2D> nv12_texture,
size_t array_slice)
: type_(DCLayerOverlayType::kNV12Texture),
size_(size),
nv12_texture_(std::move(nv12_texture)),
texture_array_slice_(array_slice) {}
DCLayerOverlayImage::DCLayerOverlayImage(const gfx::Size& size,
const uint8_t* nv12_pixmap,
size_t pixmap_stride)
: type_(DCLayerOverlayType::kNV12Pixmap),
size_(size),
nv12_pixmap_(nv12_pixmap),
pixmap_stride_(pixmap_stride) {}
DCLayerOverlayImage::DCLayerOverlayImage(
const gfx::Size& size,
Microsoft::WRL::ComPtr<IUnknown> dcomp_visual_content,
uint64_t dcomp_surface_serial)
: type_(DCLayerOverlayType::kDCompVisualContent),
size_(size),
dcomp_visual_content_(std::move(dcomp_visual_content)),
dcomp_surface_serial_(dcomp_surface_serial) {}
DCLayerOverlayImage::DCLayerOverlayImage(
const gfx::Size& size,
scoped_refptr<gl::DCOMPSurfaceProxy> dcomp_surface_proxy)
: type_(DCLayerOverlayType::kDCompSurfaceProxy),
size_(size),
dcomp_surface_proxy_(std::move(dcomp_surface_proxy)) {}
DCLayerOverlayImage::DCLayerOverlayImage(DCLayerOverlayImage&&) = default;
DCLayerOverlayImage& DCLayerOverlayImage::operator=(DCLayerOverlayImage&&) =
default;
DCLayerOverlayImage::~DCLayerOverlayImage() = default;
} // namespace gl