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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 } | 112 } |
113 | 113 |
114 bool HeadsUpDisplayLayerImpl::WillDraw(DrawMode draw_mode, | 114 bool HeadsUpDisplayLayerImpl::WillDraw(DrawMode draw_mode, |
115 ResourceProvider* resource_provider) { | 115 ResourceProvider* resource_provider) { |
116 if (draw_mode == DRAW_MODE_RESOURCELESS_SOFTWARE) | 116 if (draw_mode == DRAW_MODE_RESOURCELESS_SOFTWARE) |
117 return false; | 117 return false; |
118 | 118 |
119 internal_contents_scale_ = GetIdealContentsScale(); | 119 internal_contents_scale_ = GetIdealContentsScale(); |
120 internal_content_bounds_ = | 120 internal_content_bounds_ = |
121 gfx::ScaleToCeiledSize(bounds(), internal_contents_scale_); | 121 gfx::ScaleToCeiledSize(bounds(), internal_contents_scale_); |
| 122 internal_content_bounds_.SetToMin( |
| 123 gfx::Size(resource_provider->max_texture_size(), |
| 124 resource_provider->max_texture_size())); |
122 | 125 |
123 ReleaseUnmatchedSizeResources(resource_provider); | 126 ReleaseUnmatchedSizeResources(resource_provider); |
124 AcquireResource(resource_provider); | 127 AcquireResource(resource_provider); |
125 return LayerImpl::WillDraw(draw_mode, resource_provider); | 128 return LayerImpl::WillDraw(draw_mode, resource_provider); |
126 } | 129 } |
127 | 130 |
128 void HeadsUpDisplayLayerImpl::AppendQuads( | 131 void HeadsUpDisplayLayerImpl::AppendQuads( |
129 RenderPass* render_pass, | 132 RenderPass* render_pass, |
130 AppendQuadsData* append_quads_data) { | 133 AppendQuadsData* append_quads_data) { |
131 if (!resources_.back()->id()) | 134 if (!resources_.back()->id()) |
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
797 return "cc::HeadsUpDisplayLayerImpl"; | 800 return "cc::HeadsUpDisplayLayerImpl"; |
798 } | 801 } |
799 | 802 |
800 void HeadsUpDisplayLayerImpl::AsValueInto( | 803 void HeadsUpDisplayLayerImpl::AsValueInto( |
801 base::trace_event::TracedValue* dict) const { | 804 base::trace_event::TracedValue* dict) const { |
802 LayerImpl::AsValueInto(dict); | 805 LayerImpl::AsValueInto(dict); |
803 dict->SetString("layer_name", "Heads Up Display Layer"); | 806 dict->SetString("layer_name", "Heads Up Display Layer"); |
804 } | 807 } |
805 | 808 |
806 } // namespace cc | 809 } // namespace cc |
OLD | NEW |