| 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/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 PopulateSharedQuadState(shared_quad_state); | 141 PopulateSharedQuadState(shared_quad_state); |
| 142 | 142 |
| 143 gfx::Rect quad_rect(content_bounds()); | 143 gfx::Rect quad_rect(content_bounds()); |
| 144 gfx::Rect opaque_rect(contents_opaque() ? quad_rect : gfx::Rect()); | 144 gfx::Rect opaque_rect(contents_opaque() ? quad_rect : gfx::Rect()); |
| 145 gfx::Rect visible_quad_rect(quad_rect); | 145 gfx::Rect visible_quad_rect(quad_rect); |
| 146 bool premultiplied_alpha = true; | 146 bool premultiplied_alpha = true; |
| 147 gfx::PointF uv_top_left(0.f, 0.f); | 147 gfx::PointF uv_top_left(0.f, 0.f); |
| 148 gfx::PointF uv_bottom_right(1.f, 1.f); | 148 gfx::PointF uv_bottom_right(1.f, 1.f); |
| 149 const float vertex_opacity[] = { 1.f, 1.f, 1.f, 1.f }; | 149 const float vertex_opacity[] = { 1.f, 1.f, 1.f, 1.f }; |
| 150 bool flipped = false; | 150 bool flipped = false; |
| 151 bool nearest_neighbor = false; |
| 151 TextureDrawQuad* quad = | 152 TextureDrawQuad* quad = |
| 152 render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>(); | 153 render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>(); |
| 153 quad->SetNew(shared_quad_state, | 154 quad->SetNew(shared_quad_state, |
| 154 quad_rect, | 155 quad_rect, |
| 155 opaque_rect, | 156 opaque_rect, |
| 156 visible_quad_rect, | 157 visible_quad_rect, |
| 157 resources_.back()->id(), | 158 resources_.back()->id(), |
| 158 premultiplied_alpha, | 159 premultiplied_alpha, |
| 159 uv_top_left, | 160 uv_top_left, |
| 160 uv_bottom_right, | 161 uv_bottom_right, |
| 161 SK_ColorTRANSPARENT, | 162 SK_ColorTRANSPARENT, |
| 162 vertex_opacity, | 163 vertex_opacity, |
| 163 flipped); | 164 flipped, |
| 165 nearest_neighbor); |
| 164 } | 166 } |
| 165 | 167 |
| 166 void HeadsUpDisplayLayerImpl::UpdateHudTexture( | 168 void HeadsUpDisplayLayerImpl::UpdateHudTexture( |
| 167 DrawMode draw_mode, | 169 DrawMode draw_mode, |
| 168 ResourceProvider* resource_provider) { | 170 ResourceProvider* resource_provider) { |
| 169 if (draw_mode == DRAW_MODE_RESOURCELESS_SOFTWARE || !resources_.back()->id()) | 171 if (draw_mode == DRAW_MODE_RESOURCELESS_SOFTWARE || !resources_.back()->id()) |
| 170 return; | 172 return; |
| 171 | 173 |
| 172 SkISize canvas_size; | 174 SkISize canvas_size; |
| 173 if (hud_canvas_) | 175 if (hud_canvas_) |
| (...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 782 return "cc::HeadsUpDisplayLayerImpl"; | 784 return "cc::HeadsUpDisplayLayerImpl"; |
| 783 } | 785 } |
| 784 | 786 |
| 785 void HeadsUpDisplayLayerImpl::AsValueInto( | 787 void HeadsUpDisplayLayerImpl::AsValueInto( |
| 786 base::debug::TracedValue* dict) const { | 788 base::debug::TracedValue* dict) const { |
| 787 LayerImpl::AsValueInto(dict); | 789 LayerImpl::AsValueInto(dict); |
| 788 dict->SetString("layer_name", "Heads Up Display Layer"); | 790 dict->SetString("layer_name", "Heads Up Display Layer"); |
| 789 } | 791 } |
| 790 | 792 |
| 791 } // namespace cc | 793 } // namespace cc |
| OLD | NEW |