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

Side by Side Diff: gm/matrixconvolution.cpp

Issue 1793303002: Reland of "more shader-->sp conversions (patchset #5 id:80001 of https://codereview.chromium… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: make pictureRef a value, so its clearer what's going on 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/lumafilter.cpp ('k') | gm/modecolorfilters.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 2012 Google Inc. 2 * Copyright 2012 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 "SkColor.h" 9 #include "SkColor.h"
10 #include "SkMatrixConvolutionImageFilter.h" 10 #include "SkMatrixConvolutionImageFilter.h"
(...skipping 19 matching lines...) Expand all
30 canvas.clear(0x00000000); 30 canvas.clear(0x00000000);
31 SkPaint paint; 31 SkPaint paint;
32 paint.setAntiAlias(true); 32 paint.setAntiAlias(true);
33 sk_tool_utils::set_portable_typeface(&paint); 33 sk_tool_utils::set_portable_typeface(&paint);
34 paint.setColor(0xFFFFFFFF); 34 paint.setColor(0xFFFFFFFF);
35 paint.setTextSize(SkIntToScalar(180)); 35 paint.setTextSize(SkIntToScalar(180));
36 SkPoint pts[2] = { SkPoint::Make(0, 0), 36 SkPoint pts[2] = { SkPoint::Make(0, 0),
37 SkPoint::Make(0, SkIntToScalar(80)) }; 37 SkPoint::Make(0, SkIntToScalar(80)) };
38 SkColor colors[2] = { 0xFFFFFFFF, 0x40404040 }; 38 SkColor colors[2] = { 0xFFFFFFFF, 0x40404040 };
39 SkScalar pos[2] = { 0, SkIntToScalar(80) }; 39 SkScalar pos[2] = { 0, SkIntToScalar(80) };
40 paint.setShader(SkGradientShader::CreateLinear( 40 paint.setShader(SkGradientShader::MakeLinear(
41 pts, colors, pos, 2, SkShader::kClamp_TileMode))->unref(); 41 pts, colors, pos, 2, SkShader::kClamp_TileMode));
42 const char* str = "e"; 42 const char* str = "e";
43 canvas.drawText(str, strlen(str), SkIntToScalar(-10), SkIntToScalar(80), paint); 43 canvas.drawText(str, strlen(str), SkIntToScalar(-10), SkIntToScalar(80), paint);
44 } 44 }
45 45
46 SkISize onISize() override { 46 SkISize onISize() override {
47 return SkISize::Make(500, 300); 47 return SkISize::Make(500, 300);
48 } 48 }
49 49
50 void draw(SkCanvas* canvas, int x, int y, const SkIPoint& kernelOffset, 50 void draw(SkCanvas* canvas, int x, int y, const SkIPoint& kernelOffset,
51 SkMatrixConvolutionImageFilter::TileMode tileMode, bool convolveAl pha, 51 SkMatrixConvolutionImageFilter::TileMode tileMode, bool convolveAl pha,
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 SkBitmap fBitmap; 108 SkBitmap fBitmap;
109 109
110 typedef GM INHERITED; 110 typedef GM INHERITED;
111 }; 111 };
112 112
113 ////////////////////////////////////////////////////////////////////////////// 113 //////////////////////////////////////////////////////////////////////////////
114 114
115 DEF_GM(return new MatrixConvolutionGM;) 115 DEF_GM(return new MatrixConvolutionGM;)
116 116
117 } 117 }
OLDNEW
« no previous file with comments | « gm/lumafilter.cpp ('k') | gm/modecolorfilters.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698