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

Side by Side Diff: gm/blurrect.cpp

Issue 831113002: Cleanup: More override fixes - another round. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 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/bitmapscroll.cpp ('k') | gm/blurs.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 "SkBlurMask.h" 9 #include "SkBlurMask.h"
10 #include "SkBlurMaskFilter.h" 10 #include "SkBlurMaskFilter.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 94
95 protected: 95 protected:
96 virtual void onOnceBeforeDraw() SK_OVERRIDE { 96 virtual void onOnceBeforeDraw() SK_OVERRIDE {
97 for (int i = 0; i <= kLastEnum_SkBlurStyle; ++i) { 97 for (int i = 0; i <= kLastEnum_SkBlurStyle; ++i) {
98 fMaskFilters[i].reset(SkBlurMaskFilter::Create((SkBlurStyle)i, 98 fMaskFilters[i].reset(SkBlurMaskFilter::Create((SkBlurStyle)i,
99 SkBlurMask::ConvertRadiusToSigma(SkIntToScalar (STROKE_WIDTH/2)), 99 SkBlurMask::ConvertRadiusToSigma(SkIntToScalar (STROKE_WIDTH/2)),
100 SkBlurMaskFilter::kHighQuality_BlurFlag)); 100 SkBlurMaskFilter::kHighQuality_BlurFlag));
101 } 101 }
102 } 102 }
103 103
104 virtual SkString onShortName() { 104 virtual SkString onShortName() SK_OVERRIDE {
105 return fName; 105 return fName;
106 } 106 }
107 107
108 virtual SkISize onISize() { 108 virtual SkISize onISize() SK_OVERRIDE {
109 return SkISize::Make(860, 820); 109 return SkISize::Make(860, 820);
110 } 110 }
111 111
112 virtual void onDraw(SkCanvas* canvas) { 112 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
113 canvas->translate(STROKE_WIDTH*3/2, STROKE_WIDTH*3/2); 113 canvas->translate(STROKE_WIDTH*3/2, STROKE_WIDTH*3/2);
114 114
115 SkRect r = { 0, 0, 100, 50 }; 115 SkRect r = { 0, 0, 100, 50 };
116 SkScalar scales[] = { SK_Scalar1, 0.6f }; 116 SkScalar scales[] = { SK_Scalar1, 0.6f };
117 117
118 for (size_t s = 0; s < SK_ARRAY_COUNT(scales); ++s) { 118 for (size_t s = 0; s < SK_ARRAY_COUNT(scales); ++s) {
119 canvas->save(); 119 canvas->save();
120 for (size_t f = 0; f < SK_ARRAY_COUNT(fMaskFilters); ++f) { 120 for (size_t f = 0; f < SK_ARRAY_COUNT(fMaskFilters); ++f) {
121 SkPaint paint; 121 SkPaint paint;
122 paint.setMaskFilter(fMaskFilters[f]); 122 paint.setMaskFilter(fMaskFilters[f]);
(...skipping 17 matching lines...) Expand all
140 this->drawProcs(canvas, r, paintWithRadial, true, procs, SK_ARRA Y_COUNT(procs)); 140 this->drawProcs(canvas, r, paintWithRadial, true, procs, SK_ARRA Y_COUNT(procs));
141 canvas->restore(); 141 canvas->restore();
142 142
143 canvas->translate(0, SK_ARRAY_COUNT(procs) * r.height() * 4/3 * scales[s]); 143 canvas->translate(0, SK_ARRAY_COUNT(procs) * r.height() * 4/3 * scales[s]);
144 } 144 }
145 canvas->restore(); 145 canvas->restore();
146 canvas->translate(4 * r.width() * 4/3 * scales[s], 0); 146 canvas->translate(4 * r.width() * 4/3 * scales[s], 0);
147 } 147 }
148 } 148 }
149 149
150 virtual uint32_t onGetFlags() const { return kSkipPipe_Flag | kSkipTiled_Fla g; } 150 virtual uint32_t onGetFlags() const SK_OVERRIDE { return kSkipPipe_Flag | kS kipTiled_Flag; }
151 151
152 private: 152 private:
153 void drawProcs(SkCanvas* canvas, const SkRect& r, const SkPaint& paint, 153 void drawProcs(SkCanvas* canvas, const SkRect& r, const SkPaint& paint,
154 bool doClip, const Proc procs[], size_t procsCount) { 154 bool doClip, const Proc procs[], size_t procsCount) {
155 SkAutoCanvasRestore acr(canvas, true); 155 SkAutoCanvasRestore acr(canvas, true);
156 for (size_t i = 0; i < procsCount; ++i) { 156 for (size_t i = 0; i < procsCount; ++i) {
157 if (doClip) { 157 if (doClip) {
158 SkRect clipRect(r); 158 SkRect clipRect(r);
159 clipRect.inset(STROKE_WIDTH/2, STROKE_WIDTH/2); 159 clipRect.inset(STROKE_WIDTH/2, STROKE_WIDTH/2);
160 canvas->save(); 160 canvas->save();
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 } 417 }
418 private: 418 private:
419 typedef BlurRectCompareGM INHERITED; 419 typedef BlurRectCompareGM INHERITED;
420 }; 420 };
421 421
422 422
423 ////////////////////////////////////////////////////////////////////////////// 423 //////////////////////////////////////////////////////////////////////////////
424 424
425 DEF_GM(return new BlurRectGM("blurrects", 0xFF);) 425 DEF_GM(return new BlurRectGM("blurrects", 0xFF);)
426 DEF_GM(return new BlurRectDirectGM("blurrect_gallery");) 426 DEF_GM(return new BlurRectDirectGM("blurrect_gallery");)
OLDNEW
« no previous file with comments | « gm/bitmapscroll.cpp ('k') | gm/blurs.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698