]> git.sesse.net Git - nageru/blobdiff - cef_capture.h
Add the GPU memory metrics to the Grafana dashboard.
[nageru] / cef_capture.h
index 0d9bd525b03d6bb330ea614499cbb52fdf74f3e2..29dededf7b60ad8696dfaec10c71c7f7e84844f4 100644 (file)
@@ -35,8 +35,8 @@ class CEFCapture;
 class NageruCEFClient : public CefClient, public CefRenderHandler, public CefLoadHandler
 {
 public:
-       NageruCEFClient(int width, int height, CEFCapture *parent)
-               : width(width), height(height), parent(parent) {}
+       NageruCEFClient(CEFCapture *parent)
+               : parent(parent) {}
 
        CefRefPtr<CefRenderHandler> GetRenderHandler() override
        {
@@ -52,14 +52,13 @@ public:
 
        void OnPaint(CefRefPtr<CefBrowser> browser, PaintElementType type, const RectList &dirtyRects, const void *buffer, int width, int height) override;
 
-       bool GetViewRect(CefRefPtr<CefBrowser> browser, CefRect &rect);
+       bool GetViewRect(CefRefPtr<CefBrowser> browser, CefRect &rect) override;
 
        // CefLoadHandler.
 
        void OnLoadEnd(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, int httpStatusCode) override;
 
 private:
-       int width, height;
        CEFCapture *parent;
 
        IMPLEMENT_REFCOUNTING(NageruCEFClient);
@@ -86,6 +85,7 @@ public:
        void set_max_fps(int max_fps);
        void execute_javascript_async(const std::string &js);
        void resize(unsigned width, unsigned height);
+       void request_new_frame();
 
        // Callbacks from NageruCEFClient.
        void OnPaint(const void *buffer, int width, int height);
@@ -148,7 +148,7 @@ public:
                assert(pixel_format == bmusb::PixelFormat_8BitBGRA);
        }
 
-       bmusb::PixelFormat get_current_pixel_format() const
+       bmusb::PixelFormat get_current_pixel_format() const override
        {
                return bmusb::PixelFormat_8BitBGRA;
        }