MCPcopy Create free account
hub / github.com/CuarzoSoftware/Louvre / RScreenCopyFrame

Method RScreenCopyFrame

src/lib/protocols/ScreenCopy/RScreenCopyFrame.cpp:25–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23};
24
25RScreenCopyFrame::RScreenCopyFrame
26 (
27 GScreenCopyManager *screenCopyManagerRes,
28 LOutput *output,
29 bool overlayCursor,
30 const LRect &region,
31 UInt32 id,
32 Int32 version
33 ) noexcept
34 :LResource
35 (
36 screenCopyManagerRes->client(),
37 &zwlr_screencopy_frame_v1_interface,
38 version,
39 id,
40 &imp
41 ),
42 m_output(output),
43 m_screenCopyManagerRes(screenCopyManagerRes),
44 m_frame(*this),
45 m_rect(region)
46{
47 if (!output)
48 {
49 buffer(WL_SHM_FORMAT_XRGB8888, LSize(1), 4);
50 bufferDone();
51 failed();
52 return;
53 }
54
55 m_stateFlags.setFlag(CompositeCursor, overlayCursor);
56
57 m_bufferContainer.onDestroy.notify = [](wl_listener *listener, void *)
58 {
59 BufferContainer *bufferContainer { (BufferContainer *)listener };
60 bufferContainer->buffer = nullptr;
61 };
62
63 m_initOutputModeSize = output->currentMode()->sizeB();
64 m_initOutputSize = output->size();
65 m_initOutputTransform = output->transform();
66
67 auto &damage { screenCopyManagerRes->damage[output] };
68
69 if (damage.firstFrame)
70 {
71 damage.damage.addRect(0, m_initOutputModeSize);
72 damage.firstFrame = false;
73 }
74
75 LSizeF scale;
76
77 if (Louvre::is90Transform(output->transform()))
78 {
79 scale.setW(Float32(m_initOutputModeSize.w())/Float32(m_initOutputSize.h()));
80 scale.setH(Float32(m_initOutputModeSize.h())/Float32(m_initOutputSize.w()));
81 }
82 else

Callers

nothing calls this directly

Calls 15

is90TransformFunction · 0.85
setFlagMethod · 0.80
addRectMethod · 0.80
multiplyMethod · 0.80
painterMethod · 0.80
bufferTextureMethod · 0.80
clientMethod · 0.45
currentModeMethod · 0.45
sizeMethod · 0.45
transformMethod · 0.45
setWMethod · 0.45
wMethod · 0.45

Tested by

no test coverage detected