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 = |
| 43 skia::AdoptRef(new SkColorMatrixFilter(swizzleMatrix)); |
| 44 paint.setColorFilter(filter.get()); |
43 | 45 |
44 return paint; | 46 return paint; |
45 } | 47 } |
46 | 48 |
47 HeadsUpDisplayLayerImpl::HeadsUpDisplayLayerImpl(int id) | 49 HeadsUpDisplayLayerImpl::HeadsUpDisplayLayerImpl(int id) |
48 : LayerImpl(id) | 50 : LayerImpl(id) |
49 , m_averageFPS(0) | 51 , m_averageFPS(0) |
50 , m_minFPS(0) | 52 , m_minFPS(0) |
51 , m_maxFPS(0) | 53 , m_maxFPS(0) |
52 { | 54 { |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 | 375 |
374 canvas->restore(); | 376 canvas->restore(); |
375 } | 377 } |
376 | 378 |
377 const char* HeadsUpDisplayLayerImpl::layerTypeAsString() const | 379 const char* HeadsUpDisplayLayerImpl::layerTypeAsString() const |
378 { | 380 { |
379 return "HeadsUpDisplayLayer"; | 381 return "HeadsUpDisplayLayer"; |
380 } | 382 } |
381 | 383 |
382 } // namespace cc | 384 } // namespace cc |
OLD | NEW |