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

Side by Side Diff: gm/displacement.cpp

Issue 27391002: Fix Win warning-as-error. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 "SkDisplacementMapEffect.h" 9 #include "SkDisplacementMapEffect.h"
10 #include "SkBitmapSource.h" 10 #include "SkBitmapSource.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 } 58 }
59 } 59 }
60 } 60 }
61 61
62 virtual SkISize onISize() { 62 virtual SkISize onISize() {
63 return make_isize(500, 400); 63 return make_isize(500, 400);
64 } 64 }
65 65
66 void drawClippedBitmap(SkCanvas* canvas, int x, int y, const SkPaint& paint) { 66 void drawClippedBitmap(SkCanvas* canvas, int x, int y, const SkPaint& paint) {
67 canvas->save(); 67 canvas->save();
68 canvas->translate(x, y); 68 canvas->translate(SkIntToScalar(x), SkIntToScalar(y));
69 canvas->clipRect(SkRect::MakeWH(SkIntToScalar(fBitmap.width()), SkIntToS calar(fBitmap.height()))); 69 canvas->clipRect(SkRect::MakeWH(SkIntToScalar(fBitmap.width()), SkIntToS calar(fBitmap.height())));
70 canvas->drawBitmap(fBitmap, 0, 0, &paint); 70 canvas->drawBitmap(fBitmap, 0, 0, &paint);
71 canvas->restore(); 71 canvas->restore();
72 } 72 }
73 73
74 virtual void onDraw(SkCanvas* canvas) { 74 virtual void onDraw(SkCanvas* canvas) {
75 if (!fInitialized) { 75 if (!fInitialized) {
76 make_bitmap(); 76 make_bitmap();
77 make_checkerboard(); 77 make_checkerboard();
78 fInitialized = true; 78 fInitialized = true;
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 SkBitmap fBitmap, fCheckerboard; 181 SkBitmap fBitmap, fCheckerboard;
182 bool fInitialized; 182 bool fInitialized;
183 }; 183 };
184 184
185 ////////////////////////////////////////////////////////////////////////////// 185 //////////////////////////////////////////////////////////////////////////////
186 186
187 static GM* MyFactory(void*) { return new DisplacementMapGM; } 187 static GM* MyFactory(void*) { return new DisplacementMapGM; }
188 static GMRegistry reg(MyFactory); 188 static GMRegistry reg(MyFactory);
189 189
190 } 190 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698