Chromium Code Reviews| 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 && | |
|
danakj
2015/08/31 22:11:47
this doesn't quite look right?
you want to abort
danakj
2015/08/31 22:24:36
btw, where are the unit tests for this? they would
william.xie1
2015/09/01 03:40:33
Done.
william.xie1
2015/09/01 03:40:33
Done.
william.xie1
2015/09/01 03:40:33
Done.
| |
| 83 overlay->clip_rect.Contains( | |
| 84 gfx::ToEnclosingRect(overlay->geometry_rect)))) | |
|
danakj
2015/08/31 22:11:47
if you make the geometry_rect a gfx::Rect you don'
william.xie1
2015/09/01 03:40:33
Done.
william.xie1
2015/09/01 03:40:33
Done.
william.xie1
2015/09/01 03:40:33
Done.
| |
| 85 return; | |
| 82 | 86 |
| 83 OverlayCheck_Params lookup(*overlay); | 87 OverlayCheck_Params lookup(*overlay); |
| 84 auto iter = cache_.Get(lookup); | 88 auto iter = cache_.Get(lookup); |
| 85 if (iter == cache_.end()) { | 89 if (iter == cache_.end()) { |
| 86 cache_.Put(lookup, false); | 90 cache_.Put(lookup, false); |
| 87 SendRequest(*candidates, lookup); | 91 SendRequest(*candidates, lookup); |
| 88 } else { | 92 } else { |
| 89 overlay->overlay_handled = iter->second; | 93 overlay->overlay_handled = iter->second; |
| 90 } | 94 } |
| 91 } | 95 } |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 132 pending_checks_.pop_front(); | 136 pending_checks_.pop_front(); |
| 133 } | 137 } |
| 134 | 138 |
| 135 void DrmOverlayCandidatesHost::ProcessResult(const OverlayCheck_Params& check, | 139 void DrmOverlayCandidatesHost::ProcessResult(const OverlayCheck_Params& check, |
| 136 bool result) { | 140 bool result) { |
| 137 if (result) | 141 if (result) |
| 138 cache_.Put(check, true); | 142 cache_.Put(check, true); |
| 139 } | 143 } |
| 140 | 144 |
| 141 } // namespace ui | 145 } // namespace ui |
| OLD | NEW |