| 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 "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "CCHeadsUpDisplayLayerImpl.h" | 7 #include "CCHeadsUpDisplayLayerImpl.h" |
| 8 | 8 |
| 9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
| 10 #include "ui/gfx/point.h" | 10 #include "ui/gfx/point.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 | 56 |
| 57 void CCHeadsUpDisplayLayerImpl::willDraw(CCResourceProvider* resourceProvider) | 57 void CCHeadsUpDisplayLayerImpl::willDraw(CCResourceProvider* resourceProvider) |
| 58 { | 58 { |
| 59 CCLayerImpl::willDraw(resourceProvider); | 59 CCLayerImpl::willDraw(resourceProvider); |
| 60 | 60 |
| 61 if (!m_hudTexture) | 61 if (!m_hudTexture) |
| 62 m_hudTexture = CCScopedTexture::create(resourceProvider); | 62 m_hudTexture = CCScopedTexture::create(resourceProvider); |
| 63 | 63 |
| 64 // FIXME: Scale the HUD by deviceScale to make it more friendly under high D
PI. | 64 // FIXME: Scale the HUD by deviceScale to make it more friendly under high D
PI. |
| 65 | 65 |
| 66 if (m_hudTexture->size() != bounds()) | 66 //if (m_hudTexture->size() != bounds()) |
| 67 m_hudTexture->free(); | 67 m_hudTexture->free(); |
| 68 | 68 |
| 69 if (!m_hudTexture->id()) | 69 if (!m_hudTexture->id()) |
| 70 m_hudTexture->allocate(CCRenderer::ImplPool, bounds(), GraphicsContext3D
::RGBA, CCResourceProvider::TextureUsageAny); | 70 m_hudTexture->allocate(CCRenderer::ImplPool, bounds(), GraphicsContext3D
::RGBA, CCResourceProvider::TextureUsageAny); |
| 71 } | 71 } |
| 72 | 72 |
| 73 void CCHeadsUpDisplayLayerImpl::appendQuads(CCQuadSink& quadSink, CCAppendQuadsD
ata& appendQuadsData) | 73 void CCHeadsUpDisplayLayerImpl::appendQuads(CCQuadSink& quadSink, CCAppendQuadsD
ata& appendQuadsData) |
| 74 { | 74 { |
| 75 if (!m_hudTexture->id()) | 75 if (!m_hudTexture->id()) |
| 76 return; | 76 return; |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 canvas->drawRect(skRect, paint); | 287 canvas->drawRect(skRect, paint); |
| 288 } | 288 } |
| 289 } | 289 } |
| 290 | 290 |
| 291 const char* CCHeadsUpDisplayLayerImpl::layerTypeAsString() const | 291 const char* CCHeadsUpDisplayLayerImpl::layerTypeAsString() const |
| 292 { | 292 { |
| 293 return "HeadsUpDisplayLayer"; | 293 return "HeadsUpDisplayLayer"; |
| 294 } | 294 } |
| 295 | 295 |
| 296 } | 296 } |
| OLD | NEW |