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

Side by Side Diff: gm/lightingshader.cpp

Issue 1276133002: Fix warnings on VS2015 x86_64 build (Closed) Base URL: https://skia.googlesource.com/skia.git@didSetPipeline
Patch Set: tabs- Created 5 years, 4 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 | gyp/zlib.gyp » ('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 2015 Google Inc. 2 * Copyright 2015 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 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 20 matching lines...) Expand all
31 for (int x = 0; x < texSize; ++x) { 31 for (int x = 0; x < texSize; ++x) {
32 SkScalar locX = (x + 0.5f - texSize/2.0f) / (texSize/2.0f); 32 SkScalar locX = (x + 0.5f - texSize/2.0f) / (texSize/2.0f);
33 SkScalar locY = (y + 0.5f - texSize/2.0f) / (texSize/2.0f); 33 SkScalar locY = (y + 0.5f - texSize/2.0f) / (texSize/2.0f);
34 34
35 SkScalar locZ = locX * locX + locY * locY; 35 SkScalar locZ = locX * locX + locY * locY;
36 if (locZ >= 1.0f) { 36 if (locZ >= 1.0f) {
37 locX = 0.0f; 37 locX = 0.0f;
38 locY = 0.0f; 38 locY = 0.0f;
39 locZ = 0.0f; 39 locZ = 0.0f;
40 } 40 }
41 locZ = sqrt(1.0f - locZ); 41 locZ = sqrtf(1.0f - locZ);
42 unsigned char r = static_cast<unsigned char>((0.5f * locX + 0.5f) * 255); 42 unsigned char r = static_cast<unsigned char>((0.5f * locX + 0.5f) * 255);
43 unsigned char g = static_cast<unsigned char>((-0.5f * locY + 0.5f) * 255); 43 unsigned char g = static_cast<unsigned char>((-0.5f * locY + 0.5f) * 255);
44 unsigned char b = static_cast<unsigned char>((0.5f * locZ + 0.5f) * 255); 44 unsigned char b = static_cast<unsigned char>((0.5f * locZ + 0.5f) * 255);
45 *hemi.getAddr32(x, y) = SkPackARGB32(0xFF, r, g, b); 45 *hemi.getAddr32(x, y) = SkPackARGB32(0xFF, r, g, b);
46 } 46 }
47 } 47 }
48 48
49 return hemi; 49 return hemi;
50 } 50 }
51 51
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 SkColor3f fAmbient; 174 SkColor3f fAmbient;
175 175
176 typedef GM INHERITED; 176 typedef GM INHERITED;
177 }; 177 };
178 178
179 ////////////////////////////////////////////////////////////////////////////// 179 //////////////////////////////////////////////////////////////////////////////
180 180
181 DEF_GM( return SkNEW(LightingShaderGM); ) 181 DEF_GM( return SkNEW(LightingShaderGM); )
182 182
183 } 183 }
OLDNEW
« no previous file with comments | « no previous file | gyp/zlib.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698