X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=cef_capture.cpp;h=e46f0c065f7287e0dce70992a070cea557a0497d;hb=16e654819e2254ef045b60b7751a918558c4a13a;hp=c52e3a45ddccf92f18b6fb489a80d26b66f05ebc;hpb=82e392b0e444d9b4043b78ef3413343b092e4537;p=nageru diff --git a/cef_capture.cpp b/cef_capture.cpp index c52e3a4..e46f0c0 100644 --- a/cef_capture.cpp +++ b/cef_capture.cpp @@ -60,6 +60,7 @@ void CEFCapture::set_url(const string &url) void CEFCapture::reload() { post_to_cef_ui_thread([this] { + loaded = false; browser->Reload(); }); } @@ -85,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(); @@ -223,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; }