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

Side by Side Diff: gm/colorfilters.cpp

Issue 1827433002: Reland of [2] of "switch colorfilters to sk_sp (patchset #11 id:200001 of https://codereview.chromium.o… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 months 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
« no previous file with comments | « gm/colorfilterimagefilter.cpp ('k') | gm/colormatrix.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "gm.h" 8 #include "gm.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkColorMatrixFilter.h" 10 #include "SkColorMatrixFilter.h"
(...skipping 12 matching lines...) Expand all
23 SkShader::kClamp_TileMode); 23 SkShader::kClamp_TileMode);
24 } 24 }
25 25
26 typedef void (*InstallPaint)(SkPaint*, uint32_t, uint32_t); 26 typedef void (*InstallPaint)(SkPaint*, uint32_t, uint32_t);
27 27
28 static void install_nothing(SkPaint* paint, uint32_t, uint32_t) { 28 static void install_nothing(SkPaint* paint, uint32_t, uint32_t) {
29 paint->setColorFilter(nullptr); 29 paint->setColorFilter(nullptr);
30 } 30 }
31 31
32 static void install_lighting(SkPaint* paint, uint32_t mul, uint32_t add) { 32 static void install_lighting(SkPaint* paint, uint32_t mul, uint32_t add) {
33 paint->setColorFilter(SkColorMatrixFilter::CreateLightingFilter(mul, add))-> unref(); 33 paint->setColorFilter(SkColorMatrixFilter::MakeLightingFilter(mul, add));
34 } 34 }
35 35
36 class ColorFiltersGM : public skiagm::GM { 36 class ColorFiltersGM : public skiagm::GM {
37 public: 37 public:
38 ColorFiltersGM() { 38 ColorFiltersGM() {
39 fName.set("lightingcolorfilter"); 39 fName.set("lightingcolorfilter");
40 } 40 }
41 41
42 protected: 42 protected:
43 virtual SkString onShortName() override { 43 virtual SkString onShortName() override {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 77
78 private: 78 private:
79 SkString fName; 79 SkString fName;
80 typedef GM INHERITED; 80 typedef GM INHERITED;
81 }; 81 };
82 82
83 83
84 ////////////////////////////////////////////////////////////////////////////// 84 //////////////////////////////////////////////////////////////////////////////
85 85
86 DEF_GM(return new ColorFiltersGM;) 86 DEF_GM(return new ColorFiltersGM;)
OLDNEW
« no previous file with comments | « gm/colorfilterimagefilter.cpp ('k') | gm/colormatrix.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698