| 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_colors.h" | 10 #include "cc/debug_colors.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 { | 84 { |
| 85 if (!m_hudTexture->id()) | 85 if (!m_hudTexture->id()) |
| 86 return; | 86 return; |
| 87 | 87 |
| 88 SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSharedQ
uadState()); | 88 SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSharedQ
uadState()); |
| 89 | 89 |
| 90 gfx::Rect quadRect(gfx::Point(), bounds()); | 90 gfx::Rect quadRect(gfx::Point(), bounds()); |
| 91 gfx::Rect opaqueRect(contentsOpaque() ? quadRect : gfx::Rect()); | 91 gfx::Rect opaqueRect(contentsOpaque() ? quadRect : gfx::Rect()); |
| 92 bool premultipliedAlpha = true; | 92 bool premultipliedAlpha = true; |
| 93 gfx::RectF uvRect(0, 0, 1, 1); | 93 gfx::RectF uvRect(0, 0, 1, 1); |
| 94 const float vertex_opacity[] = {1.0f, 1.0f, 1.0f, 1.0f}; |
| 94 bool flipped = false; | 95 bool flipped = false; |
| 95 scoped_ptr<TextureDrawQuad> quad = TextureDrawQuad::Create(); | 96 scoped_ptr<TextureDrawQuad> quad = TextureDrawQuad::Create(); |
| 96 quad->SetNew(sharedQuadState, quadRect, opaqueRect, m_hudTexture->id(), prem
ultipliedAlpha, uvRect, flipped); | 97 quad->SetNew(sharedQuadState, quadRect, opaqueRect, m_hudTexture->id(), prem
ultipliedAlpha, uvRect, vertex_opacity, flipped); |
| 97 quadSink.append(quad.PassAs<DrawQuad>(), appendQuadsData); | 98 quadSink.append(quad.PassAs<DrawQuad>(), appendQuadsData); |
| 98 } | 99 } |
| 99 | 100 |
| 100 void HeadsUpDisplayLayerImpl::updateHudTexture(ResourceProvider* resourceProvide
r) | 101 void HeadsUpDisplayLayerImpl::updateHudTexture(ResourceProvider* resourceProvide
r) |
| 101 { | 102 { |
| 102 if (!m_hudTexture->id()) | 103 if (!m_hudTexture->id()) |
| 103 return; | 104 return; |
| 104 | 105 |
| 105 SkISize canvasSize; | 106 SkISize canvasSize; |
| 106 if (m_hudCanvas) | 107 if (m_hudCanvas) |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 | 376 |
| 376 canvas->restore(); | 377 canvas->restore(); |
| 377 } | 378 } |
| 378 | 379 |
| 379 const char* HeadsUpDisplayLayerImpl::layerTypeAsString() const | 380 const char* HeadsUpDisplayLayerImpl::layerTypeAsString() const |
| 380 { | 381 { |
| 381 return "HeadsUpDisplayLayer"; | 382 return "HeadsUpDisplayLayer"; |
| 382 } | 383 } |
| 383 | 384 |
| 384 } // namespace cc | 385 } // namespace cc |
| OLD | NEW |