| 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 21 matching lines...) Expand all Loading... |
| 32 // swizzle our colors when drawing to the SkCanvas. | 32 // swizzle our colors when drawing to the SkCanvas. |
| 33 SkColorMatrix swizzleMatrix; | 33 SkColorMatrix swizzleMatrix; |
| 34 for (int i = 0; i < 20; ++i) | 34 for (int i = 0; i < 20; ++i) |
| 35 swizzleMatrix.fMat[i] = 0; | 35 swizzleMatrix.fMat[i] = 0; |
| 36 swizzleMatrix.fMat[0 + 5 * 2] = 1; | 36 swizzleMatrix.fMat[0 + 5 * 2] = 1; |
| 37 swizzleMatrix.fMat[1 + 5 * 1] = 1; | 37 swizzleMatrix.fMat[1 + 5 * 1] = 1; |
| 38 swizzleMatrix.fMat[2 + 5 * 0] = 1; | 38 swizzleMatrix.fMat[2 + 5 * 0] = 1; |
| 39 swizzleMatrix.fMat[3 + 5 * 3] = 1; | 39 swizzleMatrix.fMat[3 + 5 * 3] = 1; |
| 40 | 40 |
| 41 SkPaint paint; | 41 SkPaint paint; |
| 42 paint.setColorFilter(new SkColorMatrixFilter(swizzleMatrix))->unref(); | 42 skia::RefPtr<SkColorMatrixFilter> filter = new SkColorMatrixFilter(swizzleMa
trix); |
| 43 paint.setColorFilter(filter.get()); |
| 43 | 44 |
| 44 return paint; | 45 return paint; |
| 45 } | 46 } |
| 46 | 47 |
| 47 HeadsUpDisplayLayerImpl::HeadsUpDisplayLayerImpl(int id) | 48 HeadsUpDisplayLayerImpl::HeadsUpDisplayLayerImpl(int id) |
| 48 : LayerImpl(id) | 49 : LayerImpl(id) |
| 49 , m_averageFPS(0) | 50 , m_averageFPS(0) |
| 50 , m_minFPS(0) | 51 , m_minFPS(0) |
| 51 , m_maxFPS(0) | 52 , m_maxFPS(0) |
| 52 , m_showFPSCounter(false) | 53 , m_showFPSCounter(false) |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 canvas->drawRect(skRect, paint); | 374 canvas->drawRect(skRect, paint); |
| 374 } | 375 } |
| 375 } | 376 } |
| 376 | 377 |
| 377 const char* HeadsUpDisplayLayerImpl::layerTypeAsString() const | 378 const char* HeadsUpDisplayLayerImpl::layerTypeAsString() const |
| 378 { | 379 { |
| 379 return "HeadsUpDisplayLayer"; | 380 return "HeadsUpDisplayLayer"; |
| 380 } | 381 } |
| 381 | 382 |
| 382 } // namespace cc | 383 } // namespace cc |
| OLD | NEW |