| 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())); | |
| 125 | 122 |
| 126 ReleaseUnmatchedSizeResources(resource_provider); | 123 ReleaseUnmatchedSizeResources(resource_provider); |
| 127 AcquireResource(resource_provider); | 124 AcquireResource(resource_provider); |
| 128 return LayerImpl::WillDraw(draw_mode, resource_provider); | 125 return LayerImpl::WillDraw(draw_mode, resource_provider); |
| 129 } | 126 } |
| 130 | 127 |
| 131 void HeadsUpDisplayLayerImpl::AppendQuads( | 128 void HeadsUpDisplayLayerImpl::AppendQuads( |
| 132 RenderPass* render_pass, | 129 RenderPass* render_pass, |
| 133 AppendQuadsData* append_quads_data) { | 130 AppendQuadsData* append_quads_data) { |
| 134 if (!resources_.back()->id()) | 131 if (!resources_.back()->id()) |
| (...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 800 return "cc::HeadsUpDisplayLayerImpl"; | 797 return "cc::HeadsUpDisplayLayerImpl"; |
| 801 } | 798 } |
| 802 | 799 |
| 803 void HeadsUpDisplayLayerImpl::AsValueInto( | 800 void HeadsUpDisplayLayerImpl::AsValueInto( |
| 804 base::trace_event::TracedValue* dict) const { | 801 base::trace_event::TracedValue* dict) const { |
| 805 LayerImpl::AsValueInto(dict); | 802 LayerImpl::AsValueInto(dict); |
| 806 dict->SetString("layer_name", "Heads Up Display Layer"); | 803 dict->SetString("layer_name", "Heads Up Display Layer"); |
| 807 } | 804 } |
| 808 | 805 |
| 809 } // namespace cc | 806 } // namespace cc |
| OLD | NEW |