| 23 | }; |
| 24 | |
| 25 | RScreenCopyFrame::RScreenCopyFrame |
| 26 | ( |
| 27 | GScreenCopyManager *screenCopyManagerRes, |
| 28 | LOutput *output, |
| 29 | bool overlayCursor, |
| 30 | const LRect ®ion, |
| 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 |
nothing calls this directly
no test coverage detected