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

Side by Side Diff: gm/bitmapshader.cpp

Issue 209893004: Fix 10.6 build: double -> float. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 9 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 | « 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 /* 2 /*
3 * Copyright 2013 Google Inc. 3 * Copyright 2013 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 #include "gm.h" 8 #include "gm.h"
9 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 return SkISize::Make(150, 100); 59 return SkISize::Make(150, 100);
60 } 60 }
61 61
62 virtual void onDraw(SkCanvas* canvas) { 62 virtual void onDraw(SkCanvas* canvas) {
63 SkPaint paint; 63 SkPaint paint;
64 64
65 for (int i = 0; i < 2; i++) { 65 for (int i = 0; i < 2; i++) {
66 SkMatrix s; 66 SkMatrix s;
67 s.reset(); 67 s.reset();
68 if (1 == i) { 68 if (1 == i) {
69 s.setScale(1.5, 1.5); 69 s.setScale(1.5f, 1.5f);
70 s.postTranslate(2, 2); 70 s.postTranslate(2, 2);
71 } 71 }
72 72
73 canvas->save(); 73 canvas->save();
74 adopt_shader(&paint, SkShader::CreateBitmapShader(fBitmap, SkShader: :kClamp_TileMode, 74 adopt_shader(&paint, SkShader::CreateBitmapShader(fBitmap, SkShader: :kClamp_TileMode,
75 SkShader::kClamp_T ileMode), s); 75 SkShader::kClamp_T ileMode), s);
76 76
77 // draw the shader with a bitmap mask 77 // draw the shader with a bitmap mask
78 canvas->drawBitmap(fMask, 0, 0, &paint); 78 canvas->drawBitmap(fMask, 0, 0, &paint);
79 canvas->drawBitmap(fMask, 30, 0, &paint); 79 canvas->drawBitmap(fMask, 30, 0, &paint);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 111
112 typedef GM INHERITED; 112 typedef GM INHERITED;
113 }; 113 };
114 114
115 ////////////////////////////////////////////////////////////////////////////// 115 //////////////////////////////////////////////////////////////////////////////
116 116
117 static GM* MyFactory(void*) { return new BitmapShaderGM; } 117 static GM* MyFactory(void*) { return new BitmapShaderGM; }
118 static GMRegistry reg(MyFactory); 118 static GMRegistry reg(MyFactory);
119 119
120 } 120 }
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