X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=cef_capture.cpp;h=e46f0c065f7287e0dce70992a070cea557a0497d;hb=16e654819e2254ef045b60b7751a918558c4a13a;hp=9dc454ba33d426a6abfcb86234c36e193f221c66;hpb=4dcab181655d215ad0105f8adfe76dd6fd8bd201;p=nageru diff --git a/cef_capture.cpp b/cef_capture.cpp index 9dc454b..e46f0c0 100644 --- a/cef_capture.cpp +++ b/cef_capture.cpp @@ -86,6 +86,13 @@ void CEFCapture::execute_javascript_async(const string &js) }); } +void CEFCapture::resize(unsigned width, unsigned height) +{ + lock_guard lock(resolution_mutex); + this->width = width; + this->height = height; +} + void CEFCapture::OnPaint(const void *buffer, int width, int height) { steady_clock::time_point timestamp = steady_clock::now(); @@ -224,6 +231,12 @@ void NageruCEFClient::OnPaint(CefRefPtr browser, PaintElementType ty bool NageruCEFClient::GetViewRect(CefRefPtr browser, CefRect &rect) { + return parent->GetViewRect(rect); +} + +bool CEFCapture::GetViewRect(CefRect &rect) +{ + lock_guard lock(resolution_mutex); rect = CefRect(0, 0, width, height); return true; }