restructure code to use web_preferences if possible

This commit is contained in:
Heilig Benedek 2017-11-02 22:50:04 +01:00 committed by Cheng Zhao
parent cafb9477b0
commit f8b3009ebf
16 changed files with 88 additions and 47 deletions

View file

@ -79,12 +79,12 @@ void OffScreenOutputDevice::EndPaint() {
OnPaint(damage_rect_);
}
void OffScreenOutputDevice::SetActive(bool active) {
void OffScreenOutputDevice::SetActive(bool active, bool paint) {
if (active == active_)
return;
active_ = active;
if (active_)
if (active_ && paint)
OnPaint(gfx::Rect(viewport_pixel_size_));
}

View file

@ -24,7 +24,7 @@ class OffScreenOutputDevice : public cc::SoftwareOutputDevice {
SkCanvas* BeginPaint(const gfx::Rect& damage_rect) override;
void EndPaint() override;
void SetActive(bool active);
void SetActive(bool active, bool paint);
void OnPaint(const gfx::Rect& damage_rect);
private:

View file

@ -549,7 +549,7 @@ void OffScreenRenderWidgetHostView::SubmitCompositorFrame(
if (!frame.render_pass_list.empty()) {
if (software_output_device_) {
if (!begin_frame_timer_.get() || IsPopupWidget()) {
software_output_device_->SetActive(painting_);
software_output_device_->SetActive(painting_, false);
}
// The compositor will draw directly to the SoftwareOutputDevice which
@ -935,7 +935,7 @@ void OffScreenRenderWidgetHostView::SetNeedsBeginFrames(
begin_frame_timer_->SetActive(needs_begin_frames);
if (software_output_device_) {
software_output_device_->SetActive(needs_begin_frames && painting_);
software_output_device_->SetActive(needs_begin_frames && painting_, false);
}
}
@ -1151,7 +1151,7 @@ void OffScreenRenderWidgetHostView::SetPainting(bool painting) {
painting_ = painting;
if (software_output_device_) {
software_output_device_->SetActive(painting_);
software_output_device_->SetActive(painting_, true);
}
}