24#ifndef _SCOL_EMBEDDED_WEB_NAVIGATOR_RENDER_HANDLER_
25#define _SCOL_EMBEDDED_WEB_NAVIGATOR_RENDER_HANDLER_
28#include <shared_mutex>
30#if SO3_WEB_NAVIGATOR_BUILD == 1
31#include "include/cef_render_handler.h"
32#include "include/cef_task.h"
37 namespace EmbeddedWebNavigator
46 std::shared_mutex offscreenBufferCriticalSection;
48 unsigned char* offscreenBuffer;
49 size_t offscreenBufferMemorySize;
50 unsigned char* offscreenPopupBuffer;
51 CefRect offscreenPopupRect;
52 unsigned int offscreenBuffer_width;
53 unsigned int offscreenBuffer_height;
54 bool bufferContentChanged;
60 WebNavigatorRenderHandler(CefRefPtr<WebNavigatorClient>& parentWebNavigatorClientInstance,
const ScolWindowHandle& scolMainWindow,
bool offscreen);
95 bool BlitOffscreenBitmap(
unsigned char* dest,
int destWidth,
int destHeight,
int destBytesPerPixel,
int destBitsPerLine);
100 bool BlitOffscreenAlphaBitmap(
unsigned char* destColor,
unsigned char* destAlpha,
int destWidth,
int destHeight,
int destColorBytesPerPixel,
int destColorBitsPerLine);
108 bool CheckPixelAlpha(
int posX,
int posY,
float transparentTresholdColor);
113 virtual bool GetViewRect(CefRefPtr<CefBrowser> browser, CefRect& rect);
118 virtual void OnPopupShow(CefRefPtr<CefBrowser> browser,
bool show) OVERRIDE;
123 virtual void OnPopupSize(CefRefPtr<CefBrowser> browser,
const CefRect& rect) OVERRIDE;
128 virtual void OnPaint(CefRefPtr<CefBrowser> browser, CefRenderHandler::PaintElementType type,
const CefRenderHandler::RectList& dirtyRects,
const void* buffer,
int width,
int height) OVERRIDE;
133 virtual void OnCursorChange(CefRefPtr<CefBrowser> browser, CefCursorHandle cursor, CursorType type,
const CefCursorInfo& custom_cursor_info) OVERRIDE;
154 void SetRGB(CefRefPtr<CefBrowser> browser,
int width,
int height,
const void* src,
const RectList& dirtyRects);
159 void SetBufferSize(
int width,
int height);
164 void ConvertToRGBA(
const unsigned char* src,
unsigned char* dst,
const RectList& dirtyRects,
int renderSizeWidth,
int renderSizeHeight);
unsigned char * GetOffscreenPopupBuffer()
virtual void OnPopupShow(CefRefPtr< CefBrowser > browser, bool show) OVERRIDE
~WebNavigatorRenderHandler()
virtual bool GetViewRect(CefRefPtr< CefBrowser > browser, CefRect &rect)
virtual void OnCursorChange(CefRefPtr< CefBrowser > browser, CefCursorHandle cursor, CursorType type, const CefCursorInfo &custom_cursor_info) OVERRIDE
IMPLEMENT_REFCOUNTING(WebNavigatorRenderHandler)
unsigned int GetOffscreenBufferHeight()
virtual void OnPaint(CefRefPtr< CefBrowser > browser, CefRenderHandler::PaintElementType type, const CefRenderHandler::RectList &dirtyRects, const void *buffer, int width, int height) OVERRIDE
bool GetOffscreenBufferContentChanged()
bool BlitOffscreenTexture(Ogre::TexturePtr &ogreTexture, bool forceUpdate)
unsigned char * GetOffscreenBuffer()
bool BlitOffscreenBitmap(unsigned char *dest, int destWidth, int destHeight, int destBytesPerPixel, int destBitsPerLine)
virtual void OnPopupSize(CefRefPtr< CefBrowser > browser, const CefRect &rect) OVERRIDE
CefRect GetOffscreenPopupBufferRect()
unsigned int GetOffscreenBufferWidth()
IMPLEMENT_LOCKING(WebNavigatorRenderHandler)
bool CheckPixelAlpha(int posX, int posY, float transparentTresholdColor)
bool BlitOffscreenAlphaBitmap(unsigned char *destColor, unsigned char *destAlpha, int destWidth, int destHeight, int destColorBytesPerPixel, int destColorBitsPerLine)