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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 if (!m_hudTexture->id()) | 88 if (!m_hudTexture->id()) |
89 return; | 89 return; |
90 | 90 |
91 SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSharedQ
uadState()); | 91 SharedQuadState* sharedQuadState = quadSink.useSharedQuadState(createSharedQ
uadState()); |
92 | 92 |
93 gfx::Rect quadRect(gfx::Point(), bounds()); | 93 gfx::Rect quadRect(gfx::Point(), bounds()); |
94 gfx::Rect opaqueRect(contentsOpaque() ? quadRect : gfx::Rect()); | 94 gfx::Rect opaqueRect(contentsOpaque() ? quadRect : gfx::Rect()); |
95 bool premultipliedAlpha = true; | 95 bool premultipliedAlpha = true; |
96 gfx::RectF uvRect(0, 0, 1, 1); | 96 gfx::RectF uvRect(0, 0, 1, 1); |
97 bool flipped = false; | 97 bool flipped = false; |
98 quadSink.append(TextureDrawQuad::create(sharedQuadState, quadRect, opaqueRec
t, m_hudTexture->id(), premultipliedAlpha, uvRect, flipped).PassAs<DrawQuad>(),
appendQuadsData); | 98 scoped_ptr<TextureDrawQuad> quad = TextureDrawQuad::Create(); |
| 99 quad->SetNew(sharedQuadState, quadRect, opaqueRect, m_hudTexture->id(), prem
ultipliedAlpha, uvRect, flipped); |
| 100 quadSink.append(quad.PassAs<DrawQuad>(), appendQuadsData); |
99 } | 101 } |
100 | 102 |
101 void HeadsUpDisplayLayerImpl::updateHudTexture(ResourceProvider* resourceProvide
r) | 103 void HeadsUpDisplayLayerImpl::updateHudTexture(ResourceProvider* resourceProvide
r) |
102 { | 104 { |
103 if (!m_hudTexture->id()) | 105 if (!m_hudTexture->id()) |
104 return; | 106 return; |
105 | 107 |
106 SkISize canvasSize; | 108 SkISize canvasSize; |
107 if (m_hudCanvas) | 109 if (m_hudCanvas) |
108 canvasSize = m_hudCanvas->getDeviceSize(); | 110 canvasSize = m_hudCanvas->getDeviceSize(); |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 canvas->drawRect(skRect, paint); | 373 canvas->drawRect(skRect, paint); |
372 } | 374 } |
373 } | 375 } |
374 | 376 |
375 const char* HeadsUpDisplayLayerImpl::layerTypeAsString() const | 377 const char* HeadsUpDisplayLayerImpl::layerTypeAsString() const |
376 { | 378 { |
377 return "HeadsUpDisplayLayer"; | 379 return "HeadsUpDisplayLayer"; |
378 } | 380 } |
379 | 381 |
380 } // namespace cc | 382 } // namespace cc |
OLD | NEW |