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

Side by Side Diff: gm/resizeimagefilter.cpp

Issue 1316233002: Style Change: NULL->nullptr (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-27 (Thursday) 10:25:06 EDT Created 5 years, 3 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/pictureshadertile.cpp ('k') | gm/roundrects.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 #include "SkBitmapSource.h" 9 #include "SkBitmapSource.h"
10 #include "SkColor.h" 10 #include "SkColor.h"
11 #include "SkRefCnt.h" 11 #include "SkRefCnt.h"
12 12
13 namespace skiagm { 13 namespace skiagm {
14 14
15 class ResizeGM : public GM { 15 class ResizeGM : public GM {
16 public: 16 public:
17 ResizeGM() { 17 ResizeGM() {
18 this->setBGColor(0x00000000); 18 this->setBGColor(0x00000000);
19 } 19 }
20 20
21 protected: 21 protected:
22 virtual SkString onShortName() { 22 virtual SkString onShortName() {
23 return SkString("resizeimagefilter"); 23 return SkString("resizeimagefilter");
24 } 24 }
25 25
26 void draw(SkCanvas* canvas, 26 void draw(SkCanvas* canvas,
27 const SkRect& rect, 27 const SkRect& rect,
28 const SkSize& deviceSize, 28 const SkSize& deviceSize,
29 SkFilterQuality filterQuality, 29 SkFilterQuality filterQuality,
30 SkImageFilter* input = NULL) { 30 SkImageFilter* input = nullptr) {
31 SkRect dstRect; 31 SkRect dstRect;
32 canvas->getTotalMatrix().mapRect(&dstRect, rect); 32 canvas->getTotalMatrix().mapRect(&dstRect, rect);
33 canvas->save(); 33 canvas->save();
34 SkScalar deviceScaleX = deviceSize.width() / dstRect.width(); 34 SkScalar deviceScaleX = deviceSize.width() / dstRect.width();
35 SkScalar deviceScaleY = deviceSize.height() / dstRect.height(); 35 SkScalar deviceScaleY = deviceSize.height() / dstRect.height();
36 canvas->translate(rect.x(), rect.y()); 36 canvas->translate(rect.x(), rect.y());
37 canvas->scale(deviceScaleX, deviceScaleY); 37 canvas->scale(deviceScaleX, deviceScaleY);
38 canvas->translate(-rect.x(), -rect.y()); 38 canvas->translate(-rect.x(), -rect.y());
39 SkMatrix matrix; 39 SkMatrix matrix;
40 matrix.setScale(SkScalarInvert(deviceScaleX), 40 matrix.setScale(SkScalarInvert(deviceScaleX),
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 private: 111 private:
112 typedef GM INHERITED; 112 typedef GM INHERITED;
113 }; 113 };
114 114
115 ////////////////////////////////////////////////////////////////////////////// 115 //////////////////////////////////////////////////////////////////////////////
116 116
117 static GM* MyFactory(void*) { return new ResizeGM; } 117 static GM* MyFactory(void*) { return new ResizeGM; }
118 static GMRegistry reg(MyFactory); 118 static GMRegistry reg(MyFactory);
119 119
120 } 120 }
OLDNEW
« no previous file with comments | « gm/pictureshadertile.cpp ('k') | gm/roundrects.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698