Don't generate a paint when StartPainting is called inside paint cb
This commit is contained in:
parent
17d85318c3
commit
708cde92cf
2 changed files with 6 additions and 1 deletions
|
@ -279,6 +279,7 @@ OffScreenRenderWidgetHostView::OffScreenRenderWidgetHostView(
|
||||||
popup_position_(gfx::Rect()),
|
popup_position_(gfx::Rect()),
|
||||||
hold_resize_(false),
|
hold_resize_(false),
|
||||||
pending_resize_(false),
|
pending_resize_(false),
|
||||||
|
paint_callback_running_(false),
|
||||||
renderer_compositor_frame_sink_(nullptr),
|
renderer_compositor_frame_sink_(nullptr),
|
||||||
background_color_(SkColor()),
|
background_color_(SkColor()),
|
||||||
weak_ptr_factory_(this) {
|
weak_ptr_factory_(this) {
|
||||||
|
@ -999,7 +1000,9 @@ void OffScreenRenderWidgetHostView::OnPaint(
|
||||||
}
|
}
|
||||||
|
|
||||||
damage.Intersect(GetViewBounds());
|
damage.Intersect(GetViewBounds());
|
||||||
|
paint_callback_running_ = true;
|
||||||
callback_.Run(damage, bitmap);
|
callback_.Run(damage, bitmap);
|
||||||
|
paint_callback_running_ = false;
|
||||||
|
|
||||||
for (size_t i = 0; i < damages.size(); i++) {
|
for (size_t i = 0; i < damages.size(); i++) {
|
||||||
CopyBitmapTo(bitmap, originals[i], damages[i]);
|
CopyBitmapTo(bitmap, originals[i], damages[i]);
|
||||||
|
@ -1147,7 +1150,7 @@ void OffScreenRenderWidgetHostView::SetPainting(bool painting) {
|
||||||
painting_ = painting;
|
painting_ = painting;
|
||||||
|
|
||||||
if (software_output_device_) {
|
if (software_output_device_) {
|
||||||
software_output_device_->SetActive(painting_, true);
|
software_output_device_->SetActive(painting_, !paint_callback_running_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -315,6 +315,8 @@ class OffScreenRenderWidgetHostView
|
||||||
bool hold_resize_;
|
bool hold_resize_;
|
||||||
bool pending_resize_;
|
bool pending_resize_;
|
||||||
|
|
||||||
|
bool paint_callback_running_;
|
||||||
|
|
||||||
std::unique_ptr<ui::Layer> root_layer_;
|
std::unique_ptr<ui::Layer> root_layer_;
|
||||||
std::unique_ptr<ui::Compositor> compositor_;
|
std::unique_ptr<ui::Compositor> compositor_;
|
||||||
std::unique_ptr<content::DelegatedFrameHost> delegated_frame_host_;
|
std::unique_ptr<content::DelegatedFrameHost> delegated_frame_host_;
|
||||||
|
|
Loading…
Reference in a new issue