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/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 gfx::Rect opaque_rect(contents_opaque() ? quad_rect : gfx::Rect()); | 152 gfx::Rect opaque_rect(contents_opaque() ? quad_rect : gfx::Rect()); |
153 gfx::Rect visible_quad_rect(quad_rect); | 153 gfx::Rect visible_quad_rect(quad_rect); |
154 bool premultiplied_alpha = true; | 154 bool premultiplied_alpha = true; |
155 gfx::PointF uv_top_left(0.f, 0.f); | 155 gfx::PointF uv_top_left(0.f, 0.f); |
156 gfx::PointF uv_bottom_right(1.f, 1.f); | 156 gfx::PointF uv_bottom_right(1.f, 1.f); |
157 const float vertex_opacity[] = { 1.f, 1.f, 1.f, 1.f }; | 157 const float vertex_opacity[] = { 1.f, 1.f, 1.f, 1.f }; |
158 bool flipped = false; | 158 bool flipped = false; |
159 bool nearest_neighbor = false; | 159 bool nearest_neighbor = false; |
160 TextureDrawQuad* quad = | 160 TextureDrawQuad* quad = |
161 render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>(); | 161 render_pass->CreateAndAppendDrawQuad<TextureDrawQuad>(); |
162 // TODO(danakj): crbug.com/455931 | |
163 layer_tree_impl()->resource_provider()->ValidateResource( | |
164 resources_.back()->id()); | |
165 quad->SetNew(shared_quad_state, | 162 quad->SetNew(shared_quad_state, |
166 quad_rect, | 163 quad_rect, |
167 opaque_rect, | 164 opaque_rect, |
168 visible_quad_rect, | 165 visible_quad_rect, |
169 resources_.back()->id(), | 166 resources_.back()->id(), |
170 premultiplied_alpha, | 167 premultiplied_alpha, |
171 uv_top_left, | 168 uv_top_left, |
172 uv_bottom_right, | 169 uv_bottom_right, |
173 SK_ColorTRANSPARENT, | 170 SK_ColorTRANSPARENT, |
174 vertex_opacity, | 171 vertex_opacity, |
175 flipped, | 172 flipped, |
176 nearest_neighbor); | 173 nearest_neighbor); |
| 174 ValidateQuadResources(quad); |
177 } | 175 } |
178 | 176 |
179 void HeadsUpDisplayLayerImpl::UpdateHudTexture( | 177 void HeadsUpDisplayLayerImpl::UpdateHudTexture( |
180 DrawMode draw_mode, | 178 DrawMode draw_mode, |
181 ResourceProvider* resource_provider) { | 179 ResourceProvider* resource_provider) { |
182 if (draw_mode == DRAW_MODE_RESOURCELESS_SOFTWARE || !resources_.back()->id()) | 180 if (draw_mode == DRAW_MODE_RESOURCELESS_SOFTWARE || !resources_.back()->id()) |
183 return; | 181 return; |
184 | 182 |
185 SkISize canvas_size; | 183 SkISize canvas_size; |
186 if (hud_surface_) | 184 if (hud_surface_) |
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
859 return "cc::HeadsUpDisplayLayerImpl"; | 857 return "cc::HeadsUpDisplayLayerImpl"; |
860 } | 858 } |
861 | 859 |
862 void HeadsUpDisplayLayerImpl::AsValueInto( | 860 void HeadsUpDisplayLayerImpl::AsValueInto( |
863 base::trace_event::TracedValue* dict) const { | 861 base::trace_event::TracedValue* dict) const { |
864 LayerImpl::AsValueInto(dict); | 862 LayerImpl::AsValueInto(dict); |
865 dict->SetString("layer_name", "Heads Up Display Layer"); | 863 dict->SetString("layer_name", "Heads Up Display Layer"); |
866 } | 864 } |
867 | 865 |
868 } // namespace cc | 866 } // namespace cc |
OLD | NEW |