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

Side by Side Diff: gm/imageresizetiled.cpp

Issue 281383013: skiagm::make_isize -> SkISize::Make (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 7 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/imagemagnifier.cpp ('k') | gm/internal_links.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 "SkMatrixImageFilter.h" 9 #include "SkMatrixImageFilter.h"
10 #include "SkRandom.h" 10 #include "SkRandom.h"
11 11
12 #define WIDTH 640 12 #define WIDTH 640
13 #define HEIGHT 480 13 #define HEIGHT 480
14 14
15 #define RESIZE_FACTOR SkIntToScalar(2) 15 #define RESIZE_FACTOR SkIntToScalar(2)
16 16
17 namespace skiagm { 17 namespace skiagm {
18 18
19 class ImageResizeTiledGM : public GM { 19 class ImageResizeTiledGM : public GM {
20 public: 20 public:
21 ImageResizeTiledGM() { 21 ImageResizeTiledGM() {
22 } 22 }
23 23
24 protected: 24 protected:
25 virtual SkString onShortName() SK_OVERRIDE { 25 virtual SkString onShortName() SK_OVERRIDE {
26 return SkString("imageresizetiled"); 26 return SkString("imageresizetiled");
27 } 27 }
28 28
29 virtual SkISize onISize() SK_OVERRIDE { 29 virtual SkISize onISize() SK_OVERRIDE {
30 return make_isize(WIDTH, HEIGHT); 30 return SkISize::Make(WIDTH, HEIGHT);
31 } 31 }
32 32
33 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { 33 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE {
34 SkPaint paint; 34 SkPaint paint;
35 SkMatrix matrix; 35 SkMatrix matrix;
36 matrix.setScale(RESIZE_FACTOR, RESIZE_FACTOR); 36 matrix.setScale(RESIZE_FACTOR, RESIZE_FACTOR);
37 SkAutoTUnref<SkImageFilter> imageFilter( 37 SkAutoTUnref<SkImageFilter> imageFilter(
38 SkMatrixImageFilter::Create(matrix, SkPaint::kNone_FilterLevel)); 38 SkMatrixImageFilter::Create(matrix, SkPaint::kNone_FilterLevel));
39 paint.setImageFilter(imageFilter.get()); 39 paint.setImageFilter(imageFilter.get());
40 const SkScalar tile_size = SkIntToScalar(100); 40 const SkScalar tile_size = SkIntToScalar(100);
(...skipping 29 matching lines...) Expand all
70 70
71 private: 71 private:
72 typedef GM INHERITED; 72 typedef GM INHERITED;
73 }; 73 };
74 74
75 ////////////////////////////////////////////////////////////////////////////// 75 //////////////////////////////////////////////////////////////////////////////
76 76
77 DEF_GM(return new ImageResizeTiledGM(); ) 77 DEF_GM(return new ImageResizeTiledGM(); )
78 78
79 } 79 }
OLDNEW
« no previous file with comments | « gm/imagemagnifier.cpp ('k') | gm/internal_links.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698