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

Side by Side Diff: cc/heads_up_display_layer_impl.cc

Issue 11418217: Add skia::RefPtr class to wrap ref counted classes from Skia. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Drop TNoRef 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') | skia/ext/refptr.h » ('J')
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 = 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
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
OLDNEW
« no previous file with comments | « cc/gl_renderer.cc ('k') | cc/layer.h » ('j') | skia/ext/refptr.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698