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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 void HeadsUpDisplayLayerImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& a
ppendQuadsData) | 91 void HeadsUpDisplayLayerImpl::appendQuads(QuadSink& quadSink, AppendQuadsData& a
ppendQuadsData) |
92 { | 92 { |
93 if (!m_hudTexture->id()) | 93 if (!m_hudTexture->id()) |
94 return; | 94 return; |
95 | 95 |
96 SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSharedQ
uadState()); | 96 SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSharedQ
uadState()); |
97 | 97 |
98 gfx::Rect quadRect(gfx::Point(), bounds()); | 98 gfx::Rect quadRect(gfx::Point(), bounds()); |
99 gfx::Rect opaqueRect(contentsOpaque() ? quadRect : gfx::Rect()); | 99 gfx::Rect opaqueRect(contentsOpaque() ? quadRect : gfx::Rect()); |
100 bool premultipliedAlpha = true; | 100 bool premultipliedAlpha = true; |
101 gfx::RectF uvRect(0, 0, 1, 1); | 101 gfx::PointF uv_top_left(0.f, 0.f); |
102 const float vertex_opacity[] = {1.0f, 1.0f, 1.0f, 1.0f}; | 102 gfx::PointF uv_bottom_right(1.f, 1.f); |
| 103 const float vertex_opacity[] = {1.f, 1.f, 1.f, 1.f}; |
103 bool flipped = false; | 104 bool flipped = false; |
104 scoped_ptr<TextureDrawQuad> quad = TextureDrawQuad::Create(); | 105 scoped_ptr<TextureDrawQuad> quad = TextureDrawQuad::Create(); |
105 quad->SetNew(sharedQuadState, quadRect, opaqueRect, m_hudTexture->id(), prem
ultipliedAlpha, uvRect, vertex_opacity, flipped); | 106 quad->SetNew(sharedQuadState, quadRect, opaqueRect, m_hudTexture->id(), prem
ultipliedAlpha, uv_top_left, uv_bottom_right, vertex_opacity, flipped); |
106 quadSink.append(quad.PassAs<DrawQuad>(), appendQuadsData); | 107 quadSink.append(quad.PassAs<DrawQuad>(), appendQuadsData); |
107 } | 108 } |
108 | 109 |
109 void HeadsUpDisplayLayerImpl::updateHudTexture(ResourceProvider* resourceProvide
r) | 110 void HeadsUpDisplayLayerImpl::updateHudTexture(ResourceProvider* resourceProvide
r) |
110 { | 111 { |
111 if (!m_hudTexture->id()) | 112 if (!m_hudTexture->id()) |
112 return; | 113 return; |
113 | 114 |
114 SkISize canvasSize; | 115 SkISize canvasSize; |
115 if (m_hudCanvas) | 116 if (m_hudCanvas) |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 | 386 |
386 canvas->restore(); | 387 canvas->restore(); |
387 } | 388 } |
388 | 389 |
389 const char* HeadsUpDisplayLayerImpl::layerTypeAsString() const | 390 const char* HeadsUpDisplayLayerImpl::layerTypeAsString() const |
390 { | 391 { |
391 return "HeadsUpDisplayLayer"; | 392 return "HeadsUpDisplayLayer"; |
392 } | 393 } |
393 | 394 |
394 } // namespace cc | 395 } // namespace cc |
OLD | NEW |