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_strategy_underlay.h" | 5 #include "cc/output/overlay_strategy_underlay.h" |
6 | 6 |
7 #include "cc/output/overlay_candidate_validator.h" | 7 #include "cc/output/overlay_candidate_validator.h" |
8 #include "cc/quads/draw_quad.h" | 8 #include "cc/quads/draw_quad.h" |
9 #include "cc/quads/solid_color_draw_quad.h" | 9 #include "cc/quads/solid_color_draw_quad.h" |
10 | 10 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 SolidColorDrawQuad* replacement = | 45 SolidColorDrawQuad* replacement = |
46 quad_list.ReplaceExistingElement<SolidColorDrawQuad>(it); | 46 quad_list.ReplaceExistingElement<SolidColorDrawQuad>(it); |
47 replacement->SetAll(shared_quad_state, rect, rect, rect, false, | 47 replacement->SetAll(shared_quad_state, rect, rect, rect, false, |
48 SK_ColorTRANSPARENT, true); | 48 SK_ColorTRANSPARENT, true); |
49 candidate_list->swap(new_candidate_list); | 49 candidate_list->swap(new_candidate_list); |
50 | 50 |
51 // This quad will be promoted. We clear the promotable hints here, since | 51 // This quad will be promoted. We clear the promotable hints here, since |
52 // we can only promote a single quad. Otherwise, somebody might try to | 52 // we can only promote a single quad. Otherwise, somebody might try to |
53 // back one of the promotable quads with a SurfaceView, and either it or | 53 // back one of the promotable quads with a SurfaceView, and either it or |
54 // |candidate| would have to fall back to a texture. | 54 // |candidate| would have to fall back to a texture. |
55 candidate_list->promotable_resource_hints_.clear(); | 55 candidate_list->promotion_hint_info_map_.clear(); |
56 candidate_list->promotable_resource_hints_.insert(candidate.resource_id); | 56 candidate_list->AddPromotionHint(candidate); |
57 return true; | 57 return true; |
58 } else { | 58 } else { |
59 // If |candidate| should get a promotion hint, then rememeber that now. | 59 // If |candidate| should get a promotion hint, then rememeber that now. |
60 candidate_list->promotable_resource_hints_.insert( | 60 candidate_list->promotion_hint_info_map_.insert( |
61 new_candidate_list.promotable_resource_hints_.begin(), | 61 new_candidate_list.promotion_hint_info_map_.begin(), |
62 new_candidate_list.promotable_resource_hints_.end()); | 62 new_candidate_list.promotion_hint_info_map_.end()); |
63 } | 63 } |
64 } | 64 } |
65 | 65 |
66 return false; | 66 return false; |
67 } | 67 } |
68 | 68 |
69 } // namespace cc | 69 } // namespace cc |
OLD | NEW |