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/heads_up_display_layer_impl.h" | 5 #include "cc/heads_up_display_layer_impl.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
10 #include "cc/debug_rect_history.h" | 10 #include "cc/debug_rect_history.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 void HeadsUpDisplayLayerImpl::willDraw(ResourceProvider* resourceProvider) | 69 void HeadsUpDisplayLayerImpl::willDraw(ResourceProvider* resourceProvider) |
70 { | 70 { |
71 LayerImpl::willDraw(resourceProvider); | 71 LayerImpl::willDraw(resourceProvider); |
72 | 72 |
73 if (!m_hudTexture) | 73 if (!m_hudTexture) |
74 m_hudTexture = ScopedResource::create(resourceProvider); | 74 m_hudTexture = ScopedResource::create(resourceProvider); |
75 | 75 |
76 // FIXME: Scale the HUD by deviceScale to make it more friendly under high D
PI. | 76 // FIXME: Scale the HUD by deviceScale to make it more friendly under high D
PI. |
77 | 77 |
78 if (m_hudTexture->size() != bounds()) | 78 if (m_hudTexture->size() != bounds()) |
79 m_hudTexture->free(); | 79 m_hudTexture->Free(); |
80 | 80 |
81 if (!m_hudTexture->id()) | 81 if (!m_hudTexture->id()) |
82 m_hudTexture->allocate(Renderer::ImplPool, bounds(), GL_RGBA, ResourcePr
ovider::TextureUsageAny); | 82 m_hudTexture->Allocate(Renderer::ImplPool, bounds(), GL_RGBA, ResourcePr
ovider::TextureUsageAny); |
83 } | 83 } |
84 | 84 |
85 void HeadsUpDisplayLayerImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& a
ppendQuadsData) | 85 void HeadsUpDisplayLayerImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& a
ppendQuadsData) |
86 { | 86 { |
87 if (!m_hudTexture->id()) | 87 if (!m_hudTexture->id()) |
88 return; | 88 return; |
89 | 89 |
90 SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSharedQ
uadState()); | 90 SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSharedQ
uadState()); |
91 | 91 |
92 gfx::Rect quadRect(gfx::Point(), bounds()); | 92 gfx::Rect quadRect(gfx::Point(), bounds()); |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 canvas->drawRect(skRect, paint); | 368 canvas->drawRect(skRect, paint); |
369 } | 369 } |
370 } | 370 } |
371 | 371 |
372 const char* HeadsUpDisplayLayerImpl::layerTypeAsString() const | 372 const char* HeadsUpDisplayLayerImpl::layerTypeAsString() const |
373 { | 373 { |
374 return "HeadsUpDisplayLayer"; | 374 return "HeadsUpDisplayLayer"; |
375 } | 375 } |
376 | 376 |
377 } // namespace cc | 377 } // namespace cc |
OLD | NEW |