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

Side by Side Diff: samplecode/SampleUnpremul.cpp

Issue 1533373002: Reland of change all factories to return their base-class (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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
« no previous file with comments | « samplecode/SampleTiling.cpp ('k') | src/effects/SkDisplacementMapEffect.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 2013 Google Inc. 2 * Copyright 2013 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 9
10 #include "sk_tool_utils.h" 10 #include "sk_tool_utils.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 } 76 }
77 77
78 void onDrawBackground(SkCanvas* canvas) override { 78 void onDrawBackground(SkCanvas* canvas) override {
79 sk_tool_utils::draw_checkerboard(canvas, 0xFFCCCCCC, 0xFFFFFFFF, 12); 79 sk_tool_utils::draw_checkerboard(canvas, 0xFFCCCCCC, 0xFFFFFFFF, 12);
80 } 80 }
81 81
82 void onDrawContent(SkCanvas* canvas) override { 82 void onDrawContent(SkCanvas* canvas) override {
83 SkPaint paint; 83 SkPaint paint;
84 paint.setAntiAlias(true); 84 paint.setAntiAlias(true);
85 paint.setTextSize(SkIntToScalar(24)); 85 paint.setTextSize(SkIntToScalar(24));
86 SkAutoTUnref<SkBlurDrawLooper> looper( 86 SkAutoTUnref<SkDrawLooper> looper(
87 SkBlurDrawLooper::Create(SK_ColorBLUE, 87 SkBlurDrawLooper::Create(SK_ColorBLUE,
88 SkBlurMask::ConvertRadiusToSigma(SkIntToSca lar(2)), 88 SkBlurMask::ConvertRadiusToSigma(SkIntToSca lar(2)),
89 0, 0)); 89 0, 0));
90 paint.setLooper(looper); 90 paint.setLooper(looper);
91 SkScalar height = paint.getFontMetrics(nullptr); 91 SkScalar height = paint.getFontMetrics(nullptr);
92 if (!fDecodeSucceeded) { 92 if (!fDecodeSucceeded) {
93 SkString failure; 93 SkString failure;
94 if (fResPath.size() == 0) { 94 if (fResPath.size() == 0) {
95 failure.printf("resource path is required!"); 95 failure.printf("resource path is required!");
96 } else { 96 } else {
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 188
189 typedef SampleView INHERITED; 189 typedef SampleView INHERITED;
190 }; 190 };
191 191
192 ////////////////////////////////////////////////////////////////////////////// 192 //////////////////////////////////////////////////////////////////////////////
193 193
194 static SkView* MyFactory() { 194 static SkView* MyFactory() {
195 return new UnpremulView(GetResourcePath()); 195 return new UnpremulView(GetResourcePath());
196 } 196 }
197 static SkViewRegister reg(MyFactory); 197 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleTiling.cpp ('k') | src/effects/SkDisplacementMapEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698