diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-12 14:27:29 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-13 09:35:20 +0000 |
commit | c30a6232df03e1efbd9f3b226777b07e087a1122 (patch) | |
tree | e992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/components/exo/surface.cc | |
parent | 7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff) | |
download | qtwebengine-chromium-85-based.tar.gz |
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/components/exo/surface.cc')
-rw-r--r-- | chromium/components/exo/surface.cc | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/chromium/components/exo/surface.cc b/chromium/components/exo/surface.cc index d9979147092..01fb6a805b7 100644 --- a/chromium/components/exo/surface.cc +++ b/chromium/components/exo/surface.cc @@ -221,6 +221,8 @@ const std::string& GetApplicationId(aura::Window* window) { return empty_app_id; } +int surface_id = 0; + } // namespace DEFINE_UI_CLASS_PROPERTY_KEY(int32_t, kClientSurfaceIdKey, 0) @@ -241,7 +243,7 @@ Surface::Surface() : window_( std::make_unique<aura::Window>(new CustomWindowDelegate(this), aura::client::WINDOW_TYPE_CONTROL)) { - window_->SetName("ExoSurface"); + window_->SetName(base::StringPrintf("ExoSurface-%d", surface_id++)); window_->SetProperty(kSurfaceKey, this); window_->Init(ui::LAYER_NOT_DRAWN); window_->SetEventTargeter(std::make_unique<CustomWindowTargeter>()); @@ -610,7 +612,8 @@ void Surface::CommitSurfaceHierarchy(bool synchronized) { state_.only_visible_on_secure_output || pending_state_.blend_mode != state_.blend_mode || pending_state_.alpha != state_.alpha || - pending_state_.color_space != state_.color_space; + pending_state_.color_space != state_.color_space || + pending_state_.is_tracking_occlusion != state_.is_tracking_occlusion; bool needs_update_buffer_transform = pending_state_.buffer_scale != state_.buffer_scale || @@ -638,6 +641,13 @@ void Surface::CommitSurfaceHierarchy(bool synchronized) { ? aura::EventTargetingPolicy::kDescendantsOnly : aura::EventTargetingPolicy::kTargetAndDescendants); + if (state_.is_tracking_occlusion) { + // TODO(edcourtney): Currently, it doesn't seem to be possible to stop + // tracking the occlusion state once started, but it would be nice to stop + // if the tracked occlusion region becomes empty. + window_->TrackOcclusionState(); + } + #if defined(OS_CHROMEOS) if (needs_output_protection) { if (!output_protection_) { @@ -859,12 +869,11 @@ bool Surface::FillsBoundsOpaquely() const { } void Surface::SetOcclusionTracking(bool tracking) { - is_tracking_occlusion_ = tracking; - // TODO(edcourtney): Currently, it doesn't seem to be possible to stop - // tracking the occlusion state once started, but it would be nice to stop if - // the tracked occlusion region becomes empty. - if (is_tracking_occlusion_) - window()->TrackOcclusionState(); + pending_state_.is_tracking_occlusion = tracking; +} + +bool Surface::IsTrackingOcclusion() { + return state_.is_tracking_occlusion; } void Surface::SetSurfaceHierarchyContentBoundsForTest( @@ -999,6 +1008,7 @@ void Surface::AppendContentsToFrame(const gfx::Point& origin, render_pass->damage_rect.Union( gfx::ConvertRectToPixel(device_scale_factor, damage_rect)); } + damage_.Clear(); gfx::PointF scale(content_size_.width(), content_size_.height()); @@ -1157,7 +1167,7 @@ void Surface::UpdateContentSize() { } void Surface::OnWindowOcclusionChanged() { - if (!is_tracking_occlusion_) + if (!state_.is_tracking_occlusion) return; for (SurfaceObserver& observer : observers_) |