Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Side by Side Diff: cc/heads_up_display_layer_impl.cc

Issue 11412255: cc: Use skia::RefPtr in place of raw pointers and SkAutoTUnref. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ref() Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/gl_renderer.cc ('k') | cc/layer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « cc/gl_renderer.cc ('k') | cc/layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698