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