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 "CCDebugRectHistory.h" | 10 #include "CCDebugRectHistory.h" |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 // parent compositor. We will probably need to hold on to m_hudTexture for | 119 // parent compositor. We will probably need to hold on to m_hudTexture for |
120 // longer, and have several HUD textures in the pipeline. | 120 // longer, and have several HUD textures in the pipeline. |
121 ASSERT(!resourceProvider->inUseByConsumer(m_hudTexture->id())); | 121 ASSERT(!resourceProvider->inUseByConsumer(m_hudTexture->id())); |
122 } | 122 } |
123 | 123 |
124 void CCHeadsUpDisplayLayerImpl::didLoseContext() | 124 void CCHeadsUpDisplayLayerImpl::didLoseContext() |
125 { | 125 { |
126 m_hudTexture.clear(); | 126 m_hudTexture.clear(); |
127 } | 127 } |
128 | 128 |
| 129 bool CCHeadsUpDisplayLayerImpl::layerIsAlwaysDamaged() const |
| 130 { |
| 131 return true; |
| 132 } |
| 133 |
129 void CCHeadsUpDisplayLayerImpl::drawHudContents(SkCanvas* canvas) | 134 void CCHeadsUpDisplayLayerImpl::drawHudContents(SkCanvas* canvas) |
130 { | 135 { |
131 const CCLayerTreeSettings& settings = layerTreeHostImpl()->settings(); | 136 const CCLayerTreeSettings& settings = layerTreeHostImpl()->settings(); |
132 | 137 |
133 if (settings.showPlatformLayerTree) { | 138 if (settings.showPlatformLayerTree) { |
134 SkPaint paint = createPaint(); | 139 SkPaint paint = createPaint(); |
135 paint.setColor(SkColorSetARGB(192, 0, 0, 0)); | 140 paint.setColor(SkColorSetARGB(192, 0, 0, 0)); |
136 canvas->drawRect(SkRect::MakeXYWH(0, 0, bounds().width(), bounds().heigh
t()), paint); | 141 canvas->drawRect(SkRect::MakeXYWH(0, 0, bounds().width(), bounds().heigh
t()), paint); |
137 } | 142 } |
138 | 143 |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 paint.setColor(fillColor); | 280 paint.setColor(fillColor); |
276 canvas->drawRect(skRect, paint); | 281 canvas->drawRect(skRect, paint); |
277 | 282 |
278 paint.setColor(strokeColor); | 283 paint.setColor(strokeColor); |
279 paint.setStyle(SkPaint::kStroke_Style); | 284 paint.setStyle(SkPaint::kStroke_Style); |
280 paint.setStrokeWidth(2); | 285 paint.setStrokeWidth(2); |
281 canvas->drawRect(skRect, paint); | 286 canvas->drawRect(skRect, paint); |
282 } | 287 } |
283 } | 288 } |
284 | 289 |
| 290 const char* CCHeadsUpDisplayLayerImpl::layerTypeAsString() const |
| 291 { |
| 292 return "HeadsUpDisplayLayer"; |
285 } | 293 } |
| 294 |
| 295 } |
OLD | NEW |