Pass OnPaint callback in constructor

This can catch the paint events happened before onload event.
This commit is contained in:
Cheng Zhao 2016-08-04 13:03:24 +09:00
parent 32d9382417
commit 530fcc8de1
5 changed files with 21 additions and 29 deletions

View file

@ -63,6 +63,7 @@ class OffScreenRenderWidgetHostView
public content::DelegatedFrameHostClient {
public:
OffScreenRenderWidgetHostView(bool transparent,
const OnPaintCallback& callback,
content::RenderWidgetHost* render_widget_host,
NativeWindow* native_window);
~OffScreenRenderWidgetHostView() override;
@ -189,10 +190,9 @@ class OffScreenRenderWidgetHostView
void DestroyPlatformWidget();
#endif
void SetPaintCallback(const OnPaintCallback& callback);
void OnPaint(const gfx::Rect& damage_rect,
const gfx::Size& bitmap_size,
const int pixel_size,
int pixel_size,
void* bitmap_pixels);
void SetPainting(bool painting);
@ -214,6 +214,7 @@ class OffScreenRenderWidgetHostView
NativeWindow* native_window_;
OffScreenOutputDevice* software_output_device_;
const bool transparent_;
OnPaintCallback callback_;
int frame_rate_;
@ -221,7 +222,6 @@ class OffScreenRenderWidgetHostView
base::Time last_time_;
const bool transparent_;
float scale_factor_;
bool is_showing_;
gfx::Vector2dF last_scroll_offset_;