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

Side by Side Diff: gm/ninepatchstretch.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/nested.cpp ('k') | gm/offsetimagefilter.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 2011 Google Inc. 2 * Copyright 2011 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 static void make_bitmap(SkBitmap* bitmap, SkIRect* center) { 10 static void make_bitmap(SkBitmap* bitmap, SkIRect* center) {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 protected: 46 protected:
47 virtual uint32_t onGetFlags() const SK_OVERRIDE { 47 virtual uint32_t onGetFlags() const SK_OVERRIDE {
48 return kSkipTiled_Flag; 48 return kSkipTiled_Flag;
49 } 49 }
50 50
51 virtual SkString onShortName() { 51 virtual SkString onShortName() {
52 return SkString("ninepatch-stretch"); 52 return SkString("ninepatch-stretch");
53 } 53 }
54 54
55 virtual SkISize onISize() { 55 virtual SkISize onISize() {
56 return make_isize(400, 400); 56 return SkISize::Make(400, 400);
57 } 57 }
58 58
59 virtual void onDraw(SkCanvas* canvas) { 59 virtual void onDraw(SkCanvas* canvas) {
60 SkBitmap bm; 60 SkBitmap bm;
61 SkIRect center; 61 SkIRect center;
62 make_bitmap(&bm, &center); 62 make_bitmap(&bm, &center);
63 63
64 // amount of bm that should not be stretched (unless we have to) 64 // amount of bm that should not be stretched (unless we have to)
65 const SkScalar fixed = SkIntToScalar(bm.width() - center.width()); 65 const SkScalar fixed = SkIntToScalar(bm.width() - center.width());
66 66
(...skipping 25 matching lines...) Expand all
92 private: 92 private:
93 typedef GM INHERITED; 93 typedef GM INHERITED;
94 }; 94 };
95 95
96 ////////////////////////////////////////////////////////////////////////////// 96 //////////////////////////////////////////////////////////////////////////////
97 97
98 static GM* MyFactory(void*) { return new NinePatchStretchGM; } 98 static GM* MyFactory(void*) { return new NinePatchStretchGM; }
99 static GMRegistry reg(MyFactory); 99 static GMRegistry reg(MyFactory);
100 100
101 } 101 }
OLDNEW
« no previous file with comments | « gm/nested.cpp ('k') | gm/offsetimagefilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698