OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/layers/heads_up_display_layer_impl.h" | 5 #include "cc/layers/heads_up_display_layer_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/numerics/safe_conversions.h" | 10 #include "base/numerics/safe_conversions.h" |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 resources_.erase(it_erase, resources_.end()); | 125 resources_.erase(it_erase, resources_.end()); |
126 } | 126 } |
127 | 127 |
128 bool HeadsUpDisplayLayerImpl::WillDraw(DrawMode draw_mode, | 128 bool HeadsUpDisplayLayerImpl::WillDraw(DrawMode draw_mode, |
129 ResourceProvider* resource_provider) { | 129 ResourceProvider* resource_provider) { |
130 if (draw_mode == DRAW_MODE_RESOURCELESS_SOFTWARE) | 130 if (draw_mode == DRAW_MODE_RESOURCELESS_SOFTWARE) |
131 return false; | 131 return false; |
132 | 132 |
133 internal_contents_scale_ = GetIdealContentsScale(); | 133 internal_contents_scale_ = GetIdealContentsScale(); |
134 internal_content_bounds_ = | 134 internal_content_bounds_ = |
135 gfx::ToCeiledSize(gfx::ScaleSize(bounds(), internal_contents_scale_)); | 135 gfx::ScaleToCeiledSize(bounds(), internal_contents_scale_); |
136 | 136 |
137 ReleaseUnmatchedSizeResources(resource_provider); | 137 ReleaseUnmatchedSizeResources(resource_provider); |
138 AcquireResource(resource_provider); | 138 AcquireResource(resource_provider); |
139 return LayerImpl::WillDraw(draw_mode, resource_provider); | 139 return LayerImpl::WillDraw(draw_mode, resource_provider); |
140 } | 140 } |
141 | 141 |
142 void HeadsUpDisplayLayerImpl::AppendQuads( | 142 void HeadsUpDisplayLayerImpl::AppendQuads( |
143 RenderPass* render_pass, | 143 RenderPass* render_pass, |
144 AppendQuadsData* append_quads_data) { | 144 AppendQuadsData* append_quads_data) { |
145 if (!resources_.back()->id()) | 145 if (!resources_.back()->id()) |
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
757 return "cc::HeadsUpDisplayLayerImpl"; | 757 return "cc::HeadsUpDisplayLayerImpl"; |
758 } | 758 } |
759 | 759 |
760 void HeadsUpDisplayLayerImpl::AsValueInto( | 760 void HeadsUpDisplayLayerImpl::AsValueInto( |
761 base::trace_event::TracedValue* dict) const { | 761 base::trace_event::TracedValue* dict) const { |
762 LayerImpl::AsValueInto(dict); | 762 LayerImpl::AsValueInto(dict); |
763 dict->SetString("layer_name", "Heads Up Display Layer"); | 763 dict->SetString("layer_name", "Heads Up Display Layer"); |
764 } | 764 } |
765 | 765 |
766 } // namespace cc | 766 } // namespace cc |
OLD | NEW |