| OLD | NEW | 
|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "cc/output/overlay_strategy_fullscreen.h" | 5 #include "cc/output/overlay_strategy_fullscreen.h" | 
| 6 | 6 | 
| 7 #include "cc/base/math_util.h" | 7 #include "cc/base/math_util.h" | 
| 8 #include "cc/output/overlay_candidate_validator.h" | 8 #include "cc/output/overlay_candidate_validator.h" | 
| 9 #include "cc/quads/draw_quad.h" | 9 #include "cc/quads/draw_quad.h" | 
| 10 #include "cc/quads/solid_color_draw_quad.h" | 10 #include "cc/quads/solid_color_draw_quad.h" | 
| 11 #include "ui/gfx/geometry/rect_conversions.h" | 11 #include "ui/gfx/geometry/rect_conversions.h" | 
| 12 #include "ui/gfx/geometry/size_conversions.h" | 12 #include "ui/gfx/geometry/size_conversions.h" | 
| 13 | 13 | 
| 14 namespace cc { | 14 namespace cc { | 
| 15 | 15 | 
| 16 OverlayStrategyFullscreen::OverlayStrategyFullscreen( | 16 OverlayStrategyFullscreen::OverlayStrategyFullscreen( | 
| 17     OverlayCandidateValidator* capability_checker) | 17     OverlayCandidateValidator* capability_checker) | 
| 18     : capability_checker_(capability_checker) { | 18     : capability_checker_(capability_checker) { | 
| 19   DCHECK(capability_checker); | 19   DCHECK(capability_checker); | 
| 20 } | 20 } | 
| 21 | 21 | 
| 22 OverlayStrategyFullscreen::~OverlayStrategyFullscreen() {} | 22 OverlayStrategyFullscreen::~OverlayStrategyFullscreen() {} | 
| 23 | 23 | 
| 24 bool OverlayStrategyFullscreen::Attempt(ResourceProvider* resource_provider, | 24 bool OverlayStrategyFullscreen::Attempt( | 
| 25                                         RenderPass* render_pass, | 25     ResourceProvider* resource_provider, | 
| 26                                         OverlayCandidateList* candidate_list) { | 26     RenderPass* render_pass, | 
|  | 27     OverlayCandidateList* candidate_list, | 
|  | 28     std::vector<gfx::Rect>* content_bounds) { | 
| 27   QuadList* quad_list = &render_pass->quad_list; | 29   QuadList* quad_list = &render_pass->quad_list; | 
| 28   // First quad of quad_list is the top most quad. | 30   // First quad of quad_list is the top most quad. | 
| 29   auto front = quad_list->begin(); | 31   auto front = quad_list->begin(); | 
| 30   while (front != quad_list->end()) { | 32   while (front != quad_list->end()) { | 
| 31     if (!OverlayCandidate::IsInvisibleQuad(*front)) | 33     if (!OverlayCandidate::IsInvisibleQuad(*front)) | 
| 32       break; | 34       break; | 
| 33     front++; | 35     front++; | 
| 34   } | 36   } | 
| 35 | 37 | 
| 36   if (front == quad_list->end()) | 38   if (front == quad_list->end()) | 
| (...skipping 23 matching lines...) Expand all  Loading... | 
| 60   if (!new_candidate_list.front().overlay_handled) | 62   if (!new_candidate_list.front().overlay_handled) | 
| 61     return false; | 63     return false; | 
| 62 | 64 | 
| 63   candidate_list->swap(new_candidate_list); | 65   candidate_list->swap(new_candidate_list); | 
| 64 | 66 | 
| 65   render_pass->quad_list = QuadList();  // Remove all the quads | 67   render_pass->quad_list = QuadList();  // Remove all the quads | 
| 66   return true; | 68   return true; | 
| 67 } | 69 } | 
| 68 | 70 | 
| 69 }  // namespace cc | 71 }  // namespace cc | 
| OLD | NEW | 
|---|