OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/ozone/platform/drm/host/drm_overlay_candidates_host.h" | 5 #include "ui/ozone/platform/drm/host/drm_overlay_candidates_host.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ui/gfx/geometry/rect_conversions.h" | 9 #include "ui/gfx/geometry/rect_conversions.h" |
10 #include "ui/ozone/common/gpu/ozone_gpu_messages.h" | 10 #include "ui/ozone/common/gpu/ozone_gpu_messages.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 overlay = first; | 72 overlay = first; |
73 } else { | 73 } else { |
74 return; | 74 return; |
75 } | 75 } |
76 // 0.01 constant chosen to match DCHECKs in gfx::ToNearestRect and avoid | 76 // 0.01 constant chosen to match DCHECKs in gfx::ToNearestRect and avoid |
77 // that code asserting on quads that we accept. | 77 // that code asserting on quads that we accept. |
78 if (!gfx::IsNearestRectWithinDistance(overlay->display_rect, 0.01f)) | 78 if (!gfx::IsNearestRectWithinDistance(overlay->display_rect, 0.01f)) |
79 return; | 79 return; |
80 if (overlay->transform == gfx::OVERLAY_TRANSFORM_INVALID) | 80 if (overlay->transform == gfx::OVERLAY_TRANSFORM_INVALID) |
81 return; | 81 return; |
| 82 if (overlay->is_clipped && |
| 83 !overlay->clip_rect.Contains(overlay->quad_rect_in_target_space)) |
| 84 return; |
82 | 85 |
83 OverlayCheck_Params lookup(*overlay); | 86 OverlayCheck_Params lookup(*overlay); |
84 auto iter = cache_.Get(lookup); | 87 auto iter = cache_.Get(lookup); |
85 if (iter == cache_.end()) { | 88 if (iter == cache_.end()) { |
86 cache_.Put(lookup, false); | 89 cache_.Put(lookup, false); |
87 SendRequest(*candidates, lookup); | 90 SendRequest(*candidates, lookup); |
88 } else { | 91 } else { |
89 overlay->overlay_handled = iter->second; | 92 overlay->overlay_handled = iter->second; |
90 } | 93 } |
91 } | 94 } |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 pending_checks_.pop_front(); | 135 pending_checks_.pop_front(); |
133 } | 136 } |
134 | 137 |
135 void DrmOverlayCandidatesHost::ProcessResult(const OverlayCheck_Params& check, | 138 void DrmOverlayCandidatesHost::ProcessResult(const OverlayCheck_Params& check, |
136 bool result) { | 139 bool result) { |
137 if (result) | 140 if (result) |
138 cache_.Put(check, true); | 141 cache_.Put(check, true); |
139 } | 142 } |
140 | 143 |
141 } // namespace ui | 144 } // namespace ui |
OLD | NEW |