OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_processor.h" | 5 #include "cc/output/overlay_processor.h" |
6 | 6 |
7 #include "cc/output/output_surface.h" | 7 #include "cc/output/output_surface.h" |
8 #include "cc/output/overlay_strategy_single_on_top.h" | 8 #include "cc/output/overlay_strategy_single_on_top.h" |
9 #include "cc/output/overlay_strategy_underlay.h" | 9 #include "cc/output/overlay_strategy_underlay.h" |
10 #include "cc/quads/draw_quad.h" | 10 #include "cc/quads/draw_quad.h" |
11 #include "cc/resources/resource_provider.h" | 11 #include "cc/resources/resource_provider.h" |
12 #include "ui/gfx/geometry/rect_conversions.h" | 12 #include "ui/gfx/geometry/rect_conversions.h" |
13 #include "ui/gfx/transform.h" | 13 #include "ui/gfx/transform.h" |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 #if defined(OS_ANDROID) | 17 #if defined(OS_ANDROID) |
18 // Utility class to make sure that we notify resource that they're promotable | 18 // Utility class to make sure that we notify resource that they're promotable |
19 // before returning from ProcessForOverlays. | 19 // before returning from ProcessForOverlays. |
20 class SendPromotionHintsBeforeReturning { | 20 class SendPromotionHintsBeforeReturning { |
21 public: | 21 public: |
22 SendPromotionHintsBeforeReturning(cc::ResourceProvider* resource_provider, | 22 SendPromotionHintsBeforeReturning(cc::ResourceProvider* resource_provider, |
23 cc::OverlayCandidateList* candidates) | 23 cc::OverlayCandidateList* candidates) |
24 : resource_provider_(resource_provider), candidates_(candidates) {} | 24 : resource_provider_(resource_provider), candidates_(candidates) {} |
25 ~SendPromotionHintsBeforeReturning() { | 25 ~SendPromotionHintsBeforeReturning() { |
26 resource_provider_->SendPromotionHints( | 26 resource_provider_->SendPromotionHints( |
27 candidates_->promotable_resource_hints_); | 27 candidates_->promotion_hint_info_map_); |
28 } | 28 } |
29 | 29 |
30 private: | 30 private: |
31 cc::ResourceProvider* resource_provider_; | 31 cc::ResourceProvider* resource_provider_; |
32 cc::OverlayCandidateList* candidates_; | 32 cc::OverlayCandidateList* candidates_; |
33 | 33 |
34 DISALLOW_COPY_AND_ASSIGN(SendPromotionHintsBeforeReturning); | 34 DISALLOW_COPY_AND_ASSIGN(SendPromotionHintsBeforeReturning); |
35 }; | 35 }; |
36 #endif | 36 #endif |
37 | 37 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 } | 148 } |
149 | 149 |
150 if (this_frame_underlay_rect == previous_frame_underlay_rect_) | 150 if (this_frame_underlay_rect == previous_frame_underlay_rect_) |
151 damage_rect->Subtract(this_frame_underlay_rect); | 151 damage_rect->Subtract(this_frame_underlay_rect); |
152 previous_frame_underlay_rect_ = this_frame_underlay_rect; | 152 previous_frame_underlay_rect_ = this_frame_underlay_rect; |
153 | 153 |
154 damage_rect->Union(output_surface_overlay_damage_rect); | 154 damage_rect->Union(output_surface_overlay_damage_rect); |
155 } | 155 } |
156 | 156 |
157 } // namespace cc | 157 } // namespace cc |
OLD | NEW |